zizhong.wang пре 2 година
родитељ
комит
1c4e44b1d0
2 измењених фајлова са 48 додато и 1 уклоњено
  1. 37 0
      pages/heatingPage/list.vue
  2. 11 1
      pages/heatingPage/pay.vue

+ 37 - 0
pages/heatingPage/list.vue

@@ -40,6 +40,12 @@
         </view>
       </view>
      <image src="../../static/nodata.svg" mode="aspectFit" style="width: 100%;" v-if="activityList.length === 0"></image>
+	 <view class="noLogin-box" v-if="owner_id == 0">
+	 		 <view>{{!isAuth ? '未登录': '未关联'}}</view>
+	 		 <view>{{!isAuth ? '请先完成授权登录': '请先完成关联住房'}}</view>
+	 		 <view class="withHouseBtn" @click="goHouse" v-show="isAuth">关联住房</view>
+	 		 <view class="withHouseBtn" @click="goAuth" v-show="!isAuth">授权登录</view>
+	 </view>
   </view>
   </view>
 </template>
@@ -54,10 +60,14 @@ export default {
       heatList: [],
 	  statusObj:getApp().globalData.statusObj,
 	  statusColor:getApp().globalData.statusColor,
+	  isAuth: true,
+	  owner_id : 0,
+	  
     };
   },
   onLoad() {
     this.getHeatList();
+	this.isAuth = getApp().globalData.isAuth;
   },
   methods: {
     goPayDeatil(id) {
@@ -84,6 +94,7 @@ export default {
           console.log(res);
           if (res.data.code === 200) {
             this.heatList = res.data.data.list;
+			this.owner_id = res.data.data.owner_id;
           }
         },
         fail: () => {
@@ -91,6 +102,16 @@ export default {
         },
       });
     },
+    goHouse(){
+    	uni.navigateTo({
+    	  url: "/pages/selfCenter/with_house",
+    	}); 
+    },
+    goAuth() {
+      uni.navigateTo({
+        url: "/pages/auth/index",
+      });
+    },
   },
 };
 </script>
@@ -229,4 +250,20 @@ export default {
   	font-weight: 500;
   }
 }
+
+.noLogin-box {
+	width: 100%;
+	display: flex;
+	flex-direction: column;
+	justify-content: space-between;
+	align-items: center;
+	margin-top: 160rpx;
+	color: #a7adba;
+}
+
+.withHouseBtn {
+	color: #589cff;
+	cursor: pointer;
+	margin-top: 40rpx;
+}
 </style>

+ 11 - 1
pages/heatingPage/pay.vue

@@ -98,7 +98,7 @@ export default {
 	  statusColor:getApp().globalData.statusColor,
 	  invoiceName : '',
 	  invoiceRemark : '',
-	  invoicePhone:'',
+	  invoicePhone:getApp().globalData.user_phone,
 	  invoiceEmail:''
     };
   },
@@ -263,6 +263,16 @@ export default {
 		  this.$refs.popup.open('center');
 	  },
 	closePopup() {
+		  
+		  if (this.invoicePhone === '' && this.invoiceEmail){
+			  uni.showToast({
+			    title: '手机号和邮箱至少填写一项!',
+			    icon: "none",
+			    duration: 2500,
+			  });
+			  return;
+		  }
+		
 		  this.$refs.popup.close();
 		  let that = this;
 		  let url = getApp().makeApiUrl("user",'user','invoice');