FinancialServicesIdeasDetails.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div style="width: 100%;background:#fff">
  3. <div class="autoBox box cool">
  4. <div class="crumbs">
  5. <el-breadcrumb separator="/">
  6. <el-breadcrumb-item :to="{ path: 'home' }" replace>{{$t('common.Home')}}</el-breadcrumb-item>
  7. <el-breadcrumb-item :to="{ path: 'financialServices' }" replace>{{$t('common.FinancialServices')}}</el-breadcrumb-item>
  8. <el-breadcrumb-item :to="{ path: 'FinancialServicesFundIdeas' }" replace>{{$t('common.FundIdeas')}}</el-breadcrumb-item>
  9. <el-breadcrumb-item >{{iniData.title}}</el-breadcrumb-item>
  10. </el-breadcrumb>
  11. </div>
  12. </div>
  13. <div class="autoBox box1">
  14. <div style="padding: 0 80px">
  15. <div class="ideasTitle">
  16. {{iniData.title}}
  17. <p style="text-align: center;font-size: 18px;color: #666666;font-weight: normal;margin-top: 44px">{{iniData.subtitle}}</p>
  18. </div>
  19. <div class="contentList" v-html="iniData.introduction">
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import {getBaseFundIdeasInfos} from '@/api/financialService/baseFundIdeasInfo'
  26. import {getFollowModeNumlByModelIdAndUserId} from "../../api/operation/basePortalModelFollowInfo";
  27. import {getToken } from "@/utils/auth";
  28. import Base from "@/views/base/Base";
  29. import { saveFollowModel } from "@/api/operation/basePortalModelFollowInfo";
  30. export default{
  31. name:'FinancialServicesIdeasDetails',
  32. extends: Base,
  33. data(){
  34. return{
  35. num:5,
  36. iniData:{},
  37. ifcommon:false,
  38. toViewLogin:false,
  39. params:{
  40. pageSize:"5",
  41. pageNo:"1",
  42. language:'',
  43. baseEntityId:'',
  44. statusDict:'2'
  45. }
  46. }
  47. },
  48. mounted() {
  49. this.getDetails();
  50. },
  51. watch: {
  52. '$i18n.locale'(){
  53. this.getDetails();
  54. },
  55. },
  56. methods:{
  57. // 未登录跳转
  58. loginTipsChange(){
  59. const that=this;
  60. this.num =5;
  61. // clearInterval(timer_interval);
  62. this.timer = setInterval(function() {
  63. if (that.num > 0) {
  64. that.num--;
  65. } else {
  66. if(that.toViewLogin==true){
  67. clearInterval(that.timer);
  68. that.toView('login');
  69. }else {
  70. clearInterval(that.timer);
  71. }
  72. }
  73. }, 1000)
  74. },
  75. // 判断未登录跳转是否关闭
  76. toViewLoginChange(done){
  77. this.toViewLogin=false;
  78. this.num=5;
  79. clearInterval(this.timer);
  80. },
  81. getDetails(){
  82. this.params.language = this.$i18n.locale.toUpperCase();
  83. this.params.baseEntityId = this.$route.query.key;
  84. getBaseFundIdeasInfos(this.params).then((res)=>{
  85. this.iniData = res.data.baseFundIdeasInfos[0];
  86. this.iniData.keyword = this.iniData.keyword.split(',');
  87. this.getMyCollecModel()
  88. })
  89. },
  90. // 项目收藏改变
  91. shareChange() {
  92. if (this.ifcommon) {
  93. this.Collection("unfollow");
  94. }else{
  95. this.Collection("follow");
  96. }
  97. },
  98. Collection: function (collectType) {
  99. let user = window.localStorage.getItem("user");
  100. if (!this.$Cookies.get('token')) {
  101. this.toViewLogin = true;
  102. } else {
  103. var users = JSON.parse(user);
  104. var token = "" + getToken();
  105. var userId = users.userId;
  106. var baseEntityId =this.iniData.baseEntityId;
  107. // 接口逻辑
  108. this.submitHandler((token) => {
  109. saveFollowModel(baseEntityId, "finance", userId, collectType, token)
  110. .then((result) => {
  111. console.log(result)
  112. this.$message({
  113. message: result.data,
  114. type: "success",
  115. });
  116. this.ifcommon = !this.ifcommon;
  117. this.resetToken();
  118. })
  119. .catch((error) => {
  120. this.$message({
  121. message: result.data,
  122. type: "failed",
  123. });
  124. });
  125. });
  126. }
  127. },
  128. getMyCollecModel(){
  129. const that= this;
  130. let user = window.localStorage.getItem("user");
  131. if (this.$Cookies.get('token')) {
  132. var users = JSON.parse(user);
  133. var token = "" + getToken();
  134. var baseEntityId = this.iniData.baseEntityId;
  135. this.userId = users.userId;
  136. getFollowModeNumlByModelIdAndUserId(
  137. baseEntityId,
  138. "finance",
  139. this.userId
  140. ).then((res) => {
  141. this.ifcommon = res.data;
  142. console.log(
  143. res.data,
  144. "---------------------------------------------------------------------------"
  145. );
  146. });
  147. }
  148. },
  149. }
  150. }
  151. </script>
  152. <style scoped>
  153. .box {
  154. margin-top: 10px;
  155. background: #fff;
  156. /* height: 500px; */
  157. padding: 20px 0;
  158. }
  159. .crumbs {
  160. margin-left: 20px;
  161. }
  162. .box1 {
  163. padding: 0;
  164. /* transform: translateX(-20px); */
  165. background: #fff;
  166. margin-top: 15px;
  167. }
  168. body {
  169. margin: 0;
  170. }
  171. .ideasTitle{
  172. font-size: 28px;
  173. color: #666666;
  174. font-weight: 700;
  175. margin: 30px auto;
  176. text-align: center;
  177. }
  178. .contentList{
  179. width: 100%;
  180. display: flex;
  181. justify-content: space-between;
  182. }
  183. </style>