diff --git a/pages/order/order.js b/pages/order/order.js index 5f3fbfa..1804ef2 100644 --- a/pages/order/order.js +++ b/pages/order/order.js @@ -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 diff --git a/pages/orderdetail/orderdetail.js b/pages/orderdetail/orderdetail.js index fe1f375..93606c3 100644 --- a/pages/orderdetail/orderdetail.js +++ b/pages/orderdetail/orderdetail.js @@ -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秒 + } + } + }); + }, /** * 待服务时被坚持取消订单 */ diff --git a/pages/orderdetail/orderdetail.wxml b/pages/orderdetail/orderdetail.wxml index 3571b2c..057c8ad 100644 --- a/pages/orderdetail/orderdetail.wxml +++ b/pages/orderdetail/orderdetail.wxml @@ -58,7 +58,7 @@ - 提前结束订单 + 确认服务完成 diff --git a/project.config.json b/project.config.json index b8cd1fa..4a19c28 100644 --- a/project.config.json +++ b/project.config.json @@ -46,7 +46,8 @@ "minifyWXML": true, "showES6CompileOption": false, "useCompilerPlugins": false, - "condition": false + "condition": false, + "ignoreUploadUnusedFiles": true }, "compileType": "miniprogram", "libVersion": "2.21.0", diff --git a/shopping/pages/goddess/goddess.js b/shopping/pages/goddess/goddess.js index 3a6252f..59d83bd 100644 --- a/shopping/pages/goddess/goddess.js +++ b/shopping/pages/goddess/goddess.js @@ -178,7 +178,7 @@ Page({ }) var day = this.checkDate() this.setData({ - paymoney: this.data.danjia * day + paymoney: this.data.danjia * day/100 }) }, checkDate: function () {