detail.vue 11 KB

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