choiceAddress.vue 4.1 KB

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