This commit is contained in:
Xu Chang 2022-05-30 18:36:12 +08:00
commit 75004eb17c
4 changed files with 71 additions and 12 deletions

View File

@ -5,14 +5,64 @@
.page-body {
height: 100vh;
display: flex;
justify-content: center;
flex: 1;
flex-direction: column;
background-color: @background-color-base;
background-color: @primary-color;
box-sizing: border-box;
.safe-area-inset-bottom();
}
.qrcode_view {
display: flex;
flex-direction: column;
background-color: #fff;
margin: 0 @size-spacing-large;
padding: @size-spacing-large;
border-radius: 8px;
box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12);
}
.icon-view {
position: absolute;
right: 0;
width: 50rpx;
height: 50rpx;
display: flex;
align-items: center;
justify-content: center;
background: @background-color-base;
border-radius: 50%;
}
.icon-view2 {
width: 100rpx;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
}
.image {
width: 400rpx;
height: 400rpx;
margin: @size-spacing-large 0rpx;
background-color: @background-color-base;
}
.row {
position: relative;
margin-bottom: @size-spacing-large;
display: flex;
flex: 1;
align-items: center;
justify-content: center;
}
.col {
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
}
.text {
color: @text-color;
}
.relation {
font-size: 42rpx;
}

View File

@ -18,29 +18,28 @@ OakPage({
entity: 1,
entityId: 1,
type: 1,//类型
expiresAt: 1,// 过期时间
expired: 1, //是否过期
ticket: 1,
url: 1,
buffer: 1,
},
filter: {
entity: 'userEntityGrant',
expired: false,
},
indexFrom: 0,
count: 1,
},
},
isList: false,
formData: async ([userEntityGrant]) => ({
...userEntityGrant,
relation: userEntityGrant && userEntityGrant.relation,
qrcodeUrl: userEntityGrant && userEntityGrant.wechatQrCode$entity[0]
&& userEntityGrant.wechatQrCode$entity[0].url || 'data:image/jpeg;base64,' + wx.arrayBufferToBase64(userEntityGrant.wechatQrCode$entity[0].buffer)
}),
}, {
data: {
},
lifetimes: {
ready() {
if (!this.data.wechatQrCode$entity[0] || this.data.wechatQrCode$entity[0].expiresAt) {
//请求创建wechatQrcode
}
}
},
methods: {
}

View File

@ -1,6 +1,16 @@
<!-- index.wxml -->
<view class="page-body">
<view class="col">
<image src="{{url}}" />
<view class="qrcode_view">
<view class="row">
<text class="text">邀请权限</text>
<view class="icon-view">
<g-icon name="person_add" size="30" />
</view>
</view>
<view class="col">
<text class="relation">{{relation || '-'}}</text>
<image src="{{qrcodeUrl}}" mode="aspectFit" class="image" />
<text class="text">微信扫一扫 添加用户权限</text>
</view>
</view>
</view>

View File

@ -4,7 +4,7 @@
<radio-group bindchange="radioChange" class="test">
<label class="label" wx:for="{{relationArr}}" wx:key="*this">
<view>
<radio value="{{item}}" />
<radio value="{{item}}" color="#2d8cf0" />
</view>
<view>{{item}}</view>
</label>