MemberTop.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. <template>
  2. <div class="sld_member_top">
  3. <div class="sld_member_top_zoom clearfix">
  4. <div class="container">
  5. <dl class="fl sld_left_part">
  6. <dt class="sld-user-logo sld_img_center">
  7. <router-link tag="a" :to="`/`" class="flex_row_start_center">
  8. <img
  9. :src="memberLogo"
  10. :onerror="defaultImg"
  11. />
  12. </router-link>
  13. </dt>
  14. <dd>
  15. <router-link
  16. tag="a"
  17. :to="`/member/home`"
  18. :class="{ cur_tag_active: curTag == 1 }"
  19. >
  20. {{ L["首页"] }}
  21. </router-link>
  22. </dd>
  23. </dl>
  24. <div class="fr">
  25. <div class="sld_search_part fl">
  26. <input
  27. v-model="keyword"
  28. type="text"
  29. class="text"
  30. :placeholder="L['请输入关键词']"
  31. autocomplete="off "
  32. style="color: rgb(153, 153, 153)"
  33. @focus="inputFocus"
  34. ref="searchInput"
  35. />
  36. <input
  37. type="submit"
  38. :value="L['搜索']"
  39. class="button"
  40. @click="search"
  41. />
  42. </div>
  43. </div>
  44. <div class="sld_cart_part">
  45. <dl>
  46. <dt class="ld first_dt center_text">
  47. <span class="iconfont"> <img style="width:20px;position:relative; top:3px" src="/email.svg"/> </span>
  48. <s></s>
  49. <router-link :to="`/member/enquiry/list`">
  50. {{ L["我的询盘"] }}
  51. </router-link>
  52. </dt>
  53. <!-- <dd class="cart_more_view">
  54. <cart-model></cart-model>
  55. </dd> -->
  56. </dl>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </template>
  62. <script setup>
  63. // import { lang_zn } from "@/assets/language/zh";
  64. import { getCurLanguage } from '@/composables/common.js';
  65. import { useUserInfo } from "@/store/user.js";
  66. import { useFiltersStore } from "@/store/filter.js";
  67. const filtersStore = useFiltersStore();
  68. // const L = lang_zn;
  69. const L = getCurLanguage();
  70. const configInfo = useUserInfo();
  71. const { proxy } = getCurrentInstance();
  72. const keyword = ref("");
  73. const curTag = ref(1); //当前选中的tag,1为首页,2为账户管理,3为消息
  74. const router = useRouter();
  75. const cartData = reactive({ data: {} });
  76. const memberInfo = reactive({ data: {} }); //个人信息
  77. const defaultImg = ref("/member/top_logo.png");
  78. const memberLogo = ref('')
  79. const getMemberLogo = () => {
  80. get('v3/system/front/setting/getSettings?names=main_user_center_logo').then(res=>{
  81. memberLogo.value = res.data[0]
  82. })
  83. }
  84. getMemberLogo()
  85. onMounted(() => {
  86. memberInfo.data = filtersStore.getMemberInfo;
  87. });
  88. //搜索事件
  89. const search = () => {
  90. proxy.$refs.searchInput.style.color = "rgb(153,153,153)";
  91. if (keyword.value) {
  92. router.push({ path: "/goods/list/search_keyword-"+ keyword.value });
  93. }
  94. };
  95. const inputFocus = () => {
  96. proxy.$refs.searchInput.style.color = "#333";
  97. };
  98. watchEffect(() => {
  99. // let tmpRoute = router.currentRoute.value;
  100. // if (tmpRoute.fullPath.indexOf("/msg/") > -1) {
  101. // curTag.value = 3;
  102. // }
  103. // memberInfo.data = store.state.memberInfo;
  104. });
  105. </script>
  106. <style lang="scss" scoped>
  107. .sld_member_top {
  108. width: 100%;
  109. background: #F6F8FA;
  110. .sld_member_top_zoom {
  111. width: 1210px;
  112. margin: 0 auto;
  113. .container {
  114. width: 100%;
  115. display: flex;
  116. align-items: center;
  117. &:after,
  118. &:before {
  119. display: table;
  120. content: " ";
  121. }
  122. .fl {
  123. }
  124. .fr {
  125. display: flex;
  126. align-items: center;
  127. justify-content: center;
  128. flex: 1;
  129. width: 100%;
  130. overflow: hidden;
  131. }
  132. }
  133. .sld_left_part {
  134. color: #fff;
  135. dt {
  136. float: left;
  137. width: 127px;
  138. height: 60px;
  139. // margin: 5px 35px 0px 0px;
  140. img {
  141. cursor: pointer;
  142. }
  143. &.sld_img_center {
  144. position: relative;
  145. width: 120px;
  146. overflow: hidden;
  147. a {
  148. width: 100%;
  149. height: 100%;
  150. }
  151. img {
  152. max-width: 100%;
  153. max-height: 100%;
  154. }
  155. }
  156. }
  157. dd {
  158. position: relative;
  159. float: left;
  160. background: #FFFFFF;
  161. a {
  162. display: block;
  163. line-height: 64px;
  164. margin: 0 25px;
  165. font-weight: bold;
  166. font-size: 16px;
  167. color: #282E30;
  168. &.router-link-active {
  169. &::after {
  170. // position: absolute;
  171. // bottom: 0;
  172. // left: 50%;
  173. // content: "";
  174. // width: 0;
  175. // height: 0;
  176. // transform: translateX(-50%);
  177. // border-width: 6px;
  178. // border-style: solid;
  179. // border-color: transparent transparent #fff transparent;
  180. }
  181. }
  182. .msg_num {
  183. display: block;
  184. position: absolute;
  185. background: #ffffff;
  186. color: $colorMain;
  187. min-width: 20px;
  188. height: 20px;
  189. border-radius: 10px;
  190. right: 5px;
  191. top: 10px;
  192. line-height: 20px;
  193. text-align: center;
  194. }
  195. &.cur_tag_active {
  196. &::after {
  197. position: absolute;
  198. bottom: 0;
  199. left: 0;
  200. content: "";
  201. width: 100%;
  202. height: 4px;
  203. background-color: $colorMain;
  204. // transform: translateX(-50%);
  205. // border-width: 6px;
  206. // border-style: solid;
  207. // border-color: transparent transparent red transparent;
  208. }
  209. }
  210. .account_arrow {
  211. color: rgba(255, 255, 255, 0.8);
  212. font-size: 10px;
  213. margin-left: 2px;
  214. display: inline-block;
  215. }
  216. &:hover {
  217. .account_arrow {
  218. transform: rotate(180deg);
  219. transition: transform 0.2s ease-in 0s,
  220. -webkit-transform 0.2s ease-in 0s;
  221. }
  222. }
  223. }
  224. .account_tag:hover {
  225. .account_popup {
  226. display: block;
  227. opacity: 1;
  228. -webkit-animation: showPopUp 0.4s ease-in-out;
  229. animation: showPopUp 0.4s ease-in-out;
  230. @-webkit-keyframes showPopUp {
  231. 0% {
  232. opacity: 0;
  233. }
  234. to {
  235. opacity: 1;
  236. }
  237. }
  238. @keyframes showPopUp {
  239. 0% {
  240. opacity: 0;
  241. }
  242. to {
  243. opacity: 1;
  244. }
  245. }
  246. }
  247. }
  248. .account_popup {
  249. display: none;
  250. opacity: 0;
  251. top: 40px;
  252. left: 50%;
  253. margin-left: -50px;
  254. padding: 15px 0;
  255. width: auto;
  256. position: absolute;
  257. z-index: 11;
  258. &::before {
  259. z-index: 1;
  260. top: 10px;
  261. margin-left: -5px;
  262. width: 10px;
  263. height: 10px;
  264. box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
  265. background-color: #fff;
  266. }
  267. &::after,
  268. &::before {
  269. content: "";
  270. position: absolute;
  271. left: 50%;
  272. -webkit-transform: rotate(45deg);
  273. -ms-transform: rotate(45deg);
  274. transform: rotate(45deg);
  275. }
  276. .content {
  277. padding: 10px 0 10px 23px;
  278. overflow: hidden;
  279. box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
  280. background-color: #fff;
  281. .content_item {
  282. float: left;
  283. width: 100%;
  284. color: #333;
  285. -webkit-transition: all 0.4s ease;
  286. transition: all 0.4s ease;
  287. height: 30px;
  288. line-height: 30px;
  289. font-size: 12px;
  290. margin: 0;
  291. &:hover {
  292. color: $colorMain;
  293. }
  294. }
  295. }
  296. }
  297. }
  298. }
  299. .sld_cart_part {
  300. z-index: 99;
  301. width: 150px;
  302. height: 100%;
  303. dd {
  304. // width: 355px;
  305. border: 1px solid #e3e3e3;
  306. background: #fff;
  307. z-index: 3;
  308. }
  309. dl {
  310. text-align: center;
  311. dd {
  312. .incart_goods {
  313. dl {
  314. padding-top: 8px;
  315. }
  316. dd {
  317. &.mcart_price {
  318. position: static;
  319. em {
  320. margin-right: 6px;
  321. width: auto;
  322. color: #666;
  323. &:nth-child(1) {
  324. display: block;
  325. font-weight: 600;
  326. }
  327. &:nth-child(2) {
  328. display: block;
  329. text-align: right;
  330. margin-top: 6px;
  331. }
  332. }
  333. }
  334. }
  335. }
  336. }
  337. .addcart_goods_num {
  338. font: 11px/16px Verdana;
  339. color: #fff;
  340. background: $colorMain;
  341. text-align: center;
  342. display: inline-block;
  343. height: 16px;
  344. min-width: 16px;
  345. border: none 0;
  346. border-radius: 8px;
  347. margin-left: 10px;
  348. }
  349. .iconfont {
  350. margin: 0 10px 0 0;
  351. color: $colorMain;
  352. font-size: 17px;
  353. font-weight: 600;
  354. vertical-align: bottom;
  355. }
  356. }
  357. dt {
  358. position: absolute;
  359. z-index: 3;
  360. // width: 165px;
  361. height: 38px;
  362. border: 1px solid #e3e3e3;
  363. background-color: #fff;
  364. cursor: pointer;
  365. font-weight: 400;
  366. line-height: 30px;
  367. }
  368. .first_dt {
  369. // width: 130px;
  370. height: 32px;
  371. a {
  372. font-weight: bold;
  373. font-size: $fontE;
  374. color: $colorMain;
  375. }
  376. }
  377. .cart_more_view {
  378. display: none;
  379. .empty_cart {
  380. width: 100%;
  381. position: relative;
  382. .empty_cart_line {
  383. position: absolute;
  384. width: 163px;
  385. right: 0;
  386. height: 2px;
  387. top: -2px;
  388. z-index: 999;
  389. background: #fff;
  390. }
  391. .empty_cart_txt {
  392. padding: 10px;
  393. color: #999;
  394. }
  395. }
  396. }
  397. &:hover .cart_more_view {
  398. display: inline-block;
  399. }
  400. .ld {
  401. position: relative;
  402. zoom: 1;
  403. }
  404. }
  405. .sld_search_part {
  406. width: 480px;
  407. display: flex;
  408. align-items: center;
  409. justify-content: center;
  410. height: 32px;
  411. background-color: #fff;
  412. input {
  413. height: 30px;
  414. border: none;
  415. outline: none;
  416. background-color: #fff;
  417. &.text {
  418. flex: 1;
  419. width: 100%;
  420. overflow: hidden;
  421. line-height: 30px;
  422. padding-left: 10px;
  423. }
  424. &.button {
  425. height: 32px;
  426. color: #fff;
  427. background-color: $colorMain;
  428. font-size: 14px;
  429. cursor: pointer;
  430. padding: 0 15px;
  431. border-left: 1px solid #ddd;
  432. }
  433. }
  434. }
  435. }
  436. }
  437. </style>