From 06f6e299729a63e93391fc9c0ed6f912c992b9e1 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Fri, 1 Nov 2024 14:15:56 +0800 Subject: [PATCH] 241101 --- .env.development | 4 +- src/api/think/thinkCard/index.ts | 10 + src/api/think/thinkOrder/index.ts | 12 +- src/api/think/thinkUsers/index.ts | 138 +- src/api/think/thinkUsersVip/index.ts | 11 +- src/api/think/thinkVip/index.ts | 10 + src/package/booking/checkout.vue | 149 +- src/package/booking/confirm.vue | 1467 ++++++++--------- src/package/booking/index.vue | 2 +- src/package/card/checkout.vue | 1057 ++++++------ src/package/card/index.vue | 692 ++++---- src/package/order/detail.vue | 642 ++++---- src/package/order/vipDetail.vue | 335 ++++ src/package/user/card.vue | 745 +++++---- src/package/user/personal.vue | 12 +- src/pages.json | 6 + src/pages/index.vue | 60 +- src/pages/order.vue | 391 +++-- .../ws-login/components/ws-login/ws-login.vue | 73 +- .../components/ws-user-card/ws-user-card.vue | 3 - 20 files changed, 3104 insertions(+), 2715 deletions(-) create mode 100644 src/package/order/vipDetail.vue diff --git a/.env.development b/.env.development index 749b540..8d10c2e 100644 --- a/.env.development +++ b/.env.development @@ -1,9 +1,9 @@ VITE_APP_NAME=后台管理系统 VITE_SOCKET_URL=wss://server.gxwebsoft.com VITE_SERVER_URL=https://server.gxwebsoft.com/api -#VITE_THINK_URL=https://gxtyzx-api.websoft.top/api VITE_API_URL=https://modules.gxwebsoft.com/api +VITE_THINK_URL=https://gxtyzx-api.websoft.top/api #VITE_SERVER_URL=http://127.0.0.1:9090/api #VITE_API_URL=http://127.0.0.1:9099/api -VITE_THINK_URL=http://127.0.0.1:9099/api +#VITE_THINK_URL=http://127.0.0.1:9099/api diff --git a/src/api/think/thinkCard/index.ts b/src/api/think/thinkCard/index.ts index 50865eb..b384b09 100644 --- a/src/api/think/thinkCard/index.ts +++ b/src/api/think/thinkCard/index.ts @@ -35,6 +35,16 @@ export async function listThinkCard(params?: ThinkCardParam) { return Promise.reject(new Error(res.data.message)); } +export async function listUserThinkCard() { + const res = await request.post>( + THINK_API_URL + '/think/think-card/user-card' + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + /** * 添加 */ diff --git a/src/api/think/thinkOrder/index.ts b/src/api/think/thinkOrder/index.ts index 9b5d116..cedb117 100644 --- a/src/api/think/thinkOrder/index.ts +++ b/src/api/think/thinkOrder/index.ts @@ -44,7 +44,7 @@ export async function addThinkOrder(data: ThinkOrder) { data ); if (res.data.code === 0) { - return res.data.message; + return res.data.data; } return Promise.reject(new Error(res.data.message)); } @@ -104,3 +104,13 @@ export async function getThinkOrder(id: number) { } return Promise.reject(new Error(res.data.message)); } + +export async function thinkOrderRepay(data: ThinkOrder) { + const res = await request.post>( + THINK_API_URL + '/think/think-order/repay', data + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/think/thinkUsers/index.ts b/src/api/think/thinkUsers/index.ts index dbaa46d..96d551c 100644 --- a/src/api/think/thinkUsers/index.ts +++ b/src/api/think/thinkUsers/index.ts @@ -1,115 +1,123 @@ import request from '@/utils/request'; -import type { ApiResult, PageResult } from '@/api'; -import type { ThinkUsers, ThinkUsersParam } from './model'; -import { THINK_API_URL } from '@/config/setting'; +import type {ApiResult, PageResult} from '@/api'; +import type {ThinkUsers, ThinkUsersParam} from './model'; +import {THINK_API_URL} from '@/config/setting'; // 微信小程序登录 export async function loginByOpenId(data: any) { - const res = await request.post>(THINK_API_URL + '/think/think-users/loginByOpenId', data); - if (res.data.code === 0) { - return res.data.data; - } - return Promise.reject(new Error(res.data.message)); + const res = await request.post>(THINK_API_URL + '/think/think-users/loginByOpenId', data); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +export async function thinkUserInfo() { + const res = await request.post>(THINK_API_URL + '/think/think-users/info'); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); } /** * 分页查询 */ export async function pageThinkUsers(params: ThinkUsersParam) { - const res = await request.get>>( - THINK_API_URL + '/think/think-users/page', - { - params + const res = await request.get>>( + THINK_API_URL + '/think/think-users/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; } - ); - if (res.data.code === 0) { - return res.data.data; - } - return Promise.reject(new Error(res.data.message)); + return Promise.reject(new Error(res.data.message)); } /** * 查询列表 */ export async function listThinkUsers(params?: ThinkUsersParam) { - const res = await request.get>( - THINK_API_URL + '/think/think-users', - { - params + const res = await request.get>( + THINK_API_URL + '/think/think-users', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; } - ); - if (res.data.code === 0 && res.data.data) { - return res.data.data; - } - return Promise.reject(new Error(res.data.message)); + return Promise.reject(new Error(res.data.message)); } /** * 添加 */ export async function addThinkUsers(data: ThinkUsers) { - const res = await request.post>( - THINK_API_URL + '/think/think-users', - data - ); - if (res.data.code === 0) { - return res.data.message; - } - return Promise.reject(new Error(res.data.message)); + const res = await request.post>( + THINK_API_URL + '/think/think-users', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); } /** * 修改 */ export async function updateThinkUsers(data: ThinkUsers) { - const res = await request.put>( - THINK_API_URL + '/think/think-users', - data - ); - if (res.data.code === 0) { - return res.data.message; - } - return Promise.reject(new Error(res.data.message)); + const res = await request.put>( + THINK_API_URL + '/think/think-users', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); } /** * 删除 */ export async function removeThinkUsers(id?: number) { - const res = await request.delete>( - THINK_API_URL + '/think/think-users/' + id - ); - if (res.data.code === 0) { - return res.data.message; - } - return Promise.reject(new Error(res.data.message)); + const res = await request.delete>( + THINK_API_URL + '/think/think-users/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); } /** * 批量删除 */ export async function removeBatchThinkUsers(data: (number | undefined)[]) { - const res = await request.delete>( - THINK_API_URL + '/think/think-users/batch', - { - data + const res = await request.delete>( + THINK_API_URL + '/think/think-users/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; } - ); - if (res.data.code === 0) { - return res.data.message; - } - return Promise.reject(new Error(res.data.message)); + return Promise.reject(new Error(res.data.message)); } /** * 根据id查询 */ export async function getThinkUsers(id: number) { - const res = await request.get>( - THINK_API_URL + '/think/think-users/' + id - ); - if (res.data.code === 0 && res.data.data) { - return res.data.data; - } - return Promise.reject(new Error(res.data.message)); + const res = await request.get>( + THINK_API_URL + '/think/think-users/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); } diff --git a/src/api/think/thinkUsersVip/index.ts b/src/api/think/thinkUsersVip/index.ts index 8f3b574..5f60760 100644 --- a/src/api/think/thinkUsersVip/index.ts +++ b/src/api/think/thinkUsersVip/index.ts @@ -44,7 +44,7 @@ export async function addThinkUsersVip(data: ThinkUsersVip) { data ); if (res.data.code === 0) { - return res.data.message; + return res.data.data; } return Promise.reject(new Error(res.data.message)); } @@ -104,3 +104,12 @@ export async function getThinkUsersVip(id: number) { } return Promise.reject(new Error(res.data.message)); } +export async function thinkUsersVipRepay(data: any) { + const res = await request.post>( + THINK_API_URL + '/think/think-users-vip/repay', data + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/think/thinkVip/index.ts b/src/api/think/thinkVip/index.ts index e1b36ae..cfd3df6 100644 --- a/src/api/think/thinkVip/index.ts +++ b/src/api/think/thinkVip/index.ts @@ -104,3 +104,13 @@ export async function getThinkVip(id: number) { } return Promise.reject(new Error(res.data.message)); } + +export async function listThinkVipByGroup(data: ThinkVip) { + const res = await request.post>( + THINK_API_URL + '/think/think-vip/list-by-group', data + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/package/booking/checkout.vue b/src/package/booking/checkout.vue index acfefd9..a1873b9 100644 --- a/src/package/booking/checkout.vue +++ b/src/package/booking/checkout.vue @@ -33,16 +33,16 @@ @@ -78,7 +78,7 @@ :endVal="totalPrice"> @@ -291,11 +291,11 @@ export default { onType(e) { const index = e.currentIndex if (index === 0) { - this.type = 0; + this.type = 1; this.isHalf = 0; } if (index === 1) { - this.type = 1; + this.type = 2; this.isHalf = 1; } this.reload() @@ -303,9 +303,9 @@ export default { async getMerchant() { this.merchant = await getThinkSite(this.merchantId) }, - async getFieldList(){ + async getFieldList() { if (!this.periodList.length) { - uni.showToast({ + return uni.showToast({ title: '暂无可预订场地', icon: 'none' }) @@ -315,14 +315,14 @@ export default { const timestamp = dayjs(this.dateTime + ' ' + item.timePeriod.split(' - ')[0]).unix() periodVoList.push({ timestamp, - period: item.timePeriod + period: item.timePeriod, + id: item.id }) }) - const res = await listThinkFieldWithTimeList({ + this.fieldList = await listThinkFieldWithTimeList({ sid: this.merchantId, periodVoList }) - console.log(res) }, getBookingPeriod() { const { @@ -379,9 +379,9 @@ export default { closeCarInfo() { this.$refs.popup.close() }, - onField(item, period) { + onField(field, item) { // 已被预定 - if (item.sold) { + if (field.sold) { return } const app = this @@ -390,7 +390,7 @@ export default { // const p = this.periodList[i] // 场地 // const f = this.fieldList[i2] - const key = getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`) + const key = getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${field.id}`) const index = app.selection.findIndex(d => d.key === key) if (index >= 0) { app.selection.splice(index, 1) @@ -402,80 +402,52 @@ export default { }) return false } - // 计算订单总金额 - // let totalPrice = 0 - // app.selection.map(d => { - // console.log(d); - // totalPrice = totalPrice + d.totalPrice - // }) - const split = item.timePeriod.split('-') - // console.log('aaaaaaaaa',{ - // key, - // merchantId: this.merchantId, - // merchantCode: this.merchantCode, - // fieldId: item.fieldId, - // fieldName: item.fieldName, - // price: item.price, - // merchantName: this.merchantName, - // isChildren: item.isChildren, - // isHalf: this.type, - // timePeriod: item.timePeriod, - // periodId: item.periodId, - // startTime: `${split[0].trim()}:00`, - // endTime: `${split[1].trim()}:00`, - // orderCode: key, - // dateTime: `${this.dateTime}`, - // comments: `${this.dateTime} (${getWeek(this.week)}) ${item.timePeriod}`, - // }); + const split = item.timePeriod.split(' - ') + const siteTime = field.periodVoList.find(d => d.period === item.timePeriod) // 添加到购物车 + const week = parseInt(this.week) === 7 ? 0 : this.week app.selection.push({ key, - merchantId: this.merchantId, - merchantCode: merchant.merchantCode, - fieldId: item.fieldId, - fieldName: item.fieldName, + sid: this.merchantId, + fieldId: field.id, + fieldName: field.name, price: item.price, - childrenPrice: period.childrenPrice, + childrenPrice: item.childrenPrice, adultNum: 1, childrenNum: 0, - merchantName: merchant.merchantName, + siteName: merchant.name, isChildren: item.isChildren, - isHalf: this.type, + isHalf: this.isHalf, + type: this.type, timePeriod: item.timePeriod, periodId: item.periodId, - startTime: `${split[0].trim()}:00`, + startTime: dayjs(`${this.dateTime} ${split[0].trim()}`).unix(), endTime: `${split[1].trim()}:00`, orderCode: key, + siteTimeId: siteTime.id, dateTime: `${this.dateTime}`, - comments: `${this.dateTime} (${getWeek(this.week)}) ${item.timePeriod}`, + comments: `${this.dateTime}(${getWeek(week)})${item.timePeriod}`, }) console.log(app.selection); - console.log('period: ', period); + // console.log('period: ', period); // 是否支持儿童票 - console.log('item.isChildren: ', item.isChildren); - if (item.isChildren === 1) { - console.log('item.isChildren2: ', item.isChildren); - carStore.childrenPrice = period.childrenPrice - } else { - carStore.childrenPrice = 0 - } - carStore.orderInfo = app.selection - carStore.carNum = app.selection.length - carStore.totalPrice = totalPrice - carStore.payPrice = totalPrice - carStore.setPeriod(period) + // console.log('item.isChildren: ', item.isChildren); + // if (item.isChildren === 1) { + // console.log('item.isChildren2: ', item.isChildren); + // carStore.childrenPrice = period.childrenPrice + // } else { + // carStore.childrenPrice = 0 + // } + // carStore.orderInfo = app.selection + // carStore.carNum = app.selection.length + // carStore.totalPrice = totalPrice + // carStore.payPrice = totalPrice + // carStore.setPeriod(period) } }, - getStratTime(value) { - const split = value.split('-') - const timeText = split[0].replace(' ', '') - const startTime = new Date(`${this.dateTime} ${timeText}:00`).getTime() - return startTime / 1000 || 0; - }, - - isActive(item) { - const index = this.selection.find(d => d.key === getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`)) + isActive(field, item) { + const index = this.selection.find(d => d.key === getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${field.id}`)) if (item.sold) { if (item.isHalf === 1) { return 'web-bg-warning' @@ -486,30 +458,17 @@ export default { return 'active web-bg-success' } }, - - // isActive(text,item) { - // const index = this.selection.find(d => d.key == getKey(text)) - // if(item.sold){ - // if(item.isHalf == 1){ - // return 'web-bg-warning' - // } - // return 'web-bg-info' - // } - // if (index) { - // return 'active web-bg-success' - // } - // }, remove(item) { const index = this.selection.findIndex(d => d.key === item.key) this.selection.splice(index, 1) carStore.orderInfo = this.selection }, save() { - const { - selection - } = this - uni.$uv.route({ - url: '/package/booking/confirm' + uni.navigateTo({ + url: '/package/booking/confirm', + success: (res) => { + res.eventChannel.emit('data', this.selection) + } }) } diff --git a/src/package/booking/confirm.vue b/src/package/booking/confirm.vue index 5f1d86d..bd61fe3 100644 --- a/src/package/booking/confirm.vue +++ b/src/package/booking/confirm.vue @@ -1,170 +1,161 @@ diff --git a/src/package/booking/index.vue b/src/package/booking/index.vue index ac6813e..c247a57 100644 --- a/src/package/booking/index.vue +++ b/src/package/booking/index.vue @@ -152,7 +152,7 @@ export default { }) }, async getDuration() { - let url = `http://api.tianditu.gov.cn/drive?postStr={"orig":"${this.lng},${this.lat}","dest":"${this.merchant.lng},${this.merchant.lat}","style":"0"}&type=search&tk=71f234f251d4cb1feeb3c293a0f21709` + let url = `https://api.tianditu.gov.cn/drive?postStr={"orig":"${this.lng},${this.lat}","dest":"${this.merchant.lng},${this.merchant.lat}","style":"0"}&type=search&tk=71f234f251d4cb1feeb3c293a0f21709` const res = await request.get(url) const x2js = new X2js(); const {result} = x2js.xml2js(res.data) diff --git a/src/package/card/checkout.vue b/src/package/card/checkout.vue index 326aa78..c28579e 100644 --- a/src/package/card/checkout.vue +++ b/src/package/card/checkout.vue @@ -1,635 +1,556 @@ diff --git a/src/package/card/index.vue b/src/package/card/index.vue index 4710579..864b0cf 100644 --- a/src/package/card/index.vue +++ b/src/package/card/index.vue @@ -1,415 +1,385 @@ diff --git a/src/package/order/detail.vue b/src/package/order/detail.vue index ecfaa8c..a994476 100644 --- a/src/package/order/detail.vue +++ b/src/package/order/detail.vue @@ -1,400 +1,376 @@ diff --git a/src/package/order/vipDetail.vue b/src/package/order/vipDetail.vue new file mode 100644 index 0000000..497f6fa --- /dev/null +++ b/src/package/order/vipDetail.vue @@ -0,0 +1,335 @@ + + + + + diff --git a/src/package/user/card.vue b/src/package/user/card.vue index b9850cd..3315f1b 100644 --- a/src/package/user/card.vue +++ b/src/package/user/card.vue @@ -1,423 +1,440 @@ diff --git a/src/package/user/personal.vue b/src/package/user/personal.vue index 27fffa8..3ad5a9e 100644 --- a/src/package/user/personal.vue +++ b/src/package/user/personal.vue @@ -106,11 +106,12 @@ const app = this // 当前登录用户信息 const userInfo = await userStore.fetchUserInfo(); + this.userInfo = userInfo if (Object.keys(userInfo).length > 0) { app.isLogin = true app.form = userInfo // 获取用户副表信息 - UserApi.getThinkUsers(uni.getStorageSync('uid')).then(data => { + UserApi.getThinkUsers(userInfo.uid).then(data => { if (data) { app.form = Object.assign({}, app.form, data); } @@ -159,8 +160,13 @@ }) return false } - - UserApi.updateThinkUsers(this.form).then(res => { + const formData = { + id: this.form.id, + idcard: this.form.idcard, + truename: this.form.truename, + userId: this.userInfo.userId + } + UserApi.updateThinkUsers(formData).then(res => { uni.showToast({ title: '保存成功', icon: 'success' diff --git a/src/pages.json b/src/pages.json index 2f1ea5c..d8be5db 100644 --- a/src/pages.json +++ b/src/pages.json @@ -284,6 +284,12 @@ "navigationBarTitleText": "订单详情" } }, + { + "path": "order/vipDetail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, { "path": "course/index", "style": { diff --git a/src/pages/index.vue b/src/pages/index.vue index 7e855e5..64d5330 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -34,36 +34,36 @@ - 热门项目 - - - - - - - {{ item.name }} - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 场地预定 diff --git a/src/pages/order.vue b/src/pages/order.vue index 279bf34..23a3ee9 100644 --- a/src/pages/order.vue +++ b/src/pages/order.vue @@ -1,21 +1,38 @@ @@ -108,6 +148,9 @@ import { getWeek, getKey } from '@/utils/common'; +import {pageThinkOrder, thinkOrderRepay} from "@/api/think/thinkOrder"; +import {pageThinkUsersVip, thinkUsersVipRepay, updateThinkUsersVip} from "@/api/think/thinkUsersVip"; +import {pageThinkDeposit} from "@/api/think/thinkDeposit"; export default { components: {}, @@ -142,17 +185,45 @@ export default { styleType: 'text', getWeek, // 骨架屏 - hideTools: true + hideTools: true, + orderTypeStr: '订场订单', + orderType: 0, + orderTypeList: [ + { + label: '订场订单', + value: 0 + }, + { + label: '会员卡订单', + value: 1 + }, + { + label: '押金', + value: 2 + }, + ], + orderStatusList: [ + { + label: '未支付', + value: 2 + }, + { + label: '已支付', + value: 1 + } + ], + orderStatusStr: '全部状态', + orderStatus: null, } }, - async onLoad(option) { - this.userId = await uni.getStorageSync('user_id') - // 加载数据 - await this.reload() - // if(option.isRefresh){ - // this.isRefresh = true - // } - }, + // async onLoad(option) { + // this.userId = await uni.getStorageSync('user_id') + // // 加载数据 + // await this.reload() + // // if(option.isRefresh){ + // // this.isRefresh = true + // // } + // }, async onShow(e) { this.userId = await uni.getStorageSync('user_id') await this.reload() @@ -163,60 +234,72 @@ export default { const { where } = this + console.log(app.canReset) if (app.canReset) { - app.where.page = ++where.page; - app.reload() + app.where.page += 1; + app.getOrderList() } }, methods: { - async reload() { - const app = this - const { where } = this - const uid = uni.getStorageSync('uid') - if (!uid) { - app.orderList = []; - app.loadMore = 'no-more' - return; + openOrderTypePicker() { + this.$refs.orderTypePicker.open() + }, + openOrderStatusPicker() { + this.$refs.orderStatusPicker.open() + }, + confirmOrderType({value}) { + this.orderType = value[0].value + this.orderTypeStr = value[0].label + this.reload() + }, + confirmOrderStatus({value}) { + if (this.orderType === 0) { + this.where.payStatus = value[0].value + } else if (this.orderType === 1) { + this.where.status = value[0].value + } else if (this.orderType === 2) { + this.where.status = value[0].value + } + this.orderStatus = value[0].value + this.orderStatusStr = value[0].label + this.reload() + }, + async reload() { + this.loadMore = 'loading' + this.where.page = 1 + this.orderList = [] + this.$refs.orderTypePicker.close() + await this.getOrderList() + }, + async getOrderList() { + let res + if (this.orderType === 0) res = await pageThinkOrder(this.where) + else if (this.orderType === 1) res = await pageThinkUsersVip(this.where) + else if (this.orderType === 2) res = await pageThinkDeposit(this.where) + + if (this.orderList.length < res.count) { + this.orderList = this.orderList.concat(res.list) + this.canReset = true + this.loadMore = 'no-more' + } else { + this.canReset = false; + this.loadMore = 'no-more' } - where.uid = uid; - app.loadMore = 'loading' - OrderApi.pageThinkOrder(where).then(res => { - const list = res.list.map(d => { - return d; - }); - if (app.orderList.length < res.count) { - app.orderList = app.orderList.concat(list) - app.canReset = true - app.loadMore = 'no-more' - } else { - app.canReset = false; - app.loadMore = 'no-more' - } - uni.hideLoading() - app.isRefresh = false - }).catch(() => { - uni.showToast({ - title: '请检查您的网络.', - icon: 'none' - }) - uni.hideLoading() - app.isRefresh = false - }) }, async onClickItem(e) { const app = this - this.uid = await uni.getStorageSync('uid') + // this.uid = await uni.getStorageSync('uid') const { where, - uid + // uid } = this - if (app.uid === 0 || !app.uid) { - console.log(app.uid,'>>>>>>>2',app.uid) - app.orderList = []; - app.loadMore = 'no-more' - return; - } + // if (app.uid === 0 || !app.uid) { + // console.log(app.uid, '>>>>>>>2', app.uid) + // app.orderList = []; + // app.loadMore = 'no-more' + // return; + // } const index = e.currentIndex if (this.current !== e.currentIndex) { @@ -243,18 +326,18 @@ export default { where.orderStatus = 1; } // 押金 - if (index === 4) { - pageThinkWechatDeposit({ - uid: uni.getStorageSync('user_id') - }).then(res => { - app.orderList = res.list; - if (res.count === 0) { - app.loadMore = 'no-more' - } - uni.hideLoading() - }) - return false - } + // if (index === 4) { + // pageThinkWechatDeposit({ + // uid: uni.getStorageSync('user_id') + // }).then(res => { + // app.orderList = res.list; + // if (res.count === 0) { + // app.loadMore = 'no-more' + // } + // uni.hideLoading() + // }) + // return false + // } this.where.page = 1; this.orderList = []; this.reload() @@ -312,6 +395,82 @@ export default { uni.navigateTo({ url: `/package/user/invoice-show?id=${id}` }) + }, + async closeVipOrder({id}) { + await updateThinkUsersVip({id, status: 0}) + await uni.showToast({ + title: '取消成功', + icon: 'none' + }) + await this.reload() + }, + toDetail(id) { + let url + if (this.orderType === 0) url = `/package/order/detail?id=${id}` + else if (this.orderType === 1) url = `/package/order/vipDetail?id=${id}` + else if (this.orderType === 2) url = `/package/order/detail?id=${id}` + uni.navigateTo({url}) + }, + async openPay(id) { + const orderInfo = await thinkUsersVipRepay({id}) + const _this = this + uni.requestPayment({ + provider: orderInfo.provider, // 服务提供商 + timeStamp: orderInfo.timeStamp, // 时间戳 + nonceStr: orderInfo.nonceStr, // 随机字符串 + package: orderInfo.package, + signType: orderInfo.signType, // 签名算法 + paySign: orderInfo.paySign, // 签名 + success: function (res) { + // 业务逻辑。。。 + uni.showToast({ + title: '支付成功', + icon: 'success' + }); + setTimeout(function () { + _this.reload() + }, 1500); + }, + fail: function (err) { + console.log('支付失败', err); + } + }) + }, + async openPayOrder(id) { + const orderInfo = await thinkOrderRepay({id}) + const _this = this + uni.requestPayment({ + provider: orderInfo.provider, // 服务提供商 + timeStamp: orderInfo.timeStamp, // 时间戳 + nonceStr: orderInfo.nonceStr, // 随机字符串 + package: orderInfo.package, + signType: orderInfo.signType, // 签名算法 + paySign: orderInfo.paySign, // 签名 + success: function (res) { + // 业务逻辑。。。 + uni.showToast({ + title: '支付成功', + icon: 'success' + }); + setTimeout(function () { + _this.reload() + }, 1500); + }, + fail: function (err) { + console.log('支付失败', err); + } + }) + }, + reset(){ + this.where = { + page: 1 + } + this.orderList = [] + this.orderType = 0 + this.orderTypeStr = '订场订单' + this.orderStatus = null + this.orderStatusStr = '全部状态' + this.reload() } } } diff --git a/src/uni_modules/ws-login/components/ws-login/ws-login.vue b/src/uni_modules/ws-login/components/ws-login/ws-login.vue index b16e3a7..90266cb 100644 --- a/src/uni_modules/ws-login/components/ws-login/ws-login.vue +++ b/src/uni_modules/ws-login/components/ws-login/ws-login.vue @@ -24,7 +24,7 @@