select-shop.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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.$emit('stationData', item)
  64. uni.navigateBack({
  65. delta: 1
  66. });
  67. },
  68. },
  69. }
  70. </script>
  71. <style scoped lang="scss">
  72. .select-site-box {
  73. .box-right {
  74. border-left: 2rpx solid #eee;
  75. display: flex;
  76. align-items: center;
  77. box-sizing: border-box;
  78. padding-left: 42rpx;
  79. }
  80. .w292 {
  81. width: 292rpx;
  82. }
  83. .list-item {
  84. width: 100%;
  85. min-height: 162rpx;
  86. background: #FFFFFF;
  87. border-radius: 20rpx 20rpx 20rpx 20rpx;
  88. margin-bottom: 20rpx;
  89. box-sizing: border-box;
  90. padding: 24rpx 32rpx 20rpx 80rpx;
  91. position: relative;
  92. display: flex;
  93. .jlzj-box {
  94. width: 118rpx;
  95. height: 44rpx;
  96. position: absolute;
  97. right: 0rpx;
  98. top: -1rpx;
  99. }
  100. .img-1 {
  101. width: 80rpx;
  102. height: 80rpx;
  103. border-radius: 8rpx;
  104. margin-right: 20rpx;
  105. }
  106. .w-490 {
  107. width: 490rpx;
  108. }
  109. .list-item-s {
  110. position: absolute;
  111. left: 24rpx;
  112. top: 45%;
  113. image {
  114. width: 32rpx;
  115. height: 32rpx;
  116. }
  117. }
  118. }
  119. .s-b {
  120. border: 2rpx solid #41ABF5;
  121. }
  122. }
  123. </style>