Browse Source

Merge branch 'master' of ssh://gogs.zfire.top:2222/zfire-front/recycle-mobile

linwenxin 1 year ago
parent
commit
1782ee38dd

+ 2 - 0
src/components/zj-container/zj-page-layout.vue

@@ -89,6 +89,7 @@
 
       aHeight() {
         let num = 0;
+        // #ifdef H5
         if (isWeixin()) {
           num = 0;
         } else {
@@ -98,6 +99,7 @@
             num = 44;
           }
         }
+        // #endif
         return num;
       }
 		}

+ 14 - 5
src/pages/mine/index.vue

@@ -15,10 +15,13 @@
         <view class="user-container card">
           <view class="user">
             <image src="@/static/common/logo.png" mode="aspectFill"></image>
-            <view class="main">
+            <view class="main" v-if="isLogin">
               <view class="name">张三</view>
               <view class="real">实名认证</view>
             </view>
+            <view class="main" v-else @tap="navToPage('/pages/login/indexs')">
+              <view class="name">请先登录</view>
+            </view>
           </view>
           <view class="stats">
             <view class="item" v-for="(item, index) in userStats" :key="index" @tap="$navPage(item.url)">
@@ -82,7 +85,7 @@ export default {
   data() {
     return {
       refresherTriggered: false,
-      userInfo: uni.getStorageSync('recycle_mobile_user'),
+      userInfo: {},
 
       userStats: [
         { name: '我的点赞', num: 0, url: '/pages/mine/myLike' },
@@ -109,8 +112,11 @@ export default {
       ],
     }
   },
-  
+
   computed:{
+    isLogin() {
+      return this.$store.state.user.token ? true : false;
+    },
   	cuStyle(){
   		return `height:${this.CustomBar-this.StatusBar}px; padding-top:${this.StatusBar}px;`
   	},
@@ -132,12 +138,15 @@ export default {
     	this.refresherTriggered = true;
 
     },
-    
+
     navToPage(url) {
+      if(!this.isLogin) {
+        url = '/pages/login/indexs';
+      }
       this.$navToPage({
         url
       })
-    }
+    },
   }
 }
 </script>

+ 18 - 3
src/pages/mine/myLike.vue

@@ -1,4 +1,5 @@
 <template>
+  <!-- #ifdef H5 -->
   <zj-page-layout
   	:hasFooter="false"
   	:isScroll="true"
@@ -30,28 +31,38 @@
         </view>
       </view>
     </view>
+
+    <Loading :loadStatus="loadStatus" :dataList="dataList" />
   </zj-page-layout>
+  <!-- #endif -->
+  <!-- #ifndef H5 -->
+  <web-view :src="webViewHref('/pages/mine/myLike')"></web-view>
+  <!-- #endif -->
 </template>
 
 <script>
+  // #ifdef H5
   export default {
     data() {
       return {
         imgUrl: this.$imageUrl,
         dataList: [],
-        pageNum: 1,
+        pageNum: 1,
+				loadStatus: 0,
         refresherTriggered: false,
       }
     },
 
     async onLoad() {
-      // await this.getList()
+      await this.getList()
     },
 
     methods: {
       //获取列表数据
       async getList() {
-        this.$api.post('/xxx/xxxlist', {
+        this.$api.post('/likeOrCollect/list', {
+          userId: '',
+          type: 1,
           pageNum: this.pageNum,
           pageSize: 10,
         }).then(res => {
@@ -86,6 +97,10 @@
 
     }
   }
+  // #endif
+  // #ifndef H5
+
+  // #endif
 </script>
 
 <style lang="scss" scoped>

+ 6 - 5
src/pages/mine/parse.vue

@@ -15,8 +15,8 @@
 </template>
 
 <script>
+  // #ifdef H5
 	export default {
-    // #ifdef H5
 		data() {
 			return {
 				type: 1,
@@ -53,11 +53,12 @@
 				})
 			},
 		},
-    // #endif
-    // #ifndef H5
-
-    // #endif
 	}
+  
+  // #endif
+  // #ifndef H5
+  
+  // #endif
 </script>
 
 <style lang="scss" scoped>