detail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. <template>
  2. <view class="special-column-info-page">
  3. <image class="top-bg" src="../static/bg-1.png" mode="aspectFill"/>
  4. <view class="user-wrap" v-if="info">
  5. <image :src="info.avatar_img_url" mode="aspectFill" class="avatar"/>
  6. <view class="user-name">
  7. <text>{{info.report_author}}</text>
  8. <text class="tag" v-if="info.vip_title">{{info.vip_title}}</text>
  9. </view>
  10. <view class="user-title">{{info.author_descript}}</view>
  11. <view class="user-intro">{{info.abstract}}</view>
  12. </view>
  13. <van-sticky>
  14. <view class="flex tab-box">
  15. <view :class="['item',tabActive=='专栏介绍'&&'tab-acitve']" @click="tabChange('专栏介绍')">专栏介绍</view>
  16. <view :class="['item',tabActive=='报告目录'&&'tab-acitve']" @click="tabChange('报告目录')">报告目录</view>
  17. </view>
  18. </van-sticky>
  19. <view class="section column-intro-wrap" v-if="tabActive=='专栏介绍'">
  20. <view v-html="info.descript"></view>
  21. </view>
  22. <view class="section report-list-wrap" v-if="tabActive=='报告目录'">
  23. <view class="report-empty-box" v-if="finished&&list.length==0">
  24. <image :src="globalImgUrls.chartEmpty" mode="widthFix" />
  25. <view>暂无数据</view>
  26. </view>
  27. <block v-else>
  28. <view class="flex item" v-for="item in list" :key="item" @click="goDetail(item)">
  29. <image class="img" :src="item.report_img_url" mode="aspectFill" lazy-load/>
  30. <view class="con">
  31. <view class="title">【第{{item.stage}}期|FICC】{{item.classify_name_second}}</view>
  32. <view class="tips" v-html="item.abstract"></view>
  33. <view class="time">{{item.publish_time|formatReportTime}}</view>
  34. <view :class="['audio-box',!info.auth_ok&&'grey-audio-box']" @click.stop="handleClickAudio(item)">
  35. <image :src="curAudioReportId==item.report_id&&!curAudioPaused?'../static/audio-s.png':'../static/audio.png'" mode="aspectFill"/>
  36. <text>{{curAudioReportId==item.report_id&&!curAudioPaused?'暂停':'播放'}}</text>
  37. </view>
  38. </view>
  39. </view>
  40. </block>
  41. </view>
  42. <view class="contact-box" v-if="info&&!info.auth_ok&&!info.permission_check.mobile" @click="handleContact">联系我们</view>
  43. <!-- 音频弹窗 -->
  44. <audioBox v-if="showAudioPop"></audioBox>
  45. </view>
  46. </template>
  47. <script>
  48. import {apiSpecialColumnDetail,apiSpecialColumnReportList} from '@/api/report'
  49. import audioBox from '../components/audioBox.vue'
  50. export default {
  51. computed: {
  52. showAudioPop(){//是否显示音频弹窗
  53. return this.$store.state.report.audioData.show
  54. },
  55. curAudioReportId(){//当前播放的音频所属报告
  56. return this.$store.state.report.audioData.reportId
  57. },
  58. curAudioPaused(){//当前音频是否暂停状态
  59. return this.$store.state.report.audioData.paused
  60. }
  61. },
  62. components: {
  63. audioBox
  64. },
  65. data () {
  66. return {
  67. tabActive:'专栏介绍',
  68. columnId:0,
  69. info:null,
  70. list:[],
  71. page:1,
  72. pageSize:20,
  73. finished:false
  74. }
  75. },
  76. onLoad(options) {
  77. this.columnId=options.columnId
  78. this.getDetail()
  79. this.getList()
  80. },
  81. onPullDownRefresh() {
  82. this.getDetail()
  83. this.list=[]
  84. this.page=1
  85. this.finished=false
  86. this.getList()
  87. setTimeout(()=>{
  88. uni.stopPullDownRefresh()
  89. },1500)
  90. },
  91. onReachBottom() {
  92. if(!this.finished&&this.tabActive=='报告目录'){
  93. this.page++
  94. this.getList()
  95. }
  96. },
  97. onShareAppMessage() {
  98. return {
  99. title:this.info.classify_name_second
  100. }
  101. },
  102. methods: {
  103. async getDetail(){
  104. const res=await apiSpecialColumnDetail({classify_id_second:Number(this.columnId)})
  105. if(res.code===200){
  106. this.info=res.data
  107. uni.setNavigationBarTitle({ title: res.data.classify_name_second })
  108. }
  109. },
  110. async getList(){
  111. const res=await apiSpecialColumnReportList({
  112. classify_id_second:Number(this.columnId),
  113. current_index:this.page,
  114. page_size:this.pageSize
  115. })
  116. if(res.code===200){
  117. let arr=res.data.list||[]
  118. this.list=[...this.list,...arr]
  119. if(res.data.paging.is_end){
  120. this.finished=true
  121. }
  122. }
  123. },
  124. tabChange(e){
  125. this.tabActive=e
  126. },
  127. goDetail(item){
  128. uni.navigateTo({ url: '/pages-report/reportDetail?reportId='+item.report_id })
  129. },
  130. handleContact(){
  131. uni.makePhoneCall({
  132. phoneNumber: this.info.permission_check.hz_phone
  133. })
  134. },
  135. handleClickAudio(item){
  136. if(!this.info.auth_ok) return
  137. if(!item.video_url){
  138. uni.showToast({
  139. title: '暂无音频',
  140. icon: 'none'
  141. })
  142. return
  143. }
  144. // 判断是否为同一个音频
  145. if(this.$store.state.report.audioData.reportId==item.report_id){
  146. if(this.globalBgMusic.paused){
  147. this.globalBgMusic.play()
  148. }else{
  149. this.globalBgMusic.pause()
  150. }
  151. }else{
  152. this.$store.commit('addAudio', {
  153. list:[{video_url:item.video_url,video_name:item.video_name,video_play_seconds:item.video_play_seconds}],
  154. reportId:item.report_id
  155. })
  156. }
  157. }
  158. }
  159. }
  160. </script>
  161. <style lang="scss">
  162. page{
  163. padding-bottom: 0;
  164. }
  165. </style>
  166. <style lang="scss" scoped>
  167. .special-column-info-page{
  168. .top-bg{
  169. display: block;
  170. width: 100%;
  171. height: 188rpx;
  172. }
  173. .user-wrap{
  174. padding: 0 34rpx;
  175. margin-bottom: 34rpx;
  176. .avatar{
  177. width: 140rpx;
  178. height: 140rpx;
  179. background-color: #f5f5f5;
  180. display: block;
  181. box-sizing: border-box;
  182. border: 4rpx solid #fff;
  183. border-radius: 50%;
  184. margin-top: -70rpx;
  185. }
  186. .user-name{
  187. margin-top: 20rpx;
  188. text:first-child{
  189. font-size: 32rpx;
  190. font-weight: bold;
  191. }
  192. .tag{
  193. background-color: #FAF7EE;
  194. margin-left: 20rpx;
  195. padding: 6rpx 16rpx;
  196. border-radius: 30rpx;
  197. font-size: 24rpx;
  198. display: inline-block;
  199. &::before{
  200. content: '';
  201. display: inline-block;
  202. width: 30rpx;
  203. height: 30rpx;
  204. background-image: url('../static/tag.png');
  205. background-size: cover;
  206. position: relative;
  207. top: 4rpx;
  208. }
  209. }
  210. }
  211. .user-title{
  212. color: #666666;
  213. margin: 20rpx 0;
  214. }
  215. .user-intro{
  216. font-size: 24rpx;
  217. color: #666666;
  218. line-height: 1.7;
  219. }
  220. }
  221. .tab-box{
  222. align-items: center;
  223. height: 78rpx;
  224. background: #FFFFFF;
  225. position: relative;
  226. box-shadow: 0px 4rpx 4rpx 1px rgba(198, 198, 198, 0.16);
  227. .item{
  228. flex: 1;
  229. text-align: center;
  230. font-size: 32rpx;
  231. }
  232. &::after{
  233. content: '';
  234. position: absolute;
  235. display: inline-block;
  236. width: 1rpx;
  237. height: 78rpx;
  238. top: 0;
  239. left: 50%;
  240. background-color: #F6F6F6;
  241. }
  242. .tab-acitve{
  243. color: #E3B377;
  244. }
  245. }
  246. .section{
  247. padding: 34rpx;
  248. line-height: 1.7;
  249. color: #666666;
  250. padding-bottom: 90rpx;
  251. }
  252. .report-list-wrap{
  253. .item{
  254. margin-bottom: 30rpx;
  255. .img{
  256. width: 120rpx;
  257. height: 160rpx;
  258. border-radius: 16rpx;
  259. background-color: #f5f5f5;
  260. flex-shrink: 0;
  261. margin-right: 20rpx;
  262. }
  263. .con{
  264. flex: 1;
  265. position: relative;
  266. overflow: hidden;
  267. .title{
  268. font-size: 32rpx;
  269. font-weight: bold;
  270. margin-bottom: 8rpx;
  271. }
  272. .tips{
  273. color: #666666;
  274. margin-bottom: 10rpx;
  275. min-height: 38rpx;
  276. }
  277. .time{
  278. color: #666666;
  279. }
  280. .audio-box{
  281. position: absolute;
  282. bottom: 0;
  283. right: 0;
  284. width: 99rpx;
  285. height: 39rpx;
  286. background: linear-gradient(100deg, #E3B377 0%, #FFDDB1 100%);
  287. border-radius: 20rpx;
  288. color: #fff;
  289. font-size: 24rpx;
  290. display: flex;
  291. justify-content: center;
  292. align-items: center;
  293. image{
  294. width: 30rpx;
  295. height: 30rpx;
  296. margin-right: 4rpx;
  297. }
  298. }
  299. .grey-audio-box{
  300. background: linear-gradient(114deg, #B0B0B0 0%, #E5E2E2 100%);
  301. }
  302. }
  303. }
  304. }
  305. .contact-box{
  306. position: fixed;
  307. bottom: 0;
  308. left: 0;
  309. right: 0;
  310. height: 80rpx;
  311. background: #E6B77D;
  312. line-height: 80rpx;
  313. text-align: center;
  314. color: #FFFFFF;
  315. font-size: 32rpx;
  316. z-index: 10;
  317. }
  318. }
  319. </style>