Skip to content

Commit eb0a075

Browse files
authored
fix some bug in different platform (#1397)
* docs: update demo list * fix: numberkeyboard styles in android * fix: stepper input mode in wechat
1 parent a8aca72 commit eb0a075

File tree

5 files changed

+29
-16
lines changed

5 files changed

+29
-16
lines changed

demo/utils/constants.ts

+13-11
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,26 @@ export const componentList = [
22
{
33
type: 'Copilot',
44
list: [
5-
{ name: 'Suggestion', nameZN: '快捷指令', path: '/pages/Suggestion/index' },
6-
{ name: 'Prompts', nameZN: 'Prompts', path: '/pages/Prompts/index' },
7-
{ name: 'Actions', nameZN: 'Actions', path: '/pages/Actions/index' },
85
{ name: 'Bubble', nameZN: '气泡', path: '/pages/Bubble/index' },
6+
{
7+
name: 'Conversations',
8+
nameZN: '管理会话',
9+
path: '/pages/Conversations/index',
10+
},
11+
{ name: 'Prompts', nameZN: '提示列表', path: '/pages/Prompts/index' },
12+
{ name: 'Welcome', nameZN: '欢迎', path: '/pages/Welcome/index' },
13+
{ name: 'Actions', nameZN: '操作列表', path: '/pages/Actions/index' },
914
{ name: 'Sender', nameZN: '发送器', path: '/pages/Sender/index' },
15+
{
16+
name: 'ThoughtChain',
17+
nameZN: '思维链',
18+
path: '/pages/ThoughtChain/index',
19+
},
1020
],
1121
},
1222
{
1323
type: '通用',
1424
list: [
15-
{
16-
name: 'Suggestion',
17-
nameZN: '快捷指令',
18-
path: '/pages/Suggestion/index',
19-
},
20-
{ name: 'Prompts', nameZN: 'Prompts', path: '/pages/Prompts/index' },
21-
{ name: 'ThoughtChain', nameZN: '思维链', path: '/pages/ThoughtChain/index' },
22-
{ name: 'Welcome', nameZN: '欢迎', path: '/pages/Welcome/index' },
2325
{ name: 'Button', nameZN: '按钮', path: '/pages/Button/index' },
2426
{ name: 'Icon', nameZN: '图标', path: '/pages/Icon/index' },
2527
{ name: 'Sticky', nameZN: '黏性吸附', path: '/pages/Sticky/index' },

src/NumberKeyboard/index.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
}
5858
&_none {
5959
height: 80 * @rpx;
60-
width: calc(100% - 96 * @rpx);
61-
padding: 0 48 * @rpx;
60+
width: calc(100% - @number-key-board-none-padding * 2);
61+
padding: 0 @number-key-board-none-padding;
6262
font-size: 28 * @rpx;
6363
background-color: @number-key-board-iphonex-safe-background-color;
6464
display: flex;

src/NumberKeyboard/variable.less

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@import (reference) '../style/variables.less';
22
@import (reference) '../style/themes/index.less';
33

4+
@number-key-board-none-padding: 48 * @rpx;
5+
46
// 标准字体颜色
57
@number-key-board-text-color: var(
68
--number-key-board-text-color,

src/Stepper/index.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Component, triggerEvent, getValueFromProps } from '../_util/simply';
1+
import mixinValue from '../mixins/value';
2+
import { Component, getValueFromProps, triggerEvent } from '../_util/simply';
23
import { StepperDefaultProps } from './props';
34
import { getPrecision, getValidNumber } from './utils';
4-
import mixinValue from '../mixins/value';
55

66
Component(
77
StepperDefaultProps,
@@ -11,7 +11,11 @@ Component(
1111
triggerEvent(this, 'focus', value === '' ? null : Number(value), e);
1212
},
1313
onChange(val, e) {
14-
const { needUpdate, value } = this.update(val);
14+
let curVal = val;
15+
/// #if WECHAT
16+
curVal = val.detail;
17+
/// #endif
18+
const { needUpdate, value } = this.update(curVal);
1519
if (getValueFromProps(this, 'onChange') && needUpdate) {
1620
triggerEvent(this, 'change', value === '' ? null : Number(value), e);
1721
}

src/Stepper/props.ts

+5
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,9 @@ export const StepperDefaultProps: Partial<IStepperProps> = {
103103
inputStyle: '',
104104
disabled: false,
105105
inputReadOnly: false,
106+
onChange: null,
107+
onConfirm: null,
108+
onFocus: null,
109+
onBlur: null,
110+
onDisabledTap: null,
106111
};

0 commit comments

Comments
 (0)