list.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <template>
  2. <view class="listDetail">
  3. <uni-menubar title="文章详情" />
  4. <view v-if="info.content" class="detailBox">
  5. <!-- <view v-html="info.content"></view> -->
  6. <view class="title">
  7. {{info.title}}
  8. </view>
  9. <view class="crateTime">{{info.update_time}}</view>
  10. <view class="px-30 mb-20">
  11. <mp-html :content="info.content" />
  12. <view style="display: flex;justify-content: space-between; color: #9e9e9e; font-size:24rpx;margin-top: 15px;">
  13. <view>阅读 {{info.show_views}}</view>
  14. <view> {{info.track_count}}人分享</view>
  15. </view>
  16. <view style="margin-top: 15px;display: flex;justify-content: flex-end;">
  17. <tm-button :width="107" theme="blue" titl icon="icon-reply" openType="share">分享</tm-button>
  18. </view>
  19. </view>
  20. <view>
  21. <tm-sheet color="bg-gradient-blue-accent">
  22. <view class="cardRow">
  23. <view class="flexLeft">
  24. <tm-avatar size="120" titl :round="5" :src="cardInfo.picture">
  25. </tm-avatar>
  26. </view>
  27. <view class="flexRight">
  28. <view class="nameRow">
  29. <view class="name">{{cardInfo.name}}</view>
  30. <view @click="goCardDetail(cardInfo.id)">查看名片 <tm-icons color="gray"
  31. name="icon-angle-right" :size="20"></tm-icons>
  32. </view>
  33. </view>
  34. <view class="post">{{cardInfo.title}}</view>
  35. </view>
  36. </view>
  37. <view style="margin-top: 15px;">
  38. <view class="span">
  39. 公司:{{cardInfo.company}}
  40. </view>
  41. <view class="span">
  42. 微信号:{{cardInfo.wx}}
  43. </view>
  44. <view class="span">
  45. 手机号:{{cardInfo.mobile}}
  46. </view>
  47. </view>
  48. </tm-sheet>
  49. </view>
  50. <!-- 推荐文章 -->
  51. <view>
  52. <view style="font-size: 34rpx;font-weight: 600;" class="px-30">推荐文章</view>
  53. <view>
  54. <view class='art-coin'>
  55. <block v-for="(item,index) in list" :key="index">
  56. <view class='art-act' @click="goDetail(item.id)">
  57. <view class="art-act-imgAndTitle">
  58. <image v-if="item.pic" class='art-act-l' mode='aspectFill' :src='item.pic'></image>
  59. <view class="art-act-titleAndTime">
  60. <view class='act-act-rname'>{{ item.title }}</view>
  61. <view class="art-act-time">{{item.create_time}}</view>
  62. </view>
  63. </view>
  64. <view class='act-art-rinfo'>
  65. <view class='act-act-rsort'>{{ item.name }}</view>
  66. <view class='act-act-rbrowsing'>
  67. <view class='act-act-rlook'>
  68. {{ item.show_views > 0 ? item.show_views : item.views }}查看
  69. </view>
  70. <view class='act-act-rrelay'>{{ item.track_count }}转发</view>
  71. </view>
  72. </view>
  73. </view>
  74. </block>
  75. </view>
  76. </view>
  77. </view>
  78. <view style="height: 50px;"></view>
  79. </view>
  80. <!-- <tm-empty v-else icon="icon-cry-fill" label="内容消失了~"></tm-empty> -->
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. data() {
  86. return {
  87. info: {},
  88. cate_id: "",
  89. card_id: "",
  90. cardInfo: {},
  91. list: []
  92. }
  93. },
  94. onLoad(option) {
  95. if (option) {
  96. this.cate_id = option.id
  97. this.card_id = option.card_id
  98. if (option.card_id) {
  99. this.$tm.request.post('card/viewread', {
  100. card_id: option.card_id
  101. }).then(res => {
  102. this.cardInfo = res.data.card
  103. })
  104. }
  105. this.$tm.vx.commit('card/cardId', option.card_id)
  106. this.getDetail(option.id)
  107. this.$point.point(1, option.id, option.card_id)
  108. }
  109. },
  110. onShareAppMessage(res) {
  111. return {
  112. title: this.info.title,
  113. path: '/pages/list/list?id=' + this.cate_id + "&card_id=" + this.card_id,
  114. imageUrl:this.info.pic,
  115. success: () => {
  116. this.$point.point(2, this.cate_id, this.card_id)
  117. }
  118. }
  119. },
  120. computed: {
  121. userInfo() {
  122. return this.$tm.vx.state().user.userInfo || {}
  123. },
  124. },
  125. methods: {
  126. // 获取文章详情
  127. getDetail(id) {
  128. let params = {
  129. id: id
  130. }
  131. params.card_id = this.card_id
  132. this.$tm.request.post('art/detail', params).then(res => {
  133. this.info = res.data.detail
  134. this.list = res.data.list
  135. })
  136. },
  137. goCardDetail(card_id) {
  138. uni.navigateTo({
  139. url: '/pages/index/detail?card_id=' + card_id
  140. })
  141. },
  142. goDetail(id) {
  143. uni.navigateTo({
  144. url: '/pages/list/list?id=' + id + "&card_id=" + uni.getStorageSync('card_id')
  145. })
  146. }
  147. }
  148. }
  149. </script>
  150. <style scoped lang="scss">
  151. .listDetail {
  152. background-color: #fff;
  153. }
  154. .title {
  155. font-size: 38rpx;
  156. font-weight: 600;
  157. padding: 20px;
  158. }
  159. .crateTime {
  160. padding-left: 20px;
  161. color: #9E9E9E;
  162. margin-bottom: 20px;
  163. }
  164. .cardRow {
  165. display: flex;
  166. flex-direction: row;
  167. // justify-content: center;
  168. // align-items: center;
  169. .flexLeft {
  170. margin-right: 15px;
  171. }
  172. .flexRight {
  173. flex: 1;
  174. .nameRow {
  175. display: flex;
  176. flex-direction: row;
  177. justify-content: space-between;
  178. align-items: center;
  179. font-size: 22rpx;
  180. // color: #9E9E9E;
  181. .name {
  182. // color: #000;
  183. font-size: 34rpx;
  184. // font-weight: bold;
  185. }
  186. }
  187. .post {
  188. font-size: 32rpx;
  189. // color: #9E9E9E;
  190. margin-top: 20rpx;
  191. }
  192. }
  193. }
  194. .span {
  195. // color: #2196F3;
  196. font-size: 28rpx;
  197. margin-top: 10rpx;
  198. }
  199. .art-act {
  200. display: flex;
  201. flex-direction: column;
  202. justify-content: flex-start;
  203. margin: 1rem 20rpx 0 20rpx;
  204. box-shadow: 0px 1px 5px #EEEEEE;
  205. border-radius: 5px;
  206. background: #fff;
  207. }
  208. /* .art-act:last-child{
  209. border-bottom: 0;
  210. } */
  211. .art-act-time {
  212. font-size: 24rpx;
  213. color: #aaa;
  214. margin-top: 3vw;
  215. }
  216. .art-act-imgAndTitle {
  217. display: flex;
  218. flex-direction: row-reverse;
  219. align-items: center;
  220. justify-content: space-between;
  221. padding: 3vw 0;
  222. margin: 0 3vw;
  223. border-bottom: 1px solid #eee;
  224. }
  225. .art-act-titleAndTime {
  226. display: flex;
  227. flex-direction: column;
  228. flex: 1;
  229. justify-content: space-between;
  230. }
  231. .art-act-l {
  232. width: 250rpx;
  233. height: 150rpx;
  234. margin-left: 3vw;
  235. }
  236. .act-act-rname {
  237. font-size: 30rpx;
  238. font-weight: 530;
  239. display: -webkit-box;
  240. -webkit-box-orient: vertical;
  241. -webkit-line-clamp: 2;
  242. overflow: hidden;
  243. word-break: break-all;
  244. flex: 1;
  245. }
  246. .act-art-rinfo {
  247. display: flex;
  248. flex-direction: row-reverse;
  249. align-items: center;
  250. justify-content: space-between;
  251. font-size: 26rpx;
  252. color: #888888;
  253. padding: 4vw 0;
  254. margin: 0 3vw;
  255. }
  256. .act-act-rsort {
  257. /*color: #fff;
  258. padding: 6rpx 20rpx;
  259. background: #00a1e9;
  260. border-radius: 2px;*/
  261. }
  262. .act-act-rbrowsing {
  263. display: flex;
  264. align-items: center;
  265. }
  266. .act-act-rrelay {
  267. margin-left: 20rpx;
  268. }
  269. /*底部tabbar*/
  270. .blank {
  271. height: 126rpx;
  272. }
  273. .art-tabbar {
  274. width: 100%;
  275. height: 120rpx;
  276. position: fixed;
  277. bottom: 0;
  278. z-index: 99;
  279. display: flex;
  280. justify-content: center;
  281. }
  282. .art-tabbar view {
  283. width: 100rpx;
  284. height: 100rpx;
  285. border-radius: 50%;
  286. border: 1px solid #eeeeee;
  287. position: absolute;
  288. top: -34rpx;
  289. background-color: #ffffff;
  290. }
  291. .art-bar {
  292. position: fixed;
  293. display: flex;
  294. align-items: center;
  295. width: 100%;
  296. bottom: 0;
  297. border-top: 1px solid #eeeeee;
  298. z-index: 100;
  299. background-color: #ffffff;
  300. }
  301. .art-bar-act {
  302. flex: 1;
  303. display: flex;
  304. flex-flow: column;
  305. align-items: center;
  306. height: 120rpx;
  307. justify-content: flex-end;
  308. }
  309. /* .art-tabbar-on{
  310. color:#55b537;
  311. } */
  312. .art-bar-act text {
  313. font-size: 50rpx;
  314. line-height: 50rpx;
  315. }
  316. .art-bar-act view {
  317. font-size: 24rpx;
  318. margin: 10rpx 0;
  319. }
  320. .art-bar-among {
  321. flex: 1;
  322. height: 120rpx;
  323. display: flex;
  324. justify-content: center;
  325. position: relative;
  326. }
  327. .art-bar-pic {
  328. position: absolute;
  329. font-size: 100rpx;
  330. top: -30rpx;
  331. line-height: 100rpx;
  332. /* border:1px solid #eeeeee; */
  333. border-radius: 50%;
  334. background-color: #ffffff;
  335. }
  336. .art-bar-tit {
  337. font-size: 24rpx;
  338. position: absolute;
  339. bottom: 10rpx;
  340. }
  341. .art-bar-act image {
  342. width: 50rpx;
  343. }
  344. .art-bar-among image {
  345. position: absolute;
  346. width: 100rpx;
  347. height: 100rpx;
  348. border-radius: 50%;
  349. background-color: #ffffff;
  350. top: -26rpx;
  351. }
  352. </style>