detail.vue 10 KB

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