index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  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. <view class="mp-height"></view>
  12. <!-- #endif -->
  13. <!-- 头部轮播 -->
  14. <view class="carousel-section">
  15. <!-- 标题栏和状态栏占位符 -->
  16. <view class="titleNview-placing"></view>
  17. <!-- 背景色区域 -->
  18. <view class="titleNview-background" :style="{ backgroundColor: '#5DBC7C' }"></view>
  19. <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  20. <!-- <swiper class="carousel" autoplay="true" duration="400" interval="5000"> -->
  21. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item">
  22. <image :src="item.pic" mode="aspectFill" @click="bannerNavToUrl(item)"></image>
  23. </swiper-item>
  24. </swiper>
  25. <!-- 自定义swiper指示器 -->
  26. <view class="swiper-dots">
  27. <text class="num">{{ swiperCurrent + 1 }}</text>
  28. <text class="sign">/</text>
  29. <text class="num">{{ swiperLength }}</text>
  30. </view>
  31. </view>
  32. <!-- 分类 -->
  33. <view class="cate-section">
  34. <navigator url="/pages/shoping/list">
  35. <view class="cate-item">
  36. <image class="Uimg" src="/static/icon/u5.png"></image>
  37. <text>商家联盟</text>
  38. </view>
  39. </navigator>
  40. <navigator url="/pages/product/giftBag">
  41. <view class="cate-item">
  42. <image src="/static/icon/c3.png"></image>
  43. <text>联盟礼包</text>
  44. </view>
  45. </navigator>
  46. <navigator url="/pages/integral/index">
  47. <view class="cate-item">
  48. <image src="/static/icon/c6.png"></image>
  49. <text>积分商城</text>
  50. </view>
  51. </navigator>
  52. <navigator url="/pages/sign/index">
  53. <view class="cate-item">
  54. <image src="/static/icon/c8.png"></image>
  55. <text>每日签到</text>
  56. </view>
  57. </navigator>
  58. </view>
  59. <view class="cate-section">
  60. <navigator url="/pages/groupBooking/index">
  61. <view class="cate-item">
  62. <image src="/static/icon/c5.png"></image>
  63. <text>超值拼团</text>
  64. </view>
  65. </navigator>
  66. <navigator url="/pages/seckill/seckill">
  67. <view class="cate-item">
  68. <!--v-if="userInfo.level>0"-->
  69. <image src="/static/icon/c7.png"></image>
  70. <text>限时秒杀</text>
  71. </view>
  72. </navigator>
  73. <navigator url="/pages/received/index?state=0">
  74. <view class="cate-item">
  75. <!--v-if="userInfo.level>0"-->
  76. <image src="/static/icon/c9.png"></image>
  77. <text>收付款</text>
  78. </view>
  79. </navigator>
  80. <!-- <view class="cate-item"><text class="none-font-color">每日签到</text></view> -->
  81. <view class="cate-item"><text class="none-font-color">每日签到</text></view>
  82. </view>
  83. <!-- <view class="ad-1"><image src="/static/temp/ad1.jpg" mode="scaleToFill"></image></view> -->
  84. <!-- 会员升级专区 -->
  85. <!-- <view class="f-header m-t">
  86. <view class="f-left-icon"></view>
  87. <view class="tit-box"><text class="tit">会员升级专区</text></view>
  88. </view> -->
  89. <!-- <view class="uservip flex" v-for="(ls,index) in userServant" @click="navToDetailPage(ls)">
  90. <image @error="onImageError('userServant', index)" lazy-load :src="ls.image" mode="aspectFill"></image>
  91. <view class="detail">
  92. <view class="title">{{ls.store_name}}</view>
  93. <view class="icon" v-if="ls.mer_id==0">自营</view>
  94. <view class="flex price-box">
  95. <view class="price">
  96. <text class="font-size-sm">¥</text>
  97. {{ls.price|moneyNum}}
  98. </view>
  99. <view class="text">售出{{ls.sales}}</view>
  100. </view>
  101. </view>
  102. </view> -->
  103. <!-- 秒杀楼层 -->
  104. <seckill v-if="userInfo.level > 0"></seckill>
  105. <!-- 团购楼层 -->
  106. <!-- <view class="f-header m-t">
  107. <view class="f-left-icon"></view>
  108. <view class="tit-box"><text class="tit">超值拼团</text></view>
  109. <text class="iconfont iconenter">更多</text>
  110. </view> -->
  111. <!-- <view class="group-section">
  112. <swiper class="g-swiper" :duration="500">
  113. <swiper-item class="g-swiper-item" v-for="(item, index) in goodsList" :key="index" v-if="index % 2 === 0" @click="navToDetailPage(item)">
  114. <view class="g-item left">
  115. <image :src="item.image" mode="aspectFill"></image>
  116. <view class="t-box">
  117. <text class="title clamp">{{ item.store_name }}</text>
  118. <view class="price-box">
  119. <text class="price">¥{{ item.price }}</text>
  120. <text class="m-price">¥188</text>
  121. </view>
  122. <view class="pro-box">
  123. <view class="progress-box"><progress percent="72" activeColor="#fa436a" active stroke-width="6" /></view>
  124. <text>6人成团</text>
  125. </view>
  126. </view>
  127. </view>
  128. <view class="g-item right">
  129. <image :src="goodsList.image" mode="aspectFill"></image>
  130. <view class="t-box">
  131. <text class="title clamp">{{ goodsList.store_name }}</text>
  132. <view class="price-box">
  133. <text class="price">¥{{ goodsList.price }}</text>
  134. <text class="m-price">¥188</text>
  135. </view>
  136. <view class="pro-box">
  137. <view class="progress-box"><progress percent="72" activeColor="#fa436a" active stroke-width="6" /></view>
  138. <text>10人成团</text>
  139. </view>
  140. </view>
  141. </view>
  142. </swiper-item>
  143. </swiper>
  144. </view> -->
  145. <!-- 最新 商品 -->
  146. <view class="f-header m-t">
  147. <view class="f-left-icon"></view>
  148. <view class="tit-box"><text class="tit">最新商品</text></view>
  149. <navigator url="/pages/product/classify?type=3"><text class="iconfont iconenter">更多</text></navigator>
  150. </view>
  151. <view class="guess-section">
  152. <view v-for="(item, index) in goodsList" :key="index" class="guess-item" @click="navToDetailPage(item)">
  153. <view class="image-wrapper"><image :src="item.image" mode="aspectFill"></image></view>
  154. <text class="title clamp margin-c-20">{{ item.store_name }}</text>
  155. <view class="cmy-hr"></view>
  156. <view class="price margin-c-20 flex">
  157. <view>
  158. <text class="font-size-sm ">¥</text>
  159. {{ item.price | moneyNum }}
  160. </view>
  161. <view class="font-size-sm">
  162. <text class="font-color-gray">售出{{ item.sales }}</text>
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. <!-- 促销 商品 -->
  168. <!-- <view class="f-header m-t">
  169. <view class="f-left-icon"></view>
  170. <view class="tit-box"><text class="tit">促销商品</text></view>
  171. </view>
  172. <view class="guess-section">
  173. <view v-for="(item, index) in bastBanner" :key="index" class="guess-item" @click="navToDetailPage(item)">
  174. <view class="image-wrapper"><image :src="item.image" mode="aspectFill"></image></view>
  175. <text class="title clamp margin-c-20">{{ item.store_name }}</text>
  176. <view class="cmy-hr"></view>
  177. <view class="price margin-c-20 flex">
  178. <view>
  179. <text class="font-size-sm ">¥</text>
  180. {{ item.price }}
  181. </view>
  182. <view class="font-size-sm">
  183. <text class="font-color-gray">{{ item.sales }}人购买</text>
  184. </view>
  185. </view>
  186. </view>
  187. </view> -->
  188. <!-- 精品 商品 -->
  189. <!-- <view class="f-header m-t">
  190. <view class="f-left-icon"></view>
  191. <view class="tit-box"><text class="tit">联盟礼包</text></view>
  192. <text class="iconfont iconenter">更多</text>
  193. </view> -->
  194. <!-- <view class="guess-section">
  195. <view v-for="(item, index) in bastList" :key="index" class="guess-item" @click="navToDetailPage(item)">
  196. <view class="image-wrapper"><image :src="item.image" mode="aspectFill"></image></view>
  197. <text class="title clamp margin-c-20">{{ item.store_name }}</text>
  198. <view class="cmy-hr"></view>
  199. <view class="price margin-c-20 flex">
  200. <view>
  201. <text class="font-size-sm ">¥</text>
  202. {{ item.price }}
  203. </view>
  204. <view class="font-size-sm">
  205. <text class="font-color-gray">{{ item.sales }}人购买</text>
  206. </view>
  207. </view>
  208. </view>
  209. </view> -->
  210. <!-- 精品推荐 -->
  211. <view class="f-header m-t">
  212. <view class="f-left-icon"></view>
  213. <view class="tit-box"><text class="tit">精品推荐</text></view>
  214. <navigator url="/pages/product/classify?type=1"><text class="iconfont iconenter">更多</text></navigator>
  215. </view>
  216. <view class="guess-section">
  217. <view v-for="(item, index) in bastList" :key="index" class="guess-item" @click="navToDetailPage(item)">
  218. <view class="image-wrapper"><image :src="item.image" mode="aspectFill"></image></view>
  219. <text class="title clamp margin-c-20">{{ item.store_name }}</text>
  220. <view class="cmy-hr"></view>
  221. <view class="price margin-c-20 flex">
  222. <view>
  223. <text class="font-size-sm ">¥</text>
  224. {{ item.price | moneyNum }}
  225. </view>
  226. <view class="font-size-sm">
  227. <text class="font-color-gray">售出{{ item.sales }}</text>
  228. </view>
  229. </view>
  230. </view>
  231. <!-- <view v-for="(item, index) in goodsList" :key="index" class="guess-item" @click="navToDetailPage(item)">
  232. <view class="image-wrapper"><image @error="onImageError('goodsList', index)" lazy-load :src="item.image" mode="aspectFill"></image></view>
  233. <text class="title clamp margin-c-20">
  234. <text class="icon">自营</text>
  235. {{ item.title }}
  236. </text>
  237. <view class="hr"></view>
  238. <view class="price margin-c-20 flex">
  239. <view>
  240. <text class="font-size-sm ">¥</text>
  241. {{ item.price }}
  242. </view>
  243. <view class="font-size-sm">
  244. <view class='detail'>
  245. <text class="icon">代理价</text>
  246. <text></text>
  247. </view>
  248. <view class="detail">
  249. <text class="font-color-yellow">会员价</text>
  250. <text class="font-color-yellow">7.5折</text>
  251. </view>
  252. </view>
  253. </view>
  254. <view class="tip">兑换价¥44+44积分</view>
  255. </view> -->
  256. </view>
  257. </view>
  258. </template>
  259. <script>
  260. import seckill from './seckill';
  261. import { loadIndexs } from '@/api/index.js';
  262. import { interceptor } from '@/utils/loginUtils';
  263. import { userinfo } from '@/api/user.js';
  264. import { mapState } from 'vuex';
  265. export default {
  266. components: {
  267. seckill
  268. },
  269. filters: {
  270. moneyNum: function(value) {
  271. return +value;
  272. }
  273. },
  274. data() {
  275. return {
  276. titleNViewBackground: '',
  277. swiperCurrent: 0,
  278. swiperLength: 0,
  279. carouselList: [], //轮播列表
  280. goodsList: [], //最新商品列表
  281. bastList: [], //精品推荐列表
  282. bastBanner: [], //促销商品列表
  283. menusList: [], //头部菜单
  284. userServant: [
  285. {
  286. image: ''
  287. }
  288. ] //用户推广服务
  289. };
  290. },
  291. computed: {
  292. ...mapState(['loginInterceptor']),
  293. ...mapState('user', ['hasLogin', 'userInfo'])
  294. },
  295. onLoad(option) {
  296. let agree = uni.getStorageSync("agree")||false;
  297. // 判断是否已经同意协议
  298. if(!agree){
  299. uni.redirectTo({url:"/pages/contract/start"})
  300. }
  301. if (option.spread) {
  302. // 存储邀请人
  303. uni.setStorage({
  304. key: 'spread',
  305. data: option.spread
  306. });
  307. }
  308. },
  309. onShow() {
  310. // 判断是否强制登录
  311. if (this.loginInterceptor && !this.hasLogin) {
  312. // 登录拦截
  313. userinfo()
  314. .then(e => {})
  315. .catch(e => {
  316. console.log(e);
  317. });
  318. }
  319. this.loadData();
  320. },
  321. // #ifndef MP
  322. // 监听导航栏输入框点击事件
  323. onNavigationBarSearchInputClicked(e) {
  324. //跳转到搜索页面
  325. this.clickSearch();
  326. },
  327. //点击导航栏 buttons 时触发
  328. onNavigationBarButtonTap(e) {
  329. const index = e.index;
  330. if (index === 0) {
  331. this.$api.msg('点击了扫描');
  332. } else if (index === 1) {
  333. // #ifdef APP-PLUS
  334. const pages = getCurrentPages();
  335. const page = pages[pages.length - 1];
  336. const currentWebview = page.$getAppWebview();
  337. currentWebview.hideTitleNViewButtonRedDot({
  338. index
  339. });
  340. // #endif
  341. uni.navigateTo({
  342. url: '/pages/notice/notice'
  343. });
  344. }
  345. },
  346. // #endif
  347. methods: {
  348. // 點擊搜索框
  349. clickSearch() {
  350. uni.navigateTo({
  351. url: '/pages/product/search'
  352. });
  353. },
  354. // 监听图片加载完成
  355. onImageError(key, index) {
  356. this[key][index].image = '/static/error/errorImage.jpg';
  357. },
  358. // 请求载入数据
  359. async loadData() {
  360. loadIndexs({}).then(({ data }) => {
  361. let goods = data.info;
  362. this.carouselList = data.banner;
  363. this.swiperLength = this.carouselList.length;
  364. this.menusList = data.menus;
  365. this.goodsList = goods.firstList; //最新商品
  366. this.bastList = goods.bastList; //精品推荐
  367. this.bastBanner = goods.bastBanner; //促销单品
  368. this.userServant = goods.platoonList; //服务商品
  369. });
  370. },
  371. //轮播图切换修改背景色
  372. swiperChange(e) {
  373. const index = e.detail.current;
  374. this.swiperCurrent = index;
  375. // this.titleNViewBackground = this.carouselList[index].background;
  376. },
  377. //详情页
  378. navToDetailPage(item) {
  379. uni.navigateTo({
  380. url: '/pages/product/product?id=' + item.id
  381. });
  382. },
  383. // 轮播图跳转
  384. bannerNavToUrl(item) {
  385. // #ifdef H5
  386. if (item.wap_url.indexOf('http') > 0) {
  387. window.location.href = item.wap_url;
  388. }
  389. // #endif
  390. //测试数据没有写id,用title代替
  391. uni.navigateTo({
  392. url: item.wap_url
  393. });
  394. }
  395. }
  396. };
  397. </script>
  398. <style lang="scss">
  399. /* #ifdef MP */
  400. .mp-height {
  401. height: 44px;
  402. }
  403. .input-box {
  404. position: fixed;
  405. top: 0;
  406. left: 0;
  407. width: 100%;
  408. padding: 25rpx;
  409. background-color: #ffffff;
  410. z-index: 999;
  411. height: 44px;
  412. .iconsearch {
  413. font-size: 50rpx;
  414. }
  415. .input-content {
  416. border-radius: 99rpx;
  417. flex-grow: 1;
  418. padding: 10rpx 30rpx;
  419. background-color: rgba(231, 231, 231, 0.7);
  420. .input {
  421. flex-grow: 1;
  422. input {
  423. font-size: $font-lg;
  424. }
  425. }
  426. }
  427. .input-button {
  428. padding-left: 20rpx;
  429. font-size: $font-lg;
  430. height: 100%;
  431. }
  432. }
  433. page {
  434. .cate-section {
  435. position: relative;
  436. z-index: 5;
  437. border-radius: 16rpx 16rpx 0 0;
  438. margin-top: -20rpx;
  439. }
  440. .carousel-section {
  441. padding: 0;
  442. .titleNview-placing {
  443. padding-top: 0;
  444. height: 0;
  445. }
  446. .carousel {
  447. .carousel-item {
  448. padding: 0;
  449. }
  450. }
  451. .swiper-dots {
  452. left: 45rpx;
  453. bottom: 40rpx;
  454. }
  455. }
  456. }
  457. /* #endif */
  458. page {
  459. background: $page-color-base;
  460. }
  461. .m-t {
  462. margin-top: 16rpx;
  463. }
  464. /* 头部 轮播图 */
  465. .carousel-section {
  466. position: relative;
  467. padding-top: 10px;
  468. overflow: hidden;
  469. .titleNview-placing {
  470. height: var(--status-bar-height);
  471. padding-top: 44px;
  472. box-sizing: content-box;
  473. }
  474. .titleNview-background {
  475. position: absolute;
  476. top: 0;
  477. left: -50rpx;
  478. width: 850rpx;
  479. height: 220rpx;
  480. transition: 0.4s;
  481. border-bottom-left-radius: 100rpx;
  482. border-bottom-right-radius: 100rpx;
  483. }
  484. }
  485. .carousel {
  486. width: 100%;
  487. height: 240rpx;
  488. .carousel-item {
  489. width: 100%;
  490. height: 100%;
  491. padding: 0 28rpx;
  492. overflow: hidden;
  493. }
  494. image {
  495. width: 100%;
  496. height: 100%;
  497. border-radius: $border-radius-sm;
  498. }
  499. }
  500. .swiper-dots {
  501. display: flex;
  502. position: absolute;
  503. left: 60rpx;
  504. bottom: 15rpx;
  505. width: 72rpx;
  506. height: 36rpx;
  507. 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==);
  508. background-size: 100% 100%;
  509. .num {
  510. width: 36rpx;
  511. height: 36rpx;
  512. border-radius: 50px;
  513. font-size: 24rpx;
  514. color: #fff;
  515. text-align: center;
  516. line-height: 36rpx;
  517. }
  518. .sign {
  519. position: absolute;
  520. top: 0;
  521. left: 50%;
  522. line-height: 36rpx;
  523. font-size: 12rpx;
  524. color: #fff;
  525. transform: translateX(-50%);
  526. }
  527. }
  528. /* 分类 */
  529. .cate-section {
  530. display: flex;
  531. justify-content: space-around;
  532. align-items: center;
  533. flex-wrap: wrap;
  534. padding: 30rpx 22rpx;
  535. .cate-item {
  536. display: flex;
  537. flex-direction: column;
  538. align-items: center;
  539. font-size: $font-sm + 2rpx;
  540. color: $font-color-dark;
  541. .none-font-color {
  542. color: $page-color-base;
  543. }
  544. .Uimg {
  545. border-radius: 999px;
  546. }
  547. }
  548. /* 原图标颜色太深,不想改图了,所以加了透明度 */
  549. image {
  550. width: 88rpx;
  551. height: 88rpx;
  552. margin-bottom: 14rpx;
  553. border-radius: 50%;
  554. opacity: 0.7;
  555. }
  556. }
  557. .ad-1 {
  558. width: 100%;
  559. height: 210upx;
  560. padding: 10upx 0;
  561. background: #fff;
  562. image {
  563. width: 100%;
  564. height: 100%;
  565. }
  566. }
  567. /*公用边框样式*/
  568. %icon {
  569. margin-right: 10rpx;
  570. display: inline-block;
  571. padding: 2rpx 10rpx;
  572. border: 1rpx solid $color-yellow;
  573. color: $color-yellow;
  574. line-height: 1;
  575. font-size: $font-base;
  576. border-radius: 10rpx;
  577. }
  578. /* 秒杀专区 */
  579. .seckill-section {
  580. padding: 4rpx 30rpx 24rpx;
  581. .s-header {
  582. display: flex;
  583. align-items: center;
  584. height: 92rpx;
  585. line-height: 1;
  586. .tit-box {
  587. @extend %font-title-box;
  588. }
  589. .tit {
  590. @extend %font-title;
  591. }
  592. .f-left-icon {
  593. @extend %f-left-icon;
  594. }
  595. .tip {
  596. font-size: $font-sm - 10rpx;
  597. color: $font-color-light;
  598. margin: 0 20rpx 0 40rpx;
  599. }
  600. .timer {
  601. display: inline-block;
  602. width: 40rpx;
  603. height: 36rpx;
  604. text-align: center;
  605. line-height: 36rpx;
  606. margin-right: 14rpx;
  607. font-size: $font-sm + 2rpx;
  608. color: #fff;
  609. border-radius: 2px;
  610. background: rgba(0, 0, 0, 0.8);
  611. }
  612. .iconenter {
  613. font-size: $font-sm;
  614. color: $font-color-light;
  615. flex: 1;
  616. text-align: right;
  617. }
  618. }
  619. .floor-list {
  620. white-space: nowrap;
  621. background-color: white;
  622. padding: 20rpx;
  623. border-radius: 5rpx;
  624. box-shadow: $box-shadow;
  625. }
  626. .scoll-wrapper {
  627. display: flex;
  628. align-items: flex-start;
  629. }
  630. .floor-item {
  631. width: 150rpx;
  632. margin-right: 20rpx;
  633. font-size: $font-sm + 2rpx;
  634. color: $font-color-dark;
  635. line-height: 1.8;
  636. image {
  637. width: 150rpx;
  638. height: 150rpx;
  639. border-radius: 6rpx;
  640. }
  641. .price {
  642. color: $color-red;
  643. }
  644. }
  645. }
  646. .f-header {
  647. display: flex;
  648. align-items: center;
  649. height: 92rpx;
  650. padding: 6rpx 30rpx 8rpx;
  651. image {
  652. flex-shrink: 0;
  653. width: 80rpx;
  654. height: 80rpx;
  655. margin-right: 20rpx;
  656. }
  657. .tit-box {
  658. @extend %font-title-box;
  659. }
  660. .tit {
  661. @extend %font-title;
  662. }
  663. .iconenter {
  664. font-size: $font-lg + 2rpx;
  665. color: $font-color-light;
  666. }
  667. .f-left-icon {
  668. @extend %f-left-icon;
  669. }
  670. .iconfont {
  671. font-size: $font-sm - 2rpx;
  672. }
  673. }
  674. /* 团购楼层 */
  675. .group-section {
  676. padding: 0rpx 30rpx 24rpx;
  677. .g-swiper {
  678. height: 650rpx;
  679. border-radius: 5rpx;
  680. box-shadow: $box-shadow;
  681. }
  682. .g-swiper-item {
  683. width: 100%;
  684. padding: 20rpx;
  685. padding-bottom: 30rpx;
  686. display: flex;
  687. background-color: white;
  688. }
  689. image {
  690. width: 100%;
  691. height: 460rpx;
  692. border-radius: 4px;
  693. }
  694. .g-item {
  695. display: flex;
  696. flex-direction: column;
  697. overflow: hidden;
  698. }
  699. .left {
  700. flex: 1.2;
  701. margin-right: 24rpx;
  702. .t-box {
  703. padding-top: 20rpx;
  704. }
  705. }
  706. .right {
  707. flex: 0.8;
  708. flex-direction: column-reverse;
  709. .t-box {
  710. padding-bottom: 20rpx;
  711. }
  712. }
  713. .t-box {
  714. height: 160rpx;
  715. font-size: $font-base + 2rpx;
  716. color: $font-color-dark;
  717. line-height: 1.6;
  718. }
  719. .price {
  720. color: $uni-color-primary;
  721. }
  722. .m-price {
  723. font-size: $font-sm + 2rpx;
  724. text-decoration: line-through;
  725. color: $font-color-light;
  726. margin-left: 8rpx;
  727. }
  728. .pro-box {
  729. display: flex;
  730. align-items: center;
  731. margin-top: 10rpx;
  732. font-size: $font-sm;
  733. color: $font-base;
  734. padding-right: 10rpx;
  735. }
  736. .progress-box {
  737. flex: 1;
  738. border-radius: $border-radius-sm;
  739. overflow: hidden;
  740. margin-right: 8rpx;
  741. }
  742. }
  743. // 会员升级礼包
  744. .uservip {
  745. border-radius: $border-radius-sm;
  746. background-color: white;
  747. box-shadow: $box-shadow;
  748. height: 300rpx;
  749. margin: 0 30rpx;
  750. image {
  751. height: 100%;
  752. width: 300rpx;
  753. }
  754. .detail {
  755. position: relative;
  756. padding: 20rpx;
  757. height: 100%;
  758. flex-grow: 1;
  759. .icon {
  760. @extend %icon;
  761. }
  762. .price-box {
  763. position: absolute;
  764. bottom: 20rpx;
  765. width: calc(100% - 40rpx);
  766. .price {
  767. font-size: $font-lg + 2rpx;
  768. font-weight: bold;
  769. color: $font-color-base;
  770. }
  771. .text {
  772. color: $color-gray;
  773. font-size: $font-sm;
  774. }
  775. }
  776. .title {
  777. font-size: $font-lg;
  778. font-weight: bold;
  779. }
  780. }
  781. }
  782. /* 猜你喜欢 */
  783. .guess-section {
  784. display: flex;
  785. flex-wrap: wrap;
  786. padding: 0 30rpx;
  787. .guess-item {
  788. overflow: hidden;
  789. display: flex;
  790. flex-direction: column;
  791. width: 48%;
  792. margin-bottom: 4%;
  793. border-radius: $border-radius-sm;
  794. background-color: white;
  795. box-shadow: $box-shadow;
  796. &:nth-child(2n + 1) {
  797. margin-right: 4%;
  798. }
  799. }
  800. .image-wrapper {
  801. width: 100%;
  802. height: 330rpx;
  803. border-radius: 3px;
  804. overflow: hidden;
  805. image {
  806. width: 100%;
  807. height: 100%;
  808. opacity: 1;
  809. }
  810. }
  811. .title {
  812. font-size: $font-base;
  813. color: $font-color-dark;
  814. font-weight: bold;
  815. line-height: 80rpx;
  816. }
  817. .price {
  818. font-size: $font-lg;
  819. color: $font-color-base;
  820. font-weight: bold;
  821. line-height: 1;
  822. line-height: 80rpx;
  823. }
  824. .icon {
  825. @extend %icon;
  826. }
  827. .detail {
  828. line-height: 1;
  829. }
  830. .tip {
  831. color: white;
  832. background-color: $color-yellow;
  833. line-height: 1.5;
  834. font-size: $font-sm;
  835. padding-left: 20rpx;
  836. }
  837. }
  838. </style>