|
@@ -27,7 +27,7 @@
|
|
|
<text class="status">{{item.status|filterOrderState}}</text>
|
|
|
</view>
|
|
|
<view class="center">
|
|
|
- <view v-for="goods in item.detailList" class="goods u-flex u-row-between">
|
|
|
+ <view v-for="goods in item.detailList" :key="goods.id" class="goods u-flex u-row-between">
|
|
|
<view class="left u-flex">
|
|
|
<u--image :showLoading="true" :src="goods.mainImg" width="128rpx" height="128rpx"></u--image>
|
|
|
<view class="text">
|
|
@@ -37,10 +37,12 @@
|
|
|
</view>
|
|
|
<view class="right">
|
|
|
<u-icon name="arrow-right" color="#999" size="24"></u-icon>
|
|
|
- <text class="price red">¥ <text class="price-num">{{goods.price}}</text></text>
|
|
|
+ <text class="price red">¥ <text class="price-num">{{goods.price}} </text></text>
|
|
|
+ <view class="quantity red">x {{goods.quantity}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="order-price red">合计金额: ¥ {{item.orderPrice}}</view>
|
|
|
<view class="bottom u-flex u-row-between">
|
|
|
<view class="left"></view>
|
|
|
<view class="right u-flex">
|
|
@@ -57,6 +59,7 @@
|
|
|
</view>
|
|
|
</mescroll-body>
|
|
|
</view>
|
|
|
+ <u-toast ref="uToast"></u-toast>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -70,10 +73,12 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ hasfetch:false,
|
|
|
tabsCurrent:1,
|
|
|
tabsList:[
|
|
|
{name:'全部',status:'',},
|
|
|
{name:'待付款',status:'0',},
|
|
|
+ {name:'待发货',status:'1',},
|
|
|
{name:'待收货',status:'2'},
|
|
|
{name:'待评价',status:'3'},
|
|
|
{name:'退款/售后',status:'7'}
|
|
@@ -81,14 +86,14 @@
|
|
|
status:'',
|
|
|
dataList:[{status:0},{status:1},{status:2},{status:3},{status:4}],
|
|
|
statusBtn:{
|
|
|
- 0:[{name:'取消订单',fun:'cancel ',class:''},{name:'去支付',fun:'pay',class:'red'}],
|
|
|
+ 0:[{name:'取消订单',fun:'cancelOrder',class:''},{name:'去支付',fun:'pay',class:'red'}],
|
|
|
1:[{name:'申请退款',fun:'refund',class:'green'}],
|
|
|
2:[{name:'查看物流',fun:'logistics',class:''},{name:'确认收货',fun:'confirmReceipt',class:'green'}],
|
|
|
3:[{name:'查看物流',fun:'logistics',class:''},{name:'评价',fun:'evaluate',class:'green'}],
|
|
|
// 4:[{name:'查看物流',fun:'logistics',class:''},{name:'评价',fun:'evaluate',class:'green'}],
|
|
|
5:[{name:'查看退款',fun:'viewRefund',class:'green'}],
|
|
|
// 6:[{name:'查看退款',fun:'viewRefund',class:'green'}],
|
|
|
- // 7:[{name:'查看退款',fun:'viewRefund',class:'green'}]
|
|
|
+ 7:[{name:'查看退款',fun:'viewRefund',class:'green'}]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -112,8 +117,13 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad(page) {
|
|
|
- console.log('page',page);
|
|
|
- this.tabsCurrent = page.current || 0;
|
|
|
+ // console.log('page',page);
|
|
|
+ const status = page.status;
|
|
|
+ const index = this.tabsList.findIndex(item => item.status === status);
|
|
|
+ this.tabsCurrent = index || 0;
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ this.hasfetch&&this.reloadList()
|
|
|
},
|
|
|
methods: {
|
|
|
leftClick(){
|
|
@@ -145,9 +155,11 @@
|
|
|
pageNum : page.num,
|
|
|
pageSize : page.size,
|
|
|
status : this.tabsList[this.tabsCurrent].status,
|
|
|
+ // status : this.tabsList[this.tabsCurrent].status,
|
|
|
}
|
|
|
// console.log('this.params',params);
|
|
|
this.$u.api.orderList(params).then(data => {
|
|
|
+ this.hasfetch = true;
|
|
|
console.log('data',JSON.parse(JSON.stringify(data)));
|
|
|
// 接口返回的当前页数据列表 (数组)
|
|
|
let curPageData = data.data.rows;
|
|
@@ -198,26 +210,62 @@
|
|
|
let funObj = {
|
|
|
pay: this.pay,
|
|
|
logistics:this.logistics,
|
|
|
- evaluate:this.evaluate
|
|
|
+ evaluate:this.evaluate,
|
|
|
+ refund:this.refund,
|
|
|
+ cancelOrder:this.cancelOrder,
|
|
|
+ viewRefund:this.viewRefund
|
|
|
};
|
|
|
+ // console.log('funObj[fun]',funObj[fun]);
|
|
|
if (fun in funObj) {
|
|
|
funObj[fun](item);
|
|
|
}
|
|
|
},
|
|
|
pay(item){
|
|
|
console.log('pay',item);
|
|
|
+ uni.$u.route('/shopping/pay', {
|
|
|
+ orderId: item.id,
|
|
|
+ // openid: that.vuex_wechatOpenid,
|
|
|
+ payAmount:item.orderPrice
|
|
|
+ });
|
|
|
},
|
|
|
logistics(item){
|
|
|
- console.log('logistics',item);
|
|
|
+ // console.log('logistics',item);
|
|
|
uni.$u.route('/shopping/distribution', {
|
|
|
- name: 'lisa'
|
|
|
+ orderId: item.id
|
|
|
});
|
|
|
},
|
|
|
evaluate(item){
|
|
|
- console.log('logistics',item);
|
|
|
+ // console.log('logistics',item);
|
|
|
uni.$u.route('/shopping/evaluate', {
|
|
|
id: item.id
|
|
|
});
|
|
|
+ },
|
|
|
+ refund(item){
|
|
|
+ // console.log('logistics',item);
|
|
|
+ uni.$u.route('/shopping/refund', {
|
|
|
+ id: item.id
|
|
|
+ });
|
|
|
+ },
|
|
|
+ cancelOrder(item){
|
|
|
+ let that = this;
|
|
|
+ // console.log('logistics',item);
|
|
|
+ this.$u.api.cancelOrder({orderId:item.id}).then(res=>{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ message:res.msg,
|
|
|
+ complete() {
|
|
|
+ that.reloadList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // uni.$u.toast(res.msg);
|
|
|
+ console.log('res',res.data);
|
|
|
+ }).catch(err=>{
|
|
|
+ console.log('cancelOrder',err);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ viewRefund(item){
|
|
|
+ uni.$u.route('/shopping/viewRefund', {
|
|
|
+ id: item.id
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -282,6 +330,11 @@ page{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .order-price{
|
|
|
+ text-align: right;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
.bottom{
|
|
|
font-size: 24rpx;
|
|
|
.left{color: #333;}
|