Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
Hello UTS
提交
b4b4bc52
H
Hello UTS
项目概览
DCloud
/
Hello UTS
通知
1595
Star
27
Fork
9
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
Hello UTS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b4b4bc52
编写于
7月 17, 2023
作者:
Y
yurj26
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: uvue error
上级
eb4f2ce9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
102 addition
and
77 deletion
+102
-77
pages/advance/advance.uvue
pages/advance/advance.uvue
+102
-77
未找到文件。
pages/advance/advance.uvue
浏览文件 @
b4b4bc52
...
@@ -3,13 +3,14 @@
...
@@ -3,13 +3,14 @@
<page-head :title="title"></page-head>
<page-head :title="title"></page-head>
<view class="uni-panel" v-for="(item, index) in list" :key="index">
<view class="uni-panel" v-for="(item, index) in list" :key="index">
<view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index
, item
)">
<view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index)">
<text class="uni-panel-text">{{item.name}}</text>
<text class="uni-panel-text">{{item.name}}</text>
<image :src="item.pages.length > 0 ? item.open ? arrowUpIcon : arrowDownIcon : arrowRightIcon"
<image :src="item.pages.length > 0 ? item.open ? arrowUpIcon : arrowDownIcon : arrowRightIcon"
class="uni-icon"></image>
class="uni-icon"></image>
</view>
</view>
<view class="uni-panel-c" v-if="item.open">
<view class="uni-panel-c" v-if="item.open">
<view class="uni-navigate-item" v-for="(page,key) in item.pages" :key="key" @click="goDetailPage(page)" hover-class="uni-navigate-item-active">
<view class="uni-navigate-item" v-for="(page,key) in item.pages" :key="key" @click="goDetailPage(page)"
hover-class="uni-navigate-item-active">
<text class="uni-navigate-text">{{page.name}}</text>
<text class="uni-navigate-text">{{page.name}}</text>
<image :src="arrowRightIcon" class="uni-icon" v-if="page.url"></image>
<image :src="arrowRightIcon" class="uni-icon" v-if="page.url"></image>
</view>
</view>
...
@@ -24,9 +25,22 @@
...
@@ -24,9 +25,22 @@
clearIntervalTask,
clearIntervalTask,
playAssetAudio,
playAssetAudio,
getMetaConfig,
getMetaConfig,
quitApp
quitApp,
TimerOptions
} from "../../uni_modules/uts-advance";
} from "../../uni_modules/uts-advance";
type Page = {
name : string,
url ?: string
function ?: string
}
type ListItem = {
name : string,
open : boolean,
pages : Page[],
}
export default {
export default {
data() {
data() {
return {
return {
...
@@ -34,67 +48,65 @@
...
@@ -34,67 +48,65 @@
taskId: 0,
taskId: 0,
list: [{
list: [{
name: "延迟任务",
name: "延迟任务",
open: false,
open: false,
pages: [{
pages: [{
name: "开启延迟任务",
name: "开启延迟任务",
function: "testTimer"
function: "testTimer"
}]
}] as Page[]
},
},
{
{
name: "定时任务",
name: "定时任务",
open: false,
open: false,
pages: [{
pages: [{
name: "开启定时任务",
name: "开启定时任务",
function: "testInterval"
function: "testInterval"
}, {
}, {
name: "关闭定时任务",
name: "关闭定时任务",
function: "testClearInterval"
function: "testClearInterval"
}]
}] as Page[]
},
},
{
{
name: "语法示例",
name: "语法示例",
open: false,
open: false,
pages: [{
pages: [{
name: "进阶语法示例",
name: "进阶语法示例",
url: "SyntaxCase/index"
url: "SyntaxCase/index"
}, {
}, {
name: "参数传递示例",
name: "参数传递示例",
url: "SyntaxCase/paramTest"
url: "SyntaxCase/paramTest"
},{
}, {
name: "实例测试示例",
name: "实例测试示例",
url: "SyntaxCase/instanceTest"
url: "SyntaxCase/instanceTest"
}]
}] as Page[]
},
},
{
{
name: "日志打印",
name: "日志打印",
open: false,
open: false,
pages: [{
pages: [{
name: "console示例",
name: "console示例",
url: "SyntaxCase/consoleTest"
url: "SyntaxCase/consoleTest"
}]
}] as Page[]
},
},
{
{
name: "平台代码示例",
name: "平台代码示例",
open: false,
open: false,
pages: [{
pages: [{
name: "UTSAndroid",
name: "UTSAndroid",
url: "SyntaxCase/utsAndroid"
url: "SyntaxCase/utsAndroid"
}, {
}, {
name: "UTSiOS",
name: "UTSiOS",
url: "SyntaxCase/utsiOS"
url: "SyntaxCase/utsiOS"
}]
}] as Page[]
},
},
] as ListItem[],
],
arrowUpIcon: '/static/icons/arrow-up.png',
arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png',
arrowDownIcon: '/static/icons/arrow-down.png',
arrowRightIcon: '/static/icons/arrow-right.png',
arrowRightIcon: '/static/icons/arrow-right.png',
}
}
},
},
methods: {
methods: {
triggerCollapse(index) {
triggerCollapse(index
: number
) {
for (var i = 0; i < this.list.length; ++i) {
for (var i = 0; i < this.list.length; ++i) {
if (index == i) {
if (index == i) {
this.list[i].open = !this.list[i].open;
this.list[i].open = !this.list[i].open;
...
@@ -103,9 +115,20 @@
...
@@ -103,9 +115,20 @@
}
}
}
}
},
},
goDetailPage(e) {
goDetailPage(e : Page) {
if (e.function) {
if (e.function != null) {
this[e.function]()
const funName = e.function
switch (funName) {
case 'testTimer':
this.testTimer()
break
case 'testInterval':
this.testInterval()
break
case 'testClearInterval':
this.testClearInterval()
break
}
return
return
}
}
uni.navigateTo({
uni.navigateTo({
...
@@ -116,54 +139,56 @@
...
@@ -116,54 +139,56 @@
/**
/**
* 测试延迟任务
* 测试延迟任务
*/
*/
testTimer: function() {
testTimer: function
() {
doTimerTask({
doTimerTask({
start: function(response) {
start: function
(response) {
uni.showToast({
uni.showToast({
title: response,
title: response,
icon: 'none'
icon: 'none'
});
});
},
},
work: function(response) {
work: function
(response) {
uni.showToast({
uni.showToast({
title: response,
title: response,
icon: 'none'
icon: 'none'
});
});
},
},
});
}
as TimerOptions
);
},
},
/**
/**
* 测试周期任务
* 测试周期任务
*/
*/
testInterval: function() {
testInterval: function
() {
var ret = doIntervalTask({
var ret = doIntervalTask({
start: function(response) {
start: function
(response) {
uni.showToast({
uni.showToast({
title: response,
title: response,
icon: 'none'
icon: 'none'
});
});
},
},
work: function(response) {
work: function
(response) {
uni.showToast({
uni.showToast({
title: response,
title: response,
icon: 'none'
icon: 'none'
});
});
},
},
});
} as TimerOptions);
this.taskId = ret.taskId;
if (ret.taskId != null) {
this.taskId = ret.taskId!;
}
},
},
/**
/**
* 取消周期任务
* 取消周期任务
*/
*/
testClearInterval: function() {
testClearInterval: function
() {
console.log(this.taskId);
console.log(this.taskId);
clearIntervalTask(this.taskId);
clearIntervalTask(this.taskId);
},
},
testInputDialog() {
//
testInputDialog() {
getUserInput(function
(res) {
// getUserInput(function
(res) {
console.log(res);
//
console.log(res);
});
//
});
},
//
},
testQuitApp() {
testQuitApp() {
quitApp()
quitApp()
},
},
...
@@ -184,6 +209,6 @@
...
@@ -184,6 +209,6 @@
@import '@/common/uni-uvue.css';
@import '@/common/uni-uvue.css';
.uni-container {
.uni-container {
min-height: 100%;
/* min-height: 100%; */
}
}
</style>
</style>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录