threethousanddream vor 4 Wochen
Ursprung
Commit
e3ae20d867
6 geänderte Dateien mit 63 neuen und 89 gelöschten Zeilen
  1. 1 1
      components/yx-navbar/yx-navbar.vue
  2. 4 12
      pages/home/apps.vue
  3. 5 1
      pages/home/home.less
  4. 43 50
      pages/home/home.vue
  5. 6 13
      pages/home/me.vue
  6. 4 12
      pages/home/share.vue

+ 1 - 1
components/yx-navbar/yx-navbar.vue

@@ -72,7 +72,7 @@
 			
 		</view>
 		<view class="addMenuConZhe" v-if="addMenuShow" v-on:touchstart="addMenuShow=false;searchToolList=[]"/>
-		<u-icon class="close-icon" name="close-circle" size="22" color="#fff"></u-icon>
+<!--		<u-icon class="close-icon" name="close-circle" size="22" color="#fff"></u-icon>-->
 	</view>
 </template>
 

+ 4 - 12
pages/home/apps.vue

@@ -32,8 +32,8 @@
           </view>
         </view>
         <template v-if="!loading&&!dataList.length">
-          <image v-if="params.appName" src="../../static/img/no-search.png" style="width: 100%" mode="aspectFit"></image>
-          <image v-else src="../../static/img/no-data.png" style="width: 100%" mode="aspectFit"></image>
+          <image class="none" v-if="params.appName" src="../../static/img/no-search.png" style="width: 100%" mode="aspectFit"></image>
+          <image class="none" v-else src="../../static/img/no-data.png" style="width: 100%" mode="aspectFit"></image>
         </template>
       </scroll-view>
     </view>
@@ -68,11 +68,7 @@ export default {
             item.date = moment(item.createTime).format('YYYY-MM-DD')
           })
           if (data.length) this.params.current++
-          if (reload) {
-            this.dataList = data
-          } else {
-            this.dataList = this.dataList.concat(data)
-          }
+          this.dataList = reload ? data : this.dataList.concat(data)
         }).finally(() => this.loading = false)
       }
       if (this.tabIndex === 1) {
@@ -82,11 +78,7 @@ export default {
             item.date = moment(item.createTime).format('YYYY-MM-DD')
           })
           if (data.length) this.params.current++
-          if (reload) {
-            this.dataList = data
-          } else {
-            this.dataList = this.dataList.concat(data)
-          }
+          this.dataList = reload ? data : this.dataList.concat(data)
         }).finally(() => this.loading = false)
       }
     },

+ 5 - 1
pages/home/home.less

@@ -63,6 +63,10 @@
       box-sizing: border-box;
       overflow-y: auto;
       -webkit-overflow-scrolling: touch;
