index.vue 24 KB

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