Selaa lähdekoodia

优惠券列表刷新

Xiao_123 1 vuosi sitten
vanhempi
commit
523c455964

+ 1 - 9
pages/coupon/detail.vue

@@ -33,15 +33,7 @@
               @click="getCoupon"
             >
               <text v-if="state.id > 0">{{ state.coupon.canTake ? '立即领取' : '已领取' }}</text>
-              <text v-else>
-                {{
-                  state.coupon.status === 1
-                    ? '立即使用'
-                    : state.coupon.status === 2
-                    ? '已使用'
-                    : '已过期'
-                }}
-              </text>
+              <text v-else>{{ state.coupon.status === 1 ? '立即使用' : state.coupon.status === 2 ? '已使用' : '已过期' }}</text>
             </button>
             <view class="time ss-m-y-30" v-if="state.coupon.validityType === 2">
               有效期:领取后 {{ state.coupon.fixedEndTerm }} 天内可用

+ 26 - 18
pages/coupon/list.vue

@@ -69,7 +69,7 @@
 
 <script setup>
   import sheep from '@/sheep';
-  import { onLoad, onReachBottom } from '@dcloudio/uni-app';
+  import { onLoad, onReachBottom, onShow } from '@dcloudio/uni-app';
   import { reactive } from 'vue';
   import _ from 'lodash-es';
   import { resetPagination } from '@/sheep/util';
@@ -129,7 +129,8 @@
     if (code !== 0) {
       return;
     }
-    state.pagination.list = _.concat(state.pagination.list, data.list);
+    // state.pagination.list = _.concat(state.pagination.list, data.list);
+    state.pagination.list = data.list
     state.pagination.total = data.total;
     state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
   }
@@ -145,7 +146,8 @@
     if (code !== 0) {
       return;
     }
-    state.pagination.list = _.concat(state.pagination.list, data.list);
+    // state.pagination.list = _.concat(state.pagination.list, data.list);
+    state.pagination.list = data.list
     state.pagination.total = data.total;
     state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
   }
@@ -178,21 +180,27 @@
     }
   }
 
-  onLoad((Option) => {
-    // 领劵中心
-    if (Option.type === 'all' || !Option.type) {
-      getData();
-      // 我的优惠劵
-    } else {
-      Option.type === 'geted'
-        ? (state.currentTab = 1)
-        : Option.type === 'used'
-        ? (state.currentTab = 2)
-        : (state.currentTab = 3);
-      state.type = state.currentTab;
-      getCoupon();
-    }
-  });
+  // onLoad((Option) => {
+  //   // 领劵中心
+  //   if (Option.type === 'all' || !Option.type) {
+  //     getData();
+  //     // 我的优惠劵
+  //   } else {
+  //     Option.type === 'geted'
+  //       ? (state.currentTab = 1)
+  //       : Option.type === 'used'
+  //       ? (state.currentTab = 2)
+  //       : (state.currentTab = 3);
+  //     state.type = state.currentTab;
+  //     getCoupon();
+  //   }
+  // });
+
+  onShow(() => {
+    state.type = 0
+    state.currentTab = 0
+    getData()
+  })
 
   onReachBottom(() => {
     loadMore();

+ 33 - 30
pages/user/goods_details_store/index.vue

@@ -1,45 +1,48 @@
 <template>
   <s-layout title="选择自提门店" :bgStyle="{ color: '#FFF' }">
     <view class="storeBox" ref="container">
-      <view class="storeBox-box" v-for="(item, index) in state.storeList" :key="index" @tap="checked(item)">
-        <view class="store-img">
-          <image :src="item.logo" class="img" />
-        </view>
-        <view class="store-cent-left">
-          <view class="store-name">{{ item.name }}</view>
-          <view class="store-address line1">
-            {{ item.areaName }}{{ ', ' + item.detailAddress }}
+      <s-empty v-if="!state.storeList.length" icon="/static/order-empty.png" text="暂无自提门店" />
+      <view v-else>
+        <view class="storeBox-box" v-for="(item, index) in state.storeList" :key="index" @tap="checked(item)">
+          <view class="store-img">
+            <image :src="item.logo" class="img" />
           </view>
-        </view>
-        <view class="row-right ss-flex-col ss-col-center">
-          <view>
-            <!-- #ifdef H5 -->
-            <a class="store-phone" :href="'tel:' + item.phone">
-              <view class="iconfont">
-                <view class="ss-rest-button">
-                  <text class="_icon-forward" />
+          <view class="store-cent-left">
+            <view class="store-name">{{ item.name }}</view>
+            <view class="store-address line1">
+              {{ item.areaName }}{{ ', ' + item.detailAddress }}
+            </view>
+          </view>
+          <view class="row-right ss-flex-col ss-col-center">
+            <view>
+              <!-- #ifdef H5 -->
+              <a class="store-phone" :href="'tel:' + item.phone">
+                <view class="iconfont">
+                  <view class="ss-rest-button">
+                    <text class="_icon-forward" />
+                  </view>
+                </view>
+              </a>
+              <!-- #endif -->
+              <!-- #ifdef MP -->
+              <view class="store-phone" @click="call(item.phone)">
+                <view class="iconfont">
+                  <view class="ss-rest-button">
+                    <text class="_icon-forward" />
+                  </view>
                 </view>
               </view>
-            </a>
-            <!-- #endif -->
-            <!-- #ifdef MP -->
-            <view class="store-phone" @click="call(item.phone)">
+              <!-- #endif -->
+            </view>
+            <view class="store-distance ss-flex ss-row-center" @tap.stop="showMaoLocation(item)">
+              <text class="addressTxt" v-if="item.distance">距离{{ item.distance.toFixed(2) }}千米</text>
+              <text class="addressTxt" v-else>查看地图</text>
               <view class="iconfont">
                 <view class="ss-rest-button">
                   <text class="_icon-forward" />
                 </view>
               </view>
             </view>
-            <!-- #endif -->
-          </view>
-          <view class="store-distance ss-flex ss-row-center" @tap.stop="showMaoLocation(item)">
-            <text class="addressTxt" v-if="item.distance">距离{{ item.distance.toFixed(2) }}千米</text>
-            <text class="addressTxt" v-else>查看地图</text>
-            <view class="iconfont">
-              <view class="ss-rest-button">
-                <text class="_icon-forward" />
-              </view>
-            </view>
           </view>
         </view>
       </view>

+ 2 - 1
sheep/api/member/auth.js

@@ -57,7 +57,8 @@ const AuthUtil = {
   // 刷新令牌
   refreshToken: (refreshToken) => {
     return request({
-      url: '/member/auth/refresh-token',
+      // url: '/member/auth/refresh-token',
+      url: '/menduner/system/auth/refresh-token',
       method: 'POST',
       params: {
         refreshToken