detail.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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. methods: {
  75. async getDetail(){
  76. const res=await apiSpecialColumnDetail({classify_id_second:Number(this.columnId)})
  77. if(res.code===200){
  78. this.info=res.data
  79. uni.setNavigationBarTitle({ title: res.data.classify_name_second })
  80. }
  81. },
  82. async getList(){
  83. const res=await apiSpecialColumnReportList({
  84. classify_id_second:Number(this.columnId),
  85. current_index:this.page,
  86. page_size:this.pageSize
  87. })
  88. if(res.code===200){
  89. let arr=res.data.list||[]
  90. this.list=[...this.list,...arr]
  91. if(res.data.paging.is_end){
  92. this.finished=true
  93. }
  94. }
  95. },
  96. tabChange(e){
  97. this.tabActive=e
  98. },
  99. goDetail(item){
  100. uni.navigateTo({ url: '/pages-report/reportDetail?reportId='+item.report_id })
  101. },
  102. handleContact(){
  103. uni.makePhoneCall({
  104. phoneNumber: this.info.permission_check.hz_phone
  105. })
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss">
  111. page{
  112. padding-bottom: 0;
  113. }
  114. </style>
  115. <style lang="scss" scoped>
  116. .special-column-info-page{
  117. .top-bg{
  118. display: block;
  119. width: 100%;
  120. height: 188rpx;
  121. }
  122. .user-wrap{
  123. padding: 0 34rpx;
  124. margin-bottom: 34rpx;
  125. .avatar{
  126. width: 140rpx;
  127. height: 140rpx;
  128. background-color: #f5f5f5;
  129. display: block;
  130. box-sizing: border-box;
  131. border: 4rpx solid #fff;
  132. border-radius: 50%;
  133. margin-top: -70rpx;
  134. }
  135. .user-name{
  136. margin-top: 20rpx;
  137. text:first-child{
  138. font-size: 32rpx;
  139. font-weight: bold;
  140. }
  141. .tag{
  142. background-color: #FAF7EE;
  143. margin-left: 20rpx;
  144. padding: 6rpx 16rpx;
  145. border-radius: 30rpx;
  146. font-size: 24rpx;
  147. display: inline-block;
  148. &::before{
  149. content: '';
  150. display: inline-block;
  151. width: 30rpx;
  152. height: 30rpx;
  153. background-image: url('../static/tag.png');
  154. background-size: cover;
  155. position: relative;
  156. top: 4rpx;
  157. }
  158. }
  159. }
  160. .user-title{
  161. color: #666666;
  162. margin: 20rpx 0;
  163. }
  164. .user-intro{
  165. font-size: 24rpx;
  166. color: #666666;
  167. line-height: 1.5;
  168. }
  169. }
  170. .tab-box{
  171. align-items: center;
  172. height: 78rpx;
  173. background: #FFFFFF;
  174. position: relative;
  175. box-shadow: 0px 4rpx 4rpx 1px rgba(198, 198, 198, 0.16);
  176. .item{
  177. flex: 1;
  178. text-align: center;
  179. font-size: 32rpx;
  180. }
  181. &::after{
  182. content: '';
  183. position: absolute;
  184. display: inline-block;
  185. width: 1rpx;
  186. height: 78rpx;
  187. top: 0;
  188. left: 50%;
  189. background-color: #F6F6F6;
  190. }
  191. .tab-acitve{
  192. color: #E3B377;
  193. }
  194. }
  195. .section{
  196. padding: 34rpx;
  197. line-height: 1.7;
  198. color: #666666;
  199. padding-bottom: 90rpx;
  200. }
  201. .report-list-wrap{
  202. .item{
  203. margin-bottom: 30rpx;
  204. .img{
  205. width: 120rpx;
  206. height: 160rpx;
  207. border-radius: 16rpx;
  208. background-color: #f5f5f5;
  209. flex-shrink: 0;
  210. margin-right: 20rpx;
  211. }
  212. .con{
  213. flex: 1;
  214. position: relative;
  215. overflow: hidden;
  216. .title{
  217. font-size: 32rpx;
  218. font-weight: bold;
  219. margin-bottom: 8rpx;
  220. }
  221. .tips{
  222. color: #666666;
  223. margin-bottom: 10rpx;
  224. }
  225. .time{
  226. color: #666666;
  227. }
  228. .audio-box{
  229. position: absolute;
  230. bottom: 0;
  231. right: 0;
  232. width: 99rpx;
  233. height: 39rpx;
  234. background: linear-gradient(100deg, #E3B377 0%, #FFDDB1 100%);
  235. border-radius: 20rpx;
  236. color: #fff;
  237. font-size: 24rpx;
  238. display: flex;
  239. justify-content: center;
  240. align-items: center;
  241. image{
  242. width: 30rpx;
  243. height: 30rpx;
  244. margin-right: 4rpx;
  245. }
  246. }
  247. .grey-audio-box{
  248. background: linear-gradient(114deg, #B0B0B0 0%, #E5E2E2 100%);
  249. }
  250. }
  251. }
  252. }
  253. .contact-box{
  254. position: fixed;
  255. bottom: 0;
  256. left: 0;
  257. right: 0;
  258. height: 80rpx;
  259. background: #E6B77D;
  260. line-height: 80rpx;
  261. text-align: center;
  262. color: #FFFFFF;
  263. font-size: 32rpx;
  264. z-index: 10;
  265. }
  266. }
  267. </style>