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

新增实例创建测试示例

上级 92a1a39c
{ {
"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": "",
{ "enablePullDownRefresh": false
"navigationBarTitleText": "", }
"enablePullDownRefresh": false },
} {
}, "path": "pages/SystemAPI/SystemAPI",
{ "style": {
"path" : "pages/SystemAPI/SystemAPI", "navigationBarTitleText": "",
"style" : "enablePullDownRefresh": false
{ }
"navigationBarTitleText": "",
"enablePullDownRefresh": false },
} {
"path": "pages/SystemAPI/Alert/alert",
}, "style": {
{ "navigationBarTitleText": ""
"path" : "pages/SystemAPI/Alert/alert", }
"style" :
{ },
"navigationBarTitleText": "" {
} "path": "pages/component/helloView",
"style": {
}, "navigationBarTitleText": "",
{ "enablePullDownRefresh": false
"path" : "pages/component/helloView", }
"style" : },
{ {
"navigationBarTitleText": "", "path": "pages/SDKIntegration/SDKIntegration",
"enablePullDownRefresh": false "style": {
} "navigationBarTitleText": "",
}, "enablePullDownRefresh": false
{ }
"path" : "pages/SDKIntegration/SDKIntegration",
"style" : },
{ {
"navigationBarTitleText": "", "path": "pages/SDKIntegration/TencentLocation/TencentLocation",
"enablePullDownRefresh": false "style": {
} "navigationBarTitleText": "",
"enablePullDownRefresh": false
}, }
{
"path" : "pages/SDKIntegration/TencentLocation/TencentLocation", },
"style" : {
{ "path": "pages/SDKIntegration/Lottie/index",
"navigationBarTitleText": "", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "",
} "enablePullDownRefresh": false
}
},
{ },
"path" : "pages/SDKIntegration/Lottie/index", {
"style" : "path": "pages/SDKIntegration/Toast/Toast",
{ "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/SDKIntegration/Toast/Toast", "path": "pages/lifecycle/lifecycle",
"style" : "style": {
{ "navigationBarTitleText": "",
"navigationBarTitleText": "", "enablePullDownRefresh": false
"enablePullDownRefresh": false }
}
},
}, {
{ "path": "pages/resource/resource",
"path" : "pages/lifecycle/lifecycle", "style": {
"style" : "navigationBarTitleText": "",
{ "enablePullDownRefresh": false
"navigationBarTitleText": "", }
"enablePullDownRefresh": false
} },
{
}, "path": "pages/advance/android/decorview",
{ "style": {
"path" : "pages/resource/resource", "navigationBarTitleText": "",
"style" : "enablePullDownRefresh": false
{ }
"navigationBarTitleText": "",
"enablePullDownRefresh": false },
} {
"path": "pages/advance/iOS/getResourcePath",
}, "style": {
{ "navigationBarTitleText": "",
"path" : "pages/advance/android/decorview", "enablePullDownRefresh": false
"style" : }
{
"navigationBarTitleText": "", },
"enablePullDownRefresh": false {
} "path": "pages/advance/android/assetaudio",
"style": {
}, "navigationBarTitleText": "",
{ "enablePullDownRefresh": false
"path" : "pages/advance/iOS/getResourcePath", }
"style" :
{ },
"navigationBarTitleText": "", {
"enablePullDownRefresh": false "path": "pages/SystemAPI/ScreenListen/screenlisten",
} "style": {
"navigationBarTitleText": "",
}, "enablePullDownRefresh": false
{ }
"path" : "pages/advance/android/assetaudio",
"style" : },
{
"navigationBarTitleText": "", {
"enablePullDownRefresh": false "path": "pages/SyntaxCase/index",
} "style": {
"navigationBarTitleText": "",
}, "enablePullDownRefresh": false
{ }
"path" : "pages/SystemAPI/ScreenListen/screenlisten",
"style" : },
{
"navigationBarTitleText": "", {
"enablePullDownRefresh": false "path": "pages/SyntaxCase/paramTest",
} "style": {
"navigationBarTitleText": "",
}, "enablePullDownRefresh": false
}
{
"path" : "pages/SyntaxCase/index", },
"style" : {
{ "path": "pages/SyntaxCase/consoleTest",
"navigationBarTitleText": "", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "",
} "enablePullDownRefresh": false
}
},
},
{ {
"path" : "pages/SyntaxCase/paramTest", "path": "pages/SyntaxCase/instanceTest",
"style" : "style": {
{ "navigationBarTitleText": "",
"navigationBarTitleText": "", "enablePullDownRefresh": false
"enablePullDownRefresh": false }
}
},
},
{ {
"path" : "pages/SyntaxCase/consoleTest", "path": "pages/test/index",
"style" : "style": {
{ "navigationBarTitleText": "",
"navigationBarTitleText": "", "enablePullDownRefresh": false
"enablePullDownRefresh": false }
} }
},
{ ],
"path" : "pages/test/index",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"tabBar": { "tabBar": {
"color": "#7A7E83", "color": "#7A7E83",
"selectedColor": "#007AFF", "selectedColor": "#007AFF",
...@@ -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",
...@@ -201,4 +191,4 @@ ...@@ -201,4 +191,4 @@
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },
"uniIdRouter": {} "uniIdRouter": {}
} }
\ No newline at end of file
<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.
先完成此消息的编辑!
想要评论请 注册