detail.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878
  1. <template>
  2. <view class="activity-detail" v-if="info">
  3. <view
  4. class="top-wrap"
  5. :style="'background-image:url(' + info.speakerBackgroundPic + ')'"
  6. >
  7. <view class="status status-before" v-if="info.activityState === 1"
  8. >未开始</view
  9. >
  10. <view class="status status-before" v-if="info.activityState === 2"
  11. >进行中</view
  12. >
  13. <view class="status status-before" v-if="info.activityState === 3"
  14. >已结束</view
  15. >
  16. <view class="title">{{ info.activityTypeName }}</view>
  17. <view class="name">主讲人:{{ info.speaker }}</view>
  18. <view class="time"
  19. >活动时间:{{
  20. info.startTime | formatActivityTime(info.endTime)
  21. }}</view
  22. >
  23. <view class="flex city" v-if="info.city">
  24. <image src="./static/position.png" model="aspectFill"></image>
  25. <text>{{ info.city }}</text>
  26. </view>
  27. </view>
  28. <view class="intro-wrap">{{ info.activityName }}</view>
  29. <!-- <view class="intro-wrap">{{ info.is_new_report==1?info.reportName:info.reportName?info.reportName.split('】')[1]:info.activityName }}</view> -->
  30. <!-- 音频 -->
  31. <view class="audio-wrap" v-if="info.activityState === 3">
  32. <view
  33. class="audio-item"
  34. v-for="(item,index) in audioList"
  35. :key="item.voiceUrl"
  36. @click="handleClickAudioItem(item)"
  37. >
  38. <image
  39. class="icon"
  40. src="../static/audio-doing-2.png"
  41. mode="aspectFill"
  42. v-if="item.voiceUrl==activeAudioUrl&&audioPlayStatus"
  43. />
  44. <image
  45. class="icon"
  46. src="../static/audio-pause-3.png"
  47. mode="aspectFill"
  48. v-else
  49. />
  50. <view class="name" :style="{color:item.voiceUrl==activeAudioUrl?'#D5AD79':''}">{{ item.voiceName }}</view>
  51. <view class="time">{{ item.voicePlaySeconds|formatVoiceTime }}</view>
  52. </view>
  53. <view class="box" v-if="activeAudioUrl">
  54. <view class="flex top-slider">
  55. <text>{{audioCurrentTime|formatVoiceTime}}</text>
  56. <slider
  57. class="audio-slider"
  58. activeColor="#e3b377"
  59. :max="activeAudioTime"
  60. :value="audioCurrentTime"
  61. @change="handleAudioSliderChange($event)"
  62. block-size="20"
  63. />
  64. <text>{{activeAudioTime|formatVoiceTime}}</text>
  65. </view>
  66. <view class="flex btns">
  67. <image
  68. class="before"
  69. :src="isFirstAudio?'../static/audio-before-grey.png':'../static/audio-before.png'"
  70. mode="aspectFit"
  71. @click="handleAudioBtn('before')"
  72. />
  73. <image
  74. class="center"
  75. :src="audioPlayStatus?'../static/audio-doing.png':'../static/audio-pause-3.png'"
  76. mode="aspectFit"
  77. @click="handleAudioBtn('center')"
  78. />
  79. <image
  80. class="next"
  81. :src="isLastAudio?'../static/audio-before-grey.png':'../static/audio-before.png'"
  82. mode="aspectFit"
  83. @click="handleAudioBtn('next')"
  84. />
  85. </view>
  86. </view>
  87. </view>
  88. <view class="info-wrap">
  89. <view
  90. class="flex item"
  91. v-for="item in infoList"
  92. :key="item.label"
  93. @click="handleClickInfoItem(item)"
  94. >
  95. <view class="label">{{ item.label }}:</view>
  96. <view :class="['content', item.color && 'yellow-color',item.type=='copy'&&'link']">
  97. {{item.text}}
  98. </view>
  99. <view class="copy-btn" v-if="item.type == 'copy'" @click="handleCopyLink(item.text)">复制链接</view>
  100. </view>
  101. </view>
  102. <!-- 报告链接 -->
  103. <!-- <view class="info-wrap" v-if="info.reportLink">
  104. <view class="flex item" @click="handleOpenReport">
  105. <view class="label">相关报告:</view>
  106. <view class="yellow-color">查看报告链接</view>
  107. </view>
  108. </view> -->
  109. <view class="btn-wrap">
  110. <view
  111. class="global-btn-yellow-change btn"
  112. @click="handleOpenReport"
  113. v-if="info.reportLink"
  114. >查看相关报告</view>
  115. <block v-if="info.activityState === 1">
  116. <view
  117. :class="[info.registerState == 1?'global-btn-disable':'global-btn-yellow-change' ,'btn']"
  118. v-if="info.firstActivityTypeId === 3"
  119. @click="handleSetRegister"
  120. >{{
  121. info.registerState == 0
  122. ? "报名线下参会"
  123. : "取消报名线下参会"
  124. }}({{ info.registeredNum>info.limitPeopleNum?info.limitPeopleNum:info.registeredNum }}/{{ info.limitPeopleNum }})</view
  125. >
  126. <view
  127. :class="[
  128. info.hasRemind == 1
  129. ? 'global-btn-disable'
  130. : 'global-btn-yellow-change',
  131. 'btn',
  132. ]"
  133. @click="handleSetRemind"
  134. >{{ info.hasRemind == 1 ? "取消会议提醒" : "会议提醒" }}</view
  135. >
  136. <p class="tips">(会前15分钟推送微信消息提醒)</p>
  137. </block>
  138. </view>
  139. <!-- 弹窗 -->
  140. <van-popup :show="pupData.show" @close="pupData.show = false" :close-on-click-overlay="false">
  141. <view class="global-pup">
  142. <view class="content">
  143. <rich-text :nodes="pupData.content"></rich-text>
  144. </view>
  145. <view class="flex bot" v-if="pupData.type == 'contact'">
  146. <view @click="pupData.show = false" style="color: #a9afb8">取消</view>
  147. <view @click="handleCallPhone(pupData.mobile)">拨号</view>
  148. </view>
  149. <view class="flex bot" v-else-if="pupData.type == 'apply'">
  150. <view @click="pupData.show = false" style="color: #a9afb8">取消</view>
  151. <view @click="handleApply">立即申请</view>
  152. </view>
  153. <view class="flex bot" v-else>
  154. <view @click="pupData.show = false">知道了</view>
  155. </view>
  156. </view>
  157. </van-popup>
  158. <!-- 分享海报 -->
  159. <sharePoster
  160. :style="{bottom:'250rpx'}"
  161. :shareData="{
  162. type:'activity_detail',
  163. code_page:'pages-activity/detail',
  164. code_scene:code_scene,
  165. data:shareParams
  166. }"
  167. ></sharePoster>
  168. </view>
  169. </template>
  170. <script>
  171. // 活动详情
  172. import {
  173. apiActivityDetail,
  174. apiActivityAudios,
  175. apiActivityAddRemind,
  176. apiActivityCancelRemind,
  177. apiActivityRegister,
  178. apiActivityCancelRegister,
  179. apiActivityAudioPlayRecordAdd,
  180. apiActivityAudioPlayRecordUpate
  181. } from "@/api/activity";
  182. import {apiGetSceneToParams} from '@/api/common'
  183. import {baseApiUrl} from '@/utils/config.js'
  184. import sharePoster from '../components/sharePoster/sharePoster.vue'
  185. const dayjs=require('@/utils/dayjs.min')
  186. dayjs.locale('zh-cn')
  187. export default {
  188. name: "ActivityDetail",
  189. components: {
  190. sharePoster
  191. },
  192. computed: {
  193. isFirstAudio(){
  194. if(this.audioList.length>0){
  195. return this.activeAudioUrl==this.audioList[0].voiceUrl
  196. }
  197. },
  198. isLastAudio(){
  199. if(this.audioList.length>0){
  200. return this.activeAudioUrl==this.audioList[this.audioList.length-1].voiceUrl
  201. }
  202. },
  203. shareParams(){ //生成海报数据
  204. if(this.info){
  205. let obj={
  206. activity_title:this.info.activityTypeName+'电话会',
  207. activity_speaker:this.info.speaker,
  208. activity_time:this.formatActivityTime(this.info.startTime,this.info.endTime),
  209. activity_avatar:this.info.speakerHeadPic
  210. }
  211. return obj
  212. }
  213. },
  214. code_scene(){//生成海报的小程序页面参数
  215. return JSON.stringify({id:this.id})
  216. }
  217. },
  218. data() {
  219. return {
  220. id: 0, //活动id
  221. infoList: [],
  222. info: null,
  223. audioList: [], //音频数据
  224. activeAudioUrl:'',//正在播放的背景音频地址
  225. activeAudioTime:0,//选择的音频数据时长
  226. audioCurrentTime:0,//音频正常播放的时间
  227. audioPlayStatus:false,//音频是否正在播放
  228. recordId:0,//新增音频播放记录成功的id
  229. pupData: {
  230. show: false,
  231. content: "", //弹窗html字符串
  232. type: "",
  233. mobile: "",
  234. },
  235. };
  236. },
  237. onLoad(options) {
  238. if(options.scene){
  239. this.init(options.scene)
  240. }else{
  241. this.id = options.id;
  242. this.getDetail();
  243. this.getAudios()
  244. }
  245. },
  246. onUnload(){
  247. // 存一次
  248. const tag=this.audioList.some(item=>item.voiceUrl==this.globalBgMusic.src)
  249. if(tag){
  250. let obj={
  251. activityId:this.id,//活动id
  252. play:this.audioPlayStatus,//是否正在播放
  253. list:this.audioList,//音频列表数据
  254. show:false,//是否显示弹窗
  255. title:this.info.activityTypeName,//音频弹窗标题
  256. audioCurrentTime:this.audioCurrentTime,//音频播放实时时间
  257. audioTime:this.activeAudioTime,//当前音频时间
  258. audioCurrentUrl:this.activeAudioUrl,//当前音频地址
  259. recordId:this.recordId
  260. }
  261. uni.setStorageSync('audioMsg', JSON.stringify(obj))
  262. }
  263. },
  264. onShareAppMessage() {
  265. let title=this.info.activityName
  266. // if(this.info.firstActivityTypeId==1){
  267. // title=this.info.reportName.split('】')[1]||this.info.activityName
  268. // if(this.info.is_new_report==1){
  269. // title=this.info.reportName
  270. // }
  271. // }else{
  272. // title=this.info.activityName
  273. // }
  274. const token=uni.getStorageSync('token')
  275. const timestamp=new Date().getTime()
  276. let imgUrl=baseApiUrl+`/activity/getActivityShareImg?activity_id=${this.id}&timestamp=${timestamp}`
  277. return {
  278. title: title,
  279. imageUrl:imgUrl
  280. }
  281. },
  282. methods: {
  283. async init(e){
  284. const res=await apiGetSceneToParams({scene_key:e})
  285. if(res.code==200){
  286. const obj=JSON.parse(res.data)
  287. this.id=obj.id
  288. this.getDetail()
  289. this.getAudios()
  290. }
  291. },
  292. formatActivityTime(start,end){
  293. const week=dayjs(start).format('dddd');
  294. const day=dayjs(start).format('YYYY-MM-DD');
  295. const startTime=dayjs(start).format('HH:mm');
  296. const endTime=dayjs(end).format('HH:mm');
  297. return `${day} ${startTime}-${endTime} ${week}`
  298. },
  299. // 点击音频项
  300. handleClickAudioItem(item){
  301. // 点击同一个音频
  302. if(item.voiceUrl==this.activeAudioUrl){
  303. // if(this.audioPlayStatus){
  304. // this.globalBgMusic.pause()
  305. // }else{
  306. // this.globalBgMusic.play()
  307. // }
  308. }else{
  309. let obj=uni.getStorageSync('audioMsg')
  310. if(obj&&JSON.parse(obj).audioCurrentUrl){
  311. this.handleAudioPlayRecordUpdate(this.globalBgMusic.currentTime)
  312. }
  313. this.handlePlayAudio(item)
  314. }
  315. },
  316. //新增音频播放统计
  317. async handleAudioPlayRecordAdd(primary_id,extend_id){
  318. const res=await apiActivityAudioPlayRecordAdd({
  319. primary_id:Number(primary_id),
  320. extend_id:Number(extend_id),
  321. from_page:'活动详情'
  322. })
  323. if(res.code===200){
  324. console.log('新增音频播放记录成功');
  325. this.recordId=res.data.id
  326. }
  327. },
  328. //更新音频播放记录
  329. async handleAudioPlayRecordUpdate(time){
  330. console.log(time);
  331. const res=await apiActivityAudioPlayRecordUpate({
  332. id:Number(this.recordId),
  333. stop_seconds:time?parseInt(time):Number(this.audioCurrentTime)
  334. })
  335. if(res.code===200){
  336. console.log('更新音频播放记录成功');
  337. }
  338. },
  339. // 播放音频
  340. handlePlayAudio(e){
  341. this.handleAudioPlayRecordAdd(e.activity_voice_id,e.activityId)
  342. this.globalBgMusic.title=e.voiceName
  343. this.globalBgMusic.src=e.voiceUrl
  344. this.globalBgMusic.onCanplay(()=>{
  345. console.log('onCanplay');
  346. this.globalBgMusic.play()
  347. this.activeAudioUrl=e.voiceUrl
  348. this.activeAudioTime=e.voicePlaySeconds
  349. })
  350. this.handleAudioFun()
  351. },
  352. // 音频事件
  353. handleAudioFun(){
  354. this.globalBgMusic.onPlay(()=>{
  355. console.log('onplay');
  356. this.audioPlayStatus=true
  357. })
  358. this.globalBgMusic.onPause(()=>{
  359. console.log('onPause');
  360. this.audioPlayStatus=false
  361. })
  362. this.globalBgMusic.onStop(()=>{
  363. console.log('onStop');
  364. this.handleAudioPlayRecordUpdate()
  365. this.audioPlayStatus=false
  366. this.activeAudioUrl=''
  367. this.activeAudioTime=0
  368. this.audioCurrentTime=0
  369. })
  370. this.globalBgMusic.onEnded(()=>{
  371. console.log('onEnded');
  372. this.handleAudioPlayRecordUpdate()
  373. this.audioPlayStatus=false
  374. this.handleAudioBtn('next','auto')
  375. })
  376. this.globalBgMusic.onError((e)=>{
  377. console.log('onError',e);
  378. uni.showToast({
  379. title:"音频播放错误",
  380. icon:'none'
  381. })
  382. })
  383. this.globalBgMusic.onTimeUpdate(()=>{
  384. if(this.globalBgMusic.src==this.activeAudioUrl){
  385. this.audioCurrentTime=parseInt(this.globalBgMusic.currentTime)
  386. }
  387. })
  388. },
  389. // 点击播放按钮
  390. handleAudioBtn(type,e){
  391. if(type==='center'){
  392. if(this.globalBgMusic.src){
  393. if(this.audioPlayStatus){
  394. this.globalBgMusic.pause()
  395. }else{
  396. this.globalBgMusic.play()
  397. }
  398. }else{
  399. this.handlePlayAudio(this.audioList[0])
  400. }
  401. }
  402. if(type==='before'){
  403. if(!this.isFirstAudio){
  404. this.handleAudioPlayRecordUpdate()
  405. this.audioList.forEach((_item,index)=>{
  406. if(_item.voiceUrl==this.activeAudioUrl){
  407. this.handlePlayAudio(this.audioList[index-1])
  408. }
  409. })
  410. }
  411. }
  412. if(type==='next'){
  413. if(!this.isLastAudio){
  414. this.handleAudioPlayRecordUpdate()
  415. this.audioList.forEach((_item,index)=>{
  416. if(_item.voiceUrl==this.activeAudioUrl){
  417. this.handlePlayAudio(this.audioList[index+1])
  418. }
  419. })
  420. }else{
  421. // 自动播放最后一个结束
  422. if(e==='auto'){
  423. this.activeAudioUrl=''
  424. this.audioPlayStatus=false
  425. this.activeAudioTime=0
  426. this.audioCurrentTime=0
  427. }
  428. }
  429. }
  430. },
  431. //音频进度条拖动
  432. handleAudioSliderChange(e){
  433. const value=e.detail.value
  434. this.globalBgMusic.seek(value)
  435. },
  436. // 获取活动音频
  437. async getAudios() {
  438. const res = await apiActivityAudios({ activity_id: Number(this.id) });
  439. if (res.code === 200&&res.data) {
  440. this.audioList = res.data
  441. let obj=uni.getStorageSync('audioMsg')
  442. if(obj){
  443. if(this.globalBgMusic.src&&JSON.parse(obj).activityId==this.id){
  444. this.activeAudioUrl=JSON.parse(obj).audioCurrentUrl
  445. this.activeAudioTime=Number(JSON.parse(obj).audioTime)
  446. this.audioCurrentTime=parseInt(this.globalBgMusic.currentTime)
  447. this.audioPlayStatus=JSON.parse(obj).play
  448. this.handleAudioFun()
  449. }
  450. this.recordId=JSON.parse(obj).recordId
  451. }
  452. }
  453. },
  454. async getDetail() {
  455. const res = await apiActivityDetail({ activity_id: Number(this.id) });
  456. // 无权限
  457. if (res.code === 403) {
  458. // 如果是pc进入的 则不跳转
  459. //防止无权限用户在pc点击分享的或者识别的二维码,没法正常跳转到pc页
  460. uni.getSystemInfo({
  461. success:(e)=>{
  462. if (e.windowWidth < 700){
  463. uni.redirectTo({
  464. url: "/pages-activity/noAuthority?data=" + JSON.stringify(res.data),
  465. });
  466. }
  467. }
  468. })
  469. return;
  470. }
  471. if (res.code === 200) {
  472. this.info = res.data;
  473. let arr = [
  474. {
  475. label: "大陆拨号",
  476. text: res.data.mainlandTel,
  477. color: "yellow",
  478. type: "tel",
  479. },
  480. {
  481. label: "香港拨入",
  482. text: res.data.hongKongTel,
  483. color: "yellow",
  484. type: "tel",
  485. },
  486. {
  487. label: "台湾拨入",
  488. text: res.data.taiwanTel,
  489. color: "yellow",
  490. type: "tel",
  491. },
  492. {
  493. label: "新加坡拨入",
  494. text: res.data.singaporeTel,
  495. color: "yellow",
  496. type: "tel",
  497. },
  498. {
  499. label: "美国拨入",
  500. text: res.data.americaTel,
  501. color: "yellow",
  502. type: "tel",
  503. },
  504. {
  505. label: "拨入密码",
  506. text: res.data.participationCode,
  507. },
  508. ];
  509. this.infoList = arr.filter((item) => {
  510. return item.text;
  511. });
  512. // 研究员线下沙龙
  513. if (res.data.firstActivityTypeId === 3) {
  514. // this.infoList.push({label: "活动地址",text: res.data.city + res.data.address})
  515. if(res.data.linkParticipants){
  516. this.infoList.push({label: "网络参会",text: res.data.linkParticipants,color: "yellow",type: "copy"})
  517. }
  518. }
  519. }
  520. },
  521. // 点击信息项
  522. handleClickInfoItem(e) {
  523. if (e.type === "tel" && e.text) {
  524. uni.makePhoneCall({
  525. phoneNumber: e.text,
  526. });
  527. }
  528. },
  529. // 跳转webview 打开报告
  530. handleOpenReport() {
  531. if(this.info.is_new_report==1){//新报告
  532. uni.navigateTo({ url: '/pages-report/reportDetail?reportId='+this.info.report_id })
  533. }else{
  534. uni.navigateTo({
  535. url: "/pages-activity/reportDetail",
  536. success:(res)=>{
  537. res.eventChannel.emit('webUrl', { url: this.info.reportLink})
  538. }
  539. });
  540. }
  541. },
  542. // 复制链接
  543. handleCopyLink(text){
  544. uni.setClipboardData({
  545. data: text,
  546. success: function () {
  547. uni.showToast({
  548. title:"复制成功,可在浏览器内打开",
  549. icon:"none"
  550. })
  551. },
  552. fail:function(){
  553. uni.showToast({
  554. title:"复制失败",
  555. icon:"none"
  556. })
  557. }
  558. });
  559. },
  560. // 设置会议提醒
  561. async handleSetRemind() {
  562. if (this.info.hasRemind == 1) {
  563. this.handleCancelRemind();
  564. } else {
  565. this.handleAddRemind();
  566. }
  567. },
  568. // 添加提醒
  569. async handleAddRemind() {
  570. const res = await apiActivityAddRemind({ activity_id: Number(this.info.activityId) });
  571. if (res.code === 200) {
  572. this.pupData.content = `<h4 style="text-align:center;margin-bottom:5px">设置成功</h4>
  573. <p>关注【弘则研究】公众号,接收会前15分钟微信提醒,并及时获取活动信息变更通知</p>`;
  574. this.pupData.show = true;
  575. this.handleUpateRemindStatus();
  576. } else if (res.code === 4001) {
  577. if (res.data.type == "time") {
  578. this.pupData.content = `<p>会议开始前15分钟内无法设置会议提醒</p>`;
  579. this.pupData.type = "time";
  580. }
  581. this.pupData.show = true;
  582. }
  583. },
  584. //取消提醒
  585. async handleCancelRemind() {
  586. const res = await apiActivityCancelRemind({ activity_id: Number(this.info.activityId) });
  587. if (res.code === 200) {
  588. uni.showToast({
  589. title: "取消提醒成功",
  590. icon: "none",
  591. });
  592. this.handleUpateRemindStatus();
  593. }else if(res.code===403){
  594. uni.showToast({
  595. title:res.msg,
  596. icon:"none"
  597. })
  598. }
  599. },
  600. // 更新列表提醒状态
  601. handleUpateRemindStatus() {
  602. if (this.info.hasRemind == 1) {
  603. this.info.hasRemind = 0
  604. } else {
  605. this.info.hasRemind = 1
  606. }
  607. uni.$emit('activityDetailSetRemind', { id: this.info.activityId })
  608. },
  609. // 设置报名
  610. handleSetRegister() {
  611. if (this.info.registerState == 1) {
  612. this.handleCancelRegister();
  613. } else {
  614. this.handleAddRegister();
  615. }
  616. },
  617. // 线下报名
  618. async handleAddRegister() {
  619. const res = await apiActivityRegister({ activity_id: Number(this.info.activityId) })
  620. if (res.code === 200) {
  621. this.pupData.content = `<h4 style="text-align:center;margin-bottom:5px">报名成功</h4>
  622. <p>关注【弘则研究】公众号,接收会前1小时微信提醒,并及时获取活动信息变更通知</p>`
  623. this.pupData.show = true
  624. this.handleUpdateRegister()
  625. } else if (res.code === 4001) {
  626. if (res.data.type == 'time') {
  627. this.pupData.content = `<p>活动开始前15分钟内无法设置会议提醒</p>`
  628. this.pupData.type = 'time'
  629. } else if (res.data.type == 'full') {
  630. this.pupData.content = `<p>此活动报名人数已满,请留意下期活动</p>`
  631. this.pupData.type = 'full'
  632. }
  633. this.pupData.show = true
  634. }
  635. },
  636. //取消线下报名
  637. async handleCancelRegister() {
  638. const res = await apiActivityCancelRegister({ activity_id: Number(this.info.activityId) })
  639. if (res.code === 200) {
  640. uni.showToast({
  641. title: "取消报名成功",
  642. icon: "none"
  643. })
  644. this.handleUpdateRegister()
  645. }else if(res.code===403){
  646. uni.showToast({
  647. title:res.msg,
  648. icon:"none"
  649. })
  650. }
  651. },
  652. //更新列表报名状态
  653. handleUpdateRegister() {
  654. if (this.info.registerState == 1) {
  655. this.info.registerState = 0
  656. } else {
  657. this.info.registerState = 1
  658. }
  659. this.getDetail()
  660. uni.$emit('activityDetailSetRegister', { id: this.info.activityId })
  661. }
  662. },
  663. };
  664. </script>
  665. <style lang="scss">
  666. .activity-detail {
  667. background: #fff;
  668. }
  669. .top-wrap {
  670. width: 100%;
  671. height: 370rpx;
  672. // background: linear-gradient(
  673. // 312deg,
  674. // rgba(0, 0, 0, 0.8) 0%,
  675. // rgba(43, 43, 43, 0.8) 100%
  676. // );
  677. background-color: #666666;
  678. color: $global-text-color-white;
  679. padding-top: 144rpx;
  680. padding-left: 40rpx;
  681. padding-right: 40rpx;
  682. background-size: cover;
  683. background-repeat: no-repeat;
  684. position: relative;
  685. .status {
  686. position: absolute;
  687. top: 0;
  688. left: 0;
  689. width: 116rpx;
  690. line-height: 44rpx;
  691. border-radius: 0px 0px 16rpx 0px;
  692. color: $global-text-color-white;
  693. text-align: center;
  694. font-size: $global-font-size-sm;
  695. }
  696. .status-before {
  697. background-color: #e3b377;
  698. }
  699. .status-progress {
  700. background-color: #3385ff;
  701. }
  702. .status-end {
  703. background-color: #a2a2a2;
  704. }
  705. .title {
  706. font-size: 19px;
  707. font-weight: bold;
  708. }
  709. .name {
  710. margin-top: 15rpx;
  711. margin-bottom: 40rpx;
  712. }
  713. .time {
  714. opacity: 0.8;
  715. font-size: $global-font-size-sm;
  716. }
  717. .city {
  718. font-size: $global-font-size-sm;
  719. align-items: center;
  720. position: absolute;
  721. right: 40rpx;
  722. bottom: 59rpx;
  723. image {
  724. width: 32rpx;
  725. height: 32rpx;
  726. }
  727. }
  728. }
  729. .intro-wrap {
  730. background-color: #fff;
  731. box-shadow: 0px 3px 12px rgba(196, 196, 196, 0.16);
  732. font-size: $global-font-size-lg;
  733. font-weight: bold;
  734. padding: 28rpx 34rpx;
  735. }
  736. .info-wrap {
  737. padding: 30rpx 34rpx;
  738. .item {
  739. margin-bottom: 30rpx;
  740. .label {
  741. flex-shrink: 0;
  742. }
  743. .copy-btn {
  744. background-color: #e3b377;
  745. color: #fff;
  746. padding: 4rpx 8rpx;
  747. font-size: 12px;
  748. margin-left: 4rpx;
  749. }
  750. .link{
  751. width: 300rpx;
  752. white-space:nowrap;
  753. overflow:hidden;
  754. text-overflow:ellipsis;
  755. }
  756. }
  757. .yellow-color {
  758. color: $global-text-color-main;
  759. }
  760. }
  761. .audio-wrap {
  762. padding: 0 34rpx;
  763. .audio-item {
  764. padding: 36rpx 0;
  765. border-bottom: 1px solid #E8DED2;
  766. position: relative;
  767. .icon {
  768. position: absolute;
  769. top: 50rpx;
  770. right: 6rpx;
  771. width: 40rpx;
  772. height: 40rpx;
  773. }
  774. .name {
  775. margin-bottom: 10rpx;
  776. }
  777. .time {
  778. font-size: $global-font-size-mini;
  779. }
  780. .audio-slider{
  781. margin: 20rpx 0 20rpx 20rpx;
  782. }
  783. }
  784. .box{
  785. min-height: 100rpx;
  786. margin-top: 60rpx;
  787. margin-bottom: 70rpx;
  788. padding: 30rpx 20rpx;
  789. background: #FFFFFF;
  790. border: 1px solid rgba(240, 234, 226, 0.3);
  791. box-shadow: 0px 3px 12px rgba(154, 154, 154, 0.16);
  792. border-radius: 16px;
  793. .top-slider{
  794. align-items: center;
  795. text{
  796. width: 110rpx;
  797. font-size: 12px;
  798. text-align: center;
  799. flex-shrink: 0;
  800. }
  801. .audio-slider{
  802. flex: 1;
  803. margin: 0 20rpx;
  804. }
  805. }
  806. .btns{
  807. justify-content: space-between;
  808. width: 50%;
  809. align-items: center;
  810. margin-left: auto;
  811. margin-right: auto;
  812. margin-top: 25rpx;
  813. image{
  814. width: 58rpx;
  815. height: 58rpx;
  816. }
  817. .next{
  818. transform: rotate(180deg);
  819. }
  820. }
  821. }
  822. }
  823. .btn-wrap {
  824. .btn {
  825. width: 380rpx;
  826. line-height: 70rpx;
  827. margin-left: auto;
  828. margin-right: auto;
  829. margin-top: 40rpx;
  830. }
  831. .tips {
  832. font-size: $global-font-size-sm;
  833. color: $global-text-color-999;
  834. text-align: center;
  835. }
  836. }
  837. </style>