noteAndViewpoint.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="container note-and-viewpoint" v-if="detailDataForm.HasPermission == 1">
  3. <view class="content-item">
  4. <view class="author-name">
  5. <view class="img-box">
  6. <image :src="detailDataForm.HeadImg" @click="goDetailPages"></image>
  7. </view>
  8. <text style="margin-left: 10rpx">{{ detailDataForm.NickName }}</text>
  9. </view>
  10. <view class="type-time">
  11. <view class="type"> {{ detailDataForm.Type == 1 ? "笔 记" : "观 点" }} </view>
  12. <view class="time">{{ detailDataForm.PublishTime }}</view>
  13. </view>
  14. <view class="title-item global_title"> {{ detailDataForm.Title }}</view>
  15. <view class="text-conten">
  16. <mp-html :content="detailDataForm.Content" />
  17. </view>
  18. <block v-if="detailDataForm.Docs && detailDataForm.Docs.length > 0">
  19. <view @click="goFilePages(item)" class="file-item text_oneLine" v-for="(item, index) in detailDataForm.Docs" :key="index">
  20. <image :src="item.DocIcon"></image>
  21. {{ item.DocName }}
  22. </view>
  23. </block>
  24. <view class="image-conten">
  25. <image v-for="key in dataProcessing(detailDataForm.ImgUrl)" :key="key" :src="key" @click="previewImageMediahandler(key)"></image>
  26. </view>
  27. <view class="lable-conten">
  28. <view class="item" v-for="key in dataProcessing(detailDataForm.Tags)" :key="key">{{ key }}</view>
  29. </view>
  30. </view>
  31. <view class="statement-content" v-if="detailDataForm.Status == 3">
  32. <text>郑重声明:</text>
  33. 本文为用户投稿,用户在平台中发表的所有资料、言论等仅代表个人或嘉宾观点,与本网站、任何公司与任何机构立场无关。本平台对文中陈述、观点判断保持中立,不对所包含内容及数据的真实性、准确性、可靠性或完整性提供任何明示或暗示的保证。
  34. 股市波动与很多因素有关,任何用户或嘉宾的发言,都有其特定立场,投资决策是个人基于自己的研究分析所做的决定,本文章或会议目的在于事实、观点分享,不构成任何的投资建议。投资者应当自主进行投资决策,对投资者因依赖上述信息进行投资决策而导致的财产损失,本平台不承担法律责任。
  35. 本文章或会议未经本平台和作者的书面许可,任何机构和个人不得以任何形式转发、转载、翻版、复制、刊登、发表、修改、仿制或引用文章或会议的全部或部分内容。本平台对任何第三方的未经授权行为所产生的的影响不承担任何责任,同时保持实施法律行动的权利。
  36. </view>
  37. <view class="collect-conten">
  38. <image @click="collectHandler(2)" v-if="detailDataForm.IsCollect == 1" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collected_icon.png"></image>
  39. <image @click="collectHandler(1)" v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collect_ico.png"></image>
  40. {{ detailDataForm.IsCollect == 1 ? "已收藏" : "收藏" }}
  41. </view>
  42. <Loading />
  43. </view>
  44. <view class="nodata" v-else>
  45. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  46. <text>报告加急审核中,请耐心等待~</text>
  47. </view>
  48. </template>
  49. <script>
  50. import { purchaserApi } from "@/config/api";
  51. export default {
  52. data() {
  53. return {
  54. detailDataForm: "",
  55. detailId: 0,
  56. };
  57. },
  58. methods: {
  59. previewImageMediahandler(key) {
  60. uni.previewImage({
  61. urls: [key], //查看图片的数组
  62. });
  63. },
  64. // 获取专栏详情
  65. async getDetaliData() {
  66. const res = await purchaserApi.yanxuanSpecialDetail({
  67. Id: this.detailId,
  68. });
  69. if (res.Ret === 200) {
  70. this.detailDataForm = res.Data;
  71. let str = this.detailDataForm.Type == 1 ? "笔记" : "观点";
  72. wx.setNavigationBarTitle({
  73. title: `${str}详情`,
  74. });
  75. }
  76. },
  77. // 数据处理
  78. dataProcessing(item) {
  79. return item ? item.split(",") : [];
  80. },
  81. // 收藏
  82. async collectHandler(type) {
  83. await this.$store.dispatch("checkHandle");
  84. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  85. const res = await purchaserApi.yanxuanSpecialCollect({
  86. Id: this.detailDataForm.Id,
  87. Status: type,
  88. });
  89. if (res.Ret === 200) {
  90. this.$util.toast(res.Msg);
  91. this.getDetaliData();
  92. }
  93. }
  94. },
  95. // 去往预览文件
  96. goFilePages(item) {
  97. wx.downloadFile({
  98. // 示例 url,并非真实存在
  99. url: item.DocUrl,
  100. success: function (res) {
  101. const filePath = res.tempFilePath;
  102. wx.openDocument({
  103. filePath: filePath,
  104. });
  105. },
  106. });
  107. },
  108. goDetailPages() {
  109. uni.navigateTo({ url: "/pages-purchaser/columnDetail/columnDetail?id=" + this.detailDataForm.UserId });
  110. },
  111. },
  112. onLoad(options) {
  113. this.detailId = Number(options.id) || 0;
  114. this.detailId > 0 && this.getDetaliData();
  115. },
  116. /** 用户点击分享 */
  117. onShareAppMessage: function (res) {
  118. return {
  119. title: this.detailDataForm.Title,
  120. path: "/pages-purchaser/noteAndViewpoint/noteAndViewpoint?id=" + this.detailId,
  121. };
  122. },
  123. };
  124. </script>
  125. <style lang="scss" scope>
  126. .note-and-viewpoint {
  127. padding: 30rpx;
  128. background: $uni-bg-color;
  129. .content-item {
  130. padding: 40rpx;
  131. background-color: #fff;
  132. .type-time {
  133. display: flex;
  134. align-items: center;
  135. justify-content: space-between;
  136. color: #666666;
  137. .type {
  138. width: 110rpx;
  139. height: 42rpx;
  140. line-height: 42rpx;
  141. text-align: center;
  142. border-radius: 38rpx;
  143. color: #928563;
  144. background-color: #fff6de;
  145. font-weight: 500;
  146. }
  147. }
  148. .title-item {
  149. margin: 10rpx 0 20rpx;
  150. line-height: 46rpx;
  151. }
  152. .file-item {
  153. width: 100%;
  154. height: 42rpx;
  155. margin: 20rpx 0;
  156. display: flex;
  157. align-items: center;
  158. background-color: #f8f8fa;
  159. color: #376cbb;
  160. image {
  161. margin-right: 15rpx;
  162. width: 27rpx;
  163. height: 27rpx;
  164. }
  165. }
  166. .text-conten {
  167. font-size: 32rpx;
  168. line-height: 44rpx;
  169. }
  170. .image-conten {
  171. display: flex;
  172. flex-wrap: wrap;
  173. image {
  174. width: 144rpx;
  175. height: 144rpx;
  176. margin-right: 20rpx;
  177. }
  178. }
  179. .lable-conten {
  180. display: flex;
  181. flex-wrap: wrap;
  182. margin: 20rpx 0;
  183. font-size: 24rpx;
  184. .item {
  185. display: flex;
  186. align-items: center;
  187. height: 34rpx;
  188. border-radius: 44rpx;
  189. padding: 0 35rpx;
  190. background-color: #f0f1f3;
  191. margin: 0 20rpx 20rpx 0;
  192. }
  193. }
  194. .author-name {
  195. display: flex;
  196. align-items: center;
  197. margin-bottom: 50rpx;
  198. .img-box {
  199. width: 48rpx;
  200. height: 48rpx;
  201. overflow: hidden;
  202. font-size: 28rpx;
  203. color: #333;
  204. image {
  205. width: 100%;
  206. height: 100%;
  207. }
  208. }
  209. }
  210. }
  211. .collect-conten {
  212. position: fixed;
  213. bottom: 0;
  214. left: 0;
  215. width: 100%;
  216. padding: 20rpx 0 10rpx;
  217. background-color: #fff;
  218. padding-bottom: constant(safe-area-inset-bottom);
  219. padding-bottom: env(safe-area-inset-bottom);
  220. display: flex;
  221. flex-direction: column;
  222. align-items: center;
  223. color: #666666;
  224. font-size: 24rpx;
  225. line-height: 28rpx;
  226. image {
  227. display: inline-block;
  228. flex-shrink: 0;
  229. width: 44rpx;
  230. height: 44rpx;
  231. }
  232. }
  233. .statement-content {
  234. margin-top: 20rpx;
  235. padding-bottom: 200rpx;
  236. font-size: 28rpx;
  237. line-height: 48rpx;
  238. color: #666;
  239. text {
  240. font-weight: 500;
  241. font-size: 34rpx;
  242. line-height: 48rpx;
  243. }
  244. }
  245. }
  246. </style>