|
@@ -269,26 +269,61 @@ export default {
|
|
|
moneyNum(value){
|
|
|
return +value;
|
|
|
},
|
|
|
+ orderTakes(item,index) {
|
|
|
+ let obj = this;
|
|
|
+ orderTake({
|
|
|
+ uni: item.order_id
|
|
|
+ })
|
|
|
+ .then(e => {
|
|
|
+
|
|
|
+ obj.navList[obj.tabCurrentIndex].orderList.splice(index, 1);
|
|
|
+ uni.showToast({
|
|
|
+ title: '收货成功'
|
|
|
+ });
|
|
|
+ // #ifdef MP
|
|
|
+
|
|
|
+ // #endif
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
// 确认收货
|
|
|
orderTake(item, index) {
|
|
|
let obj = this;
|
|
|
+ // #ifdef MP
|
|
|
+ if (wx.openBusinessView && item.order_id && item.mechId && item.wx_order_num) {
|
|
|
+ wx.openBusinessView({
|
|
|
+ businessType: 'weappOrderConfirm',
|
|
|
+ extraData: {
|
|
|
+ merchant_id: item.mechId,
|
|
|
+ merchant_trade_no: item.order_id,
|
|
|
+ transaction_id: item.wx_order_num
|
|
|
+ },
|
|
|
+ success() {
|
|
|
+ //dosomething
|
|
|
+ obj.orderTakes(item, index)
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ //dosomething
|
|
|
+ },
|
|
|
+ complete(ress) {
|
|
|
+ //dosomething
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ obj.orderTakes(item, index)
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ // #ifndef MP
|
|
|
uni.showModal({
|
|
|
title: '是否确认收货?',
|
|
|
success: () => {
|
|
|
- orderTake({
|
|
|
- uni: item.order_id
|
|
|
- })
|
|
|
- .then(e => {
|
|
|
- obj.navList[obj.tabCurrentIndex].orderList.splice(index, 1);
|
|
|
- uni.showToast({
|
|
|
- title: '收货成功'
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- console.log(e);
|
|
|
- });
|
|
|
+ obj.orderTakes(item, index)
|
|
|
}
|
|
|
});
|
|
|
+ // #endif
|
|
|
+
|
|
|
},
|
|
|
//跳转到订单详情
|
|
|
goToOrderDetail(e) {
|