index.vue 31 KB

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