index.vue 22 KB

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