index.vue 31 KB

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