소스 검색

【DE】【C端】临时停车微服务。缴费记录底部“查看更多”和“没有更多数据了”,不会根据用户缴费记录实际情况显示

john 2 년 전
부모
커밋
f59d0549da

+ 5 - 1
src/pages/parkingFee/components/base/parkingFeeList.vue

@@ -53,7 +53,11 @@
         </div>
       </div>
       <div class="notice-info">
-        <div>{{ list.length === 4 ? '查看更多' : '没有更多数据了' }}</div>
+<!--        <div>{{ list.length === 4 ? '查看更多' : '没有更多数据了' }}</div>-->
+        <!-- 为确保用户可以执行下滑动作,设置单次响应的数据量为4 -->
+        <div
+        >{{ list.length === 4 && list.length < numberOfElements? '查看更多' : '没有更多数据了' }}
+        </div>
 <!--        <uni-icons-->
 <!--          v-if="list.length === 4"-->
 <!--          type="arrowdown"-->

+ 2 - 1
src/pages/parkingFee/components/officeBlue/parkingFeeList.vue

@@ -39,8 +39,9 @@
         </div>
       </div>
       <div class="notice-info">
+        <!-- 为确保用户可以执行下滑动作,设置单次响应的数据量为4 -->
         <div
-          >{{ list.length === 4 ? '查看更多' : '没有更多数据了' }}
+          >{{ list.length === 4 && list.length < numberOfElements? '查看更多' : '没有更多数据了' }}
         </div>
       </div>
     </div>

+ 3 - 0
src/pages/parkingFee/mixins/parkingFeeList.js

@@ -20,6 +20,7 @@ export default {
   data() {
     return {
       list: [],
+      numberOfElements: 0,
       pageNum: 0,
     };
   },
@@ -39,6 +40,7 @@ export default {
     }, 301);
     this.$store.dispatch('clearUnlicensed');
     this.list = [];
+    this.numberOfElements = 0;
     // 重新获取数据
     canloading = true;
     pageNum = 0;
@@ -94,6 +96,7 @@ export default {
         console.log('res2', res);
         // const res = orderMockData
         const records = res.content || [];
+        this.numberOfElements = records.numberOfElements
         if (records.length) {
           const list = this.list;
           this.list = [...list, ...records];

+ 6 - 0
src/utils/index.js

@@ -184,6 +184,12 @@ export function initEnv() {
     window.profileApi = 'https://qa-apim.kerryplus.com/c/api';
     return;
   }
+  if (/sl-/.test(href)) {
+    window.env = 'prod';
+    window.profileApi = 'https://sl-apim.kerryplus.com/c/api';
+    window.api = 'api';
+    return;
+  }
   window.env = 'prod';
   window.profileApi = 'https://apim.kerryplus.com/c/api';
   window.api = 'api';