index.vue 25 KB

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