ResourceSharingResourceDetails.vue 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. <template>
  2. <div class="autoBox box" style="min-height: 900px;position: relative;">
  3. <div class="crumbs">
  4. <div style="overflow: hidden">
  5. <el-breadcrumb separator-class="el-icon-arrow-right" style="float: left">
  6. <el-breadcrumb-item :to="{ path: 'home' }">{{$t('common.Home')}}</el-breadcrumb-item>
  7. <el-breadcrumb-item :to="{ path: 'resourceSharing' }" class="pointer">{{$t('common.ResourceSharing')}}</el-breadcrumb-item>
  8. <el-breadcrumb-item>{{$t('common.resourceDetails')}}</el-breadcrumb-item>
  9. </el-breadcrumb>
  10. <!-- <el-breadcrumb separator="/" style="float: right;">-->
  11. <!-- <span :class="screenIndex==index?'secNavActive':''"-->
  12. <!-- @click="screenChange(item,index)"-->
  13. <!-- v-for="(item,index) in resourceSharingScreen">-->
  14. <!-- &nbsp;&nbsp;{{$t(item.lable)}} &nbsp;&nbsp;-->
  15. <!-- <span v-if="index+1!==resourceSharingScreen.length" style="color: #2c3e50">/</span></span>-->
  16. <!-- </el-breadcrumb>-->
  17. </div>
  18. </div>
  19. <div class="abstract">
  20. <div class="preview">
  21. <div class="swipers">
  22. <div class="swiper-container gallery-top">
  23. <div class="swiper-wrapper">
  24. <div v-if="bannerList.length==0||bannerList.length==undefined"
  25. >
  26. <img src="../../assets/img/nationaIntorduction/lavle.png" alt style="width: 100%;height: 100%;"
  27. />
  28. </div>
  29. <div v-else="bannerList.length!=0&&bannerList.length!=undefined"
  30. class="swiper-slide"
  31. v-for="(i,index) in bannerList"
  32. :data-swiper-slide-index="i+index">
  33. <video muted :src="'api/file/pub/' + i" style="width: 100%;height: 100%;position: relative;border: none;" class="videos" v-if="index<bannerVideo.length"
  34. type="video/mp4" controls="controls" width="100%" autoplay preload="auto"
  35. ></video>
  36. <!-- autoplay preload="auto"-->
  37. <img :src="'api/file/pub/' + i" alt style="width: 100%;height: 100%;"
  38. v-if="index>=bannerVideo.length"/>
  39. </div>
  40. </div>
  41. <div class="swiper-button-next swiper-button-white"></div>
  42. <div class="swiper-button-prev swiper-button-white"></div>
  43. </div>
  44. <div class="swiper-container gallery-thumbs">
  45. <div class="swiper-wrapper">
  46. <div v-if="bannerList.length==0||bannerList.length==undefined"
  47. class="swiper-slide"
  48. >
  49. <img src="../../assets/img/nationaIntorduction/lavle.png" alt style="width: 100%;height: 100%;">
  50. </div>
  51. <div v-else="bannerList.length!=0&&bannerList.length!=undefined"
  52. class="swiper-slide"
  53. :key="i"
  54. :data-swiper-slide-index="index"
  55. v-for="(i,index) in bannerList"
  56. >
  57. <video :src="'api/file/pub/' + i" style="width: 100%;height: 100%;position: relative"
  58. v-if="index<bannerVideo.length"
  59. ></video>
  60. <img :src="'api/file/pub/' + i" alt style="width: 100%;height: 100%;"
  61. v-if="index>=bannerVideo.length"
  62. />
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="message">
  69. <div style="height: 30px; width: 100%">
  70. <div style="float: right;line-height: 28px;color: rgba(51, 51, 51, 1);">
  71. <!-- <span class="share cursor"-->
  72. <!-- :style="ifcommon?'color: #66b1ff;':''"-->
  73. <!-- style="margin-right: 20px;float: right;"-->
  74. <!-- @click="shareChange()">-->
  75. <!-- <i class="el-icon-star-off" :style="ifcommon?'color: #66b1ff;':''"></i>-->
  76. <!-- {{$i18n.locale=='zh'?ifcommon?"已收藏":"收藏":ifcommon?"Favorites":"Favorites"}}-->
  77. <!-- </span>-->
  78. <i class="el-icon-star-off" style="margin-right: 3px;vertical-align: middle;cursor: pointer;"
  79. :style="ifcommon?'color: #66b1ff;':''"
  80. @click="shareChange()"></i>
  81. <span style="margin-right: 30px;vertical-align: middle;cursor: pointer;"
  82. :style="ifcommon?'color: #66b1ff;':''"
  83. @click="shareChange()"
  84. >{{$i18n.locale=='zh'?ifcommon?"已关注" : "关注":ifcommon?"Already collected":" Collection"}}</span>
  85. <!-- <img src="@/assets/img/ResourceSharing/heat.png" alt="" style="width: 16px;height: 16px;margin-right: 3px;vertical-align: middle;">-->
  86. <!--<i class="el-icon-share" style="margin-right: 3px;vertical-align: middle;"></i>
  87. <span style="margin-right: 30px;vertical-align: middle;">{{$t('common.resourceDetailsShare')}}</span>-->
  88. </div>
  89. <div style="clear: both"></div>
  90. </div>
  91. <p style="margin: 0 0 53px 0;font-size: 30px;font-weight: 600;color: #2C558A;line-height: 30px;">{{cursorContent.name}}</p>
  92. <div>
  93. <ul style="float: left;"
  94. :style="{width:language=='zh'?'30%':'37%','font-size':language=='zh'?'16px':'14px'}"
  95. >
  96. <li><i class="el-icon-baseball" style="margin-right:15px; " ></i>{{$t('common.resourceSite')}}:</li>
  97. <li><i class="el-icon-location-outline" style="margin-right:15px;"></i>{{$t('common.resourceAddress')}}:</li>
  98. <li><i class="el-icon-office-building" style="margin-right:15px;"></i>{{$t('common.resourceSubordinateUnits')}}:</li>
  99. <li><i class="el-icon-phone-outline" style="margin-right:15px;"></i>{{$t('common.resourceContact')}}:</li>
  100. <li><i class="el-icon-message" style="margin-right:15px;"></i>{{$t('common.resourceEmail')}}:</li>
  101. </ul>
  102. <ul style="float: left;color: #333333;"
  103. :style="{width:language=='zh'?'70%':'63%','font-size':language=='zh'?'16px':'14px'}"
  104. >
  105. <li style="color: #333;" :style="{wordBreak:$i18n.locale=='zh'?'normal;':'keep-all'}"class="twoLine" v-if="cursorContent.countryName&&cursorContent.countryName!='null'&&cursorContent.countryName!=null">{{cursorContent.countryName}}</li>
  106. <li style="color: #333" class="twoLine" v-else>/</li>
  107. <li style="color: #333;" :style="{wordBreak:$i18n.locale=='zh'?'normal;':'keep-all'}"class="twoLine" v-if="cursorContent.address&&cursorContent.address!='null'&&cursorContent.address!=null">{{cursorContent.address}}</li>
  108. <li style="color: #333" class="twoLine" v-else>/</li>
  109. <li style="color: #333;" :style="{wordBreak:$i18n.locale=='zh'?'normal;':'keep-all'}" class="twoLine" v-if="cursorContent.affiliatedUnitName&&cursorContent.affiliatedUnitName!='null'&&cursorContent.affiliatedUnitName!=null">{{cursorContent.affiliatedUnitName}}</li>
  110. <li style="color: #333" class="twoLine" v-else>/</li>
  111. <li style="color: #333;" :style="{wordBreak:$i18n.locale=='zh'?'normal;':'keep-all'}"class="twoLine" v-if="cursorContent.contactsNumber&&cursorContent.contactsNumber!='null'&&cursorContent.contactsNumber!=null">{{cursorContent.contactsNumber}}</li>
  112. <li style="color: #333" class="twoLine" v-else>/</li>
  113. <li style="color: #333;" :style="{wordBreak:$i18n.locale=='zh'?'normal;':'keep-all'}"class="twoLine" v-if="cursorContent.contactsEmail&&cursorContent.contactsEmail!='null'&&cursorContent.contactsEmail!=null">{{cursorContent.contactsEmail}}</li>
  114. <li style="color: #333" class="twoLine" v-else>/</li>
  115. </ul>
  116. <div style="clear: both"></div>
  117. </div>
  118. <div>
  119. <div style="text-align: center;height: 50px;border-radius: 25px;background-color: #0091FF;margin: 45px 0 0 135px;"
  120. :style="{width:language=='zh'?'140px':'200px','font-size':language=='zh'?'20px':'16px'}">
  121. <span style="color: white;line-height: 50px;cursor: pointer;" @click="toApply"> {{$t('common.resourceApplicationResearch')}}</span>
  122. </div>
  123. </div>
  124. <!--<div style="height: 30px; width: 100%">
  125. <div style="float: right;line-height: 28px;color: rgba(51, 51, 51, 1);">
  126. <i class="el-icon-star-off" style=" margin-right: 3px;vertical-align: middle;"></i>
  127. <span style="margin-right: 20px;vertical-align: middle;">{{$t('common.resourceDetailsCollection')}}</span>
  128. &lt;!&ndash; <img src="@/assets/img/ResourceSharing/heat.png" alt="" style="width: 16px;height: 16px;margin-right: 3px;vertical-align: middle;">&ndash;&gt;
  129. <i class="el-icon-share" style="margin-right: 3px;vertical-align: middle;"></i>
  130. <span style="margin-right: 30px;vertical-align: middle;">{{$t('common.resourceDetailsShare')}}</span>
  131. </div>
  132. <div style="clear: both"></div>
  133. </div>
  134. <span style="font-size: 20px;font-weight: 700;color: #2C558A;line-height: 42px;">{{cursorContent.name}}</span>
  135. <div style="width: 100%;float: left;color: #333;font-size: 16px;line-height: 16px; line-height: 35px;">
  136. <div>
  137. <i class="el-icon-baseball" style="margin-right:10px;"></i><span style="margin-left: 5px;">{{$t('common.resourceSite')}}:<span style="margin-left: 10px;"></span>{{cursorContent.countryName}}</span>
  138. </div>
  139. <div>
  140. <i class="el-icon-location-outline" style="margin-right:10px;"></i><span style="margin-left: 5px;">{{$t('common.resourceAddress')}}:<span style="margin-left: 10px;"></span>{{cursorContent.address}}</span>
  141. </div>
  142. <div>
  143. <i class="el-icon-office-building" style="margin-right:10px;"></i><span style="margin-left: 5px;">{{$t('common.resourceSubordinateUnits')}}:<span style="margin-left: 10px;"></span>{{cursorContent.affiliatedUnitName}}</span>
  144. </div>
  145. <div>
  146. <i class="el-icon-phone-outline" style="margin-right:10px;"></i><span style="margin-left: 5px;">{{$t('common.resourceContact')}}:<span style="margin-left: 10px;"></span>{{cursorContent.contactsNumber}}</span>
  147. </div>
  148. <div>
  149. <i class="el-icon-message" style="margin-right:10px;"></i><span style="margin-left: 5px;">{{$t('common.resourceEmail')}}:<span style="margin-left: 10px;"></span>{{cursorContent.contactsEmail}}</span>
  150. </div>
  151. </div>
  152. <div style="clear: both"></div>
  153. <div>
  154. <div style="text-align: center;height: 44px;border-radius: 25px;background-color: #0091FF;margin: 15px 0 0 15px;"
  155. :style="{width:language=='zh'?'140px':'200px','font-size':language=='zh'?'20px':'16px'}">
  156. <span style="color: white;line-height: 44px;cursor: pointer;" @click="toApply"> {{$t('common.resourceApplicationResearch')}}</span>
  157. </div>
  158. </div>-->
  159. </div>
  160. <div style="clear: both;"></div>
  161. </div>
  162. <div class="content">
  163. <div style="margin-bottom: 30px;" v-for="(item,index) in informationList">
  164. <div style="margin: 30px 4px 20px;">
  165. <div style="float: left; width: 6px;height: 22px; background-color: #6BC13B;margin-top: 2px;">
  166. <div style="background-color: #1B6ACE;width: 6px; height: 16px;"></div>
  167. </div>
  168. <div style="height: 24px;padding-bottom: 14px;">
  169. <span style="color: #2C558A; font-size: 20px; margin-left: 10px;font-weight: 700;line-height: 24px;">
  170. <!-- {{$t("common.resourceResourcesIsIntroduced")}}-->
  171. {{item.title}}
  172. </span>
  173. </div>
  174. <div style="clear: both;"></div>
  175. </div>
  176. <div>
  177. <!-- <div style="float: left; margin-right: 23px;">-->
  178. <!-- <div style="width: 379px; height: 260px;">-->
  179. <!-- <img src="@/assets/img/ResourceSharing/u27022.png" alt="" style="width: 379px; height: 260px;">-->
  180. <!-- </div>-->
  181. <!-- </div>-->
  182. <div>
  183. <div style="width: 100%;">
  184. <p style="color: #333333;font-size: 14px;line-height: 30px;margin: 0;text-indent: 2em;" v-html="item.content">
  185. <!-- {{cursorContent.details}}-->
  186. </p>
  187. </div>
  188. </div>
  189. <div style="clear: both;"></div>
  190. </div>
  191. </div>
  192. <!--<div style="margin-bottom: 30px;" v-if="cursorContent.mattersNeedingAttention">
  193. <div style="margin: 20px 4px;">
  194. <div style="float: left; width: 6px;height: 22px; background-color: #6BC13B;margin-top: 2px;">
  195. <div style="background-color: #1B6ACE;width: 6px; height: 16px;"></div>
  196. </div>
  197. <div style="height: 24px;padding-bottom: 14px;">
  198. <span style="color: #2C558A; font-size: 20px; margin-left: 10px;font-weight: 700;line-height: 24px;">
  199. {{$t("common.resourceMattersNeedingAttention")}}
  200. </span>
  201. </div>
  202. <div style="clear: both;"></div>
  203. </div>
  204. <div>
  205. <div>
  206. <div style="width: 100%;">
  207. <p style="color: #333333;font-size: 14px;line-height: 30px;margin: 0;text-indent: 2em;" v-html="cursorContent.mattersNeedingAttention">
  208. </p>
  209. </div>
  210. </div>
  211. &lt;!&ndash; <div style="float: right;">&ndash;&gt;
  212. &lt;!&ndash; <div style="width: 379px; height: 260px;">&ndash;&gt;
  213. &lt;!&ndash; <img src="@/assets/img/ResourceSharing/u27022.png" alt="" style="width: 379px; height: 260px;">&ndash;&gt;
  214. &lt;!&ndash; </div>&ndash;&gt;
  215. &lt;!&ndash; </div>&ndash;&gt;
  216. <div style="clear: both;"></div>
  217. </div>
  218. </div>-->
  219. </div>
  220. <div class="recommend" v-show="cursorList[0]">
  221. <div style="border-bottom: 1px solid rgba(44, 85, 138, 1); margin: 20px 4px;">
  222. <div style="float: left; width: 6px;height: 22px; background-color: #6BC13B;margin-top: 2px;">
  223. <div style="background-color: #1B6ACE;width: 6px; height: 16px;"></div>
  224. </div>
  225. <div style="height: 24px;padding-bottom: 14px;">
  226. <span style="color: #2C558A; font-size: 20px; margin-left: 10px;font-weight: 700;line-height: 24px;">
  227. {{$t("common.resourceResearchResourceRecommendation")}}
  228. </span>
  229. </div>
  230. <div style="clear: both;"></div>
  231. </div>
  232. <div style="margin: 30px 0 0 0 ;">
  233. <div v-for="(item,index) in cursorList" style="float: left;cursor: pointer;"
  234. :style="{'margin-left':index==0?'0':'13px'}" @click="toResourceDetails(item,index)"
  235. >
  236. <div style="width: 280px;height: 200px;position: relative;overflow: hidden">
  237. <img v-if="item['researchResourcesMedia']==undefined||item.researchResourcesMedia==false||item.researchResourcesMedia==''||item.researchResourcesMedia=='null'" src="../../assets/img/nationaIntorduction/lavle.png" alt="" style="width: 100%; height: 260px;">
  238. <img v-else :src="'api/file/pub/'+item.researchResourcesMedia" alt="" style="width: 280px;height: 200px;">
  239. <div style="position: absolute;top:0;width: 100%; height: 100%;text-align: center;
  240. background: black;opacity: 0.48;">
  241. <span style="color: white;font-size: 14px; font-weight: 600;line-height: 200px;display:inline-block; max-width: 90%" class="oneLine">{{item.name}}</span>
  242. </div>
  243. </div>
  244. <!--<p style="padding: 0 6px;box-sizing: border-box;width: 280px;text-align: center">
  245. <span style="color: #2C558A;font-size: 14px;font-weight: 600;">
  246. &lt;!&ndash; {{item.likeNum}}人浏览&ndash;&gt;
  247. 15632人浏览
  248. </span>
  249. </p>-->
  250. </div>
  251. <div style="clear: both;"></div>
  252. </div>
  253. </div>
  254. <!-- 登录提示-->
  255. <el-dialog
  256. :title="$i18n.locale=='zh'?'提示':'Reminder'"
  257. :visible.sync="toViewLogin"
  258. :width="$i18n.locale=='zh'?'500px':'750px'"
  259. :height="$i18n.locale=='zh'?'300px':'386px'"
  260. :before-close="toViewLoginChange"
  261. >
  262. <div style="width: 100%;height: 100%;">
  263. <img src="@/assets/img/loginTips.png" alt="" style="width: 180px;height: 180px;margin-left: 20px;">
  264. <div style="float: right;margin-right: 20px;" :style="$i18n.locale=='zh'?'width: 49%;margin-top: 10px;':'width: 453px;margin-top: -25px;'">
  265. <div style="font-size: 20px;font-weight: normal;color: #333333;
  266. font-family: HiraginoSansGB-W3, HiraginoSansGB;
  267. line-height: 40px;">
  268. {{$t('common.ReminderFirst')}}
  269. </div>
  270. <div style="font-size: 16px;font-family: HiraginoSansGB-W3, HiraginoSansGB;
  271. font-weight: normal;color: #666666;line-height: 30px;">
  272. {{$t('common.ReminderSecond')}} <span style="color: #0091FF;font-size: 18px;">{{num}}</span> {{$t('common.ReminderThird')}}
  273. </div>
  274. <div style="font-size: 14px;font-family: HiraginoSansGB-W3, HiraginoSansGB;
  275. font-weight: normal;color: #666666;line-height: 30px;">
  276. {{$t('common.ReminderForth')}}
  277. </div>
  278. <div style="font-size: 14px;font-family: HiraginoSansGB-W3, HiraginoSansGB;
  279. height:33px;line-height:60px;font-weight: normal;color: #0091FF;">
  280. <span style="margin-left: 40px;" class="cursor" @click="toView('login')">
  281. {{$t('common.ReminderFifth')}}
  282. </span>
  283. <span style="margin-left: 10px;" class="cursor" @click="toView('Register')">
  284. {{$t('common.ReminderSixth')}}
  285. </span>
  286. </div>
  287. </div>
  288. </div>
  289. </el-dialog>
  290. </div>
  291. </template>
  292. <script>
  293. import Base from "@/views/base/Base";
  294. import {Swiper} from "vue-awesome-swiper";
  295. import {getDicts} from '@/api/dict';
  296. import { gateResearchResourcesViewById ,getBaseResearchResourcesViews,gateBaseResearchResourcesInfosId,getInformationList} from "@/api/research/resource/baseResearchResourcesView";
  297. import { formatDate } from "@/utils/formatUtils";
  298. import 'vue-awesome-swiper/node_modules/swiper/dist/css/swiper.css'
  299. import {getToken, resetToken} from "@/utils/auth";
  300. import { getFollowModeNumlByModelId,
  301. getFollowModelNumByUser,
  302. saveFollowModel,} from "@/api/operation/basePortalModelFollowInfo";
  303. import {getFollowModeNumlByModelIdAndUserId} from "@/api/operation/basePortalModelFollowInfo";
  304. export default {
  305. name: "resourceSharingResourceDetails",
  306. extends: Base,
  307. data () {
  308. return {
  309. ifcommon: false,
  310. num:5,
  311. timer:'',
  312. toViewLogin:false,
  313. language:this.$i18n.locale,
  314. params: {
  315. entityId:'',
  316. pageNo:'',
  317. pageSize:'',
  318. language:'',
  319. },
  320. screenIndex:1,//研究成果、调研资源选中
  321. resourceSharingScreen:[
  322. {
  323. lable:"common.resource",
  324. value:'0'
  325. },
  326. {
  327. lable:"common.researchResource",
  328. value:'1'
  329. }
  330. ],
  331. cursorContent:{},
  332. bannerImg:[],
  333. bannerVideo:[],
  334. bannerList:[],
  335. cursorList:[],
  336. informationList:[],
  337. }
  338. },
  339. updated() {
  340. this.Swiper();
  341. },
  342. mounted() {
  343. if(this.$route.query.key){
  344. let rpath = { name: 'resourceSharingResourceDetails', query: {key:this.$route.query.key}};
  345. sessionStorage.setItem('pathReminder', JSON.stringify(rpath));
  346. this.Swiper();
  347. this.initData();
  348. }else{
  349. this.toView('resourceSharing',1)
  350. }
  351. },
  352. watch:{
  353. '$i18n.locale'(){
  354. this.initData();
  355. this.language = this.$i18n.locale;
  356. },
  357. "toViewLogin"(){
  358. if(this.toViewLogin==true){
  359. this.loginTipsChange()
  360. }
  361. },
  362. },
  363. methods:{
  364. initData(){
  365. this.getData();
  366. // this.getCursorList();
  367. this.getMyCollecModel(); // 获取用户是否收藏
  368. },
  369. getMyCollecModel(){
  370. const that= this;
  371. if (this.$Cookies.get('token')) {
  372. let user = window.localStorage.getItem('user');
  373. var users = JSON.parse(user);
  374. let MyCollecModel={
  375. modelType:'researchResources',
  376. userId:users.userId,
  377. modelEntityId:JSON.parse(that.$route.query.key).entityId,
  378. }
  379. getFollowModeNumlByModelIdAndUserId(
  380. JSON.parse(that.$route.query.key).entityId,
  381. "researchResources",
  382. this.userId
  383. ).then((res) => {
  384. this.ifcommon = res.data;
  385. });
  386. }
  387. },
  388. //收藏
  389. shareChange() {
  390. // if (this.ifcommon) {
  391. // this.Collection("uncollect");
  392. // } else {
  393. // this.Collection("collect");
  394. // }
  395. if (this.ifcommon) {
  396. this.saveFollowModelDo("unfollow");
  397. }else {
  398. this.saveFollowModelDo("follow");
  399. }
  400. },
  401. //关注操作方法
  402. saveFollowModelDo: function (followType) {
  403. let user = window.localStorage.getItem("user");
  404. if (!this.$Cookies.get('token')) {
  405. // this.$message.warning("请先登录");
  406. // this.$confirm('检测到您未登录,是否登录')
  407. // .then(_ => {
  408. // this.toView('login');
  409. // })
  410. // .catch(_ => {});
  411. this.toViewLogin = true;
  412. } else {
  413. var users = JSON.parse(user);
  414. var token = "" + getToken();
  415. var projectId = JSON.parse(this.$route.query.key).entityId;
  416. var userId = users.userId;
  417. // 接口逻辑
  418. this.submitHandler((token) => {
  419. saveFollowModel(projectId, "researchResources", userId, followType, token)
  420. .then((result) => {
  421. // console.log(result);
  422. /*if(followType=='unfollow'){
  423. if(this.$i18n.locale=='zh'){
  424. this.$message({
  425. message: '取消收藏',
  426. type: "success",
  427. });
  428. }else{
  429. this.$message({
  430. message: 'cancel coilection',
  431. type: "success",
  432. });
  433. }
  434. }else{
  435. if(this.$i18n.locale=='zh'){
  436. this.$message({
  437. message: '已收藏',
  438. type: "success",
  439. });
  440. }else{
  441. this.$message({
  442. message: 'Already collected',
  443. type: "success",
  444. });
  445. }
  446. }*/
  447. if(followType=='unfollow'){
  448. if(this.$i18n.locale=='zh'){
  449. this.$message({
  450. message: '取消关注',
  451. type: "success",
  452. });
  453. }else{
  454. this.$message({
  455. message: 'Cancel concerned',
  456. type: "success",
  457. });
  458. }
  459. }else{
  460. if(this.$i18n.locale=='zh'){
  461. this.$message({
  462. message: '已关注',
  463. type: "success",
  464. });
  465. }else{
  466. this.$message({
  467. message: 'Already concerned',
  468. type: "success",
  469. });
  470. }
  471. }
  472. this.ifcommon = !this.ifcommon;
  473. this.resetToken();
  474. })
  475. .catch((error) => {
  476. // 此处你的业务代码
  477. });
  478. });
  479. }
  480. },
  481. handleSizeChange(val) {
  482. console.log(`每页 ${val} 条`);
  483. },
  484. handleCurrentChange(val) {
  485. console.log(`当前页: ${val}`);
  486. },
  487. screenChange(item,index){
  488. this.toView('resourceSharing',item.value)
  489. },
  490. toResourceDetails(item,index){
  491. /*this.params.entityId = item.entityId;
  492. this.getData()*/
  493. let params = {
  494. entityId:item.entityId,
  495. researchResultFileId:item.researchResultFileId,
  496. }
  497. this.toDetails('resourceSharingResourceDetails',params)
  498. },
  499. toApply(){
  500. if (!this.$Cookies.get('token')){
  501. this.toViewLogin = true;
  502. }else{
  503. let params = {
  504. entityId:JSON.parse(this.$route.query.key).entityId,
  505. name: this.cursorContent.name,
  506. flag: true
  507. }
  508. this.toView('resourceSharingResourceApply',params)
  509. }
  510. },
  511. toView(router, json) {
  512. if(router=='login'||router=='Register'){
  513. clearInterval(this.timer);
  514. }
  515. this.$router.push({ name: router, params: {key:json} });
  516. },
  517. toDetails(router,json){
  518. // this.$store.commit('modify', router);
  519. window.localStorage.setItem('router', router);
  520. localStorage.setItem('conferenceId', json);
  521. const {href} = this.$router.resolve({
  522. name: router,
  523. query: {
  524. key: JSON.stringify(json)
  525. }
  526. });
  527. window.open(href, '_blank');
  528. },
  529. getData(){
  530. const that = this;
  531. let param = {
  532. entityId:'',
  533. pageNo:'',
  534. pageSize:'',
  535. language:'',
  536. effective:'Y',
  537. };
  538. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  539. param.language = 'ZH';
  540. } else if (this.$i18n.locale.toUpperCase() == 'EN') {
  541. param.language = 'EN';
  542. }
  543. if(that.$route.query.key){
  544. param.entityId = JSON.parse(that.$route.query.key).entityId;
  545. }
  546. if(that.params.entityId){
  547. param.entityId = that.params.entityId;
  548. }
  549. gateResearchResourcesViewById(param).then((resulet) => {
  550. let data = resulet.data;
  551. if (data.baseResearchResourcesView) {
  552. that.cursorContent = data.baseResearchResourcesView;
  553. that.cursorContent.createDate = that.cursorContent.createDate ? formatDate(that.cursorContent.createDate, "YYYY-MM-DD") : "";
  554. // 轮播图片
  555. if(that.cursorContent.researchResourcesMedia&&that.cursorContent.researchResourcesMedia!='null'&&that.cursorContent.researchResourcesMedia!=null){
  556. that.bannerImg = that.cursorContent.researchResourcesMedia.split(',')
  557. }
  558. for(let i=0;i<that.bannerImg.length;i++){
  559. that.bannerImg[i] = that.bannerImg[i].replace(' ','')
  560. }
  561. // 轮播视频
  562. if(that.cursorContent.researchResourcesMediaVideo){
  563. that.bannerVideo = that.cursorContent.researchResourcesMediaVideo.split(',')
  564. }
  565. for(let i=0;i<that.bannerVideo.length;i++){
  566. that.bannerVideo[i] = that.bannerVideo[i].replace(' ','')
  567. }
  568. that.bannerList = that.bannerVideo.concat(that.bannerImg)
  569. that.informationList = that.cursorContent.informationList;
  570. that.getCursorList();
  571. }
  572. });
  573. },
  574. getCursorList() {
  575. let that = this;
  576. let param = {
  577. pageNo:1,
  578. pageSize:5,
  579. status: 0,
  580. descStatus: 1
  581. };
  582. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  583. param.language = 'ZH';
  584. } else if (this.$i18n.locale.toUpperCase() == 'EN') {
  585. param.language = 'EN';
  586. }
  587. getBaseResearchResourcesViews(param).then((resulet) => {
  588. let data = resulet.data;
  589. if (data.baseResearchResourcesViews) {
  590. that.cursorList = data.baseResearchResourcesViews;
  591. that.cursorList.forEach((i) => {
  592. i.createDate = i.createDate ? formatDate(i.createDate, "YYYY-MM-DD") : "";
  593. if (i.researchResourcesMedia&&i.researchResourcesMedia!='null'){
  594. i.researchResourcesMedia = i.researchResourcesMedia.split(',')
  595. i.researchResourcesMedia = i.researchResourcesMedia[0]
  596. }
  597. })
  598. let flag = false;
  599. for(let j=0;j<that.cursorList.length;j++){
  600. if(that.cursorList[j].name == that.cursorContent.name){
  601. flag = j;
  602. }
  603. }
  604. if(flag==0||flag!=false) {
  605. that.cursorList.splice(flag,1)
  606. }else{
  607. if(that.cursorList.length>4){
  608. that.cursorList.pop()
  609. }
  610. }
  611. }
  612. });
  613. },
  614. Swiper() {
  615. let that = this;
  616. var galleryThumbs = new Swiper(".gallery-thumbs", {
  617. spaceBetween: 10,
  618. slidesPerView: 4,
  619. freeMode: true,
  620. watchSlidesVisibility: true,
  621. watchSlidesProgress: true,
  622. autoplay: {//自动播放
  623. delay: 4000,
  624. disableOnInteraction: false,//用户操作后是否停止 默认停止(true)
  625. },
  626. });
  627. var galleryTop = new Swiper(".gallery-top", {
  628. spaceBetween: 10,
  629. navigation: {
  630. nextEl: ".swiper-button-next",
  631. prevEl: ".swiper-button-prev"
  632. },
  633. // autoplay: {//自动播放
  634. // delay: 1000,
  635. // disableOnInteraction: false,//用户操作后是否停止 默认停止(true)
  636. // },
  637. autoplay: false,
  638. on:{
  639. slideChange: function(){
  640. that.videoOn(galleryTop)
  641. },
  642. },
  643. thumbs: {
  644. swiper: galleryThumbs
  645. }
  646. });
  647. this.videoInit(galleryTop);
  648. this.videoInit(galleryThumbs);
  649. // var slideChange = function () {
  650. // $('.gallery-thumbs .swiper-slide').each(function( index ) {
  651. // $(this).removeClass("swiper-slide-thumb-active")
  652. // });
  653. // let index = galleryTop.activeIndex
  654. // $('.gallery-thumbs .swiper-slide').eq(index).addClass("swiper-slide-thumb-active")
  655. // };
  656. // slideChange();
  657. },
  658. videoInit(ele){
  659. // $(".videos")[0].play();
  660. $(".videos").on('play', function () {
  661. ele.autoplay.stop()
  662. });
  663. $(".videos").on('pause', function () {
  664. ele.autoplay.start()
  665. });
  666. },
  667. videoOn(ele){
  668. let that = this;
  669. if(ele.activeIndex<that.bannerVideo.length){
  670. $(".videos")[ele.activeIndex].play();
  671. $(".videos").on('play',function(){
  672. ele.autoplay.stop()
  673. });
  674. $(".videos").on('pause',function(){
  675. ele.autoplay.start()
  676. });
  677. }
  678. },
  679. // 判断未登录跳转是否关闭
  680. toViewLoginChange(done){
  681. this.toViewLogin=false;
  682. this.num=5;
  683. clearInterval(this.timer);
  684. },
  685. loginTipsChange(){
  686. const that=this;
  687. this.num =5;
  688. // clearInterval(timer_interval);
  689. this.timer = setInterval(function() {
  690. if (that.num > 0) {
  691. that.num--;
  692. } else {
  693. if(that.toViewLogin==true){
  694. clearInterval(that.timer);
  695. that.toView('login');
  696. }else {
  697. clearInterval(that.timer);
  698. }
  699. }
  700. }, 1000)
  701. },
  702. }
  703. }
  704. </script>
  705. <style scoped>
  706. .oneLine{
  707. /* 隐藏溢出元素 */
  708. overflow: hidden;
  709. /* 单行显示 */
  710. white-space: nowrap;
  711. /* 溢出显示省略号 */
  712. text-overflow: ellipsis;
  713. }
  714. .twoLine{
  715. overflow : hidden;
  716. text-overflow: ellipsis;
  717. display: -webkit-box;
  718. -webkit-line-clamp: 2;
  719. -webkit-box-orient: vertical;
  720. }
  721. .threeLine{
  722. overflow : hidden;
  723. text-overflow: ellipsis;
  724. display: -webkit-box;
  725. -webkit-line-clamp: 3;
  726. -webkit-box-orient: vertical;
  727. }
  728. .box {
  729. margin-top: 10px;
  730. background: #fff;
  731. /* height: 500px; */
  732. padding: 20px;
  733. box-sizing: border-box;
  734. }
  735. .crumbs {
  736. /*margin:0 20px;*/
  737. }
  738. .abstract{
  739. margin-top: 15px;
  740. }
  741. .abstract .preview{
  742. margin-top: 10px;
  743. float: left;
  744. width: 578px;
  745. height: 470px;
  746. position: relative;
  747. }
  748. .swipers {
  749. position: absolute;
  750. top: 0px;
  751. left: 0px;
  752. width: 548px;
  753. height: 470px;
  754. }
  755. .swipers .gallery-top{
  756. width: 100%;
  757. height: 370px;
  758. }
  759. .swiper-container {
  760. width: 100%;
  761. height: 300px;
  762. margin-left: auto;
  763. margin-right: auto;
  764. }
  765. .swiper-slide {
  766. background-size: cover;
  767. background-position: center;
  768. }
  769. .gallery-thumbs {
  770. height: 100px;
  771. box-sizing: border-box;
  772. padding: 10px 0;
  773. }
  774. .gallery-thumbs .swiper-slide {
  775. width: 25%;
  776. height: 100%;
  777. opacity: 0.4;
  778. }
  779. .gallery-thumbs .swiper-slide-thumb-active {
  780. opacity: 1;
  781. }
  782. .abstract .message{
  783. float: right;
  784. width: 550px;
  785. height: 100%;
  786. margin: 0;
  787. box-sizing: border-box;
  788. overflow: hidden;
  789. }
  790. .abstract .message ul{
  791. width: 140px;
  792. height: 252px;
  793. }
  794. .abstract .message ul li{
  795. height: 30px;
  796. color: #999999;
  797. font-size: 16px;
  798. line-height: 16px;
  799. margin-bottom: 29px;
  800. }
  801. .recommend{
  802. margin-top: 50px;
  803. }
  804. </style>