index.vue 23 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070
  1. <template>
  2. <view class="container">
  3. <!-- 顶部logo and 搜索 start-->
  4. <!-- <view class="status_bar"></view> -->
  5. <view class="top-bg"></view>
  6. <view class="top-search flex">
  7. <view class="search-box flex" @click="clickSearch()">
  8. <image class="search" src="../../static/icon/search-w.png" mode=""></image>
  9. <view class="search-font">输入关键词搜索</view>
  10. </view>
  11. </view>
  12. <!-- 顶部logo and 搜索 end-->
  13. <view class="jg" style="background-color: #fff;"></view>
  14. <!-- 轮播图 start -->
  15. <swiper class="top-swiper" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  16. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
  17. @click="bannerNavToUrl(item)">
  18. <image :src="item.pic" />
  19. </swiper-item>
  20. </swiper>
  21. <!-- 轮播图 end -->
  22. <!-- 分类 start -->
  23. <!-- #ifdef MP -->
  24. <view class="cate-section flex" v-if="showList">
  25. <view class="cate-item flex" v-for="(citem,cindex) in cateList" @click="navto(citem.url)" :style="{'width': showW()}">
  26. <view class="img-wrapper flex">
  27. <image :src="citem.pic" mode=""></image>
  28. </view>
  29. <view class="item-title">{{citem.name}}</view>
  30. </view>
  31. </view>
  32. <!-- #endif -->
  33. <!-- 分类 ed -->
  34. <view class="jg">
  35. </view>
  36. <!-- -->
  37. <view class="main flex">
  38. <image src="https://stx2.qiniu1314.com/static/img/in-gift1.png" mode="" class="img1" @click="navto('/pages/product/classify?type=6')"></image>
  39. <view class="flex">
  40. <image src="https://stx2.qiniu1314.com/static/img/in-gift2.png" mode="" class="img2" @click="navto('/pages/product/classify?type=11')"></image>
  41. <image src="https://stx2.qiniu1314.com/static/img/in-gift3.png" mode="" class="img2" @click="navto('/pages/product/classify?type=5')"></image>
  42. </view>
  43. </view>
  44. <!-- 积分 -->
  45. <!-- <template v-for="(item,index) in navList" v-if="index == 0">
  46. <view class="common-wrap" v-if="item.list.length > 0">
  47. <view class="tit">
  48. <image :src="'../../static/index/logo' + (index + 1) + '.png'" mode="" class="logo"></image>
  49. <view class="cate">
  50. {{item.tit}}
  51. </view>
  52. <view class="more" @click="navto(item.path)">
  53. 更多<image src="../../static/index/in-go.png" mode=""></image>
  54. </view>
  55. </view>
  56. <view class="goods-wrap flex-start">
  57. <view class="goods" v-for="good in item.list"
  58. @click="navto('/pages/product/product?id=' + good.id)">
  59. <image :src="good.image" mode="" class="goods-img"></image>
  60. <view class="goods-tit clamp">
  61. {{good.store_name}}
  62. </view>
  63. <view class="goods-price" v-if="item.state == 6">
  64. <text class="new-price">
  65. <text class="rmb">¥</text>{{good.price*1}}
  66. </text>
  67. <text class="ot-pirce" v-if="good.ot_price">
  68. ¥{{good.ot_price}}
  69. </text>
  70. </view>
  71. <view class="goods-price" v-if="item.state == 5">
  72. <text class="rmb">¥</text><text>{{good.price *1}}</text>+
  73. <image src="../../static/index/in-jf.png" mode=""></image>
  74. <text>{{good.max_integral*1}}</text> <br />
  75. <text class="ot-pirce" v-if="good.ot_price">
  76. 原价:¥{{good.ot_price}}
  77. </text>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </template> -->
  83. <!-- <view class="common-wrap" v-if="kzList.length > 0">
  84. <view class="tit">
  85. <image :src="'../../static/index/logo3.png'" mode="" class="logo"></image>
  86. <view class="cate">
  87. 空中超市
  88. </view>
  89. <view class="more" @click="navto('/pages/product/classify?type=11')">
  90. 更多<image src="../../static/index/in-go.png" mode=""></image>
  91. </view>
  92. </view>
  93. <view class="goods-wrap flex-start">
  94. <view class="goods" v-for="good in kzList"
  95. @click="navto('/pages/product/product?id=' + good.id)">
  96. <image :src="good.image" mode="" class="goods-img"></image>
  97. <view class="goods-tit clamp">
  98. {{good.store_name}}
  99. </view>
  100. <view class="goods-price" >
  101. <text>¥{{good.price}}</text> <br />
  102. <text class="ot-pirce" v-if="good.ot_price">
  103. 原价:¥{{good.ot_price}}
  104. </text>
  105. </view>
  106. </view>
  107. </view>
  108. </view> -->
  109. <!-- <template v-for="(item,index) in navList" v-if="index == 1">
  110. <view class="common-wrap" v-if="item.list.length > 0">
  111. <view class="tit">
  112. <image :src="'../../static/index/logo' + (index + 1) + '.png'" mode="" class="logo"></image>
  113. <view class="cate">
  114. {{item.tit}}
  115. </view>
  116. <view class="more" @click="navto(item.path)">
  117. 更多<image src="../../static/index/in-go.png" mode=""></image>
  118. </view>
  119. </view>
  120. <view class="goods-wrap flex-start">
  121. <view class="goods" v-for="good in item.list"
  122. @click="navto('/pages/product/product?id=' + good.id)">
  123. <image :src="good.image" mode="" class="goods-img"></image>
  124. <view class="goods-tit clamp">
  125. {{good.store_name}}
  126. </view>
  127. <view class="goods-price" v-if="item.state == 6">
  128. <text class="new-price">
  129. <text class="rmb">¥</text>{{good.price*1}}
  130. </text>
  131. <text class="ot-pirce" v-if="good.ot_price">
  132. ¥{{good.ot_price}}
  133. </text>
  134. </view>
  135. <view class="goods-price" v-if="item.state == 5">
  136. <text class="rmb">¥</text><text>{{good.price *1}}</text>+
  137. <image src="../../static/index/in-jf.png" mode=""></image>
  138. <text>{{good.max_integral*1}}</text> <br />
  139. <text class="ot-pirce" v-if="good.ot_price">
  140. 原价:¥{{good.ot_price}}
  141. </text>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. </template> -->
  147. <!-- 商品列表 start -->
  148. <!-- <view class="hot-wrap" v-if="bastList.length > 0">
  149. <image src="../../static/icon/bktj.png" mode="heightFix" class="tit" ></image>
  150. <view class="hot-list">
  151. <view class="hotgoods-item" v-for="jfitem in bastList" :key="jfitem.id"
  152. @click="navto('/pages/product/product?id=' + jfitem.id)" style="height: 520rpx;">
  153. <view class="image-wrapper">
  154. <image class="image" :src="jfitem.image" mode="scaleToFill"></image>
  155. </view>
  156. <view class="flex"
  157. style="flex-direction: column;justify-content: space-between;align-items: flex-start;height: 170rpx;">
  158. <view class="title clamp2">{{jfitem.store_name}}</view>
  159. <view class="hot-price">
  160. <view class="price">
  161. <text>¥{{ jfitem.price * 1 }}</text>
  162. <text class="ot-pirce">¥{{jfitem.ot_price}}</text>
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. </view>
  168. </view> -->
  169. </view>
  170. </template>
  171. <script>
  172. import {
  173. loadIndexs,
  174. } from '@/api/index.js';
  175. import {
  176. groomList,
  177. getProducts
  178. } from '@/api/product.js';
  179. import {
  180. saveUrl,
  181. interceptor
  182. } from '@/utils/loginUtils';
  183. import {
  184. mapState,
  185. mapMutations
  186. } from 'vuex';
  187. // #ifdef H5
  188. import {
  189. weixindata,
  190. shareLoad
  191. } from '@/utils/wxAuthorized';
  192. // #endif
  193. import {
  194. getCategoryList
  195. } from '@/api/product.js';
  196. export default {
  197. data() {
  198. return {
  199. kzList: [],
  200. cunList: [],
  201. bastList: [],
  202. cateList: [],
  203. carouselList: [], //轮播列表
  204. navList: [{
  205. state: 6,
  206. path: '/pages/product/classify?type=6',
  207. tit: '礼包商品',
  208. logo: '',
  209. list: [],
  210. qdata: {
  211. limit: 3,
  212. page: 1
  213. },
  214. loaded: false
  215. },
  216. {
  217. state: 5,
  218. path: '/pages/product/classify?type=5',
  219. tit: '积分兑换区',
  220. logo: '',
  221. list: [],
  222. qdata: {
  223. limit: 3,
  224. page: 1
  225. },
  226. loaded: false
  227. },
  228. ],
  229. showList: false
  230. };
  231. },
  232. computed: {
  233. ...mapState('user', ['hasLogin', 'userInfo'])
  234. },
  235. onShareAppMessage(options) {
  236. // 设置菜单中的转发按钮触发转发事件时的转发内容
  237. let pages = getCurrentPages(); //获取加载的页面
  238. let currentPage = pages[pages.length - 1]; //获取当前页面的对象
  239. let url = currentPage.route; //当前页面url
  240. let item = currentPage.options; //如果要获取url中所带的参数可以查看options
  241. let shareObj = {}
  242. if (this.userInfo.uid) {
  243. shareObj = {
  244. title: this.userInfo.nickname + '邀请您加入7131', // 默认是小程序的名称(可以写slogan等)
  245. path: url + '?scene=' + this.userInfo.uid, // 默认是当前页面,必须是以‘/’开头的完整路径
  246. imageUrl: '',
  247. success: function(res) {
  248. // 转发成功之后的回调
  249. if (res.errMsg == 'shareAppMessage:ok') {}
  250. },
  251. fail: function() {
  252. // 转发失败之后的回调
  253. if (res.errMsg == 'shareAppMessage:fail cancel') {
  254. // 用户取消转发
  255. } else if (res.errMsg == 'shareAppMessage:fail') {
  256. // 转发失败,其中 detail message 为详细失败信息
  257. }
  258. }
  259. };
  260. } else {
  261. shareObj = {
  262. // title: '', // 默认是小程序的名称(可以写slogan等)
  263. path: url, // 默认是当前页面,必须是以‘/’开头的完整路径
  264. imageUrl: '',
  265. success: function(res) {
  266. // 转发成功之后的回调
  267. if (res.errMsg == 'shareAppMessage:ok') {}
  268. },
  269. fail: function() {
  270. // 转发失败之后的回调
  271. if (res.errMsg == 'shareAppMessage:fail cancel') {
  272. // 用户取消转发
  273. } else if (res.errMsg == 'shareAppMessage:fail') {
  274. // 转发失败,其中 detail message 为详细失败信息
  275. }
  276. }
  277. };
  278. }
  279. return shareObj;
  280. },
  281. onReachBottom() {},
  282. onLoad: function(option) {
  283. // #ifdef MP
  284. if (option.scene) {
  285. // 存储小程序邀请人
  286. uni.setStorage({
  287. key: 'spread_code',
  288. data: option.scene
  289. });
  290. }
  291. // #endif
  292. // #ifdef H5
  293. if (option.spread) {
  294. // 存储小程序邀请人
  295. uni.setStorage({
  296. key: 'spread',
  297. data: option.spread
  298. });
  299. }
  300. // #endif
  301. },
  302. onShow: function() {
  303. this.getGoodList()
  304. this.loadData();
  305. // this.getnavbar();
  306. this.getProducts()
  307. },
  308. onHide() {},
  309. methods: {
  310. showW() {
  311. // if(this.cateList.length > 4 && )
  312. if(this.cateList.length < 4) {
  313. return '33.3%'
  314. }else if(this.cateList.length >=4 && this.cateList.length % 4 == 0 ) {
  315. console.log('zhe25')
  316. return '25%'
  317. }else {
  318. console.log('zhe20')
  319. return '20%'
  320. }
  321. },
  322. getProducts() {
  323. getProducts({
  324. sid: 54
  325. }).then(res => {
  326. this.cunList = res.data
  327. console.log(this.cunList,'cunList')
  328. })
  329. //
  330. getProducts({
  331. sid: 56
  332. }).then(res => {
  333. this.kzList = res.data
  334. })
  335. },
  336. getnavbar() {
  337. let obj = this;
  338. getCategoryList({})
  339. .then(({
  340. data
  341. }) => {
  342. this.cateList = data.map((re) => {
  343. if (re.children.length > 0) {
  344. const ar = re.children[0];
  345. ar.path = '/pages/product/list?&fid=' + re.id + 'sid=' + re.id + '&tid=' + ar
  346. .id
  347. return ar
  348. } else {
  349. re.path = '/pages/product/list?&sid=' + re.id
  350. return re
  351. }
  352. });
  353. console.log();
  354. console.log(data, '123456');
  355. })
  356. .catch(err => {
  357. console.log(err);
  358. });
  359. },
  360. // gogogo(item) {
  361. // if (!item.path) {
  362. // uni.navigateTo({
  363. // url: '/pages/index/dkf'
  364. // })
  365. // }
  366. // if (item.path == 'kf') {
  367. // this.$refs.popupkf.open()
  368. // } else {
  369. // uni.navigateTo({
  370. // url: item.path + '&tit=' + item.tit,
  371. // fail() {
  372. // uni.navigateTo({
  373. // url: item.path,
  374. // fail() {
  375. // uni.switchTab({
  376. // url: item.path,
  377. // })
  378. // }
  379. // })
  380. // }
  381. // })
  382. // }
  383. // },
  384. getGoodList() {
  385. let obj = this
  386. let lb = obj.navList[0];
  387. let jf = obj.navList[1];
  388. // let vip = obj.navList[2];
  389. groomList(lb.qdata, lb.state).then(res => {
  390. lb.list = res.data.list
  391. })
  392. groomList(jf.qdata, jf.state).then(res => {
  393. jf.list = res.data.list
  394. })
  395. },
  396. navto(url, type = 0) {
  397. if (type == 1) {
  398. if (!this.hasLogin) {
  399. // 保存地址
  400. saveUrl();
  401. // 登录拦截
  402. interceptor();
  403. } else {
  404. uni.navigateTo({
  405. url,
  406. fail() {
  407. uni.switchTab({
  408. url
  409. })
  410. }
  411. })
  412. }
  413. } else {
  414. // #ifdef MP-WEIXIN
  415. // if(url)
  416. if(url.charAt(0)=='#') {
  417. return wx.navigateToMiniProgram({
  418. shortLink:url,
  419. //develop开发版;trial体验版;release正式版
  420. envVersion: 'release',
  421. success(res) {
  422. // 打开成功
  423. console.log("跳转小程序成功!",res);
  424. }
  425. })
  426. }else {
  427. uni.navigateTo({
  428. url,
  429. fail() {
  430. uni.switchTab({
  431. url
  432. })
  433. }
  434. })
  435. }
  436. // #endif
  437. // #ifndef MP
  438. uni.navigateTo({
  439. url,
  440. fail() {
  441. uni.switchTab({
  442. url
  443. })
  444. }
  445. })
  446. // #endif
  447. }
  448. },
  449. // navTo(url) {
  450. // if (url == '') {
  451. // this.$api.msg('暂未开通,敬请期待');
  452. // } else {
  453. // this.navto(url)
  454. // }
  455. // },
  456. // 點擊搜索框
  457. clickSearch() {
  458. uni.navigateTo({
  459. url: '/pages/product/search'
  460. });
  461. },
  462. // 监听图片加载完成
  463. onImageError(key, index) {
  464. this[key][index].image = '/static/error/errorImage.jpg';
  465. },
  466. // 请求载入数据
  467. async loadData() {
  468. loadIndexs({})
  469. .then(({
  470. data
  471. }) => {
  472. let goods = data.info;
  473. this.carouselList = data.banner;
  474. this.bastList = data.likeInfo;
  475. this.cateList = data.menus;
  476. let yy_model = +data.yy_model;
  477. if (yy_model == 0) {
  478. console.log(yy_model);
  479. this.showList = true;
  480. }
  481. uni.setStorageSync('yydm', data.yy_model);
  482. uni.stopPullDownRefresh();
  483. })
  484. .catch(e => {
  485. uni.stopPullDownRefresh();
  486. });
  487. },
  488. // 轮播图跳转
  489. bannerNavToUrl(item) {
  490. // #ifdef H5
  491. // console.log(item.wap_url.indexOf('http'), 'banner');
  492. if (item.wap_url.indexOf('http') >= 0) {
  493. window.location.href = item.wap_url;
  494. }
  495. // uni.navigateTo({
  496. // url: '/pages/zero/order'
  497. // })
  498. // #endif
  499. //测试数据没有写id,用title代替
  500. uni.navigateTo({
  501. url: item.wap_url
  502. });
  503. },
  504. comfirm(text) {
  505. // console.log(text);
  506. const result = this.uniCopy(text);
  507. if (result === false) {
  508. uni.showToast({
  509. title: '不支持'
  510. });
  511. } else {
  512. uni.showToast({
  513. title: '复制成功',
  514. icon: 'none'
  515. });
  516. }
  517. this.$refs.popupkf.close();
  518. },
  519. uniCopy(content) {
  520. /**
  521. * 小程序端 和 app端的复制逻辑
  522. */
  523. //#ifndef H5
  524. uni.setClipboardData({
  525. data: content,
  526. success: function() {
  527. // console.log('success');
  528. return true;
  529. }
  530. });
  531. //#endif
  532. /**
  533. * H5端的复制逻辑
  534. */
  535. // #ifdef H5
  536. if (!document.queryCommandSupported('copy')) {
  537. //为了兼容有些浏览器 queryCommandSupported 的判断
  538. // 不支持
  539. return false;
  540. }
  541. let textarea = document.createElement('textarea');
  542. textarea.value = content;
  543. textarea.readOnly = 'readOnly';
  544. document.body.appendChild(textarea);
  545. textarea.select(); // 选择对象
  546. textarea.setSelectionRange(0, content.length); //核心
  547. let result = document.execCommand('copy'); // 执行浏览器复制命令
  548. textarea.remove();
  549. return result;
  550. // #endif
  551. },
  552. // 打开客服
  553. openKf() {
  554. this.$refs.popupkf.open();
  555. },
  556. // 关闭客服
  557. cancel() {
  558. this.$refs.popupkf.close();
  559. },
  560. }
  561. };
  562. </script>
  563. <style lang="scss">
  564. image {
  565. vertical-align: middle;
  566. }
  567. page {
  568. min-height: 100%;
  569. height: auto;
  570. }
  571. // 顶部搜索
  572. .top-search {
  573. height: 80rpx;
  574. padding: 0 20rpx;
  575. position: relative;
  576. .top-logo {
  577. width: 50rpx;
  578. // height: 50rpx;
  579. margin-right: 10rpx;
  580. image {
  581. width: 48rpx;
  582. }
  583. }
  584. .search-box {
  585. justify-content: center;
  586. width: 698rpx;
  587. height: 60rpx;
  588. background: rgba(255, 255, 255, 0.5);
  589. color: #fff;
  590. // box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
  591. border-radius: 30rpx;
  592. .search {
  593. width: 34rpx;
  594. height: 34rpx;
  595. }
  596. .search-font {
  597. margin-left: 14rpx;
  598. font-size: 28rpx;
  599. font-weight: 500;
  600. }
  601. }
  602. }
  603. // 顶部轮播图
  604. .top-swiper {
  605. background-color: #fff;
  606. width: 690rpx;
  607. height: 320rpx;
  608. margin: auto;
  609. .carousel-item {
  610. image {
  611. width: 100%;
  612. height: 100%;
  613. border-radius: 20rpx;
  614. }
  615. }
  616. // margin: 20rpx 0 0;
  617. }
  618. .swiper-btm {
  619. height: 60rpx;
  620. width: 750rpx;
  621. background-color: #fff;
  622. margin-bottom: 20rpx;
  623. font-size: 26rpx;
  624. font-weight: 500;
  625. color: #333333;
  626. .btm-item {
  627. flex-grow: 1;
  628. justify-content: center;
  629. image {
  630. width: 25rpx;
  631. height: 25rpx;
  632. margin-right: 14rpx;
  633. }
  634. }
  635. }
  636. .jg {
  637. height: 20rpx;
  638. background: #F8F8F8;
  639. }
  640. // 分类
  641. .cate-section {
  642. justify-content: flex-start;
  643. background-color: #fff;
  644. padding: 0 20rpx 30rpx;
  645. flex-wrap: wrap;
  646. .cate-item {
  647. padding-top: 30rpx;
  648. flex-grow: 0;
  649. width: 20%;
  650. flex-direction: column;
  651. text-align: center;
  652. align-items: center;
  653. justify-content: center;
  654. .img-wrapper {
  655. width: 123rpx;
  656. height: 123rpx;
  657. border-radius: 20rpx;
  658. position: relative;
  659. image {
  660. width: 100%;
  661. height: 100%;
  662. position: absolute;
  663. left: 50%;
  664. top: 50%;
  665. transform: translate(-50%, -50%);
  666. }
  667. }
  668. .item-title {
  669. margin-top: 15rpx;
  670. font-size: 26rpx;
  671. font-weight: 500;
  672. }
  673. }
  674. }
  675. .hot-wrap {
  676. background-color: #fff;
  677. padding-top: 20rpx;
  678. .tit {
  679. display: block;
  680. height: 40rpx;
  681. margin: 20rpx auto 40rpx;
  682. }
  683. .hot-list {
  684. // margin-top: 38rpx;
  685. width: 100%;
  686. display: flex;
  687. flex-wrap: wrap;
  688. padding: 0 20rpx 30rpx;
  689. justify-content: space-between;
  690. .hotgoods-item {
  691. width: 345rpx;
  692. background-color: #ffffff;
  693. border-radius: 12rpx;
  694. box-shadow: 0 0 15rpx rgba(0, 0, 0, 0.2);
  695. margin-bottom: 15rpx;
  696. .image-wrapper {
  697. width: 345rpx;
  698. height: 345rpx;
  699. border-radius: 3px;
  700. overflow: hidden;
  701. position: relative;
  702. .image-bg {
  703. position: absolute;
  704. top: 0;
  705. left: 0;
  706. right: 0;
  707. bottom: 0;
  708. width: 100%;
  709. height: 100%;
  710. opacity: 1;
  711. border-radius: 12rpx 12rpx 0 0;
  712. z-index: 2;
  713. }
  714. .image {
  715. width: 100%;
  716. height: 100%;
  717. opacity: 1;
  718. border-radius: 12rpx 12rpx 0 0;
  719. }
  720. }
  721. .title {
  722. margin-top: 24rpx;
  723. padding: 0 20rpx;
  724. font-size: 32rpx;
  725. font-weight: 500;
  726. color: #333333;
  727. }
  728. .hot-price {
  729. display: flex;
  730. justify-content: flex-start;
  731. align-items: center;
  732. width: 100%;
  733. padding: 0 10rpx;
  734. // padding: 14rpx 0 30rpx;
  735. .hotPrice-box {
  736. padding: 2rpx 6rpx;
  737. background: linear-gradient(90deg, #c79a4c, #f9df7f);
  738. border-radius: 5rpx;
  739. text-align: center;
  740. line-height: 28rpx;
  741. font-size: 20rpx;
  742. font-family: Source Han Sans CN;
  743. font-weight: 400;
  744. color: #ffffff;
  745. }
  746. .price {
  747. margin-left: 10rpx;
  748. font-size: 36rpx;
  749. color: #ff0000;
  750. font-weight: 500;
  751. display: flex;
  752. width: 100%;
  753. justify-content: flex-start;
  754. align-items: center;
  755. .jf {
  756. font-size: 20rpx;
  757. }
  758. .give-jf {
  759. display: inline-block;
  760. padding: 8rpx;
  761. background: linear-gradient(90deg, #FF834D, #FF2600);
  762. border-radius: 12rpx 0px 12rpx 0px;
  763. font-size: 22rpx;
  764. font-weight: 500;
  765. color: #FFFFFF;
  766. margin-left: 22rpx;
  767. }
  768. .ot-pirce {
  769. margin-left: 7rpx;
  770. font-size: 26rpx;
  771. font-weight: 500;
  772. text-decoration: line-through;
  773. color: #999999;
  774. align-self: flex-end;
  775. }
  776. }
  777. .yuanPrice {
  778. margin-left: 10rpx;
  779. font-size: 20rpx;
  780. font-family: PingFang SC;
  781. font-weight: 500;
  782. text-decoration: line-through;
  783. color: #999999;
  784. }
  785. .cart-icon {
  786. image {
  787. width: 44rpx;
  788. height: 44rpx;
  789. }
  790. }
  791. }
  792. }
  793. }
  794. }
  795. .popup-box {
  796. width: 522rpx;
  797. height: 605rpx;
  798. background-color: #ffffff;
  799. border-radius: 20rpx;
  800. position: relative;
  801. .img {
  802. position: relative;
  803. top: -56rpx;
  804. left: 0;
  805. width: 522rpx;
  806. height: 132rpx;
  807. display: flex;
  808. justify-content: center;
  809. image {
  810. border-radius: 20rpx 20rpx 0 0;
  811. width: 450rpx;
  812. height: 132rpx;
  813. }
  814. }
  815. .mian {
  816. margin-top: -44rpx;
  817. display: flex;
  818. flex-direction: column;
  819. align-items: center;
  820. // padding: 32rpx 32rpx;
  821. background-color: #ffffff;
  822. border-radius: 0 0 20rpx 20rpx;
  823. text-align: center;
  824. .delivery {
  825. font-size: 40rpx;
  826. color: #333333;
  827. display: flex;
  828. align-items: center;
  829. flex-direction: column;
  830. image {
  831. margin-top: 48rpx;
  832. width: 172rpx;
  833. height: 160rpx;
  834. }
  835. }
  836. .nocancel {
  837. font-size: 32rpx;
  838. color: #333333;
  839. margin-top: 14rpx;
  840. }
  841. .comfirm-box {
  842. margin-top: 52rpx;
  843. display: flex;
  844. // margin-bottom: 32rpx;
  845. // justify-content: space-around;
  846. .cancel {
  847. display: flex;
  848. align-items: center;
  849. justify-content: center;
  850. width: 197rpx;
  851. height: 74rpx;
  852. border: 1px solid #dcc786;
  853. border-radius: 38rpx;
  854. font-size: 32rpx;
  855. color: #605128;
  856. }
  857. .comfirm {
  858. margin-left: 32rpx;
  859. display: flex;
  860. align-items: center;
  861. justify-content: center;
  862. width: 197rpx;
  863. height: 74rpx;
  864. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  865. border-radius: 38px;
  866. font-size: 32rpx;
  867. color: #605128;
  868. }
  869. }
  870. }
  871. }
  872. .top-bg {
  873. height: 450rpx;
  874. //#f53934
  875. background-image: linear-gradient(to bottom, $base-color, #fff);
  876. position: absolute;
  877. top: 0;
  878. width: 100%;
  879. }
  880. .gsjs {
  881. width: 100%;
  882. }
  883. .status_bar {
  884. height: var(--status-bar-height);
  885. width: 100%;
  886. }
  887. .common-wrap {
  888. background-color: #fff;
  889. margin-bottom: 20rpx;
  890. padding: 25rpx 35rpx 25rpx 0rpx;
  891. .tit {
  892. display: flex;
  893. align-items: center;
  894. padding-left: 30rpx;
  895. .logo {
  896. width: 37rpx;
  897. height: 36rpx;
  898. }
  899. .cate {
  900. font-size: 32rpx;
  901. font-weight: bold;
  902. flex-grow: 1;
  903. padding-left: 10rpx;
  904. }
  905. .more {
  906. font-size: 24rpx;
  907. font-weight: 500;
  908. color: #9A9A9A;
  909. image {
  910. display: inline-block;
  911. margin-left: 10rpx;
  912. width: 10rpx;
  913. height: 20rpx;
  914. vertical-align: middle;
  915. }
  916. }
  917. }
  918. .goods-wrap {
  919. flex-wrap: wrap;
  920. .goods {
  921. width: 207rpx;
  922. margin-top: 30rpx;
  923. margin-left: 30rpx;
  924. // &:nth-child(2n){
  925. // margin:30rpx 30rpx 0 30rpx;
  926. // }
  927. .goods-img {
  928. width: 207rpx;
  929. height: 207rpx;
  930. border-radius: 20rpx;
  931. background-color: #9A9A9A;
  932. }
  933. .goods-tit {
  934. font-size: 26rpx;
  935. font-weight: 500;
  936. padding: 15rpx 0 8rpx;
  937. }
  938. .goods-price {
  939. font-size: 30rpx;
  940. font-weight: 500;
  941. color: #FF6F0F;
  942. .ot-pirce {
  943. padding-left: 15rpx;
  944. font-size: 20rpx;
  945. font-weight: 500;
  946. text-decoration: line-through;
  947. color: #9A9A9A;
  948. }
  949. image {
  950. width: 22rpx;
  951. height: 24rpx;
  952. margin-right: 6rpx;
  953. }
  954. .vip-price {
  955. display: inline-block;
  956. border-radius: 5rpx;
  957. font-size: 24rpx;
  958. padding: 6rpx 5rpx 5rpx 9rpx;
  959. margin-left: 8rpx;
  960. border: 1px solid #FF6F0F;
  961. }
  962. }
  963. }
  964. }
  965. }
  966. .rmb {
  967. font-size: 24rpx;
  968. }
  969. .main {
  970. padding: 20rpx;
  971. background-color: #FFFFFF;
  972. justify-content: space-between;
  973. .img1 {
  974. width: 343rpx;
  975. height: 501rpx;
  976. flex-shrink: 0;
  977. }
  978. view {
  979. width: 342rpx;
  980. height: 501rpx;
  981. flex-direction: column;
  982. justify-content: space-between;
  983. }
  984. .img2 {
  985. width: 342rpx;
  986. height: 240rpx;
  987. }
  988. }
  989. </style>