This commit is contained in:
Ling53666
2025-08-18 09:11:51 +08:00
commit 02554225da
2516 changed files with 133155 additions and 0 deletions

View File

@ -0,0 +1,41 @@
<import-sjs
from="./index.sjs"
name="result"
></import-sjs>
<view
class="ant-result {{className ? className : ''}}"
style="{{style || ''}}"
>
<view class="ant-result-main">
<slot name="image">
<view
a:if="{{type}}"
class="ant-result-image"
>
<icon
type="{{result.iconType(type)}}"
className="ant-result-image-{{type}}"
style="font-size: 64px"
></icon>
</view>
<image-icon
a:elif="{{image}}"
className="ant-result-image"
image="{{image}}"
></image-icon>
<block a:else></block>
</slot>
<view class="ant-result-title">
<slot name="title">
{{title}}
</slot>
</view>
<view class="ant-result-message">
<slot name="message">
<!--display: inline-->
<text>{{message}}</text>
</slot>
</view>
</view>
<slot name="extra"></slot>
</view>

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,7 @@
import { Component } from '../_util/simply';
Component({
type: null,
image: '',
title: '',
message: '',
});

View File

@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"icon": "../Icon/index",
"image-icon": "../ImageIcon/index"
}
}

View File

@ -0,0 +1,74 @@
@import (reference) './variable.less';
@import '../style/mixins/hairline.less';
@resultPrefix: ant-result;
.@{resultPrefix} {
position: relative;
text-align: center;
line-height: normal;
box-sizing: border-box;
.hairline('bottom');
&-main {
padding: @size-8 @result-spacing-LR;
margin-bottom: @size-5;
background-color: @result-main-background;
}
&-image {
display: flex;
justify-content: center;
align-items: center;
width: @result-img-size;
height: @result-img-size;
margin: 0 auto;
overflow: hidden;
text-align: center;
line-height: @result-img-size;
& + .@{resultPrefix}-title,
& + .@{resultPrefix}-message {
padding-top: @size-5;
}
&-success {
color: @COLOR_BRAND1;
}
&-error {
color: @COLOR_TEXT_WARNING;
}
&-info {
color: @COLOR_BRAND1;
}
&-warning {
color: @COLOR_ORANGE_1;
}
&-wait {
color: @COLOR_POMONAGREEN_1;
}
}
&-title {
font-size: @result-title-size;
color: @result-title-color;
&:empty {
display: none;
}
}
&-message {
padding-top: @size-2;
font-size: @result-desc-size;
color: @result-desc-color;
&:empty {
display: none;
}
}
}

View File

@ -0,0 +1,13 @@
var iconMap = {
'success': 'CheckCircleFill',
'error': 'CloseCircleFill',
'info': 'InformationCircleFill',
'warning': 'ExclamationCircleFill',
'wait': 'ClockCircleFill'
};
var iconType = function iconType(t) {
return iconMap[t];
};
export default {
iconType: iconType
};

View File

@ -0,0 +1,23 @@
import { IBaseProps } from '../_util/base';
/**
* @description 结果页,用于展示用户操作后的信息反馈。
*/
export interface IResultProps extends IBaseProps {
/**
* @description 内置类型 success=成功 error=错误/危险 info=信息提示 wait=等待处理
*/
type: 'success' | 'error' | 'info' | 'warning' | 'wait';
/**
* @description 自定义图片,如果配置了 type 则不生效
*/
image: string;
/**
* @description 主文案
*/
title: string;
/**
* @description 副文案
*/
message: string;
}
export declare const ResultDefaultProps: Partial<IResultProps>;

View File

@ -0,0 +1 @@
export var ResultDefaultProps = {};

View File

@ -0,0 +1,16 @@
@import (reference) '../style/themes/index.less';
// 图片尺寸
@result-img-size: 128 * @rpx;
// 主区域背景
@result-main-background: @COLOR_CARD;
// 左右边距
@result-spacing-LR: @h-spacing-large;
// 主标题颜色
@result-title-color: @COLOR_TEXT_PRIMARY;
// 主标题大小
@result-title-size: @font-size-title;
// 描述颜色
@result-desc-color: @COLOR_TEXT_ASSIST;
// 描述大小
@result-desc-size: @font-size-content;