|
@@ -33,7 +33,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- order-info end -->
|
|
|
- <view class="order-tool" v-if="item.status == 0">
|
|
|
+ <view class="order-tool" v-if="item.status == 0 || item.status == 2">
|
|
|
<!-- <view class="order-tool-more">
|
|
|
<svg class="icon" aria-hidden="true">
|
|
|
<use xlink:href="#iconfengyunbang"></use>
|
|
@@ -43,6 +43,7 @@
|
|
|
<!-- <button type="default" class="btn" v-if="item.status != 0" @click="delOrder">删除订单</button> -->
|
|
|
<button type="default" class="btn" v-if="item.status == 0" @click.stop="cancelOrder(item)">取消订单</button>
|
|
|
<button type="default" class="btn" v-if="item.status == 0" @click.stop="pay(item)">我要付款</button>
|
|
|
+ <button type="default" class="btn" v-if="item.status == 2" @click.stop="received(item)">确认收货</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- order-item end -->
|
|
@@ -50,7 +51,7 @@
|
|
|
<!-- order end -->
|
|
|
</mescroll-body>
|
|
|
<uni-popup ref="popup" type="dialog">
|
|
|
- <uni-popup-dialog type="info" content="确认取消此订单吗?" :duration="2000" :before-close="true" @close="closepopup" @confirm="confirmpopup"></uni-popup-dialog>
|
|
|
+ <uni-popup-dialog type="info" :content="popupContent" :duration="2000" :before-close="true" @close="closepopup" @confirm="confirmpopup"></uni-popup-dialog>
|
|
|
</uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -82,7 +83,7 @@
|
|
|
page: {
|
|
|
size: 10 // 每页数据的数量,默认10
|
|
|
},
|
|
|
- noMoreSize: 4, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
|
|
|
+ noMoreSize: 3, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
|
|
|
empty: {
|
|
|
tip: '暂无相关数据'
|
|
|
}
|
|
@@ -96,6 +97,9 @@
|
|
|
},
|
|
|
orderlist:[],
|
|
|
cancelId:null,
|
|
|
+ receiveId:null,
|
|
|
+ popupContent:'',
|
|
|
+ popupType:'',
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -189,23 +193,45 @@
|
|
|
console.log(JSON.parse(JSON.stringify(item)));
|
|
|
this.cancelId = item.id;
|
|
|
this.$refs.popup.open();
|
|
|
-
|
|
|
+ this.popupContent = '确认取消此订单吗?';
|
|
|
+ this.popupType = 'cancel';
|
|
|
+ },
|
|
|
+ received(item){
|
|
|
+ this.receiveId = item.id;
|
|
|
+ this.$refs.popup.open();
|
|
|
+ this.popupContent = '确认收货?';
|
|
|
+ this.popupType = 'received';
|
|
|
},
|
|
|
closepopup(done){
|
|
|
done()
|
|
|
},
|
|
|
confirmpopup(done,value){
|
|
|
- this.$api.http.post(this.config.apiBaseurl + '/order/cancelUserOrder/?orderId='+this.cancelId,{},{
|
|
|
- header: {
|
|
|
- Accept:'application/json',
|
|
|
- Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
|
|
|
- },
|
|
|
- }).then(res => {
|
|
|
- this.downCallback();
|
|
|
- // console.log('res',res)
|
|
|
- }).catch(err =>{
|
|
|
- console.log('err',err)
|
|
|
- });
|
|
|
+ if(this.popupType == 'cancel'){
|
|
|
+ this.$api.http.post(this.config.apiBaseurl + '/order/cancelUserOrder/?orderId='+this.cancelId,{},{
|
|
|
+ header: {
|
|
|
+ Accept:'application/json',
|
|
|
+ Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ this.downCallback();
|
|
|
+ // console.log('res',res)
|
|
|
+ }).catch(err =>{
|
|
|
+ console.log('err',err)
|
|
|
+ });
|
|
|
+ }else if(this.popupType == 'received'){
|
|
|
+ this.$api.http.post(this.config.apiBaseurl + '/order/confirmReceiveOrder/?orderId='+this.receiveId,{},{
|
|
|
+ header: {
|
|
|
+ Accept:'application/json',
|
|
|
+ Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ this.downCallback();
|
|
|
+ // console.log('res',res)
|
|
|
+ }).catch(err =>{
|
|
|
+ console.log('err',err)
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
done()
|
|
|
},
|
|
|
changestatus(status){
|
|
@@ -231,8 +257,6 @@
|
|
|
// console.log('payres',res);
|
|
|
}).catch(err =>{console.log('err',err);});
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
|
|
|
}
|
|
|
}
|