Jacob
1 天以前 f7034f535b85264e0c5b18e82fc295dab2052304
pages/users/order_list/index.vue
....@@ -37,14 +37,14 @@
3737 <view class='title acea-row row-between-wrapper'>
3838 <view class="acea-row row-middle">
3939 <text class="sign cart-color acea-row row-center-wrapper"
40
- v-if="item.activityType !== '普通' && item.activityType !== '核销'">{{ item.activityType
41
- }}</text>
40
+ v-if="item.activityType && item.activityType !== '普通' && item.activityType !== '核销'">{{
41
+ item.activityType }}</text>
4242 <!-- <text class="sign cart-color acea-row row-center-wrapper" v-if="item.bargainId != 0">砍价</text>
4343 <text class="sign cart-color acea-row row-center-wrapper" v-else-if="item.storeOrder.combinationId != 0">拼团</text>
4444 <text class="sign cart-color acea-row row-center-wrapper" v-else-if="item.storeOrder.seckillId != 0">秒杀</text> -->
4545 <view>{{ item.createTime }}</view>
4646 </view>
47
- <view class='font-color'>{{ item.orderStatus }}</view>
47
+ <view class='font-color'>{{ item.orderStatus || '' }}</view>
4848 <!-- <view v-if="item.status?item.status.type == 0:0" class='font-color'>待付款</view>
4949 <view v-else-if="item.status?item.status.type == 1:0 && item.storeOrder.shippingType==1" class='font-color'>待发货</view>
5050 <view v-else-if="item.status?item.status.type == 2:0 && item.storeOrder.shippingType==1" class='font-color'>待收货</view>
....@@ -54,8 +54,7 @@
5454 </view>
5555 <orderListGoods :orderInfoList="item.orderInfoList"
5656 :zonePromotionList="item.zonePromotionList || []"></orderListGoods>
57
- <view class='totalPrice'>共{{ item.totalNum + getGiftCount(item.zonePromotionList || [])
58
- }}件商品,总金额
57
+ <view class='totalPrice'>共{{ getTotalNum(item) }}件商品,总金额
5958 <text class='money font-color' v-if="getPayWay(item.payPrice, item.payCareBean) == 1">
6059 <text class="color-blue">¥{{ toNumber(item.payPrice) }}</text>
6160 <text class="color-blue">+{{ toThousands(toNumber(item.payCareBean)) }}悦养豆</text>
....@@ -254,6 +253,9 @@
254253 });
255254 return count;
256255 },
256
+ getTotalNum(item) {
257
+ return (Number(item.totalNum) || 0) + this.getGiftCount(item.zonePromotionList || []);
258
+ },
257259 getPayWay(price, payCareBean) {
258260 console.log('阿斯顿发送到发送地方', Number(price) > 0 && Number(payCareBean) > 0);
259261 if (Number(price) > 0 && Number(payCareBean) > 0) {
....@@ -312,7 +314,9 @@
312314 getOrderData: function () {
313315 let that = this;
314316 orderData().then(res => {
315
- that.$set(that, 'orderData', res.data);
317
+ that.$set(that, 'orderData', (res && res.data) || {});
318
+ }).catch(() => {
319
+ that.$set(that, 'orderData', {});
316320 })
317321 },
318322 /**
....@@ -447,7 +451,7 @@
447451 page: that.page,
448452 limit: that.limit,
449453 }).then(res => {
450
- let list = res.data.list || [];
454
+ let list = (res && res.data && res.data.list) || [];
451455 let loadend = list.length < that.limit;
452456 that.orderList = that.$util.SplitArray(list, that.orderList);
453457 that.$set(that, 'orderList', that.orderList);