zizhong.wang лет назад: 2
Родитель
Сommit
81aae4cf09
3 измененных файлов с 42 добавлено и 6 удалено
  1. 12 1
      pages/heatingPage/list.vue
  2. 17 1
      pages/index/index.vue
  3. 13 4
      pages/selfCenter/index.vue

+ 12 - 1
pages/heatingPage/list.vue

@@ -44,7 +44,7 @@
 	 		 <view>{{!isAuth ? '未登录': '未关联'}}</view>
 	 		 <view>{{!isAuth ? '请先完成授权登录': '请先完成关联住房'}}</view>
 	 		 <view class="withHouseBtn" @click="goHouse" v-show="isAuth">关联住房</view>
-	 		 <view class="withHouseBtn" @click="goAuth" v-show="!isAuth">授权登录</view>
+	 		 <button type='primary' class="withHouseBtn" v-show="!isAuth" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权登录</button>
 	 </view>
   </view>
   </view>
@@ -79,6 +79,17 @@ export default {
         url: "/pages/heatingPage/pay?id=" + id,
       });
     },
+	getPhoneNumber(e){
+		let res = getApp().getPhoneNumber(e);
+		if (res){
+			this.goHouse();
+		}
+	},
+	goHouse(){
+		uni.navigateTo({
+		  url: "/pages/selfCenter/with_house",
+		}); 
+	},
     getHeatList() {
       
 	  let url = getApp().makeApiUrl("user",'user','get_order_list');

+ 17 - 1
pages/index/index.vue

@@ -156,7 +156,7 @@ export default {
   onShow() {
     uni.hideTabBar({});
 	this.isAuth = getApp().globalData.isAuth;
-	this.getHeatList()
+	this.getHeatList();
   },
   onLoad() {
     // uni.showLoading({
@@ -184,6 +184,14 @@ export default {
       this.swiperCurrent = e.detail.current;
     },
 	goOtherPage(item){
+		if(!this.isAuth){
+				  uni.showToast({
+				    title: "您还没有登录授权",
+				    duration: 2500,
+				    icon: "none",
+				  });
+				  return;
+		}
 		uni.navigateTo({
 			url:item.path
 		})
@@ -265,6 +273,14 @@ export default {
     });
   },
     goPayList() {
+		if(!this.isAuth){
+				  uni.showToast({
+				    title: "您还没有登录授权",
+				    duration: 2500,
+				    icon: "none",
+				  });
+				  return;
+		}
       uni.navigateTo({
         url: "/pages/heatingPage/list",
       });

+ 13 - 4
pages/selfCenter/index.vue

@@ -23,7 +23,7 @@
 	  </view>
       <view class="img-name-box" v-if="!isAuth">
 		<image src="/static/auth-icon.png" class="heade-img" mode="aspectFill"></image>
-        <button @click="goAuthPage()" class="auth-btn">立即登录</button>
+		<button type='primary' class="auth-btn" v-show="!isAuth" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">立即登录</button>
       </view>
       <!-- <image class="bg-img" :src="swiperBackground" mode="aspectFill"></image> -->
 	  <view class="bg-img"></view>
@@ -107,12 +107,21 @@ export default {
 	  
 	 
     },
+	getPhoneNumber(e){
+		let res = getApp().getPhoneNumber(e);
+		if (res){
+			this.goHouse();
+		}
+	},
+	goHouse(){
+		uni.navigateTo({
+		  url: "/pages/selfCenter/with_house",
+		}); 
+	},
 	goWithHouse(){
 		if (this.isWith == 0)
 		{
-			uni.navigateTo({
-			  url: "/pages/selfCenter/with_house",
-			});
+			this.goHouse();
 			return;
 		}
 		//解除绑定