Skip to content

Commit 52437e4

Browse files
committed
chore: solve conflicts
2 parents 7999320 + ddaf664 commit 52437e4

39 files changed

+894
-476
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<view class="navigation-bar"/>
2+
3+
<ant-container title="基础用法">
4+
<ant-conversations
5+
items="{{items}}"
6+
menus="{{menus}}"
7+
onItemTap="handleItemTap"
8+
onMenuItemTap="handleMenuItemTap"
9+
/>
10+
</ant-container>
11+
12+
<!-- #if ALIPAY -->
13+
<ant-container title="自定义插槽">
14+
<ant-conversations
15+
items="{{items.slice(2,5)}}"
16+
menus="{{menus}}"
17+
onItemTap="handleItemTap"
18+
onMenuItemTap="handleMenuItemTap"
19+
>
20+
<view slot-scope="props">
21+
<view style="color: #1677ff;">{{props.item.label}}</view>
22+
<view style="color: #bbbbbb;">{{props.item.description}}</view>
23+
</view>
24+
</ant-conversations>
25+
</ant-container>
26+
<!-- #endif -->
27+
28+
<ant-container title="抽屉中展示">
29+
<ant-button onTap="handleOpenHistory" inline size="small">历史记录</ant-button>
30+
<ant-popup
31+
className="history-popup"
32+
visible="{{ visible }}"
33+
height="{{ 250 }}"
34+
width="{{ 250 }}"
35+
position="left"
36+
animation
37+
onClose="handlePopupClose"
38+
>
39+
<ant-conversations
40+
items="{{items}}"
41+
menus="{{menus}}"
42+
onItemTap="handleItemTap"
43+
onMenuItemTap="handleMenuItemTap"
44+
/>
45+
</ant-popup>
46+
</ant-container>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
/// #if WECHAT
3+
"navigationBarTitleText": "Conversations",
4+
/// #endif
5+
6+
/// #if ALIPAY
7+
"defaultTitle": "Conversations",
8+
"transparentTitle": "auto",
9+
"titlePenetrate": "YES",
10+
/// #endif
11+
12+
"usingComponents": {
13+
"ant-container": "../../../src/Container/index",
14+
"ant-conversations": "../../../src/Conversations/index",
15+
"ant-popup": "../../../src/Popup/index",
16+
"ant-button": "../../../src/Button/index"
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.history-popup {
2+
.ant-popup-transform-left {
3+
/// #if ALIPAY
4+
padding-top: 90px;
5+
/// #endif
6+
}
7+
}
+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
Page({
2+
data: {
3+
visible: false,
4+
items: [
5+
{
6+
key: '1',
7+
label: '给我推荐一首歌',
8+
description: '这是会话的部分富文本信息描述',
9+
icon: 'https://randomuser.me/api/portraits/thumb/women/4.jpg',
10+
timestamp: '10:23',
11+
disabled: false,
12+
},
13+
{
14+
key: '2',
15+
label: '请根据图片里的提示,写一篇小学二年级的数学题目',
16+
description:
17+
'这首歌来自英国歌手艾德·希兰旋律轻快,歌曲写自上个世纪落日',
18+
icon: '',
19+
timestamp: '10:22',
20+
disabled: false,
21+
},
22+
{
23+
key: '3',
24+
label: '禁用无法点击此条',
25+
description: '这是会话的部分富文本信息描述',
26+
icon: '',
27+
timestamp: '10:21',
28+
disabled: true,
29+
},
30+
{
31+
key: '4',
32+
label: '菜单禁用无法滑动',
33+
description: '这是会话的部分富文本信息描述',
34+
icon: '',
35+
timestamp: '10:18',
36+
disabled: false,
37+
disabledMenu: true,
38+
},
39+
{
40+
key: '5',
41+
label: '给我推荐一首歌',
42+
description: '这是会话的部分富文本信息描述',
43+
icon: '',
44+
timestamp: '09:11',
45+
disabled: false,
46+
},
47+
],
48+
menus: [
49+
{
50+
text: '编辑',
51+
bgColor: '#FFA91B',
52+
color: '#fff',
53+
width: 160,
54+
},
55+
{
56+
text: '删除',
57+
bgColor: '#FF2B00',
58+
color: '#fff',
59+
width: 160,
60+
},
61+
],
62+
},
63+
handleItemTap(i) {
64+
let item = i;
65+
/// #if ALIPAY
66+
console.log(item);
67+
my.showToast({ content: item.key });
68+
/// #endif
69+
/// #if WECHAT
70+
item = i.detail[0];
71+
console.log(item);
72+
// @ts-ignore
73+
wx.showToast({ title: item.key });
74+
/// #endif
75+
},
76+
handleMenuItemTap(menuItem, item) {
77+
/// #if ALIPAY
78+
console.log(menuItem, item);
79+
my.showToast({ content: `菜单${menuItem.index}_列表项${item.key}` });
80+
/// #endif
81+
/// #if WECHAT
82+
console.log(menuItem.detail[0], menuItem.detail[1]);
83+
// @ts-ignore
84+
wx.showToast({
85+
title: `菜单${menuItem.detail[0].index}_列表项${menuItem.detail[1].key}`,
86+
});
87+
/// #endif
88+
},
89+
90+
handleOpenHistory() {
91+
this.setData({
92+
visible: true,
93+
});
94+
},
95+
handlePopupClose() {
96+
this.setData({
97+
visible: false,
98+
});
99+
},
100+
});

copilot-demo/pages/Prompts/index.axml

+32-7
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,66 @@
44
<ant-prompts
55
list="{{ baseList }}"
66
promptsTitle="{{ promptsTitle }}"
7-
onTapPromptsItem="onTapPromptsItem" />
7+
onItemTap="onItemTap" />
88
</ant-container>
99

1010
<ant-container title="有箭头">
1111
<ant-prompts
1212
list="{{ arrowList }}"
1313
promptsTitle="{{ promptsTitle }}"
14-
onTapPromptsItem="onTapPromptsItem" />
14+
onItemTap="onItemTap" />
1515
</ant-container>
1616

1717
<ant-container title="样式覆盖">
1818
<ant-prompts
1919
list="{{ styleList }}"
2020
className="customizeStyle"
2121
promptsTitle="{{ promptsTitle }}"
22-
onTapPromptsItem="onTapPromptsItem" />
22+
onItemTap="onItemTap" />
23+
</ant-container>
24+
25+
<ant-container title="横向展示">
26+
<ant-prompts
27+
promptsTitle="超长滑动"
28+
list="{{ horizontalList }}"
29+
vertical="{{false}}"
30+
onItemTap="onItemTap"
31+
/>
32+
<ant-prompts
33+
promptsTitle="超长换行"
34+
list="{{ horizontalList }}"
35+
vertical="{{false}}"
36+
wrap
37+
onItemTap="onItemTap"
38+
/>
39+
<ant-prompts
40+
promptsTitle="自定义"
41+
list="{{ horizontalList }}"
42+
vertical="{{false}}"
43+
wrap
44+
onItemTap="onItemTap"
45+
>
46+
<view slot="prompts-item" slot-scope="props">自定义:{{ props.item.label }}</view>
47+
</ant-prompts>
2348
</ant-container>
2449

2550
<!-- #if ALIPAY -->
2651
<ant-container title="自定义提示标题">
2752
<ant-prompts
2853
list="{{ arrowList }}"
29-
onTapPromptsItem="onTapPromptsItem">
54+
onItemTap="onItemTap">
3055
<view slot="prompts-title" class="customize-prompts-title">
31-
自定义提示标题:
56+
我可以帮助您:
3257
</view>
3358
</ant-prompts>
3459
</ant-container>
3560

3661
<ant-container title="自定义提示项">
3762
<ant-prompts
3863
list="{{ baseList }}"
39-
onTapPromptsItem="onTapPromptsItem">
64+
onItemTap="onItemTap">
4065
<view slot="prompts-item" slot-scope="props" class="customize-prompts-item">
41-
自定义提示项:{{ props.item.title }}
66+
自定义提示项:{{ props.item.label }}
4267
</view>
4368
</ant-prompts>
4469
</ant-container>

copilot-demo/pages/Prompts/index.less

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ page {
1212
}
1313

1414
.customize-prompts-title {
15-
color: #ff0000;
16-
font-weight: 500;
17-
font-size: 48rpx;
15+
color: #b76b01;
16+
font: 500;
17+
font-size: 36rpx;
1818
padding-bottom: 24rpx;
1919
}
2020

0 commit comments

Comments
 (0)