address.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <!-- 收货地址页面 -->
  2. <template>
  3. <view>
  4. <view class="item" v-for="(res, index) in siteList" :key="res.id">
  5. <view class="top">
  6. <view class="name">{{ res.name }}</view>
  7. <view class="phone">{{ res.phone }}</view>
  8. <view class="tag">
  9. <text v-for="(item, index) in res.tag" :key="index" :class="{red:item.tagText=='默认'}">{{ item.tagText }}</text>
  10. </view>
  11. </view>
  12. <view class="bottom">
  13. 广东省深圳市宝安区 自由路66号
  14. <u-icon name="edit-pen" :size="40" color="#999999"></u-icon>
  15. </view>
  16. </view>
  17. <view class="addSite" @tap="toAddSite">
  18. <view class="add">
  19. <u-icon name="plus" color="#ffffff" class="icon" :size="30"></u-icon>新建收货地址
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. siteList: []
  29. };
  30. },
  31. onLoad() {
  32. this.getData();
  33. },
  34. methods: {
  35. getData() {
  36. this.siteList = [
  37. {
  38. id: 1,
  39. name: '游X',
  40. phone: '183****5523',
  41. tag: [
  42. {
  43. tagText: '默认'
  44. },
  45. {
  46. tagText: '家'
  47. }
  48. ],
  49. site: '广东省深圳市宝安区 自由路66号'
  50. },
  51. {
  52. id: 2,
  53. name: '李XX',
  54. phone: '183****5555',
  55. tag: [
  56. {
  57. tagText: '公司'
  58. }
  59. ],
  60. site: '广东省深圳市宝安区 翻身路xx号'
  61. },
  62. {
  63. id: 3,
  64. name: '王YY',
  65. phone: '153****5555',
  66. tag: [],
  67. site: '广东省深圳市宝安区 平安路13号'
  68. }
  69. ];
  70. },
  71. toAddSite(){
  72. uni.navigateTo({
  73. url: '/pages/me/modify'
  74. });
  75. }
  76. }
  77. };
  78. </script>
  79. <style lang="scss" scoped>
  80. .item {
  81. padding: 40rpx 20rpx;
  82. .top {
  83. display: flex;
  84. font-weight: bold;
  85. font-size: 34rpx;
  86. .phone {
  87. margin-left: 60rpx;
  88. }
  89. .tag {
  90. display: flex;
  91. font-weight: normal;
  92. align-items: center;
  93. text {
  94. display: block;
  95. width: 60rpx;
  96. height: 34rpx;
  97. line-height: 34rpx;
  98. color: #ffffff;
  99. font-size: 20rpx;
  100. border-radius: 6rpx;
  101. text-align: center;
  102. margin-left: 30rpx;
  103. background-color:rgb(49, 145, 253);
  104. }
  105. .red{
  106. background-color:red
  107. }
  108. }
  109. }
  110. .bottom {
  111. display: flex;
  112. margin-top: 20rpx;
  113. font-size: 28rpx;
  114. justify-content: space-between;
  115. color: #999999;
  116. }
  117. }
  118. .addSite {
  119. display: flex;
  120. justify-content: space-around;
  121. width: 600rpx;
  122. line-height: 100rpx;
  123. position: absolute;
  124. bottom: 30rpx;
  125. left: 80rpx;
  126. background-color: #0095FF;
  127. border-radius: 60rpx;
  128. font-size: 30rpx;
  129. .add{
  130. display: flex;
  131. align-items: center;
  132. color: #ffffff;
  133. .icon{
  134. margin-right: 10rpx;
  135. }
  136. }
  137. }
  138. </style>