index.vue 31 KB

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