wangzizhong 3 years ago
parent
commit
165ae0780c
7 changed files with 308 additions and 707 deletions
  1. 2 2
      App.vue
  2. 1 1
      manifest.json
  3. 6 0
      pages.json
  4. 39 50
      pages/makeField/index.vue
  5. 0 411
      pages/makeField/putSupply.vue
  6. 214 0
      pages/makeField/selectTime.vue
  7. 46 243
      pages/makeField/viewDetail.vue

+ 2 - 2
App.vue

@@ -2,8 +2,8 @@
 import md5 from '@/common/md5.js';
 export default {
   globalData: {
-    //shareUrl: "https://kiq.xazhima.com/",
-	shareUrl:"https://kgwxxcx.xixianxinqu.gov.cn/1026airqt/",
+    shareUrl: "https://kiq.xazhima.com/",
+	//shareUrl:"https://kgwxxcx.xixianxinqu.gov.cn/1026airqt/",
     globalTimestamp: Date.now().toString(),
     secret: "AirQK_weichat_app_zhima",
     selectedIndex:0,

+ 1 - 1
manifest.json

@@ -50,7 +50,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx889d7d76e7aa3cd3",
+        "appid" : "wx1dbc76c97a3e4880",
         "setting" : {
             "urlCheck" : false,
             "minified" : true,

+ 6 - 0
pages.json

@@ -265,6 +265,12 @@
 			"style": {
 				"navigationBarTitleText": "参观详情"
 			}
+		},
+		{
+			"path": "pages/makeField/selectTime",
+			"style": {
+				"navigationBarTitleText": "参观详情"
+			}
 		}
 	],
 	"globalStyle": {

+ 39 - 50
pages/makeField/index.vue

@@ -8,19 +8,25 @@
 		 @tap="toDetail(field.id)"
       >
         <view class="image_content">
-          <image :src="field.image" mode="aspectFill" />
+          <image :src="field.pic_path ? shareUrl + field.pic_path : '/static/nodata.svg'" mode="aspectFill" />
         </view>
         <view class="info">
           <view class="title">
-            {{ field.title }}
+            {{ field.name }}
           </view>
           <view class="time">
-			  <view>
+			  <view style="margin-bottom: 10rpx;">
 				  <view>开放时间</view>
-				  <view style="margin-top: 6rpx;">周一至周五:08:00~17:00</view>
+				  <view style="margin-top: 6rpx;">{{field.open_days}}:{{field.open_hours}}</view>
 			  </view>
 			 <view class="field-btn-box">
-				 <button>今日已满</button>
+				 <button  :class="{
+					close: field.order_status == '未开放',
+					free: field.order_status == '空闲',
+					full: field.order_status == '今日已满',
+					can: field.order_status == '今日可约',}">
+					{{field.order_status}}</button>
+				 <!-- <button style="background: #00a8ea;" :disabled="field.order_status == '今日已满' || field.order_status == '未开放'">前往预约</button> -->
 				 <button style="background: #00a8ea;">前往预约</button>
 			 </view>
 		  </view>
@@ -36,11 +42,7 @@ export default {
   data() {
     return {
       fieldList: [],
-	  statusObj:{
-		  '1':'空闲',
-		  '2':'今日已满',
-		  '3':'今日可约'
-	  }
+	  shareUrl:getApp().globalData.shareUrl,
     };
   },
   onLoad() {
@@ -49,13 +51,13 @@ export default {
   methods: {
     toDetail(index) {
       uni.navigateTo({
-        url: "/pages/makeField/viewDetail?id=" + '13',
+        url: "/pages/makeField/viewDetail?id=" + index,
       });
     },
     getMyList() {
       let md5Sign = md5(
         "method=" +
-          "need" +
+          "area" +
           "&timestamp=" +
           getApp().globalData.globalTimestamp +
           "&secret=" +
@@ -64,55 +66,30 @@ export default {
       let url =
         getApp().globalData.shareUrl +
         "api/api.php" +
-        "?method=need&source=need&action=list&timestamp=" +
+        "?method=area&source=area&action=list&timestamp=" +
         getApp().globalData.globalTimestamp +
         "&sign=" +
         md5Sign;
-      let postData = {
-        s_type: this.index == 2 ? 1 : 2,
-      };
       uni.request({
         url: url,
         method: "POST",
         header: {
           "content-type": "application/x-www-form-urlencoded",
         },
-        data: this.index == -1 || this.index == 0 ? {} : postData,
+        data: {
+			// method:'area',
+			page:'',
+			page_size :''
+		},
         success: (res) => {
           if (res.data.code === 200) {
             let list = res.data.data.list;
-            /* 
-                supplyList: new Array(5).fill({
-                image: "/static/supply/u1779.png",
-                title: "移动式空气消毒机",
-                time: "2021-08-30 14:50:00",
-                state: 1,
-                }),
-                
-       */
-            this.fieldList = list.map((item) => {
-              let ob = {
-                image: "",
-                title: "",
-                time: "",
-                state: "",
-                id: "",
-              };
-              ob.id = item.id;
-              ob.title = item.title;
-              let time = this.$options.filters["globalTime"](item.addtime);
-              let timeSecond = this.$options.filters["globalTimeSecond"](
-                item.addtime
-              );
-              ob.time = time + " " + timeSecond;
-              ob.state = item.type;
-           //   ob.image = "/static/nodata.svg";
-              ob.image = item.attach_list[0]
-                ? getApp().globalData.shareUrl + item.attach_list[0]
-                : "/static/nodata.svg";
-              return ob;
-            });
-            // console.log(res.data.data.list);
+			// list.forEach((item,index)=>{
+			// 	item.statusName = '空闲'
+			// })
+			// list[1].statusName = '今日已满';
+			// list[2].statusName = '今日可约';
+			this.fieldList = list;
           }
         },
         fail: () => {
@@ -177,7 +154,7 @@ export default {
 			display: flex;
 			flex-direction: column;
 			justify-content: space-around;
-			margin-top: 20rpx;
+			// margin-top: 20rpx;
 		  .field-btn-box {
 			  display: flex;
 			  justify-content: space-between;
@@ -188,6 +165,18 @@ export default {
 				font-size: 18rpx;
 				margin: 0;
 			  };
+			  .close {
+			  	 background: #7f7f7f; 
+			  };
+			  .free {
+				 background: #95f204; 
+			  };
+			  .full {
+				 background: #f59a23; 
+			  }
+			  .can {
+			  	background: #5498ff; 
+			  }
 		  }
         }
       }

+ 0 - 411
pages/makeField/putSupply.vue

@@ -1,411 +0,0 @@
-<template>
-  <view class="content">
-    <view class="supplyInfo">
-      <view class="flex">
-        <label>发布标题:</label>
-        <input type="text" v-model="supplyInfo.title" class="input card" />
-      </view>
-      <view class="flex">
-        <label>选择类型:</label>
-        <view class="picker">
-          <picker
-            @change="bindPickerChange"
-            :value="index"
-            :range="array"
-            range-key="name"
-            class="pick"
-          >
-            <view class="picker_title">
-              <view class="pickername">
-                <view>
-                  {{ array[index].name }}
-                </view>
-              </view>
-              <view class="triangle-down"></view>
-            </view>
-          </picker>
-        </view>
-      </view>
-      <view class="flex">
-        <label>详情:</label>
-        <textarea v-model="supplyInfo.msg" class="area card"></textarea>
-      </view>
-      <view class="update_photo">
-        <view class="title"></view>
-        <view>上传图片:</view>
-        <view class="update_container card upload-parent-box">
-          <view class="update_button display-flex">
-            <view class="upload-box" @click="getImage('album')">
-              <view class="img">
-                <image src="/static/appeal/photo.png" class="photo"></image>
-              </view>
-              <view class="txt">上传</view>
-            </view>
-            <view
-              class="display-flex upload-box-photo"
-              v-for="(item, index) in uploadList"
-              :key="index"
-            >
-              <image
-                :src="item"
-                mode="aspectFit"
-                style="width: 100%; height: 100%"
-                @click="showLarge(item)"
-              />
-              <image
-                src="../../static/del.png"
-                class="del-icon"
-                mode="aspectFit"
-                style="width: 30rpx; height: 30rpx"
-                @click="delPhoto(index)"
-              ></image>
-            </view>
-          </view>
-        </view>
-      </view>
-    </view>
-    <view class="info">
-      <view class="title">企业信息</view>
-      <view class="name flex">
-        <label>企业名称:</label>
-        <input type="text" class="card input" v-model="company.name" />
-      </view>
-      <view class="tel flex">
-        <label>统一社会信用代码:</label>
-        <input type="text" class="card input" v-model="company.code" />
-      </view>
-      <view class="tel flex">
-        <label>联系电话:</label>
-        <input type="text" class="card input" v-model="company.tel" />
-      </view>
-    </view>
-    <button class="submit" @tap="submit">提交</button>
-  </view>
-</template>
-<script>
-import md5 from "@/common/md5.js";
-export default {
-  data() {
-    return {
-      array: [{ name: "供需" }, { name: "需求" }],
-      index: 0,
-      supplyInfo: {
-        title: "",
-        msg: "",
-      },
-      company: {
-        name: uni.getStorageSync("supply_name") || "",
-        code: uni.getStorageSync("supply_code") || "",
-        tel: uni.getStorageSync("supply_tel") || "",
-      },
-      uploadList: [],
-      imgIdList: [],
-    };
-  },
-  methods: {
-    submit() {
-      if (
-        this.company.name === "" ||
-        this.company.code === "" ||
-        this.company.tel === ""
-      ) {
-        uni.showToast({
-          title: "企业信息不完善",
-          icon: "error",
-        });
-        return;
-      }
-
-      let md5Sign = md5(
-        "method=" +
-          "need" +
-          "&timestamp=" +
-          getApp().globalData.globalTimestamp +
-          "&secret=" +
-          getApp().globalData.secret
-      );
-      let url =
-        getApp().globalData.shareUrl +
-        "api/api.php" +
-        "?method=need&source=need&action=add&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(),
-        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) {
-            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,
-            });
-          }
-        },
-        fail: () => {
-          console.log("连接失败");
-        },
-      });
-    },
-    bindPickerChange(e) {
-      this.index = e.detail.value;
-    },
-    getImage(type) {
-      let that = this;
-      if (that.uploadList.length >= 3) {
-        uni.showToast({
-          title: "最多上传3张图片",
-          icon: "none",
-          duration: 2500,
-        });
-        return;
-      }
-      uni.chooseImage({
-        sourceType: [type],
-        count: 3 - that.uploadList.length,
-        sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
-        success: (res) => {
-          for (let i = 0; i < res.tempFilePaths.length; i++) {
-            that.uploadList.push(res.tempFilePaths[i]);
-            that.uploadFileRequest(res.tempFilePaths[i]);
-          }
-        },
-      });
-    },
-    uploadFileRequest(fileVal) {
-      uni.showLoading({
-        title: "上传中",
-        mask: true,
-      });
-      let that = this;
-      let md5Sign = md5(
-        "method=" +
-          "upload" +
-          "&timestamp=" +
-          getApp().globalData.globalTimestamp +
-          "&secret=" +
-          getApp().globalData.secret
-      );
-      let url =
-        getApp().globalData.shareUrl +
-        "api/api.php" +
-        "?method=upload&source=consult&timestamp=" +
-        getApp().globalData.globalTimestamp +
-        "&sign=" +
-        md5Sign;
-      uni.uploadFile({
-        url: url, //需要设置为全局
-        filePath: fileVal,
-        name: "file",
-        formData: {
-          file: fileVal,
-        },
-        success: (res) => {
-          let tmpres = JSON.parse(res.data);
-          console.log(tmpres);
-          uni.hideLoading();
-          that.imgIdList.push(tmpres.data.id);
-        },
-        fail: (res) => {
-          console.log("上传请求失败");
-          console.log(res);
-        },
-      });
-    },
-    delPhoto(idx) {
-      this.uploadList.splice(idx, 1);
-      this.imgIdList.splice(idx, 1);
-    },
-    showLarge(src) {
-      uni.previewImage({
-        urls: [src],
-        longPressActions: {
-          itemList: ["发送给朋友", "保存图片"],
-          success: function (data) {},
-          fail: function (err) {
-            console.log(err.errMsg);
-          },
-        },
-      });
-    },
-  },
-};
-</script>
-<style lang="scss" scoped>
-.upload-parent-box {
-  height: 150rpx;
-  padding-top: 25rpx;
-  padding-left: 20rpx;
-}
-.upload-box {
-  display: flex;
-  flex-flow: column;
-  width: 25%;
-  background-color: #e0e0e0;
-  height: 140rpx;
-  border-radius: 10rpx;
-  padding-top: 15rpx;
-  image {
-    width: 60rpx !important;
-    height: 60rpx !important;
-  }
-}
-.upload-box-photo {
-  width: 25%;
-  height: 110rpx;
-  border-radius: 10rpx;
-  padding-top: 15rpx;
-  position: relative;
-}
-.del-icon {
-  position: absolute;
-  right: 0;
-  width: 30rpx;
-  height: 30rpx;
-}
-
-.update_button {
-  text-align: center;
-  display: flex;
-}
-.content {
-  font-size: 28rpx;
-  font-weight: 200;
-  padding: 1% 2%;
-  .title {
-    font-size: 30rpx;
-    margin: 4% 0;
-  }
-  label {
-    display: inline-block;
-    width: 25%;
-    vertical-align: middle;
-  }
-  .card {
-    background-color: rgb(248, 247, 247);
-    border-radius: 10rpx;
-  }
-  .flex {
-    display: flex;
-    align-items: center;
-    margin-bottom: 2%;
-  }
-  .input {
-    padding: 0 2%;
-    margin: 2% 0;
-    display: inline-block;
-    width: 80%;
-    height: 70rpx;
-  }
-  .supplyInfo {
-    border-radius: 40rpx;
-    padding: 4%;
-    box-shadow: rgba(100, 100, 111, 0.2) 14rpx 14rpx 40rpx 14rpx;
-	margin: 30rpx 0 30rpx 0;
-    .area {
-      height: 200rpx;
-      padding: 20rpx;
-      box-sizing: border-box;
-    }
-    .picker {
-      width: 80%;
-      height: 70rpx;
-      background: rgb(248, 247, 247);
-      display: flex;
-      align-items: center;
-      position: relative;
-      .pick {
-        width: 100%;
-      }
-      .picker_title {
-        display: flex;
-        width: 100%;
-        margin-left: 30rpx;
-        align-items: center;
-        justify-content: space-between;
-        .triangle-down {
-          width: 0;
-          height: 0;
-          border-top: 15rpx solid rgb(173, 173, 173);
-          border-left: 15rpx solid transparent;
-          border-right: 15rpx solid transparent;
-          position: absolute;
-          right: 10rpx;
-        }
-        .pickername {
-          font-weight: 100;
-        }
-      }
-    }
-    .upload-box {
-      width: 25%;
-      background-color: #e0e0e0;
-      height: 110rpx;
-      border-radius: 10rpx;
-      padding-top: 15rpx;
-    }
-    .upload-box-photo {
-      width: 25%;
-      height: 110rpx;
-      border-radius: 10rpx;
-      padding-top: 15rpx;
-      position: relative;
-    }
-    .del-icon {
-      position: absolute;
-      right: 0;
-      width: 30rpx;
-      height: 30rpx;
-    }
-    image {
-      width: 60rpx;
-      height: 60rpx;
-    }
-    .update_button {
-      text-align: center;
-      display: flex;
-    }
-  }
-  .info {
-    margin-top: 2%;
-    border-radius: 40rpx;
-    padding: 2% 4%;
-    box-shadow: rgba(100, 100, 111, 0.2) 14rpx 14rpx 40rpx 14rpx;
-  }
-  .submit {
-    color: white;
-    font-weight: normal;
-    width: 70%;
-    border-radius: 20rpx;
-    background-color: #02a7f0;
-    margin: 50rpx auto;
-  }
-}
-</style>

+ 214 - 0
pages/makeField/selectTime.vue

@@ -0,0 +1,214 @@
+<template>
+  <view class="content">
+    <view class="supplyList">
+      <view
+        class="supplyCard"
+        v-for="(field, i) in fieldList"
+        :key="i"
+		 @tap="toDetail(field.id)"
+      >
+        <view class="image_content">
+          <image :src="field.pic_path ? shareUrl + field.pic_path : '/static/nodata.svg'" mode="aspectFill" />
+        </view>
+        <view class="info">
+          <view class="title">
+            {{ field.name }}
+          </view>
+          <view class="time">
+			  <view style="margin-bottom: 10rpx;">
+				  <view>开放时间</view>
+				  <view style="margin-top: 6rpx;">{{field.open_days}}:{{field.open_hours}}</view>
+			  </view>
+			 <view class="field-btn-box">
+				 <button  :class="{
+					free: field.statusName == '空闲',
+					full: field.statusName == '今日已满',
+					can: field.statusName == '今日可约',}">
+					{{field.statusName}}</button>
+				 <button style="background: #00a8ea;" :disabled="field.statusName == '今日已满'">前往预约</button>
+			 </view>
+		  </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import md5 from "@/common/md5.js";
+export default {
+  data() {
+    return {
+      fieldList: [],
+	  shareUrl:getApp().globalData.shareUrl,
+	  areaId:''
+    };
+  },
+  onLoad(option) {
+	 this.areaId = option.id || '4' 
+     this.getDaysTime(option.id);
+  },
+  methods: {
+    toDetail(index) {
+      uni.navigateTo({
+        url: "/pages/makeField/viewDetail?id=" + index,
+      });
+    },
+    getDaysTime(id) {
+      let md5Sign = md5(
+        "method=" +
+          "area" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=area&source=area&action=get_days&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: {
+			area_id :id,
+			days:'30'
+		},
+        success: (res) => {
+          if (res.data.code === 200) {
+            console.log(res.data)
+			this.getHoursTime(id);
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
+	getHoursTime(id) {
+	  let md5Sign = md5(
+	    "method=" +
+	      "area" +
+	      "&timestamp=" +
+	      getApp().globalData.globalTimestamp +
+	      "&secret=" +
+	      getApp().globalData.secret
+	  );
+	  let url =
+	    getApp().globalData.shareUrl +
+	    "api/api.php" +
+	    "?method=area&source=area&action=get_hours&timestamp=" +
+	    getApp().globalData.globalTimestamp +
+	    "&sign=" +
+	    md5Sign;
+	  uni.request({
+	    url: url,
+	    method: "POST",
+	    header: {
+	      "content-type": "application/x-www-form-urlencoded",
+	    },
+	    data: {
+			area_id :id,
+			date :'2022-11-21',
+			//order_id :  2           //如果是自己修改自己的预定,传入预定ID,否则可不传
+		},
+	    success: (res) => {
+	      if (res.data.code === 200) {
+	        console.log(res.data)
+	      }
+	    },
+	    fail: () => {
+	      console.log("连接失败");
+	    },
+	  });
+	},
+  },
+};
+</script>
+
+<style lang="scss" scope>
+.active {
+  color: $uni-color-primary;
+}
+.content {
+  font-size: 32rpx;
+  margin: 0 5%;
+  .supplyList {
+    .supplyCard {
+      display: flex;
+      width: 92%;
+      margin: 3% 0;
+      padding: 2% 4%;
+      height: 5%;
+      border-radius: 30rpx;
+      box-shadow: rgba(100, 100, 111, 0.2) 0rpx 14rpx 50rpx 0rpx;
+      .image_content {
+        margin-right: 5%;
+		display: flex;
+		align-items: center;
+        image {
+			width: 300rpx;
+			height: 265rpx;
+			object-fit: cover;
+			border-radius: 6rpx;
+			background-color: #e4e4e4;
+        }
+      }
+      .info {
+		width: 100%;
+        display: flex;
+        flex-flow: column;
+		justify-content: space-between;
+        // justify-content: space-around;
+		.title {
+			width: 100%;
+			text-overflow: -o-ellipsis-lastline;
+			overflow: hidden;
+			text-overflow: ellipsis;
+			display: -webkit-box;
+			-webkit-line-clamp: 2;
+			line-clamp: 2;
+			-webkit-box-orient: vertical;
+			font-size: 32rpx;
+		}
+        .time {
+			font-weight: 100;
+			font-size: 24rpx;
+			color: #7f7f7f;
+			height: 60%;
+			display: flex;
+			flex-direction: column;
+			justify-content: space-around;
+			// margin-top: 20rpx;
+		  .field-btn-box {
+			  display: flex;
+			  justify-content: space-between;
+			  align-items: center;
+			  button{
+				background: #95f204;
+				color: #fff;
+				font-size: 18rpx;
+				margin: 0;
+			  };
+			  .free {
+				 background: #95f204; 
+			  };
+			  .full {
+				 background: #f59a23; 
+			  }
+			  .can {
+			  	background: #5498ff; 
+			  }
+		  }
+        }
+      }
+    }
+  }
+}
+</style>

+ 46 - 243
pages/makeField/viewDetail.vue

@@ -3,24 +3,26 @@
     <view class="header">
       <view class="title-read">
         <view class="title">
-			<view>{{ model.title }}</view>
+			<view>{{ areaObj.name }}</view>
 			<view>整体参观</view>	
         </view>
-        <button>今日已满</button>
+		 <button  :class="{
+			close: areaObj.order_status == '未开放',
+			free: areaObj.order_status == '空闲',
+			full: areaObj.order_status == '今日已满',
+			can: areaObj.order_status == '今日可约',}">
+			{{areaObj.order_status}}</button>
       </view>
-      <!-- <view class="header-image">
-        <image :src="model.url" alt="" />
-      </view> -->
     </view>
     <view class="active-deatil">
       <ul>
         <li>
           <p class="name">开放时间</p>
-          <p class="deatil-content">周一至周五:08:00~17:00</p>
+          <p class="deatil-content">{{areaObj.open_days}}:{{areaObj.open_hours}}</p>
         </li>
         <li style="margin-bottom: 0;">
           <p class="name">容纳人数</p>
-          <p class="deatil-content">50</p>
+          <p class="deatil-content">{{areaObj.max}}</p>
         </li>
       </ul>
     </view>
@@ -29,7 +31,7 @@
     </view>
     <view class="share-box">
       <view class="button">
-        <button @click="subscribeActivity()" class="start" >
+        <button @click="goSelectTime()" class="start" >
           <!-- {{ model.activiteState }} -->
 		  提交资料
         </button>
@@ -85,88 +87,23 @@ export default {
   data() {
     return {
       id: "",
-      isJoin: false,
 	  activityInfoList:[],
-	  sexValue:'男',
-      model: {
-        title: "",
-        read: 123,
-        url: "",
-        date: "",
-        type: 1,
-        status: 0,
-        way: "",
-        share: 0,
-        activiteState: "",
-        max_person: "",
-        person_count: "",
-      },
-      textModel: {
-        title: "活动内容",
-        text: "",
-      },
+	  areaObj:{},
+	  textModel: {
+	    title: "",
+	    text: "",
+	  },
     };
   },
   onLoad(op) {
     this.id = op.id
-    this.getActivityDeatil();
+    this.getAreaDeatil(op.id);
   },
   methods: {
-	checkboxChange(e){
-		this.sexValue = e.detail.value;
-	},
-    shareRequest() {
-      let md5Sign = md5(
-        "method=" +
-          "user" +
-          "&timestamp=" +
-          getApp().globalData.globalTimestamp +
-          "&secret=" +
-          getApp().globalData.secret
-      );
-      let url =
-        getApp().globalData.shareUrl +
-        "api/api.php" +
-        "?method=user&source=activity&action=repost&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,
-          source_id: this.id,
-          source: "activity",
-        },
-        success: (res) => {
-          if (res.data.code === 200) {
-            console.log(res);
-            this.model.share = this.model.share + 1;
-          }
-        },
-        fail: () => {
-          console.log("连接失败");
-        },
-      });
-    },
-    shareActive() {
-      let that = this;
-      uni.showShareMenu({
-        title: that.model.title,
-        path: "pages/activity/activity_detail?id=" + that.id,
-        success(res) {
-          that.shareRequest();
-        },
-      });
-    },
-    getActivityDeatil() {
+    getAreaDeatil(areaId) {
       let md5Sign = md5(
         "method=" +
-          "activity" +
+          "area" +
           "&timestamp=" +
           getApp().globalData.globalTimestamp +
           "&secret=" +
@@ -175,15 +112,14 @@ export default {
       let url =
         getApp().globalData.shareUrl +
         "api/api.php" +
-        "?method=activity&source=activity&action=info_by_id&timestamp=" +
+        "?method=area&source=area&action=info_by_id&timestamp=" +
         getApp().globalData.globalTimestamp +
         "&sign=" +
         md5Sign;
       let postData = {
-        id: this.id,
+        area_id: areaId,
         openId: getApp().globalData.open_id,
       };
-      //获取文章
       uni.request({
         url: url,
         method: "POST",
@@ -193,46 +129,7 @@ export default {
         data: postData,
         success: (res) => {
           if (res.data.code == 200) {
-            let data = res.data.data;
-            this.isJoin = data.active ? true : false;
-			if(data.category_list && data.category_list.length > 0){
-				this.activityInfoList = data.category_list;
-				this.activityInfoList.forEach((item)=>{
-						if(item.name === '性别'){
-							item.value = '男'
-						}else {
-							item.value = '';
-						}
-				})
-			}
-            this.model.title = data.name;
-            this.model.read = parseInt(data.base_read_count) + parseInt(data.real_read_count);
-            this.model.url = getApp().globalData.shareUrl + data.pic_url;
-            let arr = ["start_time", "end_time"];
-            let ans = [];
-            for (const item of arr) {
-              let time = this.$options.filters["formDateTime"](data[item]);
-              let timeSecond = this.$options.filters["formDateTimeSecond"](data[item]);
-              ans.push(time + " " + timeSecond);
-            }
-            this.model.date = ans.join(" - ");
-            this.model.type = data.type;
-            this.model.status = data.status;
-            this.model.way = data.sponsor;
-            this.model.max_person = data.max_person;
-            this.model.person_count = data.person_count;
-            this.model.share = parseInt(data.real_repost_count) + parseInt(data.base_repost_count);
-            if (data.status == '待开始') {
-              if (data.type == 2) {
-                this.model.activiteState = "我要参加";
-              } else {
-                this.model.activiteState = "活动待开始";
-              }
-            } else if (data.status == '已开始') {
-              this.model.activiteState = "活动进行中";
-            } else {
-              this.model.activiteState = "活动已结束";
-            }
+            this.areaObj = res.data.data;
           }
           this.getRich();
         },
@@ -267,7 +164,7 @@ export default {
       uni.request({
         url:
           getApp().globalData.shareUrl +
-          `content/activity/${Math.floor(this.id / 1000)}/${this.id}.html`+'?version='+ Math.random(),
+          `content/area/${Math.floor(this.id / 1000)}/${this.id}.html`+'?version='+ Math.random(),
         method: "GET",
         header: {
           "content-type": "application/x-www-form-urlencoded",
@@ -282,127 +179,21 @@ export default {
         },
       });
     },
-    subscribeActivity() {
-		if(!getApp().globalData.user_phone){
-			uni.showToast({
-			  title: "您还没有登录授权",
-			  duration: 2500,
-			  icon: "none",
-			});
-		uni.navigateTo({
-			url:'/pages/auth/index'
-		})
-		}
+    goSelectTime() {
+		// if(!getApp().globalData.user_phone){
+		// 	uni.showToast({
+		// 	  title: "您还没有登录授权",
+		// 	  duration: 2500,
+		// 	  icon: "none",
+		// 	});
+		// uni.navigateTo({
+		// 	url:'/pages/auth/index'
+		// })
+		// }
 		uni.navigateTo({
-			url:'/pages/makeField/fieldForm'
+			url:'/pages/makeField/selectTime?id=' + this.id
 		})
-   //    if (Number(this.model.person_count) >= Number(this.model.max_person)) {
-   //      uni.showToast({
-   //        title: "报名人数已达上限",
-   //        icon: "error",
-   //        duration: 2000,
-   //      });
-   //      return;
-   //    }
-	  // if(this.activityInfoList.length > 0 && getApp().globalData.user_phone){
-		 //  	this.open();
-	  // }
-	  // if(this.activityInfoList.length === 0 && getApp().globalData.user_phone){
-		 //    this.subscribeFn(this.activityInfoList)
-	  // }
     },
-    signUpActivity(infoList) {
-      let md5Sign = md5(
-        "method=" +
-          "activity" +
-          "&timestamp=" +
-          getApp().globalData.globalTimestamp +
-          "&secret=" +
-          getApp().globalData.secret
-      );
-      let url =
-        getApp().globalData.shareUrl +
-        "api/api.php" +
-        "?method=activity&source=activity&action=active&timestamp=" +
-        getApp().globalData.globalTimestamp +
-        "&sign=" +
-        md5Sign;
-      let postData = {
-        openId: getApp().globalData.open_id,
-        id: this.id,
-		category_json:JSON.stringify(infoList)
-      };
-      uni.request({
-        url: url,
-        method: "POST",
-        header: {
-          "content-type": "application/x-www-form-urlencoded",
-        },
-        data: postData,
-        success: (res) => {
-          if (res.data.code == 200) {
-            this.isJoin = true;
-            uni.showToast({
-              title: "报名成功",
-              icon: "none",
-              duration: 2500,
-            });
-          }
-        },
-        fail: () => {
-          console.log("连接失败");
-        },
-      });
-    },
-	subscribeFn(info){
-		let that = this;
-		uni.requestSubscribeMessage({
-		  tmplIds: [
-		  "bSg5tUWHE4qWDeyK31GBejogT1uRgkuBD1_n2I5ptAc",
-		  "T_ORLiW2C_UM6nZiEerYAokltHgHRGxWCid8eElujus",
-		//  "XPULJQ64YrS-5sAnfMTJj3S9iV8-8X_mb3r_H5dgAgE",
-		 //  "RWq7TE266RYr8DX2IHZ2F_zKbOnSfZDgh_xovBh0UiI" 		//测试环境模板id
-		  ],
-		  success(res) {
-		    that.signUpActivity(info);
-		  },
-		});
-	},
-	open() {
-		  this.$refs.popup.open('top')
-	  },
-	closePopup() {
-		  this.$refs.popup.close()
-	  },
-	submitInfo(){
-		let checkFlag = false;
-		for(let i = 0; i < this.activityInfoList.length; i++){
-			if(!this.activityInfoList[i].value){
-				uni.showToast({
-					title:'请填写' + this.activityInfoList[i].name,
-					duration:2000,
-					icon:'none'
-				})
-				checkFlag = false;
-				break;
-			}else {
-				checkFlag = true;
-			}
-		} 
-		if(checkFlag){
-			this.activityInfoList.forEach((item)=>{
-				if(item.name === '性别'){
-					item.value = this.sexValue;
-				}
-				delete item.addtime;
-				delete item.name;
-				delete item.parent_id;
-				delete item.weight;
-			})
-			this.$refs.popup.close();
-			this.subscribeFn(this.activityInfoList)
-		}
-	}  
   },
 };
 </script>
@@ -436,6 +227,18 @@ export default {
 		margin-top: 5%;
 		width: 18%;
       }
+	  .close {
+	  	 background: #7f7f7f; 
+	  };
+	  .free {
+	  	background: #95f204; 
+	  };
+	  .full {
+	  	background: #f59a23; 
+	  }
+	  .can {
+	  	background: #5498ff; 
+	  }
     }
     .header-image {
       height: 100%;