header.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  1. <template>
  2. <div class="fixed-wrap" :style="{ position: basicSet.set.set_top == 1 ? 'relative' : 'fixed' }">
  3. <div class="welcome" v-if="top_type == 'other'"
  4. :style="{ marginTop: headOver ? (basicSet.set && basicSet.set.pc_temp == 1 ? '-32px' : '-35px') : '', height: basicSet.set && basicSet.set.pc_temp == 1 ? '32px' : '35px' }">
  5. <div class="welcome-content flex flex-j-sb flex-a-c"
  6. :style="{ height: basicSet.set && basicSet.set.pc_temp == 1 ? '32px' : '35px' }">
  7. <div class="welcome-left flex flex-a-c">
  8. <div class="tips">您好,欢迎光临{{ basicSet.shop_name }}!</div>
  9. <div class="flex flex-a-c logo-box" v-if="!basicSet.is_login">
  10. <span @click="toUrl('login', { select: '1' })">微信扫码登录</span>|<span
  11. @click="toUrl('login', { select: '0' })">免登陆</span>
  12. </div>
  13. <div class="flex flex-a-c logo-box" v-if="basicSet.is_login">
  14. <span @click="logout">退出登录</span>
  15. </div>
  16. </div>
  17. <div class="welcome-right flex flex-a-c">
  18. <template v-if="basicSet.set && basicSet.set.pc_temp == 1">
  19. <!-- 模板样式1 -->
  20. <div style="margin-right: 15px" @click="toUrl('member-collection')" v-if="basicSet.is_login">我的收藏</div>
  21. <div @click="toUrl('order')">我的订单/</div>
  22. </template>
  23. <template v-if="basicSet.set && basicSet.set.pc_temp == 2">
  24. <div class="icon-item" @click="toUrl('order')">
  25. <img src="~/assets/images/icon/my.png">
  26. <div class="icon-item-text">我的</div>
  27. </div>
  28. <div class="icon-item" v-if="basicSet.is_login" @click="toUrl('cart')">
  29. <img style="width: 16px;height: 16px;" src="~/assets/images/icon/detail_gouwu.png">
  30. <div class="icon-item-text">购物车</div>
  31. </div>
  32. <div class="icon-item" v-if="basicSet.is_login" @click="toUrl('member-collection')">
  33. <img src="~/assets/images/icon/collect.png">
  34. <div class="icon-item-text">收藏</div>
  35. </div>
  36. </template>
  37. <div class="flex flex-a-c mobile_version">
  38. 手机版
  39. <img src="~/assets/images/icon/down.png" style="margin-left:2px;cursor: pointer;">
  40. <div class="hide_block">
  41. <div class="mini_code m-auto">
  42. <!--<img :src="basicSet.qr_code" alt="">-->
  43. <canvas id="qrccode-canvas"></canvas>
  44. </div>
  45. <span>扫一扫进入</span>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="header flex flex-a-c" :class="{ 'hide-shadow': basicSet.set && basicSet.set.pc_temp == 2 }"
  52. :style="{ height: basicSet.set && basicSet.set.pc_temp == 1 ? '100px' : '140px' }">
  53. <div class="top flex flex-a-c flex-j-sb">
  54. <div class="left" @click="toUrl('home')" v-if="basicSet.set">
  55. <img :src="basicSet.set.logo_src" style="margin-right:20px;">
  56. <!--<span class="advert_words overflow-hide">{{basicSet.set.advert_words}}</span>-->
  57. </div>
  58. <div class="right-img" v-if="top_type == 'normal'">
  59. <img :src="basicSet.set.advert_top_img_src" v-if="basicSet.set && basicSet.set.advert_top_img_src" alt="">
  60. </div>
  61. <div class="sousuo flex flex-j-c " v-if="top_type == 'other'">
  62. <div class="input flex flex-a-c" v-if="basicSet.set && basicSet.set.pc_temp == 1">
  63. <input type="text" v-model="keywords" @keypress="enterSearch"
  64. :placeholder="basicSet.set && basicSet.set.search_title ? basicSet.set.search_title : '商品名称/规格/型号'">
  65. <div class="flex flex-a-c flex-j-c button" @click="searchGoods" @keyup.enter="searchGoods">
  66. <i class="iconfont icon-faxianshebei">
  67. </i>
  68. </div>
  69. </div>
  70. <div class="input input-template-02 flex flex-a-c" v-else>
  71. <input type="text" v-model="keywords" @keypress="enterSearch"
  72. :placeholder="basicSet.set && basicSet.set.search_title ? basicSet.set.search_title : '商品名称/规格/型号'">
  73. <div class="flex flex-a-c flex-j-c button" @click="searchGoods" @keyup.enter="searchGoods">搜索</div>
  74. </div>
  75. </div>
  76. <div class="myCar flex flex-a-c flex-j-c"
  77. v-if="top_type == 'other' && basicSet.set && basicSet.set.pc_temp == 1" @click="toUrl('cart')">
  78. <i class="iconfont icon-htmal5icon29"></i>我的购物车
  79. </div>
  80. <div class="top-adimg"
  81. v-if="top_type == 'other' && basicSet.set && basicSet.set.pc_temp == 2 && basicSet.pc_temp2_set.right_advert_src"
  82. @click="gotoUrl(basicSet.pc_temp2_set.advert_link)">
  83. <img :src="basicSet.pc_temp2_set.right_advert_src" alt="">
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </template>
  89. <script>
  90. import { mapState } from 'vuex'
  91. import cssText from "~/utils/element_css";
  92. import QRCode from "qrcode";
  93. var canvas = "";
  94. const version = require('element-ui/package.json').version
  95. const ORIGINAL_THEME = '#409EFF'
  96. export default {
  97. name: 'LHeader',
  98. props: {
  99. top_type: String
  100. },
  101. data() {
  102. return {
  103. url: "",
  104. keywords: '',
  105. headOver: false,
  106. template: '02'
  107. };
  108. },
  109. computed: {
  110. ...mapState(['basicSet', 'basicCategory'])
  111. },
  112. watch: {
  113. "$store.state.keywords": function (v) {
  114. this.keywords = v;
  115. },
  116. keywords(v) {
  117. if(v && v !== 'null'){
  118. this.$store.commit("setKeywords", v);
  119. }else{
  120. this.$store.commit("setKeywords", '');
  121. }
  122. },
  123. '$route'(res) {
  124. // 浏览足迹 页面切换时更新new_page_comeIn
  125. window.new_page_comeIn = 1;
  126. if (res.name !== 'search') {
  127. console.log(res.name, "res.name")
  128. this.keywords = "";
  129. this.$store.commit("setKeywords", this.keywords);
  130. }
  131. if (this.top_type == 'other') {
  132. this.url = this.fun.redirectH5(this.$route.path, this.$route.fullPath);
  133. setTimeout(() => {
  134. this.createQrc(this.url);
  135. }, 200);
  136. }
  137. }
  138. },
  139. mounted() {
  140. //监听滚动条
  141. window.addEventListener('scroll', this.handleScroll);
  142. // 浏览足迹 页面切换时更新new_page_comeIn
  143. window.new_page_comeIn = 1;
  144. // PC跳转移动端
  145. this.url = this.fun.redirectH5(this.$route.path, this.$route.fullPath);
  146. // PC跳转移动端end
  147. if (this.top_type == 'other') {
  148. this.createQrc(this.url);
  149. }
  150. let color = this.basicSet.set && this.basicSet.set.theme_color ? this.basicSet.set.theme_color : '#29ba9c';
  151. this.theme(color, ORIGINAL_THEME);
  152. // 静态化部署使用
  153. // this.getBasic();
  154. // this.getBasicCategory();
  155. if (window.location.href.includes("search")) {
  156. this.keywords = this.$store.state.keywords || localStorage.getItem('keywords');
  157. }
  158. },
  159. destroyed() {
  160. window.removeEventListener('scroll', this.handleScroll);
  161. },
  162. methods: {
  163. getBasic() {
  164. if (this.basicSet.qr_code) {
  165. return
  166. }
  167. this.fun.$post('plugin.pc-terminal.api.set.get-set', { basic_info: 1 }, '正在获取').then(res => {
  168. if (res.result === 1) {
  169. this.$store.commit("setBasicInfo", res.basic_info);
  170. this.$store.commit("setBasicSet", res.data);
  171. }
  172. })
  173. },
  174. getBasicCategory() {
  175. if (this.basicCategory.current_page) {
  176. return
  177. }
  178. this.fun.$post('plugin.pc-terminal.api.goods.get-home-category', {}, '正在获取').then(res => {
  179. if (res.result === 1) {
  180. if (res.data.total > 10) {
  181. // 超过10个要显示查看更多
  182. res.data.data = res.data.data.splice(0, 9)
  183. }
  184. this.$store.commit("setBasicCategory", res.data);
  185. }
  186. })
  187. },
  188. createQrc(url) {
  189. this.$nextTick(function () {
  190. // DOM操作
  191. canvas = document.getElementById("qrccode-canvas");
  192. QRCode.toCanvas(canvas, url, error => {
  193. if (error) {
  194. console.log(error);
  195. }
  196. });
  197. });
  198. },
  199. theme(val, oldVal) {
  200. if (typeof val !== 'string') return
  201. const themeCluster = this.getThemeCluster(val.replace('#', ''))
  202. const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
  203. const getHandler = (variable, id) => {
  204. return () => {
  205. const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', ''))
  206. const newStyle = this.updateStyle(this[variable], originalCluster, themeCluster)
  207. let styleTag = document.getElementById(id)
  208. if (!styleTag) {
  209. styleTag = document.createElement('style')
  210. styleTag.setAttribute('id', id)
  211. document.head.appendChild(styleTag)
  212. }
  213. styleTag.innerText = newStyle
  214. }
  215. }
  216. const chalkHandler = getHandler('chalk', 'chalk-style')
  217. if (!this.chalk) {
  218. // 改成下载到本地不请求
  219. // const url = `https://unpkg.com/element-ui@${version}/lib/theme-chalk/index.css`
  220. this['chalk'] = cssText.cssText;
  221. chalkHandler();
  222. // this.getCSSString(url, chalkHandler, 'chalk')
  223. } else {
  224. chalkHandler()
  225. }
  226. const styles = [].slice.call(document.querySelectorAll('style'))
  227. .filter(style => {
  228. const text = style.innerText
  229. return new RegExp(oldVal, 'i').test(text) && !/Chalk Variables/.test(text)
  230. })
  231. styles.forEach(style => {
  232. const { innerText } = style
  233. if (typeof innerText !== 'string') return
  234. style.innerText = this.updateStyle(innerText, originalCluster, themeCluster)
  235. })
  236. // 响应外部操作
  237. // this.$emit('onThemeChange', val)
  238. },
  239. updateStyle(style, oldCluster, newCluster) {
  240. let newStyle = style
  241. oldCluster.forEach((color, index) => {
  242. newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index])
  243. })
  244. return newStyle
  245. },
  246. getCSSString(url, callback, variable) {
  247. const xhr = new XMLHttpRequest()
  248. xhr.onreadystatechange = () => {
  249. if (xhr.readyState === 4 && xhr.status === 200) {
  250. this[variable] = xhr.responseText.replace(/@font-face{[^}]+}/, '')
  251. callback()
  252. }
  253. }
  254. xhr.open('GET', url)
  255. xhr.send()
  256. },
  257. getThemeCluster(theme) {
  258. const tintColor = (color, tint) => {
  259. let red = parseInt(color.slice(0, 2), 16)
  260. let green = parseInt(color.slice(2, 4), 16)
  261. let blue = parseInt(color.slice(4, 6), 16)
  262. if (tint === 0) {
  263. return [red, green, blue].join(',')
  264. } else {
  265. red += Math.round(tint * (255 - red))
  266. green += Math.round(tint * (255 - green))
  267. blue += Math.round(tint * (255 - blue))
  268. red = red.toString(16)
  269. green = green.toString(16)
  270. blue = blue.toString(16)
  271. return `#${red}${green}${blue}`
  272. }
  273. }
  274. const shadeColor = (color, shade) => {
  275. let red = parseInt(color.slice(0, 2), 16)
  276. let green = parseInt(color.slice(2, 4), 16)
  277. let blue = parseInt(color.slice(4, 6), 16)
  278. red = Math.round((1 - shade) * red)
  279. green = Math.round((1 - shade) * green)
  280. blue = Math.round((1 - shade) * blue)
  281. red = red.toString(16)
  282. green = green.toString(16)
  283. blue = blue.toString(16)
  284. return `#${red}${green}${blue}`
  285. }
  286. const clusters = [theme]
  287. for (let i = 0; i <= 9; i++) {
  288. clusters.push(tintColor(theme, Number((i / 10).toFixed(2))))
  289. }
  290. clusters.push(shadeColor(theme, 0.1))
  291. return clusters
  292. },
  293. logout() {
  294. this.fun.$get("member.logout.index").then(
  295. response => {
  296. if (response.result == 1) {
  297. // localStorage.setItem("isWxLogin", -1);
  298. // localStorage.setItem("loginUid", "");
  299. sessionStorage.setItem("yz_redirect", document.location.href);
  300. this.$store.commit("setLogin", { is_login: false });
  301. this.$alert(response.msg, '提示', {
  302. confirmButtonText: '确定',
  303. callback: action => {
  304. this.$router.push(this.fun.getUrl("login"));
  305. }
  306. });
  307. }
  308. },
  309. response => {
  310. console.log(response.msg);
  311. }
  312. );
  313. },
  314. enterSearch(event) {
  315. if (event.keyCode === 13) {
  316. //如果按的是enter键
  317. event.preventDefault();
  318. this.searchGoods()
  319. }
  320. },
  321. searchGoods() {
  322. this.$store.commit("setKeywords", this.keywords);
  323. this.getSearchData();
  324. if(this.$route.name!=='search'){
  325. this.$router.push(this.fun.getUrl('search'));
  326. }
  327. },
  328. getSearchData() {
  329. let index = localStorage.getItem("search_index") || '';
  330. let url = {
  331. 0:'goods.goods.search-goods',
  332. 1:'plugin.article.api.pc.article.get-articles',
  333. 2:'plugin.message-base.frontend.article.index',
  334. 3:'plugin.micro-communities.api.pc.index.getStick',
  335. 4:'plugin.video-share.frontend.video.getList'
  336. }
  337. if (index) {
  338. if (index == 0) {
  339. this.getSeatchContent(url[index], 'post');
  340. } else if (index == 1) {
  341. this.getSeatchContent(url[index], 'get', index)
  342. } else if (index == 2) {
  343. this.getSeatchContent(url[index],'get',index)
  344. } else if (index == 3) {
  345. this.getSeatchContent(url[index],'get',index);
  346. } else if (index == 4) {
  347. this.getSeatchContent(url[index],'post',index);
  348. }
  349. }else{
  350. let type='get';
  351. if (this.basicSet && this.basicSet.set.search_module_config) {
  352. this.basicSet.set.search_module_config.forEach((item, index) => {
  353. if (item.is_default && item.is_default == 'true') {
  354. if(item.key == 'goods'){
  355. index=0;
  356. type='post';
  357. }else if(item.key == "article"){
  358. index=1;
  359. }else if(item.key=="knowledge"){
  360. index=2;
  361. }else if(item.key=="post"){
  362. index=3;
  363. }else if(item.key=="video"){
  364. index=4;
  365. type='post';
  366. }
  367. this.getSeatchContent(url[index],type,index)
  368. }
  369. })
  370. }
  371. }
  372. },
  373. getSeatchContent(url, type, index) {
  374. let json = {
  375. search: { keyword: this.keywords },
  376. page: 1,
  377. }
  378. if (type == 'post') {
  379. if(index==3){//微帖
  380. delete json.search;
  381. json.title = this.keywords;
  382. }
  383. if(index==4){
  384. delete json.search;
  385. json.search.title = this.keywords;
  386. }
  387. this.fun.$post(url, json, '正在获取').then(res => {
  388. if (res.result == 1) {
  389. if(index==4){
  390. this.$store.commit("setSearchGoods",res.data.list);
  391. return;
  392. }
  393. this.$store.commit("setSearchGoods", res.data);
  394. } else {
  395. this.$store.commit("setSearchGoods",'');
  396. this.$message.error(res.msg);
  397. }
  398. })
  399. }
  400. if (type == 'get') {
  401. if (index == 1) { //文章
  402. json.category_id = 0;
  403. json.pageSize = 12
  404. }
  405. if(index==2){ //知识库
  406. delete json.search;
  407. json.keyword = this.keywords;
  408. json.show_type==1;
  409. }
  410. this.fun
  411. .$get(url,json,"正在获取").then(res => {
  412. if (res.result === 1) {
  413. if(index==1){//文章
  414. this.$store.commit("setSearchGoods", res.data.articles);
  415. }
  416. if(index==2){ //知识库
  417. let data = this.filterList(res.data.data)
  418. console.log(data,"data===");
  419. this.$store.commit("setSearchGoods",{
  420. data,
  421. total:res.data.total,
  422. page:res.data.current_page,
  423. per_page : res.data.per_page
  424. })
  425. }
  426. } else {
  427. this.$store.commit("setSearchGoods",'');
  428. this.$message.error(res.msg);
  429. }
  430. })
  431. }
  432. },
  433. filterList(list) {
  434. if (!Array.isArray(list)) {
  435. return [];
  436. }
  437. if (!this.keywords) return list;
  438. let str = new RegExp(this.keywords, 'g');
  439. let replaceStr = `<span style="color:#eb8383">${this.keywords}</span>`
  440. let mapList = list.map((item) => {
  441. item.article_name = item.article_name.replace(str, replaceStr);
  442. item.article = item.article.replace(str, replaceStr);
  443. return item;
  444. });
  445. return mapList;
  446. },
  447. toUrl(url, params) {
  448. if (url == 'login') {
  449. sessionStorage.setItem("yz_redirect", document.location.href);
  450. }
  451. this.$router.push(this.fun.getUrl(url, params));
  452. },
  453. handleScroll() {
  454. let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
  455. if (scrollTop > 33 && this.top_type == 'other') {
  456. this.headOver = true;
  457. } else {
  458. this.headOver = false;
  459. }
  460. },
  461. gotoUrl(_url) {
  462. if (_url) {
  463. window.location.href = _url;
  464. }
  465. }
  466. },
  467. };
  468. </script>
  469. <style lang="scss" scoped>
  470. .fixed-wrap {
  471. width: 100%;
  472. /*position: fixed;*/
  473. z-index: 999;
  474. min-width: 1200px;
  475. .welcome {
  476. height: 32px;
  477. background-color: #e9e8e8;
  478. transition: all 0.35s linear;
  479. .welcome-content {
  480. width: 1200px;
  481. margin: 0 auto;
  482. box-sizing: border-box;
  483. height: 32px;
  484. .welcome-left {
  485. font-size: 14px;
  486. color: $red;
  487. .tips {
  488. color: #666666;
  489. margin-right: 40px;
  490. }
  491. .logo-box {
  492. cursor: pointer;
  493. span {
  494. margin: 0 5px;
  495. }
  496. }
  497. }
  498. .welcome-right {
  499. font-size: 14px;
  500. margin-right: 10px;
  501. color: #333;
  502. .mobile_version {
  503. position: relative;
  504. .hide_block {
  505. display: none;
  506. text-align: center;
  507. position: absolute;
  508. left: -30px;
  509. top: 35px;
  510. width: 150px;
  511. height: 167px;
  512. padding-bottom: 18px;
  513. padding-top: 25px;
  514. background-color: #ffffff;
  515. box-shadow: 0px 2px 10px 0px rgba(171, 171, 171, 0.28);
  516. box-sizing: border-box;
  517. .mini_code {
  518. width: 90px;
  519. height: 90px;
  520. background-color: #c5c5c5;
  521. margin-bottom: 17px;
  522. #qrccode-canvas {
  523. width: 90px !important;
  524. height: 90px !important;
  525. }
  526. img {
  527. width: 100%;
  528. height: 100%;
  529. }
  530. }
  531. &::after {
  532. content: "";
  533. position: absolute;
  534. left: 50%;
  535. transform: translate(-50%, -100%);
  536. top: 0;
  537. width: 0;
  538. height: 0;
  539. border-left: 10px solid transparent;
  540. border-right: 10px solid transparent;
  541. border-bottom: 10px solid $white;
  542. }
  543. }
  544. &:hover .hide_block {
  545. display: block;
  546. }
  547. }
  548. div {
  549. cursor: pointer;
  550. }
  551. .icon-item {
  552. display: flex;
  553. align-items: center;
  554. margin-right: 12px;
  555. img {
  556. width: 16px;
  557. height: 16px;
  558. margin-right: 12px;
  559. }
  560. .icon-item-text {
  561. height: 14px;
  562. font-size: 14px;
  563. line-height: 14px;
  564. padding-right: 12px;
  565. border-right: 1px solid #999;
  566. }
  567. }
  568. }
  569. }
  570. }
  571. .header {
  572. height: 100px;
  573. background-color: #fff;
  574. box-shadow: 0px 2px 10px 0px rgba(171, 171, 171, 0.28);
  575. .top {
  576. width: 1200px;
  577. margin: 0 auto;
  578. // padding: 0 0 0 30px;
  579. box-sizing: border-box;
  580. .myCar {
  581. width: 150px;
  582. height: 40px;
  583. background-color: #e8e8e8;
  584. border-radius: 25px;
  585. font-size: 15px;
  586. color: #333;
  587. cursor: pointer;
  588. .icon-htmal5icon29 {
  589. font-size: 24px;
  590. color: $red;
  591. margin-right: 8px;
  592. }
  593. }
  594. .sousuo {
  595. flex: 1;
  596. margin-right: 20px;
  597. justify-content: flex-start;
  598. .input {
  599. width: 400px;
  600. height: 40px;
  601. border-radius: 25px;
  602. border: solid 1px #c9c9c9;
  603. font-size: 15px;
  604. overflow: hidden;
  605. input {
  606. border: none;
  607. outline: none;
  608. padding: 0 10px 0 30px;
  609. color: #666666;
  610. font-size: 15px;
  611. width: 80%;
  612. box-sizing: border-box;
  613. }
  614. .button {
  615. flex: 1;
  616. height: 100%;
  617. background-color: var(--color);
  618. cursor: pointer;
  619. color: $white;
  620. font-size: 18px;
  621. i {
  622. font-size: 28px;
  623. }
  624. }
  625. }
  626. .input-template-02 {
  627. width: 460px;
  628. height: 60px;
  629. background-color: #eeeeee;
  630. border-radius: 6px;
  631. border: none;
  632. input {
  633. height: 100%;
  634. background-color: #eeeeee;
  635. }
  636. .button {
  637. background: var(--color);
  638. }
  639. }
  640. }
  641. .left {
  642. display: flex;
  643. cursor: pointer;
  644. img {
  645. width: 480px;
  646. align-self: center;
  647. height: 70px;
  648. }
  649. span {
  650. font-weight: 900;
  651. font-size: 18px;
  652. display: inline-block;
  653. align-self: flex-end;
  654. }
  655. .advert_words {
  656. display: inline-block;
  657. width: 300px;
  658. }
  659. }
  660. .right {
  661. margin-left: 273px;
  662. flex: 1;
  663. .icon:last-child {
  664. margin-right: 0;
  665. }
  666. .icon {
  667. img {
  668. margin-right: 7px;
  669. width: 20px;
  670. height: 20px;
  671. }
  672. span {
  673. font-size: 18px;
  674. color: #333333;
  675. font-weight: normal;
  676. }
  677. }
  678. }
  679. .top-adimg {
  680. width: 268px;
  681. height: 82px;
  682. img {
  683. display: block;
  684. width: 100%;
  685. height: 100%;
  686. object-fit: contain;
  687. }
  688. &:hover {
  689. cursor: pointer;
  690. }
  691. }
  692. }
  693. .right-img {
  694. width: 500px;
  695. height: 70px;
  696. img {
  697. width: 500px;
  698. height: 70px;
  699. }
  700. }
  701. }
  702. .hide-shadow {
  703. box-shadow: none;
  704. }
  705. }
  706. </style>