oak-general-business/es/components/userRelation/onEntity/index.xml

32 lines
1.7 KiB
XML

<!-- index.wxml -->
<view class="container">
<view class="primary-bg"></view>
<view class="white-bg">
<view class="content">
<image mode="aspectFill" class="img" src="{{user.avatar}}" lazy-load></image>
<text class="name">{{user.name || user.nickname || '--'}}</text>
<text class="mobile">{{user.mobile || '--'}}</text>
<t-divider />
<view class="list" wx:for="{{rows}}" wx:key="idx">
<block wx:if="{{relations.length === 1}}">
<view class="singleRelationItem">
<view class="name">{{item.name}}</view>
<t-switch value="{{item.hasRelation[0]}}" bind:change="onChange" data-id="{{item.id}}" data-relation="{{relations[0]}}" data-index="{{index}}" />
</view>
</block>
<block wx:else>
<view class="multiRelationItem">
<view class="name">{{item.name}}</view>
<view class="relationList">
<view class="relationItem" wx:for="{{relations}}" wx:key="idx2" wx:for-item="relation" wx:for-index="index2">
<t-switch value="{{item.hasRelation[index2]}}" bind:change="onChange" data-id="{{item.id}}" data-relation="{{relation}}" data-index="{{index}}" />
<text>{{relation}}</text>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
<t-button theme="primary" style="margin: 16rpx" disabled="{{!oakDirty}}" block size="large" bind:tap="confirm" content="确定" />
</view>