AA
This commit is contained in:
@@ -11,8 +11,8 @@ Page({
|
|||||||
height: '',
|
height: '',
|
||||||
url: app.globalData.url,
|
url: app.globalData.url,
|
||||||
|
|
||||||
statusType: ["全部", "待付款", "未使用", "退款"],
|
statusType: ["全部", "待付款", "待服务", "服务中", "已完成","已取消"],
|
||||||
status: ["", "1", "2", "3"],
|
status: ["", "1", "2", "3","8","-2"],
|
||||||
currentType: 0,
|
currentType: 0,
|
||||||
tabClass: ["", "", "", "", "", ""],
|
tabClass: ["", "", "", "", "", ""],
|
||||||
pageNum: 1
|
pageNum: 1
|
||||||
|
|||||||
@@ -47,6 +47,75 @@ Page({
|
|||||||
height: ''
|
height: ''
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
// 确认支付
|
||||||
|
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:服务中 时候的取消订单
|
* 订单状态:3:服务中 时候的取消订单
|
||||||
*/
|
*/
|
||||||
cancelOrderfwz() {
|
cancelOrderfwz() {
|
||||||
console.log('点击了取消订单')
|
|
||||||
this.setData({
|
|
||||||
dingdan_msgfwz: true,
|
this.completeService()
|
||||||
mengceng: true
|
|
||||||
})
|
// console.log('点击了取消订单')
|
||||||
|
// this.setData({
|
||||||
|
// dingdan_msgfwz: true,
|
||||||
|
// mengceng: true
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
okcancel() {
|
okcancel() {
|
||||||
console.log('点击了联系客服取消订单')
|
console.log('点击了联系客服取消订单')
|
||||||
@@ -247,6 +320,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秒
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 待服务时被坚持取消订单
|
* 待服务时被坚持取消订单
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<!-- 订单状态:3:服务中 -->
|
<!-- 订单状态:3:服务中 -->
|
||||||
<view wx:if="{{item.status==3}}" class="opt_view">
|
<view wx:if="{{item.status==3}}" class="opt_view">
|
||||||
<view class="detail_btn" bindtap="cancelOrderfwz">
|
<view class="detail_btn" bindtap="cancelOrderfwz">
|
||||||
提前结束订单
|
确认服务完成
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,8 @@
|
|||||||
"minifyWXML": true,
|
"minifyWXML": true,
|
||||||
"showES6CompileOption": false,
|
"showES6CompileOption": false,
|
||||||
"useCompilerPlugins": false,
|
"useCompilerPlugins": false,
|
||||||
"condition": false
|
"condition": false,
|
||||||
|
"ignoreUploadUnusedFiles": true
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "2.21.0",
|
"libVersion": "2.21.0",
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ Page({
|
|||||||
})
|
})
|
||||||
var day = this.checkDate()
|
var day = this.checkDate()
|
||||||
this.setData({
|
this.setData({
|
||||||
paymoney: this.data.danjia * day
|
paymoney: this.data.danjia * day/100
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
checkDate: function () {
|
checkDate: function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user