index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023
  1. <template>
  2. <view class="container">
  3. <!-- 小程序头部兼容 -->
  4. <!-- #ifdef MP -->
  5. <!-- <view class="input-box flex" @click="clickSearch">
  6. <view class=" input-content flex">
  7. <view class="iconfont iconsearch"></view>
  8. <view class="input"><input type="text" disabled placeholder="请输入搜索内容" /></view>
  9. </view>
  10. </view> -->
  11. <!-- #endif -->
  12. <!-- 头部轮播 -->
  13. <view class="carousel-section" style="background-color: #fff;">
  14. <view class="headerInput" @click="clickSearch">
  15. <image src="../../static/img/is.png" mode=""></image>请输入搜索内容
  16. </view>
  17. <!-- 标题栏和状态栏占位符 -->
  18. <view class="titleNview-placing"></view>
  19. <!-- 背景色区域 -->
  20. <view class="titleNview-background">
  21. <image src="../../static/img/index-bg.png"></image>
  22. </view>
  23. <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  24. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item" @click="bannerNavToUrl(item)"><image :src="item.pic" /></swiper-item>
  25. </swiper>
  26. </view>
  27. <!-- 分类 -->
  28. <view class="cate-section">
  29. <view class="cate-item" @click="tabTo('/pages/category/category')">
  30. <image src="/static/icon/in1.png"></image>
  31. <text>全部分类</text>
  32. </view>
  33. <navigator url="/pages/product/classify?type=2">
  34. <view class="cate-item">
  35. <image src="/static/icon/in2.png"></image>
  36. <text>热销专区</text>
  37. </view>
  38. </navigator>
  39. <navigator url="/pages/money/recharge">
  40. <view class="cate-item">
  41. <image src="/static/icon/in3.png"></image>
  42. <text>充值送积分</text>
  43. </view>
  44. </navigator>
  45. <view class="cate-item" @click="Toshare">
  46. <image src="/static/icon/in4.png"></image>
  47. <text>邀请有礼</text>
  48. </view>
  49. </view>
  50. <!-- 精选好物 -->
  51. <view class="goods">
  52. <hot-goods :goodsList="goodsList"></hot-goods>
  53. </view>
  54. <!-- 为你推荐 -->
  55. <view class="recommend-h">
  56. <recommend :bastList="bastList"></recommend>
  57. </view>
  58. <view class="Mask" v-show="shareShow">
  59. <image @click="share" src="http://shicai.liuniu946.com/static/img/shareimg4.png"></image>
  60. <view class="Toshare" @click="Toshare"></view>
  61. <view class="Tocancel" @click="Tocancel"></view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import seckill from '../../components/seckill/seckill.vue';
  67. import hotGoods from './child/hotGoods.vue';
  68. import recommend from './child/recommend.vue'
  69. import { loadIndexs,getHot } from '@/api/index.js';
  70. import { getUserInfo } from '@/api/user.js';
  71. import { setCoupons } from '@/api/functionalUnit.js';
  72. import { getBargainList } from '@/api/product.js';
  73. import { interceptor } from '@/utils/loginUtils';
  74. import { mapState } from 'vuex';
  75. export default {
  76. components: {
  77. seckill,
  78. hotGoods,
  79. recommend
  80. },
  81. watch: {
  82. //自适应swiper高度
  83. checkid(newValue, oldValue) {
  84. let obj = this;
  85. if (newValue == 0) {
  86. let bHeight = Math.ceil(obj.bastList.length / 2);
  87. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  88. }
  89. if (newValue == 1) {
  90. let bHeight = Math.ceil(obj.goodsList.length / 2);
  91. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  92. }
  93. if (newValue == 2) {
  94. let bHeight = Math.ceil(obj.bastBanner.length / 2);
  95. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  96. }
  97. },
  98. // 初次加载页面高度时修改页面高度
  99. bastList(newValue, oldValue) {
  100. let obj = this;
  101. let bHeight = Math.ceil(newValue.length / 2);
  102. obj.$nextTick(function() {
  103. uni.createSelectorQuery()
  104. .select('#list-box')
  105. .fields(
  106. {
  107. size: true
  108. },
  109. function(data) {
  110. obj.pageProportion = data.width / 750;
  111. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  112. }
  113. )
  114. .exec();
  115. });
  116. }
  117. },
  118. data() {
  119. return {
  120. shareShow: false, //分享海报
  121. pageProportion: 0, //保存页面基于750宽度的比例
  122. swiperHeight: 0,
  123. checkid: 0,
  124. titleNViewBackground: '',
  125. swiperCurrent: 0,
  126. swiperLength: 0,
  127. bargainlist: [], //砍价商品
  128. carouselList: [], //轮播列表
  129. goodsList: [], //最新商品列表
  130. bastList: [], //精品推荐列表
  131. bastBanner: [], //促销商品列表
  132. menusList: [], //头部菜单
  133. page: 1,
  134. limit: 5,
  135. userServant: [
  136. {
  137. image: ''
  138. }
  139. ], //用户推广服务
  140. couponArray: [], //可领取优惠券
  141. recommend: [
  142. {
  143. id: 0,
  144. re_title: '精选',
  145. re_name: '为你推荐'
  146. },
  147. {
  148. id: 1,
  149. re_title: '最新',
  150. re_name: '最新好货优选'
  151. },
  152. {
  153. id: 2,
  154. re_title: '便宜好货',
  155. re_name: '90天便宜好货'
  156. }
  157. ],
  158. actTime: new Date()
  159. };
  160. },
  161. computed: {
  162. ...mapState(['loginInterceptor']),
  163. ...mapState('user', ['hasLogin','userInfo'])
  164. },
  165. onLoad: function(option) {
  166. // #ifndef MP
  167. if (option.spread) {
  168. // 存储其他邀请人
  169. uni.setStorageSync('spread', option.spread);
  170. }
  171. // #endif
  172. // #ifdef MP
  173. if (option.scene) {
  174. // 存储小程序邀请人
  175. uni.setStorage({
  176. key: 'spread_code',
  177. data: option.scene
  178. });
  179. }
  180. // #endif
  181. },
  182. onShow: function() {
  183. // 判断是否强制登录
  184. if (this.loginInterceptor && !this.hasLogin) {
  185. // 登录拦截
  186. interceptor();
  187. }
  188. this.loadData();
  189. // this.getBargainList();
  190. },
  191. //下拉刷新
  192. onPullDownRefresh() {
  193. this.loadData();
  194. },
  195. // #ifndef MP
  196. // 监听导航栏输入框点击事件
  197. // onNavigationBarSearchInputClicked(e) {
  198. // //跳转到搜索页面
  199. // this.clickSearch();
  200. // },
  201. //点击导航栏 buttons 时触发
  202. // onNavigationBarButtonTap(e) {
  203. // const index = e.index;
  204. // if (index === 0) {
  205. // this.$api.msg('点击了扫描');
  206. // } else if (index === 1) {
  207. // // #ifdef APP-PLUS
  208. // const pages = getCurrentPages();
  209. // const page = pages[pages.length - 1];
  210. // const currentWebview = page.$getAppWebview();
  211. // currentWebview.hideTitleNViewButtonRedDot({
  212. // index
  213. // });
  214. // // #endif
  215. // uni.navigateTo({
  216. // url: '/pages/user/notice'
  217. // });
  218. // }
  219. // },
  220. // #endif
  221. methods: {
  222. //跳转
  223. tabTo(url) {
  224. uni.switchTab({
  225. url: url
  226. })
  227. },
  228. //砍价商品推荐详情页
  229. navToDetailPages(item) {
  230. let id = item.product_id;
  231. //let type = 2;
  232. uni.navigateTo({
  233. url: '/pages/product/product?id=' + id
  234. });
  235. },
  236. openSubscribe: function(e) {
  237. let page = e;
  238. // #ifndef MP
  239. uni.navigateTo({
  240. url: page
  241. });
  242. // #endif
  243. // #ifdef MP
  244. uni.showLoading({
  245. title: '正在加载'
  246. });
  247. openBargainSubscribe()
  248. .then(res => {
  249. uni.hideLoading();
  250. uni.navigateTo({
  251. url: page
  252. });
  253. })
  254. .catch(err => {
  255. uni.hideLoading();
  256. });
  257. // #endif
  258. },
  259. // getBargainList() {
  260. // let that = this;
  261. // getBargainList({
  262. // page: that.page,
  263. // limit: that.limit
  264. // })
  265. // .then(function(res) {
  266. // that.$set(that, 'bargainlist', res.data.slice(0, 2));
  267. // })
  268. // .catch(res => {
  269. // console.log(res, 'getBargainList');
  270. // });
  271. // },
  272. Mask() {
  273. this.MaskShow = false;
  274. this.shareShow = true;
  275. uni.setStorage({
  276. key: 'FirstEntry',
  277. data: true,
  278. success: function() {
  279. console.log(uni.getStorageSync('FirstEntry'), 'Mask');
  280. }
  281. });
  282. },
  283. Toshare() {
  284. if (this.userInfo == '') {
  285. getUserInfo({})
  286. .then(({ data }) => {
  287. this.setUserInfo(data);
  288. this.userInfo = data;
  289. })
  290. .catch(e => {});
  291. } else {
  292. this.shareShow = false;
  293. uni.navigateTo({
  294. url: '/pages/user/shareQrCode?spread=' + this.userInfo.uid
  295. });
  296. }
  297. },
  298. Tocancel() {
  299. this.shareShow = false;
  300. },
  301. // 监听切换事件
  302. listChange(e) {
  303. this.checkid = e.detail.current;
  304. },
  305. // 點擊搜索框
  306. clickSearch() {
  307. uni.navigateTo({
  308. url: '/pages/product/search'
  309. });
  310. },
  311. // 点击触发领取优惠券
  312. setCoupons(item) {
  313. // 判断是否已经领取了优惠券
  314. let obj = this;
  315. uni.showModal({
  316. title: '领取提示',
  317. content: '是否领取优惠券',
  318. success(e) {
  319. if (e.confirm) {
  320. setCoupons({ couponId: item.id }).then(e => {
  321. item.is_use = true;
  322. uni.showToast({
  323. title: '领取成功',
  324. type: 'top',
  325. duration: 2000
  326. });
  327. });
  328. }
  329. }
  330. });
  331. },
  332. //商品种类切换
  333. // change(item) {
  334. // let id = item;
  335. // this.checkid = id;
  336. // if (this.checkid == 1) {
  337. // // console.log(1);
  338. // this.detail = this.selected_detail;
  339. // } else if (this.checkid == 2) {
  340. // // console.log(2);
  341. // this.detail = this.new_product;
  342. // } else {
  343. // this.detail = this.cheap_good;
  344. // }
  345. // },
  346. // 监听图片加载完成
  347. onImageError(key, index) {
  348. this[key][index].image = '/static/error/errorImage.jpg';
  349. },
  350. // 请求载入数据
  351. async loadData() {
  352. loadIndexs({})
  353. .then(({ data }) => {
  354. let goods = data.info;
  355. console.log(goods)
  356. this.carouselList = data.banner;
  357. this.swiperLength = this.carouselList.length;
  358. this.goodsList = goods.firstList; //最新商品
  359. // this.bastList = goods.bastList; //精品推荐
  360. this.$set(this, 'couponArray', data.couponList); //保存卡包券
  361. uni.stopPullDownRefresh();
  362. })
  363. .catch(e => {
  364. uni.stopPullDownRefresh();
  365. });
  366. },
  367. //轮播图切换修改背景色
  368. swiperChange(e) {
  369. const index = e.detail.current;
  370. this.swiperCurrent = index;
  371. this.titleNViewBackground = this.carouselList[index].background;
  372. },
  373. //详情页
  374. navToDetailPage(item) {
  375. let id = item.id;
  376. uni.navigateTo({
  377. url: '/pages/product/product?id=' + id
  378. });
  379. },
  380. // 轮播图跳转
  381. bannerNavToUrl(item) {
  382. // #ifdef H5
  383. if (item.wap_url.indexOf('http') > 0) {
  384. window.location.href = item.wap_url;
  385. }
  386. // #endif
  387. //测试数据没有写id,用title代替
  388. uni.navigateTo({
  389. url: item.wap_url
  390. });
  391. }
  392. }
  393. };
  394. </script>
  395. <style lang="scss">
  396. //搜索栏
  397. .headerInput {
  398. z-index: 9;
  399. background-color: rgba(255,255,255,0.5);
  400. border-radius: 25rpx;
  401. padding: 8rpx 28rpx;
  402. width: 90%;
  403. position: relative;
  404. top: 30px;
  405. left: 5%;
  406. text-align: center;
  407. color: #fff;
  408. image {
  409. width: 34rpx;
  410. height: 34rpx;
  411. margin-bottom: -5rpx;
  412. margin-right: 10rpx;
  413. }
  414. }
  415. //精选好物
  416. .goods {
  417. margin-top: 20rpx;
  418. background-color: #fff;
  419. padding: 40rpx 5%;
  420. margin-bottom: 20rpx;
  421. }
  422. //为你推荐
  423. .recommend-h {
  424. margin: 0rpx auto;
  425. background-color: #fff;
  426. padding-top: 30rpx;
  427. font-size: 26rpx;
  428. }
  429. .Mask {
  430. width: 100%;
  431. height: 100vh;
  432. position: fixed;
  433. z-index: 99999;
  434. background-color: rgba(0, 0, 0, 0.7);
  435. top: 0;
  436. image {
  437. width: 100%;
  438. height: 100vh;
  439. }
  440. }
  441. // 热销商品
  442. .hot-goods {
  443. margin: 0 25rpx;
  444. padding: 5rpx 25rpx 30rpx 25rpx;
  445. background-color: #fff;
  446. border-radius: 10rpx;
  447. .hot-headers {
  448. margin: 25rpx 0;
  449. width: 100%;
  450. display: flex;
  451. .img {
  452. width: 32rpx;
  453. height: 32rpx;
  454. margin-right: 10rpx;
  455. }
  456. .hot-title {
  457. font-size: 30rpx;
  458. margin-right: 15rpx;
  459. }
  460. .more {
  461. line-height: 1;
  462. padding: 5rpx 10rpx 5rpx 15rpx;
  463. text-align: center;
  464. font-size: 20rpx;
  465. border-radius: 15rpx;
  466. color: #ffffff;
  467. background: linear-gradient(90deg, rgba(250, 52, 38, 1) 0%, rgba(249, 30, 83, 1) 100%);
  468. image {
  469. width: 20rpx;
  470. height: 20rpx;
  471. }
  472. }
  473. }
  474. .hot-lists {
  475. line-height: 1;
  476. display: flex;
  477. .hot-produce {
  478. width: 100%;
  479. height: 260rpx;
  480. border-top: 1px solid #f0f0f0;
  481. display: flex;
  482. padding-top: 28rpx;
  483. .produce-image {
  484. width: 200rpx;
  485. height: 200rpx;
  486. image {
  487. width: 200rpx;
  488. height: 200rpx;
  489. border: 1px solid #f0f0f0;
  490. }
  491. }
  492. .produce-content {
  493. // flex-direction: column;
  494. margin-left: 30rpx;
  495. height: 200rpx;
  496. position: relative;
  497. width: calc(100% - 200rpx - 30rpx);
  498. .produce-name {
  499. font-size: 28rpx;
  500. font-weight: bold;
  501. line-height: 35rpx;
  502. color: #343434;
  503. }
  504. .produce-info {
  505. font-size: 20rpx;
  506. margin-top: 25rpx;
  507. }
  508. .produce-price {
  509. display: flex;
  510. align-items: flex-end;
  511. color: #ff383e;
  512. font-size: 24rpx;
  513. margin-top: 70rpx;
  514. font-weight: bold;
  515. text {
  516. font-size: 36rpx;
  517. }
  518. .produce-price-1 {
  519. font-size: 22rpx;
  520. font-weight: 500;
  521. text-decoration: line-through;
  522. color: rgba(170, 170, 170, 1);
  523. margin-left: 20rpx;
  524. }
  525. }
  526. .produce-price1 {
  527. height: 100%;
  528. letter-spacing: 3rpx;
  529. color: #ff383e;
  530. font-size: 24rpx;
  531. font-weight: bold;
  532. .produce-center {
  533. width: 100%;
  534. position: absolute;
  535. bottom: 0;
  536. display: flex;
  537. justify-content: space-between;
  538. align-items: center;
  539. .kanjia_word {
  540. .word-1 {
  541. font-size: 22rpx;
  542. color: #666666;
  543. }
  544. .word-2 {
  545. font-size: 28rpx;
  546. color: #ff383e;
  547. margin-top: 10rpx;
  548. }
  549. }
  550. .kanjia_button {
  551. height: 50rpx;
  552. width: 150rpx;
  553. border-radius: 25rpx;
  554. font-size: 26rpx;
  555. font-weight: 500;
  556. color: #ff383e;
  557. border: 1px solid rgba(255, 56, 62, 1);
  558. }
  559. }
  560. }
  561. }
  562. }
  563. }
  564. }
  565. /* #ifdef MP */
  566. .mp-height {
  567. height: 44px;
  568. }
  569. .input-box {
  570. position: fixed;
  571. top: 0;
  572. left: 0;
  573. width: 100%;
  574. padding: 25rpx;
  575. background-color: #ffffff;
  576. z-index: 999;
  577. height: 44px;
  578. .iconsearch {
  579. font-size: 50rpx;
  580. }
  581. .input-content {
  582. border-radius: 99rpx;
  583. flex-grow: 1;
  584. padding: 10rpx 30rpx;
  585. background-color: rgba(231, 231, 231, 0.7);
  586. .input {
  587. flex-grow: 1;
  588. input {
  589. font-size: $font-lg;
  590. }
  591. }
  592. }
  593. .input-button {
  594. padding-left: 20rpx;
  595. font-size: $font-lg;
  596. height: 100%;
  597. }
  598. }
  599. page {
  600. .cate-section {
  601. position: relative;
  602. z-index: 5;
  603. border-radius: 16rpx 16rpx 0 0;
  604. margin-top: -20rpx;
  605. }
  606. .carousel-section {
  607. padding: 0;
  608. .titleNview-placing {
  609. padding-top: 0;
  610. height: 0;
  611. }
  612. .carousel {
  613. .carousel-item {
  614. padding: 0;
  615. }
  616. }
  617. .swiper-dots {
  618. left: 45rpx;
  619. bottom: 40rpx;
  620. }
  621. }
  622. }
  623. /* #endif */
  624. page {
  625. background: #f7f8f7;
  626. }
  627. .m-t {
  628. margin-top: 16rpx;
  629. }
  630. /* 头部 轮播图 */
  631. .carousel-section {
  632. position: relative;
  633. padding-top: 10px;
  634. overflow: hidden;
  635. .titleNview-placing {
  636. height: var(--status-bar-height);
  637. padding-top: 44px;
  638. box-sizing: content-box;
  639. }
  640. .titleNview-background {
  641. position: absolute;
  642. top: 0;
  643. left: 0;
  644. width: 100%;
  645. image {
  646. // imsisize: 100%;
  647. // height: 100%;
  648. width: 100%;
  649. margin-top: -100rpx;
  650. }
  651. }
  652. .carousel {
  653. width: 100%;
  654. height: 240rpx;
  655. .carousel-item {
  656. width: 100%;
  657. height: 100%;
  658. padding: 0 5%;
  659. overflow: hidden;
  660. }
  661. image {
  662. width: 100%;
  663. height: 100%;
  664. border-radius: $border-radius-sm;
  665. }
  666. }
  667. }
  668. .swiper-dots {
  669. display: flex;
  670. position: absolute;
  671. left: 60rpx;
  672. bottom: 15rpx;
  673. width: 72rpx;
  674. height: 36rpx;
  675. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABkCAYAAADDhn8LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTk4MzlBNjE0NjU1MTFFOUExNjRFQ0I3RTQ0NEExQjMiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTk4MzlBNjA0NjU1MTFFOUExNjRFQ0I3RTQ0NEExQjMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6Q0E3RUNERkE0NjExMTFFOTg5NzI4MTM2Rjg0OUQwOEUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6Q0E3RUNERkI0NjExMTFFOTg5NzI4MTM2Rjg0OUQwOEUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Gh5BPAAACTUlEQVR42uzcQW7jQAwFUdN306l1uWwNww5kqdsmm6/2MwtVCp8CosQtP9vg/2+/gY+DRAMBgqnjIp2PaCxCLLldpPARRIiFj1yBbMV+cHZh9PURRLQNhY8kgWyL/WDtwujjI8hoE8rKLqb5CDJaRMJHokC6yKgSCR9JAukmokIknCQJpLOIrJFwMsBJELFcKHwM9BFkLBMKFxNcBCHlQ+FhoocgpVwwnv0Xn30QBJGMC0QcaBVJiAMiec/dcwKuL4j1QMsVCXFAJE4s4NQA3K/8Y6DzO4g40P7UcmIBJxbEesCKWBDg8wWxHrAiFgT4fEGsB/CwIhYE+AeBAAdPLOcV8HRmWRDAiQVcO7GcV8CLM8uCAE4sQCDAlHcQ7x+ABQEEAggEEAggEEAggEAAgQACASAQQCCAQACBAAIBBAIIBBAIIBBAIABe4e9iAe/xd7EAJxYgEGDeO4j3EODp/cOCAE4sYMyJ5cwCHs4rCwI4sYBxJ5YzC84rCwKcXxArAuthQYDzC2JF0H49LAhwYUGsCFqvx5EF2T07dMaJBetx4cRyaqFtHJ8EIhK0i8OJBQxcECuCVutxJhCRoE0cZwMRyRcFefa/ffZBVPogePihhyCnbBhcfMFFEFM+DD4m+ghSlgmDkwlOgpAl4+BkkJMgZdk4+EgaSCcpVX7bmY9kgXQQU+1TgE0c+QJZUUz1b2T4SBbIKmJW+3iMj2SBVBWz+leVfCQLpIqYbp8b85EskIxyfIOfK5Sf+wiCRJEsllQ+oqEkQfBxmD8BBgA5hVjXyrBNUQAAAABJRU5ErkJggg==);
  676. background-size: 100% 100%;
  677. .num {
  678. width: 36rpx;
  679. height: 36rpx;
  680. border-radius: 50px;
  681. font-size: 24rpx;
  682. color: #fff;
  683. text-align: center;
  684. line-height: 36rpx;
  685. }
  686. .sign {
  687. position: absolute;
  688. top: 0;
  689. left: 50%;
  690. line-height: 36rpx;
  691. font-size: 12rpx;
  692. color: #fff;
  693. transform: translateX(-50%);
  694. }
  695. }
  696. /* 分类 */
  697. .cate-section {
  698. background-color: #fff;
  699. display: flex;
  700. justify-content: space-around;
  701. align-items: center;
  702. flex-wrap: wrap;
  703. padding: 30rpx 22rpx;
  704. .cate-item {
  705. display: flex;
  706. flex-direction: column;
  707. align-items: center;
  708. font-size: 12rpx;
  709. color: #333333;
  710. }
  711. /* 原图标颜色太深,不想改图了,所以加了透明度 */
  712. image {
  713. width: 120rpx;
  714. height: 120rpx;
  715. border-radius: 50%;
  716. }
  717. }
  718. // 中间广告图片
  719. .ad-1 {
  720. width: 100%;
  721. height: 210rpx;
  722. padding: 10rpx 0;
  723. background: #fff;
  724. image {
  725. width: 100%;
  726. height: 100%;
  727. }
  728. }
  729. /*公用边框样式*/
  730. %icon {
  731. margin-right: 10rpx;
  732. display: inline-block;
  733. padding: 2rpx 10rpx;
  734. border: 1rpx solid $color-yellow;
  735. color: $color-yellow;
  736. line-height: 1;
  737. font-size: $font-base;
  738. border-radius: 10rpx;
  739. }
  740. .f-header {
  741. display: flex;
  742. align-items: center;
  743. height: 92rpx;
  744. padding: 6rpx 30rpx 8rpx;
  745. image {
  746. flex-shrink: 0;
  747. width: 80rpx;
  748. height: 80rpx;
  749. margin-right: 20rpx;
  750. }
  751. .tit-box {
  752. @extend %font-title-box;
  753. }
  754. .tit {
  755. @extend %font-title;
  756. }
  757. .iconenter {
  758. font-size: $font-lg + 2rpx;
  759. color: $font-color-light;
  760. }
  761. .f-left-icon {
  762. @extend %f-left-icon;
  763. }
  764. .iconfont {
  765. font-size: $font-sm - 2rpx;
  766. }
  767. }
  768. // 会员升级礼包
  769. .uservip {
  770. border-radius: $border-radius-sm;
  771. background-color: white;
  772. box-shadow: $box-shadow;
  773. height: 300rpx;
  774. margin: 0 30rpx;
  775. image {
  776. height: 100%;
  777. width: 300rpx;
  778. }
  779. .detail {
  780. position: relative;
  781. padding: 20rpx;
  782. height: 100%;
  783. .icon {
  784. @extend %icon;
  785. }
  786. .price-box {
  787. position: absolute;
  788. bottom: 20rpx;
  789. width: calc(100% - 40rpx);
  790. .price {
  791. font-size: $font-lg + 2rpx;
  792. font-weight: bold;
  793. color: $font-color-base;
  794. }
  795. .text {
  796. color: $color-gray;
  797. font-size: $font-sm;
  798. }
  799. }
  800. .title {
  801. font-size: $font-lg;
  802. font-weight: bold;
  803. }
  804. }
  805. }
  806. /* 猜你喜欢 */
  807. .guess-section {
  808. display: flex;
  809. flex-wrap: wrap;
  810. padding: 0 30rpx;
  811. .guess-item {
  812. overflow: hidden;
  813. display: flex;
  814. flex-direction: column;
  815. width: 48%;
  816. margin-bottom: 4%;
  817. border-radius: $border-radius-sm;
  818. background-color: white;
  819. box-shadow: $box-shadow;
  820. &:nth-child(2n + 1) {
  821. margin-right: 4%;
  822. }
  823. }
  824. .image-wrapper {
  825. width: 100%;
  826. height: 330rpx;
  827. border-radius: 3px;
  828. overflow: hidden;
  829. image {
  830. width: 100%;
  831. height: 100%;
  832. opacity: 1;
  833. }
  834. }
  835. .title {
  836. font-size: $font-base;
  837. color: $font-color-dark;
  838. font-weight: bold;
  839. line-height: 80rpx;
  840. }
  841. .price {
  842. font-size: $font-lg;
  843. color: $font-color-base;
  844. font-weight: bold;
  845. line-height: 1;
  846. line-height: 80rpx;
  847. }
  848. .icon {
  849. @extend %icon;
  850. }
  851. .detail {
  852. line-height: 1;
  853. }
  854. .tip {
  855. color: white;
  856. background-color: $color-yellow;
  857. line-height: 1.5;
  858. font-size: $font-sm;
  859. padding-left: 20rpx;
  860. }
  861. }
  862. // 推荐
  863. .recommend {
  864. width: 95%;
  865. margin: 0rpx auto;
  866. padding-top: 30rpx;
  867. font-size: 26rpx;
  868. text-align: center;
  869. align-items: flex-start;
  870. .recommend_list {
  871. width: 33%;
  872. }
  873. .re_title {
  874. font-size: 32rpx;
  875. font-weight: bold;
  876. }
  877. .re_name {
  878. color: #999999;
  879. padding-top: 10rpx;
  880. }
  881. .selected_icon {
  882. width: 25rpx;
  883. height: 10rpx;
  884. margin: 0px auto;
  885. display: none;
  886. image {
  887. width: 100%;
  888. height: 100%;
  889. }
  890. }
  891. .active {
  892. display: block;
  893. }
  894. .active_color {
  895. color: #dc4d46 !important;
  896. }
  897. }
  898. // 列表
  899. .list-box-h {
  900. height: 1550rpx;
  901. }
  902. // 优惠券
  903. .coupon-list {
  904. display: inline-block;
  905. }
  906. .row {
  907. border-radius: 15rpx;
  908. margin: 25rpx;
  909. height: 155rpx;
  910. // width: 552rpx;
  911. overflow: hidden;
  912. background-color: #ffffff;
  913. padding-right: 25rpx;
  914. .list-interval {
  915. border: 1px dashed $border-color-light;
  916. height: 100%;
  917. .top,
  918. .bottom {
  919. border-radius: 100rpx;
  920. width: 30rpx;
  921. height: 30rpx;
  922. position: absolute;
  923. background-color: $page-color-base;
  924. right: -15rpx;
  925. }
  926. .top {
  927. top: -18rpx;
  928. }
  929. .bottom {
  930. bottom: -18rpx;
  931. }
  932. }
  933. .list-money {
  934. height: 100%;
  935. min-width: 155rpx;
  936. text-align: center;
  937. image {
  938. height: 100%;
  939. width: 20rpx;
  940. }
  941. .list-money-text {
  942. flex-grow: 1;
  943. padding: 0 25rpx;
  944. .tit {
  945. text-align: center;
  946. padding: 15rpx 0rpx;
  947. font-size: 55rpx;
  948. color: $color-red;
  949. font-weight: bold;
  950. &.noAction {
  951. color: $font-color-light;
  952. }
  953. }
  954. .price {
  955. padding-bottom: 25rpx;
  956. color: $font-color-light;
  957. }
  958. }
  959. }
  960. .row_list_right {
  961. // flex-grow: 1;
  962. min-width: 200rpx;
  963. padding-left: 25rpx;
  964. line-height: 1;
  965. .right_time {
  966. padding: 10rpx 0rpx;
  967. color: $font-color-light;
  968. font-size: $font-sm;
  969. }
  970. .right_top {
  971. margin: 15rpx 0;
  972. .right_name {
  973. font-size: $font-base;
  974. color: #bc253a;
  975. font-weight: bold;
  976. }
  977. .right_title {
  978. font-size: $font-base;
  979. color: $font-base;
  980. font-weight: bold;
  981. &.noAction {
  982. color: $font-color-light;
  983. }
  984. }
  985. }
  986. }
  987. .right_use {
  988. margin: 15rpx 0;
  989. padding: 10rpx;
  990. width: 160rpx;
  991. text-align: center;
  992. color: #fff;
  993. background-color: #bc253a;
  994. border-radius: 50rpx;
  995. font-size: $font-sm;
  996. &.noAction {
  997. background-color: $font-color-light;
  998. }
  999. }
  1000. .iconlocation {
  1001. font-size: 36rpx;
  1002. color: $font-color-light;
  1003. }
  1004. }
  1005. </style>