Forráskód Böngészése

fix: 修复企业承诺页面bug

梦辉 1 éve
szülő
commit
163a0ada84

+ 24 - 25
src/subPages/pages/commitment/home/components/enterpriseList/index.vue

@@ -26,8 +26,6 @@ export default {
     if(this.noRequest) {
       this.finished = true;
       this.loading = false;
-    }else {
-      this.handleGetEnterpriseList()
     }
   },
   watch: {
@@ -51,6 +49,7 @@ export default {
         });
         if (res.data.records) {
           this.enterpriseList = this.enterpriseList.concat(res.data.records || [])
+          this.current++;
           this.finished = res.data.records.length < this.size;  // 判断是否还有更多数据
         }
         this.loading = false;  // 加载结束
@@ -72,31 +71,31 @@ export default {
 </script>
 
 <template>
-  <van-list
-      v-model="loading"
-      @load="handleGetEnterpriseList"
-      :finished="finished"
-      finished-text="没有更多数据了"
-  >
-    <van-cell
-        v-for="(item, index) in enterpriseList"
-        :key="item.uuid"
-        class="box"
-        @click="handleClick(item)"
+    <van-list
+        v-model="loading"
+        @load="handleGetEnterpriseList"
+        :finished="finished"
+        finished-text="没有更多数据了"
     >
-      <template #default>
-        <view class="top">
-          <view class="name">
-            {{ item.companyName }}
-            <van-tag round color="#f4a40d" style="margin-left: 5px"> {{item.creditGoal || '暂无' }}</van-tag>
+      <van-cell
+          v-for="(item, index) in enterpriseList"
+          :key="item.uuid"
+          class="box"
+          @click="handleClick(item)"
+      >
+        <template #default>
+          <view class="top">
+            <view class="name">
+              {{ item.companyName }}
+              <van-tag round color="#f4a40d" style="margin-left: 5px"> {{item.creditGoal || '暂无' }}</van-tag>
+            </view>
           </view>
-        </view>
-        <view class="details">
-          最新承诺时间 : {{ item.createTime | date("YYYY-MM-DD HH:mm:ss") }}
-        </view>
-      </template>
-    </van-cell>
-  </van-list>
+          <view class="details">
+            最新承诺时间 : {{ item.createTime | date("YYYY-MM-DD HH:mm:ss") }}
+          </view>
+        </template>
+      </van-cell>
+    </van-list>
 </template>
 
 

+ 3 - 2
src/subPages/pages/commitment/home/components/templateList/index.vue

@@ -6,11 +6,12 @@ export default {
   props: {
     activeTemplateId: {
       type: String,
-      default: ''
+      default: '',
     }
   },
   data() {
     return {
+      /* 二维数组 */
       templateList: [],
       current: 1,
       size: 16
@@ -18,7 +19,7 @@ export default {
   },
   async mounted() {
     await this.getTemplateList();
-    this.templateList.length && this.$emit('click', this.templateList[0]);
+    this.templateList.length && this.$emit('click', this.templateList[0][0]);
   },
   methods: {
     /* 获取模板列表 */

+ 1 - 1
src/subPages/pages/commitment/home/index.vue

@@ -107,7 +107,7 @@ export default {
         <view class="enterprise-top-style" v-show="activeIndex === 1">
           <span>综合</span>
         </view>
-        <EnterPriseList v-show="activeIndex === 1" class="enter-style"></EnterPriseList>
+        <EnterPriseList v-if="activeIndex === 1" class="enter-style"></EnterPriseList>
       </view>
       <view v-else key="search" class="search-page">
         <van-search