diff --git a/my/order/pay.vue b/my/order/pay.vue index b7d87c4..016dc18 100644 --- a/my/order/pay.vue +++ b/my/order/pay.vue @@ -49,10 +49,10 @@ - - 加钟/补价 + 加钟/补价 --> @@ -256,7 +256,7 @@ class="dingshi"> 去投诉 - @@ -268,7 +268,7 @@ class="dingshi"> 立即预约 - @@ -303,22 +303,25 @@ 充值 加钟 - 改价 + 升级项目 @@ -326,8 +329,9 @@ + - + @@ -349,6 +353,41 @@ + + + + + + + + + {{item.title}} + + + 服务时长:{{item.duration}}分钟 + 已售:{{item.sales}} + + + + {{item.jianjie}} + + + + + + {{item.price}} + /元套 + + {{item.oldPrice}} + + + 确认升级 + + + + + + @@ -433,10 +472,11 @@ export default { data() { return { - tordersId: '', + ordersId: '', tpayMoney: '', paySel: 0, showorder: false, + showorderS: false, orderList: [], loading: true, customStyle: { @@ -484,7 +524,8 @@ tiqianData:'', type:'center', earlyFinishReason:'', - qurenJd:[] + qurenJd:[], + artificerlist:[] } }, onLoad(e) { @@ -542,6 +583,78 @@ // #endif }, methods: { + saveJZS(artificerId) {//升级查询技师项目 + let data = { + artificerId: artificerId, + status: 0 + } + let that = this; + this.$queue.showLoading('查询中...') + that.$Request.get("/app/artificer/selectArtificerMassageList", data).then(res => { + if (res.code == 0) { + if (res.data && res.data.length > 0) { + that.artificerlist = res.data + // for (let i = 0; i < that.artificerlist.length; i++) { + // if (that.artificerlist[i].labels) { + // that.artificerlist[i].labels = that.artificerlist[i].labels.split(","); + // } + // } + uni.hideLoading(); + that.showorderS = true; + } else { + uni.hideLoading(); + that.$queue.showToast('暂无可升级项目'); + } + } else { + uni.hideLoading(); + that.$queue.showToast(res.msg); + } + + }) + }, + saveJZ(classifyId) { + let data = { + parentId: classifyId, + page: 1, + limit: 50, + status: 1 + } + let that = this; + this.$queue.showLoading('查询中...') + that.$Request.get("/app/artificer/selectMassageTypePage", data).then(res => { + if (res.code == 0) { + if (res.data.list && res.data.list.length > 0) { + that.orderList = res.data.list + for (let i = 0; i < that.orderList.length; i++) { + if (that.orderList[i].labels) { + that.orderList[i].labels = that.orderList[i].labels.split(","); + } + } + uni.hideLoading(); + that.showorder = true; + } else { + uni.hideLoading(); + that.$queue.showToast('暂无可加钟项目'); + } + } else { + uni.hideLoading(); + that.$queue.showToast(res.msg); + } + + }) + }, + getTimeStampWithoutSeconds(date) { + // 将日期转换为标准的UTC时间 + var utcDate = new Date( + date.getUTCFullYear(), + date.getUTCMonth(), + date.getUTCDate(), + date.getUTCHours(), + date.getUTCMinutes(), + 0); + // 返回不含秒的时间戳 + return utcDate.getTime(); + }, getOrder() { let data = { ordersId: this.ordersId @@ -550,7 +663,18 @@ if (res.code == 0) { this.loading = false uni.hideLoading() - this.order = res.data + this.order = res.data; + var date = new Date(); // 当前日期和时间 + var timestamp = this.getTimeStampWithoutSeconds(date); // 不含秒的时间戳 + const twoHoursInMilliseconds = 2 * 60 * 60 * 1000; // 两个小时的毫秒数 + var twoTime=parseInt(new Date(twoHoursInMilliseconds).getTime()) + var time=parseInt(new Date(this.order.serveTime).getTime()) + if(time-timestamp>twoTime){ + this.$set(this.order, 'btnShow', 'true') + }else{ + this.$set(this.order, 'btnShow', 'false') + } + console.log("sadasdsa0",this.order) let aliphone = this.$queue.getData('aliphone'); if (aliphone === '是' && this.order.artificer) { this.ysPhone(this.order.phone, this.order.artificer.phone); @@ -738,31 +862,29 @@ }); }, goOrder(item) { + console.log("item=====>",item) + console.log("order=====>",this.order) let that = this - let payMoney = that.isVip ? item.memberPrice : item.price; let data = { - parentId: that.order.ordersId, - artificerId: that.order.artificerId, - ordersMassageList: [{ - massageId: item.massageTypeId, - num: 1, - }], - price: payMoney, - couponId: '', - payMoney: payMoney, - userId: uni.getStorageSync('userId'), + classifyId:item.classifyId, + ordersId:that.order.ordersId, + ordersMassageList:[ + {massageId: item.massageTypeId,num: 1}, + ], + massageTypeId:item.massageTypeId, + userPackageDetailId:item.userPackageDetailId, } - that.$Request.postJson("/app/artificer/insertOrders", data).then(res => { + that.$Request.postJson("/app/artificer/updateOrders", data).then(res => { that.showorder = false if (res.code == 0) { - that.tordersId = res.data.ordersId; - that.tpayMoney = payMoney; + that.ordersId = res.data.ordersId; + that.tpayMoney = res.data.payMoney; that.showpay = true; that.paySel = 1; } else { that.$queue.showToast(res.msg) } - + }); }, payJZ() { @@ -776,7 +898,7 @@ that.$queue.showLoading('支付中...') // console.log('用户点击确定'); that.$Request.post("/app/artificer/payOrders", { - ordersId: that.tordersId, + ordersId: that.ordersId, }).then(ret => { uni.hideLoading(); if (ret.code == 0) { @@ -801,7 +923,7 @@ } else if (that.openWay == 2) { //微信支付 // #ifdef MP-WEIXIN let data = { - ordersId: that.tordersId, + ordersId: that.ordersId, type: 3 } that.$Request.post('/app/wxPay/payOrder', data).then(ret => { @@ -845,7 +967,7 @@ let ua = navigator.userAgent.toLowerCase(); if (ua.indexOf('micromessenger') != -1) { let data = { - ordersId: that.tordersId, + ordersId: that.ordersId, type: 2 } that.$Request.post('/app/wxPay/payOrder', data).then(rea => { @@ -861,7 +983,7 @@ }); } else { let data = { - ordersId: that.tordersId, + ordersId: that.ordersId, type: 4 } that.$Request.post('/app/wxPay/payOrder', data).then(rea => { @@ -899,7 +1021,7 @@ } else if (that.openWay == 3) { //支付宝支付 // #ifdef H5 let data = { - ordersId: that.tordersId, + ordersId: that.ordersId, type: 2 } that.$Request.post('/app/aliPay/payOrder', data).then( @@ -914,7 +1036,7 @@ // #ifdef APP-PLUS let data = { - ordersId: that.tordersId, + ordersId: that.ordersId, type: 1 } that.$Request.post('/app/aliPay/payOrder', data).then( @@ -926,37 +1048,7 @@ } }, - saveJZ(classifyId) { - let data = { - parentId: classifyId, - page: 1, - limit: 50, - status: 1 - } - let that = this; - this.$queue.showLoading('查询中...') - that.$Request.get("/app/artificer/selectMassageTypePage", data).then(res => { - if (res.code == 0) { - if (res.data.list && res.data.list.length > 0) { - that.orderList = res.data.list - for (let i = 0; i < that.orderList.length; i++) { - if (that.orderList[i].labels) { - that.orderList[i].labels = that.orderList[i].labels.split(","); - } - } - uni.hideLoading(); - that.showorder = true; - } else { - uni.hideLoading(); - that.$queue.showToast('暂无可加钟项目'); - } - } else { - uni.hideLoading(); - that.$queue.showToast(res.msg); - } - - }) - }, + //支付选择 selectWay: function(item) { this.openWay = item.id; @@ -1397,6 +1489,114 @@ \ No newline at end of file