MemberTop.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  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-color: $colorMain;
  111. margin-bottom: 10px;
  112. .container {
  113. width: 1210px;
  114. margin: 0 auto;
  115. padding-left: 0px;
  116. padding-right: 0px;
  117. &:after,
  118. &:before {
  119. display: table;
  120. content: " ";
  121. }
  122. .fl {
  123. float: left;
  124. }
  125. .fr {
  126. float: right;
  127. }
  128. }
  129. .sld_left_part {
  130. color: #fff;
  131. dt {
  132. float: left;
  133. width: 127px;
  134. height: 60px;
  135. margin: 5px 35px 0px 0px;
  136. img {
  137. cursor: pointer;
  138. }
  139. &.sld_img_center {
  140. position: relative;
  141. width: 120px;
  142. overflow: hidden;
  143. a {
  144. width: 100%;
  145. height: 100%;
  146. }
  147. img {
  148. max-width: 100%;
  149. max-height: 100%;
  150. }
  151. }
  152. }
  153. dd {
  154. position: relative;
  155. float: left;
  156. a {
  157. display: block;
  158. line-height: 64px;
  159. color: rgba(255, 255, 255, 0.8);
  160. margin: 0 25px;
  161. font-size: 15px;
  162. &.router-link-active {
  163. &::after {
  164. position: absolute;
  165. bottom: 0;
  166. left: 50%;
  167. content: "";
  168. width: 0;
  169. height: 0;
  170. transform: translateX(-50%);
  171. border-width: 6px;
  172. border-style: solid;
  173. border-color: transparent transparent #fff transparent;
  174. }
  175. }
  176. .msg_num {
  177. display: block;
  178. position: absolute;
  179. background: #ffffff;
  180. color: $colorMain2;
  181. min-width: 20px;
  182. height: 20px;
  183. border-radius: 10px;
  184. right: 5px;
  185. top: 10px;
  186. line-height: 20px;
  187. text-align: center;
  188. }
  189. &.cur_tag_active {
  190. &::after {
  191. position: absolute;
  192. bottom: 0;
  193. left: 50%;
  194. content: "";
  195. width: 0;
  196. height: 0;
  197. transform: translateX(-50%);
  198. border-width: 6px;
  199. border-style: solid;
  200. border-color: transparent transparent #fff transparent;
  201. }
  202. }
  203. .account_arrow {
  204. color: rgba(255, 255, 255, 0.8);
  205. font-size: 10px;
  206. margin-left: 2px;
  207. display: inline-block;
  208. }
  209. &:hover {
  210. .account_arrow {
  211. transform: rotate(180deg);
  212. transition: transform 0.2s ease-in 0s,
  213. -webkit-transform 0.2s ease-in 0s;
  214. }
  215. }
  216. }
  217. .account_tag:hover {
  218. .account_popup {
  219. display: block;
  220. opacity: 1;
  221. -webkit-animation: showPopUp 0.4s ease-in-out;
  222. animation: showPopUp 0.4s ease-in-out;
  223. @-webkit-keyframes showPopUp {
  224. 0% {
  225. opacity: 0;
  226. }
  227. to {
  228. opacity: 1;
  229. }
  230. }
  231. @keyframes showPopUp {
  232. 0% {
  233. opacity: 0;
  234. }
  235. to {
  236. opacity: 1;
  237. }
  238. }
  239. }
  240. }
  241. .account_popup {
  242. display: none;
  243. opacity: 0;
  244. top: 40px;
  245. left: 50%;
  246. margin-left: -50px;
  247. padding: 15px 0;
  248. width: auto;
  249. position: absolute;
  250. z-index: 11;
  251. &::before {
  252. z-index: 1;
  253. top: 10px;
  254. margin-left: -5px;
  255. width: 10px;
  256. height: 10px;
  257. box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
  258. background-color: #fff;
  259. }
  260. &::after,
  261. &::before {
  262. content: "";
  263. position: absolute;
  264. left: 50%;
  265. -webkit-transform: rotate(45deg);
  266. -ms-transform: rotate(45deg);
  267. transform: rotate(45deg);
  268. }
  269. .content {
  270. padding: 10px 0 10px 23px;
  271. overflow: hidden;
  272. box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
  273. background-color: #fff;
  274. .content_item {
  275. float: left;
  276. width: 100%;
  277. color: #333;
  278. -webkit-transition: all 0.4s ease;
  279. transition: all 0.4s ease;
  280. height: 30px;
  281. line-height: 30px;
  282. font-size: 12px;
  283. margin: 0;
  284. &:hover {
  285. color: $colorMain;
  286. }
  287. }
  288. }
  289. }
  290. }
  291. }
  292. .sld_cart_part {
  293. float: right;
  294. position: relative;
  295. z-index: 99;
  296. width: 150px;
  297. height: 40px;
  298. margin-top: 16px;
  299. margin-right: 3px;
  300. margin-bottom: 0px;
  301. dd {
  302. top: 32px;
  303. position: absolute;
  304. right: 0;
  305. width: 355px;
  306. border: 1px solid #e3e3e3;
  307. background: #fff;
  308. z-index: 3;
  309. }
  310. dl {
  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: $colorMain2;
  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 13px 0 12px;
  351. color: $colorMain2;
  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. color: #666666;
  373. font-size: 14px;
  374. line-height: 30px;
  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. height: 32px;
  407. background-color: #fff;
  408. margin-top: 16px;
  409. margin-right: 20px;
  410. input {
  411. height: 30px;
  412. border: none;
  413. outline: none;
  414. background-color: #fff;
  415. &.text {
  416. width: 202px;
  417. line-height: 30px;
  418. padding-left: 10px;
  419. }
  420. &.button {
  421. height: 32px;
  422. color: #666666;
  423. font-size: 14px;
  424. cursor: pointer;
  425. padding: 0 15px;
  426. border-left: 1px solid #ddd;
  427. }
  428. }
  429. }
  430. }
  431. }
  432. </style>