|
@@ -29,31 +29,55 @@
|
|
|
<text class="status">{{item.status|filterOrderState}}</text>
|
|
|
</view>
|
|
|
<view class="center">
|
|
|
- <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">
|
|
|
- <view class="name ellipsis-2">{{goods.goodsName}}</view>
|
|
|
- <view class="specification ellipsis-1">规格:{{goods.specification}}</view>
|
|
|
+ <view v-for="goods in item.detailList" :key="goods.id" class="goods">
|
|
|
+ <view class="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">
|
|
|
+ <view class="name ellipsis-2">{{goods.goodsName}}</view>
|
|
|
+ <view class="specification ellipsis-1">规格:{{goods.specification}}</view>
|
|
|
+ </view>
|
|
|
+ </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>
|
|
|
+ <view class="quantity red">x {{goods.quantity}}</view>
|
|
|
</view>
|
|
|
</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>
|
|
|
- <view class="quantity red">x {{goods.quantity}}</view>
|
|
|
+ <view class="comment-btn" v-if="item.status==3">
|
|
|
+ <text class="btn green" @click="comment(item.id,goods.id,goods.goodsId)">
|
|
|
+ 评价
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <view class="comment-btn" v-if="item.status==6">
|
|
|
+ <text class="btn" @click="viewComment(goods.id,goods.goodsId,goods)">
|
|
|
+ 查看评价
|
|
|
+ </text>
|
|
|
</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">
|
|
|
- <view
|
|
|
- class="btn"
|
|
|
- :class="btn.class"
|
|
|
- @click.stop="clickEven(btn.fun,item)"
|
|
|
- v-for="(btn,index) in statusBtn[item.status]" :key="index">
|
|
|
- {{btn.name}}
|
|
|
+ <view class="bottom">
|
|
|
+ <!-- <view v-if="item.moreData" class="more" @click.stop="toggleMore(item,index)">
|
|
|
+ <text>查看剩余{{item.moreData.length}}件商品</text>
|
|
|
+ </view> -->
|
|
|
+ <view class="u-flex u-row-between">
|
|
|
+ <view class="left u-flex">
|
|
|
+ <view
|
|
|
+ class="btn"
|
|
|
+ :class="btn.class"
|
|
|
+ @click.stop="clickEven(btn.fun,item)"
|
|
|
+ v-for="(btn,index) in statusBtn[item.status]" :key="index">
|
|
|
+ {{btn.name}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="right">
|
|
|
+ <view class="order-price">
|
|
|
+ 合计金额:
|
|
|
+ <text style="font-weight: 600;">
|
|
|
+ ¥ {{item.orderPrice}}
|
|
|
+ <text v-if="item.orderType==2"> + {{item.creditPrice}}积分</text>
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -91,10 +115,12 @@
|
|
|
0:[{name:'取消订单',fun:'cancelOrder',class:''},{name:'去支付',fun:'pay',class:'red'}],
|
|
|
1:[{name:'申请退款',fun:'refund',class:''}],
|
|
|
2:[{name:'查看物流',fun:'logistics',class:''},{name:'确认收货',fun:'confirmReceipt',class:'green'}],
|
|
|
- 3:[{name:'查看物流',fun:'logistics',class:''},{name:'评价',fun:'evaluate',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:'logistics',class:''},{name:'查看评价',fun:'viewEvaluate',class:'green'}],
|
|
|
+ 6:[{name:'查看物流',fun:'logistics',class:''}],
|
|
|
+ // ,{name:'查看评价',fun:'viewEvaluate',class:'green'}
|
|
|
7:[{name:'查看退款',fun:'viewRefund',class:'green'}]
|
|
|
},
|
|
|
orderBadge:{
|
|
@@ -109,9 +135,19 @@
|
|
|
computed: {
|
|
|
orderListWithClass() {
|
|
|
return this.dataList.map(order => {
|
|
|
+ // let spliceData = order.detailList.splice(0,2);
|
|
|
+
|
|
|
+ let moreData = order.detailList.splice(2,order.detailList.length);
|
|
|
+ // if(order.detailList.length>2){
|
|
|
+ // moreData = order.detailList;
|
|
|
+ // }
|
|
|
return {
|
|
|
...order,
|
|
|
+ // spliceData:spliceData,
|
|
|
+ moreData:moreData,
|
|
|
+ showMore:false,
|
|
|
class: {
|
|
|
+ 0: 'status-0',
|
|
|
1: 'status-1',
|
|
|
2: 'status-2',
|
|
|
3: 'status-3',
|
|
@@ -148,6 +184,7 @@
|
|
|
},
|
|
|
/*上拉加载的回调*/
|
|
|
upCallback(page) {
|
|
|
+ this.statisticsOrder();
|
|
|
// 此处可以继续请求其他接口
|
|
|
// if(page.num == 1){
|
|
|
// // 请求其他接口...
|
|
@@ -201,7 +238,6 @@
|
|
|
/*若希望重新加载列表,只需调用此方法即可(内部会自动page.num=1,再主动触发up.callback)*/
|
|
|
reloadList() {
|
|
|
this.mescroll.resetUpScroll();
|
|
|
- this.statisticsOrder();
|
|
|
},
|
|
|
tabsClick(item){
|
|
|
// this.status = item.status;
|
|
@@ -214,6 +250,17 @@
|
|
|
id: id
|
|
|
});
|
|
|
},
|
|
|
+ toggleMore(item,index){
|
|
|
+ console.log('toggleMore',item);
|
|
|
+ this.orderListWithClass[index].showMore = !this.orderListWithClass[index].showMore
|
|
|
+ if(item.detailList.length<=2){
|
|
|
+ // this.orderListWithClass[index].detailList = item.detailList.concat(item.moreData);
|
|
|
+ this.$set(this.orderListWithClass, index, item.moreData);
|
|
|
+ }else{
|
|
|
+ this.orderListWithClass[index].detailList = this.orderListWithClass[index].detailList.slice(0, 2);
|
|
|
+ }
|
|
|
+ console.log('this.orderListWithClass[index]',this.orderListWithClass[index]);
|
|
|
+ },
|
|
|
clickEven(fun,item){
|
|
|
// console.log('fun',fun);
|
|
|
let funObj = {
|
|
@@ -251,6 +298,20 @@
|
|
|
id: item.id
|
|
|
});
|
|
|
},
|
|
|
+ comment(orderId,orderDetailId,goodsId){
|
|
|
+ uni.$u.route('/shopping/addcomment', {
|
|
|
+ orderId,
|
|
|
+ orderDetailId,
|
|
|
+ goodsId
|
|
|
+ });
|
|
|
+ },
|
|
|
+ viewComment(orderDetailId,goodsId,goods){
|
|
|
+ uni.$u.route('/shopping/viewcomment', {
|
|
|
+ orderDetailId,
|
|
|
+ goodsId,
|
|
|
+ goods:JSON.stringify(goods)
|
|
|
+ });
|
|
|
+ },
|
|
|
refund(item){
|
|
|
// console.log('logistics',item);
|
|
|
uni.$u.route('/shopping/refund', {
|
|
@@ -321,26 +382,26 @@
|
|
|
this.orderBadge = Object.assign(this.orderBadge,data);
|
|
|
let {noPayNum,deliverNum,collectNum,commentNum,refundNum} = res.data;
|
|
|
let noPayNumindex = this.tabsList.findIndex(item => item.status == 0);
|
|
|
- if(noPayNum>0){
|
|
|
+
|
|
|
this.tabsList[1].badge.isDot = false;
|
|
|
this.tabsList[1].badge.value = noPayNum;
|
|
|
- }
|
|
|
- if(deliverNum>0){
|
|
|
+
|
|
|
+
|
|
|
this.tabsList[2].badge.isDot = false;
|
|
|
this.tabsList[2].badge.value = deliverNum;
|
|
|
- }
|
|
|
- if(collectNum>0){
|
|
|
+
|
|
|
+
|
|
|
this.tabsList[3].badge.isDot = false;
|
|
|
this.tabsList[3].badge.value = collectNum;
|
|
|
- }
|
|
|
- if(commentNum>0){
|
|
|
+
|
|
|
+
|
|
|
this.tabsList[4].badge.isDot = false;
|
|
|
this.tabsList[4].badge.value = commentNum;
|
|
|
- }
|
|
|
- if(refundNum>0){
|
|
|
+
|
|
|
+
|
|
|
this.tabsList[5].badge.isDot = false;
|
|
|
this.tabsList[5].badge.value = refundNum;
|
|
|
- }
|
|
|
+
|
|
|
// console.log('statisticsOrder',res.data);
|
|
|
// console.log('this.orderBadge',this.orderBadge);
|
|
|
}).catch(err=>{
|
|
@@ -393,6 +454,20 @@ page{
|
|
|
border-bottom: 0.5px solid #eee;
|
|
|
}
|
|
|
}
|
|
|
+ .comment-btn{
|
|
|
+ margin-top: 20rpx;
|
|
|
+ text-align: right;
|
|
|
+ .btn{
|
|
|
+ font-size: 24rpx;
|
|
|
+ padding: 10rpx 50rpx;
|
|
|
+ border-radius: 28rpx;
|
|
|
+ border: 1px solid #333;
|
|
|
+ &.green{
|
|
|
+ border-color: #00A447;
|
|
|
+ color: #00A447;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.text{
|
|
|
margin-left: 20rpx;
|
|
|
.specification{
|
|
@@ -413,22 +488,30 @@ page{
|
|
|
.order-price{
|
|
|
text-align: right;
|
|
|
margin-bottom: 20rpx;
|
|
|
- font-weight: 600;
|
|
|
}
|
|
|
.bottom{
|
|
|
font-size: 24rpx;
|
|
|
- .left{color: #333;}
|
|
|
- .right{
|
|
|
+ .left{
|
|
|
+ color: #333;
|
|
|
.btn{
|
|
|
padding: 12rpx 20rpx;
|
|
|
border: 1px solid #333;
|
|
|
text-align: center;
|
|
|
- margin-left: 20rpx;
|
|
|
border-radius: 28rpx;
|
|
|
&.red{border-color: #FF3C3F;}
|
|
|
&.green{color: #00A447;border-color: #00A447;}
|
|
|
+ &:not(:first-child){
|
|
|
+ margin-left: 20rpx;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ .more{
|
|
|
+ text-align: center;
|
|
|
+ padding: 20rpx 0;
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
}
|
|
|
&.status-0{.status{color:#FF3C3F;}}
|
|
|
&.status-1{.status{color:#FF3C3F;}}
|