index.vue 32 KB

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