topMenu.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div class="topMenu">
  3. <div class="topLogo">
  4. <img
  5. src="@/assets/images/new_text_log.png"
  6. style="width: 100%; height: 100%"
  7. />
  8. </div>
  9. <div class="menuSty">
  10. <el-dropdown
  11. v-for="(item,index1) in menuList"
  12. :key="index1"
  13. style="margin-right: 40px"
  14. >
  15. <span class="el-dropdown-link">
  16. {{ item.name }}<i class="el-icon-arrow-down el-icon--right"></i>
  17. </span>
  18. <el-dropdown-menu slot="dropdown">
  19. <el-dropdown-item v-for="(it,index2) in item.data" :key="index2">
  20. {{ it.name }}
  21. </el-dropdown-item>
  22. </el-dropdown-menu>
  23. </el-dropdown>
  24. </div>
  25. <div class="topBtn">
  26. <span class="mobileSty">
  27. <i class="el-icon-phone-outline"></i>
  28. 0513-88888888
  29. </span>
  30. <el-button
  31. type="primary"
  32. class="btnSty"
  33. @click="toRegister()"
  34. v-if="methodType === 1"
  35. >注册
  36. </el-button
  37. >
  38. <el-button
  39. type="primary"
  40. class="btnSty"
  41. @click="toLogin()"
  42. v-if="methodType === 2"
  43. >登录
  44. </el-button
  45. >
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import { getLoginPagePopularizeModuleConfigPage } from '@/api/supplier/loginPagePopularizeModuleConfig'
  51. import { getConfigData } from '@/api/infra/config'
  52. export default {
  53. name: 'topMenu',
  54. props: {
  55. methodType: {
  56. type: Number,
  57. default: 2
  58. }
  59. },
  60. data() {
  61. return {
  62. menuList: [
  63. {
  64. name: '行业解决方案',
  65. data: [
  66. { name: '行业解决方案1' },
  67. { name: '行业解决方案2' },
  68. { name: '行业解决方案3' }
  69. ]
  70. },
  71. {
  72. name: '行业标杆',
  73. data: [
  74. { name: '行业标杆1' },
  75. { name: '行业标杆2' },
  76. { name: '行业标杆3' }
  77. ]
  78. },
  79. {
  80. name: '服务支持',
  81. data: [{ name: '服务支持' }]
  82. },
  83. {
  84. name: '关于会助理',
  85. data: [{ name: '关于会助理' }]
  86. }
  87. ],
  88. loginMenuData: []
  89. }
  90. },
  91. mounted() {
  92. getConfigData('login_menu').then(res => {
  93. if (res.data) {
  94. this.menuList = JSON.parse(res.data.value)
  95. this.menuList.forEach(item => {
  96. this.getLoginPageData(item.parentId, 1, item)
  97. })
  98. console.log(this.menuList)
  99. }
  100. })
  101. },
  102. methods: {
  103. getLoginPageData(parentId, type, data) {
  104. let queryParams = {
  105. type: type,
  106. parentId: parentId,
  107. status: 1
  108. }
  109. // 执行查询
  110. getLoginPagePopularizeModuleConfigPage(queryParams).then(response => {
  111. if (response.data) {
  112. response.data.list.forEach(item => {
  113. data.data.push(item)
  114. })
  115. }
  116. })
  117. },
  118. /**
  119. * 跳转登录页面
  120. */
  121. toLogin() {
  122. this.$router.push('/login').catch(() => {
  123. })
  124. },
  125. /**
  126. * 跳转注册页面
  127. */
  128. toRegister() {
  129. this.$router.push('/register').catch(() => {
  130. })
  131. }
  132. }
  133. }
  134. </script>
  135. <style scoped>
  136. .menuSty {
  137. float: left;
  138. width: 40%;
  139. height: 100%;
  140. display: flex;
  141. align-items: center;
  142. }
  143. .mobileSty {
  144. font-family: Microsoft YaHei, Microsoft YaHei;
  145. font-weight: 400;
  146. font-size: 18px;
  147. color: #333333;
  148. line-height: 18px;
  149. text-align: left;
  150. font-style: normal;
  151. text-transform: none;
  152. }
  153. .btnSty {
  154. font-size: 20px;
  155. width: 102px;
  156. height: 50px;
  157. margin-left: 3%;
  158. }
  159. .topBtn {
  160. float: left;
  161. width: 28%;
  162. height: 100%;
  163. display: flex;
  164. align-items: center;
  165. }
  166. .topLogo {
  167. float: left;
  168. width: 20%;
  169. height: 100%;
  170. margin-left: 12%;
  171. }
  172. .topMenu {
  173. background: #f0f7ff;
  174. height: 8vh;
  175. }
  176. .dropdown-link-text {
  177. font-size: 20px;
  178. font-weight: bold;
  179. }
  180. .el-dropdown-link {
  181. cursor: pointer;
  182. font-family: Microsoft YaHei, Microsoft YaHei;
  183. font-weight: 400;
  184. font-size: 16px;
  185. color: #333333;
  186. line-height: 18px;
  187. text-align: left;
  188. font-style: normal;
  189. text-transform: none;
  190. }
  191. .el-icon-arrow-down {
  192. font-size: 12px;
  193. }
  194. </style>