Skip to content

Commit fab601b

Browse files
ajiaberryshijia.sj
and
shijia.sj
authored
fix: 修复GuideTour内置中文文案问题 (#1133)
Co-authored-by: shijia.sj <[email protected]>
1 parent 3bb4fb1 commit fab601b

File tree

11 files changed

+89
-13
lines changed

11 files changed

+89
-13
lines changed

compiled/alipay/demo/pages/GuideTour/index.axml

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
items="{{ list }}"
2525
visible="{{ slotVisible }}"
2626
onCancel="closeTour"
27-
onChange="onChange">
27+
onChange="onChange"
28+
jumpText="跳过"
29+
gotItText="知道了"
30+
prevStepText="上一步"
31+
nextStepText="下一步">
2832
<view
2933
class="step-box"
3034
slot="step"

compiled/alipay/src/GuideTour/index.axml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,30 @@
2020
inline
2121
size="small"
2222
onTap="onCancel">
23-
跳过
23+
{{ jumpText }}
2424
</ant-button>
2525
<ant-button
2626
a:if="{{ utils.checkShowPrev(mixin.value, items) }}"
2727
inline
2828
size="small"
2929
onTap="onPrev"
3030
data-currentValue="{{ mixin.value }}">
31-
上一步
31+
{{ prevStepText }}
3232
</ant-button>
3333
<ant-button
3434
a:if="{{ utils.checkShowNext(mixin.value, items) }}"
3535
inline
3636
size="small"
3737
onTap="onNext"
3838
data-currentValue="{{ mixin.value }}">
39-
下一步
39+
{{ nextStepText }}
4040
</ant-button>
4141
<ant-button
4242
a:if="{{ utils.checkShowKnow(mixin.value, items) }}"
4343
inline
4444
size="small"
4545
onTap="onCancel">
46-
知道了
46+
{{ gotItText }}
4747
</ant-button>
4848
</view>
4949
<block a:if="{{ swiperable }}">

compiled/alipay/src/GuideTour/index.md

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ toc: 'content'
3636
| `visible` | 是否显示 | `boolean` | `false`|
3737
| `onCancel` | 关闭回调 | `() => void` | - |
3838
| `onChange` | 步骤改变回调 | `(index: number) => void` | - |
39+
| `jumpText` | 跳过按钮的文案 | `string` | '跳过' |
40+
| `prevStepText`| 上一步按钮的文案 | `string` | '上一步' |
41+
| `nextStepText`| 下一步按钮的文案 | `string` | '下一步' |
42+
| `gotItText`| 知道了按钮的文案 | `string` | '知道了' |
3943

4044
### GuideTourItem
4145

compiled/alipay/src/GuideTour/props.ts

+24
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,37 @@ export interface IGuideTour extends IBaseProps {
6565
* @description 步骤改变回调
6666
*/
6767
onChange: (index: number) => boolean;
68+
/**
69+
* @description 上一步按钮文案
70+
* @default "上一步"
71+
*/
72+
prevStepText?: string;
73+
/**
74+
* @description 下一步按钮文案
75+
* @default "下一步"
76+
*/
77+
nextStepText?: string;
78+
/**
79+
* @description 知道了按钮文案
80+
* @default "知道了"
81+
*/
82+
gotItText?: string;
83+
/**
84+
* @description 跳过按钮文案
85+
* @default "跳过"
86+
*/
87+
jumpText?: string;
6888
}
6989

7090
export const GuideTourDefaultProps: Partial<IGuideTour> = {
7191
visible: false,
7292
swiperable: false,
7393
items: [],
7494
defaultCurrent: 0,
95+
gotItText: '知道了',
96+
nextStepText: '下一步',
97+
prevStepText: '上一步',
98+
jumpText: '跳过'
7599
};
76100

77101
export const GuideTourFunctionalProps: Partial<IGuideTour> = {

compiled/wechat/src/GuideTour/index.md

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ toc: 'content'
3636
| `visible` | 是否显示 | `boolean` | `false`|
3737
| `onCancel` | 关闭回调 | `() => void` | - |
3838
| `onChange` | 步骤改变回调 | `(index: number) => void` | - |
39+
| `jumpText` | 跳过按钮的文案 | `string` | '跳过' |
40+
| `prevStepText`| 上一步按钮的文案 | `string` | '上一步' |
41+
| `nextStepText`| 下一步按钮的文案 | `string` | '下一步' |
42+
| `gotItText`| 知道了按钮的文案 | `string` | '知道了' |
3943

4044
### GuideTourItem
4145

compiled/wechat/src/GuideTour/index.wxml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,30 @@
2020
inline
2121
size="small"
2222
bind:tap="onCancel">
23-
跳过
23+
{{ jumpText }}
2424
</ant-button>
2525
<ant-button
2626
wx:if="{{ utils.checkShowPrev(mixin.value, items) }}"
2727
inline
2828
size="small"
2929
bind:tap="onPrev"
3030
data-currentValue="{{ mixin.value }}">
31-
上一步
31+
{{ prevStepText }}
3232
</ant-button>
3333
<ant-button
3434
wx:if="{{ utils.checkShowNext(mixin.value, items) }}"
3535
inline
3636
size="small"
3737
bind:tap="onNext"
3838
data-currentValue="{{ mixin.value }}">
39-
下一步
39+
{{ nextStepText }}
4040
</ant-button>
4141
<ant-button
4242
wx:if="{{ utils.checkShowKnow(mixin.value, items) }}"
4343
inline
4444
size="small"
4545
bind:tap="onCancel">
46-
知道了
46+
{{ gotItText }}
4747
</ant-button>
4848
</view>
4949
<block wx:if="{{ swiperable }}">

compiled/wechat/src/GuideTour/props.js

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ export var GuideTourDefaultProps = {
33
swiperable: false,
44
items: [],
55
defaultCurrent: 0,
6+
gotItText: '知道了',
7+
nextStepText: '下一步',
8+
prevStepText: '上一步',
9+
jumpText: '跳过'
610
};
711
export var GuideTourFunctionalProps = {
812
maskStyle: '',

demo/pages/GuideTour/index.axml.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export default ({
4646
visible={slotVisible}
4747
onCancel="closeTour"
4848
onChange="onChange"
49+
jumpText='跳过'
50+
gotItText='知道了'
51+
prevStepText='上一步'
52+
nextStepText='下一步'
4953
>
5054
<View class="step-box" slot="step" slot-scope="props">
5155
step-{props.index}

src/GuideTour/index.axml.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export default (
2424
items,
2525
visible,
2626
swiperable,
27+
jumpText,
28+
nextStepText,
29+
prevStepText,
30+
gotItText
2731
}: TSXMLProps<IGuideTour>,
2832
{ mixin, current }: InternalData
2933
) => (
@@ -43,7 +47,7 @@ export default (
4347
<View class="ant-guide-tour-button">
4448
{utils.checkShowJump(mixin.value, items) && (
4549
<AntButton inline size="small" onTap="onCancel">
46-
跳过
50+
{jumpText}
4751
</AntButton>
4852
)}
4953
{utils.checkShowPrev(mixin.value, items) && (
@@ -53,7 +57,7 @@ export default (
5357
onTap="onPrev"
5458
data-currentValue={mixin.value}
5559
>
56-
上一步
60+
{prevStepText}
5761
</AntButton>
5862
)}
5963
{utils.checkShowNext(mixin.value, items) && (
@@ -63,12 +67,12 @@ export default (
6367
onTap="onNext"
6468
data-currentValue={mixin.value}
6569
>
66-
下一步
70+
{nextStepText}
6771
</AntButton>
6872
)}
6973
{utils.checkShowKnow(mixin.value, items) && (
7074
<AntButton inline size="small" onTap="onCancel">
71-
知道了
75+
{gotItText}
7276
</AntButton>
7377
)}
7478
</View>

src/GuideTour/index.md

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ toc: 'content'
3636
| `visible` | 是否显示 | `boolean` | `false`|
3737
| `onCancel` | 关闭回调 | `() => void` | - |
3838
| `onChange` | 步骤改变回调 | `(index: number) => void` | - |
39+
| `jumpText` | 跳过按钮的文案 | `string` | '跳过' |
40+
| `prevStepText`| 上一步按钮的文案 | `string` | '上一步' |
41+
| `nextStepText`| 下一步按钮的文案 | `string` | '下一步' |
42+
| `gotItText`| 知道了按钮的文案 | `string` | '知道了' |
3943

4044
### GuideTourItem
4145

src/GuideTour/props.ts

+24
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,37 @@ export interface IGuideTour extends IBaseProps {
6565
* @description 步骤改变回调
6666
*/
6767
onChange: (index: number) => boolean;
68+
/**
69+
* @description 上一步按钮文案
70+
* @default "上一步"
71+
*/
72+
prevStepText?: string;
73+
/**
74+
* @description 下一步按钮文案
75+
* @default "下一步"
76+
*/
77+
nextStepText?: string;
78+
/**
79+
* @description 知道了按钮文案
80+
* @default "知道了"
81+
*/
82+
gotItText?: string;
83+
/**
84+
* @description 跳过按钮文案
85+
* @default "跳过"
86+
*/
87+
jumpText?: string;
6888
}
6989

7090
export const GuideTourDefaultProps: Partial<IGuideTour> = {
7191
visible: false,
7292
swiperable: false,
7393
items: [],
7494
defaultCurrent: 0,
95+
gotItText: '知道了',
96+
nextStepText: '下一步',
97+
prevStepText: '上一步',
98+
jumpText: '跳过'
7599
};
76100

77101
export const GuideTourFunctionalProps: Partial<IGuideTour> = {

0 commit comments

Comments
 (0)