changeHouse.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!-- 切换房屋 -->
  2. <template>
  3. <view class="">
  4. <view class="item" v-for="(item,index) in data" :key="index">
  5. <view class="content">
  6. <view class="city">
  7. <view style="height: 100%;display: flex;">
  8. <image src="../../static/house_icon_location@2x.png" style="width: 40rpx;height:40rpx;margin-right: 18rpx;"></image>
  9. <view class="text">{{item.address}}</view>
  10. </view>
  11. </view>
  12. <view class="address" v-for="(list,index) in item.ownerBases" :key="index">
  13. <image src="../../static/house_icon_house@2x.png" style="width: 40rpx;height:40rpx;margin-right: 18rpx;"></image>
  14. <view class="text">{{list}}</view>
  15. <view class="delete">
  16. <radio-group @change="changeHouse">
  17. <radio style="transform:scale(0.8)" :value="list" :checked="address==list" />
  18. </radio-group>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. data: [],
  30. address:""
  31. }
  32. },
  33. onShow() {
  34. this.address=uni.getStorageSync('homeAdress')
  35. },
  36. mounted() {
  37. this.getHouseData()
  38. },
  39. methods: {
  40. // 删除房屋
  41. changeHouse(item) {
  42. uni.setStorageSync('homeAdress', item.detail.value)
  43. uni.switchTab({
  44. url: "./index"
  45. })
  46. },
  47. // 添加房屋信息
  48. addMyHouse() {
  49. uni.navigateTo({
  50. url: '../authentication/city'
  51. })
  52. },
  53. //获取房屋数据
  54. getHouseData() {
  55. uni.showLoading({
  56. mask: true,
  57. title: '加载中'
  58. })
  59. this.http.httpRequest('/wxapplet/ownerbasestruct/list', 'get', {
  60. userId: String(uni.getStorageSync('userId'))
  61. }, true).then((res) => {
  62. console.log(res)
  63. if (res.code == 0) {
  64. uni.hideLoading()
  65. this.data = res.data
  66. } else {
  67. uni.hideLoading()
  68. uni.showToast({
  69. title: res.msg,
  70. "icon": 'none'
  71. })
  72. }
  73. })
  74. }
  75. }
  76. }
  77. </script>
  78. <style>
  79. .btn {
  80. width: 702rpx;
  81. height: 90rpx;
  82. background: rgba(41, 138, 253, 1);
  83. opacity: 1;
  84. border-radius: 18rpx;
  85. font-size: 32rpx;
  86. font-family: PingFang SC;
  87. font-weight: bold;
  88. line-height: 90rpx;
  89. color: rgba(255, 255, 255, 1);
  90. text-align: center;
  91. position: absolute;
  92. bottom: 56rpx;
  93. left: 26rpx;
  94. }
  95. .address {
  96. width: 100%;
  97. height: 40rpx;
  98. margin-top: 42rpx;
  99. margin-bottom: 20rpx;
  100. display: flex;
  101. }
  102. .delete {
  103. width: 60rpx;
  104. height: 32rpx;
  105. font-size: 22rpx;
  106. font-family: PingFang SC;
  107. font-weight: 400;
  108. color: rgba(41, 138, 253, 1);
  109. }
  110. .item {
  111. width: 702rpx;
  112. /* height:164rpx; */
  113. background: rgba(249, 252, 255, 1);
  114. opacity: 1;
  115. margin: 0 auto;
  116. margin-top: 40rpx;
  117. overflow: hidden;
  118. }
  119. .content {
  120. width: 622rpx;
  121. margin: 0 auto;
  122. }
  123. .city {
  124. width: 100%;
  125. height: 40rpx;
  126. display: flex;
  127. justify-content: space-between;
  128. margin-top: 26rpx;
  129. }
  130. .text {
  131. width: 400rpx;
  132. height: 40rpx;
  133. font-size: 28rpx;
  134. font-family: PingFang SC;
  135. font-weight: bold;
  136. line-height: 40rpx;
  137. color: rgba(41, 138, 253, 1);
  138. }
  139. .address .text {
  140. width: 550rpx;
  141. height: 36rpx;
  142. font-size: 26rpx;
  143. font-family: PingFang SC;
  144. font-weight: 400;
  145. color: rgba(51, 51, 51, 1);
  146. }
  147. </style>