noteAndViewpoint.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <template>
  2. <view class="container note-and-viewpoint" v-if="detailDataForm.HasPermission == 1">
  3. <zmm-watermark :watermark="watermarkText"></zmm-watermark>
  4. <view class="content-item">
  5. <view class="author-name">
  6. <view class="author-box">
  7. <view class="img-box">
  8. <image :src="detailDataForm.HeadImg" @click="goDetailPages"></image>
  9. </view>
  10. <text style="margin-left: 10rpx">{{ detailDataForm.NickName }}</text>
  11. </view>
  12. <view class="follow-content" @click="followAuthorHandler">{{ detailDataForm.IsFollowAuthor ? "取消关注" : "关注专栏" }}</view>
  13. </view>
  14. <view class="type-time">
  15. <view class="type"> {{ detailDataForm.Type == 1 ? "笔 记" : "观 点" }} </view>
  16. <view class="time">{{ detailDataForm.PublishTime }}</view>
  17. </view>
  18. <view class="title-item global_title"> {{ detailDataForm.Title }}</view>
  19. <view class="text-conten">
  20. <mp-html :content="isUserBindingPhoneNumber ? detailDataForm.Content : detailDataForm.Content.slice(0, 80)" />
  21. </view>
  22. <block v-if="isUserBindingPhoneNumber">
  23. <block v-if="detailDataForm.Docs && detailDataForm.Docs.length > 0">
  24. <view @click="goFilePages(item)" class="file-item text_oneLine" v-for="(item, index) in detailDataForm.Docs" :key="index">
  25. <image :src="item.DocIcon"></image>
  26. {{ item.DocName }}
  27. </view>
  28. </block>
  29. <view class="image-conten">
  30. <image v-for="key in dataProcessing(detailDataForm.ImgUrl)" :key="key" :src="key" @click="previewImageMediahandler(key)"></image>
  31. </view>
  32. <view class="lable-conten">
  33. <view class="item" v-for="key in dataProcessing(detailDataForm.Tags)" :key="key">{{ key }}</view>
  34. </view>
  35. </block>
  36. </view>
  37. <block v-if="isUserBindingPhoneNumber">
  38. <view class="statement-content" v-if="detailDataForm.Status == 3">
  39. <text>郑重声明:</text>
  40. 本文为用户投稿,用户在平台中发表的所有资料、言论等仅代表个人或嘉宾观点,与本网站、任何公司与任何机构立场无关。本平台对文中陈述、观点判断保持中立,不对所包含内容及数据的真实性、准确性、可靠性或完整性提供任何明示或暗示的保证。
  41. 股市波动与很多因素有关,任何用户或嘉宾的发言,都有其特定立场,投资决策是个人基于自己的研究分析所做的决定,本文章或会议目的在于事实、观点分享,不构成任何的投资建议。投资者应当自主进行投资决策,对投资者因依赖上述信息进行投资决策而导致的财产损失,本平台不承担法律责任。
  42. 本文章或会议未经本平台和作者的书面许可,任何机构和个人不得以任何形式转发、转载、翻版、复制、刊登、发表、修改、仿制或引用文章或会议的全部或部分内容。本平台对任何第三方的未经授权行为所产生的的影响不承担任何责任,同时保持实施法律行动的权利。
  43. </view>
  44. <view class="collect-conten">
  45. <image @click="collectHandler(2)" v-if="detailDataForm.IsCollect == 1" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collected_icon.png"></image>
  46. <image @click="collectHandler(1)" v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collect_ico.png"></image>
  47. {{ detailDataForm.IsCollect == 1 ? "已收藏" : "收藏" }}
  48. </view>
  49. </block>
  50. <view v-else class="please-login" @click="pleaseGoLogin">请登录后查看更多内容</view>
  51. <Loading />
  52. </view>
  53. <view class="noauth-cont" v-else>
  54. <block v-if="isSpecialArticle_report">
  55. <image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
  56. <view class="tip" v-if="detailDataForm.HasPermission === 3">
  57. 需要升级行业套餐权限才可查看此报告,请联系对口销售
  58. <view class="btn-cont back-btn" @click="backIndex"> 返回 </view>
  59. </view>
  60. </block>
  61. <block v-else>
  62. <image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
  63. <block v-if="detailDataForm.HasPermission !== 3">
  64. <view class="research-noauth">
  65. 暂无 <text class="strong-text">买方研选</text> 权限
  66. <text style="margin-bottom: 30rpx"> 您可申请开通试用 </text>
  67. </view>
  68. <view class="btn-cont" @click="applyAuth">{{ "立即申请" }} </view>
  69. </block>
  70. <view class="tip" v-if="detailDataForm.HasPermission === 3">
  71. <view class="research-noauth">
  72. 暂无 <text class="strong-text">买方研选</text> 权限
  73. <text> 点击提交申请,提醒对口销售为你开通试用 </text>
  74. </view>
  75. </view>
  76. <view v-if="detailDataForm.HasPermission === 3" class="btn-cont" @click="sellerApplyAuth"> 提交申请</view>
  77. <view class="btn-cont back-btn" @click="backIndex"> 返回 </view>
  78. </block>
  79. </view>
  80. </template>
  81. <script>
  82. import { purchaserApi, User } from "@/config/api";
  83. import zmmWatermark from "@/components/zmm-watermark/zmm-watermark.vue";
  84. let app = getApp();
  85. export default {
  86. data() {
  87. return {
  88. detailDataForm: "",
  89. detailId: 0,
  90. readTiem: 0,
  91. setIntervalTiem: null,
  92. watermarkText:''
  93. };
  94. },
  95. components:{zmmWatermark},
  96. methods: {
  97. previewImageMediahandler(key) {
  98. uni.previewImage({
  99. urls: [key], //查看图片的数组
  100. });
  101. },
  102. // 获取专栏详情
  103. async getDetaliData() {
  104. const res = await purchaserApi.yanxuanSpecialDetail({
  105. Id: this.detailId,
  106. });
  107. if (res.Ret === 200) {
  108. this.detailDataForm = res.Data;
  109. this.detailDataForm.HasPermission == 1 && this.setDisableCapture();
  110. this.watermarkText = `${this.$db.get("mobile")}`;
  111. let str = this.detailDataForm.Type == 1 ? "笔记" : "观点";
  112. wx.setNavigationBarTitle({
  113. title: `${str}详情`,
  114. });
  115. }
  116. },
  117. // 数据处理
  118. dataProcessing(item) {
  119. return item ? item.split(",") : [];
  120. },
  121. // 收藏
  122. async collectHandler(type) {
  123. await this.$store.dispatch("checkHandle");
  124. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  125. const res = await purchaserApi.yanxuanSpecialCollect({
  126. Id: this.detailDataForm.Id,
  127. Status: type,
  128. });
  129. if (res.Ret === 200) {
  130. this.$util.toast(res.Msg);
  131. this.getDetaliData();
  132. }
  133. }
  134. },
  135. // 去往预览文件
  136. goFilePages(item) {
  137. wx.downloadFile({
  138. // 示例 url,并非真实存在
  139. url: item.DocUrl,
  140. success: function (res) {
  141. const filePath = res.tempFilePath;
  142. wx.openDocument({
  143. filePath: filePath,
  144. });
  145. },
  146. });
  147. },
  148. goDetailPages() {
  149. uni.navigateTo({ url: "/pages-purchaser/columnDetail/columnDetail?id=" + this.detailDataForm.UserId });
  150. },
  151. /* 无权限申请开通权限 */
  152. applyAuth() {
  153. /* 区分是否是潜在用户 */
  154. this.detailDataForm.HasPermission === 2
  155. ? User.applyTry({
  156. ApplyMethod: 3,
  157. TryType: "YanxuanSpecial",
  158. DetailId: this.detailId,
  159. }).then((res) => {
  160. if (res.Ret === 200) {
  161. uni.navigateTo({
  162. url: "/pageMy/applyResult/applyResult",
  163. });
  164. }
  165. })
  166. : this.detailDataForm.HasPermission === 4
  167. ? uni.navigateTo({
  168. url: "/pageMy/applyTrial/applyTrial?tryType=YanxuanSpecial&detailId=" + this.detailId,
  169. })
  170. : uni.showModal({
  171. title: "",
  172. content: "您已经提交过申请了,请耐心等待",
  173. showCancel: false,
  174. confirmColor: "#365595",
  175. success: function (res) {},
  176. });
  177. },
  178. // 销售的立即申请
  179. sellerApplyAuth() {
  180. User.applyTry({
  181. TryType: "YanxuanSpecial",
  182. DetailId: this.detailId,
  183. }).then((res) => {
  184. if (res.Ret === 200) {
  185. uni.showModal({
  186. title: "",
  187. content: "提交申请成功,请耐心等待",
  188. showCancel: false,
  189. confirmColor: "#365595",
  190. success: function (res) {
  191. this.backIndex();
  192. },
  193. });
  194. }
  195. });
  196. },
  197. // 返回首頁
  198. backIndex() {
  199. uni.navigateBack({
  200. fail() {
  201. uni.switchTab({
  202. url: "/pages/index/index",
  203. });
  204. },
  205. });
  206. },
  207. // 关注作者
  208. async followAuthorHandler() {
  209. const res = await purchaserApi.yanxuanSpecialFollow({
  210. FollowUserId: this.detailDataForm.UserId,
  211. Status: this.detailDataForm.IsFollowAuthor ? 2 : 1,
  212. });
  213. if (res.Ret === 200) {
  214. this.detailDataForm.IsFollowAuthor = !this.detailDataForm.IsFollowAuthor;
  215. this.detailDataForm.IsFollowAuthor
  216. ? uni.showModal({
  217. title: "已关注专栏",
  218. content: "请关注【查研观向小助手】 公众号,及时获取专栏下内容更新提醒",
  219. confirmText: "知道了",
  220. showCancel: false,
  221. confirmColor: "#376cbb",
  222. })
  223. : uni.showToast({
  224. title: "已取消关注",
  225. icon: "none",
  226. duration: 2000,
  227. });
  228. }
  229. },
  230. setDisableCapture() {
  231. wx.setVisualEffectOnCapture({
  232. visualEffect: "hidden",
  233. complete: (res) => {
  234. console.log(res);
  235. },
  236. });
  237. },
  238. closeDisableCapture() {
  239. wx.setVisualEffectOnCapture({
  240. visualEffect: "none",
  241. });
  242. },
  243. },
  244. onLoad(options) {
  245. this.detailId = Number(options.id) || 0;
  246. },
  247. onShow() {
  248. this.detailId > 0 && this.getDetaliData();
  249. this.readTiem = 0;
  250. this.setIntervalTiem = setInterval(() => {
  251. this.readTiem++;
  252. }, 1000);
  253. },
  254. onHide() {
  255. //页面退出
  256. if (this.detailId && this.detailId > 0 && this.detailDataForm.HasPermission == 1) {
  257. clearInterval(this.setIntervalTiem);
  258. purchaserApi
  259. .YanxuanSpecialRecord({
  260. SpecialId: this.detailId,
  261. StopTime: this.readTiem,
  262. })
  263. .then((res) => {});
  264. }
  265. this.closeDisableCapture()
  266. },
  267. onUnload() {
  268. if (this.detailId && this.detailId > 0 && this.detailDataForm.HasPermission == 1) {
  269. //页面返回
  270. clearInterval(this.setIntervalTiem);
  271. purchaserApi
  272. .YanxuanSpecialRecord({
  273. SpecialId: this.detailId,
  274. StopTime: this.readTiem,
  275. })
  276. .then((res) => {});
  277. }
  278. this.closeDisableCapture()
  279. },
  280. /** 用户点击分享 */
  281. onShareAppMessage: function (res) {
  282. return {
  283. title: this.detailDataForm.Title,
  284. path: "/pages-purchaser/noteAndViewpoint/noteAndViewpoint?id=" + this.detailId,
  285. };
  286. },
  287. };
  288. </script>
  289. <style lang="scss" scope>
  290. .note-and-viewpoint {
  291. position: relative;
  292. padding: 30rpx;
  293. background: $uni-bg-color;
  294. .content-item {
  295. padding: 40rpx;
  296. background-color: #fff;
  297. .type-time {
  298. display: flex;
  299. align-items: center;
  300. justify-content: space-between;
  301. color: #666666;
  302. .type {
  303. width: 110rpx;
  304. height: 42rpx;
  305. line-height: 42rpx;
  306. text-align: center;
  307. border-radius: 38rpx;
  308. color: #928563;
  309. background-color: #fff6de;
  310. font-weight: 500;
  311. }
  312. }
  313. .title-item {
  314. margin: 10rpx 0 20rpx;
  315. line-height: 46rpx;
  316. }
  317. .file-item {
  318. width: 100%;
  319. height: 42rpx;
  320. margin: 20rpx 0;
  321. display: flex;
  322. align-items: center;
  323. background-color: #f8f8fa;
  324. color: #376cbb;
  325. image {
  326. margin-right: 15rpx;
  327. width: 27rpx;
  328. height: 27rpx;
  329. }
  330. }
  331. .text-conten {
  332. font-size: 32rpx;
  333. line-height: 44rpx;
  334. }
  335. .image-conten {
  336. display: flex;
  337. flex-wrap: wrap;
  338. image {
  339. width: 144rpx;
  340. height: 144rpx;
  341. margin-right: 20rpx;
  342. }
  343. }
  344. .lable-conten {
  345. display: flex;
  346. flex-wrap: wrap;
  347. margin: 20rpx 0;
  348. font-size: 24rpx;
  349. .item {
  350. display: flex;
  351. align-items: center;
  352. height: 34rpx;
  353. border-radius: 44rpx;
  354. padding: 0 35rpx;
  355. background-color: #f0f1f3;
  356. margin: 0 20rpx 20rpx 0;
  357. }
  358. }
  359. .author-name {
  360. display: flex;
  361. align-items: center;
  362. justify-content: space-between;
  363. margin-bottom: 50rpx;
  364. .author-box {
  365. display: flex;
  366. align-items: center;
  367. }
  368. .img-box {
  369. width: 48rpx;
  370. height: 48rpx;
  371. overflow: hidden;
  372. font-size: 28rpx;
  373. color: #333;
  374. image {
  375. width: 100%;
  376. height: 100%;
  377. }
  378. }
  379. .follow-content {
  380. display: flex;
  381. align-items: center;
  382. padding: 0 25rpx;
  383. height: 48rpx;
  384. border-radius: 150rpx;
  385. background-color: #376cbb;
  386. color: #fff;
  387. font-size: 24rpx;
  388. }
  389. }
  390. }
  391. .collect-conten {
  392. position: fixed;
  393. bottom: 0;
  394. left: 0;
  395. width: 100%;
  396. padding: 20rpx 0 10rpx;
  397. background-color: #fff;
  398. padding-bottom: constant(safe-area-inset-bottom);
  399. padding-bottom: env(safe-area-inset-bottom);
  400. display: flex;
  401. flex-direction: column;
  402. align-items: center;
  403. color: #666666;
  404. font-size: 24rpx;
  405. line-height: 28rpx;
  406. image {
  407. display: inline-block;
  408. flex-shrink: 0;
  409. width: 44rpx;
  410. height: 44rpx;
  411. }
  412. }
  413. .statement-content {
  414. margin-top: 20rpx;
  415. padding-bottom: 200rpx;
  416. font-size: 28rpx;
  417. line-height: 48rpx;
  418. color: #666;
  419. text {
  420. font-weight: 500;
  421. font-size: 34rpx;
  422. line-height: 48rpx;
  423. }
  424. }
  425. .please-login {
  426. margin: 50rpx auto 150rpx;
  427. width: 556rpx;
  428. height: 64rpx;
  429. color: #fff;
  430. font-size: 24rpx;
  431. font-weight: 600;
  432. background-color: #376cbb;
  433. display: flex;
  434. align-items: center;
  435. justify-content: center;
  436. border-radius: 9rpx;
  437. }
  438. }
  439. .noauth-cont {
  440. padding-top: 170rpx;
  441. padding-bottom: 100rpx;
  442. text-align: center;
  443. font-size: 28rpx;
  444. .noauth-ico {
  445. width: 365rpx;
  446. height: 229rpx;
  447. margin-bottom: 70rpx;
  448. }
  449. .tip {
  450. width: 532rpx;
  451. margin: 0 auto 100rpx;
  452. .contract {
  453. padding: 40rpx 90rpx 0;
  454. line-height: 44rpx;
  455. text {
  456. display: inline-block;
  457. }
  458. }
  459. }
  460. .btn-cont {
  461. width: 500rpx;
  462. height: 52rpx;
  463. background: $uni-color-new;
  464. color: #fff;
  465. font-size: 24rpx;
  466. font-weight: 600;
  467. border-radius: 8rpx;
  468. margin: 0 auto;
  469. text-align: center;
  470. line-height: 52rpx;
  471. &.back-btn {
  472. background: #e5efff !important;
  473. color: $uni-color-new;
  474. margin-top: 30rpx;
  475. }
  476. .btn_bg {
  477. width: 100%;
  478. height: 80rpx;
  479. position: absolute;
  480. left: 0;
  481. top: 0;
  482. }
  483. .btn-txt {
  484. width: 100%;
  485. position: absolute;
  486. z-index: 1;
  487. }
  488. }
  489. .research-noauth {
  490. color: #333;
  491. font-size: 36rpx;
  492. width: calc(100% + 80rpx);
  493. margin-left: -40rpx;
  494. .strong-text {
  495. display: inline-block;
  496. padding: 0 10rpx;
  497. font-weight: 500;
  498. }
  499. text:last-child {
  500. font-size: 32rpx;
  501. font-size: 34rpx;
  502. color: #999999;
  503. margin-top: 10rpx;
  504. }
  505. }
  506. }
  507. </style>