Skip to content

Commit

Permalink
fix some bug in different platform (#1397)
Browse files Browse the repository at this point in the history
* docs: update demo list

* fix: numberkeyboard styles in android

* fix: stepper input mode in wechat
  • Loading branch information
rayhomie authored Feb 7, 2025
1 parent a8aca72 commit eb0a075
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 16 deletions.
24 changes: 13 additions & 11 deletions demo/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@ export const componentList = [
{
type: 'Copilot',
list: [
{ name: 'Suggestion', nameZN: '快捷指令', path: '/pages/Suggestion/index' },
{ name: 'Prompts', nameZN: 'Prompts', path: '/pages/Prompts/index' },
{ name: 'Actions', nameZN: 'Actions', path: '/pages/Actions/index' },
{ name: 'Bubble', nameZN: '气泡', path: '/pages/Bubble/index' },
{
name: 'Conversations',
nameZN: '管理会话',
path: '/pages/Conversations/index',
},
{ name: 'Prompts', nameZN: '提示列表', path: '/pages/Prompts/index' },
{ name: 'Welcome', nameZN: '欢迎', path: '/pages/Welcome/index' },
{ name: 'Actions', nameZN: '操作列表', path: '/pages/Actions/index' },
{ name: 'Sender', nameZN: '发送器', path: '/pages/Sender/index' },
{
name: 'ThoughtChain',
nameZN: '思维链',
path: '/pages/ThoughtChain/index',
},
],
},
{
type: '通用',
list: [
{
name: 'Suggestion',
nameZN: '快捷指令',
path: '/pages/Suggestion/index',
},
{ name: 'Prompts', nameZN: 'Prompts', path: '/pages/Prompts/index' },
{ name: 'ThoughtChain', nameZN: '思维链', path: '/pages/ThoughtChain/index' },
{ name: 'Welcome', nameZN: '欢迎', path: '/pages/Welcome/index' },
{ name: 'Button', nameZN: '按钮', path: '/pages/Button/index' },
{ name: 'Icon', nameZN: '图标', path: '/pages/Icon/index' },
{ name: 'Sticky', nameZN: '黏性吸附', path: '/pages/Sticky/index' },
Expand Down
4 changes: 2 additions & 2 deletions src/NumberKeyboard/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
}
&_none {
height: 80 * @rpx;
width: calc(100% - 96 * @rpx);
padding: 0 48 * @rpx;
width: calc(100% - @number-key-board-none-padding * 2);
padding: 0 @number-key-board-none-padding;
font-size: 28 * @rpx;
background-color: @number-key-board-iphonex-safe-background-color;
display: flex;
Expand Down
2 changes: 2 additions & 0 deletions src/NumberKeyboard/variable.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import (reference) '../style/variables.less';
@import (reference) '../style/themes/index.less';

@number-key-board-none-padding: 48 * @rpx;

// 标准字体颜色
@number-key-board-text-color: var(
--number-key-board-text-color,
Expand Down
10 changes: 7 additions & 3 deletions src/Stepper/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, triggerEvent, getValueFromProps } from '../_util/simply';
import mixinValue from '../mixins/value';
import { Component, getValueFromProps, triggerEvent } from '../_util/simply';
import { StepperDefaultProps } from './props';
import { getPrecision, getValidNumber } from './utils';
import mixinValue from '../mixins/value';

Component(
StepperDefaultProps,
Expand All @@ -11,7 +11,11 @@ Component(
triggerEvent(this, 'focus', value === '' ? null : Number(value), e);
},
onChange(val, e) {
const { needUpdate, value } = this.update(val);
let curVal = val;
/// #if WECHAT
curVal = val.detail;
/// #endif
const { needUpdate, value } = this.update(curVal);
if (getValueFromProps(this, 'onChange') && needUpdate) {
triggerEvent(this, 'change', value === '' ? null : Number(value), e);
}
Expand Down
5 changes: 5 additions & 0 deletions src/Stepper/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,9 @@ export const StepperDefaultProps: Partial<IStepperProps> = {
inputStyle: '',
disabled: false,
inputReadOnly: false,
onChange: null,
onConfirm: null,
onFocus: null,
onBlur: null,
onDisabledTap: null,
};

0 comments on commit eb0a075

Please sign in to comment.