home.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938
  1. <template>
  2. <view class="index" :style="{ backgroundImage: `url(${bgImage.image1})` }">
  3. <view class="top-box" :class="showTopSearch ? '' : 'hide'">
  4. <view :style="[{ height: `${statusBarHeight}px` }]"></view>
  5. <view class="title" :style="[{ height: `${menuButtonHeight}px` }]">
  6. <text class="titlt-txt">商城</text>
  7. </view>
  8. <view class="input-box">
  9. <view
  10. class="status-bar"
  11. :style="[{ height: `${statusBarHeight}px` }]"
  12. @click="searchClick"
  13. ></view>
  14. <view class="input-placeholder" @click="searchClick"
  15. >请输入检索关键字</view
  16. >
  17. <text class="iconfont2 msgCenter" @click="goToMsg()">
  18. <!-- &#xe67c; -->
  19. <uv-icon name="chat" color="#ffffff" size="28"></uv-icon>
  20. <text v-if="msgCenter == 0 ? false : msgCenter">{{ msgCenter }}</text>
  21. </text>
  22. </view>
  23. </view>
  24. <view class="u-skeleton">
  25. <view
  26. class="swiper u-skeleton-rect"
  27. :class="showTopSearch ? '' : 'mt120'"
  28. v-if="(shopBanner && shopBanner.length > 0) || skeletonShow"
  29. >
  30. <view class="uni-margin-wrap">
  31. <swiper
  32. class="swiper"
  33. :indicator-dots="true"
  34. :autoplay="true"
  35. :interval="2000"
  36. :duration="1000"
  37. circular="false"
  38. >
  39. <swiper-item
  40. v-for="item in skeletonShow ? 1 : shopBanner"
  41. :key="item.id"
  42. >
  43. <view class="swiper-item" @click="$mUtil.imgLink(item)">
  44. <image
  45. class="bannersize"
  46. :src="`${item.image}`"
  47. mode="aspectFill"
  48. ></image>
  49. </view>
  50. </swiper-item>
  51. </swiper>
  52. </view>
  53. </view>
  54. <!-- 首页一级分类 -->
  55. <div class="one-cate">
  56. <!-- cateList.slice(0,4) -->
  57. <div
  58. class="item"
  59. v-for="item in skeletonShow ? 4 : cateList"
  60. @click="jumpHxCate(item, 0)"
  61. :key="item.id"
  62. >
  63. <!-- ?x-oss-process=style/w_350 -->
  64. <image
  65. class="u-skeleton-fillet"
  66. mode="widthFix "
  67. :src="`${item.icon}`"
  68. >
  69. </image>
  70. <div class="word u-skeleton-fillet u-font26">{{ item.name || "加载中" }}</div>
  71. </div>
  72. </div>
  73. <view
  74. v-if="(homeBanner1 && homeBanner1.image) || skeletonShow"
  75. class="banner1Cls"
  76. @click="$mUtil.imgLink(homeBanner1)"
  77. >
  78. <!-- ?x-oss-process=style/w_350 -->
  79. <image
  80. class="font u-skeleton-fillet"
  81. :src="`${homeBanner1.image}`"
  82. mode=""
  83. ></image>
  84. </view>
  85. <!-- 惠选专区 hxCateList-->
  86. <ChoiceZone
  87. :hxCateList="hxCateList"
  88. :skeletonShow="skeletonShow"
  89. @jumpHxCate="jumpHxCate"
  90. />
  91. <!-- 限时秒杀 -->
  92. <Seckill
  93. :currSeckill="currSeckill"
  94. :skeletonShow="skeletonShow"
  95. :currTime="currTime"
  96. :time2="time2"
  97. :itemsDis2="itemsDis2"
  98. :activeBannerIndex2="activeBannerIndex2"
  99. @goDetail="goDetail"
  100. @overDown2="overDown2"
  101. @imgActiveFun2="imgActiveFun2"
  102. @goProductDetails="goProductDetails"
  103. />
  104. <!-- 拼团购 -->
  105. <GroupBuy
  106. :groupList="groupList"
  107. :skeletonShow="skeletonShow"
  108. :bgImage="bgImage.image2"
  109. @goDetail="goDetail"
  110. @goProductDetails="goProductDetails"
  111. />
  112. <!-- 热门推荐 -->
  113. <HotRecommend
  114. :recommendList="recommendList"
  115. :skeletonShow="skeletonShow"
  116. :bgImage="bgImage.image3"
  117. @goDetail="goDetail"
  118. @goProductDetails="goProductDetails"
  119. />
  120. <!-- 本月热销 -->
  121. <MonthlyBestSeller
  122. :hotList="hotList"
  123. :skeletonShow="skeletonShow"
  124. :bgImage="bgImage.image4"
  125. :itemsDis="itemsDis"
  126. :lineList="lineList"
  127. :activeBannerIndex="activeBannerIndex"
  128. @goDetail="goDetail"
  129. @goProductDetails="goProductDetails"
  130. @imgActiveFun="imgActiveFun"
  131. />
  132. <!-- 猜你喜欢 -->
  133. <GuessYouLike
  134. :goodsList="goodsList"
  135. :skeletonShow="skeletonShow"
  136. :bgImage="bgImage.image5"
  137. :status="status"
  138. @goDetail="goDetail"
  139. @goProductDetails="goProductDetails"
  140. />
  141. <view class="cart-entrance" @click="toCartPage()">
  142. <!-- <image :src="imgUrl + '/static/czd/car.png'" alt=""></image> -->
  143. <uv-icon name="shopping-cart" color="#000" size="32"></uv-icon>
  144. </view>
  145. <uv-skeleton
  146. :loading="skeletonShow"
  147. :animation="true"
  148. bgColor="#FFF"
  149. ></uv-skeleton>
  150. </view>
  151. </view>
  152. </template>
  153. <script setup>
  154. import { ref, reactive, onMounted, getCurrentInstance } from "vue";
  155. import {
  156. onLoad,
  157. onShow,
  158. onPullDownRefresh,
  159. onReachBottom,
  160. onPageScroll,
  161. onShareAppMessage,
  162. } from "@dcloudio/uni-app";
  163. import { getAdList_Api, getQuickLinkList_Api } from "@/api/index.js";
  164. import { shopProductList_Api } from "@/api/shop.js";
  165. import {
  166. messageUnreadNum_Api,
  167. } from "@/api/userInfo.js";
  168. import ChoiceZone from "./components/ChoiceZone.vue";
  169. import Seckill from "./components/Seckill.vue";
  170. import GroupBuy from "./components/GroupBuy.vue";
  171. import HotRecommend from "./components/HotRecommend.vue";
  172. import MonthlyBestSeller from "./components/MonthlyBestSeller.vue";
  173. import GuessYouLike from "./components/GuessYouLike.vue";
  174. import utils from "@/util/index.js";
  175. // 响应式数据
  176. const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight);
  177. const menuButtonHeight = ref(0);
  178. try {
  179. menuButtonHeight.value = uni.getSystemInfoSync().menuButtonHeight + 10;
  180. } catch (error) {
  181. console.log(error);
  182. }
  183. const showTopSearch = ref(true);
  184. const keyWord = ref("");
  185. const groupList = ref([]); //团购
  186. const hotList = ref([]); //本月热销
  187. const recommendList = ref([]); //推荐
  188. const shopBanner = ref([]); //轮播图
  189. const currSeckill = ref([]); //秒杀
  190. const time2 = ref([0, 0, 0, 0]); //秒杀倒计时
  191. const goodsList = ref([]); //猜你喜欢
  192. const currTime = ref(null);
  193. const itemsDis = ref(1);
  194. const activeBannerIndex = ref(0);
  195. const itemsDis2 = ref(1);
  196. const activeBannerIndex2 = ref(0);
  197. const page = ref(1);
  198. const status = ref("more");
  199. const msgCenter = ref(null);
  200. const cateList = ref([]); // 一级分类
  201. const hxCateList = ref([]);
  202. const lineList = ref(0);
  203. const homeBanner1 = ref({});
  204. const skeletonShow = ref(true);
  205. // 背景图片
  206. const bgImage = reactive({
  207. // image1: "/static/home/home_bg1.png",
  208. // image2: "/static/home/home_bg2.png",
  209. // image3: "/static/home/home_bg3.png",
  210. // image4: "/static/home/home_bg4.png",
  211. // image5: "/static/home/home_bg5.png",
  212. image1:
  213. "https://chaonong-shop.oss-cn-beijing.aliyuncs.com/20260104/fc2943f1d3894cf6aebe9a4ed5455cec.png", // 顶部背景图
  214. image2:
  215. "https://chaonong-shop.oss-cn-beijing.aliyuncs.com/20260104/c99cd4841fca414bbc5bc0bb21b6e0f3.png", // 拼团购背景图
  216. image3:
  217. "https://chaonong-shop.oss-cn-beijing.aliyuncs.com/20260104/21296e0cec1e49e6aa44bca3d7758362.png", // 热门推荐背景图
  218. image4:
  219. "https://chaonong-shop.oss-cn-beijing.aliyuncs.com/20260104/afc6def5b92a41eaa243c557d73b588c.png", // 本月热销背景图
  220. image5:
  221. "https://chaonong-shop.oss-cn-beijing.aliyuncs.com/20260104/67d5c6eebace46f1abd3435352561968.png", // 猜你喜欢背景图
  222. });
  223. // 方法定义
  224. const getHomeBanner1 = () => {
  225. getAdList_Api("home_ad").then((res) => {
  226. if (res && res.data && res.data.length > 0) {
  227. homeBanner1.value = res.data[0];
  228. // console.log("homeBanner1", homeBanner1.value);
  229. }
  230. });
  231. };
  232. const init = () => {
  233. page.value = 1;
  234. getAll();
  235. getOneCate();
  236. // getHxCateList();
  237. };
  238. // 跳转消息页面
  239. const goToMsg = () => {
  240. if (!utils.isLoginTo(true)) {
  241. uni.navigateTo({
  242. url: "/pages/user/myMsg",
  243. });
  244. }
  245. };
  246. const searchClick = () => {
  247. uni.navigateTo({
  248. url: "/pages/research/homepage/search",
  249. });
  250. };
  251. const goProductDetails = (url) => {
  252. uni.navigateTo({
  253. url: url,
  254. });
  255. };
  256. const getAll = () => {
  257. // rest();
  258. getBanner();
  259. // seckillList();
  260. // getgroupList();
  261. recommend();
  262. hotSale();
  263. // guessLike();
  264. };
  265. /**获得消息数量 */
  266. const getmessageNum = () => {
  267. let token = uni.getStorageSync("apiToken");
  268. if (token) {
  269. messageUnreadNum_Api().then((res) => {
  270. if (res && res.code == 200) {
  271. msgCenter.value = res.data;
  272. }
  273. });
  274. } else {
  275. msgCenter.value = 0;
  276. }
  277. };
  278. // 一级分类
  279. const getOneCate = () => {
  280. getQuickLinkList_Api("home").then((res) => {
  281. if (res && res.code == 200) {
  282. cateList.value = res.data || [];
  283. // console.log("cateList", cateList.value);
  284. }
  285. });
  286. };
  287. const getHxCateList = () => {
  288. uni.$uv.$http.get("/hxcategory/home/recommend/4").then((res) => {
  289. if (res && res.code == 200) {
  290. hxCateList.value = res.list;
  291. }
  292. });
  293. };
  294. // 跳转一级分类
  295. const jumpCate = (id) => {
  296. // uni.$uv.$store.commit("changeCateId", id || "");
  297. uni.switchTab({
  298. url: "/pages/index/list",
  299. success: (res) => {},
  300. });
  301. };
  302. const jumpHxCate = (item, area_feature) => {
  303. let url = `/pages/freeCollection/index`;
  304. if (area_feature == 0) {
  305. url += `?categoryId=${item.id}&title=${item.name}`;
  306. } else {
  307. url += `?hxCategoryId=${item.id}&title=${item.name}`;
  308. }
  309. uni.navigateTo({
  310. url: url,
  311. });
  312. };
  313. /**轮播图 */
  314. const getBanner = () => {
  315. getAdList_Api("home_banner")
  316. .then((res) => {
  317. uni.stopPullDownRefresh();
  318. if (res && res.code == 200) {
  319. shopBanner.value = res.data || [];
  320. }
  321. })
  322. .catch((err) => {
  323. console.log("err");
  324. console.log(err);
  325. });
  326. };
  327. const imgActiveFun = (e) => {
  328. activeBannerIndex.value = e.detail.current;
  329. };
  330. const imgActiveFun2 = (e) => {
  331. activeBannerIndex2.value = e.detail.current;
  332. };
  333. const overDown2 = () => {
  334. isOver2.value = true;
  335. };
  336. /**限时秒杀 */
  337. const seckillList = () => {
  338. uni.$uv.$http
  339. .get(
  340. `/marketing/seckillActivityGoods/flash-sale`,
  341. {
  342. limit: 10,
  343. page: 1,
  344. },
  345. false
  346. )
  347. .then((res) => {
  348. if (res && res.code == 200) {
  349. currTime.value = res.data.start_hour;
  350. if (res.data.list) {
  351. currSeckill.value = oneArrToTwoArr(res.data.list);
  352. }
  353. if (res.data.finish_time) {
  354. time2.value = uni.$uv.$mUtil
  355. .countDown(Math.floor(res.data.finish_time / 1000))
  356. .split(":")
  357. .map((val) => Number(val));
  358. }
  359. }
  360. });
  361. };
  362. const oneArrToTwoArr = (data) => {
  363. let newData = [];
  364. let zyf = 4; //一维数组转二维数组长度(此处是二维数组每一个长度控制)
  365. for (var i = 0; i < Math.ceil(data.length / zyf); i++) {
  366. newData[i] = [];
  367. newData[i].push(data[i * zyf]);
  368. for (var j = 1; j < zyf; j++) {
  369. if (data[i * zyf + j] == undefined) {
  370. //超出长度控住
  371. return newData;
  372. } else {
  373. newData[i].push(data[i * zyf + j]);
  374. }
  375. }
  376. }
  377. return newData;
  378. };
  379. /**团购 */
  380. const getgroupList = () => {
  381. uni.$uv.$http
  382. .get(
  383. `/groupbuy/activitygoods/will-you-spell`,
  384. {
  385. limit: 10,
  386. page: 1,
  387. },
  388. false
  389. )
  390. .then((res) => {
  391. if (res && res.code == 200) {
  392. if (res.list.length > 0) {
  393. groupList.value = res.list;
  394. }
  395. }
  396. });
  397. };
  398. /**热门推荐 */
  399. const recommend = () => {
  400. shopProductList_Api({
  401. limit: 6,
  402. recommendStatus: 1,
  403. }).then((res) => {
  404. if (res && res.code == 200) {
  405. recommendList.value = res.data;
  406. }
  407. });
  408. };
  409. /**本月热销 */
  410. const hotSale = () => {
  411. shopProductList_Api({
  412. limit: 12,
  413. hot: 1,
  414. }).then((res) => {
  415. if (res && res.code == 200) {
  416. let list = res.data || [];
  417. hotList.value = res.data;
  418. if (hotList.value.length > 2) {
  419. lineList.value = hotList.value.length - 2;
  420. }
  421. if (list.length <= 3) {
  422. itemsDis.value = list.length;
  423. }
  424. if (list.length > 3 && list.length <= 6) {
  425. itemsDis.value = 3;
  426. }
  427. if (list.length > 6 && list.length <= 9) {
  428. itemsDis.value = 3;
  429. }
  430. if (list.length > 9 && list.length <= 12) {
  431. itemsDis.value = 3;
  432. }
  433. }
  434. });
  435. };
  436. /**猜你喜欢 */
  437. const guessLike = () => {
  438. keyWord.value = uni.getStorageSync("history")
  439. ? uni.getStorageSync("history").join(",")
  440. : "";
  441. uni.$uv.$http
  442. .get(
  443. `/goods/smart`,
  444. {
  445. page: page.value,
  446. limit: 6,
  447. keywords: keyWord.value,
  448. },
  449. false
  450. )
  451. .then((res) => {
  452. if (res && res.code == 200) {
  453. goodsList.value =
  454. page.value == 1
  455. ? res.page.list
  456. : goodsList.value.concat(res.page.list);
  457. if (res.page.totalPage <= res.page.currPage) {
  458. status.value = "noMore";
  459. } else {
  460. status.value = "more";
  461. }
  462. skeletonShow.value = false;
  463. }
  464. });
  465. };
  466. const goDetail = (url, isNeedLogin, tabShow = false) => {
  467. if ((isNeedLogin && uni.getStorageSync("apiToken") == "") || null) {
  468. uni.$uv.$mUtil.toast("请先登录");
  469. return false;
  470. }
  471. if (tabShow) {
  472. uni.switchTab({
  473. url: url,
  474. });
  475. } else {
  476. uni.navigateTo({
  477. url: url,
  478. });
  479. }
  480. };
  481. /**重置数据*/
  482. const rest = () => {
  483. goodsList.value = [];
  484. currSeckill.value = [];
  485. shopBanner.value = [];
  486. recommendList.value = [];
  487. hotList.value = [];
  488. groupList.value = [];
  489. };
  490. const toCartPage = () => {
  491. uni.switchTab({
  492. url: "/pages/tabtar/shoppingCart",
  493. });
  494. };
  495. // 生命周期钩子
  496. onLoad(() => {
  497. skeletonShow.value = false;
  498. init();
  499. getHomeBanner1();
  500. });
  501. onShow(() => {
  502. getmessageNum();
  503. });
  504. onPullDownRefresh(() => {
  505. return;
  506. page.value = 1;
  507. getAll();
  508. getOneCate();
  509. getHxCateList();
  510. getHomeBanner1();
  511. setTimeout(() => {
  512. uni.stopPullDownRefresh();
  513. }, 300);
  514. });
  515. onReachBottom(() => {
  516. return;
  517. if (status.value == "more") {
  518. page.value++;
  519. guessLike();
  520. }
  521. });
  522. onPageScroll((e) => {
  523. //nvue暂不支持滚动监听,可用bindingx代替
  524. if (e.scrollTop > uni.upx2px(49 + 30)) {
  525. showTopSearch.value = false;
  526. } else {
  527. showTopSearch.value = true;
  528. }
  529. });
  530. onShareAppMessage((res) => {
  531. let user = uni.getStorageSync("personal");
  532. if (res.from === "button") {
  533. // 来自页面内分享按钮
  534. console.log(res.target);
  535. }
  536. return {
  537. title: "商城",
  538. path: `/pages/index/lidaPage?shareId=${user.id || ""}`,
  539. };
  540. });
  541. </script>
  542. <style scoped lang="scss">
  543. .swiper {
  544. width: 690rpx;
  545. height: 370rpx !important;
  546. // border-radius: 20rpx;
  547. overflow: hidden;
  548. margin: 0 auto;
  549. ::v-deep .uni-swiper-dot {
  550. width: 16rpx !important;
  551. height: 6rpx;
  552. border-radius: 4rpx !important;
  553. background-color: #ffffff !important;
  554. opacity: 0.5;
  555. }
  556. ::v-deep .uni-swiper-dot-active {
  557. width: 32rpx !important;
  558. height: 6rpx;
  559. border-radius: 4rpx !important;
  560. background-color: #ffffff !important;
  561. opacity: 1;
  562. }
  563. }
  564. ::v-deep.hx-navbar__content__main_search_hxicon {
  565. span {
  566. font-size: 30rpx;
  567. }
  568. }
  569. ::v-deep.hx-navbar__content__main_search_input {
  570. background-color: #4a705e;
  571. }
  572. .one-cate {
  573. display: flex;
  574. // width: 750rpx;
  575. flex-wrap: wrap;
  576. justify-content: space-between;
  577. padding: 0 31rpx;
  578. margin-top: 30rpx;
  579. color: #373737;
  580. .item {
  581. width: 120rpx;
  582. text-align: center;
  583. // margin-right: 40rpx;
  584. // &:last-child {
  585. // margin-right: 0;
  586. // }
  587. image {
  588. width: 94rpx !important;
  589. height: 94rpx !important;
  590. }
  591. .word {
  592. // margin-top: 17rpx;
  593. overflow: hidden;
  594. text-overflow: ellipsis;
  595. white-space: nowrap;
  596. }
  597. }
  598. .item:first-child {
  599. margin-left: 0;
  600. }
  601. .item:nth-child(5n + 1) {
  602. margin-left: 0;
  603. }
  604. }
  605. .bannersize {
  606. display: block;
  607. overflow: hidden;
  608. width: 100%;
  609. height: 100%;
  610. border-radius: 10rpx;
  611. }
  612. .classlist {
  613. margin: 30rpx;
  614. display: flex;
  615. justify-content: space-between;
  616. color: #373737;
  617. .item {
  618. width: 120rpx;
  619. text-align: center;
  620. // margin-right: 38rpx;
  621. // &:last-child {
  622. // margin-right: 0;
  623. // }
  624. .img-box {
  625. width: 100%;
  626. // height: 110rpx;
  627. display: flex;
  628. align-items: center;
  629. justify-content: center;
  630. image {
  631. width: 70rpx;
  632. height: 70rpx;
  633. margin-bottom: 8rpx;
  634. }
  635. text {
  636. font-size: 70rpx;
  637. }
  638. .word {
  639. overflow: hidden;
  640. text-overflow: ellipsis;
  641. white-space: nowrap;
  642. }
  643. .alarmClock {
  644. color: #eb963a;
  645. }
  646. .spell {
  647. color: #4581f6;
  648. }
  649. .integral {
  650. color: #4ea700;
  651. }
  652. .discounts {
  653. color: #f55f40;
  654. }
  655. .activeRegion {
  656. color: #4581f6;
  657. }
  658. }
  659. .font {
  660. // margin-top: 17rpx;
  661. }
  662. .imgbox {
  663. display: flex;
  664. justify-content: center;
  665. align-items: center;
  666. width: 100%;
  667. // height: 110rpx;
  668. image {
  669. width: 70rpx;
  670. height: 70rpx !important;
  671. margin-bottom: 8rpx;
  672. }
  673. }
  674. }
  675. }
  676. .swiper {
  677. // margin-top: 105rpx;
  678. height: 360rpx;
  679. .swiper-item {
  680. width: 100%;
  681. height: 100%;
  682. }
  683. }
  684. .index {
  685. position: relative;
  686. background-color: #f5f5f5;
  687. overflow-x: hidden;
  688. background-repeat: no-repeat;
  689. background-size: 100% 509rpx;
  690. }
  691. .cart-entrance {
  692. position: fixed;
  693. right: 30rpx;
  694. bottom: 180rpx;
  695. width: 50px;
  696. height: 50px;
  697. background-size: 100% 100%;
  698. border-radius: 50%;
  699. filter: drop-shadow(1px 2px 4px rgba(26, 58, 70, 0.3));
  700. background-color: #fff;
  701. display: flex;
  702. align-items: center;
  703. justify-content: center;
  704. image {
  705. width: 55%;
  706. height: 55%;
  707. margin-right: 5rpx;
  708. }
  709. }
  710. .top-box {
  711. width: 100%;
  712. &.hide {
  713. background: #069d4d;
  714. }
  715. .title {
  716. display: flex;
  717. justify-content: center;
  718. align-items: center;
  719. position: relative;
  720. margin: 0 auto;
  721. // height: 45rpx;
  722. padding: 0 30rpx;
  723. font-size: 36rpx;
  724. font-family: PingFang SC, PingFang SC-Bold;
  725. font-weight: 700;
  726. color: #fff;
  727. // line-height: 45rpx;
  728. text-align: center;
  729. image {
  730. width: 41rpx;
  731. height: 31rpx;
  732. margin-right: 4rpx;
  733. }
  734. .titlt-txt {
  735. font-size: 36rpx;
  736. }
  737. }
  738. .input-box {
  739. display: flex;
  740. justify-content: space-between;
  741. align-items: center;
  742. position: sticky;
  743. top: 0;
  744. z-index: 100;
  745. width: 100%;
  746. padding: 23rpx 30rpx 30rpx;
  747. box-sizing: border-box;
  748. .text {
  749. margin-right: 20rpx;
  750. margin-left: 0rpx;
  751. font-weight: 500;
  752. font-size: 28rpx;
  753. color: #aed8b9;
  754. }
  755. .input-placeholder {
  756. // flex: 1;
  757. box-sizing: border-box;
  758. display: inline-block;
  759. vertical-align: middle;
  760. width: 630rpx;
  761. height: 70rpx;
  762. line-height: 66rpx;
  763. // background: rgba(2,81,43,0.3);
  764. background: rgba(255, 255, 255, 0.3);
  765. padding-left: 80rpx;
  766. // color: #666666;
  767. background: rgba(255, 255, 255, 0.3);
  768. // background-image: url("/static/czd/search.png");
  769. background-size: 40rpx 40rpx;
  770. background-position: 24rpx 50%;
  771. background-repeat: no-repeat;
  772. border: 1rpx solid rgba(255, 255, 255, 0.36);
  773. border-radius: 36rpx;
  774. }
  775. text {
  776. margin-left: 10rpx;
  777. display: inline-block;
  778. vertical-align: middle;
  779. font-size: 42rpx;
  780. font-weight: 400;
  781. text-align: right;
  782. color: #ffffff;
  783. line-height: 42rpx;
  784. &.iconfont2 {
  785. font-size: 55rpx;
  786. }
  787. }
  788. .msgCenter {
  789. position: relative;
  790. text {
  791. min-width: 50rpx;
  792. font-size: 20rpx;
  793. color: #ffffff;
  794. font-weight: 400;
  795. padding: 0 4rpx;
  796. background-color: #ff0000;
  797. border-radius: 13rpx;
  798. border: 2rpx solid #fff;
  799. text-align: center;
  800. position: absolute;
  801. left: 10rpx;
  802. top: -30rpx;
  803. line-height: normal;
  804. }
  805. }
  806. }
  807. .input-placeholder {
  808. color: #fee3cf;
  809. opacity: 0.74;
  810. font-size: 28rpx;
  811. font-family: PingFang SC, PingFang SC-Regular;
  812. font-weight: 400;
  813. text-align: left;
  814. line-height: 70rpx;
  815. }
  816. }
  817. .top-box.hide {
  818. position: fixed;
  819. z-index: 9999;
  820. }
  821. .notice-box {
  822. height: 92rpx;
  823. font-size: 28rpx;
  824. margin-bottom: 0;
  825. ::v-deep .uni-noticebar-icon {
  826. width: 40rpx;
  827. // background-image: url('/static/home/noticebar-icon.png');
  828. background-size: cover;
  829. color: transparent !important;
  830. }
  831. }
  832. .mt120 {
  833. margin-top: 240rpx;
  834. }
  835. .banner1Cls {
  836. text-align: center;
  837. margin-top: 20rpx;
  838. image {
  839. width: 690rpx;
  840. height: 200rpx;
  841. }
  842. }
  843. </style>