|
|
@@ -8,7 +8,7 @@
|
|
|
<view class="read">阅读量 {{ model.read }}</view>
|
|
|
</view>
|
|
|
<view class="header-image">
|
|
|
- <image src="/static/activity/u1104.png" alt="" />
|
|
|
+ <image :src="model.url" alt="" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="active-deatil">
|
|
|
@@ -40,9 +40,10 @@
|
|
|
@click="signUpActivity"
|
|
|
:disabled="!(model.status == 0 && model.type == 2)"
|
|
|
:class="{
|
|
|
- start: model.status == 0,
|
|
|
+ start: model.status == 0 && model.type == 2,
|
|
|
begun: model.status == 1,
|
|
|
ended: model.status == 2,
|
|
|
+ falseStart: model.status == 0 && model.type == 1,
|
|
|
}"
|
|
|
>
|
|
|
{{ model.activiteState }}
|
|
|
@@ -58,6 +59,40 @@
|
|
|
import md5 from "@/common/md5.js";
|
|
|
import activity_rich_card from "../policy/policy_rich_card";
|
|
|
export default {
|
|
|
+ filters: {
|
|
|
+ formDateTime(value) {
|
|
|
+ if (value) {
|
|
|
+ const time = new Date(value * 1000);
|
|
|
+ const y = time.getFullYear();
|
|
|
+ const m =
|
|
|
+ time.getMonth() + 1 < 10
|
|
|
+ ? "0" + (time.getMonth() + 1)
|
|
|
+ : time.getMonth() + 1;
|
|
|
+ const d = time.getDate() < 10 ? "0" + time.getDate() : time.getDate();
|
|
|
+ // const h = time.getHours()
|
|
|
+ // const mm = time.getMinutes();
|
|
|
+ // const s = time.getSeconds();
|
|
|
+ return y + "." + m + "." + d;
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ formDateTimeSecond(value) {
|
|
|
+ if (value) {
|
|
|
+ const time = new Date(value * 1000);
|
|
|
+ // const y = time.getFullYear();
|
|
|
+ // const m = (time.getMonth() + 1) < 10 ? '0' + (time.getMonth() + 1) : (time.getMonth() + 1);
|
|
|
+ // const d = time.getDate() < 10 ? '0' + time.getDate(): time.getDate();
|
|
|
+ const h =
|
|
|
+ time.getHours() < 10 ? "0" + time.getHours() : time.getHours();
|
|
|
+ const mm =
|
|
|
+ time.getMinutes() < 10 ? "0" + time.getMinutes() : time.getMinutes();
|
|
|
+ return h + ":" + mm;
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
components: {
|
|
|
activityRichCard: activity_rich_card,
|
|
|
},
|
|
|
@@ -65,15 +100,15 @@ export default {
|
|
|
return {
|
|
|
id: "",
|
|
|
model: {
|
|
|
- title: "400场讲座,200多门课程,免费送上门!就等你来申请啦~",
|
|
|
+ title: "",
|
|
|
read: 123,
|
|
|
url: "",
|
|
|
- date: "2021.08.20 14:00 - 2021.08.30 17:00",
|
|
|
+ date: "",
|
|
|
type: 1,
|
|
|
status: 0,
|
|
|
- way: "区人力资源局",
|
|
|
+ way: "",
|
|
|
share: 0,
|
|
|
- activiteState: "活动进行中",
|
|
|
+ activiteState: "",
|
|
|
},
|
|
|
textModel: {
|
|
|
title: "活动内容",
|
|
|
@@ -84,7 +119,8 @@ export default {
|
|
|
},
|
|
|
onLoad(op) {
|
|
|
this.id = op.id;
|
|
|
- // this.getActivityDeatil();
|
|
|
+
|
|
|
+ this.getActivityDeatil();
|
|
|
},
|
|
|
methods: {
|
|
|
getActivityDeatil() {
|
|
|
@@ -115,10 +151,42 @@ export default {
|
|
|
},
|
|
|
data: postData,
|
|
|
success: (res) => {
|
|
|
- console.log(res);
|
|
|
- if (res.data.code === 200) {
|
|
|
- this.getRich();
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ console.log(res);
|
|
|
+ let data = res.data.data;
|
|
|
+ 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.share =
|
|
|
+ parseInt(data.real_repost_count) +
|
|
|
+ parseInt(data.base_repost_count);
|
|
|
+ if (data.status == 0) {
|
|
|
+ if (data.type == 2) {
|
|
|
+ this.model.activiteState = "我要参加";
|
|
|
+ } else {
|
|
|
+ this.model.activiteState = "活动待开始";
|
|
|
+ }
|
|
|
+ } else if (data.status == 1) {
|
|
|
+ this.model.activiteState = "活动进行中";
|
|
|
+ } else {
|
|
|
+ this.model.activiteState = "活动已结束";
|
|
|
+ }
|
|
|
}
|
|
|
+ this.getRich();
|
|
|
},
|
|
|
fail: () => {
|
|
|
console.log("连接失败");
|
|
|
@@ -129,7 +197,7 @@ export default {
|
|
|
uni.request({
|
|
|
url:
|
|
|
getApp().globalData.shareUrl +
|
|
|
- `content/business/${Math.floor(this.id / 1000)}/${this.id}.html`,
|
|
|
+ `content/activity/${Math.floor(this.id / 1000)}/${this.id}.html`,
|
|
|
method: "GET",
|
|
|
header: {
|
|
|
"content-type": "application/x-www-form-urlencoded",
|
|
|
@@ -174,7 +242,9 @@ export default {
|
|
|
},
|
|
|
data: postData,
|
|
|
success: (res) => {
|
|
|
- console.log(res);
|
|
|
+ if(res.data.code==200){
|
|
|
+ console.log("报名成功");
|
|
|
+ }
|
|
|
},
|
|
|
fail: () => {
|
|
|
console.log("连接失败");
|
|
|
@@ -216,6 +286,7 @@ export default {
|
|
|
image {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ border-radius: 10%;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -308,6 +379,10 @@ export default {
|
|
|
color: #aaaaaa;
|
|
|
border-color: #aaaaaa;
|
|
|
}
|
|
|
+ .falseStart {
|
|
|
+ color: #70b603;
|
|
|
+ border-color: #70b603;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|