From 7528aeba631ca45ed5a8ca08fd3d7ca06b45a853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Tue, 31 Oct 2023 15:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/pagesB/confirmation/index.js | 23 +++ pagesB/ExpertlookOrder/ExpertlookOrder.vue | 68 +++++---- pagesB/confirmation/confirmation.scss | 47 ++++++ pagesB/confirmation/confirmation.vue | 167 ++++++++++++++------- pagesB/modifyAddress/modifyAddress.vue | 1 + pagesB/orderDetails/orderDetails.vue | 15 +- static/chat.png | Bin 0 -> 2665 bytes 7 files changed, 229 insertions(+), 92 deletions(-) create mode 100644 static/chat.png diff --git a/api/pagesB/confirmation/index.js b/api/pagesB/confirmation/index.js index 0ac681b..eb8e5b9 100644 --- a/api/pagesB/confirmation/index.js +++ b/api/pagesB/confirmation/index.js @@ -8,4 +8,27 @@ export function getListByDoctor(doctorId) { Authorization: 'Bearer' + ' ' + uni.getStorageSync('token') }, }) +} + +//提交 +export function addHealthConsultationOrder(data) { + return request({ + url: `/nurseApp/healthConsultation/addHealthConsultationOrder`, + method: 'POST', + data, + header: { + Authorization: 'Bearer' + ' ' + uni.getStorageSync('token') + }, + }) +} +//小程序购买商品订单支付接口 +export function appletGoodsOrderPay(data) { + return request({ + url: `/nurseApp/weChatPayment/appletGoodsOrderPay`, + method: 'post', + data, + header: { + Authorization: 'Bearer' + ' ' + uni.getStorageSync('token') + }, + }) } \ No newline at end of file diff --git a/pagesB/ExpertlookOrder/ExpertlookOrder.vue b/pagesB/ExpertlookOrder/ExpertlookOrder.vue index ac33488..c0ef3df 100644 --- a/pagesB/ExpertlookOrder/ExpertlookOrder.vue +++ b/pagesB/ExpertlookOrder/ExpertlookOrder.vue @@ -11,8 +11,8 @@ placeholder-class="placeholder"> - + 店铺名称 @@ -130,28 +130,30 @@ data() { return { tabslist: [ - // { - // name: '全部', - // orderStatus: '', - // }, - // { - // name: '待付款', - // orderStatus: 'WAIT_PAY', - // }, { - // name: '待收货', - // orderStatus: 'WAIT_RECEIVED_GOODS', - // }, { - // name: '待评价', - // orderStatus: 'RECEIVED_GOODS', - // }, - // { - // name: '已完成', - // orderStatus: 'EVALUATED', - // }, - // { - // name: '待咨询', - // orderStatus: 'RECEIVED_GOODS', - // } + { + name: '全部', + orderStatus: '', + }, + { + name: '待付款', + orderStatus: 'WAIT_PAY', + }, + { + name: '待接单', + orderStatus: 'WAIT_RECEIVED_GOODS', + }, + { + name: '待服务', + orderStatus: 'RECEIVED_GOODS', + },{ + name: '待评价', + orderStatus: 'RECEIVED_GOODS', + }, + { + name: '已完成', + orderStatus: 'EVALUATED', + }, + ], tabscurrent: 0, background: { @@ -161,7 +163,7 @@ orderTypeList: { patientId: '', orderType: 'HEALTH_CONSULTATION', - orderStatus: 'RECEIVED_GOODS', + orderStatus: '', // goodsOrderId: '', // pageSize: 15, // pageNum: 1, // @@ -179,15 +181,15 @@ }, methods: { //点击tabs - // tabschange(index) { - // console.log(this.tabslist) - // this.tabscurrent = index; - // this.orderTypeList.orderStatus = this.tabslist[index].orderStatus - // console.log(this.orderTypeList.orderStatus, '999') - // console.log(this.orderTypeList.orderType, '99') + tabschange(index) { + console.log(this.tabslist) + this.tabscurrent = index; + this.orderTypeList.orderStatus = this.tabslist[index].orderStatus + console.log(this.orderTypeList.orderStatus, '999') + console.log(this.orderTypeList.orderType, '99') - // this.goodsOrderinfo(); - // }, + this.goodsOrderinfo(); + }, //返回上一页 goprevious() { uni.navigateBack({ diff --git a/pagesB/confirmation/confirmation.scss b/pagesB/confirmation/confirmation.scss index cf9b197..ef75725 100644 --- a/pagesB/confirmation/confirmation.scss +++ b/pagesB/confirmation/confirmation.scss @@ -1,6 +1,53 @@ .app { padding: 0 0 124rpx; width: 100%; + // 弹框支付 + .payment { + width: 100%; + height: 130rpx; + font-size: 42rpx; + color: #000000; + line-height: 130rpx; + text-align: center; + border-bottom: 1rpx solid #D8D4D4; + } + + .chat { + position: relative; + height: 200rpx; + + span { + position: absolute; + top: 50rpx; + left: 180rpx; + line-height: 70rpx; + font-size: 42rpx; + color: #000000; + } + + image { + position: absolute; + top: 50rpx; + left: 70rpx; + width: 80rpx; + height: 70rpx; + } + } + + .submits { + background: #26A888; + width: 501rpx; + height: 71rpx; + line-height: 71rpx; + border-radius: 36rpx; + font-size: 34rpx; + color: #FFFFFF; + text-align: center; + position: fixed; + bottom: 50rpx; + left: 50%; + transform: translateX(-50%); + } .btns { width: 100%; height: 124rpx; diff --git a/pagesB/confirmation/confirmation.vue b/pagesB/confirmation/confirmation.vue index f4dc0fb..55e27d1 100644 --- a/pagesB/confirmation/confirmation.vue +++ b/pagesB/confirmation/confirmation.vue @@ -142,6 +142,19 @@ @funcValue="getpickerParentValue" pickerSize="4"> + + + + 请选择支付方式 + + + + 微信支付 + + + 确认支付¥{{formdata.price}} + + @@ -156,7 +169,9 @@ consultationInfo } from '@/api/pagesB/createnewconsultation/createnewconsultation.js' import { - getListByDoctor + getListByDoctor, + addHealthConsultationOrder, + appletGoodsOrderPay } from '@/api/pagesB/confirmation/index.js' import tabs from '@/components/utabs/u-tabs.vue' export default { @@ -166,6 +181,7 @@ }, data() { return { + buyshow: false, uoloadaction: '', // 非真实地址 list: [], addresslength: null, @@ -195,7 +211,25 @@ appointmentStartTime: null, appointmentEndTime: null, orderChannel: "WECHAT_APPLET", - } + }, + updatalist: { + consultationInfoId: '', + totalPrice: null, + receiver: null, + hospitalPersonId: null, + hospitalPersonName: '', + orderChannel: "WECHAT_APPLET", + patientId: null, + phone: null, + healthAppointDate: null, + appointmentStartTime: null, + appointmentEndTime: null, + + + // "healthConsultationContent": '', + + }, + id:'', }; }, onLoad(options) { @@ -227,6 +261,7 @@ }, //选择时间 taptime(item, index) { + console.log(item, '8') this.formdata.appointmentStartTime = item.starttime this.formdata.appointmentEndTime = item.endtime this.timeindex = index @@ -236,6 +271,7 @@ if (this.timecurrent != index) { this.timecurrent = index this.timeindex = 0 + // console.log(this.formdata.appointmentStartTime, '889') this.formdata.appointmentStartTime = this.appointmentTimeList[this.timecurrent].morningList[0] .starttime this.formdata.appointmentEndTime = this.appointmentTimeList[this.timecurrent].morningList[0] @@ -260,60 +296,84 @@ onuploaded() { this.info(); }, + // 支付 + buy() { + var that =this + that.updatalist.hospitalPersonId = that.formdata.doctorId + that.updatalist.hospitalPersonName = that.formdata.doctorName + that.updatalist.totalPrice = that.formdata.price + that.updatalist.receiver = that.formdata.patientName + that.updatalist.patientId = that.formdata.patientId + that.updatalist.phone = that.formdata.phone + that.updatalist.healthAppointDate = that.formdata.appointmentDate + that.updatalist.appointmentStartTime = that.formdata.appointmentStartTime + that.updatalist.appointmentEndTime = that.formdata.appointmentEndTime + addHealthConsultationOrder(that.updatalist).then(res => { + console.log(res, '6') + res.data.payType = "WECHAT_PAY" + res.data.paymentPrice = res.data.totalPrice + res.data.openid = uni.getStorageSync('openid'); + that.id = res.data.id + appletGoodsOrderPay(res.data).then(response => { + if (response.code == 200) { + uni.requestPayment({ + timeStamp: response.data.timeStamp, + nonceStr: response.data.nonceStr, + package: response.data.prepayId, + signType: response.data.signType, + paySign: response.data.paySign, + success: function(res) { + that.$refs.uToast.show({ + title: '支付成功', + type: 'success', + duration: 1500, + }) + if (that.timer) { + clearTimeout(that.timer) + } + that.timer = setTimeout(e => { + uni.redirectTo({ + url: '/pagesB/paysuccess/paysuccess' + }) + }, 1500) + }, + fail: function(err) { + that.$refs.uToast.show({ + title: '取消支付', + type: 'error', + duration: 1500, + }) + if (that.timer) { + clearTimeout(that.timer) + } + that.timer = setTimeout(e => { + uni.redirectTo({ + url: `/pagesB/orderDetails/orderDetails?goodsOrderId=${that.id}` + }) + }, 1500) + } + }); + } else { + that.$refs.uToast.show({ + title: response.msg, + type: 'error', + duration: 2000 + }) + } + }) + }) + }, + // 保存 info() { consultationInfo(this.formdata).then(res => { if (res.code == 200) { - res.data.payType = "WECHAT_PAY" - res.data.paymentPrice = res.data.totalPrice - res.data.openid = this.openid - let id = res.data.id - appletGoodsOrderPay(res.data).then(response => { - if (response.code == 200) { - uni.requestPayment({ - timeStamp: response.data.timeStamp, - nonceStr: response.data.nonceStr, - package: response.data.prepayId, - signType: response.data.signType, - paySign: response.data.paySign, - success: function(res) { - that.$refs.uToast.show({ - title: '支付成功', - type: 'success', - duration: 1500, - }) - if (that.timer) { - clearTimeout(that.timer) - } - that.timer = setTimeout(e => { - // uni.redirectTo({ - // url: `/pages/CommodityOrder/CommodityOrder` - // // url: `/pages/orderDetails/orderDetails?goodsOrderId=${id}` - // }) - }, 1500) - }, - fail: function(err) { - that.$refs.uToast.show({ - title: '取消支付', - type: 'error', - duration: 1500, - }) - if (that.timer) { - clearTimeout(that.timer) - } - that.timer = setTimeout(e => { - // uni.redirectTo({ - // url: `/pages/orderDetails/orderDetails?goodsOrderId=${id}` - // }) - }, 1500) - } - }); - } else { - that.$refs.uToast.show({ - title: response.msg, - type: 'error', - duration: 2000 - }) - } + this.buyshow = true + this.updatalist.consultationInfoId = res.data.id + } else if (res.code == 500) { + this.$refs.uToast.show({ + title: res.msg, + type: 'error', + duration: 1500, }) } }) @@ -338,6 +398,7 @@ res.data[0]?.morningList[0]?.endtime ? this.formdata.appointmentEndTime = res.data[0] .morningList[0].endtime : '' this.appointmentTimeList = res.data + // console.log(this.appointmentTimeList, '666') }) }, // 显示三级地址联动 diff --git a/pagesB/modifyAddress/modifyAddress.vue b/pagesB/modifyAddress/modifyAddress.vue index c67b413..4744555 100644 --- a/pagesB/modifyAddress/modifyAddress.vue +++ b/pagesB/modifyAddress/modifyAddress.vue @@ -139,6 +139,7 @@ }, onLoad(options) { let that = this + console.log(options) this.updata = JSON.parse(options.updata) }, methods: { diff --git a/pagesB/orderDetails/orderDetails.vue b/pagesB/orderDetails/orderDetails.vue index 1ce8a23..505d818 100644 --- a/pagesB/orderDetails/orderDetails.vue +++ b/pagesB/orderDetails/orderDetails.vue @@ -142,7 +142,7 @@ } from '@/api/pagesB/confirmOrder/index.js' import { confirmReceipt, - ssgoodsOrder + ssgoodsOrder, } from '@/api/pagesB/CommodityOrder/index.js' import { handCloseOrder @@ -161,11 +161,13 @@ goodsOrderId: null, patientId: '', openid: null, - orderTypeList: [ - 'INTEGRAL_EXCHANGE', - 'DIRECT_BUY', - ], - orderStatus: '', + orderType: 'HEALTH_CONSULTATION', + orderStatus: 'WAIT_PAY', + // orderTypeList: [ + // 'INTEGRAL_EXCHANGE', + // 'DIRECT_BUY', + // ], + // orderStatus: '', pageSize: 15, pageNum: 1, goodsName: '', @@ -312,6 +314,7 @@ this.goodsOrderinfo() }, onLoad(options) { + console.log(options,'88') this.baseurl = baseurl this.orderTypeList.goodsOrderId = options.goodsOrderId let that = this diff --git a/static/chat.png b/static/chat.png new file mode 100644 index 0000000000000000000000000000000000000000..ee93026d61d26854b765c4d32ddff763d04e158f GIT binary patch literal 2665 zcmV-v3YPVWP)Px4$9pD6-u( z#e9UVsBT606p{B(R)hT}mh}$V4IfduVAGxsWru@>wOdnuC|0-((eqImip5}*;sA~Q z8>k1ZL8XRp?^O(+wIx9OoKS@$Z*lp)6ogj0yqFEe zm!WbSB8TMT#NN@>71;J=l+9b=*Sf=MObq>g>ehqgKy$t9KLOO-hsy2G{$vb&< zu?mof_UP*AH7f7&f1-KY7*7A~8ZWBu$sqlS>UJc@2&x<#ERaQSjtP6=ODO{4mH5-2!)0xlO3XC`~SK3!P%= zoV?}d_94@EAtGlu0rjx&H)Chdr)=KKoyFBLd94Y20{B4>BgSnw>&e<>jI3JKkwVAh zrDDGVxxuZao+GClfGR9`h!Kf*z0bV5%29|e0($ivQXC`sJHjlK$A~7(E{)@8Kl5tG zABYut6ByvA-6I5aB{mPy+*r-1>djt4YEND|{xHhrUO>8^tl4ehCEx+VeU>nM*0xS# zsEwVBW%VICw|-Z-w&c~tha=Pi;qFI>D~~sVK8wu^N|S#^&`z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