index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div class="header">
  3. <div class="main-cen">
  4. <div class="dis_just">
  5. <div class="left">
  6. 欢迎您进入广州市建设工程消防协会!
  7. <span v-if="$store.state.token"
  8. >{{ $store.state.userInfo.Account
  9. }}<span
  10. style="cursor: pointer; color: red; margin-left: 14px"
  11. @click="$store.commit('CLEAR_Token_UserInfo')"
  12. >退出</span
  13. ></span
  14. ><span style="cursor: pointer; color: red" v-else @click="login"
  15. >请登录</span
  16. ><span v-if="!$store.state.token" style="margin: 0px 10px">|</span
  17. ><span
  18. style="cursor: pointer; color: red"
  19. v-if="!$store.state.token"
  20. class="links"
  21. @click="joinVip"
  22. >会员申请</span
  23. >
  24. </div>
  25. <div class="right">
  26. <span v-if="$store.state.token" style="cursor: pointer" @click="userInfo"
  27. >会员中心</span
  28. ><span v-if="$store.state.token" style="margin: 0px 10px">|</span>
  29. <span class="links" @click="suggestion">网站建议</span>
  30. </div>
  31. </div>
  32. <div class="dis_flex">
  33. <img
  34. @click="$router.replace('/')"
  35. src="@/assets/images/logo.png"
  36. alt=""
  37. />
  38. <div class="right">
  39. <input
  40. v-model.trim="searchKey"
  41. class="input_x"
  42. type="text"
  43. placeholder="请输入关键词搜索"
  44. />
  45. <div class="btn" @click="submit">
  46. <img src="@/assets/images/icon_search@2x.png" alt="" />
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <!--顶部-->
  52. <membership ref="membership"></membership>
  53. <suggestion ref="suggestion"></suggestion>
  54. <login-dialog ref="login"></login-dialog>
  55. <user-info ref="userInfo"></user-info>
  56. </div>
  57. </template>
  58. <script>
  59. import loginDialog from "@/components/login-dialog/index.vue";
  60. import membership from "@/components/membership";
  61. import suggestion from "@/components/suggestion";
  62. import userInfo from "@/components/userInfo/index.vue";
  63. export default {
  64. components: { loginDialog, membership, suggestion,userInfo },
  65. data() {
  66. return {
  67. week: "",
  68. searchKey: "",
  69. };
  70. },
  71. created() {
  72. if (this.$route.query && this.$route.query.mid && this.$route.query.Newpwd)
  73. this.$api
  74. .XfWebApiGetMemberApplyRc({
  75. mid: this.$route.query.mid,
  76. Newpwd: this.$route.query.Newpwd,
  77. })
  78. .then((res) => {
  79. this.$confirm("入会申请已驳回,是否前往重新编辑", "提示", {
  80. confirmButtonText: "确定",
  81. cancelButtonText: "取消",
  82. type: "warning",
  83. })
  84. .then(() => {
  85. res.Data.Newpwd = this.$route.query.Newpwd;
  86. this.$refs.membership.showInit(res.Data);
  87. })
  88. .catch(() => {});
  89. });
  90. },
  91. methods: {
  92. userInfo() {
  93. this.$refs.userInfo.showInit();
  94. },
  95. login() {
  96. this.$refs.login.showInit();
  97. },
  98. //入会申请
  99. joinVip() {
  100. this.$refs.membership.showInit();
  101. },
  102. //网站建议
  103. suggestion() {
  104. this.$refs.suggestion.showInit();
  105. },
  106. submit() {
  107. if (!this.searchKey) {
  108. this.$message.warning("请输入关键词");
  109. return;
  110. }
  111. this.$router.push({
  112. path: "searchKey",
  113. query: {
  114. key: this.searchKey,
  115. },
  116. });
  117. return;
  118. },
  119. },
  120. };
  121. </script>
  122. <style lang="scss" scoped>
  123. .header {
  124. color: #303030;
  125. position: relative;
  126. z-index: 1;
  127. height: 180px;
  128. background: url("../../assets/images/BG_db@2x.png") no-repeat center center;
  129. background-size: cover;
  130. flex-shrink: 0;
  131. }
  132. .main-cen {
  133. max-width: 1200px;
  134. margin: 0 auto;
  135. }
  136. .dis_just {
  137. font-size: 14px;
  138. padding-top: 28px;
  139. padding-bottom: 28px;
  140. display: flex;
  141. align-items: center;
  142. justify-content: space-between;
  143. & > .left {
  144. }
  145. & > .right {
  146. & > span {
  147. margin-right: 6px;
  148. }
  149. }
  150. }
  151. .dis_flex {
  152. display: flex;
  153. align-items: center;
  154. justify-content: space-between;
  155. & > img {
  156. cursor: pointer;
  157. width: 400px;
  158. height: 70px;
  159. }
  160. & > .right {
  161. display: flex;
  162. align-items: center;
  163. & > .input_x {
  164. padding: 11px;
  165. border: 1px solid #3975C6;
  166. height: 40px;
  167. line-height: 40px;
  168. }
  169. & > .btn {
  170. width: 52px;
  171. height: 40px;
  172. background-color: #3975C6;
  173. display: flex;
  174. justify-content: center;
  175. align-items: center;
  176. cursor: pointer;
  177. img {
  178. width: 24px;
  179. height: 24px;
  180. }
  181. }
  182. }
  183. }
  184. .links {
  185. cursor: pointer;
  186. user-select: none;
  187. }
  188. </style>