You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

981 lines
24 KiB

  1. <template>
  2. <view class="container">
  3. <!-- 小程序头部兼容 -->
  4. <!-- #ifdef MP -->
  5. <!-- <view class="mp-search-box"><input class="ser-input" type="text" value="输入关键字搜索" disabled /></view> -->
  6. <!-- #endif -->
  7. <!-- 头部轮播 -->
  8. <view class="carousel-section">
  9. <!-- 标题栏和状态栏占位符 -->
  10. <view class="titleNview-placing"></view>
  11. <!-- 背景色区域 -->
  12. <view class="titleNview-background" :style="{ backgroundColor: titleNViewBackground }"></view>
  13. <swiper autoplay :interval="7000" class="carousel" circular @change="swiperChange">
  14. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item" @click="navToDetailPage({ product_id: item.product_id })">
  15. <image mode="aspectFill" :src="item.image" />
  16. </swiper-item>
  17. </swiper>
  18. <!-- 自定义swiper指示器 -->
  19. <!-- <view class="swiper-dots">
  20. <text class="num">{{ swiperCurrent + 1 }}</text>
  21. <text class="sign">/</text>
  22. <text class="num">{{ swiperLength }}</text>
  23. </view> -->
  24. </view>
  25. <!-- 分类 -->
  26. <view class="cate-section">
  27. <view class="cate-item" v-for="(item, index) in menu" :key="index" @click="navToList(item.id)">
  28. <image :src="item.image"></image>
  29. <text>{{item.name}}</text>
  30. </view>
  31. </view>
  32. <!-- 所有商品 -->
  33. <view class="seckill-section">
  34. <view class="floor-list-whitelist">
  35. <view v-for="(item, index) in cateList" :key="index" class="floor-item" @click="navToDetailPages(item)">
  36. <view style="width:100%;text-align: center;">
  37. <image :src="item.image" mode="aspectFit"></image>
  38. </view>
  39. <text class="title clamp">{{item.title }}</text>
  40. <view style="display: flex;align-items:center;justify-content: space-evenly;">
  41. <text class="price">¥{{item.sales_price }}</text>
  42. <button type="primary" class="no-border confirm-btn" @click.stop.native="addCart(item)">add cart</button>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <uni-load-more :status="loadingType"></uni-load-more>
  48. <!-- 秒杀楼层 -->
  49. <view class="seckill-section" v-if="flashSale && flashSale.product.length > 0">
  50. <!-- <view class="s-header" @click="navTo('/pages/flash/list')"> -->
  51. <!-- <text class="miaosha">Promotion</text> -->
  52. <!-- <text class="tip">{{(new Date(flashSale.starttime*1000)).getHours()}}点场</text> -->
  53. <!-- <text class="tip" v-if="flashSale.countdown">下一场倒计时</text> -->
  54. <!-- <text class="tip" v-else>{{flashSale.title}}</text> -->
  55. <!-- <uni-countdown ref="countd" v-if="flashSale.countdown" @timeup="timeup" :show-day="flashSale.countdown.day ? true : false" -->
  56. <!-- :day="day" :hour="hour" :minute="minute" :second="second" color="#FFFFFF" background-color="#00B26A" border-color="#00B26A"></uni-countdown> -->
  57. <!-- <text class="yticon icon-you"></text> -->
  58. <!-- </view> -->
  59. <view class="floor-list-whitelist">
  60. <view v-for="item in cateList" :key="item.id">
  61. <view class="cate-item b-b two" @click="changeFirst(item.id)">{{item.name}}</view>
  62. <view v-for="tItem in item.child" :key="tItem.id" class="cate-item b-b" :class="{active: tItem.id==sId}" @click="changeSecond(tItem)">
  63. {{tItem.name}}
  64. </view>
  65. </view>
  66. </view>
  67. <!-- <view class="floor-list-whitelist">
  68. <view v-for="(item, index) in flashSale.product" :key="index" class="floor-item" @click="navToDetailPage({ product_id: item.flash_product_id }, flashSale.flash_id)">
  69. <view style="width:100%;text-align: center;">
  70. <image :src="item.image" mode="aspectFill"></image>
  71. </view>
  72. <text class="title clamp">{{item.title }}</text>
  73. <text class="price">¥{{item.sales_price }}</text>
  74. </view>
  75. </view> -->
  76. <!-- <scroll-view class="floor-list" scroll-x>
  77. <view class="scoll-wrapper">
  78. <view v-for="(item, index) in flashSale.product" :key="index" class="floor-item" @click="navToDetailPage({ product_id: item.flash_product_id }, flashSale.flash_id)">
  79. <image :src="item.image" mode="aspectFill"></image>
  80. <text class="title clamp">{{item.title }}</text>
  81. <text class="price">¥{{item.sales_price }}</text>
  82. </view>
  83. </view>
  84. </scroll-view> -->
  85. </view>
  86. <!-- 团购楼层 -->
  87. <!-- <view class="f-header m-t">
  88. <image src="/static/temp/h1.png"></image>
  89. <view class="tit-box">
  90. <text class="tit">精品团购</text>
  91. <text class="tit2">Boutique Group Buying</text>
  92. </view>
  93. <text class="yticon icon-you"></text>
  94. </view> -->
  95. <!-- <view class="group-section">
  96. <swiper class="g-swiper" :duration="500">
  97. <swiper-item class="g-swiper-item" v-for="(item, index) in goodsList" :key="index" v-if="index % 2 === 0" @click="navToDetailPage(item)">
  98. <view class="g-item left">
  99. <image :src="item.image" mode="aspectFill"></image>
  100. <view class="t-box">
  101. <text class="title clamp">{{ item.title }}</text>
  102. <view class="price-box">
  103. <text class="price">¥{{ item.price }}</text>
  104. <text class="m-price">¥188</text>
  105. </view>
  106. <view class="pro-box">
  107. <view class="progress-box"><progress percent="72" activeColor="#fa436a" active stroke-width="6" /></view>
  108. <text>6人成团</text>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="g-item right">
  113. <image :src="goodsList[index + 1].image" mode="aspectFill"></image>
  114. <view class="t-box">
  115. <text class="title clamp">{{ goodsList[index + 1].title }}</text>
  116. <view class="price-box">
  117. <text class="price">¥{{ goodsList[index + 1].price }}</text>
  118. <text class="m-price">¥188</text>
  119. </view>
  120. <view class="pro-box">
  121. <view class="progress-box"><progress percent="72" activeColor="#fa436a" active stroke-width="6" /></view>
  122. <text>10人成团</text>
  123. </view>
  124. </view>
  125. </view>
  126. </swiper-item>
  127. </swiper>
  128. </view> -->
  129. <!-- 分类推荐楼层 -->
  130. <!-- <view class="f-header m-t">
  131. <image src="/static/temp/h1.png"></image>
  132. <view class="tit-box">
  133. <text class="tit">分类精选</text>
  134. <text class="tit2">Competitive Products For You</text>
  135. </view>
  136. <text class="yticon icon-you"></text>
  137. </view> -->
  138. <!-- <view class="hot-floor">
  139. <view class="floor-img-box">
  140. <image
  141. class="floor-img"
  142. src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1553409398864&di=4a12763adccf229133fb85193b7cc08f&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201703%2F19%2F20170319150032_MNwmn.jpeg"
  143. mode="scaleToFill"
  144. ></image>
  145. </view>
  146. <scroll-view class="floor-list" scroll-x>
  147. <view class="scoll-wrapper">
  148. <view v-for="(item, index) in goodsList" :key="index" class="floor-item" @click="navToDetailPage(item)">
  149. <image :src="item.image" mode="aspectFill"></image>
  150. <text class="title clamp">{{ item.title }}</text>
  151. <text class="price">¥{{ item.price }}</text>
  152. </view>
  153. <view class="more">
  154. <text>查看全部</text>
  155. <text>More+</text>
  156. </view>
  157. </view>
  158. </scroll-view>
  159. </view> -->
  160. <!-- <view class="hot-floor">
  161. <view class="floor-img-box">
  162. <image
  163. class="floor-img"
  164. src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1553409984228&di=dee176242038c2d545b7690b303d65ea&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F5ef4da9f17faaf4612f0d5046f4161e556e9bbcfdb5b-rHjf00_fw658"
  165. mode="scaleToFill"
  166. ></image>
  167. </view>
  168. <scroll-view class="floor-list" scroll-x>
  169. <view class="scoll-wrapper">
  170. <view v-for="(item, index) in goodsList" :key="index" class="floor-item" @click="navToDetailPage(item)">
  171. <image :src="item.image3" mode="aspectFill"></image>
  172. <text class="title clamp">{{ item.title }}</text>
  173. <text class="price">¥{{ item.price }}</text>
  174. </view>
  175. <view class="more">
  176. <text>查看全部</text>
  177. <text>More+</text>
  178. </view>
  179. </view>
  180. </scroll-view>
  181. </view> -->
  182. <!-- <view class="hot-floor">
  183. <view class="floor-img-box">
  184. <image
  185. class="floor-img"
  186. src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1553409794730&di=12b840ec4f5748ef06880b85ff63e34e&imgtype=0&src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F01dc03589ed568a8012060c82ac03c.jpg%40900w_1l_2o_100sh.jpg"
  187. mode="scaleToFill"
  188. ></image>
  189. </view>
  190. <scroll-view class="floor-list" scroll-x>
  191. <view class="scoll-wrapper">
  192. <view v-for="(item, index) in goodsList" :key="index" class="floor-item" @click="navToDetailPage(item)">
  193. <image :src="item.image2" mode="aspectFill"></image>
  194. <text class="title clamp">{{ item.title }}</text>
  195. <text class="price">¥{{ item.price }}</text>
  196. </view>
  197. <view class="more">
  198. <text>查看全部</text>
  199. <text>More+</text>
  200. </view>
  201. </view>
  202. </scroll-view>
  203. </view> -->
  204. <!-- 猜你喜欢 -->
  205. <!-- <view class="f-header m-t">
  206. <image src="/static/temp/h1.png"></image>
  207. <view class="tit-box">
  208. <text class="tit">猜你喜欢</text>
  209. <text class="tit2">Guess You Like It</text>
  210. </view>
  211. <text class="yticon icon-you"></text>
  212. </view>
  213. <view class="guess-section">
  214. <view v-for="(item, index) in goodsList" :key="index" class="guess-item" @click="navToDetailPage(item)">
  215. <view class="image-wrapper"><image :src="item.image" mode="aspectFill"></image></view>
  216. <text class="title clamp">{{ item.title }}</text>
  217. <text class="price"><text class="symbol">¥</text> {{ item.sales_price }} <text class="sales"> {{' '+item.sales}}人付款</text></text>
  218. </view>
  219. </view> -->
  220. </view>
  221. </template>
  222. <script>
  223. var _self = this;
  224. import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
  225. export default {
  226. components: {
  227. uniCountdown
  228. },
  229. data() {
  230. return {
  231. loadingType: '',
  232. titleNViewBackground: '',
  233. swiperCurrent: 0,
  234. swiperLength: 0,
  235. carouselList: [],
  236. goodsList: [],
  237. menu: [],
  238. flashSale: '',
  239. cateList: [],
  240. page: 1,
  241. pageSize: 16,
  242. day: 0,
  243. hour: 0,
  244. minute: 0,
  245. second: 0
  246. };
  247. },
  248. computed: {
  249. },
  250. onLoad() {
  251. // this.loadCateList();
  252. // this.loadData();
  253. },
  254. onShow() {
  255. this.loadCateList();
  256. this.loadData();
  257. },
  258. onReachBottom() {
  259. this.loadCateList();
  260. // this.getProduct();
  261. },
  262. onPullDownRefresh() {
  263. if (this.$refs && this.$refs.countd) {
  264. this.$refs.countd.syncFlag = false;
  265. }
  266. // this.goodsList = [];
  267. // this.page = 1;
  268. this.loadCateList('refresh');
  269. // this.loadData();
  270. },
  271. onShareAppMessage(e) {
  272. },
  273. methods: {
  274. /**
  275. * 请求静态数据只是为了代码不那么乱
  276. * 分次请求未作整合
  277. */
  278. async loadData() {
  279. let that = this;
  280. let login = await this.$api.checkLogin();
  281. if (login) {
  282. //获取广告图
  283. that.$api.request('/ads/index', 'GET').then((res) => {
  284. let carouselList = res;
  285. that.titleNViewBackground = carouselList[0].background;
  286. that.swiperLength = carouselList.length;
  287. that.carouselList = carouselList;
  288. });
  289. //获取菜单栏
  290. // uni.request({
  291. // url: that.$unishow + '/category/menu',
  292. // success(res) {
  293. // that.menu = res.data.data;
  294. // }
  295. // });
  296. // uni.stopPullDownRefresh();
  297. // this.getFlash();
  298. // this.getProduct();
  299. }
  300. },
  301. // 获取产品列表
  302. async getProduct() {
  303. let login = await this.$api.checkLogin();
  304. if (login) {
  305. let goodsList = await this.$api.request('/product/lists', 'GET', {
  306. page: this.page,
  307. pagesize: this.pageSize
  308. });
  309. if (goodsList) {
  310. if (goodsList.length > 0) {
  311. goodsList.forEach(item => {
  312. this.goodsList.push(item);
  313. });
  314. this.page++;
  315. } else {
  316. // this.$api.msg('没有更多数据');
  317. }
  318. }
  319. }
  320. },
  321. async loadCateList(type) {
  322. if (type === 'refresh') {
  323. this.cateList = [];
  324. this.page = 1;
  325. }
  326. const that = this;
  327. //let list = await this.$api.json('cateList');
  328. let cateList = await this.$api.request('/product/lists', 'GET', {
  329. fid: "",
  330. sid: 0,
  331. page: this.page,
  332. by: 'weigh',
  333. desc: 'desc'
  334. });
  335. // uni.stopPullDownRefresh();
  336. if (!cateList) {
  337. this.loadingType = 'nomore';
  338. return;
  339. }
  340. this.cateList = this.cateList.concat(cateList);
  341. //判断是否还有下一页,有是more 没有是nomore
  342. this.loadingType = cateList.length > 20 ? 'nomore' : 'more';
  343. if (cateList.length < 20) {
  344. this.loadingType = 'nomore';
  345. } else {
  346. this.loadingType = 'more';
  347. this.page++;
  348. }
  349. if (type === 'refresh') {
  350. uni.stopPullDownRefresh();
  351. }
  352. },
  353. // 获取限时秒杀数据
  354. async getFlash() {
  355. let data = await this.$api.request('/flash/index');
  356. if (data) {
  357. this.flashSale = data;
  358. this.day = data.countdown.day;
  359. this.hour = data.countdown.hour;
  360. this.minute = data.countdown.minute;
  361. this.second = data.countdown.second;
  362. //this.$refs.countd.update();
  363. }
  364. //console.log(this.$refs)
  365. },
  366. async addCart(item) {
  367. let is_login = await this.$api.checkLogin();
  368. if (is_login) {
  369. let data = await this.$api.request('/cart/add?id=' + item.product_id);
  370. if (data) {
  371. uni.navigateTo({
  372. url: `/pages/cart/cart`
  373. })
  374. }
  375. }
  376. },
  377. //轮播图切换修改背景色
  378. swiperChange(e) {
  379. const index = e.detail.current;
  380. this.swiperCurrent = index;
  381. this.titleNViewBackground = this.carouselList[index].background;
  382. },
  383. //详情
  384. navToDetailPages(item) {
  385. uni.navigateTo({
  386. url: `/pages/product/product?id=${item.product_id}`
  387. });
  388. },
  389. // 商品详情页
  390. navToDetailPage(item, flash_id = 0) {
  391. let id = item.product_id;
  392. uni.navigateTo({
  393. url: `/pages/product/product?id=${id}&flash=${flash_id}`
  394. });
  395. },
  396. /**
  397. * 秒杀倒计时为0时再请求一次接口
  398. */
  399. timeup() {
  400. this.getFlash();
  401. },
  402. // 跳转页面
  403. navTo(url) {
  404. uni.navigateTo({
  405. url
  406. })
  407. },
  408. // 跳转到商品列表
  409. navToList(fid) {
  410. uni.navigateTo({
  411. url: `/pages/product/list?fid=${fid}&sid=0`
  412. });
  413. }
  414. },
  415. // #ifndef MP
  416. // 标题栏input搜索框点击
  417. onNavigationBarSearchInputClicked: async function(e) {
  418. this.$api.msg('点击了搜索框');
  419. },
  420. //点击导航栏 buttons 时触发
  421. onNavigationBarButtonTap(e) {
  422. const index = e.index;
  423. if (index === 0) {
  424. this.$api.msg('点击了扫描');
  425. } else if (index === 1) {
  426. // #ifdef APP-PLUS
  427. const pages = getCurrentPages();
  428. const page = pages[pages.length - 1];
  429. const currentWebview = page.$getAppWebview();
  430. currentWebview.hideTitleNViewButtonRedDot({
  431. index
  432. });
  433. // #endif
  434. uni.navigateTo({
  435. url: '/pages/notice/notice'
  436. });
  437. }
  438. }
  439. // #endif
  440. };
  441. </script>
  442. <style lang="scss">
  443. /* #ifdef MP */
  444. .mp-search-box {
  445. position: absolute;
  446. left: 0;
  447. top: 30upx;
  448. z-index: 9999;
  449. width: 100%;
  450. padding: 0 80upx;
  451. .ser-input {
  452. flex: 1;
  453. height: 56upx;
  454. line-height: 56upx;
  455. text-align: center;
  456. font-size: 28upx;
  457. color: $font-color-base;
  458. border-radius: 20px;
  459. background: rgba(255, 255, 255, 0.6);
  460. }
  461. }
  462. /* #endif */
  463. page {
  464. .cate-section {
  465. position: relative;
  466. z-index: 5;
  467. border-radius: 16upx 16upx 0 0;
  468. margin-top: 20upx;
  469. }
  470. .carousel-section {
  471. padding: 0;
  472. .titleNview-placing {
  473. padding-top: 0;
  474. height: 0;
  475. }
  476. .carousel {
  477. .carousel-item {
  478. padding: 0;
  479. }
  480. }
  481. .swiper-dots {
  482. left: 45upx;
  483. bottom: 40upx;
  484. }
  485. }
  486. }
  487. .confirm-btn {
  488. padding: 0 10upx;
  489. margin: 0 2px;
  490. border-radius: 10px;
  491. height: 36upx;
  492. line-height: 36upx;
  493. font-size: $font-base;
  494. background: $uni-color-primary;
  495. box-shadow: 1px 2px 5px rgba(217, 60, 93, 0.72)
  496. }
  497. page {
  498. background: #f5f5f5;
  499. }
  500. .m-t {
  501. margin-top: 16upx;
  502. }
  503. /* 头部 轮播图 */
  504. .carousel-section {
  505. position: relative;
  506. padding-top: 10px;
  507. .titleNview-placing {
  508. height: var(--status-bar-height);
  509. padding-top: 44px;
  510. box-sizing: content-box;
  511. }
  512. .titleNview-background {
  513. position: absolute;
  514. top: 0;
  515. left: 0;
  516. width: 100%;
  517. height: 50vw;
  518. max-height: 400px;
  519. transition: 0.4s;
  520. }
  521. }
  522. .carousel {
  523. width: 100%;
  524. height: 50vw;
  525. max-height: 400px;
  526. .carousel-item {
  527. width: 100%;
  528. height: 100%;
  529. padding: 0 28upx;
  530. overflow: hidden;
  531. }
  532. image {
  533. width: 100%;
  534. height: 100%;
  535. border-radius: 10upx;
  536. padding: 20rpx;
  537. }
  538. }
  539. .swiper-dots {
  540. display: flex;
  541. position: absolute;
  542. left: 60upx;
  543. bottom: 15upx;
  544. width: 72upx;
  545. height: 36upx;
  546. 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==);
  547. background-size: 100% 100%;
  548. .num {
  549. width: 36upx;
  550. height: 36upx;
  551. border-radius: 50px;
  552. font-size: 24upx;
  553. color: #fff;
  554. text-align: center;
  555. line-height: 36upx;
  556. }
  557. .sign {
  558. position: absolute;
  559. top: 0;
  560. left: 50%;
  561. line-height: 36upx;
  562. font-size: 12upx;
  563. color: #fff;
  564. transform: translateX(-50%);
  565. }
  566. }
  567. /* 分类 */
  568. .cate-section {
  569. display: flex;
  570. justify-content: space-around;
  571. align-items: center;
  572. flex-wrap: wrap;
  573. padding: 30upx 22upx;
  574. background: #fff;
  575. .cate-item {
  576. display: flex;
  577. flex-direction: column;
  578. align-items: center;
  579. font-size: $font-sm + 2upx;
  580. color: $font-color-dark;
  581. }
  582. /* 原图标颜色太深,不想改图了,所以加了透明度 */
  583. image {
  584. width: 88upx;
  585. height: 88upx;
  586. margin-bottom: 14upx;
  587. border-radius: 50%;
  588. opacity: 0.7;
  589. box-shadow: 4upx 4upx 20upx rgba(250, 67, 106, 0.3);
  590. }
  591. }
  592. .ad-1 {
  593. width: 100%;
  594. height: 210upx;
  595. padding: 10upx 0;
  596. background: #fff;
  597. image {
  598. width: 100%;
  599. height: 100%;
  600. }
  601. }
  602. /* 秒杀专区 */
  603. .seckill-section {
  604. padding: 4upx 30upx 24upx;
  605. background: #fff;
  606. .miaosha {
  607. font-size: 35rpx;
  608. font-weight: 1000;
  609. color: $uni-color-primary;
  610. ;
  611. }
  612. .s-header {
  613. display: flex;
  614. align-items: center;
  615. height: 92upx;
  616. line-height: 1;
  617. .s-img {
  618. width: 140upx;
  619. height: 30upx;
  620. }
  621. .tip {
  622. font-size: $font-base;
  623. color: $font-color-light;
  624. margin: 0 20upx 0 40upx;
  625. }
  626. .timer {
  627. display: inline-block;
  628. width: 40upx;
  629. height: 36upx;
  630. text-align: center;
  631. line-height: 36upx;
  632. margin-right: 14upx;
  633. font-size: $font-sm + 2upx;
  634. color: #fff;
  635. border-radius: 2px;
  636. background: rgba(0, 0, 0, 0.8);
  637. }
  638. .icon-you {
  639. font-size: $font-lg;
  640. color: $font-color-light;
  641. flex: 1;
  642. text-align: right;
  643. }
  644. }
  645. .floor-list-whitelist {
  646. display: flex;
  647. // justify-content: space-between;
  648. flex-direction: row;
  649. flex-wrap: wrap;
  650. }
  651. .floor-list {
  652. white-space: nowrap;
  653. }
  654. .scoll-wrapper {
  655. display: flex;
  656. align-items: flex-start;
  657. }
  658. .floor-item {
  659. width: calc(100%/3);
  660. padding-right: 20upx;
  661. margin-top: 20upx;
  662. font-size: $font-sm + 2upx;
  663. color: $font-color-dark;
  664. line-height: 1.8;
  665. image {
  666. max-height: 600upx;
  667. width: 100%;
  668. height: 40vw;
  669. border-radius: 6upx;
  670. }
  671. .price {
  672. color: $uni-color-primary;
  673. }
  674. }
  675. }
  676. .f-header {
  677. display: flex;
  678. align-items: center;
  679. height: 140upx;
  680. padding: 6upx 30upx 8upx;
  681. background: #fff;
  682. image {
  683. flex-shrink: 0;
  684. width: 80upx;
  685. height: 80upx;
  686. margin-right: 20upx;
  687. }
  688. .tit-box {
  689. flex: 1;
  690. display: flex;
  691. flex-direction: column;
  692. }
  693. .tit {
  694. font-size: $font-lg + 2upx;
  695. color: #font-color-dark;
  696. line-height: 1.3;
  697. }
  698. .tit2 {
  699. font-size: $font-sm;
  700. color: $font-color-light;
  701. }
  702. .icon-you {
  703. font-size: $font-lg + 2upx;
  704. color: $font-color-light;
  705. }
  706. }
  707. /* 团购楼层 */
  708. .group-section {
  709. background: #fff;
  710. .g-swiper {
  711. height: 650upx;
  712. padding-bottom: 30upx;
  713. }
  714. .g-swiper-item {
  715. width: 100%;
  716. padding: 0 30upx;
  717. display: flex;
  718. }
  719. image {
  720. width: 100%;
  721. height: 460upx;
  722. border-radius: 4px;
  723. }
  724. .g-item {
  725. display: flex;
  726. flex-direction: column;
  727. overflow: hidden;
  728. }
  729. .left {
  730. flex: 1.2;
  731. margin-right: 24upx;
  732. .t-box {
  733. padding-top: 20upx;
  734. }
  735. }
  736. .right {
  737. flex: 0.8;
  738. flex-direction: column-reverse;
  739. .t-box {
  740. padding-bottom: 20upx;
  741. }
  742. }
  743. .t-box {
  744. height: 160upx;
  745. font-size: $font-base + 2upx;
  746. color: $font-color-dark;
  747. line-height: 1.6;
  748. }
  749. .price {
  750. color: $uni-color-primary;
  751. }
  752. .m-price {
  753. font-size: $font-sm + 2upx;
  754. text-decoration: line-through;
  755. color: $font-color-light;
  756. margin-left: 8upx;
  757. }
  758. .pro-box {
  759. display: flex;
  760. align-items: center;
  761. margin-top: 10upx;
  762. font-size: $font-sm;
  763. color: $font-base;
  764. padding-right: 10upx;
  765. }
  766. .progress-box {
  767. flex: 1;
  768. border-radius: 10px;
  769. overflow: hidden;
  770. margin-right: 8upx;
  771. }
  772. }
  773. /* 分类推荐楼层 */
  774. .hot-floor {
  775. width: 100%;
  776. overflow: hidden;
  777. margin-bottom: 20upx;
  778. .floor-img-box {
  779. width: 100%;
  780. height: 320upx;
  781. position: relative;
  782. &:after {
  783. content: '';
  784. position: absolute;
  785. left: 0;
  786. top: 0;
  787. width: 100%;
  788. height: 100%;
  789. background: linear-gradient(rgba(255, 255, 255, 0.06) 30%, #f8f8f8);
  790. }
  791. }
  792. .floor-img {
  793. width: 100%;
  794. height: 100%;
  795. }
  796. .floor-list {
  797. white-space: nowrap;
  798. padding: 20upx;
  799. padding-right: 50upx;
  800. border-radius: 6upx;
  801. margin-top: -140upx;
  802. margin-left: 30upx;
  803. background: #fff;
  804. box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
  805. position: relative;
  806. z-index: 1;
  807. }
  808. .scoll-wrapper {
  809. display: flex;
  810. align-items: flex-start;
  811. }
  812. .floor-item {
  813. margin-right: 20upx;
  814. font-size: $font-sm + 2upx;
  815. color: $font-color-dark;
  816. line-height: 1.8;
  817. image {
  818. width: 180upx;
  819. height: 180upx;
  820. border-radius: 6upx;
  821. }
  822. .price {
  823. color: $uni-color-primary;
  824. }
  825. }
  826. .more {
  827. display: flex;
  828. align-items: center;
  829. justify-content: center;
  830. flex-direction: column;
  831. flex-shrink: 0;
  832. width: 180upx;
  833. height: 180upx;
  834. border-radius: 6upx;
  835. background: #f3f3f3;
  836. font-size: $font-base;
  837. color: $font-color-light;
  838. text:first-child {
  839. margin-bottom: 4upx;
  840. }
  841. }
  842. }
  843. /* 猜你喜欢 */
  844. .guess-section {
  845. display: flex;
  846. flex-wrap: wrap;
  847. padding: 0 30upx;
  848. background: #fff;
  849. .guess-item {
  850. display: flex;
  851. flex-direction: column;
  852. width: 48%;
  853. padding-bottom: 40upx;
  854. &:nth-child(2n + 1) {
  855. margin-right: 4%;
  856. }
  857. }
  858. .image-wrapper {
  859. width: 100%;
  860. height: 330upx;
  861. border-radius: 3px;
  862. overflow: hidden;
  863. image {
  864. width: 100%;
  865. height: 100%;
  866. opacity: 1;
  867. }
  868. }
  869. .title {
  870. font-size: 12px;
  871. color: $font-color-dark;
  872. line-height: 80upx;
  873. }
  874. .price {
  875. font-size: $font-lg;
  876. color: $uni-color-primary;
  877. line-height: 1;
  878. .sales {
  879. color: #999999;
  880. font-size: 24upx;
  881. }
  882. .symbol {
  883. font-size: 24upx;
  884. }
  885. }
  886. }
  887. </style>