From e0ba4f5d5b532517793483b9fe5577ce960893e0 Mon Sep 17 00:00:00 2001 From: zpc Date: Sun, 28 Sep 2025 00:13:15 +0800 Subject: [PATCH] 32 --- common/env.js | 8 +- common/server/interface/common.js | 14 +- common/server/interface/sq.js | 62 +++- common/system/router.js | 3 +- components.d.ts | 1 + components/com/index/ReservationPopup.vue | 95 ++++-- components/com/page/container-base.vue | 9 +- components/com/page/qiandao-popup.vue | 329 +++++++++++++++++++ components/com/page/reservation-evaluate.vue | 6 +- components/com/page/reservation-item.vue | 61 +++- components/index/MahjongCard.vue | 8 +- manifest.json | 2 +- pages.json | 12 + pages/appointment/appointment-page.vue | 30 +- pages/index/index.vue | 8 +- pages/me/me-page.vue | 247 ++++---------- pages/me/my-record.vue | 3 +- pages/other/agreement.vue | 21 +- pages/other/faq.vue | 232 +++++++++++++ pages/other/payment-records.vue | 194 +++++++++++ 20 files changed, 1101 insertions(+), 244 deletions(-) create mode 100644 components/com/page/qiandao-popup.vue create mode 100644 pages/other/faq.vue create mode 100644 pages/other/payment-records.vue diff --git a/common/env.js b/common/env.js index cea7457..357a4ca 100644 --- a/common/env.js +++ b/common/env.js @@ -6,11 +6,11 @@ // 开发环境配置 const development = { // API基础URL - // baseUrl: 'https://ydsapi.zpc-xy.com', + baseUrl: 'https://sqqp.zpc-xy.com', // baseUrl: 'http://1.15.21.245:2401', - // host: ['http://1.15.21.245:2401'], - baseUrl: 'http://localhost:2015', - host: ['http://localhost:2015'], + host: ['https://sqqp.zpc-xy.com'], + // baseUrl: 'http://192.168.1.21:2016', + // host: ['http://192.168.1.21:2016'], imageUrl: 'https://guyu-1308826010.cos.ap-shanghai.myqcloud.com', }; diff --git a/common/server/interface/common.js b/common/server/interface/common.js index e749607..fd10550 100644 --- a/common/server/interface/common.js +++ b/common/server/interface/common.js @@ -23,7 +23,7 @@ export const getConfig = async () => { } return null; } - + /** * 接口测试反馈 * @returns {Promise} @@ -36,6 +36,18 @@ export const interFaceTest = async () => { return null; } +/** + * 获取服务与说明数据 + * @returns {Promise} + */ +export const getServiceDescription = async () => { + const res = await request.post("Common/GetServiceDescription"); + if (res.code == 0) { + return res.data; + } + return null; +} + /** * 上传附件通用接口 * @param {FormData} formData 上传的表单数据 diff --git a/common/server/interface/sq.js b/common/server/interface/sq.js index d979f78..3c07636 100644 --- a/common/server/interface/sq.js +++ b/common/server/interface/sq.js @@ -1,5 +1,21 @@ import request from '@/common/system/request'; +/** + * 用户是否可以创建预约(仅校验,不创建) + * @param {Object} reservationData 创建预约所需参数 + * @returns {Promise<{canCreate:boolean,message?:string,code?:number}>} + */ +export const canCreateSQReservation = async (reservationData) => { + const res = await request.post("sq/CanCreateSQReservation", reservationData); + if (res && typeof res.code !== 'undefined') { + if (res.code === 0) { + return { canCreate: true, code: 0 }; + } + return { canCreate: false, message: res.msg || '不可创建', code: res.code }; + } + return { canCreate: false, message: '网络异常', code: 500 }; +} + /** * 获取预约记录 * @param {number} index @@ -95,6 +111,23 @@ export const getReputationByUser = async (pageIndex = 1, pageSize = 20) => { return null; } +/** + * 获取支付记录 + * @param {number} pageIndex 起始页 + * @param {number} pageSize 页大小 + * @returns {Promise} 返回支付记录数据 + */ +export const getPaymentRecords = async (pageIndex = 1, pageSize = 20) => { + const res = await request.get("sq/GetPaymentRecords", { + pageIndex: pageIndex, + pageSize: pageSize + }); + if (res.code == 0) { + return res.data; + } + return null; +} + /** * 获取可预约的房间列表 * @param {number} startTime 开始时间 时间戳(秒) @@ -181,18 +214,45 @@ export const cancelReservation = async (reservation_id, cancel_reason) => { }; } +/** + * 预约签到接口(仅发起者可操作,且只能签到一次) + * @param {Object} checkInData 签到数据 + * @param {number} checkInData.reservation_id 预约ID + * @param {Array} checkInData.attendeds 参会名单(不包含发起者) + * @param {number} checkInData.attendeds[].user_id 用户ID + * @param {boolean} checkInData.attendeds[].isAttended 是否到场 + * @returns {Promise} 返回签到结果 + */ +export const checkInReservation = async (checkInData) => { + console.log("checkInReservation", checkInData); + const res = await request.post("sq/CheckInReservation", checkInData); + if (res.code == 0) { + return { + success: true, + message: res.msg || '签到成功' + }; + } + return { + success: false, + message: res.msg || '签到失败' + }; +} + export const sqInterface = { + canCreateSQReservation, getReservationList, getMyReservation, getMyUseReservation, getEvaluateServices, addEvaluateServices, getReputationByUser, + getPaymentRecords, getReservationRoomList, addSQReservation, joinReservation, - cancelReservation + cancelReservation, + checkInReservation } \ No newline at end of file diff --git a/common/system/router.js b/common/system/router.js index 5555325..e996e54 100644 --- a/common/system/router.js +++ b/common/system/router.js @@ -31,4 +31,5 @@ export const navigateToAccountLogin = (page = "") => { export const navigateToAgreement = (type) => { navigateTo(`/pages/other/agreement?type=${type}`); -}; \ No newline at end of file +}; + diff --git a/components.d.ts b/components.d.ts index ee875a6..a3f35d6 100644 --- a/components.d.ts +++ b/components.d.ts @@ -17,6 +17,7 @@ declare module 'vue' { NoData: typeof import('./components/com/page/no-data.vue')['default'] NoEmpty: typeof import('./components/com/index/NoEmpty.vue')['default'] PickerData: typeof import('./components/com/appointment/picker-data.vue')['default'] + QiandaoPopup: typeof import('./components/com/page/qiandao-popup.vue')['default'] RadioSelect: typeof import('./components/com/appointment/radio-select.vue')['default'] ReservationEvaluate: typeof import('./components/com/page/reservation-evaluate.vue')['default'] ReservationItem: typeof import('./components/com/page/reservation-item.vue')['default'] diff --git a/components/com/index/ReservationPopup.vue b/components/com/index/ReservationPopup.vue index d28fb36..2de3176 100644 --- a/components/com/index/ReservationPopup.vue +++ b/components/com/index/ReservationPopup.vue @@ -1,21 +1,19 @@ @@ -150,7 +149,9 @@ const participantList = computed(() => { var isAddhandleJoin = ref(0); // 显示弹窗 const show = (item) => { + console.log("itemitemitemitem", item) reservationData.value = item || {} + isAddhandleJoin.value = 0; if (userInfo.value != null) { var _initiatorInfo = item.participants.find(p => p.role === 1); if (_initiatorInfo != null) { @@ -158,6 +159,12 @@ const show = (item) => { isAddhandleJoin.value = 2; } } + var _joinInfo = item.participants.find(p => p.role === 0); + if (_joinInfo != null) { + if (userInfo.value.id == _joinInfo.user_id) { + isAddhandleJoin.value = 1; + } + } } popup.value.open() } @@ -209,7 +216,24 @@ const getGenderText = (genderLimit) => { return '不限' } } - +const getAgeRangeText = (minAge, maxAge) => { + if (minAge == 0 && maxAge == 0) { + return "不限"; + } + let s = ""; + if (minAge == 0) { + s = "不限"; + } else { + s = minAge + "岁"; + } + s += " ~ "; + if (maxAge == 0) { + s += "不限"; + } else { + s += maxAge + "岁"; + } + return s; +} // 处理加入组局 const handleJoin = async () => { // 检查登录状态 @@ -424,4 +448,17 @@ defineExpose({ justify-content: center; align-items: center; } + +.card { + background: #FFFFFF; + box-shadow: 0rpx 0rpx 10rpx 4rpx rgba(0, 0, 0, 0.25); + border-radius: 30rpx 30rpx 30rpx 30rpx; + margin-top: 20rpx; +} + +.lable { + font-family: PingFang SC, PingFang SC; + font-size: 22rpx; + +} diff --git a/components/com/page/container-base.vue b/components/com/page/container-base.vue index b38fee5..12a5752 100644 --- a/components/com/page/container-base.vue +++ b/components/com/page/container-base.vue @@ -2,6 +2,7 @@ + { _baseEvaluatePop.value && _baseEvaluatePop.value.show(reservation) @@ -27,6 +30,10 @@ const openReservationPopup = async (reservation) => { console.log("openReservationPopup", reservation) _reservationPopup.value && _reservationPopup.value.show(reservation) } +const openQianDaoPop = async (reservation) => { + console.log("openQianDaoPop", reservation) + _qianDaoPopup.value && _qianDaoPopup.value.show(reservation) +} const _upDatesTimePicker = ref({ refId: null, show: false, @@ -105,7 +112,7 @@ const openUpDatesTimePicker = (value, minDate, title) => { }) } -defineExpose({ openEvaluatePop, openReservationPopup, openUpDatesTimePicker }) +defineExpose({ openEvaluatePop, openReservationPopup, openUpDatesTimePicker,openQianDaoPop }) // onMounted(() => { diff --git a/components/com/page/qiandao-popup.vue b/components/com/page/qiandao-popup.vue new file mode 100644 index 0000000..64a84e5 --- /dev/null +++ b/components/com/page/qiandao-popup.vue @@ -0,0 +1,329 @@ + + + + + \ No newline at end of file diff --git a/components/com/page/reservation-evaluate.vue b/components/com/page/reservation-evaluate.vue index 2bb1cf0..d859019 100644 --- a/components/com/page/reservation-evaluate.vue +++ b/components/com/page/reservation-evaluate.vue @@ -1,12 +1,13 @@