Bläddra i källkod

部分接口调试

wangzizhong 3 år sedan
förälder
incheckning
ce5e62d3f7
6 ändrade filer med 342 tillägg och 303 borttagningar
  1. 4 3
      App.vue
  2. 21 83
      pages/heatingPage/list.vue
  3. 14 45
      pages/heatingPage/pay.vue
  4. 29 99
      pages/index/index.vue
  5. 6 6
      pages/selfCenter/index.vue
  6. 268 67
      pages/selfCenter/with_house.vue

+ 4 - 3
App.vue

@@ -2,14 +2,15 @@
 import md5 from '@/common/md5.js';
 export default {
   globalData: {
-    shareUrl: "https://kiq.xazhima.com/",
+    shareUrl: "https://heater.xazhima.com/",
 	//shareUrl:"https://kgwxxcx.xixianxinqu.gov.cn/1026airqt/",
     globalTimestamp: Date.now().toString(),
-    secret: "AirQK_weichat_app_zhima",
+    secret: "Heater_weichat_app_zhima",
     selectedIndex:0,
 	isSider:false,
 	user_id: '',
-	open_id:'',
+	//open_id:'',
+	open_id:"oX46e5ImwFndnH442HW6Yt7W9Mck",//测试使用 替换正确appId后默认为空
 	user_status:'',
 	user_name:'',
 	user_phone:'',

+ 21 - 83
pages/heatingPage/list.vue

@@ -3,12 +3,12 @@
   <view class="actives">
       <view
         class="notice-content-box"
-        v-for="(item, index) in activityList"
+        v-for="(item, index) in heatList"
         :key="index"
         style="justify-content: start; padding: 30rpx 0 30rpx 30rpx;border-radius: 0;"
-        @click="goDeatil(item.id)" >
+        @click="goPayDeatil(item.code)" >
         <image
-          :src="item.url"
+          src="/static/order-poster.svg"
           style="
             width: 112rpx;
             height: 112rpx;
@@ -18,15 +18,15 @@
         ></image>
         <view class="notice-content" style="width: 75%">
           <view class="notice-content-font">{{
-            item.title
+            item.name
           }}</view>
           <view class="display-flex-start" style="margin-top: 20rpx">
             <view class="notice-content-time color-a7adba">
-				{{item.address}}
+				{{item.estate_name  + item.building_name + item.unit + item.room}}
 			</view>
 			<view class="notice-content-time display-flex-start">
 				<text class="color-a7adba">¥:</text>
-				<text class="order-money">{{item.money}}</text>
+				<text class="order-money">{{item.total_fee}}</text>
 			</view>
           </view>
           <view class="display-between" style="margin-top: 20rpx">
@@ -34,7 +34,7 @@
 				{{item.time}}
 			</view>  
 			<view class="display-flex-start">
-				<view class="notice-content-time" style="color: #d9001b;">{{item.orderStatus}}</view>
+				<view class="notice-content-time" style="color: #d9001b;">{{statusObj[item.type]}}</view>
 			</view>
           </view>
         </view>
@@ -49,43 +49,18 @@ import md5 from "@/common/md5.js";
 export default {
   data() {
     return {
-      message: "我的活动",
+      message: "缴费订单",
       themeColor: "#007AFF",
-      mode: "selector",
-      typeActive: true,
-      indexType: 0,
-      indexState: 0,
-      activityList: [
-        {
-          url: "/static/order-poster.svg",
-          title: "2022-2023年度供暖费",
-          address: "千林郡5号楼1单元10层1001室",
-		  money:'2385.40',
-          time: "2021-09-05",
-          orderStatus:'待缴费'
-        },
-        {
-          url: "/static/order-poster.svg",
-          title: "2022-2023年度供暖费",
-          address: "千林郡5号楼1单元10层1001室",
-		  money:'2385.40',
-          time: "2021-09-05",
-		  orderStatus:'已缴费'
-        },
-		{
-		  url: "/static/order-poster.svg",
-		  title: "2022-2023年度供暖费",
-		  address: "千林郡5号楼1单元10层1001室",
-		  money:'2385.40',
-		  time: "2021-09-05",
-		  orderStatus:'空置已缴费'
-		},
-      ],
-      activeListCopy: [],
+      heatList: [],
+	  statusObj:{
+		  '1':'已缴费',
+		  '2':'待缴费',
+		  '3':'空置已缴费'
+	  }
     };
   },
   onLoad() {
-    this.getActive();
+    this.getHeatList();
   },
   methods: {
     goDeatil(id) {
@@ -93,10 +68,10 @@ export default {
         url: "/pages/heatingPage/pay?id=" + id,
       });
     },
-    getActive() {
+    getHeatList() {
       let md5Sign = md5(
         "method=" +
-          "activity" +
+          "user" +
           "&timestamp=" +
           getApp().globalData.globalTimestamp +
           "&secret=" +
@@ -105,13 +80,13 @@ export default {
       let url =
         getApp().globalData.shareUrl +
         "api/api.php" +
-        "?method=activity&source=activity&action=my_list&timestamp=" +
+        "?method=user&source=user&action=get_order_list&timestamp=" +
         getApp().globalData.globalTimestamp +
         "&sign=" +
         md5Sign;
       let postData = {
         // page: 1,
-        // page_size: 15,
+        // page_size: 2,
 		openId:getApp().globalData.open_id
       };
       uni.request({
@@ -122,46 +97,9 @@ export default {
         },
         data: postData,
         success: (res) => {
-          // console.log(res);
+          console.log(res);
           if (res.data.code === 200) {
-            let list = res.data.data.list;
-            this.activeList = list.map((item) => {
-              /*
-                  url: "/static/activity/2.png",
-            title: "智能制造商标品牌培育系列培训活动",
-            way: "市场监督管理局",
-            date: "2021-08-07",
-            read: 322,
-            share: 1,
-            type: 0, //0线下
-             */
-              let ob = {
-                url: "",
-                title: "",
-                way: "",
-                date: "",
-                read: 0,
-                share: 0,
-                type: "",
-				status:'',
-                id: "",
-                status: 0,
-              };
-              ob.url = item.pic_url ? getApp().globalData.shareUrl + item.pic_url : '/static/activity/default.png';
-              ob.title = item.name;
-              ob.way = item.sponsor;
-              let time = this.$options.filters["globalTime"](item.start_time);
-			  let timeSecond = this.$options.filters["globalTime"](item.end_time);
-			  ob.date = time + "至" + timeSecond;
-              ob.read = parseInt(item.base_read_count) + parseInt(item.real_read_count);
-              ob.share =parseInt(item.real_repost_count) +parseInt(item.base_repost_count);
-              ob.type = item.type;
-			  ob.status = item.status; 
-              ob.id = item.id;
-              ob.status = item.status;
-              return ob;
-            });
-            this.activeListCopy = this.activeList;
+            this.heatList = res.data.data.list;
           }
         },
         fail: () => {

+ 14 - 45
pages/heatingPage/pay.vue

@@ -3,11 +3,11 @@
     <view class="supplyInfo">
 	  <view class="tel flex">
 	    <label>缴费名称:</label>
-	    <input type="text" class="card input" v-model="payInfo.payName" disabled/>
+	    <input type="text" class="card input" v-model="payInfo.name" disabled/>
 	  </view>
 	  <view class="tel flex">
 	    <label>订单编号:</label>
-	    <input type="text" class="card input" v-model="payInfo.num" disabled/>
+	    <input type="text" class="card input" v-model="payInfo.code" disabled/>
 	  </view>
 	  <view class="tel flex">
 	    <label>住宅地址:</label>
@@ -15,7 +15,7 @@
 	  </view>
 	  <view class="tel flex">
 	    <label>户主姓名:</label>
-	    <input type="text" class="card input" v-model="payInfo.master" disabled/>
+	    <input type="text" class="card input" v-model="payInfo.owner_name" disabled/>
 	  </view>
 	  <view class="tel flex">
 	    <label>住宅面积:</label>
@@ -30,7 +30,7 @@
 	  </view>
 	  <view class="tel flex">
 	    <label>缴费金额:</label>
-	    <input type="text" class="card input" v-model="payInfo.payMoney" disabled/>
+	    <input type="text" class="card input" v-model="payInfo.part_fee" disabled/>
 	  </view>			
     </view>
     <button class="submit" @tap="paySubmit">{{payStatus ? '申请开票' : '缴费'}}</button>
@@ -62,34 +62,18 @@ export default {
   data() {
     return {
       payInfo: {
-        payName: "2022-2023年度供暖费",
-        num: "20230907235146",
-		address:'千林郡5号楼1单元1001室',
-		master:'曹**',
-		area:'108',
-		payType:"1",
-		payMoney:'626.40'
       },
 	  payStatus:0
     };
   },
-  methods: {
-    submit() {
-      if (
-        this.company.name === "" ||
-        this.company.code === "" ||
-        this.company.tel === ""
-      ) {
-        uni.showToast({
-          title: "企业信息不完善",
-          icon: "error",
-        });
-        return;
-      }
-
+  onLoad(option) {
+	this.getPayDetail(option.id)
+  },
+  methods: {   
+    getPayDetail(payId) {
       let md5Sign = md5(
         "method=" +
-          "need" +
+          "user" +
           "&timestamp=" +
           getApp().globalData.globalTimestamp +
           "&secret=" +
@@ -98,18 +82,12 @@ export default {
       let url =
         getApp().globalData.shareUrl +
         "api/api.php" +
-        "?method=need&source=need&action=add&timestamp=" +
+        "?method=user&source=user&action=get_order_info&timestamp=" +
         getApp().globalData.globalTimestamp +
         "&sign=" +
         md5Sign;
       let postData = {
-        title: this.supplyInfo.title,
-        type: +this.index == 0 ? 2 : 1,
-        content: this.supplyInfo.msg,
-        company_name: this.company.name,
-        company_code: this.company.code,
-        phone: this.company.tel,
-        attach_ids: this.imgIdList.join(),
+        code:payId, 
         openId: getApp().globalData.open_id,
       };
       uni.request({
@@ -121,17 +99,8 @@ export default {
         data: postData,
         success: (res) => {
           if (res.data.code === 200) {
-            uni.showToast({
-              title: "发布供需成功",
-              icon: "none",
-              duration: 2000,
-            });
-            uni.setStorageSync("supply_name", this.company.name);
-            uni.setStorageSync("supply_code", this.company.code);
-            uni.setStorageSync("supply_tel", this.company.tel);
-            setTimeout(() => {
-              uni.navigateBack({});
-            }, 1500);
+               this.payInfo = res.data.data;
+			   this.payInfo.address = this.payInfo.estate_name  + this.payInfo.building_name + this.payInfo.unit + this.payInfo.room
           } else {
             uni.showToast({
               title: res.data.msg,

+ 29 - 99
pages/index/index.vue

@@ -24,7 +24,7 @@
           :key="index"
           class="swiper-content"
         >
-          <image :src="item.pic_path"  mode="aspectFill" style="width: 100%; height: 100%" @click="swiperNavGoPage(item)"></image>
+          <image :src="item.img"  mode="aspectFill" style="width: 100%; height: 100%"></image>
         </swiper-item>
       </swiper>
       <image src="../../static/Intersect.svg" class="groove-img"></image>
@@ -59,12 +59,12 @@
       </view>
       <view
         class="notice-content-box"
-        v-for="(item, index) in activityList"
+        v-for="(item, index) in heatList"
         :key="index"
         style="justify-content: start; padding: 30rpx 0 30rpx 30rpx;border-radius: 0;"
-        @click="goPayDeatil(item.id)" >
+        @click="goPayDeatil(item.code)" >
         <image
-          :src="item.url"
+          src="/static/order-poster.svg"
           style="
             width: 112rpx;
             height: 112rpx;
@@ -74,15 +74,15 @@
         ></image>
         <view class="notice-content" style="width: 75%">
           <view class="notice-content-font">{{
-            item.title
+            item.name
           }}</view>
           <view class="display-flex-start" style="margin-top: 20rpx">
             <view class="notice-content-time color-a7adba">
-				{{item.address}}
+				{{item.estate_name  + item.building_name + item.unit + item.room}}
 			</view>
 			<view class="notice-content-time display-flex-start">
 				<text class="color-a7adba">¥:</text>
-				<text class="order-money">{{item.money}}</text>
+				<text class="order-money">{{item.total_fee}}</text>
 			</view>
           </view>
           <view class="display-between" style="margin-top: 20rpx">
@@ -90,7 +90,7 @@
 				{{item.time}}
 			</view>  
 			<view class="display-flex-start">
-				<view class="notice-content-time" style="color: #d9001b;">{{item.orderStatus}}</view>
+				<view class="notice-content-time" style="color: #d9001b;">{{statusObj[item.type]}}</view>
 			</view>
           </view>
         </view>
@@ -119,12 +119,12 @@ export default {
 	  btnPos:uni.getMenuButtonBoundingClientRect().top + 6,
 	  shareImgUrl:'',
       swiperList: [
-        // {
-        //   img: "/static/swiper/swiper1.jpg",
-        // },
-        // {
-        //   img: "/static/swiper/swiper2.jpg",
-        // },
+        {
+          img: "/static/poster-bg.png",
+        },
+		{
+		  img: "/static/poster-bg.png",
+		},
       ],
       swiperCurrent: 0,
       navList: [
@@ -139,36 +139,24 @@ export default {
           content: "一件报修",
         },
       ],
-      activityList: [
-        {
-          url: "/static/order-poster.svg",
-          title: "2022-2023年度供暖费",
-          address: "千林郡5号楼1单元10层1001室",
-		  money:'2385.40',
-          time: "2021-09-05",
-          orderStatus:'待缴费'
-        },
-        {
-          url: "/static/order-poster.svg",
-          title: "2022-2023年度供暖费",
-          address: "千林郡5号楼1单元10层1001室",
-		  money:'2385.40',
-          time: "2021-09-05",
-		  orderStatus:'已缴费'
-        },
-      ],
+      heatList: [],
+	  statusObj:{
+		  '1':'已缴费',
+		  '2':'待缴费',
+		  '3':'空置已缴费'
+	  }
     };
   },
   onShow() {
     uni.hideTabBar({});
-    //this.getActive();
+    this.getHeatList();
   },
   onLoad() {
     // uni.showLoading({
     //   title: "加载中",
     //   mask: true,
     // });
-    this.getSwiperList();
+    //this.getSwiperList();
   },
   onShareAppMessage() {
   //  url: "/pages/index/index";
@@ -182,38 +170,6 @@ export default {
     swiperChange(e) {
       this.swiperCurrent = e.detail.current;
     },
-	swiperNavGoPage(info){
-	  let pageObj = {
-		  'consult':'/pages/appeal/index',
-		  'policy':'/pages/policy/index',
-		  'park':'/pages/park/index',
-		  'activity':'/pages/activity/index',
-		  'notice':'/pages/notice/index',
-		  'company':'/pages/enterprise/index',
-	  }
-	  let pageDetailObj = {
-		  'consult':'/pages/appeal/appeal_detail?id=',
-		  'policy':'/pages/policy/policy_deatil?id=',
-		  'park':'/pages/park/park_detail?id=',
-		  'activity':'/pages/activity/activity_detail?id=',
-		  'notice':'/pages/notice/notice_detail?id=',
-		  'company':'/pages/enterprise/enterprise_detail?id=',
-	  }
-	  console.log(info.link_table,info.link_id)
-	  if(info.link_table){
-		if(info.link_id && info.link_id != '0'){
-			  uni.navigateTo({
-				url:pageDetailObj[info.link_table] + info.link_id
-			  })
-		}else {
-			  uni.navigateTo({
-				url:pageObj[info.link_table]
-			  })
-		}  
-	  }else {
-		  return
-	  }
-	},
 	goOtherPage(item){
 		uni.navigateTo({
 			url:item.path
@@ -254,8 +210,6 @@ export default {
               item.pic_path = getApp().globalData.shareUrl + item.pic_path;
             });
             this.swiperList = res.data.data.list;
-			this.swiperList[0].pic_path = '/static/poster-bg.png' 
-			this.swiperList[1].pic_path = '/static/poster-bg.png' 
 			// this.shareImgUrl = res.data.data.list[0].pic_path
           }
         },
@@ -264,10 +218,10 @@ export default {
         },
       });
     },
-    getActive() {
+    getHeatList() {
       let md5Sign = md5(
         "method=" +
-          "common" +
+          "user" +
           "&timestamp=" +
           getApp().globalData.globalTimestamp +
           "&secret=" +
@@ -276,15 +230,14 @@ export default {
       let url =
         getApp().globalData.shareUrl +
         "api/api.php" +
-        "?method=common&source=activity&action=list&timestamp=" +
+        "?method=user&source=user&action=get_order_list&timestamp=" +
         getApp().globalData.globalTimestamp +
         "&sign=" +
         md5Sign;
       let postData = {
-        page: 1,
-        page_size: 2,
-		s_cancel : 0,
-		order_by : "weight desc,id desc"
+        // page: 1,
+        // page_size: 2,
+		openId:getApp().globalData.open_id
       };
       uni.request({
         url: url,
@@ -296,28 +249,7 @@ export default {
         success: (res) => {
           console.log(res);
           if (res.data.code === 200) {
-            let list = res.data.data.list;
-            this.activityList = list.map((item) => {
-              let ob = {
-                url: "",
-                title: "",
-                department: "",
-                time: "",
-                browe: 0,
-                share: 0,
-                type: "",
-                id: "",
-              };
-              ob.url = item.pic_url ? getApp().globalData.shareUrl + item.pic_url : '/static/activity/default.png';
-              ob.title = item.name;
-              ob.department = item.sponsor;
-              ob.time = this.$options.filters["globalTime"](item.start_time);
-              ob.browe = parseInt(item.base_read_count) + parseInt(item.real_read_count);
-              ob.share =  parseInt(item.real_repost_count) + parseInt(item.base_repost_count);
-              ob.isOnline = item.type == 1 ? 1 : 0;
-              ob.id = item.id;
-              return ob;
-            });
+            this.heatList = res.data.data.list;
           }
         },
         fail: () => {
@@ -325,8 +257,6 @@ export default {
         },
       });
     },
-
-
     goPayDeatil(id) {
       uni.navigateTo({
         url: "/pages/heatingPage/pay?id=" + id,

+ 6 - 6
pages/selfCenter/index.vue

@@ -103,12 +103,12 @@ export default {
 	//this.$forceUpdate();
   },
   onShow() {
-    // 	 this.isAuth = getApp().globalData.isAuth;
-    // if(this.isAuth){
-    //  this.userHeadImg = getApp().globalData.user_headUrl;
-    //  this.userNickName = getApp().globalData.user_name;
-    // }
-    //this.getUserInfo();
+    this.isAuth = getApp().globalData.isAuth;
+    if(this.isAuth){
+     this.userHeadImg = getApp().globalData.user_headUrl;
+     this.userNickName = getApp().globalData.user_name;
+    }
+    this.getUserInfo();
   },
   methods: {
     goAuthPage() {

+ 268 - 67
pages/selfCenter/with_house.vue

@@ -2,23 +2,40 @@
   <view class="content">
     <view class="supplyInfo">
 	  <view class="tel flex">
-	    <label>小区名称:</label>
-	    <input type="text" class="card input" v-model="house.name"/>
+		<label>小区名称:</label>
+		<view class="picker">
+		  <picker
+		    @change="hoodChange"
+		    :value="hoodIndex"
+		    :range="hoodList"
+		    range-key="name"
+		    class="pick"
+		  >
+		    <view class="picker_title">
+		      <view class="pickername">
+		        <view>
+		          {{ hoodList[hoodIndex].name || '请选择小区'}}
+		        </view>
+		      </view>
+		      <view class="triangle-down"></view>
+		    </view>
+		  </picker>
+		</view>
 	  </view>
-	  <view class="tel flex">
+	  <view class="tel flex"  style="margin-top:30rpx;">
 	    <label style="text-align: center;">楼栋:</label>
 	    <view class="picker">
 	      <picker
-	        @change="bindPickerChange"
-	        :value="index"
-	        :range="array"
+	        @change="buildingChange"
+	        :value="buildIndex"
+	        :range="buildList"
 	        range-key="name"
 	        class="pick"
 	      >
 	        <view class="picker_title">
 	          <view class="pickername">
 	            <view>
-	              {{ array[index].name }}
+	              {{ buildList[buildIndex].name || '请选择楼栋'}}
 	            </view>
 	          </view>
 	          <view class="triangle-down"></view>
@@ -26,20 +43,20 @@
 	      </picker>
 	    </view>
 	  </view>
-	  <view class="tel flex" style="margin-top:30rpx;">
+	  <view class="tel flex">
 	    <label   style="text-align: center;">单元:</label>
 	    <view class="picker">
 	      <picker
-	        @change="bindPickerChange"
-	        :value="index"
-	        :range="array"
+	        @change="unitChange"
+	        :value="unitIndex"
+	        :range="unitList"
 	        range-key="name"
 	        class="pick"
 	      >
 	        <view class="picker_title">
 	          <view class="pickername">
 	            <view>
-	              {{ array[index].name }}
+	              {{ unitList[unitIndex].name || '请选择单元'}}
 	            </view>
 	          </view>
 	          <view class="triangle-down"></view>
@@ -48,8 +65,25 @@
 	    </view>
 	  </view>
 	  <view class="tel flex">
-	    <label   style="text-align: center;text-indent: 16rpx;">房号:</label>
-	    <input type="text" class="card input" v-model="house.num"/>
+			<label   style="text-align: center;">房号:</label>
+			<view class="picker">
+			  <picker
+				@change="numChange"
+				:value="numIndex"
+				:range="numList"
+				range-key="name"
+				class="pick"
+			  >
+				<view class="picker_title">
+				  <view class="pickername">
+					<view>
+					  {{ numList[numIndex].name || '请选择房号'}}
+					</view>
+				  </view>
+				  <view class="triangle-down"></view>
+				</view>
+			  </picker>
+			</view>
 	  </view>
 	  <view class="tel flex" style="margin-top: 100rpx;">
 	    <label>户主姓名:</label>
@@ -92,27 +126,232 @@ export default {
 		master:'曹**',
 		area:'108',
       },
-	  array: [{ name: "1单元" }, { name: "2单元" }],
-	  index: 0,
+	  hoodList: [],
+	  buildList: [],
+	  unitList: [],
+	  numList: [],
+	  hoodIndex: 0,
+	  buildIndex:0,
+	  unitIndex:0,
+	  numIndex:0,
     };
   },
+  onLoad() {
+
+  	
+  },
+  onShow() {
+    this.searchHood()
+  },
   methods: {
+	searchHood(){
+		let that = this;
+		// let result = e.detail.value;
+		let md5Sign = md5(
+		  "method=" +
+		    "user" +
+		    "&timestamp=" +
+		    getApp().globalData.globalTimestamp +
+		    "&secret=" +
+		    getApp().globalData.secret
+		);
+		let url =
+		  getApp().globalData.shareUrl +
+		  "api/api.php" +
+		  "?method=user&source=user&action=search_estate&timestamp=" +
+		  getApp().globalData.globalTimestamp +
+		  "&sign=" +
+		  md5Sign;
+		let postData = {
+          keyword:'',
+		  openId: getApp().globalData.open_id,
+		};
+		uni.request({
+		  url: url,
+		  method: "POST",
+		  header: {
+		    "content-type": "application/x-www-form-urlencoded",
+		  },
+		  data: postData,
+		  success: (res) => {
+		    if (res.data.code === 200) {
+				let obj = res.data.data;
+				for (let key in obj) {
+					let child = {
+						name:obj[key]
+					}
+				 that.hoodList.push(child)
+				}
+			this.searchDetail(this.hoodList[this.hoodIndex].name)		
+		    } 
+		  },
+		  fail: () => {
+		    console.log("连接失败");
+		  },
+		});
+	},
+	searchDetail(hood,build,unit){
+		let that = this, addressResult,searchType;
+		// let result = e.detail.value;
+		if(build && unit){
+			searchType = 'houseNumber'
+			addressResult = hood + '/' + build + '/' + unit
+		}
+		if(build && !unit){
+			searchType = 'houseUnit'
+			addressResult = hood + '/' + build
+		}
+		if(!build && !unit){
+			searchType = 'houseBuilding'
+			addressResult = hood
+		}		
+		let md5Sign = md5(
+		  "method=" +
+		    "user" +
+		    "&timestamp=" +
+		    getApp().globalData.globalTimestamp +
+		    "&secret=" +
+		    getApp().globalData.secret
+		);
+		let url =
+		  getApp().globalData.shareUrl +
+		  "api/api.php" +
+		  "?method=user&source=user&action=get_address&timestamp=" +
+		  getApp().globalData.globalTimestamp +
+		  "&sign=" +
+		  md5Sign;
+		let postData = {
+          address:addressResult,
+		  openId: getApp().globalData.open_id,
+		};
+		uni.request({
+		  url: url,
+		  method: "POST",
+		  header: {
+		    "content-type": "application/x-www-form-urlencoded",
+		  },
+		  data: postData,
+		  success: (res) => {
+		    if (res.data.code === 200) {
+                   if(res.data.data.length === 0){
+					     uni.showToast({
+					       title: "暂无数据",
+					       icon: "error",
+					     });
+				   }else{
+					   that.makeHouseData(searchType,res.data.data)
+				   } 	
+		    } 
+		  },
+		  fail: () => {
+		    console.log("连接失败");
+		  },
+		});		
+	},
+	makeHouseData(type,dataList){
+		let that = this , obj = dataList;
+		switch (type){
+			case 'houseBuilding':
+				for (let key in obj) {
+					let child = {
+						name:obj[key]
+					}
+					that.buildList.push(child)
+				}
+				that.searchDetail(that.hoodList[that.hoodIndex].name,that.buildList[0].name)
+				break;
+			case 'houseUnit':
+				for (let key in obj) {
+					let child = {
+						name:obj[key]
+					}
+					that.unitList.push(child)
+				}	
+				that.searchDetail(that.hoodList[that.hoodIndex].name,that.buildList[that.buildIndex].name,that.unitList[0].name)
+				break;
+			case 'houseNumber':
+				for (let key in obj) {
+						let child = {
+							name:obj[key]
+						}
+						that.numList.push(child)
+					}
+					that.numList[that.numIndex].name = that.numList[0].name
+				break;	
+			default:
+				break;
+		}
+	},
+	houseSubmit(){
+	  //uni.navigateBack({});
+	  this.open()
+	},
+	hoodChange(e){
+	  this.hoodIndex = e.detail.value;
+	  this.searchDetail(this.hoodList[this.hoodIndex].name)
+	},
+    buildingChange(e) {
+	  if(!this.hoodList.length){
+		    uni.showToast({
+		      title: "请先选择小区",
+		      icon: "error",
+		    });
+			return
+	  }
+      this.buildIndex = e.detail.value;
+	  this.searchDetail(this.hoodList[this.hoodIndex].name,this.buildList[this.buildIndex].name)
+    },
+    unitChange(e) {
+	  if(!this.buildList.length){
+		    uni.showToast({
+		      title: "请先选择楼栋",
+		      icon: "error",
+		    });
+			return
+	  }		
+      this.unitIndex = e.detail.value;
+	  this.searchDetail(this.hoodList[this.hoodIndex].name,this.buildList[this.buildIndex].name,this.unitList[this.unitIndex].name)
+    },	
+    numChange(e) {
+	  if(!this.unitList.length){
+		    uni.showToast({
+		      title: "请先选择单元",
+		      icon: "error",
+		    });
+			return
+	  }			
+      this.numIndex = e.detail.value;
+	  // this.searchDetail(this.hoodList[this.hoodIndex].name,this.buildList[this.buildIndex].name,this.unitList[this.unitIndex].name)
+    },	
+	submitPop(){
+		this.closePopup()
+		this.submit()
+	},
+	closePop(){
+		this.closePopup()
+	},
+	open() {
+		  this.$refs.popup.open('center')
+	  },
+	closePopup() {
+		  this.$refs.popup.close()
+	  },
     submit() {
       if (
-        this.company.name === "" ||
-        this.company.code === "" ||
-        this.company.tel === ""
+        !this.buildList.length ||
+        !this.unitList.length ||
+        !this.numList.length
       ) {
         uni.showToast({
-          title: "企业信息不完善",
+          title: "小区信息不完善",
           icon: "error",
         });
         return;
       }
-
+	  let addressResult = this.hoodList[this.hoodIndex].name + '/' + this.buildList[this.buildIndex].name + '/' + this.unitList[this.unitIndex].name + '/' + this.numList[this.numIndex].name
       let md5Sign = md5(
         "method=" +
-          "need" +
+          "user" +
           "&timestamp=" +
           getApp().globalData.globalTimestamp +
           "&secret=" +
@@ -121,18 +360,12 @@ export default {
       let url =
         getApp().globalData.shareUrl +
         "api/api.php" +
-        "?method=need&source=need&action=add&timestamp=" +
+        "?method=user&source=user&action=band_owner&timestamp=" +
         getApp().globalData.globalTimestamp +
         "&sign=" +
         md5Sign;
       let postData = {
-        title: this.supplyInfo.title,
-        type: +this.index == 0 ? 2 : 1,
-        content: this.supplyInfo.msg,
-        company_name: this.company.name,
-        company_code: this.company.code,
-        phone: this.company.tel,
-        attach_ids: this.imgIdList.join(),
+        address:addressResult, 
         openId: getApp().globalData.open_id,
       };
       uni.request({
@@ -144,49 +377,17 @@ export default {
         data: postData,
         success: (res) => {
           if (res.data.code === 200) {
-            uni.showToast({
-              title: "发布供需成功",
-              icon: "none",
-              duration: 2000,
-            });
-            uni.setStorageSync("supply_name", this.company.name);
-            uni.setStorageSync("supply_code", this.company.code);
-            uni.setStorageSync("supply_tel", this.company.tel);
-            setTimeout(() => {
-              uni.navigateBack({});
-            }, 1500);
-          } else {
-            uni.showToast({
-              title: res.data.msg,
-              icon: "none",
-              duration: 2500,
-            });
+			  uni.showToast({
+			    title: "绑定成功",
+			    icon: "success",
+			  });
           }
         },
         fail: () => {
           console.log("连接失败");
         },
       });
-    },
-	houseSubmit(){
-	  //uni.navigateBack({});
-	  this.open()
-	},
-    bindPickerChange(e) {
-      this.index = e.detail.value;
-    },
-	submitPop(){
-		this.closePopup()
-	},
-	closePop(){
-		this.closePopup()
-	},
-	open() {
-		  this.$refs.popup.open('center')
-	  },
-	closePopup() {
-		  this.$refs.popup.close()
-	  },	
+    },		  
   },
 };
 </script>