支付
This commit is contained in:
parent
e7be819cf3
commit
7528aeba63
@ -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')
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -11,8 +11,8 @@
|
||||
placeholder-class="placeholder">
|
||||
</view>
|
||||
</u-navbar>
|
||||
<!-- <u-tabs :list="tabslist" :is-scroll="false" :current="tabscurrent" @change="tabschange" :show-bar='false'
|
||||
active-color='#26A888'></u-tabs> -->
|
||||
<u-tabs :list="tabslist" :is-scroll="false" :current="tabscurrent" @change="tabschange" :show-bar='false'
|
||||
active-color='#26A888'></u-tabs>
|
||||
<view class="" v-if="total>0" style="margin-top: 80rpx;padding: 3%;">
|
||||
<view class="Apayment" v-for='(item,index) in orderlist' :key="index">
|
||||
<view class="names">店铺名称
|
||||
@ -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({
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -142,6 +142,19 @@
|
||||
@funcValue="getpickerParentValue" pickerSize="4">
|
||||
</m-city>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<u-popup v-model="buyshow" mode="bottom" length="45%" border-radius="30" :closeable='true'>
|
||||
<view class="payment">
|
||||
请选择支付方式
|
||||
</view>
|
||||
<view class="chat">
|
||||
<image src="/static/chat.png" mode=""></image>
|
||||
<span>微信支付</span>
|
||||
</view>
|
||||
<view class="submits" @tap='buy'>
|
||||
确认支付¥{{formdata.price}}
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
@ -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')
|
||||
})
|
||||
},
|
||||
// 显示三级地址联动
|
||||
|
||||
@ -139,6 +139,7 @@
|
||||
},
|
||||
onLoad(options) {
|
||||
let that = this
|
||||
console.log(options)
|
||||
this.updata = JSON.parse(options.updata)
|
||||
},
|
||||
methods: {
|
||||
|
||||
@ -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
|
||||
|
||||
BIN
static/chat.png
Normal file
BIN
static/chat.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Loading…
Reference in New Issue
Block a user