Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
74a9be23
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6373
Star
108
Fork
184
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
24
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
24
Issue
24
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
74a9be23
编写于
4月 25, 2025
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(harmony): 上架做无网处理
上级
333d04b2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
111 addition
and
20 deletion
+111
-20
App.uvue
App.uvue
+14
-3
pages/tabBar/API.uvue
pages/tabBar/API.uvue
+17
-0
pages/tabBar/component.uvue
pages/tabBar/component.uvue
+17
-0
pages/tabBar/template.uvue
pages/tabBar/template.uvue
+18
-1
pages/template/swiper-vertical-video/swiper-vertical-video.uvue
...template/swiper-vertical-video/swiper-vertical-video.uvue
+36
-13
store/index.uts
store/index.uts
+9
-3
未找到文件。
App.uvue
浏览文件 @
74a9be23
<script lang="uts">
<script lang="uts">
import { state, setLifeCycleNum,
checkSystemTheme
} from '@/store/index.uts'
import { state, setLifeCycleNum,
checkSystemTheme, setNetless
} from '@/store/index.uts'
// #ifdef APP-ANDROID
// #ifdef APP-ANDROID
let firstBackTime = 0
let firstBackTime = 0
...
@@ -68,10 +68,21 @@
...
@@ -68,10 +68,21 @@
})
})
}
}
}
}
})
})
// #ifdef APP-HARMONY
uni.getNetworkType({
success(res) {
setNetless(res.networkType === 'none')
}
})
uni.onNetworkStatusChange((res) => {
setNetless(res.isConnected === false)
})
// #endif
}
}
// #endif
// #endif
// 获取系统主题
// 获取系统主题
checkSystemTheme();
checkSystemTheme();
...
...
pages/tabBar/API.uvue
浏览文件 @
74a9be23
...
@@ -81,8 +81,25 @@
...
@@ -81,8 +81,25 @@
},
},
isDarkMode() : boolean {
isDarkMode() : boolean {
return state.isDarkMode
return state.isDarkMode
},
netless() : boolean {
return state.netless
}
},
// #ifdef APP-HARMONY
watch: {
'netless': {
immediate: true,
handler(netless) {
if (netless) {
this.menu = this.menu.filter(item => {
return !['unicloud'].includes(item.id)
})
}
}
}
}
},
},
// #endif
methods: {
methods: {
goPage(url : string) {
goPage(url : string) {
if (url == '/set-tab-bar') {
if (url == '/set-tab-bar') {
...
...
pages/tabBar/component.uvue
浏览文件 @
74a9be23
...
@@ -69,8 +69,25 @@
...
@@ -69,8 +69,25 @@
},
},
isDarkMode() : boolean {
isDarkMode() : boolean {
return state.isDarkMode
return state.isDarkMode
},
netless() : boolean {
return state.netless
}
}
},
},
// #ifdef APP-HARMONY
watch: {
'netless': {
immediate: true,
handler(netless) {
if (netless) {
this.menu = this.menu.filter(item => {
return !['unicloud'].includes(item.id)
})
}
}
}
},
// #endif
methods: {
methods: {
goPage(url : string) {
goPage(url : string) {
if (this.hasLeftWin) {
if (this.hasLeftWin) {
...
...
pages/tabBar/template.uvue
浏览文件 @
74a9be23
...
@@ -251,8 +251,25 @@
...
@@ -251,8 +251,25 @@
},
},
isDarkMode() : boolean {
isDarkMode() : boolean {
return state.isDarkMode
return state.isDarkMode
},
netless() : boolean {
return state.netless
}
},
// #ifdef APP-HARMONY
watch: {
'netless': {
immediate: true,
handler(netless) {
if (netless) {
this.list = this.list.filter(item => {
return !['list-news'].includes(item.id)
})
}
}
}
}
},
},
// #endif
methods: {
methods: {
triggerCollapse(index : number, item : ListItem) {
triggerCollapse(index : number, item : ListItem) {
if (item.pages.length == 0) {
if (item.pages.length == 0) {
...
@@ -319,4 +336,4 @@
...
@@ -319,4 +336,4 @@
.uni-panel-h {
.uni-panel-h {
padding: 12px 18px;
padding: 12px 18px;
}
}
</style>
</style>
pages/template/swiper-vertical-video/swiper-vertical-video.uvue
浏览文件 @
74a9be23
...
@@ -30,7 +30,8 @@
...
@@ -30,7 +30,8 @@
type ListItem = { _id : string, content : string, src : string, poster_src : string }
type ListItem = { _id : string, content : string, src : string, poster_src : string }
let page : number = 0,
let page : number = 0,
currentPageIsShow : boolean = true;
currentPageIsShow : boolean = true;
import { state, setNetless } from '@/store/index.uts'
export default {
export default {
components: {},
components: {},
data() {
data() {
...
@@ -45,8 +46,17 @@
...
@@ -45,8 +46,17 @@
}
}
},
},
created() {
created() {
this.list = this.getData()
// #ifdef APP-HARMONY
this.visibleList = this.list.slice(0, 3)
uni.getNetworkType({
success: (res) => {
setNetless(res.networkType === 'none')
// #endif
this.list = this.getData()
this.visibleList = this.list.slice(0, 3)
// #ifdef APP-HARMONY
}
})
// #endif
},
},
watch: {
watch: {
current(current : number, oldCurrent : number) {
current(current : number, oldCurrent : number) {
...
@@ -155,17 +165,30 @@
...
@@ -155,17 +165,30 @@
}
}
},
},
getData() : ListItem[] {
getData() : ListItem[] {
let videoUrlList = [
let videoUrlList = state.netless
'https://web-ext-storage.dcloud.net.cn/uni-app-x/video/uts-5-16.mp4',
? [
'https://web-ext-storage.dcloud.net.cn/uni-app-x/video/uni-ai-5-16.mp4',
'/static/test-video/10second-demo.mp4',
'https://web-ext-storage.dcloud.net.cn/uni-app-x/video/uni-verify-5-16.mp4'
'/static/test-video/10second-demo.mp4',
] as string[]
'/static/test-video/10second-demo.mp4'
]
: [
'https://web-ext-storage.dcloud.net.cn/uni-app-x/video/uts-5-16.mp4',
'https://web-ext-storage.dcloud.net.cn/uni-app-x/video/uni-ai-5-16.mp4',
'https://web-ext-storage.dcloud.net.cn/uni-app-x/video/uni-verify-5-16.mp4'
] as string[]
let posterSrcList = state.netless
? [
'/static/shuijiao.jpg',
'/static/logo.jpg',
'/static/shuijiao.jpg'
]
: [
'https://web-ext-storage.dcloud.net.cn/uni-app-x/dark-uni-uts-01.png',
'https://web-ext-storage.dcloud.net.cn/uni-app-x/dark-uni-ai-01.png',
'https://web-ext-storage.dcloud.net.cn/uni-app-x/dark-uni-verify-01.jpg'
] as string[]
let posterSrcList = [
'https://web-ext-storage.dcloud.net.cn/uni-app-x/dark-uni-uts-01.png',
'https://web-ext-storage.dcloud.net.cn/uni-app-x/dark-uni-ai-01.png',
'https://web-ext-storage.dcloud.net.cn/uni-app-x/dark-uni-verify-01.jpg'
] as string[]
let list = [] as ListItem[];
let list = [] as ListItem[];
for (let i = 0; i < 6; i++) {
for (let i = 0; i < 6; i++) {
...
...
store/index.uts
浏览文件 @
74a9be23
...
@@ -28,7 +28,9 @@ type State = {
...
@@ -28,7 +28,9 @@ type State = {
// 是否同意截屏
// 是否同意截屏
allowCapture: boolean,
allowCapture: boolean,
// 是否暗黑主题(适配web端)
// 是否暗黑主题(适配web端)
isDarkMode: boolean
isDarkMode: boolean
// 是否无网环境
netless: boolean
}
}
const getAgreePrivacy = () => {
const getAgreePrivacy = () => {
...
@@ -60,7 +62,8 @@ export const state = reactive({
...
@@ -60,7 +62,8 @@ export const state = reactive({
},
},
agreeToPrivacy: getAgreePrivacy(),
agreeToPrivacy: getAgreePrivacy(),
allowCapture: true,
allowCapture: true,
isDarkMode:false
isDarkMode:false,
netless: false
} as State)
} as State)
export const setLifeCycleNum = (num : number) => {
export const setLifeCycleNum = (num : number) => {
...
@@ -125,5 +128,8 @@ export const checkSystemTheme = () => {
...
@@ -125,5 +128,8 @@ export const checkSystemTheme = () => {
})
})
// #endif
// #endif
}
}
export const setNetless = (netless: boolean) => {
state.netless = netless
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录