activity.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  1. <template>
  2. <page-meta :page-style="currentAudioMsg.show? 'overflow: hidden;' : ''" />
  3. <view class="activity-page">
  4. <van-sticky style="background: #fff">
  5. <!-- <view class="search-wrap">
  6. <van-search
  7. shape="round"
  8. :value="searchVal"
  9. placeholder="搜索您想要的商品名"
  10. @change="searchValChange"
  11. @search="onSearch"
  12. @clear="onClearSearch"
  13. />
  14. </view> -->
  15. <view class="flex tabs-wrap" @click="tabChange">
  16. <view
  17. :class="['tab-item', tabActive === '1' && 'tab-active']"
  18. data-type="1"
  19. >报告及线上会议</view>
  20. <view
  21. :class="['tab-item', tabActive === '3' && 'tab-active']"
  22. data-type="3"
  23. >线下沙龙</view>
  24. </view>
  25. <view class="flex status-wrap" @click="statusChange">
  26. <view
  27. :class="[
  28. 'status-item',
  29. statusActive === '1' && 'status-active',
  30. ]"
  31. data-status="1">本周预告
  32. </view>
  33. <view
  34. :class="[
  35. 'status-item',
  36. statusActive === '2' && 'status-active',
  37. ]"
  38. data-status="2">进行中
  39. </view>
  40. <view
  41. :class="[
  42. 'status-item',
  43. statusActive === '3' && 'status-active',
  44. ]"
  45. data-status="3">已结束
  46. </view>
  47. <van-checkbox
  48. class="auth-box"
  49. shape="square"
  50. :value="onlySeeAuth"
  51. @change="handleAuthChange"
  52. checked-color="#D5AD79"
  53. icon-size="16px"
  54. >
  55. <view class="text">只看有权限</view>
  56. </van-checkbox>
  57. </view>
  58. </van-sticky>
  59. <view class="list" v-if="list.length > 0">
  60. <view
  61. class="global-list-card item"
  62. v-for="(item,index) in list"
  63. :key="item.activityId"
  64. @click="handleGoDetail(item.activityId)"
  65. >
  66. <view class="status-box status-before" v-if="item.activityState===1">未开始</view>
  67. <view class="status-box status-progress" v-if="item.activityState===2">进行中</view>
  68. <view class="status-box status-end" v-if="item.activityState===3">已结束</view>
  69. <view class="flex top">
  70. <image class="avatar" :src="item.speakerHeadPic" mode="aspectFill"></image>
  71. <view class="content">
  72. <view class="flex icon-box" @click.stop="handleGetAudio(item)">
  73. <template v-if="item.firstActivityTypeId===3&&item.city">
  74. <image src='../../static/position.png'></image>
  75. <text>{{item.city}}</text>
  76. </template>
  77. <template v-if="item.firstActivityTypeId===1&&item.activityState===3&&item.hasPlayBack">
  78. <image :src="currentAudioMsg.activityId==item.activityId&&currentAudioMsg.play?'../../static/audio-doing.png':'../../static/audio-pause-3.png'"></image>
  79. <text>{{currentAudioMsg.activityId==item.activityId?currentAudioMsg.play?'暂停':'回放':'回放'}}</text>
  80. </template>
  81. </view>
  82. <view class="van-ellipsis title">{{item.activityTypeName}}</view>
  83. <view class="name">主讲:{{item.speaker}}</view>
  84. <view class="time">{{ item.startTime | formatActivityTime(item.endTime) }}</view>
  85. </view>
  86. </view>
  87. <view class="flex bot" v-if="item.activityState===1">
  88. <view
  89. :class="!item.hasRemind&&'active'"
  90. @click.stop="handleRemind(item,index)"
  91. >
  92. {{item.hasRemind?'取消提醒':'会议提醒'}}
  93. </view>
  94. <view
  95. :class="!item.registerState&&'active'"
  96. v-if="item.firstActivityTypeId===3"
  97. @click.stop="handleRegister(item,index)"
  98. >
  99. {{item.registerState?'取消线下报名':'报名线下参会'}}
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. <van-empty description="暂无数据" v-if="list.length===0&&finished" />
  105. <!-- 弹窗 -->
  106. <van-popup :show="pupData.show" @close="pupData.show=false" :close-on-click-overlay="false">
  107. <view class="global-pup">
  108. <view class="content">
  109. <rich-text :nodes="pupData.content"></rich-text>
  110. </view>
  111. <view class="flex bot" v-if="pupData.type=='contact'">
  112. <view @click="pupData.show=false" style="color:#A9AFB8">取消</view>
  113. <view @click="handleCallPhone(pupData.mobile)">拨号</view>
  114. </view>
  115. <view class="flex bot" v-else-if="pupData.type=='apply'">
  116. <view @click="pupData.show=false" style="color:#A9AFB8">取消</view>
  117. <view @click="handleApply">立即申请</view>
  118. </view>
  119. <view class="flex bot" v-else>
  120. <view @click="pupData.show=false">知道了</view>
  121. </view>
  122. </view>
  123. </van-popup>
  124. <!-- 音频弹窗 -->
  125. <van-popup
  126. :show="currentAudioMsg.show"
  127. @close="currentAudioMsg.show=false"
  128. position="bottom"
  129. closeable
  130. round
  131. z-index="99999"
  132. >
  133. <view class="audio-popup-box">
  134. <view class="title">{{currentAudioMsg.title}}</view>
  135. <view class="list">
  136. <view class="flex item" v-for="item in currentAudioMsg.list" :key="item.voiceUrl" @click="handleAudioChange(item)">
  137. <view>
  138. <view :style="{color:item.voiceUrl==currentAudioMsg.audioCurrentUrl?'#D5AD79':''}">{{item.voiceName}}</view>
  139. <view style="font-size:12px;color:#999">{{item.voicePlaySeconds|formatVoiceTime}}</view>
  140. </view>
  141. <!-- <image v-if="item.voiceUrl==currentAudioMsg.audioCurrentUrl&&currentAudioMsg.play" src="../../static/audio-doing.png" mode="scaleToFill"/>
  142. <image v-else-if="item.voiceUrl==currentAudioMsg.audioCurrentUrl&&!currentAudioMsg.play" src="../../static/audio-pause-3.png" mode="scaleToFill"/>
  143. <image v-else src="../../static/audio-pause-2.png" mode="scaleToFill"/> -->
  144. </view>
  145. </view>
  146. <view class="flex box">
  147. <text>{{currentAudioMsg.audioCurrentTime|formatVoiceTime}}</text>
  148. <slider
  149. activeColor="#e3b377"
  150. :max="currentAudioMsg.audioTime"
  151. :value="currentAudioMsg.audioCurrentTime"
  152. @change="handleAudioSliderChange($event)"
  153. block-size="20"
  154. />
  155. <text>{{currentAudioMsg.audioTime|formatVoiceTime}}</text>
  156. </view>
  157. <view class="flex btns">
  158. <image
  159. class="before"
  160. :src="isFirstAudio?'../../static/audio-before-grey.png':'../../static/audio-before.png'"
  161. mode="aspectFit"
  162. @click="handleAudioBtn('before')"
  163. />
  164. <image
  165. class="center"
  166. :src="currentAudioMsg.play?'../../static/audio-doing.png':'../../static/audio-pause-3.png'"
  167. mode="aspectFit"
  168. @click="handleAudioBtn('center')"
  169. />
  170. <image
  171. class="next"
  172. :src="isLastAudio?'../../static/audio-before-grey.png':'../../static/audio-before.png'"
  173. mode="aspectFit"
  174. @click="handleAudioBtn('next')"
  175. />
  176. </view>
  177. </view>
  178. </van-popup>
  179. </view>
  180. </template>
  181. <script>
  182. import {
  183. apiActivityList,
  184. apiActivityAddRemind,
  185. apiActivityCancelRemind,
  186. apiActivityRegister,
  187. apiActivityCancelRegister,
  188. apiActivityAudios
  189. } from '@/api/activity'
  190. import {apiApplyPermission,apiUserInfo} from '@/api/user'
  191. export default {
  192. computed: {
  193. isFirstAudio(){
  194. if(!this.currentAudioMsg.audioCurrentUrl){
  195. return true
  196. }
  197. if(this.currentAudioMsg.list.length>0){
  198. return this.currentAudioMsg.audioCurrentUrl==this.currentAudioMsg.list[0].voiceUrl
  199. }
  200. },
  201. isLastAudio(){
  202. if(!this.currentAudioMsg.audioCurrentUrl){
  203. return true
  204. }
  205. if(this.currentAudioMsg.list.length>0){
  206. return this.currentAudioMsg.audioCurrentUrl==this.currentAudioMsg.list[this.currentAudioMsg.list.length-1].voiceUrl
  207. }
  208. }
  209. },
  210. watch: {
  211. 'pupData.show':{
  212. handler(nval){
  213. if(!nval){
  214. this.pupData={
  215. show:false,
  216. content:'',//弹窗html字符串
  217. type:'',
  218. mobile:"",
  219. }
  220. }
  221. }
  222. }
  223. },
  224. data() {
  225. return {
  226. searchVal: '',
  227. tabActive: '1',
  228. statusActive: '1',
  229. page: 1,
  230. pageSize: 20,
  231. list: [],
  232. finished: false,
  233. pupData:{
  234. show:false,
  235. content:'',//弹窗html字符串
  236. type:'',
  237. mobile:"",
  238. },
  239. onlySeeAuth:false,// 是否只看有权限的
  240. currentAudioMsg:{
  241. activityId:'',//活动id
  242. play:false,//是否正在播放
  243. list:[],//音频列表数据
  244. show:false,//是否显示弹窗
  245. title:'',//音频弹窗标题
  246. audioCurrentTime:0,//音频播放实时时间
  247. audioTime:0,//当前音频时间
  248. audioCurrentUrl:'',//当前音频地址
  249. },
  250. }
  251. },
  252. onLoad() {
  253. this.init()
  254. this.addEventListenerRemind()
  255. this.addEventListenerRegister()
  256. },
  257. onShow() {
  258. if(this.$store.state.activity.activityListPageRefresh){
  259. this.allRefresh()
  260. }
  261. this.initAudio()
  262. },
  263. onHide(){
  264. this.pupData.show=false
  265. this.currentAudioMsg.show=false
  266. // 存一次音频信息
  267. uni.setStorageSync('audioMsg', JSON.stringify(this.currentAudioMsg))
  268. },
  269. onUnload(){
  270. uni.$off('activityDetailSetRemind')
  271. uni.$off('activityDetailSetRegister')
  272. },
  273. onShareAppMessage(res) {
  274. return {
  275. title: '弘则FICC周度电话会安排',
  276. path: ''
  277. }
  278. },
  279. onPullDownRefresh() {
  280. this.refreshPage()
  281. setTimeout(() => {
  282. uni.stopPullDownRefresh()
  283. }, 1500)
  284. },
  285. onReachBottom() {
  286. if (this.finished) return
  287. this.page++
  288. this.getList()
  289. },
  290. methods: {
  291. // 初始化音频状态
  292. initAudio(){
  293. console.log('音频src',this.globalBgMusic.src);
  294. if(this.globalBgMusic.src){
  295. const obj=uni.getStorageSync('audioMsg')
  296. if(obj){
  297. this.currentAudioMsg=JSON.parse(obj)
  298. }
  299. this.handleAudioFun()
  300. }else{
  301. this.currentAudioMsg={
  302. activityId:'',//活动id
  303. play:false,//是否正在播放
  304. list:[],//音频列表数据
  305. show:false,//是否显示弹窗
  306. title:'',//音频弹窗标题
  307. audioCurrentTime:0,//音频播放实时时间
  308. audioTime:0,//当前音频时间
  309. audioCurrentUrl:'',//当前音频地址
  310. }
  311. }
  312. },
  313. // 点击列表中播放音频
  314. async handleGetAudio(item){
  315. if(!(item.firstActivityTypeId===1&&item.activityState===3&&item.hasPlayBack)) return
  316. // 获取音频
  317. if(this.currentAudioMsg.activityId!=item.activityId){
  318. const res=await apiActivityAudios({activity_id: Number(item.activityId)})
  319. if(res.code===200){
  320. if(res.data){
  321. this.currentAudioMsg.activityId=item.activityId
  322. this.currentAudioMsg.list=res.data
  323. this.currentAudioMsg.title=item.activityTypeName
  324. this.handlePlayAudio(res.data[0])
  325. this.currentAudioMsg.show=!this.currentAudioMsg.show
  326. }else{
  327. uni.showToast({
  328. title:"无音频数据",
  329. icon:"none"
  330. })
  331. }
  332. }else if(res.code===403){
  333. if(res.data.type=='contact'){
  334. if(!res.data.customer_info.has_apply){
  335. if(res.data.customer_info.status=='冻结'||(res.data.customer_info.status=='试用'&&res.data.customer_info.is_suspend==1)){
  336. apiApplyPermission({
  337. company_name:res.data.customer_info.company_name,
  338. real_name:res.data.customer_info.name,
  339. source:2,
  340. }).then(res=>{
  341. if(res.code===200){
  342. console.log('主动申请成功');
  343. }
  344. })
  345. }
  346. }
  347. this.pupData.content=`<p>您暂无权限参加此活动,若想参加请联系对口销售--${res.data.name}:${res.data.mobile}</p>`
  348. this.pupData.mobile=res.data.mobile
  349. }else if(res.data.type=='apply'){
  350. this.pupData.content=`<p>您暂无权限参加此活动,若想参加可以申请开通哦</p>`
  351. }
  352. this.pupData.show=true
  353. this.pupData={...this.pupData,...res.data}
  354. }
  355. }else{
  356. if(this.currentAudioMsg.play){
  357. this.globalBgMusic.pause()
  358. }else{
  359. this.globalBgMusic.play()
  360. }
  361. this.currentAudioMsg.show=!this.currentAudioMsg.show
  362. }
  363. },
  364. // 播放音频
  365. handlePlayAudio(item){
  366. this.globalBgMusic.src=item.voiceUrl
  367. this.globalBgMusic.title=item.voiceName
  368. this.globalBgMusic.onCanplay(()=>{
  369. this.globalBgMusic.play()
  370. this.currentAudioMsg.audioTime=item.voicePlaySeconds
  371. })
  372. this.handleAudioFun()
  373. },
  374. // 音频事件
  375. handleAudioFun(){
  376. this.globalBgMusic.onPlay(()=>{
  377. this.currentAudioMsg.play=true
  378. this.currentAudioMsg.audioCurrentUrl=this.globalBgMusic.src
  379. })
  380. this.globalBgMusic.onPause(()=>{
  381. this.currentAudioMsg.play=false
  382. })
  383. this.globalBgMusic.onStop(()=>{
  384. this.currentAudioMsg.play=false
  385. this.currentAudioMsg.play=false
  386. this.currentAudioMsg.audioCurrentTime=0
  387. this.currentAudioMsg.audioTime=0
  388. this.currentAudioMsg.audioCurrentUrl=0
  389. })
  390. this.globalBgMusic.onEnded(()=>{
  391. console.log('onEnded');
  392. this.currentAudioMsg.play=false
  393. this.handleAudioBtn('next','auto')
  394. })
  395. this.globalBgMusic.onError((e)=>{
  396. console.log('onError',e);
  397. })
  398. this.globalBgMusic.onTimeUpdate(()=>{
  399. console.log('时间更新');
  400. // if(this.globalBgMusic.src==this.currentAudioMsg.audioCurrentUrl){
  401. this.currentAudioMsg.audioCurrentTime=parseInt(this.globalBgMusic.currentTime)
  402. // }
  403. })
  404. },
  405. // 点击弹窗中的按钮
  406. handleAudioBtn(type,e){
  407. if(type==='center'){
  408. if(this.globalBgMusic.src){
  409. if(this.currentAudioMsg.play){
  410. this.globalBgMusic.pause()
  411. }else{
  412. this.globalBgMusic.play()
  413. }
  414. }else{
  415. this.handlePlayAudio(this.currentAudioMsg.list[0])
  416. }
  417. }
  418. if(type==='before'){
  419. if(!this.isFirstAudio){
  420. this.currentAudioMsg.list.forEach((_item,index)=>{
  421. if(_item.voiceUrl==this.currentAudioMsg.audioCurrentUrl){
  422. this.handlePlayAudio(this.currentAudioMsg.list[index-1])
  423. }
  424. })
  425. }
  426. }
  427. if(type==='next'){
  428. if(!this.isLastAudio){
  429. this.currentAudioMsg.list.forEach((_item,index)=>{
  430. if(_item.voiceUrl==this.currentAudioMsg.audioCurrentUrl){
  431. this.handlePlayAudio(this.currentAudioMsg.list[index+1])
  432. }
  433. })
  434. }else{
  435. if(e==='auto'){
  436. this.currentAudioMsg.play=false
  437. this.currentAudioMsg.audioCurrentTime=0
  438. this.currentAudioMsg.audioTime=0
  439. this.currentAudioMsg.audioCurrentUrl=''
  440. }
  441. }
  442. }
  443. },
  444. //点击弹窗中的音频项
  445. handleAudioChange(item){
  446. // 点击的同一个
  447. if(item.voiceUrl==this.currentAudioMsg.audioCurrentUrl){
  448. // if(this.currentAudioMsg.play){
  449. // this.globalBgMusic.pause()
  450. // }else{
  451. // this.globalBgMusic.play()
  452. // }
  453. }else{
  454. this.handlePlayAudio(item)
  455. }
  456. },
  457. //拖动进度条
  458. handleAudioSliderChange(e){
  459. const value=e.detail.value
  460. this.globalBgMusic.seek(value)
  461. },
  462. async init(){
  463. let userInfoRes=this.userInfo
  464. if(!this.userInfo.status){
  465. const res=await apiUserInfo()
  466. if(res.code===200){
  467. userInfoRes=res.data
  468. }
  469. }
  470. if(['正式','永续'].includes(userInfoRes.status)){
  471. this.onlySeeAuth=true
  472. }
  473. if(userInfoRes.status=='试用'&&userInfoRes.is_suspend==0){
  474. this.onlySeeAuth=true
  475. }
  476. this.getList()
  477. },
  478. handleAuthChange(e){
  479. this.onlySeeAuth=e.detail
  480. this.refreshPage()
  481. },
  482. // 切换tabbar页面时 整个刷新
  483. allRefresh(){
  484. this.tabActive= '1'
  485. this.statusActive='1'
  486. this.pupData={
  487. show:false,
  488. content:'',//弹窗html字符串
  489. type:'',
  490. mobile:"",
  491. }
  492. this.page = 1
  493. this.list = []
  494. this.finished = false
  495. this.getList()
  496. },
  497. // 监听详情中设置提醒
  498. addEventListenerRemind(){
  499. uni.$on('activityDetailSetRemind',e=>{
  500. this.list.forEach((item,index) => {
  501. if(item.activityId==e.id){
  502. this.handleUpateRemindStatus(index)
  503. }
  504. });
  505. })
  506. },
  507. // 监听详情中报名
  508. addEventListenerRegister(){
  509. uni.$on('activityDetailSetRegister',e=>{
  510. this.list.forEach((item,index) => {
  511. if(item.activityId==e.id){
  512. this.handleUpdateRegister(index)
  513. }
  514. });
  515. })
  516. },
  517. //搜索
  518. onSearch(){
  519. this.refreshPage()
  520. this.getList()
  521. },
  522. //清除搜索内容
  523. onClearSearch(){
  524. this.searchVal=''
  525. this.refreshPage()
  526. this.getList()
  527. },
  528. // 同步搜索关键词
  529. searchValChange(e){
  530. this.searchVal=e.detail
  531. },
  532. // 类型切换
  533. tabChange(e) {
  534. const type = e.target.dataset.type
  535. if (!type||type === this.tabActive) return
  536. this.tabActive = type
  537. this.statusActive = '1'
  538. this.refreshPage()
  539. },
  540. // 状态切换
  541. statusChange(e) {
  542. const status = e.target.dataset.status
  543. if (!status||status === this.statusActive) return
  544. this.statusActive = status
  545. this.refreshPage()
  546. },
  547. // 刷新页面
  548. refreshPage() {
  549. this.page = 1
  550. this.list = []
  551. this.finished = false
  552. this.getList()
  553. },
  554. handleGoDetail(id) {
  555. uni.navigateTo({
  556. url: '/pages-activity/detail?id=' + id
  557. });
  558. },
  559. async getList() {
  560. const res = await apiActivityList({
  561. title:this.searchVal,
  562. active_state: Number(this.statusActive),
  563. activity_type: Number(this.tabActive),
  564. has_permission:this.onlySeeAuth?1:0,
  565. page: this.page,
  566. limit: this.pageSize
  567. })
  568. if (res.code === 200) {
  569. if(res.data){
  570. this.list = [...this.list, ...res.data]
  571. }else{
  572. this.finished=true
  573. }
  574. }
  575. },
  576. handleRemind(e,index){
  577. if(e.hasRemind===0){
  578. this.handleAddRemind(e,index)
  579. }else{
  580. this.handleCancelRemind(e,index)
  581. }
  582. },
  583. // 添加提醒
  584. async handleAddRemind(e,index){
  585. const res=await apiActivityAddRemind({activity_id:Number(e.activityId)})
  586. if(res.code===200){
  587. this.pupData.content=`<h4 style="text-align:center;margin-bottom:5px">设置成功</h4>
  588. <p>关注【弘则研究】公众号,接收会前15分钟微信提醒,并及时获取活动信息变更通知</p>`
  589. this.pupData.show=true
  590. this.handleUpateRemindStatus(index)
  591. }else if(res.code===4001){
  592. if(res.data.type=='time'){
  593. this.pupData.content=`<p>会议开始前15分钟内无法设置会议提醒</p>`
  594. this.pupData.type='time'
  595. }
  596. this.pupData.show=true
  597. }else if(res.code===403){
  598. if(res.data.type=='contact'){
  599. if(!res.data.customer_info.has_apply){
  600. if(res.data.customer_info.status=='冻结'||(res.data.customer_info.status=='试用'&&res.data.customer_info.is_suspend==1)){
  601. apiApplyPermission({
  602. company_name:res.data.customer_info.company_name,
  603. real_name:res.data.customer_info.name,
  604. source:2,
  605. }).then(res=>{
  606. if(res.code===200){
  607. console.log('主动申请成功');
  608. }
  609. })
  610. }
  611. }
  612. this.pupData.content=`<p>您暂无权限参加此会议,若想参加请联系对口销售--${res.data.name}:${res.data.mobile}</p>`
  613. this.pupData.mobile=res.data.mobile
  614. }else if(res.data.type=='apply'){
  615. this.pupData.content=`<p>您暂无权限参加此会议,若想参加可以申请开通哦</p>`
  616. }
  617. this.pupData.show=true
  618. this.pupData={...this.pupData,...res.data}
  619. }
  620. },
  621. //取消提醒
  622. async handleCancelRemind(e,index){
  623. const res=await apiActivityCancelRemind({activity_id:Number(e.activityId)})
  624. if(res.code===200){
  625. uni.showToast({
  626. title:"取消提醒成功",
  627. icon:"none"
  628. })
  629. this.handleUpateRemindStatus(index)
  630. }else if(res.code===403){
  631. uni.showToast({
  632. title:res.msg,
  633. icon:"none"
  634. })
  635. }
  636. },
  637. //更新列表中某项的设置提醒状态
  638. handleUpateRemindStatus(index){
  639. if(this.list[index].hasRemind===0){
  640. this.list[index].hasRemind=1
  641. }else{
  642. this.list[index].hasRemind=0
  643. }
  644. },
  645. handleRegister(e,index){
  646. if(e.registerState===0){
  647. this.handleAddRegister(e,index)
  648. }else{
  649. this.handleCancelRegister(e,index)
  650. }
  651. },
  652. // 线下报名
  653. async handleAddRegister(e,index){
  654. const res=await apiActivityRegister({activity_id:Number(e.activityId)})
  655. if(res.code===200){
  656. this.pupData.content=`<h4 style="text-align:center;margin-bottom:5px">报名成功</h4>
  657. <p>关注【弘则研究】公众号,接收会前1小时微信提醒,并及时获取活动信息变更通知</p>`
  658. this.pupData.show=true
  659. this.handleUpdateRegister(index)
  660. }else if(res.code===4001){
  661. if(res.data.type=='time'){
  662. this.pupData.content=`<p>活动开始前15分钟内无法设置会议提醒</p>`
  663. this.pupData.type='time'
  664. }else if(res.data.type=='full'){
  665. this.pupData.content=`<p>此活动报名人数已满,请留意下期活动</p>`
  666. this.pupData.type='full'
  667. }
  668. this.pupData.show=true
  669. }else if(res.code===403){
  670. if(res.data.type=='contact'){
  671. if(!res.data.customer_info.has_apply){
  672. if(res.data.customer_info.status=='冻结'||(res.data.customer_info.status=='试用'&&res.data.customer_info.is_suspend==1)){
  673. apiApplyPermission({
  674. company_name:res.data.customer_info.company_name,
  675. real_name:res.data.customer_info.name,
  676. source:2,
  677. }).then(res=>{
  678. if(res.code===200){
  679. console.log('主动申请成功');
  680. }
  681. })
  682. }
  683. }
  684. this.pupData.content=`<p>您暂无权限参加此活动,若想参加请联系对口销售--${res.data.name}:${res.data.mobile}</p>`
  685. this.pupData.mobile=res.data.mobile
  686. }else if(res.data.type=='apply'){
  687. this.pupData.content=`<p>您暂无权限参加此活动,若想参加可以申请开通哦</p>`
  688. }
  689. this.pupData.show=true
  690. this.pupData={...this.pupData,...res.data}
  691. }
  692. },
  693. //取消线下报名
  694. async handleCancelRegister(e,index){
  695. const res=await apiActivityCancelRegister({activity_id:Number(e.activityId)})
  696. if(res.code===200){
  697. uni.showToast({
  698. title:"取消报名成功",
  699. icon:"none"
  700. })
  701. this.handleUpdateRegister(index)
  702. }else if(res.code===403){
  703. uni.showToast({
  704. title:res.msg,
  705. icon:"none"
  706. })
  707. }
  708. },
  709. // 更新报名状态
  710. handleUpdateRegister(index){
  711. if(this.list[index].registerState===0){
  712. this.list[index].registerState=1
  713. }else{
  714. this.list[index].registerState=0
  715. }
  716. },
  717. // 点击立即申请
  718. async handleApply(){
  719. if(this.pupData.customer_info.has_apply){//已经申请过
  720. this.pupData.content=`<p>您已提交过申请,请耐心等待</p>`
  721. this.pupData.type=''
  722. }else{
  723. if(!this.pupData.customer_info.status||this.pupData.customer_info.status!='流失'){
  724. uni.navigateTo({
  725. url:"/pages-applyPermission/applyPermission?source=2"
  726. })
  727. }else{//主动调一次申请权限接口
  728. const res=await apiApplyPermission({
  729. company_name:this.pupData.customer_info.company_name,
  730. real_name:this.pupData.customer_info.name,
  731. source:2,
  732. })
  733. if(res.code===200){
  734. this.pupData.content=`<p>申请已提交</p><p>请等待销售人员与您联系</p>`
  735. this.pupData.type=''
  736. }
  737. }
  738. }
  739. },
  740. // 拨打电话
  741. handleCallPhone(tel){
  742. uni.makePhoneCall({
  743. phoneNumber: tel
  744. });
  745. }
  746. }
  747. }
  748. </script>
  749. <style lang="scss">
  750. .audio-popup-box{
  751. .title{
  752. font-size: 16px;
  753. font-weight: bold;
  754. padding: 40rpx 34rpx 0 34rpx;
  755. }
  756. .list{
  757. max-height: 50vh;
  758. overflow-y: auto;
  759. }
  760. .item{
  761. padding: 34rpx 52rpx 34rpx 34rpx;
  762. border-bottom: 1px solid $global-border-color;
  763. justify-content: space-between;
  764. image{
  765. width: 48rpx;
  766. height: 48rpx;
  767. flex-shrink: 0;
  768. }
  769. }
  770. .box{
  771. align-items: center;
  772. padding: 0rpx 54rpx 30rpx 54rpx;
  773. text{
  774. width: 110rpx;
  775. display: inline-block;
  776. font-size: 12px;
  777. }
  778. slider{
  779. flex: 1;
  780. }
  781. }
  782. .btns{
  783. width: 45%;
  784. margin-left: auto;
  785. margin-right: auto;
  786. margin-bottom: 20rpx;
  787. justify-content: space-between;
  788. image{
  789. width: 58rpx;
  790. height: 58rpx;
  791. }
  792. .next{
  793. transform: rotate(180deg);
  794. }
  795. }
  796. }
  797. .search-wrap {
  798. padding: 0 8rpx;
  799. background-color: $global-bg-color;
  800. }
  801. .tabs-wrap {
  802. background-color: $global-bg-color;
  803. box-shadow: $global-tab-shadow-color;
  804. align-items: center;
  805. text-align: center;
  806. font-size: $global-font-size-lg;
  807. color: $global-text-color-grey;
  808. position: relative;
  809. z-index: 10;
  810. .tab-item {
  811. flex: 1;
  812. height: 94rpx;
  813. line-height: 94rpx;
  814. }
  815. .tab-active {
  816. font-weight: bold;
  817. color: $global-text-color-main;
  818. border-bottom: 6rpx solid $global-text-color-main;
  819. }
  820. }
  821. .status-wrap {
  822. background-color: $global-bg-color;
  823. padding: 40rpx 34rpx 20rpx 34rpx;
  824. overflow-x: scroll;
  825. width: 100%;
  826. margin-right: 34rpx;
  827. align-items: center;
  828. &::-webkit-scrollbar{
  829. width: 0;
  830. display: none;
  831. }
  832. .status-item {
  833. font-size: $global-font-size-sm;
  834. color: #444;
  835. min-width: 167rpx;
  836. text-align: center;
  837. padding: 14rpx;
  838. border-radius: 40rpx;
  839. background-color: #f6f6f6;
  840. margin-right: 40rpx;
  841. height: 60rpx;
  842. }
  843. .status-active {
  844. background: linear-gradient(270deg, #efc896 0%, #d9a35f 100%);
  845. color: $global-bg-color;
  846. }
  847. .auth-box{
  848. margin-right: 40rpx;
  849. .text{
  850. color: $global-text-color-main;
  851. font-size: $global-font-size-sm;
  852. min-width: 120rpx;
  853. white-space: nowrap;
  854. }
  855. }
  856. }
  857. .list {
  858. padding: 34rpx;
  859. .item {
  860. position: relative;
  861. margin-bottom: 30rpx;
  862. .status-box {
  863. top: 0;
  864. right: 0;
  865. position: absolute;
  866. width: 132rpx;
  867. line-height: 44rpx;
  868. text-align: center;
  869. font-size: $global-font-size-sm;
  870. color: $global-text-color-white;
  871. }
  872. .status-before {
  873. background-color: #e3b377;
  874. }
  875. .status-progress {
  876. background-color: #3385ff;
  877. }
  878. .status-end {
  879. background-color: #a2a2a2;
  880. }
  881. .top {
  882. padding-top: 64rpx;
  883. padding-left: 30rpx;
  884. padding-right: 30rpx;
  885. padding-bottom: 42rpx;
  886. .avatar {
  887. width: 168rpx;
  888. height: 168rpx;
  889. border-radius: 50%;
  890. margin-right: 30rpx;
  891. flex-shrink: 0;
  892. border: 1px solid $global-border-color;
  893. }
  894. .title {
  895. font-size: $global-font-size-lg;
  896. font-weight: bold;
  897. width: 400rpx;
  898. padding-right: 80rpx;
  899. padding-bottom: 10rpx;
  900. border-bottom: 1px solid $global-border-color;
  901. }
  902. .name {
  903. color: $global-text-color-grey;
  904. margin: 20rpx 0;
  905. }
  906. .time {
  907. font-size: $global-font-size-sm;
  908. color: $global-text-color-999;
  909. }
  910. }
  911. .bot {
  912. border-top: 1px solid $global-border-color;
  913. color: $global-text-color-999;
  914. view {
  915. line-height: 72rpx;
  916. flex: 1;
  917. text-align: center;
  918. border-right: 1px solid $global-border-color;
  919. }
  920. view:last-child {
  921. border: none;
  922. }
  923. .active{
  924. color: #E3B377;
  925. }
  926. }
  927. .content{
  928. width: 420rpx;
  929. position: relative;
  930. .icon-box{
  931. align-items: center;
  932. position: absolute;
  933. right: 0;
  934. top: -10rpx;
  935. font-size: $global-font-size-sm;
  936. color:$global-text-color-main;
  937. width: 100rpx;
  938. height: 70rpx;
  939. justify-content: center;
  940. image{
  941. width: 26rpx;
  942. height: 26rpx;
  943. margin-right: 4rpx;
  944. }
  945. }
  946. }
  947. }
  948. }
  949. </style>