index.vue 32 KB

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