index.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255
  1. <template>
  2. <view class="container">
  3. <!-- 小程序头部兼容 -->
  4. <view class="input-box flex" @click="clickSearch">
  5. <view class=" input-content flex">
  6. <view class="iconfont iconsearch"></view>
  7. <view class="input"><input type="text" disabled placeholder="请输入搜索内容" /></view>
  8. </view>
  9. </view>
  10. <view class="mp-height"></view>
  11. <!-- 头部轮播 -->
  12. <view class="carousel-section">
  13. <!-- 标题栏和状态栏占位符 -->
  14. <view class="titleNview-placing"></view>
  15. <!-- 背景色区域 -->
  16. <view class="titleNview-background" :style="{ backgroundColor: '#fff' }"></view>
  17. <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  18. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item" @click="bannerNavToUrl(item)"><image :src="item.pic" /></swiper-item>
  19. </swiper>
  20. <!-- 自定义swiper指示器 -->
  21. <!-- <view class="swiper-dots">
  22. <text class="num">{{ swiperCurrent + 1 }}</text>
  23. <text class="sign">/</text>
  24. <text class="num">{{ swiperLength }}</text>
  25. </view> -->
  26. </view>
  27. <!-- 分类 -->
  28. <view class="cate-section">
  29. <view class="cate-item" @click="navToTab('/pages/category/category')">
  30. <image src="/static/icon/c3.png"></image>
  31. <text>全部分类</text>
  32. </view>
  33. <navigator url="/pages/store/storeList">
  34. <view class="cate-item">
  35. <image src="/static/icon/c5.png"></image>
  36. <text>线下门店</text>
  37. </view>
  38. </navigator>
  39. <navigator url="/pages/product/construction">
  40. <view class="cate-item">
  41. <image src="/static/icon/c7.png"></image>
  42. <text>施工产品</text>
  43. </view>
  44. </navigator>
  45. <navigator url="/pages/user/shareQrCode">
  46. <view class="cate-item">
  47. <image src="/static/icon/c8.png"></image>
  48. <text>分享有礼</text>
  49. </view>
  50. </navigator>
  51. </view>
  52. <!-- 秒杀楼层 -->
  53. <!-- <seckill></seckill> -->
  54. <!-- 附近门店 -->
  55. <view class="store-wrapper" v-if="storeList.length != 0">
  56. <view class="title-wrapper flex">
  57. <image src="/static/icon/t2.png" mode=""></image>
  58. <view class="">附近门店</view>
  59. <view class="title-b">门店好物随心购</view>
  60. </view>
  61. <view class="store flex" v-for="item in storeList" @click="navTo('/pages/store/storeDetail?id=' + item.id)" :key="item.id">
  62. <image :src="item.image" mode="" class="store-img"></image>
  63. <view class="store-info">
  64. <view class="store-name">{{ item.name }}</view>
  65. <view class="store-detail">{{ item.detailed_address }}</view>
  66. <view class="store-tip">门店</view>
  67. <view class="store-des">
  68. <image src="../../static/icon/dingwei.png" mode=""></image>
  69. 距离 {{ item.space }}
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 好货推荐 -->
  75. <view class="store-wrapper">
  76. <view class="title-wrapper flex">
  77. <image src="/static/icon/t3.png" mode=""></image>
  78. <view class="">好货推荐</view>
  79. <view class="title-b">优选商品低价入手</view>
  80. </view>
  81. <view class="goods-wrapper flex">
  82. <view class="good" v-for="item in bastList" @click="navTo('/pages/product/product?id='+ item.id)" :key="item.id">
  83. <image :src="item.image" mode="" class="good-img"></image>
  84. <view class="good-name clamp">{{ item.store_name }}</view>
  85. <!-- <view class="good-info clamp">纯植物无香精</view> -->
  86. <view class="good-price">
  87. <text class="new-price">{{ item.price }}</text>
  88. <text class="old-price">{{ item.ot_price }}</text>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="Mask" v-show="shareShow">
  94. <image @click="share" src="http://shicai.liuniu946.com/static/img/shareimg4.png"></image>
  95. <view class="Toshare" @click="Toshare"></view>
  96. <view class="Tocancel" @click="Tocancel"></view>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. import { timeComputed, space, openMap } from '@/utils/rocessor.js';
  102. import { loadIndexs, getStoreList } from '@/api/index.js';
  103. import { getUserInfo } from '@/api/user.js';
  104. import { setCoupons } from '@/api/functionalUnit.js';
  105. import { getBargainList, getProducts } from '@/api/product.js';
  106. import { interceptor } from '@/utils/loginUtils';
  107. import { mapState, mapMutations } from 'vuex';
  108. export default {
  109. components: {
  110. // seckill
  111. },
  112. watch: {
  113. //自适应swiper高度
  114. checkid(newValue, oldValue) {
  115. let obj = this;
  116. if (newValue == 0) {
  117. let bHeight = Math.ceil(obj.bastList.length / 2);
  118. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  119. }
  120. if (newValue == 1) {
  121. let bHeight = Math.ceil(obj.goodsList.length / 2);
  122. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  123. }
  124. if (newValue == 2) {
  125. let bHeight = Math.ceil(obj.bastBanner.length / 2);
  126. obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
  127. }
  128. }
  129. },
  130. data() {
  131. return {
  132. storeList: [], //门店列表
  133. shareShow: false, //分享海报
  134. pageProportion: 0, //保存页面基于750宽度的比例
  135. swiperHeight: 0,
  136. checkid: 0,
  137. titleNViewBackground: '',
  138. swiperCurrent: 0,
  139. swiperLength: 0,
  140. bargainlist: [], //砍价商品
  141. carouselList: [], //轮播列表
  142. goodsList: [], //最新商品列表
  143. bastList: [], //精品推荐列表
  144. bastBanner: [], //促销商品列表
  145. menusList: [], //头部菜单
  146. page: 1,
  147. limit: 5,
  148. userServant: [
  149. {
  150. image: ''
  151. }
  152. ], //用户推广服务
  153. couponArray: [], //可领取优惠券
  154. recommend: [
  155. {
  156. id: 0,
  157. re_title: '精选',
  158. re_name: '为你推荐'
  159. },
  160. {
  161. id: 1,
  162. re_title: '最新',
  163. re_name: '最新好货优选'
  164. },
  165. {
  166. id: 2,
  167. re_title: '便宜好货',
  168. re_name: '90天便宜好货'
  169. }
  170. ],
  171. actTime: new Date()
  172. };
  173. },
  174. computed: {
  175. ...mapState(['loginInterceptor']),
  176. ...mapState('user', ['hasLogin', 'userInfo']),
  177. ...mapState('latlon', ['lat', 'lon'])
  178. },
  179. onLoad: function(option) {
  180. // #ifndef MP
  181. if (option.spread) {
  182. // 存储其他邀请人
  183. uni.setStorageSync('spread', option.spread);
  184. }
  185. // #endif
  186. // #ifdef MP
  187. if (option.scene) {
  188. // 存储小程序邀请人
  189. uni.setStorage({
  190. key: 'spread_code',
  191. data: option.scene
  192. });
  193. }
  194. // #endif
  195. this.getaddress();
  196. },
  197. onShow: function() {
  198. // 判断是否强制登录
  199. // if (this.loginInterceptor && !this.hasLogin) {
  200. // // 登录拦截
  201. // interceptor();
  202. // }
  203. this.loadData();
  204. this.getBargainList();
  205. // this.getProducts()
  206. },
  207. //下拉刷新
  208. onPullDownRefresh() {
  209. this.loadData();
  210. },
  211. // #ifndef MP
  212. // 监听导航栏输入框点击事件
  213. onNavigationBarSearchInputClicked(e) {
  214. //跳转到搜索页面
  215. this.clickSearch();
  216. },
  217. //点击导航栏 buttons 时触发
  218. onNavigationBarButtonTap(e) {
  219. const index = e.index;
  220. if (index === 0) {
  221. this.$api.msg('点击了扫描');
  222. } else if (index === 1) {
  223. // #ifdef APP-PLUS
  224. const pages = getCurrentPages();
  225. const page = pages[pages.length - 1];
  226. const currentWebview = page.$getAppWebview();
  227. currentWebview.hideTitleNViewButtonRedDot({
  228. index
  229. });
  230. // #endif
  231. uni.navigateTo({
  232. url: '/pages/user/notice'
  233. });
  234. }
  235. },
  236. // #endif
  237. methods: {
  238. navTo(url) {
  239. uni.navigateTo({
  240. url: url
  241. })
  242. },
  243. ...mapMutations('latlon', ['setLat', 'setLon']),
  244. navToTab(url) {
  245. uni.switchTab({
  246. url: url
  247. });
  248. },
  249. //砍价商品推荐详情页
  250. navToDetailPages(item) {
  251. let id = item.product_id;
  252. //let type = 2;
  253. uni.navigateTo({
  254. url: '/pages/product/product?id=' + id
  255. });
  256. },
  257. openSubscribe: function(e) {
  258. let page = e;
  259. // #ifndef MP
  260. uni.navigateTo({
  261. url: page
  262. });
  263. // #endif
  264. // #ifdef MP
  265. uni.showLoading({
  266. title: '正在加载'
  267. });
  268. openBargainSubscribe()
  269. .then(res => {
  270. uni.hideLoading();
  271. uni.navigateTo({
  272. url: page
  273. });
  274. })
  275. .catch(err => {
  276. uni.hideLoading();
  277. });
  278. // #endif
  279. },
  280. getBargainList() {
  281. let that = this;
  282. getBargainList({
  283. page: that.page,
  284. limit: that.limit
  285. })
  286. .then(function(res) {
  287. that.$set(that, 'bargainlist', res.data.slice(0, 2));
  288. })
  289. .catch(res => {
  290. console.log(res, 'getBargainList');
  291. });
  292. },
  293. Mask() {
  294. this.MaskShow = false;
  295. this.shareShow = true;
  296. uni.setStorage({
  297. key: 'FirstEntry',
  298. data: true,
  299. success: function() {
  300. console.log(uni.getStorageSync('FirstEntry'), 'Mask');
  301. }
  302. });
  303. },
  304. Toshare() {
  305. if (this.userInfo == '') {
  306. getUserInfo({})
  307. .then(({ data }) => {
  308. this.setUserInfo(data);
  309. this.userInfo = data;
  310. })
  311. .catch(e => {});
  312. } else {
  313. this.shareShow = false;
  314. uni.navigateTo({
  315. url: '/pages/user/shareQrCode?spread=' + this.userInfo.uid
  316. });
  317. }
  318. },
  319. Tocancel() {
  320. this.shareShow = false;
  321. },
  322. // 监听切换事件
  323. listChange(e) {
  324. this.checkid = e.detail.current;
  325. },
  326. // 點擊搜索框
  327. clickSearch() {
  328. uni.navigateTo({
  329. url: '/pages/product/search'
  330. });
  331. },
  332. // 点击触发领取优惠券
  333. setCoupons(item) {
  334. // 判断是否已经领取了优惠券
  335. let obj = this;
  336. uni.showModal({
  337. title: '领取提示',
  338. content: '是否领取优惠券',
  339. success(e) {
  340. if (e.confirm) {
  341. setCoupons({ couponId: item.id }).then(e => {
  342. item.is_use = true;
  343. uni.showToast({
  344. title: '领取成功',
  345. type: 'top',
  346. duration: 2000
  347. });
  348. });
  349. }
  350. }
  351. });
  352. },
  353. //商品种类切换
  354. change(item) {
  355. let id = item;
  356. this.checkid = id;
  357. if (this.checkid == 1) {
  358. // console.log(1);
  359. this.detail = this.selected_detail;
  360. } else if (this.checkid == 2) {
  361. // console.log(2);
  362. this.detail = this.new_product;
  363. } else {
  364. this.detail = this.cheap_good;
  365. }
  366. },
  367. // 监听图片加载完成
  368. onImageError(key, index) {
  369. this[key][index].image = '/static/error/errorImage.jpg';
  370. },
  371. // 请求载入数据
  372. async loadData() {
  373. loadIndexs({})
  374. .then(({ data }) => {
  375. let goods = data.info;
  376. this.carouselList = data.banner;
  377. this.swiperLength = this.carouselList.length;
  378. this.menusList = data.menus;
  379. this.goodsList = goods.firstList; //最新商品
  380. this.bastList = goods.bastList; //精品推荐
  381. console.log(this.bastList, 'this.bastList6666666666666666666666');
  382. this.bastBanner = data.benefit; //促销单品
  383. this.$set(this, 'couponArray', data.couponList); //保存卡包券
  384. uni.stopPullDownRefresh();
  385. })
  386. .catch(e => {
  387. uni.stopPullDownRefresh();
  388. });
  389. },
  390. //轮播图切换修改背景色
  391. swiperChange(e) {
  392. const index = e.detail.current;
  393. this.swiperCurrent = index;
  394. this.titleNViewBackground = this.carouselList[index].background;
  395. },
  396. //详情页
  397. navToDetailPage(item) {
  398. let id = item.id;
  399. uni.navigateTo({
  400. url: '/pages/product/product?id=' + id
  401. });
  402. },
  403. // 轮播图跳转
  404. bannerNavToUrl(item) {
  405. console.log(item)
  406. // #ifdef H5
  407. console.log(item.wap_url.indexOf('http'),'66666666666')
  408. if (item.wap_url.indexOf('http') > -1) {
  409. console.log('hello word')
  410. window.location.href = item.wap_url;
  411. }
  412. // #endif
  413. //测试数据没有写id,用title代替
  414. uni.navigateTo({
  415. url: item.wap_url
  416. });
  417. },
  418. //获取定位信息
  419. getaddress() {
  420. console.log('dizhi+++++++++++')
  421. let obj = this;
  422. uni.getLocation({
  423. type:'gcj02',
  424. success: res => {
  425. console.log('66666666666666666666')
  426. let latitude = Math.abs(+res.latitude);
  427. let longitude = Math.abs(+res.longitude);
  428. obj.setLat(latitude);
  429. obj.setLon(longitude);
  430. console.log(obj.lat, obj.lon, '经纬度数据');
  431. obj.getStoreList(latitude, longitude);
  432. },
  433. fail: err => {
  434. console.log(err,'shi+++++++++++++++')
  435. openMap().then(e => {
  436. this.getaddress();
  437. });
  438. }
  439. });
  440. },
  441. //获取门店列表
  442. getStoreList(latitude, longitude) {
  443. let obj = this;
  444. getStoreList({
  445. page: 1,
  446. limit: 3,
  447. latitude: latitude,
  448. longitude: longitude
  449. }).then(({ data }) => {
  450. data.list = data.list.map(item => {
  451. item.space = obj.space(obj.lat, obj.lon, item.latitude*1, item.longitude*1);
  452. console.log(item.space, 'item.space++++++++++');
  453. return item;
  454. });
  455. obj.storeList = data.list;
  456. });
  457. },
  458. space(lat1, lng1, lat2, lng2) {
  459. console.log(lat1, lng1, lat2, lng2, '位置信息');
  460. var radLat1 = (lat1 * Math.PI) / 180.0;
  461. var radLat2 = (lat2 * Math.PI) / 180.0;
  462. var a = radLat1 - radLat2;
  463. var b = (lng1 * Math.PI) / 180.0 - (lng2 * Math.PI) / 180.0;
  464. var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
  465. s = s * 6378.137;
  466. s = Math.round(s * 10000) / 10000;
  467. // return s * 1000;
  468. if (s > 1) {
  469. return s.toFixed(2) + 'km';
  470. } else {
  471. return (s * 1000).toFixed(2) + 'm'; // 单位米
  472. }
  473. }
  474. }
  475. };
  476. </script>
  477. <style lang="scss">
  478. .Mask {
  479. width: 100%;
  480. height: 100vh;
  481. position: fixed;
  482. z-index: 99999;
  483. background-color: rgba(0, 0, 0, 0.7);
  484. top: 0;
  485. image {
  486. width: 100%;
  487. height: 100vh;
  488. }
  489. }
  490. // 热销商品
  491. .hot-goods {
  492. margin: 0 25rpx;
  493. padding: 5rpx 25rpx 30rpx 25rpx;
  494. background-color: #fff;
  495. border-radius: 10rpx;
  496. .hot-headers {
  497. margin: 25rpx 0;
  498. width: 100%;
  499. display: flex;
  500. .img {
  501. width: 32rpx;
  502. height: 32rpx;
  503. margin-right: 10rpx;
  504. }
  505. .hot-title {
  506. font-size: 30rpx;
  507. margin-right: 15rpx;
  508. }
  509. .more {
  510. line-height: 1;
  511. padding: 5rpx 10rpx 5rpx 15rpx;
  512. text-align: center;
  513. font-size: 20rpx;
  514. border-radius: 15rpx;
  515. color: #ffffff;
  516. background: linear-gradient(90deg, rgba(250, 52, 38, 1) 0%, rgba(249, 30, 83, 1) 100%);
  517. image {
  518. width: 20rpx;
  519. height: 20rpx;
  520. }
  521. }
  522. }
  523. .hot-lists {
  524. line-height: 1;
  525. display: flex;
  526. .hot-produce {
  527. width: 100%;
  528. height: 260rpx;
  529. border-top: 1px solid #f0f0f0;
  530. display: flex;
  531. padding-top: 28rpx;
  532. .produce-image {
  533. width: 200rpx;
  534. height: 200rpx;
  535. image {
  536. width: 200rpx;
  537. height: 200rpx;
  538. border: 1px solid #f0f0f0;
  539. }
  540. }
  541. .produce-content {
  542. // flex-direction: column;
  543. margin-left: 30rpx;
  544. height: 200rpx;
  545. position: relative;
  546. width: calc(100% - 200rpx - 30rpx);
  547. .produce-name {
  548. font-size: 28rpx;
  549. font-weight: bold;
  550. line-height: 35rpx;
  551. color: #343434;
  552. }
  553. .produce-info {
  554. font-size: 20rpx;
  555. margin-top: 25rpx;
  556. }
  557. .produce-price {
  558. display: flex;
  559. align-items: flex-end;
  560. color: #ff383e;
  561. font-size: 24rpx;
  562. margin-top: 70rpx;
  563. font-weight: bold;
  564. text {
  565. font-size: 36rpx;
  566. }
  567. .produce-price-1 {
  568. font-size: 22rpx;
  569. font-weight: 500;
  570. text-decoration: line-through;
  571. color: rgba(170, 170, 170, 1);
  572. margin-left: 20rpx;
  573. }
  574. }
  575. .produce-price1 {
  576. height: 100%;
  577. letter-spacing: 3rpx;
  578. color: #ff383e;
  579. font-size: 24rpx;
  580. font-weight: bold;
  581. .produce-center {
  582. width: 100%;
  583. position: absolute;
  584. bottom: 0;
  585. display: flex;
  586. justify-content: space-between;
  587. align-items: center;
  588. .kanjia_word {
  589. .word-1 {
  590. font-size: 22rpx;
  591. color: #666666;
  592. }
  593. .word-2 {
  594. font-size: 28rpx;
  595. color: #ff383e;
  596. margin-top: 10rpx;
  597. }
  598. }
  599. .kanjia_button {
  600. height: 50rpx;
  601. width: 150rpx;
  602. border-radius: 25rpx;
  603. font-size: 26rpx;
  604. font-weight: 500;
  605. color: #ff383e;
  606. border: 1px solid rgba(255, 56, 62, 1);
  607. }
  608. }
  609. }
  610. }
  611. }
  612. }
  613. }
  614. .input-box {
  615. position: absolute;
  616. width: 100%;
  617. padding: 25rpx;
  618. background-color: rgba(0, 0, 0, 0);
  619. z-index: 999;
  620. height: 44px;
  621. .iconsearch {
  622. font-size: 50rpx;
  623. }
  624. .input-content {
  625. border-radius: 99rpx;
  626. flex-grow: 1;
  627. padding: 10rpx 200rpx;
  628. background-color: #fff;
  629. // justify-content: center;
  630. .input {
  631. flex-grow: 1;
  632. input {
  633. font-size: $font-lg;
  634. }
  635. }
  636. }
  637. .input-button {
  638. padding-left: 20rpx;
  639. font-size: $font-lg;
  640. height: 100%;
  641. }
  642. }
  643. /* #ifdef MP */
  644. .mp-height {
  645. height: 44px;
  646. }
  647. .input-box {
  648. position: fixed;
  649. top: 0;
  650. left: 0;
  651. width: 100%;
  652. padding: 25rpx;
  653. background-color: #ffffff;
  654. z-index: 999;
  655. height: 44px;
  656. .iconsearch {
  657. font-size: 50rpx;
  658. }
  659. .input-content {
  660. border-radius: 99rpx;
  661. flex-grow: 1;
  662. padding: 10rpx 30rpx;
  663. background-color: rgba(231, 231, 231, 0.7);
  664. .input {
  665. flex-grow: 1;
  666. input {
  667. font-size: $font-lg;
  668. }
  669. }
  670. }
  671. .input-button {
  672. padding-left: 20rpx;
  673. font-size: $font-lg;
  674. height: 100%;
  675. }
  676. }
  677. page {
  678. .cate-section {
  679. position: relative;
  680. z-index: 5;
  681. border-radius: 16rpx 16rpx 0 0;
  682. margin-top: -20rpx;
  683. }
  684. .carousel-section {
  685. padding: 0;
  686. .titleNview-placing {
  687. padding-top: 0;
  688. height: 0;
  689. }
  690. .carousel {
  691. .carousel-item {
  692. padding: 0;
  693. }
  694. }
  695. .swiper-dots {
  696. left: 45rpx;
  697. bottom: 40rpx;
  698. }
  699. }
  700. }
  701. /* #endif */
  702. page {
  703. background: #f7f8f7;
  704. }
  705. .m-t {
  706. margin-top: 16rpx;
  707. }
  708. /* 头部 轮播图 */
  709. .carousel-section {
  710. position: relative;
  711. // padding-top: 10px;
  712. overflow: hidden;
  713. .titleNview-placing {
  714. height: var(--status-bar-height);
  715. // padding-top: 44px;
  716. box-sizing: content-box;
  717. }
  718. .titleNview-background {
  719. position: absolute;
  720. top: 0;
  721. left: 0;
  722. width: 100%;
  723. height: 426rpx;
  724. transition: 0.4s;
  725. }
  726. .carousel {
  727. width: 100%;
  728. height: 426rpx;
  729. .carousel-item {
  730. width: 100%;
  731. height: 100%;
  732. // padding: 0 28rpx;
  733. overflow: hidden;
  734. }
  735. image {
  736. width: 100%;
  737. height: 100%;
  738. // border-radius: $border-radius-sm;
  739. }
  740. }
  741. }
  742. .swiper-dots {
  743. display: flex;
  744. position: absolute;
  745. left: 60rpx;
  746. bottom: 15rpx;
  747. width: 72rpx;
  748. height: 36rpx;
  749. 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==);
  750. background-size: 100% 100%;
  751. .num {
  752. width: 36rpx;
  753. height: 36rpx;
  754. border-radius: 50px;
  755. font-size: 24rpx;
  756. color: #fff;
  757. text-align: center;
  758. line-height: 36rpx;
  759. }
  760. .sign {
  761. position: absolute;
  762. top: 0;
  763. left: 50%;
  764. line-height: 36rpx;
  765. font-size: 12rpx;
  766. color: #fff;
  767. transform: translateX(-50%);
  768. }
  769. }
  770. /* 分类 */
  771. .cate-section {
  772. display: flex;
  773. justify-content: space-around;
  774. align-items: center;
  775. flex-wrap: wrap;
  776. padding: 30rpx 22rpx;
  777. background-color: #fff;
  778. margin-bottom: 20rpx;
  779. .cate-item {
  780. display: flex;
  781. flex-direction: column;
  782. align-items: center;
  783. font-size: $font-sm + 2rpx;
  784. color: $font-color-dark;
  785. }
  786. /* 原图标颜色太深,不想改图了,所以加了透明度 */
  787. image {
  788. width: 88rpx;
  789. height: 88rpx;
  790. margin-bottom: 14rpx;
  791. border-radius: 50%;
  792. opacity: 0.7;
  793. }
  794. }
  795. // 中间广告图片
  796. .ad-1 {
  797. width: 100%;
  798. height: 210rpx;
  799. padding: 10rpx 0;
  800. background: #fff;
  801. image {
  802. width: 100%;
  803. height: 100%;
  804. }
  805. }
  806. /*公用边框样式*/
  807. %icon {
  808. margin-right: 10rpx;
  809. display: inline-block;
  810. padding: 2rpx 10rpx;
  811. border: 1rpx solid $color-yellow;
  812. color: $color-yellow;
  813. line-height: 1;
  814. font-size: $font-base;
  815. border-radius: 10rpx;
  816. }
  817. .f-header {
  818. display: flex;
  819. align-items: center;
  820. height: 92rpx;
  821. padding: 6rpx 30rpx 8rpx;
  822. image {
  823. flex-shrink: 0;
  824. width: 80rpx;
  825. height: 80rpx;
  826. margin-right: 20rpx;
  827. }
  828. .tit-box {
  829. @extend %font-title-box;
  830. }
  831. .tit {
  832. @extend %font-title;
  833. }
  834. .iconenter {
  835. font-size: $font-lg + 2rpx;
  836. color: $font-color-light;
  837. }
  838. .f-left-icon {
  839. @extend %f-left-icon;
  840. }
  841. .iconfont {
  842. font-size: $font-sm - 2rpx;
  843. }
  844. }
  845. // 会员升级礼包
  846. .uservip {
  847. border-radius: $border-radius-sm;
  848. background-color: white;
  849. box-shadow: $box-shadow;
  850. height: 300rpx;
  851. margin: 0 30rpx;
  852. image {
  853. height: 100%;
  854. width: 300rpx;
  855. }
  856. .detail {
  857. position: relative;
  858. padding: 20rpx;
  859. height: 100%;
  860. .icon {
  861. @extend %icon;
  862. }
  863. .price-box {
  864. position: absolute;
  865. bottom: 20rpx;
  866. width: calc(100% - 40rpx);
  867. .price {
  868. font-size: $font-lg + 2rpx;
  869. font-weight: bold;
  870. color: $font-color-base;
  871. }
  872. .text {
  873. color: $color-gray;
  874. font-size: $font-sm;
  875. }
  876. }
  877. .title {
  878. font-size: $font-lg;
  879. font-weight: bold;
  880. }
  881. }
  882. }
  883. /* 猜你喜欢 */
  884. .guess-section {
  885. display: flex;
  886. flex-wrap: wrap;
  887. padding: 0 30rpx;
  888. .guess-item {
  889. overflow: hidden;
  890. display: flex;
  891. flex-direction: column;
  892. width: 48%;
  893. margin-bottom: 4%;
  894. border-radius: $border-radius-sm;
  895. background-color: white;
  896. box-shadow: $box-shadow;
  897. &:nth-child(2n + 1) {
  898. margin-right: 4%;
  899. }
  900. }
  901. .image-wrapper {
  902. width: 100%;
  903. height: 330rpx;
  904. border-radius: 3px;
  905. overflow: hidden;
  906. image {
  907. width: 100%;
  908. height: 100%;
  909. opacity: 1;
  910. }
  911. }
  912. .title {
  913. font-size: $font-base;
  914. color: $font-color-dark;
  915. font-weight: bold;
  916. line-height: 80rpx;
  917. }
  918. .price {
  919. font-size: $font-lg;
  920. color: $font-color-base;
  921. font-weight: bold;
  922. line-height: 1;
  923. line-height: 80rpx;
  924. }
  925. .icon {
  926. @extend %icon;
  927. }
  928. .detail {
  929. line-height: 1;
  930. }
  931. .tip {
  932. color: white;
  933. background-color: $color-yellow;
  934. line-height: 1.5;
  935. font-size: $font-sm;
  936. padding-left: 20rpx;
  937. }
  938. }
  939. // 推荐
  940. .recommend {
  941. width: 95%;
  942. height: 155rpx;
  943. margin: 0rpx auto;
  944. padding-top: 30rpx;
  945. font-size: 26rpx;
  946. text-align: center;
  947. color: #333333;
  948. align-items: flex-start;
  949. .recommend_list {
  950. width: 33%;
  951. }
  952. .re_title {
  953. font-size: 32rpx;
  954. font-weight: bold;
  955. }
  956. .re_name {
  957. color: #999999;
  958. padding-top: 10rpx;
  959. }
  960. .selected_icon {
  961. width: 25rpx;
  962. height: 10rpx;
  963. margin: 0px auto;
  964. display: none;
  965. image {
  966. width: 100%;
  967. height: 100%;
  968. }
  969. }
  970. .active {
  971. display: block;
  972. }
  973. .active_color {
  974. color: #dc4d46 !important;
  975. }
  976. }
  977. // 列表
  978. .list-box-h {
  979. height: 1550rpx;
  980. }
  981. // 优惠券
  982. .coupon-list {
  983. display: inline-block;
  984. }
  985. .row {
  986. border-radius: 15rpx;
  987. margin: 25rpx;
  988. height: 155rpx;
  989. // width: 552rpx;
  990. overflow: hidden;
  991. background-color: #ffffff;
  992. padding-right: 25rpx;
  993. .list-interval {
  994. border: 1px dashed $border-color-light;
  995. height: 100%;
  996. .top,
  997. .bottom {
  998. border-radius: 100rpx;
  999. width: 30rpx;
  1000. height: 30rpx;
  1001. position: absolute;
  1002. background-color: $page-color-base;
  1003. right: -15rpx;
  1004. }
  1005. .top {
  1006. top: -18rpx;
  1007. }
  1008. .bottom {
  1009. bottom: -18rpx;
  1010. }
  1011. }
  1012. .list-money {
  1013. height: 100%;
  1014. min-width: 155rpx;
  1015. text-align: center;
  1016. image {
  1017. height: 100%;
  1018. width: 20rpx;
  1019. }
  1020. .list-money-text {
  1021. flex-grow: 1;
  1022. padding: 0 25rpx;
  1023. .tit {
  1024. text-align: center;
  1025. padding: 15rpx 0rpx;
  1026. font-size: 55rpx;
  1027. color: $color-red;
  1028. font-weight: bold;
  1029. &.noAction {
  1030. color: $font-color-light;
  1031. }
  1032. }
  1033. .price {
  1034. padding-bottom: 25rpx;
  1035. color: $font-color-light;
  1036. }
  1037. }
  1038. }
  1039. .row_list_right {
  1040. // flex-grow: 1;
  1041. min-width: 200rpx;
  1042. padding-left: 25rpx;
  1043. line-height: 1;
  1044. .right_time {
  1045. padding: 10rpx 0rpx;
  1046. color: $font-color-light;
  1047. font-size: $font-sm;
  1048. }
  1049. .right_top {
  1050. margin: 15rpx 0;
  1051. .right_name {
  1052. font-size: $font-base;
  1053. color: #bc253a;
  1054. font-weight: bold;
  1055. }
  1056. .right_title {
  1057. font-size: $font-base;
  1058. color: $font-base;
  1059. font-weight: bold;
  1060. &.noAction {
  1061. color: $font-color-light;
  1062. }
  1063. }
  1064. }
  1065. }
  1066. .right_use {
  1067. margin: 15rpx 0;
  1068. padding: 10rpx;
  1069. width: 160rpx;
  1070. text-align: center;
  1071. color: #fff;
  1072. background-color: #bc253a;
  1073. border-radius: 50rpx;
  1074. font-size: $font-sm;
  1075. &.noAction {
  1076. background-color: $font-color-light;
  1077. }
  1078. }
  1079. .iconlocation {
  1080. font-size: 36rpx;
  1081. color: $font-color-light;
  1082. }
  1083. }
  1084. .store-wrapper {
  1085. margin: 20rpx 0;
  1086. background-color: #fff;
  1087. padding: 0 0rpx 25rpx;
  1088. .title-wrapper {
  1089. padding-left: 20rpx;
  1090. justify-content: flex-start;
  1091. align-items: center;
  1092. height: 86rpx;
  1093. line-height: 86rpx;
  1094. image {
  1095. width: 36rpx;
  1096. height: 36rpx;
  1097. background: linear-gradient(43deg, #ffc063, #ffa163);
  1098. border-radius: 50%;
  1099. }
  1100. view {
  1101. padding-left: 10rpx;
  1102. font-size: 32rpx;
  1103. font-family: PingFang SC;
  1104. font-weight: bold;
  1105. color: #242424;
  1106. }
  1107. .title-b {
  1108. font-size: 24rpx;
  1109. font-family: PingFang SC;
  1110. font-weight: 500;
  1111. color: #8b8b8b;
  1112. }
  1113. }
  1114. .goods-wrapper {
  1115. padding: 0 20rpx;
  1116. justify-content: space-between;
  1117. flex-wrap: wrap;
  1118. .good {
  1119. margin-bottom: 20rpx;
  1120. width: 345rpx;
  1121. height: 480rpx;
  1122. background: #ffffff;
  1123. box-shadow: 0px 0px 10rpx rgba(50, 50, 52, 0.2);
  1124. border-radius: 10rpx;
  1125. .good-img {
  1126. width: 345rpx;
  1127. height: 345rpx;
  1128. border-radius: 10rpx;
  1129. }
  1130. .good-name {
  1131. font-size: 30rpx;
  1132. font-family: PingFang SC;
  1133. font-weight: bold;
  1134. color: #333333;
  1135. line-height: 35rpx;
  1136. padding-left: 21rpx;
  1137. }
  1138. .good-info {
  1139. padding-top: 10rpx;
  1140. padding-left: 21rpx;
  1141. font-size: 26rpx;
  1142. font-family: PingFang SC;
  1143. font-weight: 500;
  1144. color: #666666;
  1145. line-height: 35rpx;
  1146. }
  1147. .good-price {
  1148. padding-left: 21rpx;
  1149. padding-top: 30rpx;
  1150. font-size: 36rpx;
  1151. font-family: PingFang SC;
  1152. font-weight: bold;
  1153. color: #ff4c4c;
  1154. line-height: 35rpx;
  1155. height: 35rpx;
  1156. .old-price {
  1157. display: inline-block;
  1158. padding-left: 8rpx;
  1159. font-size: 26rpx;
  1160. font-family: PingFang SC;
  1161. font-weight: bold;
  1162. text-decoration: line-through;
  1163. color: #999999;
  1164. }
  1165. }
  1166. }
  1167. }
  1168. .store {
  1169. margin: 0 auto 20rpx;
  1170. width: 710rpx;
  1171. height: 210rpx;
  1172. background: #ffffff;
  1173. box-shadow: 0px 0px 10rpx 0px rgba(0, 0, 0, 0.1);
  1174. border-radius: 10rpx;
  1175. padding: 19rpx 25rpx 11rpx 20rpx;
  1176. justify-content: flex-start;
  1177. .store-img {
  1178. flex-shrink: 0;
  1179. width: 180rpx;
  1180. height: 180rpx;
  1181. border-radius: 10rpx;
  1182. // background-color: red;
  1183. }
  1184. .store-info {
  1185. width: 100%;
  1186. height: 100%;
  1187. padding-left: 19rpx;
  1188. position: relative;
  1189. .store-name {
  1190. font-size: 30rpx;
  1191. font-family: PingFang SC;
  1192. font-weight: bold;
  1193. color: #333333;
  1194. }
  1195. .store-detail {
  1196. padding-top: 10rpx;
  1197. font-size: 22rpx;
  1198. font-family: PingFang SC;
  1199. font-weight: 500;
  1200. color: #666666;
  1201. }
  1202. .store-tip {
  1203. width: 66rpx;
  1204. height: 40rpx;
  1205. background: linear-gradient(120deg, #ffc063, #ffa163);
  1206. border-radius: 8rpx;
  1207. position: absolute;
  1208. right: 0;
  1209. top: 0;
  1210. font-size: 24rpx;
  1211. font-family: PingFang SC;
  1212. font-weight: 500;
  1213. color: #ffffff;
  1214. line-height: 40rpx;
  1215. text-align: center;
  1216. }
  1217. .store-des {
  1218. // width: 400rpx;
  1219. position: absolute;
  1220. bottom: 0;
  1221. font-size: 24rpx;
  1222. font-family: PingFang SC;
  1223. font-weight: 500;
  1224. color: #999999;
  1225. height: 35rpx;
  1226. image {
  1227. margin-right: 8rpx;
  1228. width: 17rpx;
  1229. height: 24rpx;
  1230. }
  1231. }
  1232. }
  1233. }
  1234. }
  1235. </style>