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