This commit is contained in:
renjianbo0118
2023-04-30 23:21:15 +08:00
parent 1a9aa76822
commit e59e93f33e
5 changed files with 108 additions and 10 deletions

View File

@@ -11,8 +11,8 @@ Page({
height: '',
url: app.globalData.url,
statusType: ["全部", "待付款", "未使用", "退款"],
status: ["", "1", "2", "3"],
statusType: ["全部", "待付款", "待服务", "服务中", "已完成","已取消"],
status: ["", "1", "2", "3","8","-2"],
currentType: 0,
tabClass: ["", "", "", "", "", ""],
pageNum: 1

View File

@@ -48,6 +48,75 @@ Page({
},
// 确认支付
confirm_pay: async function () {
var that = this;
if (!this.data.is_ok_click) {
that.setData({
is_ok_click: true
})
//你要执行的操作
this.godetail()
setTimeout(function () {
that.setData({
is_ok_click: false
})
}, 10000) //阻止一秒点击多次
} else {
// wx.showToast({
// title: '请勿重复操作!',
// })
}
},
godetail() {
console.log('点击了去付款');
var _this = this;
console.log(this.data.id + 'tttttttttttttttttttttttttttttttttt')
wx.request({
// url: app.globalData.url + '/system/weixinPayNew/12345666',
//order_id为8位数字
url: app.globalData.url + '/system/order/weixinPay/' + this.data.order_id,
header: app.getRequestHeader(),
method: 'GET',
data: {
},
success(res) {
if (res.data.code == 200) {
console.log('timeStamp==' + res.data.data.timeStamp)
console.log('nonceStr==' + res.data.data.nonceStr)
console.log('package==' + res.data.data.package)
console.log('signType==' + res.data.data.signType)
console.log('paySign==' + res.data.data.paySign)
wx.requestPayment({
timeStamp: res.data.data.timeStamp,
nonceStr: res.data.data.nonceStr,
package: res.data.data.package,
signType: res.data.data.signType,
paySign: res.data.data.paySign,
success(res) {
console.log('支付成功');
wx.navigateTo({
url: '/shopping/pages/paysuccess/paysuccess',
})
},
fail(res) {
console.log('支付失败');
}
})
} else {
wx.showToast({
title: res.data.msg,
icon: 'error',
duration: 2000
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
@@ -164,11 +233,15 @@ Page({
* 订单状态3服务中 时候的取消订单
*/
cancelOrderfwz() {
console.log('点击了取消订单')
this.setData({
dingdan_msgfwz: true,
mengceng: true
})
this.completeService()
// console.log('点击了取消订单')
// this.setData({
// dingdan_msgfwz: true,
// mengceng: true
// })
},
okcancel() {
console.log('点击了联系客服取消订单')
@@ -248,6 +321,30 @@ Page({
});
},
//确认完成服务
completeService() {
var that = this;
wx.request({
url: app.globalData.url + '/system/view/completeOrder',
header: app.getRequestHeader(),
method: 'post',
data: {
orderId: that.data.order_id
},
success: function (res) {
var resp = res.data;
if (res.data.code == 200) {
wx.showToast({
title: res.data.msg,
})
setTimeout(function () {
//要延时执行的代码
wx.navigateBack()
}, 2000) //延迟时间 这里是2秒
}
}
});
},
/**
* 待服务时被坚持取消订单
*/

View File

@@ -58,7 +58,7 @@
<!-- 订单状态3服务中 -->
<view wx:if="{{item.status==3}}" class="opt_view">
<view class="detail_btn" bindtap="cancelOrderfwz">
提前结束订单
确认服务完成
</view>
</view>

View File

@@ -46,7 +46,8 @@
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"condition": false
"condition": false,
"ignoreUploadUnusedFiles": true
},
"compileType": "miniprogram",
"libVersion": "2.21.0",

View File

@@ -178,7 +178,7 @@ Page({
})
var day = this.checkDate()
this.setData({
paymoney: this.data.danjia * day
paymoney: this.data.danjia * day/100
})
},
checkDate: function () {