detail.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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="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="flex item" v-for="item in list" :key="item" @click="goDetail(item)">
  24. <image class="img" :src="item.report_img_url" mode="aspectFill"/>
  25. <view class="con">
  26. <view class="title">【第{{item.stage}}期|FICC】{{item.classify_name_second}}</view>
  27. <view class="van-ellipsis tips">摘要:{{item.abstract}}</view>
  28. <view class="time">{{item.publish_time|formatReportTime}}</view>
  29. <view :class="['audio-box',!info.auth_ok&&'grey-audio-box']">
  30. <image src="../static/audio.png" mode="aspectFill"/>
  31. <text>播放</text>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="contact-box" v-if="!info.auth_ok&&!info.permission_check.mobile" @click="handleContact">联系我们</view>
  37. </view>
  38. </template>
  39. <script>
  40. import {apiSpecialColumnDetail,apiSpecialColumnReportList} from '@/api/report'
  41. export default {
  42. data () {
  43. return {
  44. tabActive:'专栏介绍',
  45. columnId:0,
  46. info:null,
  47. list:[],
  48. page:1,
  49. pageSize:20,
  50. finished:false
  51. }
  52. },
  53. onLoad(options) {
  54. this.columnId=options.columnId
  55. this.getDetail()
  56. this.getList()
  57. },
  58. onPullDownRefresh() {
  59. this.getDetail()
  60. this.list=[]
  61. this.page=1
  62. this.finished=false
  63. this.getList()
  64. setTimeout(()=>{
  65. uni.stopPullDownRefresh()
  66. },1500)
  67. },
  68. onReachBottom() {
  69. if(!this.finished&&this.tabActive=='报告目录'){
  70. this.page++
  71. this.getList()
  72. }
  73. },
  74. onShareAppMessage() {
  75. return {
  76. title:this.info.classify_name_second
  77. }
  78. },
  79. methods: {
  80. async getDetail(){
  81. const res=await apiSpecialColumnDetail({classify_id_second:Number(this.columnId)})
  82. if(res.code===200){
  83. this.info=res.data
  84. uni.setNavigationBarTitle({ title: res.data.classify_name_second })
  85. }
  86. },
  87. async getList(){
  88. const res=await apiSpecialColumnReportList({
  89. classify_id_second:Number(this.columnId),
  90. current_index:this.page,
  91. page_size:this.pageSize
  92. })
  93. if(res.code===200){
  94. let arr=res.data.list||[]
  95. this.list=[...this.list,...arr]
  96. if(res.data.paging.is_end){
  97. this.finished=true
  98. }
  99. }
  100. },
  101. tabChange(e){
  102. this.tabActive=e
  103. },
  104. goDetail(item){
  105. uni.navigateTo({ url: '/pages-report/reportDetail?reportId='+item.report_id })
  106. },
  107. handleContact(){
  108. uni.makePhoneCall({
  109. phoneNumber: this.info.permission_check.hz_phone
  110. })
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss">
  116. page{
  117. padding-bottom: 0;
  118. }
  119. </style>
  120. <style lang="scss" scoped>
  121. .special-column-info-page{
  122. .top-bg{
  123. display: block;
  124. width: 100%;
  125. height: 188rpx;
  126. }
  127. .user-wrap{
  128. padding: 0 34rpx;
  129. margin-bottom: 34rpx;
  130. .avatar{
  131. width: 140rpx;
  132. height: 140rpx;
  133. background-color: #f5f5f5;
  134. display: block;
  135. box-sizing: border-box;
  136. border: 4rpx solid #fff;
  137. border-radius: 50%;
  138. margin-top: -70rpx;
  139. }
  140. .user-name{
  141. margin-top: 20rpx;
  142. text:first-child{
  143. font-size: 32rpx;
  144. font-weight: bold;
  145. }
  146. .tag{
  147. background-color: #FAF7EE;
  148. margin-left: 20rpx;
  149. padding: 6rpx 16rpx;
  150. border-radius: 30rpx;
  151. font-size: 24rpx;
  152. display: inline-block;
  153. &::before{
  154. content: '';
  155. display: inline-block;
  156. width: 30rpx;
  157. height: 30rpx;
  158. background-image: url('../static/tag.png');
  159. background-size: cover;
  160. position: relative;
  161. top: 4rpx;
  162. }
  163. }
  164. }
  165. .user-title{
  166. color: #666666;
  167. margin: 20rpx 0;
  168. }
  169. .user-intro{
  170. font-size: 24rpx;
  171. color: #666666;
  172. line-height: 1.5;
  173. }
  174. }
  175. .tab-box{
  176. align-items: center;
  177. height: 78rpx;
  178. background: #FFFFFF;
  179. position: relative;
  180. box-shadow: 0px 4rpx 4rpx 1px rgba(198, 198, 198, 0.16);
  181. .item{
  182. flex: 1;
  183. text-align: center;
  184. font-size: 32rpx;
  185. }
  186. &::after{
  187. content: '';
  188. position: absolute;
  189. display: inline-block;
  190. width: 1rpx;
  191. height: 78rpx;
  192. top: 0;
  193. left: 50%;
  194. background-color: #F6F6F6;
  195. }
  196. .tab-acitve{
  197. color: #E3B377;
  198. }
  199. }
  200. .section{
  201. padding: 34rpx;
  202. line-height: 1.7;
  203. color: #666666;
  204. padding-bottom: 90rpx;
  205. }
  206. .report-list-wrap{
  207. .item{
  208. margin-bottom: 30rpx;
  209. .img{
  210. width: 120rpx;
  211. height: 160rpx;
  212. border-radius: 16rpx;
  213. background-color: #f5f5f5;
  214. flex-shrink: 0;
  215. margin-right: 20rpx;
  216. }
  217. .con{
  218. flex: 1;
  219. position: relative;
  220. overflow: hidden;
  221. .title{
  222. font-size: 32rpx;
  223. font-weight: bold;
  224. margin-bottom: 8rpx;
  225. }
  226. .tips{
  227. color: #666666;
  228. margin-bottom: 10rpx;
  229. }
  230. .time{
  231. color: #666666;
  232. }
  233. .audio-box{
  234. position: absolute;
  235. bottom: 0;
  236. right: 0;
  237. width: 99rpx;
  238. height: 39rpx;
  239. background: linear-gradient(100deg, #E3B377 0%, #FFDDB1 100%);
  240. border-radius: 20rpx;
  241. color: #fff;
  242. font-size: 24rpx;
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. image{
  247. width: 30rpx;
  248. height: 30rpx;
  249. margin-right: 4rpx;
  250. }
  251. }
  252. .grey-audio-box{
  253. background: linear-gradient(114deg, #B0B0B0 0%, #E5E2E2 100%);
  254. }
  255. }
  256. }
  257. }
  258. .contact-box{
  259. position: fixed;
  260. bottom: 0;
  261. left: 0;
  262. right: 0;
  263. height: 80rpx;
  264. background: #E6B77D;
  265. line-height: 80rpx;
  266. text-align: center;
  267. color: #FFFFFF;
  268. font-size: 32rpx;
  269. z-index: 10;
  270. }
  271. }
  272. </style>