| | |
| | | <template> |
| | | <view class="role-container"> |
| | | <view @click="activeRole(item)" v-for="(item, index) in roleData" :key="index" :class="item.active?'active':''"> |
| | | <view @click="enableRole(item)" v-for="(item, index) in roleData" :key="index" :class="item.active?'active':''"> |
| | | <view class="l"> |
| | | <u-icon :name="item.iconName"></u-icon> |
| | | <u-icon :name="item.icon" width="80rpx" height="80rpx"></u-icon> |
| | | <view class="role-name"> |
| | | {{item.roleName}} |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-if="item.active" class="r"> |
| | | <!-- <view v-if="item.active" class="r"> |
| | | <u-icon name="checkmark" color="#2979ff"></u-icon> |
| | | </view> --> |
| | | <view v-if="item.id == currentId" class="r"> |
| | | <u-icon name="checkmark" color="#2979ff"></u-icon> |
| | | </view> |
| | | </view> |
| | |
| | | roleData: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | currentId:{ |
| | | type:[Number,String] |
| | | } |
| | | }, |
| | | |
| | | data() { |
| | | return {} |
| | | }, |
| | |
| | | methods: { |
| | | |
| | | //启用角色 |
| | | activeRole(item) { |
| | | enableRole(item) { |
| | | this.roleData.forEach(role => { |
| | | if (role.id == item.id) { |
| | | role.active = true |
| | |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | margin-top: 16rpx; |
| | | padding: 0 16rpx; |
| | | background: #fff; |
| | | height: 80rpx; |
| | | |
| | | margin:0 30rpx; |
| | | padding:30rpx 0; |
| | | border-bottom:1px solid #F5F5F5; |
| | | .l { |
| | | flex: 1; |
| | | display: flex; |