|
|
@@ -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" +
|
|
|
- "×tamp=" +
|
|
|
- getApp().globalData.globalTimestamp +
|
|
|
- "&secret=" +
|
|
|
- getApp().globalData.secret
|
|
|
- );
|
|
|
- let url =
|
|
|
- getApp().globalData.shareUrl +
|
|
|
- "api/api.php" +
|
|
|
- "?method=user&source=activity&action=repost×tamp=" +
|
|
|
- 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" +
|
|
|
"×tamp=" +
|
|
|
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×tamp=" +
|
|
|
+ "?method=area&source=area&action=info_by_id×tamp=" +
|
|
|
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" +
|
|
|
- "×tamp=" +
|
|
|
- getApp().globalData.globalTimestamp +
|
|
|
- "&secret=" +
|
|
|
- getApp().globalData.secret
|
|
|
- );
|
|
|
- let url =
|
|
|
- getApp().globalData.shareUrl +
|
|
|
- "api/api.php" +
|
|
|
- "?method=activity&source=activity&action=active×tamp=" +
|
|
|
- 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%;
|