增加补充相关资料和小程序源码

This commit is contained in:
Wang Beihong
2026-02-07 23:14:57 +08:00
parent a0febb1e5b
commit a9be1dd6b9
1255 changed files with 476253 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
Component({
properties: {
padding: {
type: String,
value: '32rpx'
},
background: {
type: String,
value: 'rgba(0,0,0,.6)'
},
width: {
type: Number,
optionalTypes: [String],
value: 64
},
size: {
type: Number,
optionalTypes: [String],
value: 30
},
color: {
type: String,
value: '#fff'
},
zIndex: {
type: Number,
value: 1001
}
},
data: {
timer: null,
src: '',
text: '',
visible: false
},
lifetimes: {
detached: function () {
clearTimeout(this.data.timer);
this.data.timer = null;
}
},
methods: {
show(options) {
clearTimeout(this.data.timer);
let {
duration = 2000,
src = '',
text = ''
} = options;
this.setData({
text: text,
src: src
}, () => {
setTimeout(() => {
this.visible = true;
this.setData({
visible: true
})
this.data.timer = setTimeout(() => {
this.setData({
visible: false
})
clearTimeout(this.data.timer);
this.data.timer = null;
}, duration);
}, 50);
})
}
}
})

View File

@@ -0,0 +1,3 @@
{
"component": true
}

View File

@@ -0,0 +1,10 @@
<view class="fui-toast__wrap {{visible?'fui-toast__show':''}}">
<view class="fui-toast__inner" style="padding:{{padding}};background:{{background}};z-index:{{zIndex}}">
<slot></slot>
<view class="fui-toast__icon-box" wx:if="{{src}}" style="width:{{width}}rpx;height:{{width}}rpx">
<image class="fui-toast__icon" src="{{src}}" style="width:{{width}}rpx;height:{{width}}rpx">
</image>
</view>
<text class="fui-toast__text" style="font-size:{{size}}rpx;color:{{color}}" wx:if="{{text}}">{{text}}</text>
</view>
</view>

View File

@@ -0,0 +1,43 @@
.fui-toast__wrap {
position: fixed;
left: 15%;
right: 15%;
top: 50%;
transform: translateY(-50%);
background-color: rgba(0, 0, 0, 0);
z-index: 1002;
display: flex;
visibility: hidden;
align-items: center;
justify-content: center;
transition-property: opacity, visibility;
transition-timing-function: ease-in-out;
transition-duration: 0.3s;
opacity: 0;
}
.fui-toast__inner {
display: flex;
box-sizing: border-box;
align-items: center;
justify-content: center;
flex-direction: column;
border-radius: 16rpx;
}
.fui-toast__show {
visibility: visible;
opacity: 1;
}
.fui-toast__icon-box {
padding-bottom: 20rpx;
}
.fui-toast__icon {
display: block;
}
.fui-toast__text {
font-weight: 400;
text-align: center;
word-break: break-all;
}