|
|
@@ -56,12 +56,44 @@
|
|
|
<!-- "status":"活动状态 0:待开始;1:已开始; 2:已结束
|
|
|
"type":"活动类型 1:线上;2 线下"} -->
|
|
|
</view>
|
|
|
+ <uni-popup ref="popup" :mask-click="false">
|
|
|
+ <view class="popup-box">
|
|
|
+ <view>
|
|
|
+ <view class="popup-title">活动报名信息填写</view>
|
|
|
+ <view class="popup-content-box">
|
|
|
+ <view class="popup-content">
|
|
|
+ <view class="popup-type" v-for="(info,index) in activityInfoList" :key="info.id">
|
|
|
+ <view>{{info.name}}</view>
|
|
|
+ <input type="text" v-model="info.value"/>
|
|
|
+ </view>
|
|
|
+<!-- <view class="popup-type">
|
|
|
+ <view>性别</view><input type="text" value="" />
|
|
|
+ </view>
|
|
|
+ <view class="popup-type">
|
|
|
+ <view>年龄</view><input type="number" value="" />
|
|
|
+ </view>
|
|
|
+ <view class="popup-type">
|
|
|
+ <view>工作单位</view><input type="text" value="" />
|
|
|
+ </view>
|
|
|
+ <view class="popup-type">
|
|
|
+ <view>职务</view><input type="text" value="" />
|
|
|
+ </view> -->
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="popup-footer">
|
|
|
+ <button class="popup-cancel" @click="closePopup">取消</button>
|
|
|
+ <button class="popup-submit" @click="submitInfo">提交</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import md5 from "@/common/md5.js";
|
|
|
import activity_rich_card from "../policy/policy_rich_card";
|
|
|
+import uniPopup from "@/components/uni-popup/uni-popup.vue"
|
|
|
export default {
|
|
|
filters: {
|
|
|
formDateTime(value) {
|
|
|
@@ -99,11 +131,13 @@ export default {
|
|
|
},
|
|
|
components: {
|
|
|
activityRichCard: activity_rich_card,
|
|
|
+ uniPopup
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
id: "",
|
|
|
isJoin: false,
|
|
|
+ activityInfoList:[],
|
|
|
model: {
|
|
|
title: "",
|
|
|
read: 123,
|
|
|
@@ -208,17 +242,18 @@ export default {
|
|
|
if (res.data.code == 200) {
|
|
|
let data = res.data.data;
|
|
|
this.isJoin = data.active ? true : false;
|
|
|
+ this.activityInfoList = data.category_list;
|
|
|
+ this.activityInfoList.forEach((item)=>{
|
|
|
+ item.value = '';
|
|
|
+ })
|
|
|
this.model.title = data.name;
|
|
|
- this.model.read =
|
|
|
- parseInt(data.base_read_count) + parseInt(data.real_read_count);
|
|
|
+ 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]
|
|
|
- );
|
|
|
+ let timeSecond = this.$options.filters["formDateTimeSecond"](data[item]);
|
|
|
ans.push(time + " " + timeSecond);
|
|
|
}
|
|
|
this.model.date = ans.join(" - ");
|
|
|
@@ -227,9 +262,7 @@ export default {
|
|
|
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);
|
|
|
+ this.model.share = parseInt(data.real_repost_count) + parseInt(data.base_repost_count);
|
|
|
if (data.status == '待开始') {
|
|
|
if (data.type == 2) {
|
|
|
this.model.activiteState = "我要参加";
|
|
|
@@ -290,7 +323,7 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
- subscribeActivity() {
|
|
|
+ subscribeActivity(info) {
|
|
|
if (this.model.person_count >= this.model.max_person) {
|
|
|
uni.showToast({
|
|
|
title: "报名人数已达上限",
|
|
|
@@ -299,18 +332,11 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- let that = this;
|
|
|
- uni.requestSubscribeMessage({
|
|
|
- tmplIds: [
|
|
|
- "bSg5tUWHE4qWDeyK31GBejogT1uRgkuBD1_n2I5ptAc",
|
|
|
- "T_ORLiW2C_UM6nZiEerYAokltHgHRGxWCid8eElujus",
|
|
|
- ],
|
|
|
- success(res) {
|
|
|
- that.signUpActivity();
|
|
|
- },
|
|
|
- });
|
|
|
+ if(this.activityInfoList.length > 0){
|
|
|
+ this.open();
|
|
|
+ }
|
|
|
},
|
|
|
- signUpActivity() {
|
|
|
+ signUpActivity(infoList) {
|
|
|
let md5Sign = md5(
|
|
|
"method=" +
|
|
|
"activity" +
|
|
|
@@ -329,6 +355,7 @@ export default {
|
|
|
let postData = {
|
|
|
openId: getApp().globalData.open_id,
|
|
|
id: this.id,
|
|
|
+ category_json:JSON.stringify(infoList)
|
|
|
};
|
|
|
uni.request({
|
|
|
url: url,
|
|
|
@@ -352,6 +379,36 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ 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(){
|
|
|
+ this.activityInfoList.forEach((item)=>{
|
|
|
+ delete item.addtime;
|
|
|
+ delete item.name;
|
|
|
+ delete item.parent_id;
|
|
|
+ delete item.weight;
|
|
|
+ })
|
|
|
+ this.$refs.popup.close();
|
|
|
+ this.subscribeFn(this.activityInfoList)
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -490,5 +547,51 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .popup-box {
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+ .popup-title {
|
|
|
+ text-align: center;
|
|
|
+ font-weight: bold;
|
|
|
+ height: 30px;
|
|
|
+ border-bottom: 1px solid #d8d8d8;
|
|
|
+ }
|
|
|
+ .popup-content {
|
|
|
+ font-size: 28rpx;
|
|
|
+ padding: 10rpx 0 10rpx 0;
|
|
|
+ }
|
|
|
+ .popup-type {
|
|
|
+ display: flex;
|
|
|
+ height: 80rpx;
|
|
|
+ align-items: center;
|
|
|
+ view {
|
|
|
+ width: 25%;
|
|
|
+ }
|
|
|
+ input {
|
|
|
+ border: 1px solid #d7d7d7;
|
|
|
+ width: 70%;
|
|
|
+ border-radius: 5rpx;
|
|
|
+ padding-left: 10rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .popup-footer {
|
|
|
+ display: flex;
|
|
|
+ button{
|
|
|
+ font-size: 26rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ width: 150rpx;
|
|
|
+ line-height: 60rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .popup-cancel {
|
|
|
+ background-color: #AAAAAA;
|
|
|
+ }
|
|
|
+ .popup-submit {
|
|
|
+ background-color: #249CD3;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|