CheckoutAddress.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="div container" @click="onclick">
  3. <view class="div top-wrapper">
  4. <view class="selected-wrapper" v-if="hasAddress">
  5. <view class="div line">
  6. <text class="i icon iconfont">&#xe6d3;</text>
  7. <view class="div line-content">
  8. <view class="div title-wrapper">
  9. <label class="title">{{item.address_realname}}</label>
  10. <label class="title" style="margin-left:1rem;">{{item.address_mob_phone}}</label>
  11. <label class="default" v-if="isDefault">默认</label>
  12. </view>
  13. <view class="div desc address-text">{{item.area_info}}{{item.address_detail}}</view>
  14. <view class="div desc address-text-cityerror" v-if="item.cityerror">门店已失效,请重新编辑收货地址</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view v-else class="div unselected-wrapper">
  19. <label class="desc">您还没有收货地址,点击这里添加。</label>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import flexLine from '../../../flexLine'
  26. export default {
  27. props: ['item'],
  28. created: function () {
  29. },
  30. components: { flexLine },
  31. computed: {
  32. hasAddress () {
  33. if (this.item) {
  34. return true
  35. }
  36. this.onclick()
  37. return false
  38. },
  39. isDefault () {
  40. if (this.item && this.item.is_default) {
  41. return true
  42. }
  43. return false
  44. }
  45. },
  46. methods: {
  47. onclick () {
  48. this.$emit('onclick')
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .container {
  55. background-color: #fff;
  56. }
  57. .line{display: flex;
  58. .line-content{flex:1}
  59. }
  60. .top-wrapper {
  61. background-color: #fff;
  62. }
  63. .title-wrapper {
  64. height: 1rem;
  65. display: flex;
  66. flex-direction: row;
  67. justify-content: flex-start;
  68. align-items: center;
  69. }
  70. .icon {
  71. font-size:$h1;
  72. margin-right: .2rem;
  73. color:$primaryColor
  74. }
  75. .title {
  76. font-size:$h3;
  77. color: #333;
  78. font-weight: 700;
  79. }
  80. .default {
  81. width: 1.4rem;
  82. margin-left: 0.5rem;
  83. margin-right: 0.5rem;
  84. border: 1px solid $primaryColor;
  85. color: $primaryColor;
  86. font-size:$h6;
  87. text-align: center;
  88. border-radius: 0.1rem;
  89. }
  90. .desc {
  91. color: $descTextColor;
  92. font-size:$subFontSize;
  93. }
  94. .address-text {
  95. margin-top: .3rem;
  96. font-weight: normal;
  97. }
  98. .address-text-cityerror{
  99. margin-top: .3rem;
  100. font-weight: normal;
  101. color: #ff4040;
  102. }
  103. .selected-wrapper{
  104. padding:1rem 0;
  105. border-bottom: 1px dashed #eee;
  106. }
  107. .unselected-wrapper {
  108. flex: 1;
  109. display: flex;
  110. flex-direction: column;
  111. justify-content: center;
  112. align-items: center;
  113. padding:2rem 0;
  114. }
  115. .indicator {
  116. height: 0.6rem;
  117. margin-left: 0.5rem;
  118. margin-right: $pageSpace;
  119. }
  120. .line-wrapper {
  121. background:#eee;
  122. // position: relative;
  123. left: 0;
  124. right: 0;
  125. bottom: 0;
  126. width: 100%;
  127. height: 0.1rem;
  128. }
  129. </style>