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