index.vue 28 KB

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