detail.vue 10 KB

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