detail.vue 29 KB

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