diff --git a/my/hongbao/youhuijuanList.vue b/my/hongbao/youhuijuanList.vue new file mode 100644 index 0000000..a15b7b2 --- /dev/null +++ b/my/hongbao/youhuijuanList.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/my/order/payModify.vue b/my/order/payModify.vue index bda7f12..4027f2b 100644 --- a/my/order/payModify.vue +++ b/my/order/payModify.vue @@ -2,13 +2,14 @@ - + 请选择地址 联系人 {{name}} + 选择 @@ -41,10 +42,17 @@ 服务时间 - + + --> + + + {{startTime}} + 请选择预约时间 + + @@ -58,8 +66,20 @@ + + + 平台优惠劵 + + + + -¥{{couponDataList}} + + 选择优惠劵 + + + - + + + + + + + + + + @@ -211,7 +240,11 @@ export default { data() { return { - single:'2024-06-19', + startTime: '', + msTimeList: [], + msTimeDate: 0, + isTrue1: false, + single:'请选择时间', radio1:'', sex: [{ text: '我已同意《盛安健康服务协议》', @@ -253,8 +286,6 @@ user: {}, game: {} }, - isTrue: 0, - phone: '', isVip: false, birthDate: '', @@ -277,7 +308,7 @@ city:'', district:'', addressId:'', - isTrues: true, + isTrue: false, jishiName:'', checkbox:false, couponData:[], @@ -285,19 +316,32 @@ textareaData:'', ordersId:'', userPackageDetailId:'', + couponDataList:'' } }, onLoad(e) { - this.jishiName=this.$queue.getData('getJishi'); - // setTimeout(() => { - // // this.loading = false; - // }, 2000) - this.isTrue = e.isTrue - if (this.isTrue) { - uni.setNavigationBarTitle({ - title: '订单详情' - }) + if (this.$queue.getData('msTimeDate')) { + this.msTimeDate = parseInt(this.$queue.getData('msTimeDate')); + } else { + this.msTimeDate = 60; } + var date = new Date(); + var year = date.getFullYear(); + let month = (parseInt(date.getMonth()) + 1) > 9 ? (parseInt(date.getMonth()) + 1) : "0" + (parseInt( + date.getMonth()) + 1) // 当前月份 + let days = (date.getDate()) > 9 ? date.getDate() : "0" + date.getDate() //当前日期 + let fullDate = `${month}-${days}` + let Time = year + '-' + fullDate + this.yearsDate = Time; + var classifyId=this.$queue.getData('classifyId') + this.classifyId = classifyId; + this.getMsTime(Time); + this.jishiName=this.$queue.getData('getJishi'); + this.couponId=this.$queue.getData('youhui'); + if(this.couponId){ + this.youhuiF(this.couponId) + } + this.ordersId = this.$queue.getData('ordersId'); this.userPackageDetailId = this.$queue.getData('userPackageDetailId'); this.youhui() @@ -343,6 +387,54 @@ // #endif }, methods: { + // 时间段数据 + TimeData(e) { + var date = new Date(); + var year = date.getFullYear(); + // if(this.msTimeList.length > 0){ + // let startTime = year + '-' + e.days + ' ' + e.hours + // for (var i = 0; i < this.msTimeList.length; i++) { + // let msTime = this.msTimeList[i].artificerDate + ' ' + this.msTimeList[i].artificerTime + // if(startTime === msTime){ + // this.isTrue = false + // uni.showModal({ + // title: '温馨提示', + // content: '当前时段已被预约,请更换预约时段!', + // showCancel: true, + // cancelText: '取消', + // confirmText: '确定', + // success: res => { + // if(res.confirm){ + // this.isTrue = true + // } + // } + // }); + // return; + // } + // } + // }else{ + this.startTime = year + '-' + e.days + ' ' + e.hours + this.isTrue = false + // } + }, + getMsTime(artificerDate) { + this.$Request.getT('/app/artificerTime/selectArtificerTimeListByArtificerId?artificerId=' + this + .artificerId + '&artificerDate=' + artificerDate).then(res => { + if (res.code == 0) { + this.msTimeList = res.data; + console.log(res.data, "获取忙时时间") + } + }) + }, + // 打开弹窗 + openData() { + this.isTrue = true + }, + youhuijuan(){ + uni.navigateTo({ + url:'/my/hongbao/youhuijuanList' + }) + }, openpay() {//验证 if(this.single=='2024-06-19'){ uni.showToast({ @@ -369,6 +461,24 @@ checkboxChange(e){ this.couponId=e.detail.value.join(",") }, + youhuiF(couponId){//获取优惠卷 + let that = this; + let data = { + page: 1, + limit: 10, + id:couponId, + } + that.$Request.get("/app/coupon/selectCouponUserList", data).then(res => { + if (res.code == 0) { + var list=res.data.list; + that.couponDataList=list.reduce((sum, item) => sum + item.money, 0) + console.log("asdasdasdasd",that.couponDataList) + } else { + that.$queue.showToast(res.msg) + } + + }); + }, youhui(){//获取优惠卷 let that = this let data = { @@ -561,7 +671,7 @@ userId: uni.getStorageSync('userId'), longitude:that.longitude, latitude:that.latitude, - serveTime:that.single, + serveTime:that.startTime, remarks:that.textareaData, ordersMassageList:[ {massageId: that.userPackageDetailId? that.userPackageDetailId:that.ordersId,num: 1}, @@ -1223,6 +1333,16 @@