| | |
| | | </view> |
| | | |
| | | <view class="sub2" v-for="it in sub.children" style="margin-left: 1em;" v-show="sub.switch"> |
| | | <view :class="it.key" class="title sub-title" >{{it.title}}</view> |
| | | <view :class="it.key" class="name" v-show="it.key == 'user_id'" @click="back()"> |
| | | <!-- <view :class="it.key" class="title sub-title" >{{it.title}}</view> --> |
| | | <view :class="it.key" class="locarea name" @click="chose(it)"> |
| | | <view>{{it.title}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view style="height: 100rpx;"></view> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | // console.log(res.data[0].children); |
| | | if (res.data[0].children[0]) { |
| | | for (let k of res.data[0].children) { |
| | | console.log(k); |
| | | // console.log(k); |
| | | if (k.children && k.children.length > 0) { |
| | | for (let i of k.children) { |
| | | i['switch'] = true |
| | | console.log(i); |
| | | // console.log(i); |
| | | } |
| | | } |
| | | // console.log(k); |
| | | k['switch'] = true |
| | | _this.tree.push(k) |
| | | } |
| | | console.log(_this.tree); |
| | | // console.log(_this.tree); |
| | | } else { |
| | | this.tree.push(res.data[0]) |
| | | } |
| | |
| | | let res = await user.getUserTree() |
| | | if (res.code === 200) { |
| | | this.tree = [] |
| | | console.log(res.data[0]); |
| | | // console.log(res.data[0]); |
| | | if (res.data[0].children) { |
| | | for (let k of res.data[0].children) { |
| | | |
| | | if (k.children && k.children.length > 0) { |
| | | for (let i of k.children) { |
| | | i['switch'] = true |
| | | console.log(i); |
| | | // console.log(i); |
| | | } |
| | | } |
| | | // console.log(k); |
| | |
| | | console.log(this.tree); |
| | | }, |
| | | switchbtn(item) { |
| | | console.log(item); |
| | | // console.log(item); |
| | | item.switch = item.switch ? false : true |
| | | }, |
| | | open(e) { |
| | |
| | | uni.navigateBack({ |
| | | |
| | | }) |
| | | }, |
| | | chose(data) { |
| | | console.log(data); |
| | | this.tree = [] |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .locarea:active { |
| | | background-color: #55aa7f; |
| | | } |
| | | </style> |