address.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="address-index flex-common-css box-border-box iPhone-bottom">
  3. <Nav title="地址管理"></Nav>
  4. <view v-if="list.length === 0" class="scroll-view-css">
  5. <EnBlank :customSrc='true'>
  6. <template v-slot:blankImg>
  7. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  8. </template>
  9. </EnBlank>
  10. </view>
  11. <view v-else class="scroll-view-css box-border-box p-24">
  12. <view class="list-box box-border-box p-24" v-for="(item,i) in list" :key="i" @click.stop="to(1,item)">
  13. <view class=" mb-8 display-flex">
  14. <view class="fs-34 fw-500 mr-10 w-556">
  15. <span v-if="item.is_default == 1" class="list-box-only fs-24 fc-FF7F00 text-align-center">默认</span>
  16. {{item.school_name}}{{item.dorm_name}}{{item.address}}
  17. </view>
  18. </view>
  19. <view class="w-520 fs-26 fc-9 align-items-center">
  20. <view class="fs-24 fc-9 mr-24">{{item.consignee}}</view>
  21. <view class="fs-24 fc-9">{{item.phone}}</view>
  22. </view>
  23. <image src="@/static/img/common/edit.png" mode=""></image>
  24. </view>
  25. </view>
  26. <view class="box-border-box p-24 bgc-f" @click="to(2)">
  27. <view class="add-box text-align-center fs-34 fc-f">新增地址</view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import {getAddressList} from '@/api/member.js'
  33. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  34. import tools from "@/service/tools.js";
  35. export default {
  36. components:{EnBlank,},
  37. data(){
  38. return{
  39. list:[],
  40. }
  41. },
  42. onShow() {
  43. this.list = [];
  44. this.getList();
  45. },
  46. methods:{
  47. getList(){
  48. getAddressList().then((res)=>{
  49. if(res.code === 1){
  50. this.list = res.data;
  51. }
  52. })
  53. },
  54. to(type,item){
  55. if(type === 1){
  56. uni.navigateTo({
  57. url:"pages-address/edit-add?id=" + item.id
  58. })
  59. }else{
  60. uni.navigateTo({
  61. url:"pages-address/edit-add"
  62. })
  63. }
  64. },
  65. },
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .address-index{
  70. .w-556{
  71. width: 556rpx;
  72. }
  73. .w-520{
  74. width: 570rpx;
  75. }
  76. .add-box{
  77. width: 100%;
  78. height: 80rpx;
  79. line-height: 80rpx;
  80. background-color: #2F80ED;
  81. border-radius: 200rpx;
  82. }
  83. .list-box{
  84. background: #FFFFFF;
  85. border-radius: 20rpx;
  86. margin-bottom: 24rpx;
  87. position: relative;
  88. image{
  89. width: 48rpx;
  90. height: 48rpx;
  91. position: absolute;
  92. top: 42rpx;
  93. right: 40rpx;
  94. }
  95. .del-icon{
  96. position: absolute;
  97. top: 45rpx;
  98. right: 0;
  99. }
  100. .list-box-only{
  101. padding: 0 8rpx;
  102. height: 34rpx;
  103. line-height: 34rpx;
  104. border-radius: 8rpx;
  105. border: 2rpx solid #FE9E11;
  106. margin-right: 8rpx;
  107. }
  108. }
  109. }
  110. </style>