+      .none {
+        height: 320rpx;
+        margin-top: 30%;
+      }
       .main {
         display: grid;
         grid-template-columns: 1fr 1fr;
@@ -116,7 +120,7 @@
           left: 0;
           width: 100%;
           overflow: hidden;
-          padding:0;
+          padding: 0;
           top: 0;
           text-align: right;
           box-sizing: border-box;

+ 43 - 50
pages/home/home.vue

@@ -2,53 +2,54 @@
   <view class="pageHome">
     <yx-navbar :isBack="false" title="企业看板"></yx-navbar>
     <view class="pageIndex">
-        <view class="tabs">
-          <view class="tab" :class="tabIndex === 0 ? 'active' : ''" @click="onClickTab(0)">
-            <text>可视化大屏</text>
-          </view>
-          <view class="tab" :class="tabIndex === 1 ? 'active' : ''" @click="onClickTab(1)">
-            <text>自助报表</text>
-          </view>
+      <view class="tabs">
+        <view class="tab" :class="tabIndex === 0 ? 'active' : ''" @click="onClickTab(0)">
+          <text>可视化大屏</text>
         </view>
-        <view class="search">
-          <u-search
-            :placeholder="placeholder" v-model="params.title" :show-action="false"
-            bg-color="#f6f6f6" @change="onSearch" shape="square"
-          ></u-search>
-          <img class="icon" src="../../static/img/cate.png" alt="" @click="showCategory=true">
+        <view class="tab" :class="tabIndex === 1 ? 'active' : ''" @click="onClickTab(1)">
+          <text>自助报表</text>
         </view>
-        <scroll-view class="content" scroll-y @scrolltolower="getData(false)">
-          <view class="main" v-if="dataList.length > 0">
-            <view class="infoList" v-for="(item, index) in dataList" :key="index" @click="goDetail(item)">
-              <img v-if="item.backgroundUrl" class="infoImg" :src="item.backgroundUrl" alt="">
-              <img v-else class="infoImg" src="../../static/img/no-bg-img.jpg" alt="">
-              <view class="info-box">
-                <view class="name">{{ item.title }}</view>
-                <view class="describe">所属分类:{{ item.categoryName }}</view>
-                <view class="info">
-                  <view class="num"><i class="el-icon-view"></i> 访问量:{{ item.count }}</view>
-                  <view class="dateTime">{{ item.date }}</view>
-                </view>
+      </view>
+      <view class="search">
+        <u-search
+          :placeholder="placeholder" v-model="params.title" :show-action="false"
+          bg-color="#f6f6f6" @change="onSearch" shape="square"
+        ></u-search>
+        <img class="icon" src="../../static/img/cate.png" alt="" @click="showCategory=true">
+      </view>
+      <scroll-view class="content" scroll-y @scrolltolower="getData(false)">
+        <view class="main" v-if="dataList.length > 0">
+          <view class="infoList" v-for="(item, index) in dataList" :key="index" @click="goDetail(item)">
+            <img v-if="item.backgroundUrl" class="infoImg" :src="item.backgroundUrl" alt="">
+            <img v-else class="infoImg" src="../../static/img/no-bg-img.jpg" alt="">
+            <view class="info-box">
+              <view class="name">{{ item.title }}</view>
+              <view class="describe">所属分类:{{ item.categoryName }}</view>
+              <view class="info">
+                <view class="num"><i class="el-icon-view"></i> 访问量:{{ item.count }}</view>
+                <view class="dateTime">{{ item.date }}</view>
               </view>
-              <view class="tags">
-                <view class="tag" v-if="item.reviewStatus === 0" style="background-color: #ff7f23">审核中</view>
-                <template v-if="item.reviewStatus === 1">
-                  <view class="tag" v-if="item.status === 1" style="background-color: #ff7f23">已发布</view>
-                  <view class="tag" v-if="item.status === 0" style="color: #0a0a0a; background-color: #ededed">已禁用</view>
-                </template>
-                <view class="tag" v-if="item.reviewStatus === 2" style="color: #0a0a0a; background-color: #ededed">
-                  已驳回
+            </view>
+            <view class="tags">
+              <view class="tag" v-if="item.reviewStatus === 0" style="background-color: #ff7f23">审核中</view>
+              <template v-if="item.reviewStatus === 1">
+                <view class="tag" v-if="item.status === 1" style="background-color: #ff7f23">已发布</view>
+                <view class="tag" v-if="item.status === 0" style="color: #0a0a0a; background-color: #ededed">已禁用
                 </view>
-                <view class="tag" v-if="item.publicStatus" style="background-color: #eb5a10">已公开</view>
+              </template>
+              <view class="tag" v-if="item.reviewStatus === 2" style="color: #0a0a0a; background-color: #ededed">
+                已驳回
               </view>
+              <view class="tag" v-if="item.publicStatus" style="background-color: #eb5a10">已公开</view>
             </view>
           </view>
-          <template v-if="!loading&&!dataList.length">
-            <image v-if="params.title" src="../../static/img/no-search.png" style="width: 100%"
-                   mode="aspectFit"></image>
-            <image v-else src="../../static/img/no-data.png" style="width: 100%" mode="aspectFit"></image>
-          </template>
-        </scroll-view>
+        </view>
+        <template v-if="!loading&&!dataList.length">
+          <image class="none" v-if="params.title" src="../../static/img/no-search.png" style="width: 100%"
+                 mode="aspectFit"></image>
+          <image class="none" v-else src="../../static/img/no-data.png" style="width: 100%" mode="aspectFit"></image>
+        </template>
+      </scroll-view>
     </view>
     <u-picker :show="showCategory" :columns="categoryList" confirmColor="#eb5a10" @cancel="showCategory=false"
               closeOnClickOverlay @close="showCategory=false" key-name="categoryValue" @change="onCategoryChange"
@@ -122,11 +123,7 @@ export default {
               item.date = moment(item.createTime).format('YYYY-MM-DD')
             })
             if (data.length) this.params.current++
-            if (reload) {
-              this.dataList = data
-            } else {
-              this.dataList = this.dataList.concat(data)
-            }
+            this.dataList = reload ? data : this.dataList.concat(data)
             this.lastCreateTime = this.dataList[this.dataList.length - 1]?.createTime || ''
           })
         }).finally(() => this.loading = false)
