提交 1c2eb11f 编写于 作者: 杜庆泉's avatar 杜庆泉

新增实例创建测试示例

上级 92a1a39c
...@@ -2,132 +2,117 @@ ...@@ -2,132 +2,117 @@
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path" : "pages/index/index", "path": "pages/index/index",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/advance/advance", "path": "pages/advance/advance",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/SystemAPI/SystemAPI", "path": "pages/SystemAPI/SystemAPI",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/SystemAPI/Alert/alert", "path": "pages/SystemAPI/Alert/alert",
"style" : "style": {
{
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{ {
"path" : "pages/component/helloView", "path": "pages/component/helloView",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/SDKIntegration/SDKIntegration", "path": "pages/SDKIntegration/SDKIntegration",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/SDKIntegration/TencentLocation/TencentLocation", "path": "pages/SDKIntegration/TencentLocation/TencentLocation",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/SDKIntegration/Lottie/index", "path": "pages/SDKIntegration/Lottie/index",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/SDKIntegration/Toast/Toast", "path": "pages/SDKIntegration/Toast/Toast",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/lifecycle/lifecycle", "path": "pages/lifecycle/lifecycle",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/resource/resource", "path": "pages/resource/resource",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/advance/android/decorview", "path": "pages/advance/android/decorview",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/advance/iOS/getResourcePath", "path": "pages/advance/iOS/getResourcePath",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/advance/android/assetaudio", "path": "pages/advance/android/assetaudio",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/SystemAPI/ScreenListen/screenlisten", "path": "pages/SystemAPI/ScreenListen/screenlisten",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
...@@ -135,9 +120,8 @@ ...@@ -135,9 +120,8 @@
}, },
{ {
"path" : "pages/SyntaxCase/index", "path": "pages/SyntaxCase/index",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
...@@ -145,27 +129,33 @@ ...@@ -145,27 +129,33 @@
}, },
{ {
"path" : "pages/SyntaxCase/paramTest", "path": "pages/SyntaxCase/paramTest",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/SyntaxCase/consoleTest", "path": "pages/SyntaxCase/consoleTest",
"style" : "style": {
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/test/index", "path": "pages/SyntaxCase/instanceTest",
"style" : "style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/test/index",
"style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
...@@ -186,7 +176,7 @@ ...@@ -186,7 +176,7 @@
"pagePath": "pages/advance/advance", "pagePath": "pages/advance/advance",
"text": "进阶" "text": "进阶"
}, { }, {
"pagePath":"pages/SystemAPI/SystemAPI", "pagePath": "pages/SystemAPI/SystemAPI",
"text": "系统API" "text": "系统API"
}, { }, {
"pagePath": "pages/SDKIntegration/SDKIntegration", "pagePath": "pages/SDKIntegration/SDKIntegration",
......
<template>
{{ret}}
<button @click="instanceCreate">多实例创建测试</button>
</template>
<script>
import {
User
} from '@/uni_modules/uts-advance'
export default {
data() {
return {
ret:''
}
},
methods: {
instanceCreate() {
const user1 = new User("张三", 20);
let userText1 = user1.describeSelf()
const user2 = new User("李四", 30);
let userText2 = user2.describeSelf()
const user3 = new User("王五", 40);
let userText3 = user3.describeSelf()
if(userText1 == userText2 || userText1 == userText3 || userText2 == userText3){
this.ret = '测试未通过'
}else{
this.ret = '测试通过'
}
}
}
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
</uni-list-item> </uni-list-item>
<uni-list-item @tap="testConsole" title="日志打印示例" :clickable="true" link> <uni-list-item @tap="testConsole" title="日志打印示例" :clickable="true" link>
</uni-list-item> </uni-list-item>
<uni-list-item @tap="testInstance" title="实例测试示例" :clickable="true" link>
</uni-list-item>
<uni-list-item @tap="testGrammar" title="基础语法测试例" :clickable="true" link> <uni-list-item @tap="testGrammar" title="基础语法测试例" :clickable="true" link>
</uni-list-item> </uni-list-item>
</uni-list> </uni-list>
...@@ -205,6 +207,11 @@ ...@@ -205,6 +207,11 @@
url: '/pages/test/index' url: '/pages/test/index'
}) })
}, },
testInstance: function() {
uni.navigateTo({
url: '/pages/SyntaxCase/instanceTest'
})
},
testGetResourcePath: function() { testGetResourcePath: function() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/advance/iOS/getResourcePath' url: '/pages/advance/iOS/getResourcePath'
......
...@@ -454,5 +454,21 @@ export function quitApp(){ ...@@ -454,5 +454,21 @@ export function quitApp(){
UTSAndroid.quitApp() UTSAndroid.quitApp()
} }
export class User {
private name : string;
private age : Int;
constructor(hostP : string, port : Int) {
this.name = hostP;
this.age = port;
}
describeSelf():string{
let text = "name = " + this.name + ";age = " + this.age
return text
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册