index.vue 29 KB

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