@@ -140,11 +137,7 @@ export default {
               item.date = moment(item.createTime).format('YYYY-MM-DD')
             })
             if (data.length) this.params.current++
-            if (reload) {
-              this.dataList = data
-            } else {
-              this.dataList = this.dataList.concat(data)
-            }
+            this.dataList = reload ? data : this.dataList.concat(data)
             this.lastCreateTime = this.dataList[this.dataList.length - 1]?.createTime || ''
           })
         }).finally(() => this.loading = false)

+ 6 - 13
pages/home/me.vue

@@ -34,7 +34,8 @@
               <view class="tag" v-if="item.reviewStatus === 0" style="background-color: #ff7f23">审核中</view>
               <template v-if="item.reviewStatus === 1">
                 <view class="tag" v-if="item.status === 1" style="background-color: #ff7f23">已发布</view>
-                <view class="tag" v-if="item.status === 0" style="color: #0a0a0a; background-color: #ededed">已禁用</view>
+                <view class="tag" v-if="item.status === 0" style="color: #0a0a0a; background-color: #ededed">已禁用
+                </view>
               </template>
               <view class="tag" v-if="item.reviewStatus === 2" style="color: #0a0a0a; background-color: #ededed">
                 已驳回
@@ -44,8 +45,8 @@
           </view>
         </view>
         <template v-if="!loading&&!dataList.length">
-          <image v-if="params.title" src="../../static/img/no-search.png" style="width: 100%" mode="aspectFit"></image>
-          <image v-else src="../../static/img/no-data.png" style="width: 100%" mode="aspectFit"></image>
+          <image class="none" v-if="params.title" src="../../static/img/no-search.png" style="width: 100%" mode="aspectFit"></image>
+          <image class="none" v-else src="../../static/img/no-data.png" style="width: 100%" mode="aspectFit"></image>
         </template>
       </scroll-view>
     </view>
@@ -119,11 +120,7 @@ export default {
               item.date = moment(item.createTime).format('YYYY-MM-DD')
             })
             if (data.length) this.params.current++
-            if (reload) {
-              this.dataList = data
-            } else {
-              this.dataList = this.dataList.concat(data)
-            }
+            this.dataList = reload ? data : this.dataList.concat(data)
             this.lastCreateTime = this.dataList[this.dataList.length - 1]?.createTime || ''
           })
         }).finally(() => this.loading = false)
@@ -137,11 +134,7 @@ export default {
               item.date = moment(item.createTime).format('YYYY-MM-DD')
             })
             if (data.length) this.params.current++
-            if (reload) {
-              this.dataList = data
-            } else {
-              this.dataList = this.dataList.concat(data)
-            }
+            this.dataList = reload ? data : this.dataList.concat(data)
             this.lastCreateTime = this.dataList[this.dataList.length - 1]?.createTime || ''
           })
         }).finally(() => this.loading = false)

+ 4 - 12
pages/home/share.vue

@@ -31,8 +31,8 @@
           </view>
         </view>
         <template v-if="!loading&&!dataList.length">
-          <image v-if="params.name" src="../../static/img/no-search.png" style="width: 100%" mode="aspectFit"></image>
-          <image v-else src="../../static/img/no-data.png" style="width: 100%" mode="aspectFit"></image>
+          <image class="none" v-if="params.name" src="../../static/img/no-search.png" style="width: 100%" mode="aspectFit"></image>
+          <image class="none" v-else src="../../static/img/no-data.png" style="width: 100%" mode="aspectFit"></image>
         </template>
       </scroll-view>
       <tab-bar tabbarValue='分享给我'></tab-bar>
@@ -88,11 +88,7 @@ export default {
               item.date = moment(item.visualData.createTime).format('YYYY-MM-DD')
             })
             if (data.length) this.params.page++
-            if (reload) {
-              this.dataList = data
-            } else {
-              this.dataList = this.dataList.concat(data)
-            }
+            this.dataList = reload ? data : this.dataList.concat(data)
           })
         }).finally(() => this.loading = false)
       }
@@ -104,11 +100,7 @@ export default {
               item.date = moment(item.visualData.createTime).format('YYYY-MM-DD')
             })
             if (data.length) this.params.page++
-            if (reload) {
-              this.dataList = data
-            } else {
-              this.dataList = this.dataList.concat(data)
-            }
+            this.dataList = reload ? data : this.dataList.concat(data)
           })
         }).finally(() => this.loading = false)
       }