球星卡微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
3.2 KiB

  1. <template>
  2. <view style="flex-direction: column;">
  3. <scroll-view class="scroll-view" :scroll-y="true">
  4. <view class="addressItem" v-for="(item, index) in addressList" :key="item.id">
  5. <view class="addressItemTop">
  6. <text class="addrName">{{ item.name }}</text>
  7. <text class="addrTel">{{ item.phone }}</text>
  8. </view>
  9. <text class="addr">{{ item.address }}</text>
  10. <view class="line"></view>
  11. <view class="optionsPanel">
  12. <radio-group @change="radioChange">
  13. <label>
  14. <radio :value="item.id" :checked="item.isDefault" color="#e7a23f"></radio>
  15. <text>设置为默认地址</text>
  16. </label>
  17. </radio-group>
  18. <view class="rightPanel">
  19. <image class="optionsBtn" src="../../static/删除.png" @click="remove"></image>
  20. <image class="optionsBtnEdit" src="../../static/编辑.png" @click="$url('/packages/addAddress/addAddress?id='+ item.id)"></image>
  21. </view>
  22. </view>
  23. <view style="height: 30rpx;background-color: #F6F6F6;"></view>
  24. </view>
  25. </scroll-view>
  26. <view class="addNewAddr" @click="$url('/packages/addAddress/addAddress')">
  27. <text>+ 新增收获地址</text>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. addressList: [{
  36. id: '1',
  37. name: '邓平艺',
  38. phone: '18454545455',
  39. address: '北京北京市海淀区钻石大厦C座',
  40. isDefault: true
  41. },{
  42. id: '2',
  43. name: '邓艺平',
  44. phone: '18454545455',
  45. address: '北京北京市海淀区钻石大厦C座',
  46. isDefault: false
  47. },{
  48. id: '3',
  49. name: '洛阳',
  50. phone: '18454545455',
  51. address: '北京北京市海淀区钻石大厦C座',
  52. isDefault: false
  53. }]
  54. }
  55. },
  56. methods: {
  57. radioChange(event){
  58. let id = event.detail.value;
  59. this.addressList.forEach(item => {
  60. if(item.id === id){
  61. item.isDefault = true;
  62. }else{
  63. item.isDefault = false;
  64. }
  65. });
  66. },
  67. remove(){
  68. this.$msg('删除')
  69. }
  70. }
  71. }
  72. </script>
  73. <style scoped class="scss">
  74. /deep/view{
  75. display: flex;
  76. background-color: #FFFFFF;
  77. }
  78. .scroll-view{
  79. height: calc(100vh - 200rpx);
  80. }
  81. .checkBtn{
  82. width: 44rpx;
  83. height: 44rpx;
  84. margin-right: 14rpx;
  85. }
  86. .addressItemTop{
  87. align-items: center;
  88. margin-top: 20rpx;
  89. margin-bottom: 20rpx;
  90. }
  91. .addressItem{
  92. flex-direction: column;
  93. }
  94. .line{
  95. height: 1rpx;
  96. background-color: #D8D8D8;
  97. margin-left: 32rpx;
  98. margin-right: 32rpx;
  99. margin-top: 20rpx;
  100. margin-bottom: 20rpx;
  101. }
  102. .addrName{
  103. margin-left: 32rpx;
  104. font-size: 36rpx;
  105. font-weight: bold;
  106. margin-right: 40rpx;
  107. }
  108. .addr{
  109. margin-left: 32rpx;
  110. }
  111. .optionsPanel{
  112. margin-left: 32rpx;
  113. margin-bottom: 40rpx;
  114. align-items: center;
  115. justify-content: space-between;
  116. }
  117. .rightPanel{
  118. align-items: center;
  119. justify-content: center;
  120. margin-right: 32rpx;
  121. }
  122. .optionsBtn{
  123. width: 44rpx;
  124. height: 44rpx;
  125. margin-right: 50rpx;
  126. }
  127. .optionsBtnEdit{
  128. width: 38rpx;
  129. height: 38rpx;
  130. }
  131. .addNewAddr{
  132. height: 96rpx;
  133. /* width: 90%; */
  134. width: 686rpx;
  135. border: #E7A23F 2rpx solid;
  136. border-radius: 8rpx;
  137. position: fixed;
  138. bottom: 100rpx;
  139. left: calc(50% - 343rpx);
  140. justify-content: center;
  141. align-items: center;
  142. align-self: center;
  143. color: #E7A23F;
  144. }
  145. </style>