|
@@ -440,26 +440,64 @@ export default {
|
|
|
// 点击支付按钮回调
|
|
// 点击支付按钮回调
|
|
|
async handlePay(item) {
|
|
async handlePay(item) {
|
|
|
const res = await this.$myRequest_repairs({
|
|
const res = await this.$myRequest_repairs({
|
|
|
- url: '/repairPayRecord/repairPayment',
|
|
|
|
|
|
|
+ url: '/repairRecord/pay',
|
|
|
method: 'post',
|
|
method: 'post',
|
|
|
data: {
|
|
data: {
|
|
|
recordId: item.id,
|
|
recordId: item.id,
|
|
|
- userId: this.userId,
|
|
|
|
|
- price: item.price
|
|
|
|
|
|
|
+ openid: uni.getStorageSync('openId'),
|
|
|
|
|
+ totalPrice: item.price
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
// console.log(res)
|
|
// console.log(res)
|
|
|
- if (res.cdoe === '200') {
|
|
|
|
|
|
|
+ if (res.code === '200') {
|
|
|
|
|
+ uni.requestPayment({
|
|
|
|
|
+ provider: 'wxpay',
|
|
|
|
|
+ timeStamp: res.data.timeStamp,
|
|
|
|
|
+ nonceStr: res.data.nonceStr,
|
|
|
|
|
+ package: 'prepay_id=' + res.data.prepay_id,
|
|
|
|
|
+ signType: res.data.signType,
|
|
|
|
|
+ paySign: res.data.paySign,
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (res.errMsg == 'requestPayment:ok') {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '支付成功',
|
|
|
|
|
+ icon: 'success',
|
|
|
|
|
+ mask: true
|
|
|
|
|
+ })
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ // 清空数组
|
|
|
|
|
+ this.list = []
|
|
|
|
|
+ // 重置当前页面可以滚动
|
|
|
|
|
+ this.scrollY = true
|
|
|
|
|
+ // 重置请求数据当前页参数
|
|
|
|
|
+ this.currentPage = 1
|
|
|
|
|
+ this.getRepairList()
|
|
|
|
|
+ this.getRepairCount()
|
|
|
|
|
+ }, 1500)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '支付失败',
|
|
|
|
|
+ icon: 'error',
|
|
|
|
|
+ mask: true
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ if (err.errMsg === 'requestPayment:fail cancel') {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '支付已取消',
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ mask: true
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: '支付成功',
|
|
|
|
|
- icon: 'success',
|
|
|
|
|
|
|
+ title: res.message,
|
|
|
|
|
+ icon: 'none',
|
|
|
mask: true
|
|
mask: true
|
|
|
})
|
|
})
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.list = []
|
|
|
|
|
- this.currentPage = 1
|
|
|
|
|
- this.getRepairList()
|
|
|
|
|
- }, 1500)
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 点击录音播放回调
|
|
// 点击录音播放回调
|
|
@@ -644,6 +682,7 @@ export default {
|
|
|
|
|
|
|
|
.box_value2 {
|
|
.box_value2 {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
|
|
|
img {
|
|
img {
|
|
|
margin-top: -2rpx;
|
|
margin-top: -2rpx;
|