detail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <view class="activity-detail" v-if="info">
  3. <view class="top-wrap" :style="'background-image:url('+info.speakerBackgroundPic+')'">
  4. <view class="status status-before" v-if="info.activityState===1">未开始</view>
  5. <view class="status status-before" v-if="info.activityState===2">进行中</view>
  6. <view class="status status-before" v-if="info.activityState===3">已结束</view>
  7. <view class="title">{{info.activityTypeName}}</view>
  8. <view class="name">主讲人:{{info.speaker}}</view>
  9. <view class="time">活动时间:{{info.startTime| formatActivityTime(info.endTime)}}</view>
  10. <view class="flex city" v-if="info.activityTypeId===3">
  11. <image src="./static/position.png" model="aspectFill"></image>
  12. <text>{{info.city}}</text>
  13. </view>
  14. </view>
  15. <view class="intro-wrap">{{info.activityName}}</view>
  16. <view class="info-wrap" v-if="info.activityState!==3">
  17. <view class="flex item" v-for="item in infoList" :key="item.label" @click="handleClickInfoItem(item)">
  18. <view class="label">{{item.label}}:</view>
  19. <view :class="['content',item.color&&'yellow-color']">{{item.text}}</view>
  20. </view>
  21. </view>
  22. <!-- 音频 -->
  23. <view class="audio-wrap" v-if="info.activityState===3">
  24. <view class="audio-item" v-for="item in audioList" :key="item.voiceUrl">
  25. <image class="icon" src="./static/audio-play.png" model="aspectFill"></image>
  26. <view class="name">{{item.voiceName}}</view>
  27. <view class="time">{{item.voicePlaySeconds}}</view>
  28. </view>
  29. </view>
  30. <!-- 报告链接 -->
  31. <view class="info-wrap" v-if="info.reportLink">
  32. <view class="flex item" @click="handleOpenReport">
  33. <view class="label">相关报告:</view>
  34. <view class="yellow-color">查看报告链接</view>
  35. </view>
  36. </view>
  37. <view class="btn-wrap" v-if="info.activityState===1">
  38. <view class="global-btn-yellow-change btn">报名线下参会(15/20)</view>
  39. <view class="global-btn-yellow-change btn">会议提醒</view>
  40. <p class="tips">(会前15分钟推送微信消息提醒)</p>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. // 活动详情
  46. import {apiActivityDetail,apiActivityAudios} from '@/api/activity'
  47. export default {
  48. name: "ActivityDetail",
  49. data() {
  50. return {
  51. id: 0, //活动id
  52. infoList:[],
  53. info:null,
  54. audioList:[],//音频数据
  55. };
  56. },
  57. onLoad(options) {
  58. this.id = options.id;
  59. this.getDetail()
  60. // setTimeout(()=>{
  61. // uni.redirectTo({
  62. // url: '/pages-activity/noAuthority'
  63. // });
  64. // },2000)
  65. },
  66. methods: {
  67. async getDetail(){
  68. const res=await apiActivityDetail({activity_id:Number(this.id)})
  69. // 无权限
  70. if(res.code===403){
  71. return
  72. }
  73. if(res.code===200){
  74. this.info=res.data
  75. // 线上会议
  76. if(res.data.activityTypeId===1){
  77. this.infoList=[
  78. {
  79. label:'大陆拨号',
  80. text:res.data.mainlandTel,
  81. color:'yellow',
  82. type:'tel'
  83. },
  84. {
  85. label:'新加坡拨入',
  86. text:res.data.singaporeTel,
  87. color:'yellow',
  88. type:'tel'
  89. },
  90. {
  91. label:'香港拨入',
  92. text:res.data.hongKongTel,
  93. color:'yellow',
  94. type:'tel'
  95. },
  96. {
  97. label:'台湾拨入',
  98. text:res.data.taiwanTel,
  99. color:'yellow',
  100. type:'tel'
  101. },
  102. {
  103. label:'美国拨入',
  104. text:res.data.americaTel,
  105. color:'yellow',
  106. type:'tel'
  107. },
  108. {
  109. label:'拨入密码',
  110. text:res.data.participationCode
  111. },
  112. ]
  113. }
  114. if(res.data.activityState===3){
  115. this.getAudios()
  116. }
  117. }
  118. },
  119. // 获取活动音频
  120. async getAudios(){
  121. const res=await apiActivityAudios({activity_id:Number(this.id)})
  122. if(res.code===200){
  123. this.audioList=res.data
  124. }
  125. },
  126. // 点击信息项
  127. handleClickInfoItem(e){
  128. if(e.type==='tel'&&e.text){
  129. uni.makePhoneCall({
  130. phoneNumber: e.text
  131. });
  132. }
  133. },
  134. // 跳转webview 打开报告
  135. handleOpenReport(){
  136. uni.navigateTo({
  137. url:'/pages/webView?url='+this.info.reportLink
  138. })
  139. }
  140. }
  141. };
  142. </script>
  143. <style lang="scss">
  144. .top-wrap {
  145. width: 100%;
  146. height: 370rpx;
  147. background: linear-gradient(312deg, rgba(0, 0, 0, 0.8) 0%, rgba(43, 43, 43, 0.8) 100%);
  148. color: $global-text-color-white;
  149. padding-top: 144rpx;
  150. padding-left: 40rpx;
  151. padding-right: 40rpx;
  152. background-size: cover;
  153. background-repeat: no-repeat;
  154. position: relative;
  155. .status {
  156. position: absolute;
  157. top: 0;
  158. left: 0;
  159. width: 116rpx;
  160. line-height: 44rpx;
  161. border-radius: 0px 0px 16rpx 0px;
  162. color: $global-text-color-white;
  163. text-align: center;
  164. font-size: $global-font-size-sm;
  165. }
  166. .status-before {
  167. background-color: #e3b377;
  168. }
  169. .status-progress {
  170. background-color: #3385ff;
  171. }
  172. .status-end {
  173. background-color: #a2a2a2;
  174. }
  175. .title {
  176. font-size: 17px;
  177. font-weight: bold;
  178. }
  179. .name {
  180. margin-top: 15rpx;
  181. margin-bottom: 40rpx;
  182. }
  183. .time {
  184. opacity: 0.8;
  185. font-size: $global-font-size-sm;
  186. }
  187. .city{
  188. font-size: $global-font-size-sm;
  189. align-items: center;
  190. position: absolute;
  191. right: 40rpx;
  192. bottom: 59rpx;
  193. image{
  194. width: 32rpx;
  195. height: 32rpx;
  196. }
  197. }
  198. }
  199. .intro-wrap{
  200. background-color: #fff;
  201. box-shadow: 0px 3px 12px rgba(196, 196, 196, 0.16);
  202. font-size: $global-font-size-lg;
  203. font-weight: bold;
  204. padding: 28rpx 34rpx;
  205. }
  206. .info-wrap{
  207. padding: 30rpx 34rpx;
  208. .item{
  209. margin-bottom: 30rpx;
  210. .label{
  211. flex-shrink: 0;
  212. }
  213. }
  214. .yellow-color{
  215. color: $global-text-color-main;
  216. }
  217. }
  218. .audio-wrap{
  219. .audio-item{
  220. padding: 36rpx 34rpx;
  221. border-bottom: 1px solid $global-border-color;
  222. position: relative;
  223. .icon{
  224. position: absolute;
  225. top: 50%;
  226. transform: translateY(-50%);
  227. right: 45rpx;
  228. width: 48rpx;
  229. height: 48rpx;
  230. }
  231. .name{
  232. margin-bottom: 10rpx;
  233. }
  234. .time{
  235. font-size: $global-font-size-mini;
  236. }
  237. }
  238. }
  239. .btn-wrap{
  240. .btn{
  241. width: 380rpx;
  242. line-height: 70rpx;
  243. margin-left: auto;
  244. margin-right: auto;
  245. margin-top: 40rpx;
  246. }
  247. .tips{
  248. font-size: $global-font-size-sm;
  249. color: $global-text-color-999;
  250. text-align: center;
  251. }
  252. }
  253. </style>