Selaa lähdekoodia

pay page and self center

zizhong.wang 2 vuotta sitten
vanhempi
commit
eaef576516

+ 15 - 4
pages/heatingPage/pay.vue

@@ -24,13 +24,13 @@
 	  <view class="tel flex">
 	    <label>缴费类型:</label>
 		<radio-group  @change="payChange">
-		  <radio value="1" checked style="margin-right: 30rpx;transform: scale(0.85);">金额</radio>
-		  <radio value="2" style="transform: scale(0.85);">空置</radio>
+		  <radio value="1" :checked="payInfo.type!==2" style="margin-right: 30rpx;transform: scale(0.85);">金额</radio>
+		  <radio value="2" :checked="payInfo.type===2" style="transform: scale(0.85);">空置</radio>
 		</radio-group>
 	  </view>
 	  <view class="tel flex">
 	    <label>缴费金额:</label>
-	    <input type="text" class="card input" v-model="payInfo.part_fee" disabled/>
+	    <input type="text" class="card input" id="real_fee" v-model="payInfo.real_fee" disabled/>
 	  </view>			
     </view>
     <button class="submit" @tap="paySubmit">{{payStatus ? '申请开票' : '缴费'}}</button>
@@ -63,7 +63,7 @@ export default {
     return {
       payInfo: {
       },
-	  payStatus:0
+	  payStatus:0,
     };
   },
   onLoad(option) {
@@ -115,6 +115,17 @@ export default {
       });
     },
     payChange(e){
+		let v = e.detail.value;
+		if (v == 2)
+		{
+			let value = this.payInfo.part_fee - this.payInfo.reduction;
+			this.payInfo.real_fee = value;
+		}
+		else
+		{
+			let value = this.payInfo.total_fee - this.payInfo.reduction;
+			this.payInfo.real_fee = value;
+		}
 		this.payInfo.payType = e.detail.value;
 	},
 	paySubmit(){

+ 1 - 1
pages/heatingPage/reportFix.vue

@@ -180,7 +180,7 @@ export default {
       let url =
         getApp().globalData.shareUrl +
         "api/api.php" +
-        "?method=upload&source=consult&timestamp=" +
+        "?method=upload&source=repair&timestamp=" +
         getApp().globalData.globalTimestamp +
         "&sign=" +
         md5Sign;

+ 10 - 3
pages/index/index.vue

@@ -90,7 +90,7 @@
 				{{item.time}}
 			</view>  
 			<view class="display-flex-start">
-				<view class="notice-content-time" style="color: #d9001b;">{{statusObj[item.type]}}</view>
+				<view class="notice-content-time" style="color: {{statusColor[item.status]}};">{{statusObj[item.status]}}</view>
 			</view>
           </view>
         </view>
@@ -141,9 +141,16 @@ export default {
       ],
       heatList: [],
 	  statusObj:{
+		  '0':'未缴费',
 		  '1':'已缴费',
-		  '2':'待缴费',
-		  '3':'空置已缴费'
+		  '2':'空置已缴费',
+		  '3':'空置转全额'
+	  },
+	  statusColor:{
+		  '0':'#D9001B',
+		  '1':'#70B603',
+		  '2':'#4B7902',
+		  '3':'#BFBF00',
 	  }
     };
   },

+ 57 - 14
pages/selfCenter/index.vue

@@ -77,18 +77,6 @@ export default {
 		  url: "/pages/selfCenter/my_fix",
 		  isShow:true,
 		 },
-  //       {
-  //         icoin: "/static/selfCenter/collection.png",
-  //         name: "我的收藏",
-  //         url: "/pages/selfCenter/collection",
-		//   isShow:true,
-  //       },
-		// {
-		//   icoin: "/static/selfCenter/collection.png",
-		//   name: "工业经济指标",
-		//   url: "/pages/metrics/index",
-		//   isShow:true,
-		// },
         { 
 		   icoin: "/static/selfCenter/back.png",
 		   name: "退出登录" ,
@@ -117,8 +105,54 @@ export default {
       });
     },
 	goWithHouse(){
-		uni.navigateTo({
-		  url: "/pages/selfCenter/with_house",
+		if (this.isWith == 0)
+		{
+			uni.navigateTo({
+			  url: "/pages/selfCenter/with_house",
+			});
+			return;
+		}
+		//解除绑定
+		let md5Sign = md5(
+		  "method=" +
+		    "user" +
+		    "&timestamp=" +
+		    getApp().globalData.globalTimestamp +
+		    "&secret=" +
+		    getApp().globalData.secret
+		);
+		let url =
+		  getApp().globalData.shareUrl +
+		  "api/api.php" +
+		  "?method=user&action=unband_owner&timestamp=" +
+		  getApp().globalData.globalTimestamp +
+		  "&sign=" +
+		  md5Sign;
+		uni.request({
+		  url: url,
+		  method: "POST",
+		  header: {
+		    "content-type": "application/x-www-form-urlencoded",
+		  },
+		  data: {
+		    openId: getApp().globalData.open_id,
+		  },
+		  success: (res) => {
+		    if (res.data.code === 200) {
+		      this.isWith = 0;
+			  this.houseInfo.address = "";
+			  this.houseInfo.master = "";
+			  this.houseInfo.area = "";
+		      uni.showToast({
+		        title: "已解除绑定",
+		        duration: 2500,
+		        icon: "none",
+		      });
+		    }
+		  },
+		  fail: () => {
+		    console.log("连接失败");
+		  },
 		});
 	},
     goDetailFn(index, url) {
@@ -238,6 +272,15 @@ export default {
 			  if(res.data.data.stat_user){
 				  this.list[3].isShow = true;
 			  }
+			  
+			  if (res.data.data.owner_info){
+				  let  wi = res.data.data.owner_info;
+				  this.houseInfo.address = wi.estate_name  + wi.building_name + wi.unit + wi.room;
+				  this.houseInfo.master = wi.owner_name;
+				  this.houseInfo.area = wi.area;
+				  this.isWith = 1;
+			  }
+			  
             } else {
               this.isAuth = false;
 			  getApp().globalData.globalAuth  = false;

+ 5 - 5
pages/selfCenter/with_house.vue

@@ -121,10 +121,10 @@ export default {
   data() {
     return {
       house: {
-        name: "千林郡",
-        num: "1205室",
-		master:'曹**',
-		area:'108',
+        name: "",
+        num: "",
+		master:'',
+		area:'',
       },
 	  hoodList: [],
 	  buildList: [],
@@ -180,7 +180,7 @@ export default {
 					let child = {
 						name:obj[key]
 					}
-				 that.hoodList.push(child)
+				 this.hoodList.push(child)
 				}
 			this.searchDetail(this.hoodList[this.hoodIndex].name)		
 		    }