index.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166
  1. <template>
  2. <view class="container">
  3. <!-- 小程序头部兼容 -->
  4. <!-- #ifdef MP -->
  5. <view class="input-box flex" @click="clickSearch">
  6. <view class=" input-content flex">
  7. <view class="iconfont iconsearch"></view>
  8. <view class="input"><input type="text" disabled placeholder="请输入搜索内容" /></view>
  9. </view>
  10. </view>
  11. <view class="mp-height"></view>
  12. <!-- #endif -->
  13. <!-- 头部轮播 -->
  14. <view class="carousel-section">
  15. <!-- 标题栏和状态栏占位符 -->
  16. <view class="titleNview-placing"></view>
  17. <!-- 背景色区域 -->
  18. <view class="titleNview-background" :style="{ backgroundColor: '#5DBC7C' }"></view>
  19. <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  20. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item" @click="bannerNavToUrl(item)"><image :src="item.pic" /></swiper-item>
  21. </swiper>
  22. <!-- 自定义swiper指示器 -->
  23. <!-- <view class="swiper-dots">
  24. <text class="num">{{ swiperCurrent + 1 }}</text>
  25. <text class="sign">/</text>
  26. <text class="num">{{ swiperLength }}</text>
  27. </view> -->
  28. </view>
  29. <!-- 分类 -->
  30. <view class="cate-section">
  31. <view class="cate-item">
  32. <image src="/static/icon/c3.png"></image>
  33. <text>全部分类</text>
  34. </view>
  35. <navigator url="/pages/product/groupBooking/index">
  36. <view class="cate-item">
  37. <image src="/static/icon/c5.png"></image>
  38. <text>线下门店</text>
  39. </view>
  40. </navigator>
  41. <navigator url="/pages/product/seckill">
  42. <view class="cate-item">
  43. <image src="/static/icon/c7.png"></image>
  44. <text>施工产品</text>
  45. </view>
  46. </navigator>
  47. <navigator url="/pages/index/sign">
  48. <view class="cate-item">
  49. <image src="/static/icon/c8.png"></image>
  50. <text>分享有礼</text>
  51. </view>
  52. </navigator>
  53. </view>
  54. <!-- <view class="ad-1"><image src="/static/temp/ad1.jpg" mode="scaleToFill"></image></view> -->
  55. <!-- 可领取优惠券 -->
  56. <!-- <scroll-view class="coupon-box clamp" :scroll-x="true">
  57. <view v-for="(item, index) in couponArray" :key="item.id" class="coupon-list">
  58. <view class="row flex">
  59. <view class="list-money flex">
  60. <image :src="item.is_use ? '/static/img/img02.png' : '/static/img/img03.png'" mode="scaleToFill"></image>
  61. <view class="list-money-text">
  62. <view class="tit" :class="{ noAction: item.is_use }">
  63. <text>{{ item.coupon_price }}</text>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="list-interval position-relative">
  68. <view class="bottom"></view>
  69. <view class="top"></view>
  70. </view>
  71. <view class="row_list_right">
  72. <view class="right_top"><text class="right_title" :class="{ noAction: item.is_use }">满减券</text></view>
  73. <view class="right_time">
  74. <text>满{{ item.use_min_price }}使用</text>
  75. </view>
  76. </view>
  77. <view class="right_use" :class="{ noAction: item.is_use }" @click="setCoupons(item)">
  78. <text>{{ item.is_use ? '已领取' : '立即领取' }}</text>
  79. </view>
  80. </view>
  81. </view>
  82. </scroll-view> -->
  83. <!-- 秒杀楼层 -->
  84. <seckill></seckill>
  85. <!-- 附近门店 -->
  86. <view class="store-wrapper">
  87. <view class="title-wrapper flex">
  88. <image src="" mode=""></image>
  89. <view class="">附近门店</view>
  90. <view class="title-b">门店好物随心购</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. //砍价商品推荐详情页
  373. navToDetailPages(item) {
  374. let id = item.product_id;
  375. //let type = 2;
  376. uni.navigateTo({
  377. url: '/pages/product/product?id=' + id
  378. });
  379. },
  380. openSubscribe: function(e) {
  381. let page = e;
  382. // #ifndef MP
  383. uni.navigateTo({
  384. url: page
  385. });
  386. // #endif
  387. // #ifdef MP
  388. uni.showLoading({
  389. title: '正在加载'
  390. });
  391. openBargainSubscribe()
  392. .then(res => {
  393. uni.hideLoading();
  394. uni.navigateTo({
  395. url: page
  396. });
  397. })
  398. .catch(err => {
  399. uni.hideLoading();
  400. });
  401. // #endif
  402. },
  403. getBargainList() {
  404. let that = this;
  405. getBargainList({
  406. page: that.page,
  407. limit: that.limit
  408. })
  409. .then(function(res) {
  410. that.$set(that, 'bargainlist', res.data.slice(0, 2));
  411. })
  412. .catch(res => {
  413. console.log(res, 'getBargainList');
  414. });
  415. },
  416. Mask() {
  417. this.MaskShow = false;
  418. this.shareShow = true;
  419. uni.setStorage({
  420. key: 'FirstEntry',
  421. data: true,
  422. success: function() {
  423. console.log(uni.getStorageSync('FirstEntry'), 'Mask');
  424. }
  425. });
  426. },
  427. Toshare() {
  428. if (this.userInfo == '') {
  429. getUserInfo({})
  430. .then(({ data }) => {
  431. this.setUserInfo(data);
  432. this.userInfo = data;
  433. })
  434. .catch(e => {});
  435. } else {
  436. this.shareShow = false;
  437. uni.navigateTo({
  438. url: '/pages/user/shareQrCode?spread=' + this.userInfo.uid
  439. });
  440. }
  441. },
  442. Tocancel() {
  443. this.shareShow = false;
  444. },
  445. // 监听切换事件
  446. listChange(e) {
  447. this.checkid = e.detail.current;
  448. },
  449. // 點擊搜索框
  450. clickSearch() {
  451. uni.navigateTo({
  452. url: '/pages/product/search'
  453. });
  454. },
  455. // 点击触发领取优惠券
  456. setCoupons(item) {
  457. // 判断是否已经领取了优惠券
  458. let obj = this;
  459. uni.showModal({
  460. title: '领取提示',
  461. content: '是否领取优惠券',
  462. success(e) {
  463. if (e.confirm) {
  464. setCoupons({ couponId: item.id }).then(e => {
  465. item.is_use = true;
  466. uni.showToast({
  467. title: '领取成功',
  468. type: 'top',
  469. duration: 2000
  470. });
  471. });
  472. }
  473. }
  474. });
  475. },
  476. //商品种类切换
  477. change(item) {
  478. let id = item;
  479. this.checkid = id;
  480. if (this.checkid == 1) {
  481. // console.log(1);
  482. this.detail = this.selected_detail;
  483. } else if (this.checkid == 2) {
  484. // console.log(2);
  485. this.detail = this.new_product;
  486. } else {
  487. this.detail = this.cheap_good;
  488. }
  489. },
  490. // 监听图片加载完成
  491. onImageError(key, index) {
  492. this[key][index].image = '/static/error/errorImage.jpg';
  493. },
  494. // 请求载入数据
  495. async loadData() {
  496. loadIndexs({})
  497. .then(({ data }) => {
  498. let goods = data.info;
  499. this.carouselList = data.banner;
  500. this.swiperLength = this.carouselList.length;
  501. this.menusList = data.menus;
  502. this.goodsList = goods.firstList; //最新商品
  503. this.bastList = goods.bastList; //精品推荐
  504. this.bastBanner = data.benefit; //促销单品
  505. this.$set(this, 'couponArray', data.couponList); //保存卡包券
  506. uni.stopPullDownRefresh();
  507. })
  508. .catch(e => {
  509. uni.stopPullDownRefresh();
  510. });
  511. },
  512. //轮播图切换修改背景色
  513. swiperChange(e) {
  514. const index = e.detail.current;
  515. this.swiperCurrent = index;
  516. this.titleNViewBackground = this.carouselList[index].background;
  517. },
  518. //详情页
  519. navToDetailPage(item) {
  520. let id = item.id;
  521. uni.navigateTo({
  522. url: '/pages/product/product?id=' + id
  523. });
  524. },
  525. // 轮播图跳转
  526. bannerNavToUrl(item) {
  527. // #ifdef H5
  528. if (item.wap_url.indexOf('http') > 0) {
  529. window.location.href = item.wap_url;
  530. }
  531. // #endif
  532. //测试数据没有写id,用title代替
  533. uni.navigateTo({
  534. url: item.wap_url
  535. });
  536. }
  537. }
  538. };
  539. </script>
  540. <style lang="scss">
  541. .Mask {
  542. width: 100%;
  543. height: 100vh;
  544. position: fixed;
  545. z-index: 99999;
  546. background-color: rgba(0, 0, 0, 0.7);
  547. top: 0;
  548. image {
  549. width: 100%;
  550. height: 100vh;
  551. }
  552. }
  553. // 热销商品
  554. .hot-goods {
  555. margin: 0 25rpx;
  556. padding: 5rpx 25rpx 30rpx 25rpx;
  557. background-color: #fff;
  558. border-radius: 10rpx;
  559. .hot-headers {
  560. margin: 25rpx 0;
  561. width: 100%;
  562. display: flex;
  563. .img {
  564. width: 32rpx;
  565. height: 32rpx;
  566. margin-right: 10rpx;
  567. }
  568. .hot-title {
  569. font-size: 30rpx;
  570. margin-right: 15rpx;
  571. }
  572. .more {
  573. line-height: 1;
  574. padding: 5rpx 10rpx 5rpx 15rpx;
  575. text-align: center;
  576. font-size: 20rpx;
  577. border-radius: 15rpx;
  578. color: #ffffff;
  579. background: linear-gradient(90deg, rgba(250, 52, 38, 1) 0%, rgba(249, 30, 83, 1) 100%);
  580. image {
  581. width: 20rpx;
  582. height: 20rpx;
  583. }
  584. }
  585. }
  586. .hot-lists {
  587. line-height: 1;
  588. display: flex;
  589. .hot-produce {
  590. width: 100%;
  591. height: 260rpx;
  592. border-top: 1px solid #f0f0f0;
  593. display: flex;
  594. padding-top: 28rpx;
  595. .produce-image {
  596. width: 200rpx;
  597. height: 200rpx;
  598. image {
  599. width: 200rpx;
  600. height: 200rpx;
  601. border: 1px solid #f0f0f0;
  602. }
  603. }
  604. .produce-content {
  605. // flex-direction: column;
  606. margin-left: 30rpx;
  607. height: 200rpx;
  608. position: relative;
  609. width: calc(100% - 200rpx - 30rpx);
  610. .produce-name {
  611. font-size: 28rpx;
  612. font-weight: bold;
  613. line-height: 35rpx;
  614. color: #343434;
  615. }
  616. .produce-info {
  617. font-size: 20rpx;
  618. margin-top: 25rpx;
  619. }
  620. .produce-price {
  621. display: flex;
  622. align-items: flex-end;
  623. color: #ff383e;
  624. font-size: 24rpx;
  625. margin-top: 70rpx;
  626. font-weight: bold;
  627. text {
  628. font-size: 36rpx;
  629. }
  630. .produce-price-1 {
  631. font-size: 22rpx;
  632. font-weight: 500;
  633. text-decoration: line-through;
  634. color: rgba(170, 170, 170, 1);
  635. margin-left: 20rpx;
  636. }
  637. }
  638. .produce-price1 {
  639. height: 100%;
  640. letter-spacing: 3rpx;
  641. color: #ff383e;
  642. font-size: 24rpx;
  643. font-weight: bold;
  644. .produce-center {
  645. width: 100%;
  646. position: absolute;
  647. bottom: 0;
  648. display: flex;
  649. justify-content: space-between;
  650. align-items: center;
  651. .kanjia_word {
  652. .word-1 {
  653. font-size: 22rpx;
  654. color: #666666;
  655. }
  656. .word-2 {
  657. font-size: 28rpx;
  658. color: #ff383e;
  659. margin-top: 10rpx;
  660. }
  661. }
  662. .kanjia_button {
  663. height: 50rpx;
  664. width: 150rpx;
  665. border-radius: 25rpx;
  666. font-size: 26rpx;
  667. font-weight: 500;
  668. color: #ff383e;
  669. border: 1px solid rgba(255, 56, 62, 1);
  670. }
  671. }
  672. }
  673. }
  674. }
  675. }
  676. }
  677. /* #ifdef MP */
  678. .mp-height {
  679. height: 44px;
  680. }
  681. .input-box {
  682. position: fixed;
  683. top: 0;
  684. left: 0;
  685. width: 100%;
  686. padding: 25rpx;
  687. background-color: #ffffff;
  688. z-index: 999;
  689. height: 44px;
  690. .iconsearch {
  691. font-size: 50rpx;
  692. }
  693. .input-content {
  694. border-radius: 99rpx;
  695. flex-grow: 1;
  696. padding: 10rpx 30rpx;
  697. background-color: rgba(231, 231, 231, 0.7);
  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. page {
  712. .cate-section {
  713. position: relative;
  714. z-index: 5;
  715. border-radius: 16rpx 16rpx 0 0;
  716. margin-top: -20rpx;
  717. }
  718. .carousel-section {
  719. padding: 0;
  720. .titleNview-placing {
  721. padding-top: 0;
  722. height: 0;
  723. }
  724. .carousel {
  725. .carousel-item {
  726. padding: 0;
  727. }
  728. }
  729. .swiper-dots {
  730. left: 45rpx;
  731. bottom: 40rpx;
  732. }
  733. }
  734. }
  735. /* #endif */
  736. page {
  737. background: #f7f8f7;
  738. }
  739. .m-t {
  740. margin-top: 16rpx;
  741. }
  742. /* 头部 轮播图 */
  743. .carousel-section {
  744. position: relative;
  745. padding-top: 10px;
  746. overflow: hidden;
  747. .titleNview-placing {
  748. height: var(--status-bar-height);
  749. padding-top: 44px;
  750. box-sizing: content-box;
  751. }
  752. .titleNview-background {
  753. position: absolute;
  754. top: 0;
  755. left: 0;
  756. width: 100%;
  757. height: 426rpx;
  758. transition: 0.4s;
  759. }
  760. .carousel {
  761. width: 100%;
  762. height: 240rpx;
  763. .carousel-item {
  764. width: 100%;
  765. height: 100%;
  766. padding: 0 28rpx;
  767. overflow: hidden;
  768. }
  769. image {
  770. width: 100%;
  771. height: 100%;
  772. border-radius: $border-radius-sm;
  773. }
  774. }
  775. }
  776. .swiper-dots {
  777. display: flex;
  778. position: absolute;
  779. left: 60rpx;
  780. bottom: 15rpx;
  781. width: 72rpx;
  782. height: 36rpx;
  783. 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==);
  784. background-size: 100% 100%;
  785. .num {
  786. width: 36rpx;
  787. height: 36rpx;
  788. border-radius: 50px;
  789. font-size: 24rpx;
  790. color: #fff;
  791. text-align: center;
  792. line-height: 36rpx;
  793. }
  794. .sign {
  795. position: absolute;
  796. top: 0;
  797. left: 50%;
  798. line-height: 36rpx;
  799. font-size: 12rpx;
  800. color: #fff;
  801. transform: translateX(-50%);
  802. }
  803. }
  804. /* 分类 */
  805. .cate-section {
  806. display: flex;
  807. justify-content: space-around;
  808. align-items: center;
  809. flex-wrap: wrap;
  810. padding: 30rpx 22rpx;
  811. background-color: #fff;
  812. margin-bottom: 20rpx;
  813. .cate-item {
  814. display: flex;
  815. flex-direction: column;
  816. align-items: center;
  817. font-size: $font-sm + 2rpx;
  818. color: $font-color-dark;
  819. }
  820. /* 原图标颜色太深,不想改图了,所以加了透明度 */
  821. image {
  822. width: 88rpx;
  823. height: 88rpx;
  824. margin-bottom: 14rpx;
  825. border-radius: 50%;
  826. opacity: 0.7;
  827. }
  828. }
  829. // 中间广告图片
  830. .ad-1 {
  831. width: 100%;
  832. height: 210rpx;
  833. padding: 10rpx 0;
  834. background: #fff;
  835. image {
  836. width: 100%;
  837. height: 100%;
  838. }
  839. }
  840. /*公用边框样式*/
  841. %icon {
  842. margin-right: 10rpx;
  843. display: inline-block;
  844. padding: 2rpx 10rpx;
  845. border: 1rpx solid $color-yellow;
  846. color: $color-yellow;
  847. line-height: 1;
  848. font-size: $font-base;
  849. border-radius: 10rpx;
  850. }
  851. .f-header {
  852. display: flex;
  853. align-items: center;
  854. height: 92rpx;
  855. padding: 6rpx 30rpx 8rpx;
  856. image {
  857. flex-shrink: 0;
  858. width: 80rpx;
  859. height: 80rpx;
  860. margin-right: 20rpx;
  861. }
  862. .tit-box {
  863. @extend %font-title-box;
  864. }
  865. .tit {
  866. @extend %font-title;
  867. }
  868. .iconenter {
  869. font-size: $font-lg + 2rpx;
  870. color: $font-color-light;
  871. }
  872. .f-left-icon {
  873. @extend %f-left-icon;
  874. }
  875. .iconfont {
  876. font-size: $font-sm - 2rpx;
  877. }
  878. }
  879. // 会员升级礼包
  880. .uservip {
  881. border-radius: $border-radius-sm;
  882. background-color: white;
  883. box-shadow: $box-shadow;
  884. height: 300rpx;
  885. margin: 0 30rpx;
  886. image {
  887. height: 100%;
  888. width: 300rpx;
  889. }
  890. .detail {
  891. position: relative;
  892. padding: 20rpx;
  893. height: 100%;
  894. .icon {
  895. @extend %icon;
  896. }
  897. .price-box {
  898. position: absolute;
  899. bottom: 20rpx;
  900. width: calc(100% - 40rpx);
  901. .price {
  902. font-size: $font-lg + 2rpx;
  903. font-weight: bold;
  904. color: $font-color-base;
  905. }
  906. .text {
  907. color: $color-gray;
  908. font-size: $font-sm;
  909. }
  910. }
  911. .title {
  912. font-size: $font-lg;
  913. font-weight: bold;
  914. }
  915. }
  916. }
  917. /* 猜你喜欢 */
  918. .guess-section {
  919. display: flex;
  920. flex-wrap: wrap;
  921. padding: 0 30rpx;
  922. .guess-item {
  923. overflow: hidden;
  924. display: flex;
  925. flex-direction: column;
  926. width: 48%;
  927. margin-bottom: 4%;
  928. border-radius: $border-radius-sm;
  929. background-color: white;
  930. box-shadow: $box-shadow;
  931. &:nth-child(2n + 1) {
  932. margin-right: 4%;
  933. }
  934. }
  935. .image-wrapper {
  936. width: 100%;
  937. height: 330rpx;
  938. border-radius: 3px;
  939. overflow: hidden;
  940. image {
  941. width: 100%;
  942. height: 100%;
  943. opacity: 1;
  944. }
  945. }
  946. .title {
  947. font-size: $font-base;
  948. color: $font-color-dark;
  949. font-weight: bold;
  950. line-height: 80rpx;
  951. }
  952. .price {
  953. font-size: $font-lg;
  954. color: $font-color-base;
  955. font-weight: bold;
  956. line-height: 1;
  957. line-height: 80rpx;
  958. }
  959. .icon {
  960. @extend %icon;
  961. }
  962. .detail {
  963. line-height: 1;
  964. }
  965. .tip {
  966. color: white;
  967. background-color: $color-yellow;
  968. line-height: 1.5;
  969. font-size: $font-sm;
  970. padding-left: 20rpx;
  971. }
  972. }
  973. // 推荐
  974. .recommend {
  975. width: 95%;
  976. height: 155rpx;
  977. margin: 0rpx auto;
  978. padding-top: 30rpx;
  979. font-size: 26rpx;
  980. text-align: center;
  981. color: #333333;
  982. align-items: flex-start;
  983. .recommend_list {
  984. width: 33%;
  985. }
  986. .re_title {
  987. font-size: 32rpx;
  988. font-weight: bold;
  989. }
  990. .re_name {
  991. color: #999999;
  992. padding-top: 10rpx;
  993. }
  994. .selected_icon {
  995. width: 25rpx;
  996. height: 10rpx;
  997. margin: 0px auto;
  998. display: none;
  999. image {
  1000. width: 100%;
  1001. height: 100%;
  1002. }
  1003. }
  1004. .active {
  1005. display: block;
  1006. }
  1007. .active_color {
  1008. color: #dc4d46 !important;
  1009. }
  1010. }
  1011. // 列表
  1012. .list-box-h {
  1013. height: 1550rpx;
  1014. }
  1015. // 优惠券
  1016. .coupon-list {
  1017. display: inline-block;
  1018. }
  1019. .row {
  1020. border-radius: 15rpx;
  1021. margin: 25rpx;
  1022. height: 155rpx;
  1023. // width: 552rpx;
  1024. overflow: hidden;
  1025. background-color: #ffffff;
  1026. padding-right: 25rpx;
  1027. .list-interval {
  1028. border: 1px dashed $border-color-light;
  1029. height: 100%;
  1030. .top,
  1031. .bottom {
  1032. border-radius: 100rpx;
  1033. width: 30rpx;
  1034. height: 30rpx;
  1035. position: absolute;
  1036. background-color: $page-color-base;
  1037. right: -15rpx;
  1038. }
  1039. .top {
  1040. top: -18rpx;
  1041. }
  1042. .bottom {
  1043. bottom: -18rpx;
  1044. }
  1045. }
  1046. .list-money {
  1047. height: 100%;
  1048. min-width: 155rpx;
  1049. text-align: center;
  1050. image {
  1051. height: 100%;
  1052. width: 20rpx;
  1053. }
  1054. .list-money-text {
  1055. flex-grow: 1;
  1056. padding: 0 25rpx;
  1057. .tit {
  1058. text-align: center;
  1059. padding: 15rpx 0rpx;
  1060. font-size: 55rpx;
  1061. color: $color-red;
  1062. font-weight: bold;
  1063. &.noAction {
  1064. color: $font-color-light;
  1065. }
  1066. }
  1067. .price {
  1068. padding-bottom: 25rpx;
  1069. color: $font-color-light;
  1070. }
  1071. }
  1072. }
  1073. .row_list_right {
  1074. // flex-grow: 1;
  1075. min-width: 200rpx;
  1076. padding-left: 25rpx;
  1077. line-height: 1;
  1078. .right_time {
  1079. padding: 10rpx 0rpx;
  1080. color: $font-color-light;
  1081. font-size: $font-sm;
  1082. }
  1083. .right_top {
  1084. margin: 15rpx 0;
  1085. .right_name {
  1086. font-size: $font-base;
  1087. color: #bc253a;
  1088. font-weight: bold;
  1089. }
  1090. .right_title {
  1091. font-size: $font-base;
  1092. color: $font-base;
  1093. font-weight: bold;
  1094. &.noAction {
  1095. color: $font-color-light;
  1096. }
  1097. }
  1098. }
  1099. }
  1100. .right_use {
  1101. margin: 15rpx 0;
  1102. padding: 10rpx;
  1103. width: 160rpx;
  1104. text-align: center;
  1105. color: #fff;
  1106. background-color: #bc253a;
  1107. border-radius: 50rpx;
  1108. font-size: $font-sm;
  1109. &.noAction {
  1110. background-color: $font-color-light;
  1111. }
  1112. }
  1113. .iconlocation {
  1114. font-size: 36rpx;
  1115. color: $font-color-light;
  1116. }
  1117. }
  1118. .store-wrapper {
  1119. .title-wrapper {
  1120. justify-content: flex-start;
  1121. align-items: center;
  1122. height: 86rpx;
  1123. line-height: 86rpx;
  1124. image {
  1125. width: 36rpx;
  1126. height: 36rpx;
  1127. background: linear-gradient(43deg, #FFC063, #FFA163);
  1128. border-radius: 50%;
  1129. }
  1130. view {
  1131. padding-left: 10rpx;
  1132. font-size: 32rpx;
  1133. font-family: PingFang SC;
  1134. font-weight: bold;
  1135. color: #242424;
  1136. }
  1137. .title-b {
  1138. font-size: 24rpx;
  1139. font-family: PingFang SC;
  1140. font-weight: 500;
  1141. color: #8B8B8B;
  1142. }
  1143. }
  1144. }
  1145. </style>