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.
 
 
 
 
 
 

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