|
@@ -229,6 +229,41 @@ export default {
|
|
|
uni.$off('selectAddr', this.onAddressSelected);
|
|
uni.$off('selectAddr', this.onAddressSelected);
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ hasPayOrderNo(payOrderNo) {
|
|
|
|
|
+ return payOrderNo !== null && payOrderNo !== undefined && String(payOrderNo).trim() !== '';
|
|
|
|
|
+ },
|
|
|
|
|
+ openWechatConfirmReceive(payOrderNo) {
|
|
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
|
|
+ if (typeof wx === 'undefined' || typeof wx.openBusinessView !== 'function') {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ wx.openBusinessView({
|
|
|
|
|
+ businessType: 'weappOrderConfirm',
|
|
|
|
|
+ extraData: {
|
|
|
|
|
+ transaction_id: payOrderNo
|
|
|
|
|
+ },
|
|
|
|
|
+ success: () => {
|
|
|
|
|
+ uni.showLoading({ title: '处理中' });
|
|
|
|
|
+ this.$u.api.confirmReceiveAjax({ orderId: this.orderInfo.orderId }).then(res => {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ uni.showToast({ title: '收货成功', icon: 'success' });
|
|
|
|
|
+ this.loadOrderDetail(this.orderInfo.orderId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ const errMsg = (err && err.errMsg) ? err.errMsg : '';
|
|
|
|
|
+ if (errMsg.indexOf('cancel') > -1) return;
|
|
|
|
|
+ uni.showToast({ title: '暂无法唤起微信确认收货', icon: 'none' });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return true;
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ return false;
|
|
|
|
|
+ },
|
|
|
onAddressSelected(addr) {
|
|
onAddressSelected(addr) {
|
|
|
if (this.isModifyingAddress && addr && addr.id) {
|
|
if (this.isModifyingAddress && addr && addr.id) {
|
|
|
this.$u.api.modifyOrderAddressAjax({
|
|
this.$u.api.modifyOrderAddressAjax({
|
|
@@ -388,6 +423,9 @@ export default {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (type === 'confirm') {
|
|
if (type === 'confirm') {
|
|
|
|
|
+ if (this.orderInfo.showConfirmShop == 1 && this.hasPayOrderNo(this.orderInfo.payOrderNo) && this.openWechatConfirmReceive(this.orderInfo.payOrderNo)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
title: '提示',
|
|
|
content: '是否确认收货?',
|
|
content: '是否确认收货?',
|