Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
020a66f9
提交
020a66f9
authored
10月 23, 2024
作者:
方治民
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 优化示例菜单命名,Chat 模块在 Android 下的顶部状态栏高度适配
上级
230ce021
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
43 行增加
和
13 行删除
+43
-13
index.vue
src/pages/example/chat/index.vue
+6
-1
index.vue
src/pages/example/index.vue
+37
-12
没有找到文件。
src/pages/example/chat/index.vue
浏览文件 @
020a66f9
...
...
@@ -43,6 +43,11 @@
webview
.
addEventListener
(
'loaded'
,
()
=>
{
let
paddingTop
=
'0px'
if
(
uni
.
getSystemInfoSync
().
platform
===
'android'
)
{
paddingTop
=
'30px'
}
webview
.
appendJsFile
(
'_www/static/uni.webview.1.5.6.js'
)
webview
.
evalJS
(
`
document.addEventListener('UniAppJSBridgeReady', function() {
...
...
@@ -60,7 +65,7 @@
// 隐藏底部描述和图片上传能力
var style = document.createElement('style')
style.id = 'no-security-webview-style'
style.innerHTML = 'footer, .semi-upload-add { display: none !important; } .close-btn { position: absolute; right: 12px; top:
18px; padding: 8px;
}'
style.innerHTML = 'footer, .semi-upload-add { display: none !important; } .close-btn { position: absolute; right: 12px; top:
calc(18px +
${
paddingTop
}
); padding: 8px; } html { padding-top: calc(0px +
${
paddingTop
}
)
}'
document.body.appendChild(style)
// 添加关闭按钮
...
...
src/pages/example/index.vue
浏览文件 @
020a66f9
<
script
setup
lang=
"ts"
>
import
*
as
Pages
from
'@/utils/pages'
interface
Item
{
name
:
string
icon
:
string
page
:
string
type
?:
'link'
|
'bottom'
animationType
?:
Pages
.
AnimationType
event
?:
()
=>
void
}
// @unocss-include
const
data
=
reactive
({
const
data
=
reactive
<
{
items
:
Item
[]
}
>
({
items
:
[
{
name
:
'Chat AI 示例'
,
icon
:
'emojione-cowboy-hat-face'
,
page
:
`/pages/example/chat/index?link=
${
encodeURIComponent
(
'https://api.coze.cn/open-platform/sdk/chatapp?params=%7B%22chatClientId%22%3A%22Hd1w0dc49QzvaAGlDONiA%22%2C%22chatConfig%22%3A%7B%22bot_id%22%3A%227426295021118488587%22%2C%22user%22%3A%22NmAh7FUtuyO6RPrzYMg4v%22%2C%22conversation_id%22%3A%22cqnuKy6c3lmYTdjF0vslj%22%7D%2C%22componentProps%22%3A%7B%22layout%22%3A%22mobile%22%2C%22lang%22%3A%22zh_CN%22%2C%22uploadable%22%3Atrue%2C%22title%22%3A%22%E6%B9%96%E5%8D%97%E5%A4%A9%E6%B0%94%20AI%20%E6%99%BA%E8%83%BD%E5%8A%A9%E7%90%86%22%2C%22icon%22%3A%22https%3A%2F%2Fhntq-res.oss-cn-shenzhen.aliyuncs.com%2Fhntq-ai-logo.png%22%7D%7D'
)}
`
,
animationType
:
'slide-in-bottom'
,
},
{
name
:
'Mapbox 地图示例'
,
name
:
'Mapbox 地图'
,
icon
:
'emojione-globe-showing-europe-africa'
,
page
:
'/pages/example/mapbox/index'
,
},
{
name
:
'Echarts
示例
'
,
name
:
'Echarts
图表
'
,
icon
:
'logos-chartblocks'
,
page
:
'/pages/example/echarts/index'
,
},
{
name
:
'Webview(本地) 示例'
,
name
:
'Chat AI 对话'
,
icon
:
'emojione-cowboy-hat-face'
,
page
:
`/pages/example/chat/index?link=
${
encodeURIComponent
(
'https://api.coze.cn/open-platform/sdk/chatapp?params=%7B%22chatClientId%22%3A%22Hd1w0dc49QzvaAGlDONiA%22%2C%22chatConfig%22%3A%7B%22bot_id%22%3A%227426295021118488587%22%2C%22user%22%3A%22NmAh7FUtuyO6RPrzYMg4v%22%2C%22conversation_id%22%3A%22cqnuKy6c3lmYTdjF0vslj%22%7D%2C%22componentProps%22%3A%7B%22layout%22%3A%22mobile%22%2C%22lang%22%3A%22zh_CN%22%2C%22uploadable%22%3Atrue%2C%22title%22%3A%22%E6%B9%96%E5%8D%97%E5%A4%A9%E6%B0%94%20AI%20%E6%99%BA%E8%83%BD%E5%8A%A9%E7%90%86%22%2C%22icon%22%3A%22https%3A%2F%2Fhntq-res.oss-cn-shenzhen.aliyuncs.com%2Fhntq-ai-logo.png%22%7D%7D'
)}
`
,
animationType
:
'slide-in-bottom'
,
},
{
name
:
'Webview(本地)'
,
icon
:
'vscode-icons-file-type-html'
,
page
:
`/pages/common/webview/index?link=
${
encodeURIComponent
(
'/hybrid/html/local.html'
)}
`
,
},
{
name
:
'Webview
(网络) 示例
'
,
name
:
'Webview
(网络)
'
,
icon
:
'logos-internetexplorer'
,
page
:
`/pages/common/webview/index?link=
${
encodeURIComponent
(
'https://uniapp.dcloud.io/static/web-view.html'
)}
`
,
},
{
name
:
'应用维护全屏通知'
,
icon
:
'twemoji-laptop'
,
page
:
'/pages/common/repair/index'
,
animationType
:
'fade-in'
,
},
],
})
function
to
(
item
:
Item
)
{
if
(
item
.
type
===
'bottom'
)
{
item
.
event
?.()
return
}
Pages
.
to
(
item
.
page
,
item
.
animationType
)
}
</
script
>
<
template
>
...
...
@@ -43,9 +67,10 @@
:bottomBorder=
"false"
radius=
"16rpx"
marginTop=
"24"
:padding=
"['20rpx', '32rpx']"
v-for=
"(item, idx) in data.items"
:key=
"idx"
@
click=
"
Pages.to(item.page, item.animationType as Pages.AnimationType
)"
@
click=
"
to(item
)"
>
<view
class=
"fui-list__item fui-align__center"
>
<Icon
:class=
"[`icon-$
{item.icon}`]" size="48" />
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论