fix actionpanel

This commit is contained in:
Wang Kejun 2022-08-02 18:58:56 +08:00
parent d48f7bc986
commit 9d2d3231de
6 changed files with 50 additions and 69 deletions

View File

@ -3,6 +3,8 @@
"usingComponents": {
"t-button": "../../../miniprogram_npm/tdesign/button/button",
"t-icon": "../../../miniprogram_npm/tdesign/icon/icon",
"t-drawer": "../../../miniprogram_npm/tdesign/drawer/drawer"
"t-popup": "../../../miniprogram_npm/tdesign/popup/popup",
"t-grid": "../../../miniprogram_npm/tdesign/grid/grid",
"t-grid-item": "../../../miniprogram_npm/tdesign/grid/grid-item"
}
}

View File

@ -15,67 +15,41 @@
box-sizing: border-box;
}
.btn-container {
.block {
width: 176rpx;
height: 176rpx;
background: #fff;
color: #333;
display: flex;
}
.block--bottom {
width: 100vw;
height: 35vh;
border-top-left-radius: 16rpx;
border-top-right-radius: 16rpx;
}
.btn-box {
display: flex;
flex: 1;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 32rpx;
}
.five-grid {
position: unset;
}
.btn-icon {
padding: @spacer-1;
border-radius: 50%;
margin-bottom: @spacer;
background-color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
//按压水波纹特效
.btn-ripple {
overflow: hidden;
position: relative;
transition: background-color 0.3s linear, border 0.3s linear;
&:after {
content: "";
display: block;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
pointer-events: none;
background-image: radial-gradient(
circle,
#000 10%,
rgba(0, 0, 0, 0) 10.01%
);
background-repeat: no-repeat;
background-position: 50%;
transform: scale(10);
opacity: 0;
transition: transform 0.5s, opacity 1s;
}
&:active:after {
transform: scale(0);
opacity: 0.2;
transition: 0s;
}
.external-class-content {
padding: 32rpx 0 !important;
}
.btn-label {
color: @text-level-3-color;
font-size: 24rpx;
.image-icon {
width: 96rpx !important;
height: 96rpx !important;
}
.drawer-container {
height: 500rpx;
.image {
width: 100%;
padding: @spacer-1;
box-sizing: border-box;
border-top-left-radius: @spacer-1;
border-top-right-radius: @spacer-1;
background: @bg-color-fade;
bottom: 0px;
z-index: 7;
height: 100%;
}

View File

@ -1,12 +1,13 @@
<g-drawer mode="bottom" visible="{{show}}" bind:close="closeDrawer">
<view class="drawer-container" solt="container">
<view class="grid">
<view class="grid-item" wx:for="{{actionss}}" wx:key="index" bind:tap="onClick" data-index="{{index}}">
<view class="btn-container">
<g-icon class="btn-icon btn-ripple" size="48" family="{{item.icon.family}}" name="{{item.icon.name}}" color="#5f6368" />
<text class="btn-label">{{item.label}}</text>
</view>
</view>
<t-popup placement="bottom" visible="{{show}}" bind:visible-change="closeDrawer" close-btn="true">
<view class="block block--bottom">
<view class="btn-box">
<t-grid t-class="five-grid" column="{{5}}">
<block wx:for="{{actionss}}" wx:key="index">
<t-grid-item bind:tap="onClick" data-index="{{index}}" text="{{item.label}}" t-class-text="text" t-class-image="image-icon" t-class-content="external-class-content">
<t-icon class="image" name="{{item.icon.name}}" slot="image" />
</t-grid-item>
</block>
</t-grid>
</view>
</view>
</g-drawer>
</t-popup>

View File

@ -155,7 +155,7 @@ export default OakPage({
switch (action) {
case 'update': {
this.navigateTo({
url: '/user/upsert',
url: '/user/manage/upsert',
oakId: this.props.oakId,
});
return;

View File

@ -35,5 +35,5 @@
</view>
<view style="flex:1" />
<t-button theme="primary" style="margin: 16rpx" block size="large" bind:tap="openDrawer" content="更多" />
<actionPanel show="{{show}}" bind:close="closeDrawer" style="align-self:stretch" actions="{{oakLegalActions}}" actionDescriptions="{{actionDescriptions}}" bind:click="onActionClick" />
</view>
</view>
<actionPanel show="{{show}}" bind:close="closeDrawer" actions="{{oakLegalActions}}" actionDescriptions="{{actionDescriptions}}" bind:click="onActionClick" />

View File

@ -84,9 +84,13 @@ export default OakPage({
const { id } = dataset!;
if (event) {
this.pub(event, this.state.userData.find(ele => ele.id === id));
// this.navigateBack();
}
else {
this.navigateBack();
this.navigateTo({
url: '/user/manage/detail',
oakId: id,
});
}
},
goNewUser() {