index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846
  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. let url = ''
  283. if (item.productType === 'Web') {
  284. console.log('链接');
  285. } else if (item.productType === 'Recharge') {
  286. url = '/detail/virtualGoods/index'
  287. console.log('充值类');
  288. } else if (item.productType === 'Scenic') {
  289. url = '/scenic/detail'
  290. console.log('景区');
  291. } else if (item.productType === 'ScenicTicket') {
  292. console.log('景区门票');
  293. } else if (item.productType === 'StudyTour') {
  294. url = '/detail/virtualGoods/index'
  295. console.log('StudyTour');
  296. } else if (item.productType === 'Hotel') {
  297. url = '/hotel/hotelDetail'
  298. console.log('酒店');
  299. } else if (item.productType === 'HotelRoom') {
  300. url = '/hotel/hotelDetail'
  301. console.log('酒店房型');
  302. } else if (item.productType === 'Cinema') {
  303. url = '/movie/movieList'
  304. console.log('电影院');
  305. } else if (item.productType === 'MovieTicket') {
  306. url = '/movie/movieDetail'
  307. console.log('电影票');
  308. } else if (item.productType === 'Restaurant') {
  309. url = '/detail/virtualGoods/index'
  310. console.log('餐厅');
  311. } else if (item.productType === 'RestaurantFood') {
  312. url = '/detail/discountsDetail/index'
  313. console.log('餐厅美食');
  314. } else if (item.productType === 'CarMaintain') {
  315. url = '/detail/discountsDetail/index'
  316. console.log('汽车保养门店');
  317. } else if (item.productType === 'CarMaintainGoods') {
  318. url = '/detail/detail/discountsDetail/index/index'
  319. console.log('汽车保养商品');
  320. } else if (item.productType === 'CarMaintainService') {
  321. url = '/detail/detail/discountsDetail/index/index'
  322. console.log('汽车保养服务');
  323. } else if (item.productType === 'Shop') {
  324. url = '/detail/shopDetail/shopDetail'
  325. console.log('店铺');
  326. } else if (item.productType === 'ShopGoods') {
  327. url = '/detail/goodsDetail/index'
  328. console.log('店铺商品');
  329. } else if (item.productType === 'ShopService') {
  330. url = '/detail/goodsDetail/index'
  331. console.log('店铺服务');
  332. } else if (item.productType === 'Coupon') {
  333. url = '/detail/goodsDetail/index'
  334. console.log('优惠券');
  335. }
  336. else if (item.productType === 'PetrolStation') {
  337. url = '/refuel/refuelDetail'
  338. console.log('加油站');
  339. }
  340. else {
  341. // 处理未知或未定义的产品类型
  342. console.log('未知产品类型');
  343. }
  344. uni.navigateTo({
  345. // url: `../../detail/goodsDetail/index?id=${item.goodsVos[0].goodsId}`
  346. url: `${url}?id=${item.pid}&epId=${item.id}`
  347. })
  348. },
  349. // 更多套餐
  350. handleMore() {
  351. uni.reLaunch({
  352. // url:'../../login/login/login'
  353. url: '../../combo/combo/combo'
  354. })
  355. },
  356. // 获取用户详情
  357. getUserDetail() {
  358. getUserDetail().then(res => {
  359. uni.setStorageSync('userInfo', JSON.stringify(res.content))
  360. })
  361. },
  362. loadMore() {
  363. // if(this.query['location.lat']&&this.query['location.lon']){
  364. if(this.query.latitude&&this.query.longitude){
  365. this.search()
  366. }
  367. },
  368. search() {
  369. if(this.status == 'noMore' || this.status == 'loading') return
  370. this.status = 'loading'
  371. homeSearch(this.query).then(res=>{
  372. if(res.state == 'Success'){
  373. this.loading = false
  374. let list = []
  375. let list1 = []
  376. let data = res.content.content
  377. data.map((item,index)=>{
  378. if(item.productType == 'Cinema'){
  379. delete item.meta
  380. }
  381. if(index%2 == 0){
  382. list.push(item)
  383. }else{
  384. list1.push(item)
  385. }
  386. })
  387. // 存储原始数据
  388. this.copyList = this.copyList.concat(list)
  389. this.copyList1 = this.copyList1.concat(list1)
  390. this.list = JSON.parse(JSON.stringify(this.copyList))
  391. this.list1 = JSON.parse(JSON.stringify(this.copyList1))
  392. if(this.query.page == res.content.totalPages){
  393. this.status = 'noMore'
  394. }else{
  395. this.status = 'more'
  396. this.query.page++
  397. }
  398. if(!this.advList1.length){
  399. this.getGoodsAdv().then(()=>{
  400. this.advList1.map(item=>{
  401. if(item.showSort<= (this.list.length + this.list1.length)){
  402. if((item.showSort-1)%2 == 0){
  403. this.list.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
  404. }else{
  405. this.list1.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
  406. }
  407. }
  408. })
  409. }
  410. )
  411. }else{
  412. this.advList1.map(item=>{
  413. if(item.showSort<= (this.list.length + this.list1.length)){
  414. if((item.showSort-1)%2 == 0){
  415. this.list.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
  416. }else{
  417. this.list1.splice(Math.ceil(item.showSort/2)-1,0,{isAdv:true,...item})
  418. }
  419. }
  420. })
  421. }
  422. // 获取商品里面的广告
  423. // getAdv({currentPage:1,pageSize:99,advertsType:2,status:1}).then(res1=>{
  424. // if(res.state == 'Success'){
  425. // res1.content.records.map(item=>{
  426. // data.splice(item.showSort-1,0,{isAdv:true,...item})
  427. // })
  428. // console.log(data);
  429. // data.map((item,index)=>{
  430. // if(index%2){
  431. // list.push(item)
  432. // }else{
  433. // list1.push(item)
  434. // }
  435. // })
  436. // this.list = this.list.concat(list)
  437. // this.list1 = this.list1.concat(list1)
  438. // // let total = this.list.length+this.list1.length
  439. // // if(total>=res.content.total){
  440. // if(this.query.pageCurrent == res.content.pages){
  441. // this.status = 'noMore'
  442. // }else{
  443. // this.status = 'more'
  444. // this.query.pageCurrent++
  445. // }
  446. // }
  447. // })
  448. }
  449. })
  450. },
  451. // 金刚区
  452. getMenu(){
  453. return new Promise((resolve,reject)=>{
  454. getMenu({currentPage:1,pageSize:10,status:2,belongType:2}).then(res=>{
  455. if(res.state == 'Success'){
  456. this.discountsList = res.content.records
  457. resolve(1)
  458. }
  459. })
  460. })
  461. },
  462. // 广告位
  463. getAdv(){
  464. return new Promise((resolve,reject)=>{
  465. getAdv({currentPage:1,pageSize:10,advertsType:1,status:1,belongType:2}).then(res=>{
  466. if(res.state == 'Success'){
  467. this.advList = res.content.records
  468. // this.advList = res.content.records.filter((item,index)=>index<2)
  469. // this.advList1 = res.content.records.filter((item,index)=>index>=2)
  470. resolve(2)
  471. }
  472. })
  473. })
  474. },
  475. // 弹窗广告
  476. getDialogAdv() {
  477. let loginShow
  478. if(uni.getStorageSync('token')){
  479. loginShow = 2
  480. }else{
  481. loginShow = 1
  482. }
  483. getAdv({
  484. currentPage: 1,
  485. pageSize: 99,
  486. status:1,
  487. belongType: 2,
  488. loginShow,
  489. advertsType: 6,
  490. }).then((res) => {
  491. if (res.state == "Success") {
  492. this.dialogAdvList = res.content.records
  493. }
  494. });
  495. },
  496. // 获取商品列表内广告位
  497. getGoodsAdv(){
  498. return new Promise((resolve,reject)=>{
  499. getAdv({currentPage:1,pageSize:99,advertsType:2,status:1,belongType:2}).then(res=>{
  500. if(res.state == 'Success'){
  501. this.advList1 = res.content.records
  502. resolve(2)
  503. }
  504. })
  505. })
  506. },
  507. },
  508. onPageScroll(e) {
  509. if(e.scrollTop >= 50){
  510. this.background = true
  511. }else{
  512. this.background = false
  513. }
  514. },
  515. onShow() {
  516. if (uni.getStorageSync('token')&&!uni.getStorageSync('userInfo')) {
  517. this.getUserDetail()
  518. }
  519. },
  520. onHide() {
  521. },
  522. onLoad(query){
  523. const token = uni.getStorageSync('token')
  524. console.log(!!token)
  525. if(query.scene){
  526. // const token = uni.getStorageSync('token')
  527. if(token){
  528. uni.showToast({
  529. title: '已经是平台用户',
  530. icon: 'none'
  531. });
  532. return
  533. }
  534. uni.setStorageSync('inviteCode',decodeURIComponent(query.scene))
  535. }
  536. },
  537. onShareTimeline() {
  538. return {
  539. title: "慧研学惠生活",
  540. query: "id=1",
  541. imageUrl: "https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/XHBjBiMRhVYG8f1a30bbbd80c2346197b81470444c9a.png/1.png",
  542. };
  543. },
  544. onShareAppMessage() {
  545. return {
  546. title: "慧研学惠生活",
  547. path: "/pages/index/index",
  548. };
  549. },
  550. created() {
  551. this.loading = true
  552. this.getDialogAdv()
  553. Promise.all([this.getMenu(),this.getAdv(),this.getCity()]).then(res=>{
  554. this.search()
  555. })
  556. }
  557. }
  558. </script>
  559. <style lang="scss">
  560. .home {
  561. // padding-bottom:120rpx;
  562. // background: linear-gradient(180deg, #FFFFFF 0%, #DCE8FF 100%);
  563. background: #F9F9F9;
  564. .card-title {
  565. display: flex;
  566. justify-content: center;
  567. .title {
  568. font-size: 32rpx;
  569. text-align: center;
  570. color: #fff;
  571. width: 210rpx;
  572. line-height: 64rpx;
  573. background: linear-gradient(360deg, #3074F8 0%, #568FFF 100%);
  574. border-radius: 0rpx 0rpx 24rpx 24rpx;
  575. }
  576. }
  577. .login-home {
  578. // background: linear-gradient(178deg, #FFFFFF 0%, #F9F9F9 100%);
  579. // background: #FFF;
  580. .discount-list {
  581. display: flex;
  582. flex-wrap: wrap;
  583. // padding: 30rpx 0;
  584. margin: 0 24rpx 20rpx;
  585. // background: #fff;
  586. border-radius: 16rpx;
  587. position: relative;
  588. top: 20rpx;
  589. padding-top: 20rpx;
  590. .discount-item {
  591. width: 20%;
  592. display: flex;
  593. flex-direction: column;
  594. align-items: center;
  595. margin-top: 20rpx;
  596. margin-bottom: 20rpx;
  597. position: relative;
  598. .icon {
  599. width: 80rpx;
  600. height: 80rpx;
  601. }
  602. .title {
  603. font-size: 24rpx;
  604. margin-top: 10rpx;
  605. font-weight: 300;
  606. color: #222222;
  607. }
  608. .tag {
  609. position: absolute;
  610. top: -20rpx;
  611. left: 50%;
  612. background: #FF0615;
  613. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
  614. border-radius: 14rpx 14rpx 14rpx 0rpx;
  615. color: #fff;
  616. white-space: nowrap;
  617. font-size: 18rpx;
  618. line-height: 24rpx;
  619. height: 24rpx;
  620. padding: 0 10rpx;
  621. // width: fit-content;
  622. // background-size: 100% 34rpx;
  623. }
  624. .desc {
  625. color: #FF0817;
  626. font-size: 16rpx;
  627. text-align: center;
  628. margin-top: 4rpx;
  629. }
  630. }
  631. }
  632. .title-img {
  633. width: 686rpx;
  634. height: 166rpx;
  635. margin: 24rpx 32rpx;
  636. }
  637. .swiper-box{
  638. position: relative;
  639. width: 344rpx;
  640. height: 462rpx;
  641. border-radius: 16rpx;
  642. margin-bottom: 20rpx;
  643. .progress{
  644. position: absolute;
  645. top: 38rpx;
  646. right: 20rpx;
  647. z-index: 2;
  648. color: #FFFFFF;
  649. font-size: 16rpx;
  650. background: rgba(255, 255, 255, 0.3);
  651. padding: 2rpx 10rpx;
  652. border-radius: 14rpx;
  653. }
  654. .swiper {
  655. position: relative;
  656. height: 100%;
  657. .swiper-item {
  658. width: 344rpx;
  659. height: 462rpx;
  660. border-radius: 16rpx;
  661. object-fit: cover;
  662. }
  663. }
  664. }
  665. .advertise-box {
  666. display: flex;
  667. justify-content: space-between;
  668. margin: 0 24rpx;
  669. padding: 20rpx 0;
  670. }
  671. .content {
  672. border-radius: 16rpx 16rpx 0 0;
  673. }
  674. .zs-list {
  675. display: flex;
  676. flex-wrap: wrap;
  677. justify-content: space-between;
  678. padding: 0 24rpx;
  679. .left {
  680. .adv-swiper{
  681. width: 340rpx;
  682. height: 444rpx;
  683. margin-bottom: 25rpx;
  684. .adv-item{
  685. width: 340rpx;
  686. height: 444rpx;
  687. }
  688. }
  689. }
  690. .ad{
  691. width: 340rpx;
  692. border-radius: 16rpx;
  693. }
  694. .store-item {
  695. width: 344rpx;
  696. margin-bottom: 20rpx;
  697. // box-shadow: 0rpx 0rpx 24rpx 2rpx rgba(0, 0, 0, 0.08);
  698. border-radius: 16rpx;
  699. background: #fff;
  700. .icon {
  701. width: 100%;
  702. height: 300rpx;
  703. border-radius: 16rpx 16rpx 0 0;
  704. }
  705. .info{
  706. flex: 1;
  707. padding: 16rpx;
  708. position: relative;
  709. .title{
  710. margin-top: 10rpx;
  711. display: flex;
  712. align-items: center;
  713. .tag{
  714. display: inline-block;
  715. text-align: center;
  716. font-size: 20rpx;
  717. color: #FFFFFF;
  718. background: $uni-color-primary;
  719. padding: 2rpx 10rpx;
  720. border-radius: 8rpx;
  721. }
  722. .text{
  723. font-size: 28rpx;
  724. font-weight: bold;
  725. flex: 1;
  726. white-space: nowrap;
  727. overflow: hidden;
  728. text-overflow: ellipsis;
  729. }
  730. }
  731. .desc{
  732. font-size: 24rpx;
  733. color: #AAAAAA;
  734. overflow: hidden;
  735. text-overflow: ellipsis;
  736. /* 弹性伸缩盒子模型显示 */
  737. display: -webkit-box;
  738. /* 限制在一个块元素显示的文本的行数 */
  739. -webkit-line-clamp: 2;
  740. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  741. -webkit-box-orient: vertical;
  742. margin-top: 12rpx;
  743. }
  744. .discount-tag{
  745. display: inline-block;
  746. padding: 0 10rpx;
  747. font-size: 20rpx;
  748. color: #EE4320;
  749. line-height: 28rpx;
  750. background: #FFF6F5;
  751. border-radius: 8rpx 8rpx 8rpx 8rpx;
  752. margin-top: 10rpx;
  753. }
  754. .price-box{
  755. display: flex;
  756. justify-content: space-between;
  757. align-items: center;
  758. margin-top: 12rpx;
  759. .left{
  760. display: flex;
  761. align-items: flex-end;
  762. .unit{
  763. font-size: 20rpx;
  764. color: $uni-color-primary;
  765. font-weight: bold;
  766. }
  767. .price{
  768. font-size: 32rpx;
  769. color: $uni-color-primary;
  770. font-weight: bold;
  771. }
  772. .old-price{
  773. font-size: 20rpx;
  774. color: #AAAAAA;
  775. text-decoration: line-through;
  776. margin-left: 12rpx;
  777. }
  778. }
  779. .right{
  780. font-size: 24rpx;
  781. color: #AAAAAA;
  782. }
  783. }
  784. }
  785. }
  786. }
  787. }
  788. }
  789. </style>