index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="shop-list">
  3. <view class="item" v-for="item in list" :key="item.shopVo.shopId" @click="jump('/detail/shopDetail/shopDetail',item)">
  4. <view class="info">
  5. <view class="shop-name">
  6. {{item.shopVo.shopName}}
  7. </view>
  8. <view class="address">
  9. {{item.address}} {{(item.shopVo.distance/1000).toFixed(2)}} km
  10. </view>
  11. </view>
  12. <image class="icon" src="../../static/shop-desc.png" mode=""></image>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. list: []
  21. }
  22. },
  23. methods: {
  24. jump(url,item) {
  25. let shopInfo = {
  26. shopId:item.shopVo.shopId,
  27. shopName:item.shopVo.shopName,
  28. detailContent:item.detailContent,
  29. logoPath:item.logoPath,
  30. }
  31. uni.setStorageSync('shopInfo',JSON.stringify(shopInfo))
  32. uni.navigateTo({
  33. url
  34. })
  35. },
  36. },
  37. onLoad() {
  38. this.list = JSON.parse(uni.getStorageSync('shopList'))
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .shop-list{
  44. background: #F9F9F9;
  45. min-height: 100vh;
  46. padding: 20rpx 24rpx;
  47. .item{
  48. padding: 24rpx;
  49. background: #fff;
  50. display: flex;
  51. align-items: center;
  52. justify-content: space-between;
  53. margin-bottom: 20rpx;
  54. .info{
  55. .shop-name{
  56. font-size: 28rpx;
  57. color: #222222;
  58. }
  59. .address{
  60. font-size: 24rpx;
  61. color: #AAAAAA;
  62. margin-top: 16rpx;
  63. }
  64. }
  65. .icon{
  66. width: 48rpx;
  67. height: 48rpx;
  68. transform: rotate(-90deg);
  69. }
  70. }
  71. }
  72. </style>