Skip to content

Commit

Permalink
fix: 统一demo样式
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherso1a committed Jan 24, 2025
1 parent 5301904 commit 8352839
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 81 deletions.
4 changes: 3 additions & 1 deletion copilot-demo/pages/Actions/index.axml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<view class="navigation-bar" />

<ant-container title="基础用法">
<ant-actions items="{{basicActions}}" onItemTap="handleTapAction" />
</ant-container>

<ant-container title="配合bubble使用">
<ant-container title="配合 Bubble 使用">
<ant-switch checked="{{ showBubble }}" onChange="toggleBubble" />
<ant-bubble
a:if="{{ showBubble }}"
Expand Down
2 changes: 2 additions & 0 deletions copilot-demo/pages/Actions/index.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

/// #if ALIPAY
"defaultTitle": "Actions",
"transparentTitle": "auto",
"titlePenetrate": "YES",
/// #endif

"usingComponents": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
/// #if WECHAT
"navigationBarTitleText": "Bubble",
/// #endif

/// #if ALIPAY
"defaultTitle": "Bubble",
"transparentTitle": "auto",
"titlePenetrate": "YES",
/// #endif
"usingComponents": {
"ant-bubble": "../../../src/Bubble/index",
"ant-actions": "../../../src/Actions/index",
Expand Down
4 changes: 0 additions & 4 deletions copilot-demo/pages/Bubble/index.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.navigation-bar {
height: var(--tf-status-bar-height);
}

.ant-copilot-bubble-name {
font-weight: 400;
font-size: 24rpx;
Expand Down
109 changes: 52 additions & 57 deletions copilot-demo/pages/Sender/index.axml
Original file line number Diff line number Diff line change
@@ -1,61 +1,56 @@
<view class="page">
<view class="content">
<ant-container title="基础用法">
<ant-sender value="{{value}}" onChange="handleChange" onSubmit="handleSend" />
</ant-container>
<view class="navigation-bar" />

<ant-container title="发送loading状态">
<ant-sender
value="{{value1}}"
placeholder="输入你想说的话..."
onChange="handleChange1"
onSubmit="handleSend1"
onCancel="handleCancel"
loading="{{loading}}"
/>
</ant-container>

<ant-container title="禁用状态">
<ant-sender disabled="{{true}}" placeholder="输入框已禁用" />
</ant-container>
<ant-container title="基础用法">
<ant-sender value="{{value}}" onChange="handleChange" onSubmit="handleSend" />
</ant-container>

<ant-container title="发送 loading 状态">
<ant-sender
value="{{value1}}"
placeholder="输入你想说的话..."
onChange="handleChange1"
onSubmit="handleSend1"
onCancel="handleCancel"
loading="{{loading}}"
/>
</ant-container>

<ant-container title="配合upload组件">
<ant-sender
value="{{value3}}"
placeholder="可以配合其他组件使用"
onChange="handleChange3"
onSubmit="handleSend3"
>
<view slot="input-header">
<ant-upload defaultFileList="{{[{ url: 'https://gw.alipayobjects.com/mdn/rms_226d75/afts/img/A*znK_ToIL8rQAAAAAAAAAAAAAARQnAQ', status: 'done' }]}}" />
</view>
</ant-sender>
</ant-container>
<ant-container title="禁用状态">
<ant-sender disabled="{{true}}" placeholder="输入框已禁用" />
</ant-container>

<ant-container title="配合bubble和prompts">
<scroll-view scroll-y style="height: 600rpx;" scroll-into-view="{{scrollToView}}">
<view a:for="{{bubbleList}}" id="msg-{{index}}">
<ant-bubble
content="{{item.content}}"
placement="{{index%2 ? 'end' : 'start'}}"
shape="{{index%2 ? 'corner' : 'default'}}"
typing="{{index%2 === 0}}"
/>
</view>
</scroll-view>
<ant-sender
value="{{value4}}"
placeholder="组合使用"
onChange="handleChange4"
onSubmit="handleSend4"
>
<ant-prompts
slot="header"
items="{{horizontalList}}"
vertical="{{false}}"
onItemTap="onItemTap"
></ant-prompts>
</ant-sender>
</ant-container>
</view>
</view>
<ant-container title="配合 ImageUpload 组件">
<ant-sender
value="{{value3}}"
placeholder="可以配合其他组件使用"
onChange="handleChange3"
onSubmit="handleSend3"
>
<view slot="input-header">
<ant-upload defaultFileList="{{[{ url: 'https://gw.alipayobjects.com/mdn/rms_226d75/afts/img/A*znK_ToIL8rQAAAAAAAAAAAAAARQnAQ', status: 'done' }]}}" />
</view>
</ant-sender>
</ant-container>

<ant-container title="配合 Bubble 和 Prompts">
<scroll-view scroll-y style="height: 600rpx;" scroll-into-view="{{scrollToView}}">
<view a:for="{{bubbleList}}" id="msg-{{index}}">
<ant-bubble
content="{{item.content}}"
placement="{{index%2 ? 'end' : 'start'}}"
shape="{{index%2 ? 'corner' : 'default'}}"
typing="{{index%2 === 0}}"
/>
</view>
</scroll-view>
<ant-sender value="{{value4}}" placeholder="组合使用" onChange="handleChange4" onSubmit="handleSend4">
<ant-prompts
slot="header"
items="{{horizontalList}}"
vertical="{{false}}"
onItemTap="onItemTap"
>
</ant-prompts>
</ant-sender>
</ant-container>
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
/// #if WECHAT
"navigationBarTitleText": "Sender",
/// #endif

/// #if ALIPAY
"defaultTitle": "Sender",
"transparentTitle": "auto",
"titlePenetrate": "YES",
/// #endif
"usingComponents": {
"ant-sender": "../../../src/Sender/index",
"ant-upload": "../../../src/ImageUpload/index",
Expand Down
15 changes: 0 additions & 15 deletions copilot-demo/pages/Sender/index.less
Original file line number Diff line number Diff line change
@@ -1,15 +0,0 @@
.page {
min-height: 100vh;
background: var(--color-background);
box-sizing: border-box;
padding-bottom: 200rpx;
}

.navigation-bar {
margin-bottom: 24rpx;
height: var(--tf-status-bar-height);
}

.content {
padding: 24rpx;
}
6 changes: 4 additions & 2 deletions copilot-demo/pages/ThoughtChain/index.json5
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
/// #if WECHAT
"navigationBarTitleText": "ThoughtChain 组件",
"navigationBarTitleText": "ThoughtChain",
/// #endif

/// #if ALIPAY
"defaultTitle": "ThoughtChain 组件",
"defaultTitle": "ThoughtChain",
"transparentTitle": "auto",
"titlePenetrate": "YES",
/// #endif

"usingComponents": {
Expand Down
6 changes: 4 additions & 2 deletions copilot-demo/pages/Welcome/index.json5
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
/// #if WECHAT
"navigationBarTitleText": "Welcome 组件",
"navigationBarTitleText": "Welcome",
/// #endif

/// #if ALIPAY
"defaultTitle": "Welcome 组件",
"defaultTitle": "Welcome",
"transparentTitle": "auto",
"titlePenetrate": "YES",
/// #endif

"usingComponents": {
Expand Down

0 comments on commit 8352839

Please sign in to comment.