index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842
  1. <template>
  2. <view class="home">
  3. <zs-skeleton :loading="loading"></zs-skeleton>
  4. <zs-banner :city="city" :background="background" position @handlePosition="getCity" @search="handleSearch"></zs-banner>
  5. <view class="login-home">
  6. <!-- 登录显示的套餐列表 -->
  7. <view class="discount-list">
  8. <view class="discount-item" v-for="(item,index) in discountsList" :key="index" @click="goDetail(item.domainUrl,item.id,item.secondaryImg,item.menuName)">
  9. <image class="icon" :src="item.imgUrl" mode=""></image>
  10. <view class="title">{{item.menuName}}</view>
  11. <view class="tag" v-if="item.labelAbove">
  12. {{item.labelAbove}}
  13. </view>
  14. <view class="desc">
  15. {{item.labelBelow || ''}}
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 广告位 -->
  20. <!-- <view class="advertise-box">
  21. <view class="item" v-for="item in advList" :key="item.id">
  22. <zs-img
  23. :src="item.advertsImg"
  24. width="335rpx" height="188rpx" radius="full" mode=""></zs-img>
  25. </view>
  26. </view> -->
  27. <view class="content">
  28. <!-- 列表 -->
  29. <zs-list class="store-box" mt="0" @load="loadMore" :status="status">
  30. <view class="left">
  31. <view class="swiper-box">
  32. <!-- <view class="progress">
  33. {{current+1+'/'+advList.length}}
  34. </view> -->
  35. <swiper class="swiper" @change="swiperChange" skip-hidden-item-layout indicator-dots indicator-color="#fff" indicator-active-color="#FF4D3A" circular :autoplay="true"
  36. :interval="3000" :duration="1000">
  37. <swiper-item v-for="(item,index) in advList" :key="item.id" @click="jump(item.jumpUrl)">
  38. <image class="swiper-item" mode="" :src="item.advertsImg">
  39. </image>
  40. </swiper-item>
  41. </swiper>
  42. </view>
  43. <view class="store-item" v-for="(item,index) in list" :key="index">
  44. <template v-if="item.isAdv">
  45. <!-- <image class="ad" :src="item.advertsImg" mode="widthFix"></image> -->
  46. <zs-img :src="item.advertsImg" radius="full" width="344rpx" mode="widthFix" @click.native="jump(item.jumpUrl)"></zs-img>
  47. </template>
  48. <view v-else @click="goGoodsDetail(item)">
  49. <zs-img :src="item.cover[0]" width="344rpx" height="344rpx" mode=""></zs-img>
  50. <!-- <zs-img :src="item.goodsVos[0].goodsImg" width="344rpx" height="344rpx" mode=""></zs-img> -->
  51. <view class="info">
  52. <view class="title">
  53. <view class="tag">
  54. 今日特惠
  55. </view>
  56. <view class="text">
  57. {{item.title}}
  58. </view>
  59. </view>
  60. <!-- <view class="desc">
  61. {{item.goodsVos[0].goodsDescribe}}
  62. </view> -->
  63. <view class="discount-tag" v-if="item.salePrice&&item.originalPrice">
  64. {{(item.salePrice/item.originalPrice)*10}}
  65. </view>
  66. <view class="price-box">
  67. <view class="left">
  68. <view class="price" v-if="item.salePrice">
  69. ¥{{item.salePrice}}
  70. </view>
  71. <view class="old-price" v-if="item.originalPrice">
  72. ¥{{item.originalPrice}}
  73. </view>
  74. </view>
  75. <view class="right" v-if="item.salesCount">
  76. 销量{{item.salesCount}}
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="right">
  84. <view class="store-item" v-for="(item,index) in list1" :key="index">
  85. <template v-if="item.isAdv">
  86. <zs-img :src="item.advertsImg" radius="full" width="344rpx" mode="widthFix" @click.native="jump(item.jumpUrl)"></zs-img>
  87. <!-- <image class="ad" :src="item.advertsImg" mode="widthFix"></image> -->
  88. </template>
  89. <view v-else @click="goGoodsDetail(item)">
  90. <zs-img :src="item.cover[0]" width="344rpx" height="344rpx" mode=""></zs-img>
  91. <view class="info">
  92. <view class="title">
  93. <view class="tag">
  94. 今日特惠
  95. </view>
  96. <view class="text">
  97. {{item.title}}
  98. </view>
  99. </view>
  100. <view class="discount-tag">
  101. <!-- {{(item.salePrice/item.originalPrice)*10}} -->
  102. 4.5折
  103. </view>
  104. <!-- <view class="desc">
  105. {{item.goodsVos[0].goodsDescribe}}
  106. </view> -->
  107. <view class="price-box">
  108. <view class="left">
  109. <view class="price" v-if="item.salePrice">
  110. ¥{{item.salePrice}}
  111. </view>
  112. <view class="old-price" v-if="item.originalPrice">
  113. ¥{{item.originalPrice}}
  114. </view>
  115. </view>
  116. <view class="right" v-if="item.salesCount">
  117. 销量{{item.salesCount}}
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. </zs-list>
  125. </view>
  126. </view>
  127. <!-- 广告弹窗 -->
  128. <zs-adv-dialog :list="dialogAdvList"></zs-adv-dialog>
  129. </view>
  130. </template>
  131. <script>
  132. import {
  133. getUserDetail,
  134. getMenu,
  135. getAdv,
  136. homeSearch
  137. } from '@/api/common.js'
  138. import { search } from '@/api/shop.js';
  139. // 腾讯地图
  140. var QQMapWX = require('../../libs/qqmap-wx-jssdk.min.js');
  141. var qqmapsdk = new QQMapWX({key:'KX5BZ-B64RC-RO62W-AMWAZ-VVTC3-YAFXF'});
  142. export default {
  143. data() {
  144. return {
  145. background:false,
  146. loading: false,
  147. userId: '',
  148. city:'定位中',
  149. status: 'more',
  150. current:0,
  151. bannerList:['https://alipic.lanhuapp.com/XDSlicePNGMAX2f4cb415a269b2e935c7a97da9077db4d78ddb8306ac44ec1e10274387048a22.png',
  152. 'https://alipic.lanhuapp.com/XDSlicePNGMAX2f4cb415a269b2e935c7a97da9077db4d78ddb8306ac44ec1e10274387048a22.png'],
  153. discountsList: [],//菜单
  154. advList:[],
  155. advList1:[],
  156. dialogAdvList:[],
  157. list: [],
  158. copyList: [],
  159. list1: [],
  160. copyList1: [],
  161. query:{
  162. distance:100000000,
  163. latitude:0,
  164. longitude:0,
  165. regionCode:'520101',
  166. page:0,
  167. size:10
  168. }
  169. // query:{
  170. // queryName:'',
  171. // 'location.lat':0,
  172. // 'location.lon':0,
  173. // pageCurrent:1,
  174. // pageSize:100
  175. // },
  176. }
  177. },
  178. methods: {
  179. // swiper变动
  180. swiperChange(val) {
  181. this.current = val.target.current
  182. },
  183. jump(url){
  184. uni.reLaunch({
  185. url
  186. })
  187. },
  188. // 点击搜索
  189. handleSearch(){
  190. if(!uni.getStorageSync('token')){
  191. return uni.showModal({
  192. title:'请登录',
  193. confirmText:'去登录',
  194. success(res){
  195. if(res.confirm){
  196. uni.navigateTo({
  197. url:'/login/login/login?redirect=/pages/index/index'
  198. })
  199. }
  200. }
  201. })
  202. }
  203. uni.reLaunch({
  204. url:'./search'
  205. })
  206. // if(!val) return
  207. // this.query.queryName = val
  208. // this.query.pageCurrent = 1
  209. // this.list = []
  210. // this.list1 = []
  211. // this.status = 'more'
  212. // this.search()
  213. },
  214. // 获取当前城市
  215. getCity(){
  216. let that = this
  217. this.city = '定位中'
  218. return new Promise((resolve,reject)=>{
  219. uni.getLocation({
  220. type: 'gcj02',
  221. success: (res) => {
  222. // 解析地址
  223. that.query.latitude = res.latitude
  224. that.query.longitude = res.longitude
  225. // that.query['location.lat'] = res.latitude
  226. // that.query['location.lon'] = res.longitude
  227. // 存储经纬度
  228. uni.setStorageSync('location',JSON.stringify({latitude:res.latitude,longitude:res.longitude}))
  229. qqmapsdk.reverseGeocoder({
  230. location: {
  231. latitude: res.latitude,
  232. longitude: res.longitude
  233. },
  234. success: function(res) {
  235. // 市
  236. that.city = res.result.address_component.city
  237. if(uni.setStorageSync('districtList')&&uni.getStorageSync('city')==that.city) return
  238. uni.setStorageSync('city',res.result.address_component.city)
  239. // 获取市区的行政区
  240. qqmapsdk.getDistrictByCityId({
  241. // 传入对应省份ID获得城市数据,传入城市ID获得区县数据,依次类推
  242. id: res.result.ad_info.city_code.substr(3), //对应接口getCityList返回数据的Id,如:北京是'110000'
  243. success: function(res) {//成功后的回调
  244. console.log('对应城市ID下的区县数据:', res.result[0]);
  245. let data = res.result[0]
  246. data.map(item=>{
  247. item.label = item.fullname
  248. })
  249. uni.setStorageSync('districtList',JSON.stringify(data))
  250. },
  251. fail: function(error) {
  252. console.error(error);
  253. },
  254. complete: function(res) {
  255. console.log(res);
  256. }
  257. });
  258. resolve()
  259. },
  260. fail: function(res) {
  261. that.city = '定位失败'
  262. },
  263. })
  264. },
  265. fail: () => {
  266. console.log("获取经纬度失败");
  267. },
  268. })
  269. })
  270. },
  271. // 跳转优惠详情
  272. goDetail(url,id,banner,title) {
  273. uni.navigateTo({
  274. url: `${url}?id=${id}&title=${title}`,
  275. success(res) {
  276. res.eventChannel.emit('banner', banner)
  277. }
  278. })
  279. },
  280. goGoodsDetail(item) {
  281. // uni.setStorageSync('shopInfo', JSON.stringify(item))
  282. let url = ''
  283. if (item.productType === 'Web') {
  284. console.log('链接');
  285. } else if (item.productType === 'Recharge') {
  286. url = '/detail/virtualGoods/index'
  287. console.log('充值类');
  288. } else if (item.productType === 'Scenic') {
  289. url = '/scenic/detail'
  290. console.log('景区');
  291. } else if (item.productType === 'ScenicTicket') {
  292. console.log('景区门票');
  293. } else if (item.productType === 'StudyTour') {
  294. url = '/detail/virtualGoods/index'
  295. console.log('StudyTour');
  296. } else if (item.productType === 'Hotel') {
  297. url = '/hotel/hotelDetail'
  298. console.log('酒店');
  299. } else if (item.productType === 'HotelRoom') {
  300. url = '/hotel/hotelDetail'
  301. console.log('酒店房型');
  302. } else if (item.productType === 'Cinema') {
  303. url = '/movie/movieList'
  304. console.log('电影院');
  305. } else if (item.productType === 'MovieTicket') {
  306. url = '/movie/movieDetail'
  307. console.log('电影票');
  308. } else if (item.productType === 'Restaurant') {
  309. url = '/detail/virtualGoods/index'
  310. console.log('餐厅');
  311. } else if (item.productType === 'RestaurantFood') {
  312. url = '/detail/discountsDetail/index'
  313. console.log('餐厅美食');
  314. } else if (item.productType === 'CarMaintain') {
  315. url = '/detail/discountsDetail/index'
  316. console.log('汽车保养门店');
  317. } else if (item.productType === 'CarMaintainGoods') {
  318. url = '/detail/detail/discountsDetail/index/index'
  319. console.log('汽车保养商品');
  320. } else if (item.productType === 'CarMaintainService') {
  321. url = '/detail/detail/discountsDetail/index/index'
  322. console.log('汽车保养服务');
  323. } else if (item.productType === 'Shop') {
  324. url = '/detail/shopDetail/shopDetail'
  325. console.log('店铺');
  326. } else if (item.productType === 'ShopGoods') {
  327. url = '/detail/goodsDetail/index'
  328. console.log('店铺商品');
  329. } else if (item.productType === 'ShopService') {
  330. url = '/detail/goodsDetail/index'
  331. console.log('店铺服务');
  332. } else if (item.productType === 'Coupon') {
  333. url = '/detail/goodsDetail/index'
  334. console.log('优惠券');
  335. }
  336. else if (item.productType === 'PetrolStation') {
  337. url = '/refuel/refuelDetail'
  338. console.log('加油站');
  339. }
  340. else {
  341. // 处理未知或未定义的产品类型
  342. console.log('未知产品类型');
  343. }
  344. uni.navigateTo({
  345. // url: `../../detail/goodsDetail/index?id=${item.goodsVos[0].goodsId}`
  346. url: `${url}?id=${item.pid}&epId=${item.id}`
  347. })
  348. },
  349. // 更多套餐
  350. handleMore() {
  351. uni.reLaunch({
  352. // url:'../../login/login/login'
  353. url: '../../combo/combo/combo'
  354. })
  355. },
  356. // 获取用户详情
  357. getUserDetail() {
  358. getUserDetail().then(res => {
  359. uni.setStorageSync('userInfo', JSON.stringify(res.content))
  360. })
  361. },
  362. loadMore() {
  363. // if(this.query['location.lat']&&this.query['location.lon']){
  364. if(this.query.latitude&&this.query.longitude){
  365. this.search()
  366. }
  367. },
  368. search() {
  369. if(this.status == 'noMore' || this.status == 'loading') return
  370. this.status = 'loading'
  371. homeSearch(this.query).then(res=>{
  372. if(res.state == 'Success'){
  373. this.loading = false
  374. let list = []
  375. let list1 = []
  376. let data = res.content.content
  377. data.map((item,index)=>{
  378. if(item.productType == 'Cinema'){
  379. delete item.meta
  380. }
  381. if(index%2 == 0){
  382. list.push(item)
  383. }else{
  384. list1.push(item)
  385. }
  386. })
  387. // 存储原始数据
  388. this.copyList = this.copyList.concat(list)
  389. this.copyList1 = this.copyList1.concat(list1)
  390. this.list = JSON.parse(JSON.stringify(this.copyList))
  391. this.list1 = JSON.parse(JSON.stringify(this.copyList1))
  392. if(this.query.page == res.content.totalPages){
  393. this.status = 'noMore'
  394. }else{
  395. this.status = 'more'
  396. this.query.page++
  397. }
  398. if(!this.advList1.length){
  399. this.getGoodsAdv().then(()=>{
  400. this.advList1.map(item=>{
  401. if(item.showSort<= (this.list.length + this.list1.length)){
  402. if((item.showSort-1)%2 == 0){
  403. this.list.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
  404. }else{
  405. this.list1.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
  406. }
  407. }
  408. })
  409. }
  410. )
  411. }else{
  412. this.advList1.map(item=>{
  413. if(item.showSort<= (this.list.length + this.list1.length)){
  414. if((item.showSort-1)%2 == 0){
  415. this.list.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
  416. }else{
  417. this.list1.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
  418. }
  419. }
  420. })
  421. }
  422. // 获取商品里面的广告
  423. // getAdv({currentPage:1,pageSize:99,advertsType:2,status:1}).then(res1=>{
  424. // if(res.state == 'Success'){
  425. // res1.content.records.map(item=>{
  426. // data.splice(item.showSort-1,0,{isAdv:true,...item})
  427. // })
  428. // console.log(data);
  429. // data.map((item,index)=>{
  430. // if(index%2){
  431. // list.push(item)
  432. // }else{
  433. // list1.push(item)
  434. // }
  435. // })
  436. // this.list = this.list.concat(list)
  437. // this.list1 = this.list1.concat(list1)
  438. // // let total = this.list.length+this.list1.length
  439. // // if(total>=res.content.total){
  440. // if(this.query.pageCurrent == res.content.pages){
  441. // this.status = 'noMore'
  442. // }else{
  443. // this.status = 'more'
  444. // this.query.pageCurrent++
  445. // }
  446. // }
  447. // })
  448. }
  449. })
  450. },
  451. // 金刚区
  452. getMenu(){
  453. return new Promise((resolve,reject)=>{
  454. getMenu({currentPage:1,pageSize:10,status:2,belongType:2}).then(res=>{
  455. if(res.state == 'Success'){
  456. this.discountsList = res.content.records
  457. resolve(1)
  458. }
  459. })
  460. })
  461. },
  462. // 广告位
  463. getAdv(){
  464. return new Promise((resolve,reject)=>{
  465. getAdv({currentPage:1,pageSize:10,advertsType:1,status:1,belongType:2}).then(res=>{
  466. if(res.state == 'Success'){
  467. this.advList = res.content.records
  468. // this.advList = res.content.records.filter((item,index)=>index<2)
  469. // this.advList1 = res.content.records.filter((item,index)=>index>=2)
  470. resolve(2)
  471. }
  472. })
  473. })
  474. },
  475. // 弹窗广告
  476. getDialogAdv() {
  477. let loginShow
  478. if(uni.getStorageSync('token')){
  479. loginShow = 2
  480. }else{
  481. loginShow = 1
  482. }
  483. getAdv({
  484. currentPage: 1,
  485. pageSize: 99,
  486. status:1,
  487. belongType: 2,
  488. loginShow,
  489. advertsType: 6,
  490. }).then((res) => {
  491. if (res.state == "Success") {
  492. this.dialogAdvList = res.content.records
  493. }
  494. });
  495. },
  496. // 获取商品列表内广告位
  497. getGoodsAdv(){
  498. return new Promise((resolve,reject)=>{
  499. getAdv({currentPage:1,pageSize:99,advertsType:2,status:1,belongType:2}).then(res=>{
  500. if(res.state == 'Success'){
  501. this.advList1 = res.content.records
  502. resolve(2)
  503. }
  504. })
  505. })
  506. },
  507. },
  508. onPageScroll(e) {
  509. if(e.scrollTop >= 50){
  510. this.background = true
  511. }else{
  512. this.background = false
  513. }
  514. },
  515. onShow() {
  516. if (uni.getStorageSync('token')&&!uni.getStorageSync('userInfo')) {
  517. this.getUserDetail()
  518. }
  519. },
  520. onHide() {
  521. },
  522. onLoad(query){
  523. if(query.scene){
  524. if(uni.getStorageSync('token')){
  525. uni.showToast({
  526. title: '已经是平台用户',
  527. icon: 'none'
  528. });
  529. return
  530. }
  531. uni.setStorageSync('inviteCode',decodeURIComponent(query.scene))
  532. }
  533. },
  534. onShareTimeline() {
  535. return {
  536. title: "慧研学惠生活",
  537. query: "id=1",
  538. imageUrl: "https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/XHBjBiMRhVYG8f1a30bbbd80c2346197b81470444c9a.png/1.png",
  539. };
  540. },
  541. onShareAppMessage() {
  542. return {
  543. title: "慧研学惠生活",
  544. path: "/pages/index/index",
  545. };
  546. },
  547. created() {
  548. this.loading = true
  549. this.getDialogAdv()
  550. Promise.all([this.getMenu(),this.getAdv(),this.getCity()]).then(res=>{
  551. this.search()
  552. })
  553. }
  554. }
  555. </script>
  556. <style lang="scss">
  557. .home {
  558. // padding-bottom:120rpx;
  559. // background: linear-gradient(180deg, #FFFFFF 0%, #DCE8FF 100%);
  560. background: #F9F9F9;
  561. .card-title {
  562. display: flex;
  563. justify-content: center;
  564. .title {
  565. font-size: 32rpx;
  566. text-align: center;
  567. color: #fff;
  568. width: 210rpx;
  569. line-height: 64rpx;
  570. background: linear-gradient(360deg, #3074F8 0%, #568FFF 100%);
  571. border-radius: 0rpx 0rpx 24rpx 24rpx;
  572. }
  573. }
  574. .login-home {
  575. // background: linear-gradient(178deg, #FFFFFF 0%, #F9F9F9 100%);
  576. // background: #FFF;
  577. .discount-list {
  578. display: flex;
  579. flex-wrap: wrap;
  580. // padding: 30rpx 0;
  581. margin: 0 24rpx 20rpx;
  582. // background: #fff;
  583. border-radius: 16rpx;
  584. position: relative;
  585. top: 20rpx;
  586. padding-top: 20rpx;
  587. .discount-item {
  588. width: 20%;
  589. display: flex;
  590. flex-direction: column;
  591. align-items: center;
  592. margin-top: 20rpx;
  593. margin-bottom: 20rpx;
  594. position: relative;
  595. .icon {
  596. width: 80rpx;
  597. height: 80rpx;
  598. }
  599. .title {
  600. font-size: 24rpx;
  601. margin-top: 10rpx;
  602. font-weight: 300;
  603. color: #222222;
  604. }
  605. .tag {
  606. position: absolute;
  607. top: -20rpx;
  608. left: 50%;
  609. background: #FF0615;
  610. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
  611. border-radius: 14rpx 14rpx 14rpx 0rpx;
  612. color: #fff;
  613. white-space: nowrap;
  614. font-size: 18rpx;
  615. line-height: 24rpx;
  616. height: 24rpx;
  617. padding: 0 10rpx;
  618. // width: fit-content;
  619. // background-size: 100% 34rpx;
  620. }
  621. .desc {
  622. color: #FF0817;
  623. font-size: 16rpx;
  624. text-align: center;
  625. margin-top: 4rpx;
  626. }
  627. }
  628. }
  629. .title-img {
  630. width: 686rpx;
  631. height: 166rpx;
  632. margin: 24rpx 32rpx;
  633. }
  634. .swiper-box{
  635. position: relative;
  636. width: 344rpx;
  637. height: 462rpx;
  638. border-radius: 16rpx;
  639. margin-bottom: 20rpx;
  640. .progress{
  641. position: absolute;
  642. top: 38rpx;
  643. right: 20rpx;
  644. z-index: 2;
  645. color: #FFFFFF;
  646. font-size: 16rpx;
  647. background: rgba(255, 255, 255, 0.3);
  648. padding: 2rpx 10rpx;
  649. border-radius: 14rpx;
  650. }
  651. .swiper {
  652. position: relative;
  653. height: 100%;
  654. .swiper-item {
  655. width: 344rpx;
  656. height: 462rpx;
  657. border-radius: 16rpx;
  658. object-fit: cover;
  659. }
  660. }
  661. }
  662. .advertise-box {
  663. display: flex;
  664. justify-content: space-between;
  665. margin: 0 24rpx;
  666. padding: 20rpx 0;
  667. }
  668. .content {
  669. border-radius: 16rpx 16rpx 0 0;
  670. }
  671. .zs-list {
  672. display: flex;
  673. flex-wrap: wrap;
  674. justify-content: space-between;
  675. padding: 0 24rpx;
  676. .left {
  677. .adv-swiper{
  678. width: 340rpx;
  679. height: 444rpx;
  680. margin-bottom: 25rpx;
  681. .adv-item{
  682. width: 340rpx;
  683. height: 444rpx;
  684. }
  685. }
  686. }
  687. .ad{
  688. width: 340rpx;
  689. border-radius: 16rpx;
  690. }
  691. .store-item {
  692. width: 344rpx;
  693. margin-bottom: 20rpx;
  694. // box-shadow: 0rpx 0rpx 24rpx 2rpx rgba(0, 0, 0, 0.08);
  695. border-radius: 16rpx;
  696. background: #fff;
  697. .icon {
  698. width: 100%;
  699. height: 300rpx;
  700. border-radius: 16rpx 16rpx 0 0;
  701. }
  702. .info{
  703. flex: 1;
  704. padding: 16rpx;
  705. position: relative;
  706. .title{
  707. margin-top: 10rpx;
  708. display: flex;
  709. align-items: center;
  710. .tag{
  711. display: inline-block;
  712. text-align: center;
  713. font-size: 20rpx;
  714. color: #FFFFFF;
  715. background: $uni-color-primary;
  716. padding: 2rpx 10rpx;
  717. border-radius: 8rpx;
  718. }
  719. .text{
  720. font-size: 28rpx;
  721. font-weight: bold;
  722. flex: 1;
  723. white-space: nowrap;
  724. overflow: hidden;
  725. text-overflow: ellipsis;
  726. }
  727. }
  728. .desc{
  729. font-size: 24rpx;
  730. color: #AAAAAA;
  731. overflow: hidden;
  732. text-overflow: ellipsis;
  733. /* 弹性伸缩盒子模型显示 */
  734. display: -webkit-box;
  735. /* 限制在一个块元素显示的文本的行数 */
  736. -webkit-line-clamp: 2;
  737. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  738. -webkit-box-orient: vertical;
  739. margin-top: 12rpx;
  740. }
  741. .discount-tag{
  742. display: inline-block;
  743. padding: 0 10rpx;
  744. font-size: 20rpx;
  745. color: #EE4320;
  746. line-height: 28rpx;
  747. background: #FFF6F5;
  748. border-radius: 8rpx 8rpx 8rpx 8rpx;
  749. margin-top: 10rpx;
  750. }
  751. .price-box{
  752. display: flex;
  753. justify-content: space-between;
  754. align-items: center;
  755. margin-top: 12rpx;
  756. .left{
  757. display: flex;
  758. align-items: flex-end;
  759. .unit{
  760. font-size: 20rpx;
  761. color: $uni-color-primary;
  762. font-weight: bold;
  763. }
  764. .price{
  765. font-size: 32rpx;
  766. color: $uni-color-primary;
  767. font-weight: bold;
  768. }
  769. .old-price{
  770. font-size: 20rpx;
  771. color: #AAAAAA;
  772. text-decoration: line-through;
  773. margin-left: 12rpx;
  774. }
  775. }
  776. .right{
  777. font-size: 24rpx;
  778. color: #AAAAAA;
  779. }
  780. }
  781. }
  782. }
  783. }
  784. }
  785. }
  786. </style>