index.vue 23 KB

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