123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <template>
- <div style="width: 100%;background:#fff">
- <div class="autoBox box cool">
- <div class="crumbs">
- <el-breadcrumb separator="/">
- <el-breadcrumb-item :to="{ path: 'home' }" replace>{{$t('common.Home')}}</el-breadcrumb-item>
- <el-breadcrumb-item :to="{ path: 'financialServices' }" replace>{{$t('common.FinancialServices')}}</el-breadcrumb-item>
- <el-breadcrumb-item :to="{ path: 'FinancialServicesFundIdeas' }" replace>{{$t('common.FundIdeas')}}</el-breadcrumb-item>
- <el-breadcrumb-item >{{iniData.title}}</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- </div>
- <div class="autoBox box1">
- <div style="padding: 0 80px">
- <div class="ideasTitle">
- {{iniData.title}}
- <p style="text-align: center;font-size: 18px;color: #666666;font-weight: normal;margin-top: 44px">{{iniData.subtitle}}</p>
- </div>
- <div class="contentList" v-html="iniData.introduction">
- </div>
- </div>
- </div>
- </template>
- <script>
- import {getBaseFundIdeasInfos} from '@/api/financialService/baseFundIdeasInfo'
- import {getFollowModeNumlByModelIdAndUserId} from "../../api/operation/basePortalModelFollowInfo";
- import {getToken } from "@/utils/auth";
- import Base from "@/views/base/Base";
- import { saveFollowModel } from "@/api/operation/basePortalModelFollowInfo";
- export default{
- name:'FinancialServicesIdeasDetails',
- extends: Base,
- data(){
- return{
- num:5,
- iniData:{},
- ifcommon:false,
- toViewLogin:false,
- params:{
- pageSize:"5",
- pageNo:"1",
- language:'',
- baseEntityId:'',
- statusDict:'2'
- }
- }
- },
- mounted() {
- this.getDetails();
- },
- watch: {
- '$i18n.locale'(){
- this.getDetails();
- },
- },
- methods:{
- // 未登录跳转
- loginTipsChange(){
- const that=this;
- this.num =5;
- // clearInterval(timer_interval);
- this.timer = setInterval(function() {
- if (that.num > 0) {
- that.num--;
- } else {
- if(that.toViewLogin==true){
- clearInterval(that.timer);
- that.toView('login');
- }else {
- clearInterval(that.timer);
- }
- }
- }, 1000)
- },
- // 判断未登录跳转是否关闭
- toViewLoginChange(done){
- this.toViewLogin=false;
- this.num=5;
- clearInterval(this.timer);
- },
- getDetails(){
- this.params.language = this.$i18n.locale.toUpperCase();
- this.params.baseEntityId = this.$route.query.key;
- getBaseFundIdeasInfos(this.params).then((res)=>{
- this.iniData = res.data.baseFundIdeasInfos[0];
- this.iniData.keyword = this.iniData.keyword.split(',');
- this.getMyCollecModel()
- })
- },
- // 项目收藏改变
- shareChange() {
- if (this.ifcommon) {
- this.Collection("unfollow");
- }else{
- this.Collection("follow");
- }
- },
- Collection: function (collectType) {
- let user = window.localStorage.getItem("user");
- if (!this.$Cookies.get('token')) {
- this.toViewLogin = true;
- } else {
- var users = JSON.parse(user);
- var token = "" + getToken();
- var userId = users.userId;
- var baseEntityId =this.iniData.baseEntityId;
- // 接口逻辑
- this.submitHandler((token) => {
- saveFollowModel(baseEntityId, "finance", userId, collectType, token)
- .then((result) => {
- console.log(result)
- this.$message({
- message: result.data,
- type: "success",
- });
- this.ifcommon = !this.ifcommon;
- this.resetToken();
- })
- .catch((error) => {
- this.$message({
- message: result.data,
- type: "failed",
- });
- });
- });
- }
- },
- getMyCollecModel(){
- const that= this;
- let user = window.localStorage.getItem("user");
- if (this.$Cookies.get('token')) {
- var users = JSON.parse(user);
- var token = "" + getToken();
- var baseEntityId = this.iniData.baseEntityId;
- this.userId = users.userId;
- getFollowModeNumlByModelIdAndUserId(
- baseEntityId,
- "finance",
- this.userId
- ).then((res) => {
- this.ifcommon = res.data;
- console.log(
- res.data,
- "---------------------------------------------------------------------------"
- );
- });
- }
- },
- }
- }
- </script>
- <style scoped>
- .box {
- margin-top: 10px;
- background: #fff;
- /* height: 500px; */
- padding: 20px 0;
- }
- .crumbs {
- margin-left: 20px;
- }
- .box1 {
- padding: 0;
- /* transform: translateX(-20px); */
- background: #fff;
- margin-top: 15px;
- }
- body {
- margin: 0;
- }
- .ideasTitle{
- font-size: 28px;
- color: #666666;
- font-weight: 700;
- margin: 30px auto;
- text-align: center;
- }
- .contentList{
- width: 100%;
- display: flex;
- justify-content: space-between;
- }
- </style>
|