select-site.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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" @scrolltolower="scrolltolower">
  5. <view class="list-item align-items-center" :class="site_id == item.site_id?'s-b':''"
  6. v-for="(item,i) in list" :key="i" @click="selectFun(item)">
  7. <view class="list-item-s">
  8. <image v-if="site_id == item.site_id" src="@/static/img/common/y-select.png" mode=""></image>
  9. <image v-else src="@/static/img/common/n-select.png" mode=""></image>
  10. </view>
  11. <image class="img-1" :src="item.logo" mode="aspectFill"></image>
  12. <view class="w-490">
  13. <view class="fs-32 fw-600 fc-0">{{item.name}}</view>
  14. <view class="fs-26 fw-400 fc-9">{{item.city_name}} {{item.address}}</view>
  15. </view>
  16. </view>
  17. </scroll-view>
  18. </view>
  19. </template>
  20. <script>
  21. import tools from "@/service/tools";
  22. import {
  23. getExpressSite
  24. } from '@/api/express.js';
  25. export default {
  26. data() {
  27. return {
  28. site_id: '',
  29. list: [],
  30. }
  31. },
  32. onLoad(e) {
  33. this.site_id = Number(e.site_id);
  34. this.getExpressSite();
  35. },
  36. methods: {
  37. getExpressSite() {
  38. let school_id = uni.getStorageSync('school_id');
  39. getExpressSite({
  40. school_id: school_id
  41. }).then((res) => {
  42. if (res.code === 1) {
  43. this.list = res.data
  44. }
  45. })
  46. },
  47. selectFun(item) {
  48. this.site_id = item.site_id;
  49. uni.setStorageSync('site_id', item.site_id)
  50. uni.setStorageSync('site_name', item.name)
  51. uni.setStorageSync('site_address', item.city_name + item.address)
  52. uni.setStorageSync('site_logo', item.logo)
  53. tools.leftClick()
  54. // uni.reLaunch({
  55. // url: '/pages-takeout/replace-take'
  56. // })
  57. },
  58. },
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .select-site-box {
  63. .list-item {
  64. width: 100%;
  65. min-height: 162rpx;
  66. background: #FFFFFF;
  67. border-radius: 20rpx 20rpx 20rpx 20rpx;
  68. margin-bottom: 20rpx;
  69. box-sizing: border-box;
  70. padding: 24rpx 32rpx 20rpx 80rpx;
  71. position: relative;
  72. .img-1 {
  73. width: 80rpx;
  74. height: 80rpx;
  75. border-radius: 8rpx;
  76. margin-right: 20rpx;
  77. }
  78. .w-490 {
  79. width: 490rpx;
  80. }
  81. .list-item-s {
  82. position: absolute;
  83. left: 24rpx;
  84. top: 45%;
  85. image {
  86. width: 32rpx;
  87. height: 32rpx;
  88. }
  89. }
  90. }
  91. .s-b {
  92. border: 2rpx solid #41ABF5;
  93. }
  94. }
  95. </style>