소스 검색

拆分分享设备,分享记录

wangming 3 주 전
부모
커밋
21f60b808c
6개의 변경된 파일43개의 추가작업 그리고 19개의 파일을 삭제
  1. 1 1
      src/pages.json
  2. 3 4
      src/pages/home/home.vue
  3. 14 4
      src/pagesA/my/my.vue
  4. 25 10
      src/pagesA/shareList/shareList.vue
  5. BIN
      src/static/list.png
  6. BIN
      src/static/share.png

+ 1 - 1
src/pages.json

@@ -80,7 +80,7 @@
                     "path": "shareList/shareList",
                     "style": {
                         "enablePullDownRefresh": true,
-                        "navigationBarTitleText": "分享记录",
+                        "navigationBarTitleText": "",
                         "navigationBarBackgroundColor": "#faede2",
                         "navigationBarTextStyle": "black"
                     },

+ 3 - 4
src/pages/home/home.vue

@@ -101,7 +101,7 @@
         <view class="bot_version"> v3.0.18</view>
         <view
             class="shareInfo"
-            @click="goDeviceShare()"
+            @click="goDeviceShare('sure')"
             v-if="shareNum > 0"
             :style="{ top: warnNum > 0 ? '280rpx' : '210rpx' }"
         >
@@ -259,10 +259,9 @@ export default {
                 url: "/pagesA/loginNew/loginNew",
             });
         },
-        goDeviceShare() {
-            uni.setStorageSync("shareStatus", "authorized");
+        goDeviceShare(shareType) {
             uni.navigateTo({
-                url: "/pagesA/shareList/shareList",
+                url: "/pagesA/shareList/shareList?shareType=" + shareType,
             });
         },
         getperSonInfo() {

+ 14 - 4
src/pagesA/my/my.vue

@@ -18,7 +18,7 @@
                     <image src="../../static/arrTwo.png" mode="" />
                 </view>
             </view> -->
-            <view class="menu-item" @click="gotoShare()">
+            <view class="menu-item" @click="gotoShare('sure')">
                 <view class="meanLeft">
                     <image src="../../static/share.png" mode="" />
                     <text>分享确认</text>
@@ -27,6 +27,17 @@
                     <image src="../../static/arrTwo.png" mode="" />
                 </view>
             </view>
+
+            <view class="menu-item" @click="gotoShare('list')">
+                <view class="meanLeft">
+                    <image src="../../static/list.png" mode="" />
+                    <text>分享记录</text>
+                </view>
+                <view class="meanRight">
+                    <image src="../../static/arrTwo.png" mode="" />
+                </view>
+            </view>
+
             <!-- <view class="menu-item" @click="serverchange()">
                 <view class="meanLeft">
                     <image src="../../static/setting.png" mode="" />
@@ -71,10 +82,9 @@ export default {
                 url: "/pagesA/OTA/OTA",
             });
         },
-        gotoShare() {
-            uni.setStorageSync("shareStatus", "all");
+        gotoShare(shareType) {
             uni.navigateTo({
-                url: "/pagesA/shareList/shareList",
+                url: "/pagesA/shareList/shareList?shareType=" + shareType,
             });
         },
         goLogout() {

+ 25 - 10
src/pagesA/shareList/shareList.vue

@@ -60,6 +60,10 @@
                 </view>
             </view>
         </template>
+        <view v-else class="noData">
+            <text v-if="status === 0">暂无分享设备</text>
+            <text v-else>暂无分享记录</text>
+        </view>
     </view>
 </template>
 
@@ -79,21 +83,12 @@ export default {
             this.$http
                 .post("wap/share/queryDevShare", {
                     userId: uni.getStorageSync("userId"),
-                    state: null,
+                    state: this.status,
                 })
                 .then((res) => {
                     uni.hideLoading();
                     if (res.data.data) {
                         this.shareList = res.data.data;
-                        if (this.shareList && this.status != null) {
-                            const hasStatusZero = this.shareList.some(
-                                (item) => item.state === 0
-                            );
-                            if (!hasStatusZero) {
-                                this.state = null;
-                                this.getShareList();
-                            }
-                        }
                     }
                 });
         },
@@ -166,6 +161,19 @@ export default {
             uni.stopPullDownRefresh();
         }, 1000);
     },
+    onLoad(options) {
+        const shareType = options.shareType;
+        if (shareType) {
+            uni.setNavigationBarTitle({
+                title: shareType === "list" ? "分享记录" : "分享设备",
+            });
+        }
+        if (shareType === "list") {
+            this.status = null;
+        } else if (shareType === "sure") {
+            this.status = 0;
+        }
+    },
 };
 </script>
 
@@ -250,5 +258,12 @@ export default {
             }
         }
     }
+
+    .noData {
+        text-align: center;
+        padding: 20rpx;
+        color: #999;
+        font-size: 28rpx;
+    }
 }
 </style>

BIN
src/static/list.png


BIN
src/static/share.png