articles.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <view class="article" v-if="articleMsg">
  3. <!-- <navbar :config="config"></navbar> -->
  4. <view class="title">
  5. {{ articleMsg.title }}
  6. </view>
  7. <view class="image-time">
  8. <image src="@/static/alipay.png" mode=""></image>
  9. <view class="time">
  10. {{ articleMsg.update_time }}
  11. </view>
  12. </view>
  13. <view class="text">
  14. <view class="item" v-if="articleMsg.article_type == 0">
  15. <jyf-parser
  16. :html="$mUtil.formatRichText(articleMsg.content)"
  17. ref="article"
  18. ></jyf-parser>
  19. </view>
  20. <view class="item" v-if="articleMsg.article_type == 1">
  21. <video :src="articleMsg.video_url" style="width: 100%"></video>
  22. </view>
  23. <view class="option">
  24. <view class="good">
  25. <image src="@/static/good.png" mode=""></image>
  26. <view class="num">
  27. {{ articleMsg.init_like_num }}
  28. </view>
  29. </view>
  30. <view class="message">
  31. <image src="@/static/message.png" mode=""></image>
  32. <view class="num">
  33. {{ articleMsg.comment_sum }}
  34. </view>
  35. </view>
  36. <view class="link">
  37. <image src="@/static/link.png" mode=""></image>
  38. <view class="num">
  39. {{ articleMsg.init_share_num }}
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="bottom-btn u-bg-fff">
  45. <view class="pt-pb30 u-plr30 u-flex-center-sb">
  46. <view class="u-flex-center">
  47. <button class="buy-btn u-DCCDA4 u-font30" @click="open(0)">
  48. 查看更多
  49. </button> <button class="buy-btn u-DCCDA4 u-font30" @click="open(1)">
  50. 下载App
  51. </button>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. config: {
  62. back: true, //false是tolbar页面 是则不写
  63. title: "文章详情",
  64. color: "#fff",
  65. switchnextstep: true, //切换底部样式
  66. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  67. backgroundColor: [1, "#00321E"],
  68. statusBarFontColor: "#ffffff",
  69. },
  70. articleMsg: null,
  71. };
  72. },
  73. props: {
  74. options: {
  75. type: Object,
  76. default: null,
  77. },
  78. },
  79. watch: {
  80. options(n) {
  81. this.options = n;
  82. },
  83. },
  84. created() {
  85. this.getActicle(this.options.id);
  86. },
  87. methods: {
  88. open(number) {
  89. if(number==0){
  90. window.location.href = "lida://&pageType=2&type=" + this.type + "&id=" + this.articleMsg.id+"&shareId="+this.options.shareId;
  91. // "lida://
  92. }else{
  93. uni.navigateTo({
  94. url:"/pages/down"
  95. })
  96. }
  97. },
  98. getActicle(id) {
  99. this.$http.get("/bbs/article/info/" + id).then((res) => {
  100. if (res && res.code == 200) {
  101. this.articleMsg = res.data;
  102. }
  103. });
  104. },
  105. },
  106. };
  107. </script>
  108. <style lang="scss" scoped>
  109. .bottom-btn .buy-btn{
  110. width: 340px;
  111. height: 42px;
  112. line-height: 42px;
  113. background: #00321e;
  114. border-radius: 21px;
  115. }
  116. .show-bottom {
  117. background-color: #ffffff;
  118. border-radius: 50rpx 50rpx 0 0;
  119. padding: 37rpx 30rpx 22rpx 30rpx;
  120. .input {
  121. .texterea-item {
  122. background-color: #fafafa;
  123. padding: 22rpx 20rpx;
  124. border-radius: 21rpx;
  125. margin: 22rpx 29rpx 4rpx 30rpx;
  126. }
  127. }
  128. .top {
  129. display: flex;
  130. align-items: center;
  131. .line {
  132. width: 6rpx;
  133. height: 26rpx;
  134. background-color: #00321e;
  135. border-radius: 3rpx;
  136. }
  137. .item {
  138. font-size: 36rpx;
  139. color: #1a1a1a;
  140. font-weight: 700;
  141. margin-left: 14rpx;
  142. flex: 1;
  143. }
  144. .deter-mine {
  145. font-size: 30rpx;
  146. font-weight: 500;
  147. color: #1a1a1a;
  148. }
  149. }
  150. }
  151. .selected {
  152. padding: 0 32rpx;
  153. .item {
  154. display: flex;
  155. margin-top: 30rpx;
  156. // align-items: center;
  157. .personal {
  158. margin-left: 18rpx;
  159. .top-title {
  160. font-size: 28rpx;
  161. font-weight: 400;
  162. color: #1a1a1a;
  163. }
  164. .time {
  165. font-size: 24rpx;
  166. color: #999999;
  167. margin-top: 8rpx;
  168. font-weight: 500;
  169. }
  170. .content {
  171. margin-top: 14rpx;
  172. font-size: 28rpx;
  173. font-weight: 500;
  174. color: #999999;
  175. }
  176. }
  177. image {
  178. width: 84rpx;
  179. height: 84rpx;
  180. }
  181. }
  182. .item:nth-child(odd) {
  183. .content {
  184. margin-top: 14rpx;
  185. font-size: 28rpx;
  186. font-weight: 500;
  187. color: #999999;
  188. }
  189. }
  190. .item:nth-child(even) {
  191. .content {
  192. margin-top: 14rpx;
  193. font-size: 28rpx;
  194. font-weight: 500;
  195. color: #1a1a1a;
  196. }
  197. }
  198. .stay-msg {
  199. margin-top: 28rpx;
  200. font-size: 36rpx;
  201. font-weight: 700;
  202. color: #1a1a1a;
  203. }
  204. }
  205. .option {
  206. display: flex;
  207. .link {
  208. display: flex;
  209. align-items: center;
  210. margin-left: 44rpx;
  211. image {
  212. width: 38rpx;
  213. height: 38rpx;
  214. }
  215. .num {
  216. margin-left: 10rpx;
  217. font-size: 24rpx;
  218. font-weight: 500;
  219. color: #999999;
  220. }
  221. }
  222. .message {
  223. display: flex;
  224. align-items: center;
  225. margin-left: 44rpx;
  226. image {
  227. width: 38rpx;
  228. height: 38rpx;
  229. }
  230. .num {
  231. margin-left: 10rpx;
  232. font-size: 24rpx;
  233. font-weight: 500;
  234. color: #999999;
  235. }
  236. }
  237. .good {
  238. display: flex;
  239. align-items: center;
  240. image {
  241. width: 38rpx;
  242. height: 38rpx;
  243. }
  244. .num {
  245. margin-left: 18rpx;
  246. font-size: 24rpx;
  247. font-weight: 500;
  248. color: #999999;
  249. }
  250. }
  251. }
  252. .text {
  253. padding: 18rpx 30rpx 40rpx 30rpx;
  254. color: #666666;
  255. font-weight: 500;
  256. line-height: 48rpx;
  257. border-bottom: 10rpx solid #f5f5f5;
  258. .item {
  259. margin-bottom: 30rpx;
  260. }
  261. image {
  262. width: 690rpx;
  263. height: 390rpx;
  264. // margin-bottom: 30rpx;
  265. }
  266. }
  267. .image-time {
  268. display: flex;
  269. align-items: center;
  270. margin-left: 30rpx;
  271. image {
  272. width: 24rpx;
  273. height: 24rpx;
  274. }
  275. .time {
  276. margin-left: 10rpx;
  277. font-size: 24rpx;
  278. font-weight: 400;
  279. color: #999999;
  280. }
  281. }
  282. .title {
  283. padding: 48rpx 30rpx 16rpx 30rpx;
  284. font-size: 42rpx;
  285. font-weight: 700;
  286. color: #1a1a1a;
  287. }
  288. </style>