select-shop.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="select-site-box iPhone-bottom flex-common-css box-border-box">
  3. <Nav title='选择站点'></Nav>
  4. <scroll-view class="scroll-view-css box-border-box p-24" scroll-y="true">
  5. <view class="list-item" :class="id == item.id?'s-b':''" v-for="(item,i) in list" :key="i"
  6. @click="selectFun(item)">
  7. <image v-if="true" class="jlzj-box" src="@/static/img/buy/jlzj.png" mode=""></image>
  8. <view class="align-items-center mr-18">
  9. <view class="list-item-s">
  10. <image v-if="id == item.id" src="@/static/img/common/y-select.png" mode=""></image>
  11. <image v-else src="@/static/img/common/n-select.png" mode=""></image>
  12. </view>
  13. <image class="img-1" :src="item.logo" mode="scaleToFill"></image>
  14. <view class="w292">
  15. <view class="fs-32 fw-600 fc-0">{{item.name}}</view>
  16. <view class="fs-26 fw-400 fc-9">{{item.city_name}}{{item.address}}</view>
  17. </view>
  18. </view>
  19. <view class="box-right text-align-center">
  20. <view class="">
  21. <view class="fs-28 mb-12">去下单</view>
  22. <view class="fs-26 fc-9">距您你{{item.distance}}km</view>
  23. </view>
  24. </view>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. laundrySite
  32. } from '@/api/laundry.js';
  33. import tools from "@/service/tools";
  34. export default {
  35. data() {
  36. return {
  37. id: '',
  38. list: [],
  39. }
  40. },
  41. onLoad(e) {
  42. if (e.id) {
  43. this.id = Number(e.id);
  44. }
  45. this.getList();
  46. },
  47. methods: {
  48. getList() {
  49. let obj = {
  50. school_id: uni.getStorageSync('school_id'),
  51. lon: uni.getStorageSync('lon'),
  52. lat: uni.getStorageSync('lat'),
  53. }
  54. laundrySite(obj).then((res) => {
  55. if (res.code === 1) {
  56. this.list = res.data;
  57. }
  58. })
  59. },
  60. selectFun(item) {
  61. let obj = JSON.stringify(item);
  62. this.id = item.id;
  63. uni.reLaunch({
  64. url: '/pages-buy/dry-clean?data=' + encodeURIComponent(obj)
  65. })
  66. },
  67. },
  68. }
  69. </script>
  70. <style scoped lang="scss">
  71. .select-site-box {
  72. .box-right {
  73. border-left: 2rpx solid #eee;
  74. display: flex;
  75. align-items: center;
  76. box-sizing: border-box;
  77. padding-left: 42rpx;
  78. }
  79. .w292 {
  80. width: 292rpx;
  81. }
  82. .list-item {
  83. width: 100%;
  84. min-height: 162rpx;
  85. background: #FFFFFF;
  86. border-radius: 20rpx 20rpx 20rpx 20rpx;
  87. margin-bottom: 20rpx;
  88. box-sizing: border-box;
  89. padding: 24rpx 32rpx 20rpx 80rpx;
  90. position: relative;
  91. display: flex;
  92. .jlzj-box {
  93. width: 118rpx;
  94. height: 44rpx;
  95. position: absolute;
  96. right: 0rpx;
  97. top: -1rpx;
  98. }
  99. .img-1 {
  100. width: 80rpx;
  101. height: 80rpx;
  102. border-radius: 8rpx;
  103. margin-right: 20rpx;
  104. }
  105. .w-490 {
  106. width: 490rpx;
  107. }
  108. .list-item-s {
  109. position: absolute;
  110. left: 24rpx;
  111. top: 45%;
  112. image {
  113. width: 32rpx;
  114. height: 32rpx;
  115. }
  116. }
  117. }
  118. .s-b {
  119. border: 2rpx solid #41ABF5;
  120. }
  121. }
  122. </style>