MemberTop.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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. .sld_member_top_zoom {
  109. width: 100%;
  110. background: #F6F8FA;
  111. .container {
  112. width: 100%;
  113. padding: 0 240px;
  114. display: flex;
  115. align-items: center;
  116. &:after,
  117. &:before {
  118. display: table;
  119. content: " ";
  120. }
  121. .fl {
  122. }
  123. .fr {
  124. display: flex;
  125. align-items: center;
  126. justify-content: center;
  127. flex: 1;
  128. width: 100%;
  129. overflow: hidden;
  130. }
  131. }
  132. .sld_left_part {
  133. color: #fff;
  134. dt {
  135. float: left;
  136. width: 127px;
  137. height: 60px;
  138. // margin: 5px 35px 0px 0px;
  139. img {
  140. cursor: pointer;
  141. }
  142. &.sld_img_center {
  143. position: relative;
  144. width: 120px;
  145. overflow: hidden;
  146. a {
  147. width: 100%;
  148. height: 100%;
  149. }
  150. img {
  151. max-width: 100%;
  152. max-height: 100%;
  153. }
  154. }
  155. }
  156. dd {
  157. position: relative;
  158. float: left;
  159. background: #FFFFFF;
  160. a {
  161. display: block;
  162. line-height: 64px;
  163. margin: 0 25px;
  164. font-weight: bold;
  165. font-size: 16px;
  166. color: #282E30;
  167. &.router-link-active {
  168. &::after {
  169. // position: absolute;
  170. // bottom: 0;
  171. // left: 50%;
  172. // content: "";
  173. // width: 0;
  174. // height: 0;
  175. // transform: translateX(-50%);
  176. // border-width: 6px;
  177. // border-style: solid;
  178. // border-color: transparent transparent #fff transparent;
  179. }
  180. }
  181. .msg_num {
  182. display: block;
  183. position: absolute;
  184. background: #ffffff;
  185. color: $colorMain;
  186. min-width: 20px;
  187. height: 20px;
  188. border-radius: 10px;
  189. right: 5px;
  190. top: 10px;
  191. line-height: 20px;
  192. text-align: center;
  193. }
  194. &.cur_tag_active {
  195. &::after {
  196. position: absolute;
  197. bottom: 0;
  198. left: 0;
  199. content: "";
  200. width: 100%;
  201. height: 4px;
  202. background-color: $colorMain;
  203. // transform: translateX(-50%);
  204. // border-width: 6px;
  205. // border-style: solid;
  206. // border-color: transparent transparent red transparent;
  207. }
  208. }
  209. .account_arrow {
  210. color: rgba(255, 255, 255, 0.8);
  211. font-size: 10px;
  212. margin-left: 2px;
  213. display: inline-block;
  214. }
  215. &:hover {
  216. .account_arrow {
  217. transform: rotate(180deg);
  218. transition: transform 0.2s ease-in 0s,
  219. -webkit-transform 0.2s ease-in 0s;
  220. }
  221. }
  222. }
  223. .account_tag:hover {
  224. .account_popup {
  225. display: block;
  226. opacity: 1;
  227. -webkit-animation: showPopUp 0.4s ease-in-out;
  228. animation: showPopUp 0.4s ease-in-out;
  229. @-webkit-keyframes showPopUp {
  230. 0% {
  231. opacity: 0;
  232. }
  233. to {
  234. opacity: 1;
  235. }
  236. }
  237. @keyframes showPopUp {
  238. 0% {
  239. opacity: 0;
  240. }
  241. to {
  242. opacity: 1;
  243. }
  244. }
  245. }
  246. }
  247. .account_popup {
  248. display: none;
  249. opacity: 0;
  250. top: 40px;
  251. left: 50%;
  252. margin-left: -50px;
  253. padding: 15px 0;
  254. width: auto;
  255. position: absolute;
  256. z-index: 11;
  257. &::before {
  258. z-index: 1;
  259. top: 10px;
  260. margin-left: -5px;
  261. width: 10px;
  262. height: 10px;
  263. box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
  264. background-color: #fff;
  265. }
  266. &::after,
  267. &::before {
  268. content: "";
  269. position: absolute;
  270. left: 50%;
  271. -webkit-transform: rotate(45deg);
  272. -ms-transform: rotate(45deg);
  273. transform: rotate(45deg);
  274. }
  275. .content {
  276. padding: 10px 0 10px 23px;
  277. overflow: hidden;
  278. box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
  279. background-color: #fff;
  280. .content_item {
  281. float: left;
  282. width: 100%;
  283. color: #333;
  284. -webkit-transition: all 0.4s ease;
  285. transition: all 0.4s ease;
  286. height: 30px;
  287. line-height: 30px;
  288. font-size: 12px;
  289. margin: 0;
  290. &:hover {
  291. color: $colorMain;
  292. }
  293. }
  294. }
  295. }
  296. }
  297. }
  298. .sld_cart_part {
  299. z-index: 99;
  300. width: 150px;
  301. height: 100%;
  302. dd {
  303. // width: 355px;
  304. border: 1px solid #e3e3e3;
  305. background: #fff;
  306. z-index: 3;
  307. }
  308. dl {
  309. text-align: center;
  310. dd {
  311. .incart_goods {
  312. dl {
  313. padding-top: 8px;
  314. }
  315. dd {
  316. &.mcart_price {
  317. position: static;
  318. em {
  319. margin-right: 6px;
  320. width: auto;
  321. color: #666;
  322. &:nth-child(1) {
  323. display: block;
  324. font-weight: 600;
  325. }
  326. &:nth-child(2) {
  327. display: block;
  328. text-align: right;
  329. margin-top: 6px;
  330. }
  331. }
  332. }
  333. }
  334. }
  335. }
  336. .addcart_goods_num {
  337. font: 11px/16px Verdana;
  338. color: #fff;
  339. background: $colorMain;
  340. text-align: center;
  341. display: inline-block;
  342. height: 16px;
  343. min-width: 16px;
  344. border: none 0;
  345. border-radius: 8px;
  346. margin-left: 10px;
  347. }
  348. .iconfont {
  349. margin: 0 10px 0 0;
  350. color: $colorMain;
  351. font-size: 17px;
  352. font-weight: 600;
  353. vertical-align: bottom;
  354. }
  355. }
  356. dt {
  357. position: absolute;
  358. z-index: 3;
  359. // width: 165px;
  360. height: 38px;
  361. border: 1px solid #e3e3e3;
  362. background-color: #fff;
  363. cursor: pointer;
  364. font-weight: 400;
  365. line-height: 30px;
  366. }
  367. .first_dt {
  368. // width: 130px;
  369. height: 32px;
  370. a {
  371. font-weight: bold;
  372. font-size: $fontE;
  373. color: $colorMain;
  374. }
  375. }
  376. .cart_more_view {
  377. display: none;
  378. .empty_cart {
  379. width: 100%;
  380. position: relative;
  381. .empty_cart_line {
  382. position: absolute;
  383. width: 163px;
  384. right: 0;
  385. height: 2px;
  386. top: -2px;
  387. z-index: 999;
  388. background: #fff;
  389. }
  390. .empty_cart_txt {
  391. padding: 10px;
  392. color: #999;
  393. }
  394. }
  395. }
  396. &:hover .cart_more_view {
  397. display: inline-block;
  398. }
  399. .ld {
  400. position: relative;
  401. zoom: 1;
  402. }
  403. }
  404. .sld_search_part {
  405. width: 480px;
  406. display: flex;
  407. align-items: center;
  408. justify-content: center;
  409. height: 32px;
  410. background-color: #fff;
  411. input {
  412. height: 30px;
  413. border: none;
  414. outline: none;
  415. background-color: #fff;
  416. &.text {
  417. flex: 1;
  418. width: 100%;
  419. overflow: hidden;
  420. line-height: 30px;
  421. padding-left: 10px;
  422. }
  423. &.button {
  424. height: 32px;
  425. color: #fff;
  426. background-color: $colorMain;
  427. font-size: 14px;
  428. cursor: pointer;
  429. padding: 0 15px;
  430. border-left: 1px solid #ddd;
  431. }
  432. }
  433. }
  434. }
  435. }
  436. </style>