shopDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <template>
  2. <view class="shopDetail">
  3. <view class="top-box">
  4. <image class="bg" :src="info.src||'../../static/jiayou.png'" mode="aspectFill"></image>
  5. <view class="shop-info">
  6. <view class="title">
  7. {{info.title}}
  8. </view>
  9. <view class="address">
  10. <image class="position" src="../../static/position.png" mode=""></image>
  11. {{info.address || 'xxxxx地址'}}·距你{{info.distance}}km
  12. </view>
  13. </view>
  14. </view>
  15. <view class="content">
  16. <view class="discounts">
  17. <view class="title">
  18. 全场优惠
  19. </view>
  20. <view class="discounts-item">
  21. <view class="info">
  22. <view class="title">
  23. 满200享 <text class="red">7</text> 折
  24. </view>
  25. <view class="time">
  26. 有效期至2023-10-27
  27. </view>
  28. </view>
  29. <view class="btn-box">
  30. <view class="num">
  31. 剩余 1 次
  32. </view>
  33. <view class="btn" @click="jump">
  34. 去使用
  35. </view>
  36. </view>
  37. </view>
  38. <view class="discounts-item">
  39. <view class="info">
  40. <view class="title">
  41. 满200享 <text class="red">7</text> 折
  42. </view>
  43. <view class="time">
  44. 有效期至2023-10-27
  45. </view>
  46. </view>
  47. <view class="btn-box">
  48. <view class="num">
  49. 剩余 1 次
  50. </view>
  51. <view class="btn" @click="jump">
  52. 去使用
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="hot-title">
  59. <image class="icon" src="../../static/hot.png" mode=""></image>
  60. <view class="title">
  61. 热门推荐
  62. </view>
  63. <image class="icon" src="../../static/hot.png" mode=""></image>
  64. </view>
  65. <!-- 列表 -->
  66. <zs-list class="store-box" mt="0" @load="loadMore" :status="status">
  67. <view class="left">
  68. <view class="left-frist">
  69. <view class="top-box">
  70. <view class="title">
  71. 天天低价
  72. </view>
  73. <view class="type-box">
  74. <image class="hot" src="../../static/hot-white.png" mode=""></image>
  75. <view class="type">
  76. 今日超低价
  77. </view>
  78. </view>
  79. </view>
  80. <view class="image-box">
  81. <image class="image" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F45f7efd9-3760-4fa0-8cf0-79ca4b44d017%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695803683&t=09678f8c997578d3e8101dd2b0a597e8" mode=""></image>
  82. <view class="btn-box">
  83. <view class="btn">
  84. </view>
  85. <view class="desc">
  86. 满200享7折
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="store-item" v-for="(item,index) in list" :key="index" @click="goShopDetail(item)">
  92. <zs-img :src="item.src" width="335rpx" mode="widthFix" ></zs-img>
  93. <view class="info">
  94. <view class="title">
  95. {{item.title}}
  96. </view>
  97. <view class="address">
  98. <image class="position" src="../../static/position.png" mode=""></image>
  99. {{item.distance}}km
  100. </view>
  101. <image v-if="index==0" class="hot-icon" src="../../static/hot1.png" mode=""></image>
  102. </view>
  103. </view>
  104. </view>
  105. <view class="right">
  106. <view class="store-item frist" @click="goShopDetail(list1[0])">
  107. <zs-img :src="list1[0].src" width="335rpx" mode="widthFix" ></zs-img>
  108. <view class="info">
  109. <view class="title">
  110. {{list1[0].title}}
  111. </view>
  112. <view class="tags">
  113. <view class="tag-item">
  114. <view class="label">
  115. </view>
  116. <view class="value">
  117. 满200享8折
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <view v-if="index!=0" class="store-item" v-for="(item,index) in list1" :key="index" @click="goShopDetail(item)">
  124. <zs-img :src="item.src" width="335rpx" mode="widthFix" ></zs-img>
  125. <view class="info">
  126. <view class="title">
  127. {{item.title}}
  128. </view>
  129. <view class="address">
  130. <image class="position" src="../../static/position.png" mode=""></image>
  131. {{item.distance}}km
  132. </view>
  133. </view>
  134. </view>
  135. </view>
  136. </zs-list>
  137. </view>
  138. </template>
  139. <script>
  140. export default {
  141. data() {
  142. return {
  143. info: null,
  144. status: 'more',
  145. list: [{
  146. src: 'https://mstatic.gzstv.com/media/images/2021/06/09/w1nrZC8_x-PQ.jpg',
  147. title: '万安加油站(中石化)',
  148. distance: 13.62
  149. },
  150. {
  151. src: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fss2.meipian.me%2Fusers%2F159660028%2Fb327e4a2a3e1473a82e2a53b5a5d2db2.jpeg%3Fmeipian-raw%2Fbucket%2Fivwen%2Fkey%2FdXNlcnMvMTU5NjYwMDI4L2IzMjdlNGEyYTNlMTQ3M2E4MmUyYTUzYjVhNWQyZGIyLmpwZWc%3D%2Fsign%2Fcec9ce1dfb5e0c3e627e30fb099899da.jpg&refer=http%3A%2F%2Fss2.meipian.me&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1693560973&t=7b7dfb1cbf6a6759e70f868c894888c9',
  152. title: '万安加油站(中石化)',
  153. distance: 13.62
  154. },
  155. {
  156. id: 2,
  157. src:'https://img2.baidu.com/it/u=242243300,1128843585&fm=253&fmt=auto&app=138&f=JPEG?w=696&h=500',
  158. title: '泊斯曼酒店',
  159. distance: 5.23,
  160. },
  161. {
  162. id: 3,
  163. src:'https://img-md.veimg.cn/meadinindex/img5/2021/11/69F51D249ADA446EB5507352AA4ABD6E.jpg',
  164. title: '贵阳万丽酒店',
  165. distance: 5.23,
  166. },
  167. ],
  168. list1: [
  169. {
  170. id: 3,
  171. src:'https://alipic.lanhuapp.com/XDSlicePNGMAX7ded25d105ed4479be2eb747ddcbdb05808ff36bf272aad1d9717f0a2fb26d06.png',
  172. title: '黄果树瀑布',
  173. distance: 5.23,
  174. },
  175. {
  176. id: 3,
  177. src:'https://alipic.lanhuapp.com/XDSlicePNGMAXdb1c28750d2e8f45e7509c176f186600d2bafe09de15a8107b168c078801e1e7.png',
  178. title: '微笑牙科诊所',
  179. distance: 5.23,
  180. },
  181. {
  182. id: 2,
  183. src:'https://img2.baidu.com/it/u=242243300,1128843585&fm=253&fmt=auto&app=138&f=JPEG?w=696&h=500',
  184. title: '泊斯曼酒店',
  185. distance: 5.23,
  186. },
  187. {
  188. id: 3,
  189. src:'https://img-md.veimg.cn/meadinindex/img5/2021/11/69F51D249ADA446EB5507352AA4ABD6E.jpg',
  190. title: '贵阳万丽酒店',
  191. distance: 5.23,
  192. },
  193. ]
  194. };
  195. },
  196. onLoad() {
  197. this.info = JSON.parse(uni.getStorageSync('shopInfo'))
  198. },
  199. methods: {
  200. jump() {
  201. uni.navigateTo({
  202. url: '../qrcode/index'
  203. })
  204. },
  205. goShopDetail(item) {
  206. uni.setStorageSync('shopInfo', JSON.stringify(item))
  207. uni.navigateTo({
  208. url: `../../detail/shopDetail/shopDetail`
  209. })
  210. },
  211. loadMore(){
  212. // this.status = 'loading'
  213. // setTimeout(() => {
  214. // this.status = 'more'
  215. // this.list = this.list.concat([{
  216. // src: 'https://img1.baidu.com/it/u=384382004,2638328762&fm=253&fmt=auto&app=138&f=JPEG?w=667&h=500',
  217. // title: '万安加油站(中石化)',
  218. // distance: 13.62
  219. // }, {
  220. // src: 'https://img1.baidu.com/it/u=1281595595,1208289696&fm=253&fmt=auto&app=138&f=JPEG?w=667&h=500',
  221. // title: '万安加油站(中石化)',
  222. // distance: 13.62
  223. // }])
  224. // }, 1000)
  225. }
  226. },
  227. }
  228. </script>
  229. <style lang="scss">
  230. .shopDetail {
  231. background: rgb(239, 239, 239);
  232. min-height: 100vh;
  233. .top-box{
  234. background: linear-gradient(180deg, #FFDEDE 0%, #FFFCFC 100%);
  235. .bg {
  236. width: calc(100% - 60rpx);
  237. margin: 0 30rpx;
  238. height: 350rpx;
  239. object-fit: cover;
  240. border-radius: 16rpx;
  241. }
  242. .shop-info {
  243. padding: 30rpx;
  244. box-sizing: border-box;
  245. .title {
  246. font-size: 32rpx;
  247. font-weight: bold;
  248. }
  249. .address {
  250. display: flex;
  251. align-items: center;
  252. font-size: 24rpx;
  253. padding: 15rpx 0;
  254. color: #999;
  255. .position{
  256. width: 25rpx;
  257. height: 29rpx;
  258. margin-right: 8rpx;
  259. }
  260. }
  261. }
  262. }
  263. .content {
  264. padding: 0 30rpx;
  265. .discounts {
  266. padding: 30rpx;
  267. background: #fff;
  268. border-radius: 8px;
  269. margin-top: 20rpx;
  270. .title {
  271. font-weight: bold;
  272. font-size: 28rpx;
  273. }
  274. .discounts-item {
  275. display: flex;
  276. align-items: center;
  277. justify-content: space-between;
  278. background-color: rgb(239, 239, 239);
  279. background: url('../../static/card.png') no-repeat;
  280. background-size: 100% 144rpx;
  281. border-radius: 16rpx;
  282. height: 144rpx;
  283. padding: 0 30rpx;
  284. margin-top: 20rpx;
  285. .info {
  286. margin-left: 20rpx;
  287. .title {
  288. color: #0F0F0F;
  289. font-size: 30rpx;
  290. }
  291. .red{
  292. color: $uni-text-primary!important;
  293. }
  294. .time {
  295. color: #9a9a9a;
  296. font-size: 24rpx;
  297. margin-top: 15rpx;
  298. }
  299. }
  300. .btn-box{
  301. display: flex;
  302. flex-direction: column;
  303. align-items: center;
  304. .btn {
  305. width: 118rpx;
  306. height: 48rpx;
  307. line-height: 48rpx;
  308. text-align: center;
  309. font-size: 24rpx;
  310. background: linear-gradient(90deg, #FEFBF2 0%, #F7D188 100%);
  311. border-radius: 35rpx;
  312. color: #E5452C;
  313. margin-top: 15rpx;
  314. }
  315. .num{
  316. color: #fff;
  317. font-size: 24rpx;
  318. }
  319. }
  320. }
  321. }
  322. }
  323. .hot-title{
  324. display: flex;
  325. justify-content: center;
  326. align-items: center;
  327. margin: 20rpx 0;
  328. .icon{
  329. width: 29rpx;
  330. height: 35rpx;
  331. }
  332. .title{
  333. font-size: 32rpx;
  334. color: #0F0F0F;
  335. font-weight: bold;
  336. padding: 0 10rpx;
  337. }
  338. }
  339. .zs-list {
  340. display: flex;
  341. flex-wrap: wrap;
  342. justify-content: space-between;
  343. padding: 0 30rpx;
  344. .left{
  345. .left-frist{
  346. padding: 15rpx;
  347. border-radius: 16rpx;
  348. width: 332rpx;
  349. height: 284rpx;
  350. box-sizing: border-box;
  351. background: linear-gradient(180deg, #FFDEDE 0%, #FFFFFF 100%);
  352. box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0,0,0,0.16);
  353. margin-bottom: 25rpx;
  354. .top-box{
  355. display: flex;
  356. align-items: center;
  357. justify-content: space-between;
  358. .title{
  359. color: #0F0F0F;
  360. font-size: 26rpx;
  361. }
  362. .type-box{
  363. display: flex;
  364. align-items: center;
  365. padding: 0 16rpx;
  366. height: 40rpx;
  367. line-height: 40rpx;
  368. border-radius: 20rpx;
  369. background: linear-gradient(90deg, #FE574C 0%, #FE2A5C 100%);
  370. .hot{
  371. width: 16.7rpx;
  372. height: 21.7rpx;
  373. }
  374. .type{
  375. font-size: 20rpx;
  376. font-weight: 400;
  377. color: #FFFFFF;
  378. margin-left: 6rpx;
  379. }
  380. }
  381. }
  382. .image-box{
  383. position: relative;
  384. margin-top: 20rpx;
  385. .image{
  386. width: 302rpx;
  387. height: 182rpx;
  388. border-radius: 16rpx;
  389. }
  390. .btn-box{
  391. position: absolute;
  392. left: 0;
  393. bottom: 10rpx;
  394. display: flex;
  395. align-items: center;
  396. .desc{
  397. font-size: 24rpx;
  398. font-weight: 400;
  399. color: #FFFFFF;
  400. margin-left: 10rpx;
  401. }
  402. .btn{
  403. height: 36rpx;
  404. line-height: 36rpx;
  405. padding: 0 14rpx;
  406. background: $uni-color-primary;
  407. border-radius: 8rpx;
  408. color: #FFFFFF;
  409. font-size: 20rpx;
  410. }
  411. }
  412. }
  413. }
  414. }
  415. .right{
  416. .frist{
  417. border: 1px solid #FF612E;
  418. .info{
  419. background: #FF612E;
  420. color: #fff;
  421. .address{
  422. color: #fff;
  423. }
  424. }
  425. }
  426. }
  427. .store-item {
  428. width: 335rpx;
  429. margin-bottom: 25rpx;
  430. box-shadow: 0rpx 0rpx 24rpx 2rpx rgba(0, 0, 0, 0.08);
  431. border-radius: 16rpx;
  432. background: #fff;
  433. .icon {
  434. width: 100%;
  435. height: 300rpx;
  436. border-radius: 16rpx 16rpx 0 0;
  437. }
  438. .info {
  439. padding: 20rpx;
  440. background: #fff;
  441. border-radius: 0 0 16rpx 16rpx;
  442. position: relative;
  443. .hot-icon{
  444. position: absolute;
  445. bottom: 20rpx;
  446. right: 25rpx;
  447. width: 44.6rpx;
  448. height: 48.6rpx;
  449. }
  450. .title {
  451. font-weight: bold;
  452. width: 100%;
  453. white-space: nowrap;
  454. text-overflow: ellipsis;
  455. overflow: hidden;
  456. }
  457. .tags{
  458. display: flex;
  459. align-items: center;
  460. .tag-item{
  461. line-height: 50rpx;
  462. border-radius: 8rpx;
  463. padding: 6rpx 0;
  464. font-size: 24rpx;
  465. margin-left: 10rpx;
  466. display: flex;
  467. .label{
  468. background: #FFF;
  469. color: #FE5B47;
  470. padding: 0 10rpx;
  471. border-radius: 8rpx 0 0 8rpx;
  472. }
  473. .value{
  474. color: #FFF;
  475. background: rgba(255, 255, 255, .2);
  476. padding: 0 14rpx;
  477. border-radius: 0 8rpx 8rpx 0;
  478. }
  479. }
  480. }
  481. .address {
  482. display: flex;
  483. align-items: center;
  484. margin-top: 15rpx;
  485. color: #999;
  486. .position{
  487. width: 25rpx;
  488. height: 29rpx;
  489. margin-right: 8rpx;
  490. }
  491. }
  492. }
  493. }
  494. }
  495. }
  496. </style>