瀏覽代碼

当数据为空时

lex-xin 5 年之前
父節點
當前提交
463a2a96b5

文件差異過大導致無法顯示
+ 0 - 0
dist/app.f98ee5c70791c8adbdd3.js


文件差異過大導致無法顯示
+ 0 - 0
dist/css/PeriodExchange.22e7968e.css


文件差異過大導致無法顯示
+ 0 - 0
dist/css/PeriodExchange.2f17d24d.css


文件差異過大導致無法顯示
+ 0 - 0
dist/index.html


文件差異過大導致無法顯示
+ 0 - 0
dist/js/PeriodExchange.4e459070.js


文件差異過大導致無法顯示
+ 0 - 0
dist/js/PeriodExchange.fe43387e.js


+ 12 - 3
src/views/app/PeriodExchange.vue

@@ -17,7 +17,7 @@
             </van-cell>
         </van-cell-group>
 
-        <div class="activeList">
+        <div class="activeList" v-if="dataShow">
             <h2>优惠活动:</h2>
 
             <div class="active" @click="onPayOrder(item)" v-for="(item, index) in dataList" :key="index">
@@ -30,6 +30,10 @@
                 </van-image>
             </div>
         </div>
+        <div class="activeList" v-else>
+            <h2>优惠活动:</h2>
+            <m-empty class="empty" msg="暂无优惠活动"  key="data" />
+        </div>
     
         <!-- <div class="pay_btn" >确认兑换</div> -->
         <van-popup v-model="popupShow" closeable position="bottom"
@@ -41,12 +45,13 @@
 <script>
 /* eslint-disable */
 import MHeader from '@/components/MHeader'
+import MEmpty from '@/components/MEmpty'
 import { browser, calcMinute }  from '@/common/common'
 import { tenantEntryActivitesList, queryUserInfo, sysTenantAccountGet, createOrder } from '@/api/app'
 
 export default {
     name: 'courseApply',
-    components: { MHeader },
+    components: { MHeader, MEmpty },
     data() {
         return {
             userInfo: {},
@@ -57,6 +62,7 @@ export default {
             isClick: false,
             popupShow: false,
             popupContent: null,
+            dataShow: true, // 是否有数据
             imageStatus: false
         }
     },
@@ -106,11 +112,14 @@ export default {
             await tenantEntryActivitesList().then(res => {
                 let result = res.data
                 if(result.code == 200) {
-                    this.dataList = result.data.rows
+                    this.dataList = result.data.rows ? result.data.rows :  []
                 } else {
                     loadingStatus = false
                     this.$toast(result.msg)
                 }
+                if(this.dataList.length <= 0) {
+                    this.dataShow = false
+                }
             })
             if(loadingStatus) {
                 this.$toast.clear()

部分文件因文件數量過多而無法顯示