From e00f688ee8464c0e9a3a865a5f4576f15f7fbfd1 Mon Sep 17 00:00:00 2001
From: "Mr.jiang" <714156421@qq.com>
Date: Sun, 30 Jun 2024 09:49:59 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
my/hongbao/youhuijuanList.vue | 10 +-
my/order/pay.vue | 12 +-
my/order/payModify.vue | 5 +-
my/order/payModifyDzhifu.vue | 860 ++++++-----
my/order/paydingXiuGai.vue | 2012 ++++++++++++++++++++++++++
my/wallet/index.vue | 11 +-
pages.json | 10 +
pages/order/index.vue | 47 +-
pages/therapist/therapistDingdan.vue | 5 +
9 files changed, 2613 insertions(+), 359 deletions(-)
create mode 100644 my/order/paydingXiuGai.vue
diff --git a/my/hongbao/youhuijuanList.vue b/my/hongbao/youhuijuanList.vue
index 0d7dbd1..7bff737 100644
--- a/my/hongbao/youhuijuanList.vue
+++ b/my/hongbao/youhuijuanList.vue
@@ -72,7 +72,7 @@
},
couponId:'',
content:'',
- priceDd:''
+ priceDd:'',
}
},
onLoad(e) {
@@ -85,14 +85,18 @@
methods: {
queding(){
this.$queue.setData('youhui',this.couponId);
- if(this.content){//返回推荐套餐订单
+ if(this.content=='套餐'){//返回推荐套餐订单
uni.navigateTo({
url:'/my/order/payModifyTc'
})
- }else{
+ }else if(this.content=='支付'){
uni.navigateTo({//返回项目订单
url:'/my/order/payModify'
})
+ }else if(this.content=='修改'){
+ uni.navigateTo({//返回项目订单
+ url:'/my/order/payModifyDzhifu'
+ })
}
},
diff --git a/my/order/pay.vue b/my/order/pay.vue
index a384761..5c2499d 100644
--- a/my/order/pay.vue
+++ b/my/order/pay.vue
@@ -205,8 +205,11 @@
合计:
- ¥{{order.sumMoney}}
+ ¥
+
+ {{order.oldMassageMoney==null?order.payMoney:(order.payMoney+order.oldMassageMoney)}}
+
+
@@ -279,7 +282,8 @@
取消订单
+ v-if="order.status != 3 && order.status != 4 && order.status != 5">
+ 取消订单
修改订单
diff --git a/my/order/payModify.vue b/my/order/payModify.vue
index cda1eda..147dd93 100644
--- a/my/order/payModify.vue
+++ b/my/order/payModify.vue
@@ -331,6 +331,7 @@
this.youhuiF(this.couponId)
}
this.orderXm=this.$queue.getData('xiangmu');//上一个页面带过来的全部数据
+ console.log("this.orderXm",this.orderXm)
this.ordersId = this.$queue.getData('ordersId');
this.userPackageDetailId = this.$queue.getData('userPackageDetailId');
this.youhui()
@@ -425,7 +426,7 @@
},
youhuijuan(){
uni.navigateTo({
- url:'/my/hongbao/youhuijuanList?price='+this.orderXm.price
+ url:'/my/hongbao/youhuijuanList?price='+this.orderXm.price+'&text='+'支付'
})
},
openpay() {//验证
@@ -1323,7 +1324,7 @@
}
})
},
- }
+ }
}
diff --git a/my/order/payModifyDzhifu.vue b/my/order/payModifyDzhifu.vue
index d7b8bb7..33ecdc1 100644
--- a/my/order/payModifyDzhifu.vue
+++ b/my/order/payModifyDzhifu.vue
@@ -2,13 +2,61 @@
-
-
-
+
+
+
+
+
+
+
+
+
@@ -174,7 +243,12 @@
export default {
data() {
return {
- single:'',
+ number:1,
+ startTime: '',
+ msTimeList: [],
+ msTimeDate: 0,
+ isTrue1: false,
+ single:'请选择时间',
radio1:'',
sex: [{
text: '我已同意《盛安健康服务协议》',
@@ -216,8 +290,6 @@
user: {},
game: {}
},
- isTrue: 0,
-
phone: '',
isVip: false,
birthDate: '',
@@ -240,7 +312,7 @@
city:'',
district:'',
addressId:'',
- isTrues: true,
+ isTrue: false,
jishiName:'',
checkbox:false,
couponData:[],
@@ -248,30 +320,41 @@
textareaData:'',
ordersId:'',
userPackageDetailId:'',
- dingdanData:'',
- huixian:[],
- // 设置今天之后的日期为可选的开始日期
- startDate: this.getTomorrowDate()
+ couponDataList:'',
+ orderXm:[],
+ number:1,
}
},
onLoad(e) {
- this.jishiName=this.$queue.getData('getJishi');
- this.dingdanData=this.$queue.getData('daibudan');
- console.log("his.dingdanData",this.dingdanData)
- this.huixian=this.dingdanData.couponId.split(',');
- this.single=this.dingdanData.serveTime
- // 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;
+ this.orderXm=this.$queue.getData('xiangmu');//上一个页面带过来的全部数据
this.ordersId = this.$queue.getData('ordersId');
this.userPackageDetailId = this.$queue.getData('userPackageDetailId');
- this.youhuiZ()
+ this.youhui()
+ this.jishiName=this.$queue.getData('getJishi');
+ if(this.jishiName){
+ this.getMsTime(Time);
+ }else{
+ this.jishiName=this.orderXm;
+ }
+ console.log("this.jishiName===>",this.jishiName)
+ this.couponId=this.$queue.getData('youhui');
+ if(this.couponId){
+ this.youhuiF(this.couponId)
+ }
+
// this.getOrder()
},
@@ -314,25 +397,269 @@
// #endif
},
methods: {
- // 获取明天的日期字符串
- getTomorrowDate() {
- const now = new Date();
- const tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);
- return this.formatDate(tomorrow);
- },
- // 将日期对象格式化为YYYY-MM-DD字符串
- formatDate(date) {
- const year = date.getFullYear();
- const month = this.padStart(date.getMonth() + 1);
- const day = this.padStart(date.getDate());
- return `${year}-${month}-${day}`;
+ goOrder() {//生成orderId
+ let that = this
+ let data = {
+ address:that.province+that.city+that.district+that.detailaddress,
+ artificerId:that.jishiName.artificerId,
+ ordersMassageList:[
+ {massageId: that.orderXm.massageTypeId,num: that.number},
+ ],
+ city:that.city,
+ serveTime:that.startTime,
+ userId: uni.getStorageSync('userId'),
+ userName:that.name,
+ tripWay:that.jishiName.tripWay,
+ phone:that.mobile,
+ remark:that.textareaData,
+ classifyId:that.orderXm.classifyId,
+ latitude:that.latitude,
+ longitude:that.longitude,
+ ordersId:that.orderXm.ordersId,
+ couponId: that.couponId,
+ massageTypeId:that.orderXm.massageTypeId,
+ userPackageDetailId:that.orderXm.userPackageDetailId,
+ }
+ that.$Request.postJson("/app/artificer/updateOrders", data).then(res => {
+ that.showorder = false
+ if (res.code == 0) {
+ that.ordersId = res.data.ordersId;
+ that.tpayMoney = res.data.payMoney;
+ // that.showpay = true;
+ that.paySel = 1;
+ uni.navigateTo({
+ url:'/my/order/paydingXiuGai?ordersId='+ res.data.ordersId
+ })
+ } else {
+ that.$queue.showToast(res.msg)
+ }
+
+ });
},
- // 补齐日期字符串,确保月份和日期为两位数
- padStart(num) {
- return num < 10 ? '0' + num : num;
+ payJZ() {
+ let that = this;
+ if (that.openWay == 1) { //零钱支付
+ uni.showModal({
+ title: '付款提示',
+ content: '确认支付' + that.tpayMoney + '元吗?',
+ success: function(re) {
+ if (re.confirm) {
+ that.$queue.showLoading('支付中...')
+ // console.log('用户点击确定');
+ that.$Request.post("/app/artificer/payOrders", {
+ ordersId: that.ordersId,
+ }).then(ret => {
+ uni.hideLoading();
+ if (ret.code == 0) {
+ uni.showToast({
+ title: '支付成功',
+ icon: 'none'
+ })
+ // that.getOrder()
+
+ } else {
+ uni.showToast({
+ title: ret.msg,
+ icon: 'none'
+ })
+ }
+ });
+ } else if (re.cancel) {
+ // that.getOrder()
+ }
+ }
+ })
+ } else if (that.openWay == 2) { //微信支付
+ // #ifdef MP-WEIXIN
+ let data = {
+ ordersId: that.tordersId,
+ type: 3
+ }
+ that.$Request.post('/app/wxPay/payOrder', data).then(ret => {
+ console.log(ret)
+ if (ret.code == 0) {
+ uni.hideLoading();
+ uni.requestPayment({
+ provider: 'wxpay',
+ timeStamp: ret.data.timestamp,
+ nonceStr: ret.data.noncestr,
+ package: ret.data.package,
+ signType: ret.data.signType,
+ paySign: ret.data.sign,
+ success: function(ret) {
+ console.log(ret)
+ uni.showToast({
+ title: '支付成功',
+ icon: 'none'
+ })
+ // that.getOrder()
+ // this.$queue.showToast('支付成功');
+
+ // uni.switchTab({
+ // url: '/pages/my/index'
+ // })
+ },
+ fail: function(err) {
+ // this.$queue.showToast('支付失败');
+ uni.showToast({
+ title: '支付失败',
+ icon: 'nones'
+ });
+ // that.getOrder()
+ }
+ });
+ }
+ });
+ // #endif
+
+ // #ifdef H5
+ let ua = navigator.userAgent.toLowerCase();
+ if (ua.indexOf('micromessenger') != -1) {
+ let data = {
+ ordersId: that.tordersId,
+ type: 2
+ }
+ that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
+ that.showpay = false
+ if (rea.code == 0) {
+ that.callPay(rea.data);
+ } else {
+ uni.showToast({
+ title: rea.msg,
+ icon: 'none'
+ })
+ }
+ });
+ } else {
+ let data = {
+ ordersId: that.tordersId,
+ type: 4
+ }
+ that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
+ that.showpay = false
+ if (rea.code == 0) {
+ const urlArr = window.location.href;
+ const hostUrl = urlArr.split("/");
+ const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
+ const url = '&redirect_url=' + callBack + 'my/order/pay';
+ window.location = rea.data.mweb_url + url
+ } else {
+ uni.showToast({
+ title: rea.msg,
+ icon: 'none'
+ })
+ }
+ });
+ }
+
+ // #endif
+
+ // #ifdef APP
+ let data = {
+ ordersId: that.order.ordersId,
+ type: 1
+ }
+ that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
+ console.log(rea)
+ that.showpay = false
+ if (rea.code == 0) {
+ that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data));
+ }
+ });
+ // #endif
+ } else if (that.openWay == 3) { //支付宝支付
+ // #ifdef H5
+ let data = {
+ ordersId: that.tordersId,
+ type: 2
+ }
+ that.$Request.post('/app/aliPay/payOrder', data).then(
+ rea => {
+ that.showpay = false
+ const div = document.createElement('div')
+ div.innerHTML = rea.data //此处form就是后台返回接收到的数据
+ document.body.appendChild(div)
+ document.forms[0].submit()
+ });
+ // #endif
+
+ // #ifdef APP-PLUS
+ let data = {
+ ordersId: that.tordersId,
+ type: 1
+ }
+ that.$Request.post('/app/aliPay/payOrder', data).then(
+ rea => {
+ that.showpay = false
+ that.setPayment('alipay', rea.data);
+ });
+ // #endif
+ }
+
+ },
+
+ changeValue(value){
+ this.number=value
+ },
+ changeValue(value){
+ this.number=value
+ },
+ // 时间段数据
+ 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) {
+ let that = this;
+ let artificerId = that.jishiName.artificerId;
+ this.$Request.getT('/app/artificerTime/selectArtificerTimeListByArtificerId?artificerId=' + 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?price='+this.orderXm.price+'&text='+'修改'
+ })
},
openpay() {//验证
- if(this.single=='2024-06-19'){
+ // else if(this.radio1!='0'){
+ // uni.showToast({
+ // title:'请同意服务保障!'
+ // })
+ // }
+ if(this.startTime==''){
uni.showToast({
title:'请选择服务时间!'
})
@@ -340,57 +667,47 @@
uni.showToast({
title:'请选择理疗师!'
})
- }else if(this.radio1!='0'){
- uni.showToast({
- title:'请同意服务保障!'
- })
}else{
- this.showpay = true;
+ // this.showpay = true;
this.goOrder()
}
},
textareaChange(e){//备注
this.textareaData=e.detail.value
+ console.log("adsadas0",this.textareaData)
},
- checkboxChange(e){//选择优惠卷
- this.couponId=e.detail.value.join(",");
- if(this.huixian.length>1){
- this.huixian.push(this.couponId)
- }
+ checkboxChange(e){
+ this.couponId=e.detail.value.join(",")
},
- youhuiZ(){//获取优惠卷
- let that = this
+ youhuiF(couponId){//获取优惠卷
+ let that = this;
let data = {
- status:0,
page: 1,
limit: 10,
+ id:couponId,
}
that.$Request.get("/app/coupon/selectCouponUserList", data).then(res => {
if (res.code == 0) {
- var couponData=res.data.list
- this.youhui(couponData)
+ 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(couponData){//获取优惠卷
- let that = this;
- var daijin=couponData;
+ youhui(){//获取优惠卷
+ let that = this
let data = {
+ status: 0,
page: 1,
- limit: 10,
- id:this.dingdanData.couponId,
+ limit: 10
}
that.$Request.get("/app/coupon/selectCouponUserList", data).then(res => {
if (res.code == 0) {
- that.couponData=res.data.list;
- var list=[]
- for(var i=0;i {
- that.showorder = false
- if (res.code == 0) {
- that.ordersId = res.data.ordersId;
- that.tpayMoney = res.data.payMoney;
- that.showpay = true;
- that.paySel = 1;
- } else {
- that.$queue.showToast(res.msg)
- }
-
- });
- },
- payJZ() {
- let that = this;
- if (that.openWay == 1) { //零钱支付
- uni.showModal({
- title: '付款提示',
- content: '确认支付' + that.tpayMoney + '元吗?',
- success: function(re) {
- if (re.confirm) {
- that.$queue.showLoading('支付中...')
- // console.log('用户点击确定');
- that.$Request.post("/app/artificer/payOrders", {
- ordersId: that.ordersId,
- }).then(ret => {
- uni.hideLoading();
- if (ret.code == 0) {
- uni.showToast({
- title: '支付成功',
- icon: 'none'
- })
- that.getOrder()
-
- } else {
- uni.showToast({
- title: ret.msg,
- icon: 'none'
- })
- }
- });
- } else if (re.cancel) {
- that.getOrder()
- }
- }
- })
- } else if (that.openWay == 2) { //微信支付
- // #ifdef MP-WEIXIN
- let data = {
- ordersId: that.tordersId,
- type: 3
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(ret => {
- console.log(ret)
- if (ret.code == 0) {
- uni.hideLoading();
- uni.requestPayment({
- provider: 'wxpay',
- timeStamp: ret.data.timestamp,
- nonceStr: ret.data.noncestr,
- package: ret.data.package,
- signType: ret.data.signType,
- paySign: ret.data.sign,
- success: function(ret) {
- console.log(ret)
- uni.showToast({
- title: '支付成功',
- icon: 'none'
- })
- that.getOrder()
- // this.$queue.showToast('支付成功');
-
- // uni.switchTab({
- // url: '/pages/my/index'
- // })
- },
- fail: function(err) {
- // this.$queue.showToast('支付失败');
- uni.showToast({
- title: '支付失败',
- icon: 'nones'
- });
- that.getOrder()
- }
- });
- }
- });
- // #endif
-
- // #ifdef H5
- let ua = navigator.userAgent.toLowerCase();
- if (ua.indexOf('micromessenger') != -1) {
- let data = {
- ordersId: that.tordersId,
- type: 2
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
- that.showpay = false
- if (rea.code == 0) {
- that.callPay(rea.data);
- } else {
- uni.showToast({
- title: rea.msg,
- icon: 'none'
- })
- }
- });
- } else {
- let data = {
- ordersId: that.tordersId,
- type: 4
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
- that.showpay = false
- if (rea.code == 0) {
- const urlArr = window.location.href;
- const hostUrl = urlArr.split("/");
- const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
- const url = '&redirect_url=' + callBack + 'my/order/pay';
- window.location = rea.data.mweb_url + url
- } else {
- uni.showToast({
- title: rea.msg,
- icon: 'none'
- })
- }
- });
- }
-
- // #endif
-
- // #ifdef APP
- let data = {
- ordersId: that.order.ordersId,
- type: 1
- }
- that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
- console.log(rea)
- that.showpay = false
- if (rea.code == 0) {
- that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data));
- }
- });
- // #endif
- } else if (that.openWay == 3) { //支付宝支付
- // #ifdef H5
- let data = {
- ordersId: that.tordersId,
- type: 2
- }
- that.$Request.post('/app/aliPay/payOrder', data).then(
- rea => {
- that.showpay = false
- const div = document.createElement('div')
- div.innerHTML = rea.data //此处form就是后台返回接收到的数据
- document.body.appendChild(div)
- document.forms[0].submit()
- });
- // #endif
-
- // #ifdef APP-PLUS
- let data = {
- ordersId: that.tordersId,
- type: 1
- }
- that.$Request.post('/app/aliPay/payOrder', data).then(
- rea => {
- that.showpay = false
- that.setPayment('alipay', rea.data);
- });
- // #endif
- }
-
- },
+
saveJZ(classifyId) {
let data = {
parentId: classifyId,
@@ -918,7 +1039,6 @@
this.payJZ();
return;
}
- console.log("ordersId000000000",this.ordersId)
if (that.openWay == 1) { //零钱支付
uni.showModal({
title: '付款提示',
@@ -1232,11 +1352,86 @@
}
})
},
- }
+ }
}
\ No newline at end of file
diff --git a/my/wallet/index.vue b/my/wallet/index.vue
index eaf6504..aeda9f4 100644
--- a/my/wallet/index.vue
+++ b/my/wallet/index.vue
@@ -339,7 +339,8 @@
nameTxt:'',
couponId:'',
artificerId:'',
- artificerIdMy:false
+ artificerIdMy:false,
+ ordersId:''
}
},
onLoad(d) {
@@ -364,7 +365,8 @@
this.txMsg = this.$queue.getData('txMsg');
this.avatar = uni.getStorageSync('avatar')
this.renzheng = uni.getStorageSync("renzheng")
- this.nameTxt=d.text
+ this.nameTxt=d.text;
+ this.ordersId=d.ordersId
this.getMoneyList();
// #ifndef MP-WEIXIN
this.openLists = [{
@@ -596,7 +598,8 @@
let data = {
payClassifyId: this.thisSelect.payClassifyId,
type: 1,
- userId: uni.getStorageSync('userId')
+ userId: uni.getStorageSync('userId'),
+ ordersId:this.ordersId
}
this.$Request.post("/app/wxPay/payMoney", data).then(ret => {
console.log(ret)
@@ -691,9 +694,11 @@
payClassifyId: this.thisSelect.payClassifyId,
type: 2,
userId: uni.getStorageSync('userId'),
+ ordersId:this.ordersId
}
if(this.artificerId){
data.artificerId=this.artificerId
+
}
this.$Request.post('/app/aliPay/payOrderMoney', data).then(
diff --git a/pages.json b/pages.json
index 48be353..2bc86a1 100644
--- a/pages.json
+++ b/pages.json
@@ -767,6 +767,16 @@
}
}
},
+ {
+ "path": "order/paydingXiuGai",
+ "style": {
+ "navigationBarTitleText": "修改订单详情",
+ "navigationStyle": "custom",
+ "app-plus": {
+ "titleNView": false
+ }
+ }
+ },
{
"path": "order/payJaZ",
"style": {
diff --git a/pages/order/index.vue b/pages/order/index.vue
index e85ffbf..10e9e66 100644
--- a/pages/order/index.vue
+++ b/pages/order/index.vue
@@ -80,7 +80,7 @@
去支付
-
修改订单
@@ -103,14 +103,14 @@
取消订单
+ @click="goNav('/my/wallet/index?artificerId='+item.artificerId+'&ordersId='+item.ordersId,item)">
充值