LeftNav.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <div class="wrapper">
  3. <div class="left-nav" :style="{height: navHeight}">
  4. <div class="nav-title">{{topTitle}}</div>
  5. <div class="nav-item" v-for="item in navList" :key="item.id"
  6. :class="{'action': currentUrl.indexOf(item.path) !== -1 }" @click="navTo(item.path)">
  7. <div class="item-name">
  8. {{item.name}}
  9. </div>
  10. <div class="item-icon">
  11. >
  12. </div>
  13. </div>
  14. </div>
  15. <div class="right-content">
  16. <div class="title moren" v-if="isShow">
  17. {{rightTitle}}
  18. </div>
  19. <template v-else>
  20. <div class="title hand" style="display: inline-block;" :class="{'action': currentIndex !== 0}"
  21. @click="changeClik(0)">
  22. 基础知识
  23. </div>
  24. <div class="title hand" style="display: inline-block;" :class="{'action': currentIndex !== 1}"
  25. @click="changeClik(1)">
  26. 如何报名
  27. </div>
  28. </template>
  29. <div style="padding: 35px 50px 35px 50px;" class="line">
  30. <slot></slot>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. props: {
  38. navList: {
  39. type: Array,
  40. default: []
  41. },
  42. topTitle: {
  43. type: String,
  44. default: '公众参与'
  45. }
  46. },
  47. computed: {
  48. isShow() {
  49. return this.$route.path !== '/donation/Hpc'
  50. },
  51. navHeight() {
  52. return this.navList.length * 51 + 52 + 'px'
  53. },
  54. currentUrl() {
  55. return this.$route.path
  56. },
  57. rightTitle() {
  58. let title = ''
  59. switch (this.currentUrl) {
  60. case '/donation/contribution':
  61. title = '爱心捐赠'
  62. break;
  63. case '/donation/organDonation':
  64. title = '遗体及器官捐献'
  65. break;
  66. case '/join/rescue':
  67. title = '成为“救在身边”志愿者'
  68. break;
  69. case '/join/member':
  70. title = '会员入会登记'
  71. break
  72. case '/join/volunteer':
  73. title = '志愿者报名'
  74. break
  75. case '/join/train':
  76. title = '普及培训报名'
  77. break
  78. case '/about/chineseRedCross':
  79. title = '关于中国红十字会'
  80. break
  81. case '/about/matrix':
  82. title = '微信矩阵'
  83. break
  84. case '/about/redCrossLaw':
  85. title = '中国红十字会法'
  86. break
  87. case '/about/redCrossMovement':
  88. title = '关于红十字运动'
  89. break
  90. case '/concat':
  91. title = '信息公开'
  92. break
  93. case '/concat/publicity/list':
  94. title = '公告公示'
  95. break
  96. case '/concat/publicity/detail':
  97. title = '公告公示'
  98. break
  99. case '/concat/rules/list':
  100. title = '规章制度'
  101. break
  102. case '/concat/rules/detail':
  103. title = '规章制度'
  104. break
  105. case '/concat/finance/list':
  106. title = '财务信息'
  107. break
  108. case '/concat/finance/detail':
  109. title = '财务信息'
  110. break
  111. case '/concat/donation/list':
  112. title = '社会捐赠信息'
  113. break
  114. case '/concat/donation/detail':
  115. title = '社会捐赠信息'
  116. break
  117. case '/concat/expenditure/list':
  118. title = '捐赠款物支出信息'
  119. break
  120. case '/concat/expenditure/detail':
  121. title = '捐赠款物支出信息'
  122. break
  123. case '/concat/concat/detail':
  124. title = '联系我们'
  125. break
  126. case '/popularScience/list':
  127. title = '红会科普'
  128. break
  129. case '/popularScience/detail':
  130. title = '红会科普'
  131. break
  132. case '/news/list':
  133. title = '红会新闻'
  134. break
  135. case '/news/detail':
  136. title = '红会新闻'
  137. break
  138. case '/publicity/list':
  139. title = '公示公告'
  140. break
  141. case '/publicity/detail':
  142. title = '公示公告'
  143. break
  144. case '/regulations/detail':
  145. title = '政策法规'
  146. break
  147. case '/regulations/list':
  148. title = '政策法规'
  149. break
  150. case '/regulations':
  151. title = '政策法规'
  152. break
  153. case '/knowledge/rescue/list':
  154. title = '救护培训'
  155. break
  156. case '/knowledge/rescue/detail':
  157. title = '救护培训'
  158. break
  159. case '/knowledge/cells/detail':
  160. title = '造血干细胞'
  161. break
  162. case '/knowledge/cells/list':
  163. title = '造血干细胞'
  164. break
  165. case '/knowledge/bloodDonation/list':
  166. title = '无偿献血'
  167. break
  168. case '/knowledge/bloodDonation/detail':
  169. title = '无偿献血'
  170. break
  171. case '/knowledge/development/detail':
  172. title = '红十字发展'
  173. break
  174. case '/knowledge/development/list':
  175. title = '红十字发展'
  176. break
  177. case '/newContent/jlx/detail':
  178. title = '江陵县红会'
  179. break
  180. case '/newContent/jlx/list':
  181. title = '江陵县红会'
  182. break
  183. case '/newContent/jzq/list':
  184. title = '荆州区红会'
  185. break
  186. case '/newContent/jzq/detail':
  187. title = '荆州区红会'
  188. break
  189. case '/newContent/szs/list':
  190. title = '松滋市红会'
  191. break
  192. case '/newContent/szs/detail':
  193. title = '松滋市红会'
  194. break
  195. case '/newContent/sss/list':
  196. title = '石首市红会'
  197. break
  198. case '/newContent/sss/detail':
  199. title = '石首市红会'
  200. break
  201. case '/newContent/jls/list':
  202. title = '监利市红会'
  203. break
  204. case '/newContent/jls/detail':
  205. title = '监利市红会'
  206. break
  207. case '/newContent/ssq/list':
  208. title = '沙市区红会'
  209. break
  210. case '/newContent/ssq/detail':
  211. title = '沙市区市红会'
  212. break
  213. case '/newContent/hhs/list':
  214. title = '洪湖市红会'
  215. break
  216. case '/newContent/hhs/detail':
  217. title = '洪湖市红会'
  218. break
  219. case '/newContent/gnx/list':
  220. title = '公安县红会'
  221. break
  222. case '/newContent/gnx/detail':
  223. title = '公安县红会'
  224. break
  225. case '/directories/list':
  226. title = '造血干细胞捐献名录'
  227. break
  228. case '/directories/detail':
  229. title = '造血干细胞捐献名录'
  230. break
  231. case '/organs/detail':
  232. title = '器官/遗体捐献名录'
  233. break
  234. case '/organs/list':
  235. title = '器官/遗体捐献名录'
  236. break
  237. case '/cause/cells/list':
  238. title = '造血干细胞捐献'
  239. break
  240. case '/cause/cells/detail':
  241. title = '造血干细胞捐献'
  242. break
  243. case '/cause/emergency/detail':
  244. title = '应急救护'
  245. break
  246. case '/cause/emergency/list':
  247. title = '应急救护'
  248. break
  249. case '/cause/free/detail':
  250. title = '无偿献血'
  251. break
  252. case '/cause/free/list':
  253. title = '无偿献血'
  254. break
  255. case '/cause/humanity/detail':
  256. title = '人道救助'
  257. break
  258. case '/cause/humanity/list':
  259. title = '人道救助'
  260. break
  261. case '/cause/remains/detail':
  262. title = '遗体和人体器官捐献'
  263. break
  264. case '/cause/remains/list':
  265. title = '遗体和人体器官捐献'
  266. break
  267. case '/cause/rescue/detail':
  268. title = '应急救援'
  269. break
  270. case '/cause/rescue/list':
  271. title = '应急救援'
  272. break
  273. case '/cause/service/detail':
  274. title = '志愿服务'
  275. break
  276. case '/cause/service/list':
  277. title = '志愿服务'
  278. break
  279. case '/cause/teenagers/detail':
  280. title = '红十字志愿服务和青少年'
  281. break
  282. case '/cause/teenagers/list':
  283. title = '红十字志愿服务和青少年'
  284. break
  285. default:
  286. title = ''
  287. }
  288. return title
  289. }
  290. },
  291. data() {
  292. return {
  293. currentIndex: 0
  294. }
  295. },
  296. methods: {
  297. navTo(path) {
  298. // console.log(path,'dddddddddddddddd')
  299. let currentUrl = this.$route.path
  300. if (currentUrl === path) {
  301. return
  302. } else {
  303. this.$router.push(path)
  304. }
  305. },
  306. changeClik(index) {
  307. this.currentIndex = index
  308. this.$router.push('/donation/Hpc?id=' + index)
  309. }
  310. }
  311. }
  312. </script>
  313. <style lang="scss" scoped>
  314. .wrapper {
  315. width: 1200px;
  316. display: flex;
  317. justify-content: space-between;
  318. }
  319. .left-nav {
  320. width: 265px;
  321. // height: 154px;
  322. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  323. .nav-title {
  324. height: 52px;
  325. background-color: #d82020;
  326. line-height: 52px;
  327. text-align: center;
  328. font-size: 18px;
  329. font-family: PingFang SC;
  330. font-weight: bold;
  331. color: #FFFFFF;
  332. letter-spacing: 3px;
  333. cursor: default;
  334. }
  335. .nav-item {
  336. cursor: pointer;
  337. border-top: 1px #fcfbfb solid;
  338. display: flex;
  339. height: 50px;
  340. background-color: #f2eeef;
  341. justify-content: space-between;
  342. line-height: 50px;
  343. padding: 0 20px 0 26px;
  344. .item-name {
  345. font-size: 16px;
  346. font-family: PingFang SC;
  347. font-weight: bold;
  348. color: #333333;
  349. letter-spacing: 1px
  350. }
  351. .item-icon {
  352. font-size: 16px;
  353. font-family: PingFang SC;
  354. font-weight: bold;
  355. color: #999999;
  356. }
  357. }
  358. .action {
  359. background-color: #f7dfdf;
  360. }
  361. }
  362. .right-content {
  363. width: 915px;
  364. min-height: 706px;
  365. border-top: 2px solid #D82020;
  366. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  367. .title {
  368. border: 2px #d82020 solid;
  369. // width: 200px;
  370. min-width: 180px;
  371. display: inline-block;
  372. padding: 0 10px;
  373. height: 50px;
  374. line-height: 50px;
  375. text-align: center;
  376. background: #D82020;
  377. font-size: 18px;
  378. font-family: PingFang SC;
  379. font-weight: bold;
  380. color: #FFFFFF;
  381. position: relative;
  382. top: -2px;
  383. }
  384. .action {
  385. background: #FFFFFF;
  386. color: #D82020;
  387. }
  388. }
  389. .line {
  390. line-height: 1.5;
  391. }
  392. </style>