select-site.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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" :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 {getExpressSite} from '@/api/express.js';
  23. export default {
  24. data(){
  25. return{
  26. site_id:'',
  27. list:[],
  28. }
  29. },
  30. onLoad(e) {
  31. this.site_id = Number(e.site_id);
  32. this.getExpressSite();
  33. },
  34. methods:{
  35. getExpressSite(){
  36. let school_id = uni.getStorageSync('school_id');
  37. getExpressSite({school_id:school_id}).then((res)=>{
  38. if(res.code === 1){
  39. this.list = res.data
  40. }
  41. })
  42. },
  43. selectFun(item){
  44. this.site_id = item.site_id;
  45. uni.setStorageSync('site_id',item.site_id)
  46. uni.setStorageSync('site_name',item.name)
  47. uni.setStorageSync('site_address', item.city_name + item.address)
  48. uni.setStorageSync('site_logo', item.logo)
  49. uni.reLaunch({
  50. url:'/pages-takeout/replace-take'
  51. })
  52. },
  53. },
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .select-site-box{
  58. .list-item{
  59. width: 100%;
  60. min-height: 162rpx;
  61. background: #FFFFFF;
  62. border-radius: 20rpx 20rpx 20rpx 20rpx;
  63. margin-bottom: 20rpx;
  64. box-sizing: border-box;
  65. padding: 24rpx 32rpx 20rpx 80rpx;
  66. position: relative;
  67. display: flex;
  68. .img-1{
  69. width: 80rpx;
  70. height: 80rpx;
  71. border-radius: 8rpx;
  72. margin-right: 20rpx;
  73. }
  74. .w-490{
  75. width: 490rpx;
  76. }
  77. .list-item-s{
  78. position: absolute;
  79. left: 24rpx;
  80. top: 45%;
  81. image{
  82. width: 32rpx;
  83. height: 32rpx;
  84. }
  85. }
  86. }
  87. .s-b{
  88. border: 2rpx solid #41ABF5;
  89. }
  90. }
  91. </style>