Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

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