myfamily.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view class="">
  3. <u-popup v-model="show" mode="center" width="80%" :border-radius="10" negative-top="200">
  4. <view style="padding:30rpx 0rpx;display: flex;flex-direction: column;justify-content: space-between;">
  5. <view class="center text-center padding-bottom-30">
  6. <text>绑定房间</text>
  7. </view>
  8. <view class="flex-sub" style="margin: 20rpx 0;">
  9. <u-checkbox-group>
  10. <u-cell-group>
  11. <u-cell-item @click="check(item)" v-for="(item,index) in roomList" :key="index"
  12. :icon-style="item.checked?iconStyle:''" :icon="item.checked?'home-fill':'home'"
  13. :arrow="false" icon-size="30" :title="item.roomName">
  14. <u-checkbox slot="right-icon" v-model="item.checked" :name="item.id"></u-checkbox>
  15. </u-cell-item>
  16. </u-cell-group>
  17. </u-checkbox-group>
  18. </view>
  19. <view style="display: flex;justify-content: center;padding-top: 50rpx;">
  20. <u-button :customStyle="cancelStyle">暂不绑定</u-button>
  21. <u-button :customStyle="confirmStyle">确认绑定</u-button>
  22. </view>
  23. </view>
  24. </u-popup>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. name: '',
  30. data() {
  31. return {
  32. show: true,
  33. roomList: [{
  34. checked: false,
  35. roomName: '常春藤小区-4栋-1单元-101',
  36. id: 1
  37. }, {
  38. checked: false,
  39. roomName: '常春藤小区-4栋-1单元-102',
  40. id: 2
  41. }],
  42. iconStyle: {
  43. 'color': '#2f7ff5'
  44. },
  45. cancelStyle: {
  46. height: '70rpx',
  47. lineHeight: '70rpx',
  48. width: '210rpx',
  49. fontSize: '28rpx',
  50. border: '1rpx solid #afb0b3',
  51. marginRight: '15rpx',
  52. borderRadius: '0'
  53. },
  54. confirmStyle: {
  55. backgroundColor: '#2f7ff5',
  56. height: '70rpx',
  57. lineHeight: '70rpx',
  58. width: '210rpx',
  59. fontSize: '28rpx',
  60. color: '#FFFFFF',
  61. marginLeft: '15rpx',
  62. borderRadius: '0'
  63. }
  64. };
  65. },
  66. created() {
  67. this.initData()
  68. },
  69. methods: {
  70. check(item) {
  71. item.checked = !item.checked
  72. },
  73. initData(){
  74. let params={
  75. phone:this.vuex_member.phone,
  76. name:this.vuex_member.name,
  77. }
  78. console.log(params);
  79. return
  80. this.$http.getHouseUserCondition(params).then(res=>{
  81. let list=res.data.data
  82. console.log(list);
  83. })
  84. },
  85. }
  86. };
  87. </script>
  88. <style lang="scss" scoped>
  89. </style>