index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983
  1. <template>
  2. <view class="container">
  3. <view class="vheigh" :style="{ backgroundColor: titleNViewBackground }"></view>
  4. <view class="top-box" :style="{ backgroundColor: titleNViewBackground }">
  5. <view class="top" @click="clickSearch()">
  6. <view class="top-icon">
  7. <image src="../../static/icon/icon.png" mode=""></image>
  8. </view>
  9. <view class="top-main">输入你要查找的内容</view>
  10. </view>
  11. </view>
  12. <swiper class="banner" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  13. <swiper-item class="banner-item" v-for="(item, index) in carouselList" @click="bannergo(item)">
  14. <image :src="item.pic" />
  15. </swiper-item>
  16. </swiper>
  17. <view class="swiper-dot">
  18. <template v-for="item in swiperLength">
  19. <view class="swiper-dots-item" :key="item" :class="{ action: swiperCurrent === item }"></view>
  20. </template>
  21. </view>
  22. <view class="gg" v-if="text.length != 0">
  23. <view class="gg-icon">
  24. <image src="../../static/img/gonggao.png" mode=""></image>
  25. </view>
  26. <view class="tongz-left flex">
  27. <view class="tongz-font">平台公告</view>
  28. <u-notice-bar style="width: 84%;" mode="vertical" type="none" :volume-icon="false" :more-icon="true"
  29. color="#ffffff" :list="text" @click="goDetails"
  30. @getMore="navTo('/pages/info/articleList?id=4')"></u-notice-bar>
  31. </view>
  32. </view>
  33. <view class="navbar-box">
  34. <view class="navbar-title">
  35. <image src="../../static/icon/index1.png" mode=""></image>
  36. </view>
  37. <view class="navbar-main">
  38. <view class="navbar-item" @click="navTo('/pages/category/category')">
  39. <view class="navbar-icon">
  40. <image src="../../static/icon/index2.png" mode="widthFix"></image>
  41. </view>
  42. <view class="navbar-font-box">
  43. <view class="navbar-font">全部商品</view>
  44. <image class="navbar-font-icon" src="../../static/icon/jt.png" mode=""></image>
  45. </view>
  46. <view class="navbar-tip">生活好物 口碑爆款</view>
  47. </view>
  48. <view class="xian"></view>
  49. <button class="navbar-item" @click="navTo('/pages/index/coupon')">
  50. <view class="navbar-icon">
  51. <image src="../../static/icon/index3.png" mode="widthFix"></image>
  52. </view>
  53. <view class="navbar-font-box">
  54. <view class="navbar-font">领取优惠券</view>
  55. <image class="navbar-font-icon" src="../../static/icon/jt.png" mode=""></image>
  56. </view>
  57. <view class="navbar-tip">高奢品味 高端体验</view>
  58. </button>
  59. <view class="xian"></view>
  60. <view class="navbar-item" @click="navTo('/pages/user/shareQrCode')">
  61. <view class="navbar-icon">
  62. <image src="../../static/icon/index4.png" mode="widthFix"></image>
  63. </view>
  64. <view class="navbar-font-box">
  65. <view class="navbar-font">邀请好友</view>
  66. <image class="navbar-font-icon" src="../../static/icon/jt.png" mode=""></image>
  67. </view>
  68. <view class="navbar-tip">邀请好友 奖励多多</view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="hot-box">
  73. <view class="hot-title">
  74. <image class="hot-title-icon" src="../../static/icon/l.png" mode=""></image>
  75. <view class="hot-title-font">今日上新</view>
  76. <image class="hot-title-icon" src="../../static/icon/r.png" mode=""></image>
  77. </view>
  78. <view class="hot-tip">好货限时抢购</view>
  79. <view class="hot-main">
  80. <view class="hot-main-box" v-for="(item, index) in hotList">
  81. <view class="hot-main-item" v-for="(itn, ind) in item.datalist" @click="navProduct(item, ind)">
  82. <view class="time">
  83. <view class="sq">立省{{ itn.ot_price * 1 - itn.price * 1 }}</view>
  84. <view class="time-main">
  85. <text>{{ item.status == 1 ? '距离结束' : item.status == 0 ? '已结束' : '距离开始' }}</text>
  86. <view v-if="item.continued == '24'">
  87. <uni-countdown color="#ffffff" background-color="rgba(0, 0, 0, 0.3)"
  88. borderColor="rgba(0, 0, 0, 0.3)" splitorColor="#ffffff"
  89. v-if="item.status == 1 || item.status == 2" :show-day="true"
  90. :day="itn.stopTimeD" :hour="itn.stopTimeH" :minute="itn.stopTimeM"
  91. :second="itn.stopTimeS"></uni-countdown>
  92. </view>
  93. <view v-if="item.continued != '24'">
  94. <uni-countdown color="#ffffff" background-color="rgba(0, 0, 0, 0.3)"
  95. borderColor="rgba(0, 0, 0, 0.3)" splitorColor="#ffffff"
  96. v-if="item.status == 1 || item.status == 2" :show-day="false"
  97. :hour="item.stopTimeH" :minute="item.stopTimeM"
  98. :second="item.stopTimeS"></uni-countdown>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="hot-main-image">
  103. <image :src="itn.image" mode=""></image>
  104. </view>
  105. <view class="hot-name clamp">{{ itn.store_name }}</view>
  106. <view class="hot-tipBox flex">
  107. <view class="hot-tip clamp" style="text-align: left;">{{ itn.info }}</view>
  108. <view class="sale">已售{{ itn.sales }}件</view>
  109. </view>
  110. <view class="hot-price-box flex">
  111. <view class="hot-price">
  112. ¥{{ itn.price * 1 }}
  113. <text class="yuan-price">¥{{ itn.ot_price }}</text>
  114. </view>
  115. <view class="btn" v-if="item.status == 1">立即抢购</view>
  116. <view class="btn1" @click.stop="dingy(item, ind)" v-if="item.status == 2">
  117. {{ itn.subscribe != null ? '已订阅' : '抢购提醒' }}
  118. </view>
  119. <view class="btn1" v-if="item.status == 0">已结束</view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. <view class="guess-section-box">
  126. <view class="hot-title">
  127. <image class="hot-title-icon" src="../../static/icon/l.png" mode=""></image>
  128. <view class="hot-title-font">爆款推荐</view>
  129. <image class="hot-title-icon" src="../../static/icon/r.png" mode=""></image>
  130. </view>
  131. <view class="hot-tip">悦享格调生活</view>
  132. <view class="guess-section">
  133. <view v-for="(item, index) in bastList" :key="index" class="guess-item" @click="navToDetailPage(item)">
  134. <view class="image-wrapper">
  135. <image :src="item.image" mode="aspectFill"></image>
  136. </view>
  137. <text class="title clamp margin-c-20">{{ item.store_name }}</text>
  138. <view class="price margin-c-20 flex">
  139. <view>
  140. ¥{{ item.price * 1 }}
  141. <text class="yuan-price">¥{{ item.ot_price * 1 }}</text>
  142. </view>
  143. <view class="font-size-sm">已售:{{ item.sales }}</view>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. </view>
  149. </template>
  150. <script>
  151. import {
  152. loadIndexs
  153. } from '@/api/index.js';
  154. import {
  155. getUserInfo,
  156. articleList,
  157. subscribe
  158. } from '@/api/user.js';
  159. import {
  160. setCoupons
  161. } from '@/api/functionalUnit.js';
  162. import {
  163. getSeckillList,
  164. getSeckillClass
  165. } from '@/api/product.js';
  166. import {
  167. interceptor,
  168. saveUrl
  169. } from '@/utils/loginUtils';
  170. import {
  171. timeComputed
  172. } from '@/utils/rocessor.js';
  173. import {
  174. mapState
  175. } from 'vuex';
  176. export default {
  177. data() {
  178. return {
  179. carouselList: [''],
  180. hotList: [],
  181. bastList: [],
  182. swiperCurrent: 0,
  183. swiperLength: '',
  184. titleNViewBackground: '#e4e2dc',
  185. text: [], //通告消息
  186. article: [] //通告列表
  187. };
  188. },
  189. // #ifdef MP
  190. onShareAppMessage: function(res) {
  191. console.log(res);
  192. console.log('是否从按钮进入');
  193. if (res.from === 'button' || res.from === 'menu') {
  194. // 来自页面内分享按钮
  195. let pages = getCurrentPages();
  196. // 获取当前页面
  197. let page = pages[pages.length - 1];
  198. let path = '/' + page.route + '?';
  199. // 保存传值
  200. for (let i in page.options) {
  201. path += i + '=' + page.options[i] + '&';
  202. }
  203. // 保存邀请人
  204. path += 'scene=' + this.userInfo.uid;
  205. let data = {
  206. path: path,
  207. imageUrl: this.bastList[0].pic,
  208. title: this.userInfo.nickname ? this.userInfo.nickname : '' + '邀请您进入亲家母优选'
  209. };
  210. return data;
  211. } else {
  212. console.log('else');
  213. }
  214. },
  215. // #endif
  216. computed: {
  217. ...mapState('user', ['hasLogin', 'userInfo'])
  218. },
  219. onLoad: function(option) {
  220. // #ifndef MP
  221. if (option.spread) {
  222. // 存储其他邀请人
  223. uni.setStorageSync('spread', option.spread);
  224. }
  225. // #endif
  226. // #ifdef MP
  227. if (option.scene) {
  228. // 存储小程序邀请人
  229. uni.setStorage({
  230. key: 'spread_code',
  231. data: option.scene
  232. });
  233. }
  234. // #endif
  235. },
  236. onShow: function() {
  237. // 判断是否强制登录
  238. if (this.loginInterceptor && !this.hasLogin) {
  239. // 登录拦截
  240. interceptor();
  241. }
  242. this.loadData();
  243. },
  244. //下拉刷新
  245. onPullDownRefresh() {
  246. this.loadData();
  247. },
  248. methods: {
  249. navTo(url) {
  250. uni.navigateTo({
  251. url,
  252. fail() {
  253. uni.switchTab({
  254. url
  255. });
  256. }
  257. });
  258. },
  259. dingy(item, ind) {
  260. if (!this.hasLogin) {
  261. // 保存地址
  262. saveUrl();
  263. // 登录拦截
  264. interceptor();
  265. } else {
  266. if (item.datalist[ind].subscribe != null) {
  267. return;
  268. }
  269. const obj = this;
  270. wx.getSetting({
  271. withSubscriptions: true,
  272. success(res) {
  273. if (res['oo9kG5bU_FwzA9I2rqVp2dkV1k8pBUpBWy2WmwdA-_M'] == 'accept') {
  274. console.log('订阅成功');
  275. }
  276. }
  277. });
  278. if (wx.requestSubscribeMessage) {
  279. wx.requestSubscribeMessage({
  280. tmplIds: ['oo9kG5bU_FwzA9I2rqVp2dkV1k8pBUpBWy2WmwdA-_M'],
  281. success(res) {
  282. let date = new Date();
  283. let year = date.getFullYear();
  284. let month = date.getMonth() + 1;
  285. let day = date.getDate();
  286. if (month < 10) {
  287. month = '0' + month;
  288. }
  289. if (day < 10) {
  290. day = '0' + day;
  291. }
  292. let nowDate = year + '-' + month + '-' + day + ' ' + item.time + ':00';
  293. subscribe({
  294. time: nowDate
  295. }, item.datalist[ind].id).then(e => {
  296. obj.$api.msg('订阅消息成功');
  297. });
  298. },
  299. fail(err) {
  300. obj.$api.msg('订阅消息失败');
  301. console.log(err);
  302. },
  303. complete() {}
  304. });
  305. }
  306. }
  307. },
  308. bannergo(item) {
  309. console.log(item);
  310. uni.navigateTo({
  311. url: item.url
  312. });
  313. },
  314. seckill() {
  315. let obj = this;
  316. getSeckillClass({})
  317. .then(({
  318. data
  319. }) => {
  320. let arr1 = data.seckillTime.filter(e => {
  321. return e.status != 0;
  322. });
  323. let arr2 = data.seckillTime.filter(e => {
  324. return e.status == 0;
  325. });
  326. let arr = arr1.concat(arr2);
  327. obj.hotList = arr.map((e, ind) => {
  328. getSeckillList({
  329. page: 1,
  330. limit: 100
  331. },
  332. e.id
  333. ).then(sp => {
  334. this.$set(e, 'datalist', sp.data);
  335. let ar = e;
  336. // 判断是否为进行中的活动
  337. if (ar.status === 1) {
  338. // 计算倒计时时间
  339. console.log(ar, '时间');
  340. if (ar.continued != '24') {
  341. obj.timeComputed(ar.stop * 1000, ar);
  342. } else {
  343. console.log(ar.datalist, '123456');
  344. if (ar.datalist.length != 0) {
  345. ar.datalist.forEach(sp => {
  346. obj.timeComputed(sp.stop_time * 1000, sp);
  347. })
  348. }
  349. }
  350. } else {
  351. // 获取距离开始还需要多少时间
  352. let arTime = ar.time.split(':');
  353. let h = arTime[0];
  354. let m = arTime[1];
  355. let time = new Date();
  356. // 设置时间
  357. time.setHours(h, m, 0);
  358. console.log(time.getTime(), 'time');
  359. // 计算倒计时时间
  360. obj.timeComputed(time.getTime(), ar);
  361. }
  362. });
  363. return e;
  364. });
  365. console.log(obj.hotList, '数据');
  366. })
  367. .catch(e => {
  368. console.log(e);
  369. });
  370. },
  371. // 计算倒计时时间
  372. timeComputed(da, ar) {
  373. let obj = this;
  374. // 计算时间,保存需要多少时间到期
  375. let stopTime = timeComputed(da);
  376. console.log(stopTime);
  377. ar.stopTimeH = stopTime.hours;
  378. ar.stopTimeM = stopTime.minutes;
  379. ar.stopTimeS = stopTime.seconds;
  380. ar.stopTimeD = stopTime.day;
  381. },
  382. comfirm(text) {
  383. console.log(text);
  384. const result = uniCopy(text);
  385. if (result === false) {
  386. uni.showToast({
  387. title: '不支持'
  388. });
  389. } else {
  390. uni.showToast({
  391. title: '复制成功',
  392. icon: 'none'
  393. });
  394. }
  395. this.$refs.popupkf.close();
  396. },
  397. goDetails(e) {
  398. uni.navigateTo({
  399. url: '/pages/info/detail?id=' + this.article[e].id
  400. });
  401. },
  402. // 點擊搜索框
  403. clickSearch() {
  404. uni.navigateTo({
  405. url: '/pages/product/search'
  406. });
  407. },
  408. // 请求载入数据
  409. async loadData() {
  410. loadIndexs({})
  411. .then(({
  412. data
  413. }) => {
  414. let goods = data.info;
  415. this.carouselList = data.banner;
  416. this.swiperLength = this.carouselList.length;
  417. this.titleNViewBackground = this.carouselList[this.swiperCurrent].name;
  418. this.bastList = data.likeInfo; //爆款推荐
  419. this.seckill();
  420. uni.stopPullDownRefresh();
  421. })
  422. .catch(e => {
  423. uni.stopPullDownRefresh();
  424. });
  425. articleList({
  426. page: 1,
  427. limit: 1000
  428. }, 4).then(({
  429. data
  430. }) => {
  431. data.forEach(e => {
  432. this.text.push(e.synopsis);
  433. });
  434. this.article = data;
  435. });
  436. },
  437. //轮播图切换修改背景色
  438. swiperChange(e) {
  439. const index = e.detail.current;
  440. this.swiperCurrent = index;
  441. this.titleNViewBackground = this.carouselList[index].name;
  442. },
  443. //详情页
  444. navToDetailPage(item) {
  445. let id = item.id;
  446. uni.navigateTo({
  447. url: '/pages/product/product?id=' + id
  448. });
  449. },
  450. // 秒杀商品详情页
  451. navProduct(ls, ind) {
  452. let data = ls.datalist[ind];
  453. console.log(ls.datalist[ind]);
  454. uni.navigateTo({
  455. url: '/pages/product/product?id=' + data.id + '&type=1'
  456. });
  457. },
  458. // 轮播图跳转
  459. bannerNavToUrl(item) {
  460. // #ifdef H5
  461. if (item.wap_url.indexOf('http') > 0) {
  462. window.location.href = item.wap_url;
  463. }
  464. // #endif
  465. //测试数据没有写id,用title代替
  466. uni.navigateTo({
  467. url: item.wap_url
  468. });
  469. }
  470. }
  471. };
  472. </script>
  473. <style lang="scss">
  474. .vheigh {
  475. height: var(--status-bar-height);
  476. }
  477. .container,
  478. page {
  479. height: auto;
  480. min-height: 100%;
  481. background: #f6f6f6;
  482. }
  483. .top-box {
  484. display: flex;
  485. justify-content: start;
  486. padding: 50rpx 50rpx 20rpx;
  487. }
  488. .top {
  489. width: 500rpx;
  490. height: 58rpx;
  491. background: #ededed;
  492. border-radius: 29rpx;
  493. display: flex;
  494. justify-content: center;
  495. align-items: center;
  496. .top-icon {
  497. width: 32rpx;
  498. height: 32rpx;
  499. image {
  500. width: 100%;
  501. height: 100%;
  502. }
  503. }
  504. .top-main {
  505. margin-left: 20rpx;
  506. font-size: 28rpx;
  507. font-family: PingFang SC;
  508. font-weight: 500;
  509. color: #cbcbcb;
  510. }
  511. }
  512. .banner {
  513. margin-top: -2rpx;
  514. width: 750rpx;
  515. height: 916rpx;
  516. .banner-item {
  517. width: 750rpx;
  518. height: 916rpx;
  519. image {
  520. width: 100%;
  521. height: 100%;
  522. }
  523. }
  524. }
  525. .hot-title {
  526. align-items: center;
  527. justify-content: center;
  528. display: flex;
  529. .hot-title-icon {
  530. width: 20rpx;
  531. height: 12rpx;
  532. image {
  533. width: 100%;
  534. height: 100%;
  535. }
  536. }
  537. .hot-title-font {
  538. margin: 0 28rpx;
  539. font-size: 32rpx;
  540. font-family: PingFang SC;
  541. font-weight: bold;
  542. color: #000000;
  543. }
  544. }
  545. .hot-tip {
  546. text-align: center;
  547. margin-top: 12rpx;
  548. font-size: 24rpx;
  549. font-family: PingFang SC;
  550. font-weight: 500;
  551. color: #000000;
  552. }
  553. .hot-box {
  554. margin-top: 47rpx;
  555. .hot-main {
  556. padding-top: 5rpx;
  557. .hot-main-item {
  558. margin: 24rpx auto 0;
  559. width: 704rpx;
  560. background: #ffffff;
  561. border-radius: 20rpx;
  562. padding-bottom: 26rpx;
  563. position: relative;
  564. .time {
  565. position: absolute;
  566. z-index: 2;
  567. top: 0;
  568. left: 0;
  569. background: rgba(0, 0, 0, 0.3);
  570. border-radius: 16rpx 24rpx 24rpx 0px;
  571. display: flex;
  572. align-items: center;
  573. .sq {
  574. height: 74rpx;
  575. display: flex;
  576. justify-content: center;
  577. align-items: center;
  578. padding: 12rpx 20rpx;
  579. background: #000000;
  580. font-size: 24rpx;
  581. font-family: PingFang SC;
  582. font-weight: bold;
  583. color: #ffffff;
  584. border-radius: 16rpx 0px 0px 0px;
  585. }
  586. .time-main {
  587. display: flex;
  588. align-items: center;
  589. padding: 12rpx 20rpx;
  590. font-size: 22rpx;
  591. font-family: PingFang SC;
  592. font-weight: 500;
  593. color: #ffffff;
  594. }
  595. }
  596. .hot-main-image {
  597. width: 704rpx;
  598. height: 452rpx;
  599. background: #ffffff;
  600. border-radius: 20rpx 20rpx 0px 0px;
  601. image {
  602. width: 100%;
  603. height: 100%;
  604. border-radius: 20rpx 20rpx 0px 0px;
  605. }
  606. }
  607. .hot-name {
  608. padding: 18rpx 20rpx 0;
  609. font-size: 30rpx;
  610. font-family: PingFang SC;
  611. font-weight: bold;
  612. color: #000000;
  613. }
  614. .hot-tipBox {
  615. padding: 18rpx 20rpx 0;
  616. line-height: 1;
  617. .hot-tip {
  618. width: 85%;
  619. font-size: 26rpx;
  620. font-family: PingFang SC;
  621. font-weight: 500;
  622. color: #666666;
  623. }
  624. .sale {
  625. font-size: 24rpx;
  626. font-family: PingFang SC;
  627. font-weight: 500;
  628. color: #999999;
  629. }
  630. }
  631. .hot-price-box {
  632. padding: 18rpx 20rpx 0;
  633. .hot-price {
  634. padding: 0 12rpx;
  635. font-size: 32rpx;
  636. font-family: PingFang SC;
  637. font-weight: 800;
  638. color: #ff4c4c;
  639. .yuan-price {
  640. display: inline-block;
  641. margin-left: 10rpx;
  642. font-size: 24rpx;
  643. font-family: PingFang SC;
  644. font-weight: 500;
  645. text-decoration: line-through;
  646. color: #969696;
  647. }
  648. }
  649. .btn {
  650. width: 172rpx;
  651. height: 60rpx;
  652. background: #000000;
  653. border-radius: 10rpx;
  654. display: flex;
  655. justify-content: center;
  656. align-items: center;
  657. font-size: 26rpx;
  658. font-family: PingFang SC;
  659. font-weight: 500;
  660. color: #ffffff;
  661. }
  662. .btn1 {
  663. width: 172rpx;
  664. height: 60rpx;
  665. background: #ffffff;
  666. border: 1px solid #000000;
  667. border-radius: 10rpx;
  668. display: flex;
  669. justify-content: center;
  670. align-items: center;
  671. font-size: 26rpx;
  672. font-family: PingFang SC;
  673. font-weight: 500;
  674. color: #000000;
  675. }
  676. }
  677. }
  678. }
  679. }
  680. .guess-section-box {
  681. margin-top: 20rpx;
  682. width: 750rpx;
  683. background: #fff;
  684. padding-top: 30rpx;
  685. .guess-section-title {
  686. display: flex;
  687. justify-content: center;
  688. align-items: center;
  689. .guess-section-xian {
  690. width: 120rpx;
  691. height: 1px;
  692. background: #999999;
  693. }
  694. .guess-section-title-font {
  695. margin: 0 70rpx;
  696. font-size: 30rpx;
  697. font-family: PingFang SC;
  698. font-weight: 500;
  699. color: #363636;
  700. }
  701. }
  702. }
  703. .guess-section {
  704. margin-top: 40rpx;
  705. display: flex;
  706. flex-wrap: wrap;
  707. padding: 0 30rpx;
  708. .guess-item {
  709. padding-bottom: 35rpx;
  710. overflow: hidden;
  711. display: flex;
  712. flex-direction: column;
  713. width: 48%;
  714. margin-bottom: 4%;
  715. border-radius: $border-radius-sm;
  716. background-color: white;
  717. box-shadow: $box-shadow;
  718. &:nth-child(2n + 1) {
  719. margin-right: 4%;
  720. }
  721. }
  722. .image-wrapper {
  723. width: 330rpx;
  724. height: 330rpx;
  725. border-radius: 3px;
  726. overflow: hidden;
  727. image {
  728. width: 100%;
  729. height: 100%;
  730. opacity: 1;
  731. }
  732. }
  733. .title {
  734. margin-top: 28rpx;
  735. font-size: $font-base;
  736. color: $font-color-dark;
  737. font-weight: bold;
  738. }
  739. .price {
  740. margin-top: 34rpx;
  741. font-size: 32rpx;
  742. font-family: PingFang SC;
  743. font-weight: 800;
  744. color: #ff4c4c;
  745. line-height: 1;
  746. .font-size-sm {
  747. flex-shrink: 0;
  748. font-size: 24rpx;
  749. font-family: PingFang SC;
  750. font-weight: 500;
  751. color: #999999;
  752. }
  753. .yuan-price {
  754. display: inline-block;
  755. margin-left: 10rpx;
  756. font-size: 24rpx;
  757. font-family: PingFang SC;
  758. font-weight: 500;
  759. text-decoration: line-through;
  760. color: #969696;
  761. }
  762. }
  763. .icon {
  764. @extend %icon;
  765. }
  766. .detail {
  767. line-height: 1;
  768. }
  769. .tip {
  770. color: white;
  771. background-color: $color-yellow;
  772. line-height: 1.5;
  773. font-size: $font-sm;
  774. padding-left: 20rpx;
  775. }
  776. }
  777. /*公用边框样式*/
  778. %icon {
  779. margin-right: 10rpx;
  780. display: inline-block;
  781. padding: 2rpx 10rpx;
  782. border: 1rpx solid $color-yellow;
  783. color: $color-yellow;
  784. line-height: 1;
  785. font-size: $font-base;
  786. border-radius: 10rpx;
  787. }
  788. .swiper-dot {
  789. margin-top: -18rpx;
  790. display: flex;
  791. justify-content: center;
  792. position: relative;
  793. z-index: 2;
  794. .swiper-dots-item {
  795. width: 25rpx;
  796. height: 8rpx;
  797. border-radius: 4rpx 4rpx;
  798. background-color: #9fab9e;
  799. margin: 0 16rpx;
  800. // z-index: 999;
  801. }
  802. .action {
  803. background-color: #ffffff;
  804. }
  805. }
  806. .gg {
  807. margin-top: 10rpx;
  808. width: 750rpx;
  809. height: 60rpx;
  810. background: #ff3342;
  811. padding: 15rpx 30rpx;
  812. display: flex;
  813. align-items: center;
  814. .gg-icon {
  815. width: 28rpx;
  816. height: 28rpx;
  817. image {
  818. width: 100%;
  819. height: 100%;
  820. }
  821. }
  822. .tongz-left {
  823. width: 100%;
  824. margin-left: 10rpx;
  825. .tongz-font {
  826. font-size: 26rpx;
  827. font-family: PingFang SC;
  828. font-weight: bold;
  829. color: #ffffff;
  830. }
  831. }
  832. }
  833. .navbar-box {
  834. width: 750rpx;
  835. background: #10101e;
  836. padding: 34rpx 24rpx 36rpx;
  837. image {
  838. width: 100%;
  839. height: 100%;
  840. }
  841. .navbar-title {
  842. width: 100%;
  843. height: 70rpx;
  844. }
  845. button {
  846. width: 33%;
  847. height: 100%;
  848. padding: 52rpx 0 58rpx;
  849. background: #ffffff;
  850. line-height: 1;
  851. }
  852. .navbar-main {
  853. margin-top: 28rpx;
  854. display: flex;
  855. justify-content: space-around;
  856. align-items: center;
  857. padding: 52rpx 0 58rpx;
  858. background: #ffffff;
  859. line-height: 1;
  860. .navbar-item::after {
  861. border: none;
  862. background: #ffffff;
  863. height: 0;
  864. width: 0;
  865. }
  866. .navbar-item {
  867. width: 33%;
  868. display: flex;
  869. flex-direction: column;
  870. align-items: center;
  871. .navbar-icon {
  872. width: 40rpx;
  873. }
  874. .navbar-font-box {
  875. display: flex;
  876. justify-content: center;
  877. align-content: flex-start;
  878. margin-top: 24rpx;
  879. align-items: center;
  880. .navbar-font {
  881. font-size: 28rpx;
  882. font-family: PingFang SC;
  883. font-weight: 500;
  884. color: #000000;
  885. margin-right: 12rpx;
  886. }
  887. .navbar-font-icon {
  888. width: 8rpx;
  889. height: 16rpx;
  890. image {
  891. width: 100%;
  892. height: 100%;
  893. }
  894. }
  895. }
  896. .navbar-tip {
  897. margin-top: 26rpx;
  898. font-size: 20rpx;
  899. font-family: PingFang SC;
  900. font-weight: 500;
  901. color: #737372;
  902. }
  903. }
  904. .xian {
  905. width: 2rpx;
  906. height: 118rpx;
  907. background: linear-gradient(0deg, #f9e6cd 0%, #fdf6eb 50%, #f9e6cd 100%);
  908. }
  909. }
  910. }
  911. </style>