Skip to content

Commit 08d59f1

Browse files
committed
feat: copilot suggestion dev
1 parent 55a9907 commit 08d59f1

File tree

20 files changed

+412
-79
lines changed

20 files changed

+412
-79
lines changed
+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
<view class="navigation-bar"/>
2+
13
<view>button page</view>
2-
<copilot-button />
4+
<ant-copilot-button />
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
/// #if WECHAT
3-
"navigationBarTitleText": "",
3+
"navigationBarTitleText": "Copilotbutton",
44
/// #endif
55

66
/// #if ALIPAY
7-
"defaultTitle": "",
7+
"defaultTitle": "Copilotbutton",
8+
"transparentTitle": "auto",
9+
"titlePenetrate": "YES",
810
/// #endif
911

1012
"usingComponents": {
11-
"copilot-button": "../../../src/Copilotbutton/index"
13+
"ant-copilot-button": "../../../src/Copilotbutton/index"
1214
},
1315
"transparentTitle": "always"
1416
}

copilot-demo/pages/Prompts/index.axml

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
<view class="navigation-bar"/>
22

33
<ant-container title="基础用法">
4-
<prompts
5-
list="{{ baseList }}"
4+
<ant-prompts
5+
list="{{ baseList }}"
66
promptsTitle="{{ promptsTitle }}"
77
onTapPromptsItem="onTapPromptsItem" />
88
</ant-container>
99

1010
<ant-container title="有箭头">
11-
<prompts
12-
list="{{ arrowList }}"
11+
<ant-prompts
12+
list="{{ arrowList }}"
1313
promptsTitle="{{ promptsTitle }}"
1414
onTapPromptsItem="onTapPromptsItem" />
1515
</ant-container>
1616

1717
<ant-container title="样式覆盖">
18-
<prompts
19-
list="{{ styleList }}"
18+
<ant-prompts
19+
list="{{ styleList }}"
2020
className="customizeStyle"
2121
promptsTitle="{{ promptsTitle }}"
2222
onTapPromptsItem="onTapPromptsItem" />
2323
</ant-container>
2424

2525
<ant-container title="自定义提示标题">
26-
<prompts
27-
list="{{ arrowList }}"
26+
<ant-prompts
27+
list="{{ arrowList }}"
2828
onTapPromptsItem="onTapPromptsItem">
2929
<view slot="prompts-title" class="customize-prompts-title">
3030
自定义提示标题:
3131
</view>
32-
</prompts>
32+
</ant-prompts>
3333
</ant-container>
3434

3535
<ant-container title="自定义提示项">
36-
<prompts
37-
list="{{ baseList }}"
36+
<ant-prompts
37+
list="{{ baseList }}"
3838
onTapPromptsItem="onTapPromptsItem">
3939
<view slot="prompts-item" slot-scope="props" class="customize-prompts-item">
4040
自定义提示项:{{ props.item.title }}
4141
</view>
42-
</prompts>
42+
</ant-prompts>
4343
</ant-container>
4444

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
/// #if WECHAT
3-
"navigationBarTitleText": "",
3+
"navigationBarTitleText": "Prompts",
44
/// #endif
55

66
/// #if ALIPAY
7-
"defaultTitle": "Prompts 组件",
7+
"defaultTitle": "Prompts",
8+
"transparentTitle": "auto",
9+
"titlePenetrate": "YES",
810
/// #endif
911

1012
"usingComponents": {
1113
"ant-container": "../../../src/Container/index",
12-
"prompts": "../../../src/Prompts/index"
13-
},
14-
"transparentTitle": "always"
14+
"ant-prompts": "../../../src/Prompts/index"
15+
}
1516
}
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<view class="navigation-bar"/>
2+
3+
<ant-container title="基础用法">
4+
<ant-suggestion
5+
items="{{items1}}"
6+
onSelect="handleSelect"
7+
/>
8+
</ant-container>
9+
10+
<ant-container title="支持 ant-icon">
11+
<ant-suggestion
12+
items="{{items2}}"
13+
onSelect="handleSelect"
14+
/>
15+
</ant-container>
16+
17+
<!-- #if ALIPAY -->
18+
<ant-container title="插槽">
19+
<ant-suggestion
20+
items="{{items2}}"
21+
onSelect="handleSelect"
22+
>
23+
<view slot-scope="prop" a:if="{{prop.index === 0}}">
24+
<ant-icon type="PictureOutline"/>
25+
</view>
26+
<view slot-scope="prop" a:if="{{prop.item.value === 'suggestion'}}">
27+
<ant-icon type="VideoOutline"/>
28+
</view>
29+
</ant-suggestion>
30+
</ant-container>
31+
<!-- #endif -->
32+
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
/// #if WECHAT
3+
"navigationBarTitleText": "Suggestion",
4+
/// #endif
5+
6+
/// #if ALIPAY
7+
"defaultTitle": "Suggestion",
8+
"transparentTitle": "auto",
9+
"titlePenetrate": "YES",
10+
/// #endif
11+
12+
"usingComponents": {
13+
"ant-suggestion": "../../../src/Suggestion/index",
14+
"ant-container": "../../../src/Container/index",
15+
"ant-icon": "../../../src/Icon/index"
16+
}
17+
}

copilot-demo/pages/Suggestion/index.less

Whitespace-only changes.
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Page({
2+
data: {
3+
items1: [
4+
{
5+
icon: 'https://mdn.alipayobjects.com/huamei_2jrq4g/afts/img/A*AdC9RZfDwicAAAAAAAAAAAAADtF8AQ/original',
6+
label: '我的日程',
7+
value: 'schedule',
8+
},
9+
{
10+
icon: 'https://mdn.alipayobjects.com/huamei_2jrq4g/afts/img/A*Mbi1R5eGTecAAAAAAAAAAAAADtF8AQ/original',
11+
label: '快捷功能',
12+
value: 'suggestion',
13+
},
14+
{
15+
icon: 'https://mdn.alipayobjects.com/huamei_2jrq4g/afts/img/A*WqBJSZEpPbwAAAAAAAAAAAAADtF8AQ/original',
16+
label: '诊断分析',
17+
value: 'analyze',
18+
},
19+
{
20+
icon: 'https://mdn.alipayobjects.com/huamei_2jrq4g/afts/img/A*fVpIQZbRi4IAAAAAAAAAAAAADtF8AQ/original',
21+
label: '更多',
22+
value: 'more',
23+
},
24+
],
25+
items2: [
26+
{
27+
icon: 'UserOutline',
28+
label: '我的日程',
29+
value: 'schedule',
30+
},
31+
{
32+
icon: 'UnorderedListOutline',
33+
label: '快捷功能',
34+
value: 'suggestion',
35+
},
36+
{
37+
icon: 'HistogramOutline',
38+
label: '诊断分析',
39+
value: 'analyze',
40+
},
41+
{
42+
icon: 'MoreOutline',
43+
label: '更多',
44+
value: 'SendOutline',
45+
},
46+
],
47+
},
48+
handleSelect(item) {
49+
/// #if ALIPAY
50+
console.log(item);
51+
my.showToast({ content: item.value });
52+
/// #endif
53+
},
54+
});

0 commit comments

Comments
 (0)