choiceAddress.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template name="address">
  2. <view class="address-template clearfix">
  3. <!-- 地址 -->
  4. <navigator :url="addressSrc" class="address-section">
  5. <view class="address-empty" v-if="isEmpty">
  6. <text>添加收货地址</text><text class="iconfont icon-tianjiadizhi"></text>
  7. </view>
  8. <view class="address-content" v-else>
  9. <view class="address-cen">
  10. <view class="top">
  11. <view class="name">{{addressData.name !== undefined ? addressData.name : ''}}</view>
  12. <view class="mobile">{{addressData.phoneNumber !== undefined ? addressData.phoneNumber : ''}}</view>
  13. </view>
  14. <view class="address">
  15. <view class="address-text">
  16. 收货地址:
  17. {{addressData.province !== undefined ? addressData.province : ''}}
  18. {{addressData.city !== undefined ? addressData.city : ''}}
  19. {{addressData.region !== undefined ? addressData.region : ''}}
  20. {{addressData.detailAddress !== undefined ? addressData.detailAddress : ''}}
  21. </view>
  22. </view>
  23. <view class="nexpage"><text class="iconfont icon-xiayibu"></text></view>
  24. </view>
  25. </view>
  26. </navigator>
  27. <view class="tui-bg-img"></view>
  28. </view>
  29. </template>
  30. <script>
  31. export default{
  32. name:"address",
  33. props:{
  34. addressData:{
  35. type:Object
  36. }
  37. },
  38. data() {
  39. return{
  40. isEmpty:false,
  41. addressSrc:'',
  42. }
  43. },
  44. created(){
  45. this.initData(this.addressData)
  46. },
  47. computed: {
  48. },
  49. watch:{
  50. addressData:{
  51. handler:function(val){
  52. this.initData(val)
  53. }
  54. }
  55. },
  56. methods:{
  57. initData(res) {
  58. if(Object.keys(res).length == 0){
  59. this.isEmpty = true
  60. this.addressSrc = '/pages/user/address/addressManage'
  61. }else{
  62. this.isEmpty = false
  63. this.$parent.isFreight = false
  64. this.addressSrc = '/pages/user/address/address?type=select'
  65. }
  66. }
  67. }
  68. }
  69. </script>
  70. <style lang="scss">
  71. .address-template{
  72. width: 100%;
  73. height: auto;
  74. background: #FFFFFF;
  75. border-top: 1px solid #F8F8F8;
  76. position: relative;
  77. .tui-bg-img {
  78. position: absolute;
  79. width: 100%;
  80. height: 8rpx;
  81. left: 0;
  82. bottom: 0;
  83. background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL0AAAAECAMAAADszM6/AAAAOVBMVEUAAAAVqfH/fp//vWH/vWEVqfH/fp8VqfH/fp//vWEVqfH/fp8VqfH/fp//vWH/vWEVqfH/fp//vWHpE7b6AAAAEHRSTlMA6urqqlVVFRUVq6upqVZUDT4vVAAAAEZJREFUKM/t0CcOACAQRFF6r3v/w6IQJGwyDsPT882IQzQE0E3chToByjG5LwMgLZN3TQATmdypCciBya0cgOT3/h//9PgF49kd+6lTSIIAAAAASUVORK5CYII=") repeat;
  84. }
  85. }
  86. .address-section {
  87. width: 100%;
  88. height: auto;
  89. float: left;
  90. position: relative;
  91. .address-empty{
  92. width: 100%;
  93. height: 84rpx;
  94. line-height: 84rpx;
  95. color: $color-system;
  96. text-align: center;
  97. font-size: $font-size-26;
  98. font-weight: bold;
  99. background: #fff;
  100. float: left;
  101. .icon-tianjiadizhi{
  102. font-size: 30rpx;
  103. margin: 0 8rpx;
  104. }
  105. }
  106. .address-content {
  107. display: flex;
  108. align-items: center;
  109. padding:20rpx 24rpx;
  110. background: #fff;
  111. }
  112. .icon-shouhuodizhi {
  113. flex-shrink: 0;
  114. display: flex;
  115. align-items: center;
  116. justify-content: center;
  117. width: 40rpx;
  118. color: $color-system;
  119. font-size: 46rpx;
  120. margin-right: 10rpx;
  121. }
  122. .address-cen {
  123. width: 100%;
  124. height: auto;
  125. position: relative;
  126. .top{
  127. height: 42rpx;
  128. line-height: 42rpx;
  129. text-align: left;
  130. font-size: $font-size-30;
  131. color: $text-color;
  132. padding-bottom: 8rpx;
  133. display: flex;
  134. float: left;
  135. margin-bottom: 10rpx;
  136. .name{
  137. margin-right: 48rpx;
  138. }
  139. .mobile{
  140. margin-right: 40rpx;
  141. }
  142. }
  143. .address {
  144. width: 100%;
  145. height: auto;
  146. float: left;
  147. .address-icon{
  148. width: 40rpx;
  149. height: auto;
  150. float: left;
  151. line-height: 40rpx;
  152. }
  153. .address-text{
  154. width: 610rpx;
  155. float: left;
  156. line-height: 40rpx;
  157. font-size: $font-size-24;
  158. color: #666;
  159. text-align: left;
  160. -o-text-overflow: ellipsis;
  161. text-overflow: ellipsis;
  162. display: -webkit-box;
  163. word-break: break-all;
  164. -webkit-box-orient: vertical;
  165. -webkit-line-clamp: 2;
  166. overflow: hidden;
  167. }
  168. }
  169. .nexpage{
  170. text-align: right;
  171. font-size: $font-size-30;
  172. color: $color-system;
  173. position: absolute;
  174. right: 0;
  175. top: 45rpx;
  176. .icon-genghuan{
  177. font-size: $font-size-30;
  178. }
  179. }
  180. }
  181. .icon-xiayibu {
  182. font-size: 32rpx;
  183. color: $text-color;
  184. margin-right: 30rpx;
  185. }
  186. .a-bg {
  187. position: absolute;
  188. left: 0;
  189. bottom: 0;
  190. display: block;
  191. width: 100%;
  192. height: 5rpx;
  193. }
  194. }
  195. </style>