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.
 
 
 
 
 
 

980 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 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.loadData();
  256. },
  257. onReachBottom() {
  258. this.loadCateList();
  259. // this.getProduct();
  260. },
  261. onPullDownRefresh() {
  262. if (this.$refs && this.$refs.countd) {
  263. this.$refs.countd.syncFlag = false;
  264. }
  265. // this.goodsList = [];
  266. // this.page = 1;
  267. this.loadCateList('refresh');
  268. // this.loadData();
  269. },
  270. onShareAppMessage(e) {
  271. },
  272. methods: {
  273. /**
  274. * 请求静态数据只是为了代码不那么乱
  275. * 分次请求未作整合
  276. */
  277. async loadData() {
  278. let that = this;
  279. let login = await this.$api.checkLogin();
  280. if (login) {
  281. //获取广告图
  282. that.$api.request('/ads/index', 'GET').then((res) => {
  283. let carouselList = res;
  284. that.titleNViewBackground = carouselList[0].background;
  285. that.swiperLength = carouselList.length;
  286. that.carouselList = carouselList;
  287. });
  288. //获取菜单栏
  289. // uni.request({
  290. // url: that.$unishow + '/category/menu',
  291. // success(res) {
  292. // that.menu = res.data.data;
  293. // }
  294. // });
  295. // uni.stopPullDownRefresh();
  296. // this.getFlash();
  297. // this.getProduct();
  298. }
  299. },
  300. // 获取产品列表
  301. async getProduct() {
  302. let login = await this.$api.checkLogin();
  303. if (login) {
  304. let goodsList = await this.$api.request('/product/lists', 'GET', {
  305. page: this.page,
  306. pagesize: this.pageSize
  307. });
  308. if (goodsList) {
  309. if (goodsList.length > 0) {
  310. goodsList.forEach(item => {
  311. this.goodsList.push(item);
  312. });
  313. this.page++;
  314. } else {
  315. // this.$api.msg('没有更多数据');
  316. }
  317. }
  318. }
  319. },
  320. async loadCateList(type) {
  321. if (type === 'refresh') {
  322. this.cateList = [];
  323. this.page = 1;
  324. }
  325. const that = this;
  326. //let list = await this.$api.json('cateList');
  327. let cateList = await this.$api.request('/product/lists', 'GET', {
  328. fid: "",
  329. sid: 0,
  330. page: this.page,
  331. by: 'weigh',
  332. desc: 'desc'
  333. });
  334. // uni.stopPullDownRefresh();
  335. if (!cateList) {
  336. this.loadingType = 'nomore';
  337. return;
  338. }
  339. this.cateList = this.cateList.concat(cateList);
  340. //判断是否还有下一页,有是more 没有是nomore
  341. this.loadingType = cateList.length > 20 ? 'nomore' : 'more';
  342. if (cateList.length < 20) {
  343. this.loadingType = 'nomore';
  344. } else {
  345. this.loadingType = 'more';
  346. this.page++;
  347. }
  348. if (type === 'refresh') {
  349. uni.stopPullDownRefresh();
  350. }
  351. },
  352. // 获取限时秒杀数据
  353. async getFlash() {
  354. let data = await this.$api.request('/flash/index');
  355. if (data) {
  356. this.flashSale = data;
  357. this.day = data.countdown.day;
  358. this.hour = data.countdown.hour;
  359. this.minute = data.countdown.minute;
  360. this.second = data.countdown.second;
  361. //this.$refs.countd.update();
  362. }
  363. //console.log(this.$refs)
  364. },
  365. async addCart(item) {
  366. let is_login = await this.$api.checkLogin();
  367. if (is_login) {
  368. let data = await this.$api.request('/cart/add?id=' + item.product_id);
  369. if (data) {
  370. uni.navigateTo({
  371. url: `/pages/cart/cart`
  372. })
  373. }
  374. }
  375. },
  376. //轮播图切换修改背景色
  377. swiperChange(e) {
  378. const index = e.detail.current;
  379. this.swiperCurrent = index;
  380. this.titleNViewBackground = this.carouselList[index].background;
  381. },
  382. //详情
  383. navToDetailPages(item) {
  384. uni.navigateTo({
  385. url: `/pages/product/product?id=${item.product_id}`
  386. });
  387. },
  388. // 商品详情页
  389. navToDetailPage(item, flash_id = 0) {
  390. let id = item.product_id;
  391. uni.navigateTo({
  392. url: `/pages/product/product?id=${id}&flash=${flash_id}`
  393. });
  394. },
  395. /**
  396. * 秒杀倒计时为0时再请求一次接口
  397. */
  398. timeup() {
  399. this.getFlash();
  400. },
  401. // 跳转页面
  402. navTo(url) {
  403. uni.navigateTo({
  404. url
  405. })
  406. },
  407. // 跳转到商品列表
  408. navToList(fid) {
  409. uni.navigateTo({
  410. url: `/pages/product/list?fid=${fid}&sid=0`
  411. });
  412. }
  413. },
  414. // #ifndef MP
  415. // 标题栏input搜索框点击
  416. onNavigationBarSearchInputClicked: async function(e) {
  417. this.$api.msg('点击了搜索框');
  418. },
  419. //点击导航栏 buttons 时触发
  420. onNavigationBarButtonTap(e) {
  421. const index = e.index;
  422. if (index === 0) {
  423. this.$api.msg('点击了扫描');
  424. } else if (index === 1) {
  425. // #ifdef APP-PLUS
  426. const pages = getCurrentPages();
  427. const page = pages[pages.length - 1];
  428. const currentWebview = page.$getAppWebview();
  429. currentWebview.hideTitleNViewButtonRedDot({
  430. index
  431. });
  432. // #endif
  433. uni.navigateTo({
  434. url: '/pages/notice/notice'
  435. });
  436. }
  437. }
  438. // #endif
  439. };
  440. </script>
  441. <style lang="scss">
  442. /* #ifdef MP */
  443. .mp-search-box {
  444. position: absolute;
  445. left: 0;
  446. top: 30upx;
  447. z-index: 9999;
  448. width: 100%;
  449. padding: 0 80upx;
  450. .ser-input {
  451. flex: 1;
  452. height: 56upx;
  453. line-height: 56upx;
  454. text-align: center;
  455. font-size: 28upx;
  456. color: $font-color-base;
  457. border-radius: 20px;
  458. background: rgba(255, 255, 255, 0.6);
  459. }
  460. }
  461. /* #endif */
  462. page {
  463. .cate-section {
  464. position: relative;
  465. z-index: 5;
  466. border-radius: 16upx 16upx 0 0;
  467. margin-top: 20upx;
  468. }
  469. .carousel-section {
  470. padding: 0;
  471. .titleNview-placing {
  472. padding-top: 0;
  473. height: 0;
  474. }
  475. .carousel {
  476. .carousel-item {
  477. padding: 0;
  478. }
  479. }
  480. .swiper-dots {
  481. left: 45upx;
  482. bottom: 40upx;
  483. }
  484. }
  485. }
  486. .confirm-btn {
  487. padding: 0 10upx;
  488. margin: 0 2px;
  489. border-radius: 10px;
  490. height: 36upx;
  491. line-height: 36upx;
  492. font-size: $font-base;
  493. background: $uni-color-primary;
  494. box-shadow: 1px 2px 5px rgba(217, 60, 93, 0.72)
  495. }
  496. page {
  497. background: #f5f5f5;
  498. }
  499. .m-t {
  500. margin-top: 16upx;
  501. }
  502. /* 头部 轮播图 */
  503. .carousel-section {
  504. position: relative;
  505. padding-top: 10px;
  506. .titleNview-placing {
  507. height: var(--status-bar-height);
  508. padding-top: 44px;
  509. box-sizing: content-box;
  510. }
  511. .titleNview-background {
  512. position: absolute;
  513. top: 0;
  514. left: 0;
  515. width: 100%;
  516. height: 50vw;
  517. max-height: 400px;
  518. transition: 0.4s;
  519. }
  520. }
  521. .carousel {
  522. width: 100%;
  523. height: 50vw;
  524. max-height: 400px;
  525. .carousel-item {
  526. width: 100%;
  527. height: 100%;
  528. padding: 0 28upx;
  529. overflow: hidden;
  530. }
  531. image {
  532. width: 100%;
  533. height: 100%;
  534. border-radius: 10upx;
  535. padding: 20rpx;
  536. }
  537. }
  538. .swiper-dots {
  539. display: flex;
  540. position: absolute;
  541. left: 60upx;
  542. bottom: 15upx;
  543. width: 72upx;
  544. height: 36upx;
  545. 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==);
  546. background-size: 100% 100%;
  547. .num {
  548. width: 36upx;
  549. height: 36upx;
  550. border-radius: 50px;
  551. font-size: 24upx;
  552. color: #fff;
  553. text-align: center;
  554. line-height: 36upx;
  555. }
  556. .sign {
  557. position: absolute;
  558. top: 0;
  559. left: 50%;
  560. line-height: 36upx;
  561. font-size: 12upx;
  562. color: #fff;
  563. transform: translateX(-50%);
  564. }
  565. }
  566. /* 分类 */
  567. .cate-section {
  568. display: flex;
  569. justify-content: space-around;
  570. align-items: center;
  571. flex-wrap: wrap;
  572. padding: 30upx 22upx;
  573. background: #fff;
  574. .cate-item {
  575. display: flex;
  576. flex-direction: column;
  577. align-items: center;
  578. font-size: $font-sm + 2upx;
  579. color: $font-color-dark;
  580. }
  581. /* 原图标颜色太深,不想改图了,所以加了透明度 */
  582. image {
  583. width: 88upx;
  584. height: 88upx;
  585. margin-bottom: 14upx;
  586. border-radius: 50%;
  587. opacity: 0.7;
  588. box-shadow: 4upx 4upx 20upx rgba(250, 67, 106, 0.3);
  589. }
  590. }
  591. .ad-1 {
  592. width: 100%;
  593. height: 210upx;
  594. padding: 10upx 0;
  595. background: #fff;
  596. image {
  597. width: 100%;
  598. height: 100%;
  599. }
  600. }
  601. /* 秒杀专区 */
  602. .seckill-section {
  603. padding: 4upx 30upx 24upx;
  604. background: #fff;
  605. .miaosha {
  606. font-size: 35rpx;
  607. font-weight: 1000;
  608. color: $uni-color-primary;
  609. ;
  610. }
  611. .s-header {
  612. display: flex;
  613. align-items: center;
  614. height: 92upx;
  615. line-height: 1;
  616. .s-img {
  617. width: 140upx;
  618. height: 30upx;
  619. }
  620. .tip {
  621. font-size: $font-base;
  622. color: $font-color-light;
  623. margin: 0 20upx 0 40upx;
  624. }
  625. .timer {
  626. display: inline-block;
  627. width: 40upx;
  628. height: 36upx;
  629. text-align: center;
  630. line-height: 36upx;
  631. margin-right: 14upx;
  632. font-size: $font-sm + 2upx;
  633. color: #fff;
  634. border-radius: 2px;
  635. background: rgba(0, 0, 0, 0.8);
  636. }
  637. .icon-you {
  638. font-size: $font-lg;
  639. color: $font-color-light;
  640. flex: 1;
  641. text-align: right;
  642. }
  643. }
  644. .floor-list-whitelist {
  645. display: flex;
  646. // justify-content: space-between;
  647. flex-direction: row;
  648. flex-wrap: wrap;
  649. }
  650. .floor-list {
  651. white-space: nowrap;
  652. }
  653. .scoll-wrapper {
  654. display: flex;
  655. align-items: flex-start;
  656. }
  657. .floor-item {
  658. width: calc(100%/3);
  659. padding-right: 20upx;
  660. margin-top: 20upx;
  661. font-size: $font-sm + 2upx;
  662. color: $font-color-dark;
  663. line-height: 1.8;
  664. image {
  665. max-height: 600upx;
  666. width: 100%;
  667. height: 40vw;
  668. border-radius: 6upx;
  669. }
  670. .price {
  671. color: $uni-color-primary;
  672. }
  673. }
  674. }
  675. .f-header {
  676. display: flex;
  677. align-items: center;
  678. height: 140upx;
  679. padding: 6upx 30upx 8upx;
  680. background: #fff;
  681. image {
  682. flex-shrink: 0;
  683. width: 80upx;
  684. height: 80upx;
  685. margin-right: 20upx;
  686. }
  687. .tit-box {
  688. flex: 1;
  689. display: flex;
  690. flex-direction: column;
  691. }
  692. .tit {
  693. font-size: $font-lg + 2upx;
  694. color: #font-color-dark;
  695. line-height: 1.3;
  696. }
  697. .tit2 {
  698. font-size: $font-sm;
  699. color: $font-color-light;
  700. }
  701. .icon-you {
  702. font-size: $font-lg + 2upx;
  703. color: $font-color-light;
  704. }
  705. }
  706. /* 团购楼层 */
  707. .group-section {
  708. background: #fff;
  709. .g-swiper {
  710. height: 650upx;
  711. padding-bottom: 30upx;
  712. }
  713. .g-swiper-item {
  714. width: 100%;
  715. padding: 0 30upx;
  716. display: flex;
  717. }
  718. image {
  719. width: 100%;
  720. height: 460upx;
  721. border-radius: 4px;
  722. }
  723. .g-item {
  724. display: flex;
  725. flex-direction: column;
  726. overflow: hidden;
  727. }
  728. .left {
  729. flex: 1.2;
  730. margin-right: 24upx;
  731. .t-box {
  732. padding-top: 20upx;
  733. }
  734. }
  735. .right {
  736. flex: 0.8;
  737. flex-direction: column-reverse;
  738. .t-box {
  739. padding-bottom: 20upx;
  740. }
  741. }
  742. .t-box {
  743. height: 160upx;
  744. font-size: $font-base + 2upx;
  745. color: $font-color-dark;
  746. line-height: 1.6;
  747. }
  748. .price {
  749. color: $uni-color-primary;
  750. }
  751. .m-price {
  752. font-size: $font-sm + 2upx;
  753. text-decoration: line-through;
  754. color: $font-color-light;
  755. margin-left: 8upx;
  756. }
  757. .pro-box {
  758. display: flex;
  759. align-items: center;
  760. margin-top: 10upx;
  761. font-size: $font-sm;
  762. color: $font-base;
  763. padding-right: 10upx;
  764. }
  765. .progress-box {
  766. flex: 1;
  767. border-radius: 10px;
  768. overflow: hidden;
  769. margin-right: 8upx;
  770. }
  771. }
  772. /* 分类推荐楼层 */
  773. .hot-floor {
  774. width: 100%;
  775. overflow: hidden;
  776. margin-bottom: 20upx;
  777. .floor-img-box {
  778. width: 100%;
  779. height: 320upx;
  780. position: relative;
  781. &:after {
  782. content: '';
  783. position: absolute;
  784. left: 0;
  785. top: 0;
  786. width: 100%;
  787. height: 100%;
  788. background: linear-gradient(rgba(255, 255, 255, 0.06) 30%, #f8f8f8);
  789. }
  790. }
  791. .floor-img {
  792. width: 100%;
  793. height: 100%;
  794. }
  795. .floor-list {
  796. white-space: nowrap;
  797. padding: 20upx;
  798. padding-right: 50upx;
  799. border-radius: 6upx;
  800. margin-top: -140upx;
  801. margin-left: 30upx;
  802. background: #fff;
  803. box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
  804. position: relative;
  805. z-index: 1;
  806. }
  807. .scoll-wrapper {
  808. display: flex;
  809. align-items: flex-start;
  810. }
  811. .floor-item {
  812. margin-right: 20upx;
  813. font-size: $font-sm + 2upx;
  814. color: $font-color-dark;
  815. line-height: 1.8;
  816. image {
  817. width: 180upx;
  818. height: 180upx;
  819. border-radius: 6upx;
  820. }
  821. .price {
  822. color: $uni-color-primary;
  823. }
  824. }
  825. .more {
  826. display: flex;
  827. align-items: center;
  828. justify-content: center;
  829. flex-direction: column;
  830. flex-shrink: 0;
  831. width: 180upx;
  832. height: 180upx;
  833. border-radius: 6upx;
  834. background: #f3f3f3;
  835. font-size: $font-base;
  836. color: $font-color-light;
  837. text:first-child {
  838. margin-bottom: 4upx;
  839. }
  840. }
  841. }
  842. /* 猜你喜欢 */
  843. .guess-section {
  844. display: flex;
  845. flex-wrap: wrap;
  846. padding: 0 30upx;
  847. background: #fff;
  848. .guess-item {
  849. display: flex;
  850. flex-direction: column;
  851. width: 48%;
  852. padding-bottom: 40upx;
  853. &:nth-child(2n + 1) {
  854. margin-right: 4%;
  855. }
  856. }
  857. .image-wrapper {
  858. width: 100%;
  859. height: 330upx;
  860. border-radius: 3px;
  861. overflow: hidden;
  862. image {
  863. width: 100%;
  864. height: 100%;
  865. opacity: 1;
  866. }
  867. }
  868. .title {
  869. font-size: 12px;
  870. color: $font-color-dark;
  871. line-height: 80upx;
  872. }
  873. .price {
  874. font-size: $font-lg;
  875. color: $uni-color-primary;
  876. line-height: 1;
  877. .sales {
  878. color: #999999;
  879. font-size: 24upx;
  880. }
  881. .symbol {
  882. font-size: 24upx;
  883. }
  884. }
  885. }
  886. </style>