|
@@ -28,10 +28,10 @@
|
|
|
<view class="two">
|
|
|
<view class="two_1">
|
|
|
<view class="title">我的订单</view>
|
|
|
- <!-- <view class="title">
|
|
|
+ <view class="title">
|
|
|
<text @click="toOrder({route:'pagesMy/order/index',type:'order',status:'-0'})">全部订单</text>
|
|
|
<text class="iconfont icon-jiantouyou"></text>
|
|
|
- </view> -->
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="two_2">
|
|
|
<view class="orderList" v-for="(item, index) in orderList" :key="index" @click="toOrder(item)">
|
|
@@ -155,19 +155,22 @@
|
|
|
key: 'token',
|
|
|
success: async (res) => {
|
|
|
let user = that.$jwt(res.data);
|
|
|
- const arr = await that.$api(`/user/${user.id}`, 'GET');
|
|
|
- if (arr.errcode == '0') that.$set(that, `user`, arr.data);
|
|
|
- const market = await that.$api(`/storeGoods`, 'GET', {
|
|
|
- customer: user._id
|
|
|
- })
|
|
|
- if (market.errcode == '0') {
|
|
|
- that.$set(that, `market_num`, market.total)
|
|
|
- }
|
|
|
- const shop = await that.$api(`/storeShop`, 'GET', {
|
|
|
- customer: user._id
|
|
|
- })
|
|
|
- if (shop.errcode == '0') {
|
|
|
- that.$set(that, `shop_num`, shop.total)
|
|
|
+ that.$set(that, `user`, user);
|
|
|
+ if (user && user._id) {
|
|
|
+ let arr;
|
|
|
+ // 查询用户信息
|
|
|
+ arr = await that.$api(`/user/${user._id}`, 'GET');
|
|
|
+ if (arr.errcode == '0') that.$set(that, `user`, arr.data);
|
|
|
+ // 查询收藏商品
|
|
|
+ arr = await that.$api(`/storeGoods`, 'GET', {
|
|
|
+ customer: user._id
|
|
|
+ })
|
|
|
+ if (arr.errcode == '0') that.$set(that, `market_num`, arr.total);
|
|
|
+ // 查询收藏店铺
|
|
|
+ arr = await that.$api(`/storeShop`, 'GET', {
|
|
|
+ customer: user._id
|
|
|
+ })
|
|
|
+ if (arr.errcode == '0') that.$set(that, `shop_num`, arr.total);
|
|
|
}
|
|
|
},
|
|
|
fail: (err) => {}
|