index.vue 28 KB

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