|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view class="activity-page">
|
|
|
<van-sticky style="background: #fff">
|
|
|
- <view class="search-wrap">
|
|
|
+ <!-- <view class="search-wrap">
|
|
|
<van-search
|
|
|
shape="round"
|
|
|
:value="searchVal"
|
|
@@ -10,7 +10,7 @@
|
|
|
@search="onSearch"
|
|
|
@clear="onClearSearch"
|
|
|
/>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<view class="flex tabs-wrap" @click="tabChange">
|
|
|
<view
|
|
|
:class="['tab-item', tabActive === '1' && 'tab-active']"
|
|
@@ -49,20 +49,22 @@
|
|
|
<view class="list" v-if="list.length > 0">
|
|
|
<view
|
|
|
class="global-list-card item"
|
|
|
- v-for="item in list"
|
|
|
+ v-for="(item,index) in list"
|
|
|
:key="item.activityId"
|
|
|
@click="handleGoDetail(item.activityId)"
|
|
|
>
|
|
|
- <view class="status-box status-before">未开始</view>
|
|
|
+ <view class="status-box status-before" v-if="item.activityState===1">未开始</view>
|
|
|
+ <view class="status-box status-progress" v-if="item.activityState===2">进行中</view>
|
|
|
+ <view class="status-box status-end" v-if="item.activityState===3">已结束</view>
|
|
|
<view class="flex top">
|
|
|
- <image class="avatar" :src="item.img" mode="aspectFill"></image>
|
|
|
+ <image class="avatar" :src="item.speakerHeadPic" mode="aspectFill"></image>
|
|
|
<view class="content">
|
|
|
<view class="flex icon-box">
|
|
|
- <template v-if="item.city">
|
|
|
+ <template v-if="item.activityTypeId===3&&item.city">
|
|
|
<image src='../../static/position.png'></image>
|
|
|
<text>{{item.city}}</text>
|
|
|
</template>
|
|
|
- <template v-if="item.hasPlayBack">
|
|
|
+ <template v-if="item.activityTypeId===1&&item.hasPlayBack">
|
|
|
<image src='../../static/hf.png'></image>
|
|
|
<text>回放</text>
|
|
|
</template>
|
|
@@ -72,18 +74,47 @@
|
|
|
<view class="time">时间:{{ item.startTime | formatActivityTime(item.endTime) }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="flex bot">
|
|
|
- <view>会议提醒</view>
|
|
|
- <view>报名线下参会</view>
|
|
|
+ <view class="flex bot" v-if="item.activityState===1">
|
|
|
+ <view
|
|
|
+ :class="!item.hasRemind&&'active'"
|
|
|
+ @click.stop="handleRemind(item,index)"
|
|
|
+ >
|
|
|
+ {{item.hasRemind?'取消提醒':'会议提醒'}}
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ :class="!item.registerState&&'active'"
|
|
|
+ v-if="item.activityTypeId===3"
|
|
|
+ @click.stop="handleRegister(item,index)"
|
|
|
+ >
|
|
|
+ {{item.registerState?'取消线下报名':'报名线下参会'}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<van-empty description="暂无数据" v-else />
|
|
|
+
|
|
|
+ <!-- 弹窗 -->
|
|
|
+ <van-popup :show="show" @close="show=false">
|
|
|
+ <view class="global-pup">
|
|
|
+ <view class="content">
|
|
|
+ <rich-text :nodes="pupContent"></rich-text>
|
|
|
+ </view>
|
|
|
+ <view class="flex bot">
|
|
|
+ <view @click="show=false">知道了</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </van-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { apiActivityList } from '@/api/activity'
|
|
|
+import {
|
|
|
+ apiActivityList,
|
|
|
+ apiActivityAddRemind,
|
|
|
+ apiActivityCancelRemind,
|
|
|
+ apiActivityRegister,
|
|
|
+ apiActivityCancelRegister
|
|
|
+} from '@/api/activity'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -95,6 +126,9 @@ export default {
|
|
|
pageSize: 20,
|
|
|
list: [],
|
|
|
finished: false,
|
|
|
+
|
|
|
+ show:false,
|
|
|
+ pupContent:'',//弹窗html字符串
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -180,7 +214,88 @@ export default {
|
|
|
this.finished=true
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+
|
|
|
+ handleRemind(e,index){
|
|
|
+ if(e.hasRemind===0){
|
|
|
+ this.handleAddRemind(e,index)
|
|
|
+ }else{
|
|
|
+ this.handleCancelRemind(e,index)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 添加提醒
|
|
|
+ async handleAddRemind(e,index){
|
|
|
+ const res=await apiActivityAddRemind({activity_id:Number(e.activityId)})
|
|
|
+ if(res.code===200){
|
|
|
+ this.pupContent=`<p style="margin-bottom:10px">设置成功,会前15分钟会为您推送微信消息提醒</p>
|
|
|
+ <p>请关注【弘则研究】公众号,以获取微信消息提醒</p>`
|
|
|
+ this.show=true
|
|
|
+ this.handleUpateRemindStatus(index)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //取消提醒
|
|
|
+ async handleCancelRemind(e,index){
|
|
|
+ const res=await apiActivityCancelRemind({activity_id:Number(e.activityId)})
|
|
|
+ if(res.code===200){
|
|
|
+ uni.showToast({
|
|
|
+ title:"取消提醒成功",
|
|
|
+ icon:"none"
|
|
|
+ })
|
|
|
+ this.handleUpateRemindStatus(index)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //更新列表中某项的设置提醒状态
|
|
|
+ handleUpateRemindStatus(index){
|
|
|
+ if(this.list[index].hasRemind===0){
|
|
|
+ this.list[index].hasRemind=1
|
|
|
+ }else{
|
|
|
+ this.list[index].hasRemind=0
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ handleRegister(e,index){
|
|
|
+ if(e.registerState===0){
|
|
|
+ this.handleAddRegister(e,index)
|
|
|
+ }else{
|
|
|
+ this.handleCancelRegister(e,index)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 线下报名
|
|
|
+ async handleAddRegister(e,index){
|
|
|
+ const res=await apiActivityRegister({activity_id:Number(e.activityId)})
|
|
|
+ if(res.code===200){
|
|
|
+ this.pupContent=`<p style="margin-bottom:10px">报名成功,已加入您的活动日程</p>
|
|
|
+ <p>想要及时获取活动时间变更通知,请关注【弘则研究】公众号</p>`
|
|
|
+ this.show=true
|
|
|
+ this.handleUpdateRegister(index)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //取消线下报名
|
|
|
+ async handleCancelRegister(e,index){
|
|
|
+ const res=await apiActivityCancelRegister({activity_id:Number(e.activityId)})
|
|
|
+ if(res.code===200){
|
|
|
+ uni.showToast({
|
|
|
+ title:"取消报名成功",
|
|
|
+ icon:"none"
|
|
|
+ })
|
|
|
+ this.handleUpdateRegister(index)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更新报名状态
|
|
|
+ handleUpdateRegister(index){
|
|
|
+ if(this.list[index].registerState===0){
|
|
|
+ this.list[index].registerState=1
|
|
|
+ }else{
|
|
|
+ this.list[index].registerState=0
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -269,7 +384,7 @@ export default {
|
|
|
font-size: $global-font-size-lg;
|
|
|
font-weight: bold;
|
|
|
width: 420rpx;
|
|
|
- padding-right: 130rpx;
|
|
|
+ padding-right: 80rpx;
|
|
|
padding-bottom: 10rpx;
|
|
|
border-bottom: 1px solid $global-border-color;
|
|
|
}
|
|
@@ -284,6 +399,7 @@ export default {
|
|
|
}
|
|
|
.bot {
|
|
|
border-top: 1px solid $global-border-color;
|
|
|
+ color: $global-text-color-999;
|
|
|
view {
|
|
|
line-height: 72rpx;
|
|
|
flex: 1;
|
|
@@ -293,6 +409,9 @@ export default {
|
|
|
view:last-child {
|
|
|
border: none;
|
|
|
}
|
|
|
+ .active{
|
|
|
+ color: #E3B377;
|
|
|
+ }
|
|
|
}
|
|
|
.content{
|
|
|
width: 420rpx;
|