فهرست منبع

【Mod】tab页面无登录提示弹窗,可允许用户先查看信息

liuxiangxin 2 ماه پیش
والد
کامیت
7459e40782
4فایلهای تغییر یافته به همراه21 افزوده شده و 8 حذف شده
  1. 4 4
      pages/car/index.vue
  2. 1 1
      pages/score/clockin.vue
  3. 6 0
      pages/score/index.vue
  4. 10 3
      pages/user/index.vue

+ 4 - 4
pages/car/index.vue

@@ -130,8 +130,8 @@ export default {
     return shareObj;
   },
   onShow() {
-    // 登录提示
-    if (!this.$checkAccess.alterLogin()) return;
+    // 未登录不请求
+    if (!this.$checkAccess.checkLogin()) return;
     // 请求中,不允许刷新
     if (this.isReqing) return;
     // 设置请求中
@@ -155,8 +155,8 @@ export default {
     });
   },
   onPullDownRefresh() {
-    // 登录提示
-    if (!this.$checkAccess.alterLogin()) return;
+    // 未登录不请求
+    if (!this.$checkAccess.checkLogin()) return;
     // 请求列表
     this.$http.request("api/shop_cart/get_list", this.requestParam).then((re) => {
       if (re.code == "success") {

+ 1 - 1
pages/score/clockin.vue

@@ -123,7 +123,7 @@ export default {
   },
   onShow() {
     // 登录提示
-    if (!this.$checkAccess.alterLogin()) return;
+    if (!this.$checkAccess.checkLogin()) return;
     // 请求打卡列表
     this.getClockinList();
     // 请求中,不允许刷新

+ 6 - 0
pages/score/index.vue

@@ -74,6 +74,8 @@ export default {
     return shareObj;
   },
   onShow() {
+	// 如果登录才请求
+	if( !this.$checkAccess.checkLogin() ) return ;
     // 没有数据的话,或者请求中,不允许刷新
     if (this.isReqing) return;
     // 请求参数
@@ -96,6 +98,8 @@ export default {
     });
   },
   onPullDownRefresh() {
+	// 如果登录才请求
+	if( !this.$checkAccess.checkLogin() ) return ;
     // 如果请求中,不允许请求,
     if (this.isReqing) return uni.stopPullDownRefresh();
     // 初始化页码为1
@@ -117,6 +121,8 @@ export default {
     uni.stopPullDownRefresh();
   },
   onReachBottom() {
+	// 如果登录才请求
+	if( !this.$checkAccess.checkLogin() ) return ;
     // 如果页码是0,避免第一页重复
     if (this.requestParam.page < 1) return;
     // 最后一页不再请求

+ 10 - 3
pages/user/index.vue

@@ -7,7 +7,8 @@
         </navigator>
       </view>
       <view class="box_center">
-        <view class="user_name">{{ userInfo.username }}</view>
+        <view class="user_name" v-if="is_login">{{ userInfo.username }}</view>
+		<navigator class="user_name" url="/pages/login/index" v-if="!is_login">请登录</navigator>
         <view class="user_info">{{ userInfo.phone }}</view>
       </view>
       <view class="box_right">
@@ -80,7 +81,11 @@ export default {
         phone: 'kailin',
         status: 0,
         city_id: 0,
+		is_video_vip:0,
+		amount:0.00,
+		transfer_amount:0.00
       },
+	  is_login:0,
       packetList: [],
       show_packet: false,
     };
@@ -130,8 +135,10 @@ export default {
     return shareObj;
   },
   onShow() {
-    // 登录提示
-    if (!this.$checkAccess.alterLogin()) return;
+	  
+	this.is_login = this.$checkAccess.checkLogin()
+    // 未登录不请求
+    if ( !this.is_login ) return;
     // 判断数据
     this.$http.request('api/custom/get_info').then((callback) => {
       if (callback.code == 'success') {