noteAndViewpoint.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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. success: function (res) {
  105. console.log("打开文档成功");
  106. },
  107. });
  108. },
  109. });
  110. },
  111. goDetailPages() {
  112. uni.navigateTo({ url: "/pages-purchaser/columnDetail/columnDetail?id=" + this.detailDataForm.UserId });
  113. },
  114. },
  115. onLoad(options) {
  116. this.detailId = Number(options.id) || 0;
  117. this.detailId > 0 && this.getDetaliData();
  118. },
  119. /** 用户点击分享 */
  120. onShareAppMessage: function (res) {
  121. return {
  122. title: this.detailDataForm.Title,
  123. path: "/pages-purchaser/noteAndViewpoint/noteAndViewpoint?id=" + this.detailId,
  124. };
  125. },
  126. };
  127. </script>
  128. <style lang="scss" scope>
  129. .note-and-viewpoint {
  130. padding: 30rpx;
  131. background: $uni-bg-color;
  132. .content-item {
  133. padding: 40rpx;
  134. background-color: #fff;
  135. .type-time {
  136. display: flex;
  137. align-items: center;
  138. justify-content: space-between;
  139. color: #666666;
  140. .type {
  141. width: 110rpx;
  142. height: 42rpx;
  143. line-height: 42rpx;
  144. text-align: center;
  145. border-radius: 38rpx;
  146. color: #928563;
  147. background-color: #fff6de;
  148. font-weight: 500;
  149. }
  150. }
  151. .title-item {
  152. margin: 10rpx 0 20rpx;
  153. line-height: 46rpx;
  154. }
  155. .file-item {
  156. width: 100%;
  157. height: 42rpx;
  158. margin: 20rpx 0;
  159. display: flex;
  160. align-items: center;
  161. background-color: #f8f8fa;
  162. color: #376cbb;
  163. image {
  164. margin-right: 15rpx;
  165. width: 27rpx;
  166. height: 27rpx;
  167. }
  168. }
  169. .text-conten {
  170. font-size: 32rpx;
  171. line-height: 44rpx;
  172. }
  173. .image-conten {
  174. display: flex;
  175. flex-wrap: wrap;
  176. image {
  177. width: 144rpx;
  178. height: 144rpx;
  179. margin-right: 20rpx;
  180. }
  181. }
  182. .lable-conten {
  183. display: flex;
  184. flex-wrap: wrap;
  185. margin: 20rpx 0;
  186. font-size: 24rpx;
  187. .item {
  188. display: flex;
  189. align-items: center;
  190. height: 34rpx;
  191. border-radius: 44rpx;
  192. padding: 0 35rpx;
  193. background-color: #f0f1f3;
  194. margin: 0 20rpx 20rpx 0;
  195. }
  196. }
  197. .author-name {
  198. display: flex;
  199. align-items: center;
  200. margin-bottom: 50rpx;
  201. .img-box {
  202. width: 48rpx;
  203. height: 48rpx;
  204. overflow: hidden;
  205. font-size: 28rpx;
  206. color: #333;
  207. image {
  208. width: 100%;
  209. height: 100%;
  210. }
  211. }
  212. }
  213. }
  214. .collect-conten {
  215. position: fixed;
  216. bottom: 0;
  217. left: 0;
  218. width: 100%;
  219. padding: 20rpx 0 10rpx;
  220. background-color: #fff;
  221. padding-bottom: constant(safe-area-inset-bottom);
  222. padding-bottom: env(safe-area-inset-bottom);
  223. display: flex;
  224. flex-direction: column;
  225. align-items: center;
  226. color: #666666;
  227. font-size: 24rpx;
  228. line-height: 28rpx;
  229. image {
  230. display: inline-block;
  231. flex-shrink: 0;
  232. width: 44rpx;
  233. height: 44rpx;
  234. }
  235. }
  236. .statement-content {
  237. margin-top: 20rpx;
  238. padding-bottom: 200rpx;
  239. font-size: 28rpx;
  240. line-height: 48rpx;
  241. color: #666;
  242. text {
  243. font-weight: 500;
  244. font-size: 34rpx;
  245. line-height: 48rpx;
  246. }
  247. }
  248. }
  249. </style>