export default { methods: { // 酒店支付订单 payOrder(id){ let self = this this.$api('orderPay', { id }, res => { if (res.code == 200) { uni.requestPayment({ provider: 'wxpay', // 服务提提供商 timeStamp: res.result.timeStamp, // 时间戳 nonceStr: res.result.nonceStr, // 随机字符串 package: res.result.packageValue, signType: res.result.signType, // 签名算法 paySign: res.result.paySign, // 签名 success: function(res) { self.getData() }, fail: function(err) { console.log('支付失败', err); // self.$refs.confirmationPopup.close() uni.showToast({ icon: 'none', title: "支付失败" }) } }); } }) }, // 确认收货 confirmReceiveGoods(item) { let self = this uni.showModal({ title: '您收到货了吗?', success(res) { if (res.confirm) { self.$api('orderConfirm', { id: item.id }, res => { if (res.code == 200) { self.getData() } }) } } }) }, // 水洗店确认接单 orderConfirmAccept(item){ let self = this this.$api('orderConfirmAccept', { id: item.id }, res => { if (res.code == 200) { uni.showToast({ title: '接单成功', icon: 'none' }) self.getData() } }) }, // 水洗店确认破损0无破损,1破损 orderConfirmedDamage(item, flag){ let self = this this.$api('orderConfirmAccept', { id: item.id, flag, }, res => { if (res.code == 200) { uni.showToast({ title: '上报成功', icon: 'none' }) self.getData() } }) }, // 水洗店完成水洗 orderFinishedWashing(item){ let self = this self.$api('orderConfirm', { id: item.id }, res => { if (res.code == 200) { self.getData() } }) }, } }