guideDetial.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <view class="organsDetial">
  3. <!-- 标题栏 -->
  4. <u-navbar :is-back="true" :back-icon-color="'#fff'" :background="{'background':'#1777FE'}" :border-bottom="true"
  5. :back-text="$t('common.Back')" :title-color="'#fff'" :back-text-style="{color:'#fff'}" :title="title">
  6. <view slot="right" style="margin-right:20upx">
  7. <u-icon name="share-fill" style="margin-right: 30upx;" color="white" size="50" @click="share"></u-icon>
  8. <u-icon name="heart-fill" color="#fff" size="36" @click="saveFollowModel(followed)"
  9. v-if="this.followed"></u-icon>
  10. <u-icon name="heart" color="#fff" size="36" @click="saveFollowModel(followed)" v-if="!this.followed">
  11. </u-icon>
  12. </view>
  13. </u-navbar>
  14. <view class="main">
  15. <view class="contentTitle">{{dataList.name}}</view>
  16. <view class="contentText">
  17. <rich-text :nodes="dataList.introduction"></rich-text>
  18. </view>
  19. <view class="imgList">
  20. <view class="imgitem" v-for="pdfitem in pdfCtrl">
  21. <img :src="websiteUrl + pdfList.fileAddress+'\\'+ (++pdfitem)+'.png'" mode="widthFix"
  22. style="width:100% ;"></img>
  23. </view>
  24. <!-- <image class="imgitem" v-for="(imgitem,imgidx) in imgList" :key="imgidx" :src="imgitem" mode="widthFix" ></image> -->
  25. </view>
  26. <!-- 阅读更多 -->
  27. <!-- <view class="seearticle" v-if="pdfLength>2" @click="seearticle" :style="showTip?'width:100%;text-align:center':'display:none'">
  28. {{$t('common.ReadingFullText')}}
  29. </view> -->
  30. </view>
  31. <!-- 其他区域投资指引 -->
  32. <!-- <view class="guide">
  33. <view class="zoneTitle">{{$t('common.OtherRelated')}}</view>
  34. <view class="guideList">
  35. <view class="item" v-for="(item,index) in otherArea" :key="index" @click="showDeital(item)">
  36. <view class="thumb">
  37. <image class="thumbimg" :src="websiteUrl+item.photo" mode="widthFix" @error="showErrorImg(item)"></image>
  38. </view>
  39. <view class="info">
  40. <view class="title">{{item.name}}</view>
  41. <view class="date">{{formatDate(item.publishDate)}}</view>
  42. </view>
  43. </view>
  44. </view>
  45. </view> -->
  46. <!-- 投融资资讯 -->
  47. <!-- <view class="informations">
  48. <view class="zoneTitle">{{$t('common.relatedNews')}}</view>
  49. <view class="infoList">
  50. <view class="item" v-for="(item,index) in infomationList" :key="index" @click="toDetails(item)">
  51. <view class="thumb" v-if="item.pictureUrl&&item.pictureUrl != null">
  52. <image class="thumbimg" :src="websiteUrl + item.pictureUrl" mode="widthFix"></image>
  53. </view>
  54. <view class="info">
  55. <view class="title">{{item.title}}</view>
  56. <view class="date"><text>{{item.auther}}</text><text>{{formatDate(item.publishDate)}}</text></view>
  57. </view>
  58. </view>
  59. </view>
  60. </view> --><!-- 8.8.20.112:19001 InvestmentGuide -->
  61. <share v-show="ifShare == true" :show="ifShare" @closeShare="share" :title="$t('common.InvestmentGuide')" :summary="dataList.name"
  62. :href="'https://m.geidcp.com/#/pages/financialService/investmentGuide/guideDetial?' + 'id=' + baseEntityId + '&language=' + $i18n.locale"
  63. :imageUrl="pdfCtrl && pdfCtrl[0]? websiteUrl + pdfList.fileAddress+'\\'+ (++pdfCtrl[0])+'.png':
  64. 'https://m.geidcp.com/api/file/pub/defaultCutPic/shareLogo.png'">
  65. </share>
  66. <u-toast ref="uToast" />
  67. <!-- #ifdef H5 -->
  68. <rf-back-home></rf-back-home>
  69. <!-- #endif -->
  70. <rf-back-top :scrollTop="scrollTop"></rf-back-top>
  71. </view>
  72. </template>
  73. <script>
  74. import UNavbar from '@/components/uni-nav-bar/uni-nav-bar.vue';
  75. import UIcon from '@/components/uni-icons/uni-icons.vue'
  76. import {
  77. getBaseInvestmentGuidelinesInfos
  78. } from '@/api/financialService/baseInvestmentGuidelinesInfo';
  79. import {
  80. saveFollowModel,
  81. getFollowModelStatusByModelIdAndUserId
  82. } from '@/api/operation/basePortalModelFollowInfo'
  83. import {
  84. sysAttachmentInfos
  85. } from "@/api/cooperation/baseCooperationUnit";
  86. import {
  87. gateResearchResultFileById
  88. } from "@/api/research/baseResearchResultView";
  89. import {
  90. financeInfoList
  91. } from "@/api/financialService/cmsInformationViews";
  92. import share from '@/components/share'
  93. export default {
  94. name: 'OrgansDetial',
  95. components: {
  96. UNavbar,
  97. UIcon,
  98. share
  99. },
  100. data() {
  101. return {
  102. title: '',
  103. followed: false,
  104. modelType: 'investmentGuidelines',
  105. imgs: [],
  106. baseEntityId: '',
  107. dataList: [],
  108. pdfList: [],
  109. showTip: true,
  110. otherArea: [],
  111. scrollTop: 0,
  112. banner: '../../../static/img/finance/header1.png',
  113. guideList: [],
  114. infomationList: [],
  115. pdfCtrl: [],
  116. pdfLength: '',
  117. ifShare: false,
  118. }
  119. },
  120. onLoad(e) {
  121. this.baseEntityId = e.id;
  122. if (option.language) {
  123. uni.setStorageSync("language", option.language);
  124. this._i18n.locale = option.language;
  125. }
  126. uni.showLoading({
  127. title: this.$i18n.locale == 'zh' ? '加载中...' : 'Loading...'
  128. });
  129. this.title = this.$i18n.locale == 'zh' ? '投资指引详情' : 'InvestmentGuide Detial'
  130. setTimeout(() => {
  131. uni.hideLoading();
  132. }, 100)
  133. },
  134. onShow: function() {
  135. this.token = uni.getStorageSync('Auth-Token') ? ('Bearer ' + uni.getStorageSync('Auth-Token')) : '';
  136. this.userId = uni.getStorageSync('user') ? (JSON.parse(uni.getStorageSync('user')).id) : '';
  137. },
  138. created() {
  139. // this.pdfCtrl=this.imgs.slice(0,2);
  140. // console.log(this.imgs,'------------imgs-----')
  141. this.getDataList();
  142. this.getInfomation()
  143. },
  144. onPageScroll(e) {
  145. this.scrollTop = e.scrollTop;
  146. },
  147. methods: {
  148. seearticle() {
  149. this.imgs = this.pdfCtrl;
  150. this.showTip = false
  151. },
  152. share() {
  153. this.ifShare = !this.ifShare;
  154. },
  155. i18n(data) {
  156. return this.$t('common.' + data);
  157. },
  158. //查看投资指引详情
  159. showDeital(item) {
  160. uni.navigateTo({
  161. url: '/pages/financialService/investmentGuide/guideDetial?id=' + item.baseEntityId
  162. })
  163. },
  164. //获取投资指引详情
  165. async getDataList() {
  166. let params = {
  167. language: this.$i18n.locale.toUpperCase(),
  168. baseEntityId: this.baseEntityId,
  169. statusDict: '2'
  170. }
  171. const res = await this.$myRequest({
  172. url: '/project/baseInvestmentGuidelinesInfos/',
  173. data: params
  174. });
  175. if (res.data.baseInvestmentGuidelinesInfos) {
  176. this.dataList = res.data.baseInvestmentGuidelinesInfos[0];
  177. this.contentText = this.dataList.introduction;
  178. this.getOther();
  179. this.getFollowModelStatusByModelIdAndUserId();
  180. //获取pdf详情
  181. if (this.dataList.pdfToPictureFileIds) {
  182. let dataPrams = {
  183. pageNo: 1,
  184. pageSize: 1,
  185. language: this.$i18n.locale.toUpperCase(),
  186. researchResultFileId: this.dataList.pdfToPictureFileIds
  187. }
  188. const result = await this.$myRequest({
  189. url: '/resourceshare/baseResearchResultViews/gateResearchResultFile',
  190. data: {
  191. ...dataPrams
  192. }
  193. });
  194. if (result.data.baseResearchResultFile !== "无数据") {
  195. this.pdfList = result.data.baseResearchResultFile;
  196. this.goForpage()
  197. } else {
  198. this.pdfList = [];
  199. }
  200. } else {
  201. this.pdfList = [];
  202. }
  203. console.log(this.pdfList, '---------------this.pdfList');
  204. console.log(this.pdfList.filePages, '---------------this.pdfList.filePages')
  205. }
  206. },
  207. //获取其他区域投资指引
  208. async getOther() {
  209. let otherList = {
  210. language: this.$i18n.locale.toUpperCase(),
  211. statusDict: '2',
  212. // showable:'y'
  213. };
  214. const otheres = await this.$myRequest({
  215. url: '/project/baseInvestmentGuidelinesInfos/',
  216. data: otherList
  217. });
  218. if (otheres.data.baseInvestmentGuidelinesInfos) {
  219. let tempList = [];
  220. tempList = otheres.data.baseInvestmentGuidelinesInfos;
  221. this.otherArea = [];
  222. for (let i = 0; i < tempList.length; i++) {
  223. if (tempList[i].id !== this.dataList.id) {
  224. this.otherArea.push(tempList[i])
  225. }
  226. }
  227. }
  228. },
  229. async getInfomation() {
  230. let infoParams = {
  231. language: this.$i18n.locale.toUpperCase(),
  232. }
  233. const res = await this.$myRequest({
  234. url: '/cms/cmsInformationViews/financeInfoList/',
  235. data: infoParams
  236. });
  237. for (let i = 0; i < 10; i++) {
  238. this.infomationList.push(res.data[i]);
  239. }
  240. },
  241. toDetails(item) {
  242. let key = item.baseEntityId;
  243. uni.navigateTo({
  244. url: '/pages/information/components/rankDetail?key=' + key
  245. });
  246. },
  247. goForpage() {
  248. // this.pdfCtrl = [];
  249. for (let i = 0; i < this.pdfList.filePages; i++) {
  250. this.pdfCtrl.push(i);
  251. // this.imgs=this.pdfCtrl.slice(0,2);
  252. }
  253. this.pdfLength = this.pdfCtrl.length;
  254. console.log(this.pdfLength, '------------this.pdfLength-------------')
  255. },
  256. // 检测是否被收藏
  257. async getFollowModelStatusByModelIdAndUserId() {
  258. let res = await this.$myRequest({
  259. url: '/op/basePortalModelFollowInfos/followModelStatusByModelIdAndUserId',
  260. data: {
  261. modelId: this.baseEntityId,
  262. modelType: this.modelType,
  263. userId: this.userId
  264. }
  265. })
  266. this.followed = res.data;
  267. },
  268. // 收藏或取消收藏操作
  269. async saveFollowModel(flag) {
  270. if (this.token.length <= 7) {
  271. uni.navigateTo({
  272. url: '/pages/public/login?back=1'
  273. })
  274. } else {
  275. let [type, msg, followfailmsg] = [];
  276. if (!flag) {
  277. type = "follow";
  278. msg = this.$i18n.locale == 'zh' ? '关注成功' : 'fowllow success'
  279. followfailmsg = this.$i18n.locale == 'zh' ? '关注失败' : 'fowllow fail'
  280. } else {
  281. type = "unfollow"
  282. msg = this.$i18n.locale == 'zh' ? '取消关注成功' : 'cancel fowllow success'
  283. followfailmsg = this.$i18n.locale == 'zh' ? '取消关注成功关注失败' : 'cnacel fowllow fail'
  284. }
  285. let res = await this.$myRequest({
  286. url: '/op/basePortalModelFollowInfos/followModel',
  287. method: 'post',
  288. headers: {
  289. token: this.token
  290. },
  291. data: {
  292. modelId: this.baseEntityId,
  293. modelType: this.modelType,
  294. userId: this.userId,
  295. followType: type,
  296. }
  297. })
  298. if (!flag) {
  299. if (res.status == '200' && res.msg == 'ok') {
  300. this.$refs.uToast.show({
  301. title: msg,
  302. type: 'success'
  303. })
  304. this.followed = !this.followed;
  305. } else this.$refs.uToast.show({
  306. title: followfailmsg,
  307. type: 'error'
  308. })
  309. } else {
  310. if (res.status == '200' && res.msg == 'ok') {
  311. this.$refs.uToast.show({
  312. title: msg,
  313. type: 'success'
  314. })
  315. this.followed = !this.followed;
  316. } else this.$refs.uToast.show({
  317. title: followfailmsg,
  318. type: 'error'
  319. })
  320. }
  321. }
  322. },
  323. // 错误图像加载显示
  324. showErrorImg(item) {
  325. this.$set(item, 'photo', 'https://www.geidcp.com/api/file/pub//def/projectdefault.png')
  326. }
  327. }
  328. }
  329. </script>
  330. <style lang="scss" scoped>
  331. .organsDetial {
  332. background: #fff;
  333. padding: 2%;
  334. .main {
  335. .contentTitle {
  336. text-align: center;
  337. font-weight: 700;
  338. line-height: 60upx;
  339. margin-bottom: 20upx;
  340. }
  341. .contentText {
  342. text-indent: 60upx;
  343. }
  344. .imgList {
  345. margin-top: 20upx;
  346. text-align: center;
  347. .imgitem {
  348. width: 100%;
  349. font-size: 0;
  350. display: block;
  351. }
  352. .seearticle {
  353. height: 60upx;
  354. line-height: 60upx;
  355. color: #04e;
  356. font-size: 24upx;
  357. }
  358. }
  359. }
  360. .banner {
  361. position: relative;
  362. overflow: hidden;
  363. .bannerimg {
  364. display: block;
  365. width: 100%;
  366. }
  367. }
  368. .guide,
  369. .informations {
  370. .zoneTitle {
  371. height: 100upx;
  372. line-height: 100upx;
  373. font-weight: bold;
  374. position: relative;
  375. margin-left: 10upx;
  376. color: #666;
  377. &:before {
  378. content: "";
  379. width: 6upx;
  380. height: 40upx;
  381. background: #6DD400;
  382. position: absolute;
  383. left: -10upx;
  384. top: 50%;
  385. margin-top: -22upx;
  386. }
  387. }
  388. }
  389. .guide .guideList,
  390. .informations .infoList {
  391. .item {
  392. display: flex;
  393. margin: 20upx 0;
  394. padding: 20upx 0;
  395. border-bottom: 2upx solid #eee;
  396. &:last-of-type {
  397. border: none;
  398. }
  399. .thumb {
  400. width: 200upx;
  401. position: relative;
  402. overflow: hidden;
  403. margin-right: 20upx;
  404. .thumbimg {
  405. display: block;
  406. width: 100%;
  407. max-height: 160upx;
  408. }
  409. }
  410. .info {
  411. flex: 1;
  412. position: relative;
  413. .title {
  414. margin-bottom: 20upx;
  415. overflow: hidden;
  416. text-overflow: ellipsis;
  417. display: -webkit-box;
  418. -webkit-box-orient: vertical;
  419. -webkit-line-clamp: 2;
  420. }
  421. .date {
  422. width: 65%;
  423. font-size: 20upx;
  424. color: #888;
  425. align-self: flex-end;
  426. display: flex;
  427. justify-content: space-between;
  428. }
  429. }
  430. }
  431. }
  432. .infoList .info {
  433. .title {
  434. margin-bottom: 10upx !important;
  435. }
  436. }
  437. }
  438. </style>