userCenter.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. <template>
  2. <div>
  3. <div class="autoBox box cool">
  4. <div class="crumbs">
  5. <el-breadcrumb separator="/">
  6. <el-breadcrumb-item :to="{ path: 'home' }" replace>{{
  7. $t('common.Home')
  8. }}</el-breadcrumb-item>
  9. <el-breadcrumb-item :to="{ path: 'userCenterView' }" replace
  10. >{{ $t('common.UserCenter') }}
  11. </el-breadcrumb-item>
  12. <el-breadcrumb-item
  13. v-if="lable !== '' && $route.path !== '/userCenterView'"
  14. >{{ $t(lable) }}
  15. </el-breadcrumb-item>
  16. </el-breadcrumb>
  17. </div>
  18. </div>
  19. <!-- 左侧菜单导航 -->
  20. <div class="autoBox box1" :class="user ? 'box2' : 'box1'">
  21. <div style="height: 800px" class="userItemClass">
  22. <div
  23. style="
  24. width: 100%;
  25. height: 50px;
  26. text-align: center;
  27. line-height: 50px;
  28. color: #fff;
  29. background: #2c5589;
  30. "
  31. class="cursor"
  32. @click="toView('userCenterView')"
  33. >
  34. {{ $t('common.UserCenter') }}
  35. </div>
  36. <el-row class="tac">
  37. <el-col :span="24">
  38. <el-menu
  39. class="el-menu-vertical-demo"
  40. @select="handleOpen"
  41. @close="handleClose"
  42. unique-opened
  43. :default-active="navRouter"
  44. router
  45. >
  46. <!-- <el-menu-item index="2" style="width: 100%;text-align: center;color: #fff;background: #2c5589;">
  47. <span slot="title">用户中心</span>
  48. </el-menu-item> -->
  49. <div v-if="isTrue">
  50. <el-submenu
  51. :index="index + ''"
  52. v-for="(nav, index) in navs1"
  53. :key="index"
  54. >
  55. <template slot="title">
  56. <i :class="nav.icon"></i>
  57. <span>{{ $t(nav.lable) }}</span>
  58. </template>
  59. <el-menu-item-group>
  60. <el-menu-item
  61. :index="navChild.router"
  62. v-for="(navChild, num) in nav.child"
  63. :key="num"
  64. >
  65. {{ $t(navChild.lable) }}
  66. </el-menu-item>
  67. </el-menu-item-group>
  68. </el-submenu>
  69. </div>
  70. <div v-else>
  71. <el-submenu
  72. :index="index + ''"
  73. v-for="(nav, index) in navs"
  74. :key="index"
  75. >
  76. <template slot="title">
  77. <i :class="nav.icon"></i>
  78. <span>{{ $t(nav.lable) }}</span>
  79. </template>
  80. <el-menu-item-group>
  81. <el-menu-item
  82. :index="navChild.router"
  83. v-for="(navChild, num) in nav.child"
  84. :key="num"
  85. >
  86. {{ $t(navChild.lable) }}
  87. </el-menu-item>
  88. </el-menu-item-group>
  89. </el-submenu>
  90. </div>
  91. </el-menu>
  92. </el-col>
  93. </el-row>
  94. </div>
  95. <!-- 个人中心内容显示 -->
  96. <div style="width: 82%; float: right">
  97. <router-view />
  98. </div>
  99. </div>
  100. <div style="clear: both"></div>
  101. </div>
  102. </template>
  103. <script>
  104. import HeaderItem from '@/components/headerItem'
  105. import tabers from '@/components/taber'
  106. import footers from '@/components/footers'
  107. import Screen from '@/components/screen'
  108. import CooperationExchangeItems from '@/views/cooperationExchange/CooperationExchangeItem'
  109. import CooperationExchangeList from '@/views/cooperationExchange/CooperationExchangeList'
  110. import userCenterView from '@/views/userCenter/userCenterView'
  111. export default {
  112. name: 'userCenter',
  113. components: {
  114. tabers,
  115. HeaderItem,
  116. footers,
  117. Screen,
  118. CooperationExchangeItems,
  119. CooperationExchangeList,
  120. userCenterView,
  121. },
  122. data() {
  123. return {
  124. navRouter: this.$route.query.key,
  125. i: 0,
  126. user: true,
  127. locale: '',
  128. videoBox: 1500,
  129. lable: '',
  130. initData: [
  131. {
  132. img: 'cool001.gif',
  133. data: {
  134. title: '2020国际水资源大会',
  135. time: '2020-10-05',
  136. place: '中国-北京',
  137. describe: '大会将聚焦清洁能源开发与亚洲转型发展、跨国跨区合作、...',
  138. num: '986',
  139. },
  140. },
  141. {
  142. img: 'cool001.gif',
  143. data: {
  144. title: '2020国际水资源大会',
  145. time: '2020-10-05',
  146. place: '中国-北京',
  147. describe: '大会将聚焦清洁能源开发与亚洲转型发展、跨国跨区合作、...',
  148. num: '986',
  149. },
  150. },
  151. {
  152. img: 'cool001.gif',
  153. data: {
  154. title: '2020国际水资源大会',
  155. time: '2020-10-05',
  156. place: '中国-北京',
  157. describe: '大会将聚焦清洁能源开发与亚洲转型发展、跨国跨区合作、...',
  158. num: '986',
  159. },
  160. },
  161. ],
  162. screen: [
  163. {
  164. value: '1',
  165. lable: '全部选择',
  166. },
  167. {
  168. value: '1',
  169. lable: '会员活动',
  170. },
  171. {
  172. value: '1',
  173. lable: '联盟活动',
  174. },
  175. {
  176. value: '1',
  177. lable: '合作单位活动',
  178. },
  179. ],
  180. recommend: [
  181. {
  182. img: 'u6029.png',
  183. num: '2934',
  184. },
  185. {
  186. img: 'u6029.png',
  187. num: '2934',
  188. },
  189. {
  190. img: 'u6029.png',
  191. num: '2934',
  192. },
  193. {
  194. img: 'u6029.png',
  195. num: '2934',
  196. },
  197. {
  198. img: 'u6029.png',
  199. num: '2934',
  200. },
  201. ],
  202. userUsertypeDict: '',
  203. navsBase: [
  204. {
  205. lable: 'common.MessageCenter',
  206. icon: 'el-icon-chat-line-round',
  207. value: '1',
  208. child: [
  209. {
  210. lable: 'common.SystemMessage',
  211. router: '/SystemMessage',
  212. value: '1',
  213. },
  214. {
  215. lable: 'common.notification',
  216. router: '/notification',
  217. value: '1',
  218. },
  219. {
  220. lable: 'common.Interactive',
  221. router: '/communication',
  222. value: '1',
  223. },
  224. ],
  225. },
  226. {
  227. lable: 'common.ManagementCenter',
  228. value: '1',
  229. icon: 'el-icon-setting',
  230. child: [
  231. {
  232. lable: 'common.MyApplication',
  233. router: '/myConcerns',
  234. value: '1',
  235. },
  236. {
  237. lable: 'common.MyProject',
  238. router: '/myProject',
  239. value: '1',
  240. },
  241. {
  242. router: '/myActivity',
  243. lable: 'common.MyActivities',
  244. value: '1',
  245. },
  246. {
  247. router: '/myConsultingService',
  248. lable: 'common.MyAdvice',
  249. value: '1',
  250. },
  251. {
  252. lable: 'common.MyAttention',
  253. router: '/myFollow',
  254. value: '1',
  255. },
  256. {
  257. lable: 'common.MySubscription',
  258. router: '/mySubscribe',
  259. value: '1',
  260. },
  261. {
  262. lable: 'common.MyCollection',
  263. router: '/myCollection',
  264. value: '1',
  265. },
  266. {
  267. lable: 'common.ApplicationHistory',
  268. router: '/ApplicationHistory',
  269. value: '1',
  270. },
  271. // 我的资源共享
  272. {
  273. lable: 'common.myResourceSharing',
  274. router: '/myResourceSharing',
  275. value: '1',
  276. },
  277. ],
  278. },
  279. {
  280. lable: 'common.InfoDataCenter',
  281. value: '1',
  282. icon: 'el-icon-setting',
  283. child: [
  284. // 我的资讯
  285. {
  286. lable: 'common.myInfoData',
  287. router: '/myInfoData',
  288. value: '1',
  289. },
  290. ],
  291. },
  292. {
  293. lable: 'common.MyAccount',
  294. value: '1',
  295. icon: 'el-icon-user',
  296. child: [
  297. {
  298. lable: 'common.BasicInformation',
  299. value: 'information',
  300. router: 'information',
  301. },
  302. {
  303. lable: 'common.RealAuthentication',
  304. router: '/authentication',
  305. value: 'authentication',
  306. },
  307. {
  308. lable: 'common.SecuritySettings',
  309. router: '/securitySetting',
  310. value: 'securitySetting',
  311. },
  312. {
  313. lable: 'common.FeetBack',
  314. router: '/userCenterMyFeedBackService',
  315. value: 'userCenterMyFeedBackService',
  316. },
  317. ],
  318. },
  319. ],
  320. navs: [
  321. {
  322. lable: 'common.MessageCenter',
  323. icon: 'el-icon-chat-line-round',
  324. value: '1',
  325. child: [
  326. {
  327. lable: 'common.SystemMessage',
  328. router: '/SystemMessage',
  329. value: '1',
  330. },
  331. {
  332. lable: 'common.notification',
  333. router: '/notification',
  334. value: '1',
  335. },
  336. {
  337. lable: 'common.Interactive',
  338. router: '/communication',
  339. value: '1',
  340. },
  341. ],
  342. },
  343. {
  344. lable: 'common.ManagementCenter',
  345. value: '1',
  346. icon: 'el-icon-setting',
  347. child: [
  348. {
  349. lable: 'common.MyApplication',
  350. router: '/myConcerns',
  351. value: '1',
  352. },
  353. {
  354. lable: 'common.MyProject',
  355. router: '/myProject',
  356. value: '1',
  357. },
  358. {
  359. router: '/myActivity',
  360. lable: 'common.MyActivities',
  361. value: '1',
  362. },
  363. {
  364. router: '/myConsultingService',
  365. lable: 'common.MyAdvice',
  366. value: '1',
  367. },
  368. {
  369. lable: 'common.MyAttention',
  370. router: '/myFollow',
  371. value: '1',
  372. },
  373. {
  374. lable: 'common.MySubscription',
  375. router: '/mySubscribe',
  376. value: '1',
  377. },
  378. {
  379. lable: 'common.MyCollection',
  380. router: '/myCollection',
  381. value: '1',
  382. },
  383. {
  384. lable: 'common.ApplicationHistory',
  385. router: '/ApplicationHistory',
  386. value: '1',
  387. },
  388. // 我的资源共享
  389. {
  390. lable: 'common.myResourceSharing',
  391. router: '/myResourceSharing',
  392. value: '1',
  393. },
  394. // 我的订单
  395. {
  396. lable: 'common.myOrder',
  397. router: '/userCenterMyOrder',
  398. value: '1',
  399. },
  400. ],
  401. },
  402. {
  403. lable: 'common.InfoDataCenter',
  404. value: '1',
  405. icon: 'el-icon-setting',
  406. child: [
  407. // 我的资讯
  408. {
  409. lable: 'common.myInfoData',
  410. router: '/myInfoData',
  411. value: '1',
  412. },
  413. ],
  414. },
  415. {
  416. lable: 'common.MyAccount',
  417. value: '1',
  418. icon: 'el-icon-user',
  419. child: [
  420. {
  421. lable: 'common.BasicInformation',
  422. value: 'information',
  423. router: 'information',
  424. },
  425. {
  426. lable: 'common.RealAuthentication',
  427. router: '/authentication',
  428. value: 'authentication',
  429. },
  430. {
  431. lable: 'common.SecuritySettings',
  432. router: '/securitySetting',
  433. value: 'securitySetting',
  434. },
  435. {
  436. lable: 'common.integralAccount',
  437. router: '/userCenterIntegralAccount',
  438. value: 'userCenterIntegralAccount',
  439. },
  440. {
  441. lable: 'common.integralExchange',
  442. router: '/userCenterIntegralExchange',
  443. value: 'userCenterIntegralExchange',
  444. },
  445. {
  446. lable: 'common.rightsRank',
  447. router: '/userCenterRightsRank',
  448. value: 'userCenterRightsRank',
  449. },
  450. {
  451. lable: 'common.FeetBack',
  452. router: '/userCenterMyFeedBackService',
  453. value: 'userCenterMyFeedBackService',
  454. },
  455. ],
  456. },
  457. ],
  458. navs1: [
  459. {
  460. lable: 'common.MessageCenter',
  461. icon: 'el-icon-chat-line-round',
  462. value: '1',
  463. child: [
  464. {
  465. lable: 'common.SystemMessage',
  466. router: '/SystemMessage',
  467. value: '1',
  468. },
  469. {
  470. lable: 'common.notification',
  471. router: '/notification',
  472. value: '1',
  473. },
  474. {
  475. lable: 'common.Interactive',
  476. router: '/communication',
  477. value: '1',
  478. },
  479. ],
  480. },
  481. {
  482. lable: 'common.ManagementCenter',
  483. value: '1',
  484. icon: 'el-icon-setting',
  485. child: [
  486. {
  487. lable: 'common.MyApplication',
  488. router: '/myConcerns',
  489. value: '1',
  490. },
  491. {
  492. lable: 'common.MyProject',
  493. router: '/myProject',
  494. value: '1',
  495. },
  496. {
  497. router: '/myActivity',
  498. lable: 'common.MyActivities',
  499. value: '1',
  500. },
  501. {
  502. router: '/myConsultingService',
  503. lable: 'common.MyAdvice',
  504. value: '1',
  505. },
  506. {
  507. lable: 'common.MyAttention',
  508. router: '/myFollow',
  509. value: '1',
  510. },
  511. {
  512. lable: 'common.MySubscription',
  513. router: '/mySubscribe',
  514. value: '1',
  515. },
  516. {
  517. lable: 'common.MyCollection',
  518. router: '/myCollection',
  519. value: '1',
  520. },
  521. {
  522. lable: 'common.ApplicationHistory',
  523. router: '/ApplicationHistory',
  524. value: '1',
  525. },
  526. // 我的资源共享
  527. {
  528. lable: 'common.myResourceSharing',
  529. router: '/myResourceSharing',
  530. value: '1',
  531. },
  532. // 我的订单
  533. // {
  534. // lable: "common.myOrder",
  535. // router: "/userCenterMyOrder",
  536. // value: "1",
  537. // },
  538. ],
  539. },
  540. {
  541. lable: 'common.InfoDataCenter',
  542. value: '1',
  543. icon: 'el-icon-setting',
  544. child: [
  545. // 我的资讯
  546. {
  547. lable: 'common.myInfoData',
  548. router: '/myInfoData',
  549. value: '1',
  550. },
  551. ],
  552. },
  553. {
  554. lable: 'common.MyAccount',
  555. value: '1',
  556. icon: 'el-icon-user',
  557. child: [
  558. {
  559. lable: 'common.BasicInformation',
  560. value: 'information',
  561. router: 'information',
  562. },
  563. {
  564. lable: 'common.RealAuthentication',
  565. router: '/authentication',
  566. value: 'authentication',
  567. },
  568. {
  569. lable: 'common.SecuritySettings',
  570. router: '/securitySetting',
  571. value: 'securitySetting',
  572. },
  573. // {
  574. // lable: 'common.integralAccount',
  575. // router: '/userCenterIntegralAccount',
  576. // value: 'userCenterIntegralAccount',
  577. // },
  578. // {
  579. // lable: 'common.integralExchange',
  580. // router: '/userCenterIntegralExchange',
  581. // value: 'userCenterIntegralExchange',
  582. // },
  583. // {
  584. // lable: "common.rightsRank",
  585. // router: "/userCenterRightsRank",
  586. // value: "userCenterRightsRank",
  587. // },
  588. {
  589. lable: 'common.FeetBack',
  590. router: '/userCenterMyFeedBackService',
  591. value: 'userCenterMyFeedBackService',
  592. },
  593. ],
  594. },
  595. ],
  596. }
  597. },
  598. watch: {
  599. user: function () {
  600. if (this.user) {
  601. this.videoBox = 1500
  602. } else {
  603. this.videoBox = 700
  604. }
  605. },
  606. },
  607. mounted() {
  608. console.log('*****')
  609. this.locale = this.$i18n.locale
  610. console.log(
  611. this.$i18n.locale,
  612. 'this.$i18n.localethis.$i18n.localethis.$i18n.locale'
  613. )
  614. this.initData11()
  615. },
  616. updated() {
  617. if (this.$route.query.key) {
  618. this.navRouter = this.$route.query.key
  619. }
  620. },
  621. methods: {
  622. initData11() {
  623. var data = JSON.parse(window.localStorage.getItem('user'))
  624. this.userUsertypeDict = data.umsUser.userUsertypeDict
  625. console.log(this.userUsertypeDict)
  626. },
  627. getIconUrl(url) {
  628. return require('@/assets/img/cooperationExchange/' + url)
  629. },
  630. toView(router, json) {
  631. this.$router.push({ name: router, params: { key: json } })
  632. },
  633. screenBack(data) {
  634. console.log(data, 'screenBackscreenBackscreenBackscreenBack')
  635. },
  636. screens(item, index) {
  637. this.i = index
  638. },
  639. handleOpen(key, keyPath) {
  640. this.navs.forEach((i, index) => {
  641. i.child.forEach((item, g) => {
  642. if (item.router == key) {
  643. return (this.lable = item.lable)
  644. }
  645. })
  646. })
  647. },
  648. handleClose(key, keyPath) {
  649. console.log(key, keyPath)
  650. this.$store.commit('modify', key)
  651. },
  652. },
  653. computed: {
  654. isTrue() {
  655. if (this.userUsertypeDict === '2') {
  656. console.log('高级用户')
  657. return true
  658. } else {
  659. console.log('普通用户')
  660. return false
  661. }
  662. },
  663. },
  664. }
  665. </script>
  666. <!-- Add "scoped" attribute to limit CSS to this component only -->
  667. <style scoped>
  668. .box {
  669. margin-top: 10px;
  670. background: #fff;
  671. /* height: 500px; */
  672. padding: 20px 0;
  673. }
  674. .crumbs {
  675. margin-left: 20px;
  676. }
  677. .box1 {
  678. padding: 0;
  679. /* transform: translateX(-20px); */
  680. margin-top: 15px;
  681. height: 700px;
  682. }
  683. .box2 {
  684. padding: 0;
  685. /* transform: translateX(-20px); */
  686. margin-top: 15px;
  687. }
  688. body {
  689. margin: 0;
  690. }
  691. .el-carousel__item div:nth-child(1) {
  692. font-size: 18px;
  693. margin: 0;
  694. float: left;
  695. width: 70%;
  696. }
  697. .el-carousel__item div:nth-child(2) {
  698. font-size: 18px;
  699. margin: 0;
  700. float: right;
  701. width: 30%;
  702. }
  703. .el-carousel__item:nth-child(n) {
  704. background-color: #ecedef;
  705. color: #000;
  706. }
  707. .cool >>> .el-carousel__container {
  708. height: 350px;
  709. }
  710. .screen1 {
  711. padding: 10px 18px;
  712. font-size: 14px;
  713. background-color: #e8e8e8;
  714. }
  715. .screen2 {
  716. padding: 10px 18px;
  717. font-size: 14px;
  718. background-color: #12559c;
  719. color: #fff;
  720. }
  721. .initData {
  722. height: 1200px;
  723. }
  724. .initData li {
  725. width: 49%;
  726. height: 600px;
  727. float: left;
  728. }
  729. .initData li:nth-child(2n-1) {
  730. margin-right: 15px;
  731. }
  732. .recommend {
  733. margin-top: 15px;
  734. margin-left: 10px;
  735. }
  736. .recommend li {
  737. display: inline-block;
  738. width: 212px;
  739. /* height: 130px; */
  740. text-align: center;
  741. margin-right: 15px;
  742. }
  743. .el-col-12 {
  744. width: 100%;
  745. }
  746. .el-submenu .el-menu-item {
  747. min-width: 0;
  748. }
  749. .userItemClass {
  750. width: 17%;
  751. background: #fff;
  752. float: left;
  753. }
  754. </style>