@hap-toolkit/dsl-xvm 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +51 -51
- package/device-json-template/config-tv.json +14 -14
- package/package.json +5 -5
- package/readme.md +3 -3
- package/templates/app/demo/.eslintignore +6 -6
- package/templates/app/demo/.eslintrc.json +66 -66
- package/templates/app/demo/.gitignore +25 -25
- package/templates/app/demo/.prettierignore +6 -6
- package/templates/app/demo/README.md +11 -11
- package/templates/app/demo/_gitignore +16 -16
- package/templates/app/demo/package.json +54 -54
- package/templates/app/demo/scripts/gen/index.js +92 -92
- package/templates/app/demo/scripts/gen/template.ux +32 -32
- package/templates/app/demo/scripts/selfCloseInputTag.js +41 -41
- package/templates/app/demo/src/app.ux +22 -22
- package/templates/app/demo/src/assets/styles/mixins.scss +5 -5
- package/templates/app/demo/src/assets/styles/style.scss +2 -2
- package/templates/app/demo/src/assets/styles/variables.scss +11 -11
- package/templates/app/demo/src/global.js +38 -38
- package/templates/app/demo/src/helper/ajax.js +67 -67
- package/templates/app/demo/src/helper/apis/example.js +25 -25
- package/templates/app/demo/src/helper/apis/index.js +16 -16
- package/templates/app/demo/src/helper/utils.js +31 -31
- package/templates/app/demo/src/manifest.json +70 -70
- package/templates/app/demo/src/pages/Demo/index.ux +72 -72
- package/templates/app/demo/src/pages/DemoDetail/index.ux +63 -63
- package/templates/app/demo/src/sitemap.json +3 -3
- package/templates/app/demo/src/widgets/CardDemo/assets/styles.scss +16 -16
- package/templates/app/demo/src/widgets/CardDemo/index.ux +83 -83
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021-present, the hapjs-platform Project Contributors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import $ajax from '../ajax'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @desc 在实际开发中,您可以将 baseUrl 替换为您的请求地址前缀;
|
|
10
|
-
*
|
|
11
|
-
* 已将 $apis 挂载在 global,您可以通过如下方式,进行调用:
|
|
12
|
-
* $apis.example.getSomeApi().then().catch().finally()
|
|
13
|
-
*
|
|
14
|
-
* 备注:如果您不需要发起请求,删除 apis 目录,以及 app.ux 中引用即可;
|
|
15
|
-
*/
|
|
16
|
-
const baseUrl = 'https://api.exampel.com/'
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
getSomeApi(data) {
|
|
20
|
-
return $ajax.get(`${baseUrl}your-project-api`, data)
|
|
21
|
-
},
|
|
22
|
-
postOtherApi(data) {
|
|
23
|
-
return $ajax.post(`${baseUrl}your-project-api`, data)
|
|
24
|
-
},
|
|
25
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-present, the hapjs-platform Project Contributors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import $ajax from '../ajax'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @desc 在实际开发中,您可以将 baseUrl 替换为您的请求地址前缀;
|
|
10
|
+
*
|
|
11
|
+
* 已将 $apis 挂载在 global,您可以通过如下方式,进行调用:
|
|
12
|
+
* $apis.example.getSomeApi().then().catch().finally()
|
|
13
|
+
*
|
|
14
|
+
* 备注:如果您不需要发起请求,删除 apis 目录,以及 app.ux 中引用即可;
|
|
15
|
+
*/
|
|
16
|
+
const baseUrl = 'https://api.exampel.com/'
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
getSomeApi(data) {
|
|
20
|
+
return $ajax.get(`${baseUrl}your-project-api`, data)
|
|
21
|
+
},
|
|
22
|
+
postOtherApi(data) {
|
|
23
|
+
return $ajax.post(`${baseUrl}your-project-api`, data)
|
|
24
|
+
},
|
|
25
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021-present, the hapjs-platform Project Contributors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const files = require.context('.', true, /\.js/)
|
|
7
|
-
const modules = {}
|
|
8
|
-
|
|
9
|
-
files.keys().forEach((key) => {
|
|
10
|
-
if (key === './index.js') {
|
|
11
|
-
return
|
|
12
|
-
}
|
|
13
|
-
modules[key.replace(/(^\.\/|\.js$)/g, '')] = files(key).default
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
export default modules
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-present, the hapjs-platform Project Contributors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const files = require.context('.', true, /\.js/)
|
|
7
|
+
const modules = {}
|
|
8
|
+
|
|
9
|
+
files.keys().forEach((key) => {
|
|
10
|
+
if (key === './index.js') {
|
|
11
|
+
return
|
|
12
|
+
}
|
|
13
|
+
modules[key.replace(/(^\.\/|\.js$)/g, '')] = files(key).default
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export default modules
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021-present, the hapjs-platform Project Contributors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 您可以将常用的方法、或系统 API,统一封装,暴露全局,以便各页面、组件调用,而无需 require / import.
|
|
8
|
-
*/
|
|
9
|
-
const prompt = require('@system.prompt')
|
|
10
|
-
|
|
11
|
-
function queryString(url, query) {
|
|
12
|
-
let str = []
|
|
13
|
-
for (let key in query) {
|
|
14
|
-
str.push(key + '=' + query[key])
|
|
15
|
-
}
|
|
16
|
-
let paramStr = str.join('&')
|
|
17
|
-
return paramStr ? `${url}?${paramStr}` : url
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function showToast(message = '', duration = 0) {
|
|
21
|
-
if (!message) return
|
|
22
|
-
prompt.showToast({
|
|
23
|
-
message: message,
|
|
24
|
-
duration,
|
|
25
|
-
})
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default {
|
|
29
|
-
showToast,
|
|
30
|
-
queryString,
|
|
31
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-present, the hapjs-platform Project Contributors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 您可以将常用的方法、或系统 API,统一封装,暴露全局,以便各页面、组件调用,而无需 require / import.
|
|
8
|
+
*/
|
|
9
|
+
const prompt = require('@system.prompt')
|
|
10
|
+
|
|
11
|
+
function queryString(url, query) {
|
|
12
|
+
let str = []
|
|
13
|
+
for (let key in query) {
|
|
14
|
+
str.push(key + '=' + query[key])
|
|
15
|
+
}
|
|
16
|
+
let paramStr = str.join('&')
|
|
17
|
+
return paramStr ? `${url}?${paramStr}` : url
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function showToast(message = '', duration = 0) {
|
|
21
|
+
if (!message) return
|
|
22
|
+
prompt.showToast({
|
|
23
|
+
message: message,
|
|
24
|
+
duration,
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
showToast,
|
|
30
|
+
queryString,
|
|
31
|
+
}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
{
|
|
2
|
-
"package": "com.example.demo",
|
|
3
|
-
"name": "快应用示例模版",
|
|
4
|
-
"versionName": "1.0.0",
|
|
5
|
-
"versionCode": 1,
|
|
6
|
-
"minPlatformVersion": 1070,
|
|
7
|
-
"icon": "/assets/images/logo.png",
|
|
8
|
-
"features": [{
|
|
9
|
-
"name": "system.prompt"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"name": "system.router"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"name": "system.shortcut"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"name": "system.fetch"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"permissions": [{
|
|
22
|
-
"origin": "*"
|
|
23
|
-
}],
|
|
24
|
-
"template/official": "demo-template",
|
|
25
|
-
"config": {
|
|
26
|
-
"logLevel": "debug",
|
|
27
|
-
"designWidth": 1080
|
|
28
|
-
},
|
|
29
|
-
"router": {
|
|
30
|
-
"entry": "pages/Demo",
|
|
31
|
-
"pages": {
|
|
32
|
-
"pages/Demo": {
|
|
33
|
-
"component": "index"
|
|
34
|
-
},
|
|
35
|
-
"pages/DemoDetail": {
|
|
36
|
-
"component": "index"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"widgets": {
|
|
40
|
-
"widgets/CardDemo": {
|
|
41
|
-
"name": "卡片名称4x2",
|
|
42
|
-
"description": "快应用卡片展示",
|
|
43
|
-
"component": "index",
|
|
44
|
-
"path": "/widgets/CardDemo",
|
|
45
|
-
"minPlatformVersion": 1032,
|
|
46
|
-
"params": {
|
|
47
|
-
"size": "4x2"
|
|
48
|
-
},
|
|
49
|
-
"targetManufacturers": [
|
|
50
|
-
"vivo", "OPPO", "xiaomi"
|
|
51
|
-
],
|
|
52
|
-
"features": []
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"display": {
|
|
57
|
-
"titleBarBackgroundColor": "#f2f2f2",
|
|
58
|
-
"titleBarTextColor": "#414141",
|
|
59
|
-
"menu": true,
|
|
60
|
-
"pages": {
|
|
61
|
-
"pages/Demo": {
|
|
62
|
-
"titleBarText": "快应用示例模版",
|
|
63
|
-
"menu": false
|
|
64
|
-
},
|
|
65
|
-
"pages/DemoDetail": {
|
|
66
|
-
"titleBarText": "详情页"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"package": "com.example.demo",
|
|
3
|
+
"name": "快应用示例模版",
|
|
4
|
+
"versionName": "1.0.0",
|
|
5
|
+
"versionCode": 1,
|
|
6
|
+
"minPlatformVersion": 1070,
|
|
7
|
+
"icon": "/assets/images/logo.png",
|
|
8
|
+
"features": [{
|
|
9
|
+
"name": "system.prompt"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "system.router"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "system.shortcut"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "system.fetch"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"permissions": [{
|
|
22
|
+
"origin": "*"
|
|
23
|
+
}],
|
|
24
|
+
"template/official": "demo-template",
|
|
25
|
+
"config": {
|
|
26
|
+
"logLevel": "debug",
|
|
27
|
+
"designWidth": 1080
|
|
28
|
+
},
|
|
29
|
+
"router": {
|
|
30
|
+
"entry": "pages/Demo",
|
|
31
|
+
"pages": {
|
|
32
|
+
"pages/Demo": {
|
|
33
|
+
"component": "index"
|
|
34
|
+
},
|
|
35
|
+
"pages/DemoDetail": {
|
|
36
|
+
"component": "index"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"widgets": {
|
|
40
|
+
"widgets/CardDemo": {
|
|
41
|
+
"name": "卡片名称4x2",
|
|
42
|
+
"description": "快应用卡片展示",
|
|
43
|
+
"component": "index",
|
|
44
|
+
"path": "/widgets/CardDemo",
|
|
45
|
+
"minPlatformVersion": 1032,
|
|
46
|
+
"params": {
|
|
47
|
+
"size": "4x2"
|
|
48
|
+
},
|
|
49
|
+
"targetManufacturers": [
|
|
50
|
+
"vivo", "OPPO", "xiaomi"
|
|
51
|
+
],
|
|
52
|
+
"features": []
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"display": {
|
|
57
|
+
"titleBarBackgroundColor": "#f2f2f2",
|
|
58
|
+
"titleBarTextColor": "#414141",
|
|
59
|
+
"menu": true,
|
|
60
|
+
"pages": {
|
|
61
|
+
"pages/Demo": {
|
|
62
|
+
"titleBarText": "快应用示例模版",
|
|
63
|
+
"menu": false
|
|
64
|
+
},
|
|
65
|
+
"pages/DemoDetail": {
|
|
66
|
+
"titleBarText": "详情页"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright (c) 2021-present, the hapjs-platform Project Contributors
|
|
3
|
-
SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
-->
|
|
5
|
-
|
|
6
|
-
<template>
|
|
7
|
-
<!-- template里只能有一个根节点 -->
|
|
8
|
-
<div class="wrapper">
|
|
9
|
-
<text class="title">{{ title }}</text>
|
|
10
|
-
<!-- 点击跳转详情页 -->
|
|
11
|
-
<input
|
|
12
|
-
class="btn"
|
|
13
|
-
type="button"
|
|
14
|
-
value="跳转到详情页"
|
|
15
|
-
onclick="onDetailBtnClick"
|
|
16
|
-
/>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
import router from '@system.router'
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
// 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
|
|
25
|
-
private: {
|
|
26
|
-
title: '欢迎体验快应用开发'
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
onInit() {
|
|
30
|
-
// --------------------------------- Optimize SEO Start
|
|
31
|
-
// 当 titlebar 的文案与搜索的标题不一致时,请先设置 titlebar
|
|
32
|
-
// 备注:this.$page.setMeta 需要引擎 1090 版本及以上才支持,因此这段做注释处理;
|
|
33
|
-
// this.$page.setTitleBar({ text: 'setTitlebar 设置的标题' })
|
|
34
|
-
// this.$page.setMeta({
|
|
35
|
-
// title: '快应用示例模版',
|
|
36
|
-
// description:
|
|
37
|
-
// '快应用是移动互联网新型应用生态,与手机系统深度整合,为用户提供更加场景化的体验。具备传统APP完整的应用体验,但无需安装、即点即用。'
|
|
38
|
-
// })
|
|
39
|
-
// --------------------------------- Optimize SEO End
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
onDetailBtnClick() {
|
|
43
|
-
// 跳转到应用内的某个页面,router用法详见:文档 -> 接口 -> 页面路由
|
|
44
|
-
router.push({
|
|
45
|
-
uri: '/pages/DemoDetail'
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<style lang="scss">
|
|
52
|
-
@import './../../assets/styles/style.scss';
|
|
53
|
-
|
|
54
|
-
.wrapper {
|
|
55
|
-
@include flex-box-mixins(column, center, center);
|
|
56
|
-
.title {
|
|
57
|
-
font-size: 18 * $size-factor;
|
|
58
|
-
text-align: center;
|
|
59
|
-
color: $black;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.btn {
|
|
63
|
-
width: 150 * $size-factor;
|
|
64
|
-
height: 42 * $size-factor;
|
|
65
|
-
border-radius: 21 * $size-factor;
|
|
66
|
-
background-color: $brand;
|
|
67
|
-
color: $white;
|
|
68
|
-
font-size: 16 * $size-factor;
|
|
69
|
-
margin-top: 20 * $size-factor;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
</style>
|
|
1
|
+
<!--
|
|
2
|
+
Copyright (c) 2021-present, the hapjs-platform Project Contributors
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<!-- template里只能有一个根节点 -->
|
|
8
|
+
<div class="wrapper">
|
|
9
|
+
<text class="title">{{ title }}</text>
|
|
10
|
+
<!-- 点击跳转详情页 -->
|
|
11
|
+
<input
|
|
12
|
+
class="btn"
|
|
13
|
+
type="button"
|
|
14
|
+
value="跳转到详情页"
|
|
15
|
+
onclick="onDetailBtnClick"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import router from '@system.router'
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
// 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
|
|
25
|
+
private: {
|
|
26
|
+
title: '欢迎体验快应用开发'
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
onInit() {
|
|
30
|
+
// --------------------------------- Optimize SEO Start
|
|
31
|
+
// 当 titlebar 的文案与搜索的标题不一致时,请先设置 titlebar
|
|
32
|
+
// 备注:this.$page.setMeta 需要引擎 1090 版本及以上才支持,因此这段做注释处理;
|
|
33
|
+
// this.$page.setTitleBar({ text: 'setTitlebar 设置的标题' })
|
|
34
|
+
// this.$page.setMeta({
|
|
35
|
+
// title: '快应用示例模版',
|
|
36
|
+
// description:
|
|
37
|
+
// '快应用是移动互联网新型应用生态,与手机系统深度整合,为用户提供更加场景化的体验。具备传统APP完整的应用体验,但无需安装、即点即用。'
|
|
38
|
+
// })
|
|
39
|
+
// --------------------------------- Optimize SEO End
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
onDetailBtnClick() {
|
|
43
|
+
// 跳转到应用内的某个页面,router用法详见:文档 -> 接口 -> 页面路由
|
|
44
|
+
router.push({
|
|
45
|
+
uri: '/pages/DemoDetail'
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style lang="scss">
|
|
52
|
+
@import './../../assets/styles/style.scss';
|
|
53
|
+
|
|
54
|
+
.wrapper {
|
|
55
|
+
@include flex-box-mixins(column, center, center);
|
|
56
|
+
.title {
|
|
57
|
+
font-size: 18 * $size-factor;
|
|
58
|
+
text-align: center;
|
|
59
|
+
color: $black;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.btn {
|
|
63
|
+
width: 150 * $size-factor;
|
|
64
|
+
height: 42 * $size-factor;
|
|
65
|
+
border-radius: 21 * $size-factor;
|
|
66
|
+
background-color: $brand;
|
|
67
|
+
color: $white;
|
|
68
|
+
font-size: 16 * $size-factor;
|
|
69
|
+
margin-top: 20 * $size-factor;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright (c) 2021-present, the hapjs-platform Project Contributors
|
|
3
|
-
SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
-->
|
|
5
|
-
|
|
6
|
-
<template>
|
|
7
|
-
<!-- template里只能有一个根节点 -->
|
|
8
|
-
<div class="wrapper">
|
|
9
|
-
<text class="title">{{ text }}</text>
|
|
10
|
-
<text class="desc"
|
|
11
|
-
>快应用是移动互联网新型应用生态,与手机系统深度整合,为用户提供更加场景化的体验。具备传统APP完整的应用体验,但无需安装、即点即用。
|
|
12
|
-
</text>
|
|
13
|
-
<text class="desc"
|
|
14
|
-
>标准是由主流手机厂商组成的快应用联盟联合制定。其标准的诞生将在研发接口、能力接入、开发者服务等层面建设标准平台,以平台化的生态模式对个人开发者和企业开发者全品类开放
|
|
15
|
-
</text>
|
|
16
|
-
<input
|
|
17
|
-
class="btn"
|
|
18
|
-
type="button"
|
|
19
|
-
value="欢迎使用"
|
|
20
|
-
onclick="onWelcomeBtnClick"
|
|
21
|
-
/>
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<script>
|
|
26
|
-
export default {
|
|
27
|
-
private: {
|
|
28
|
-
text: '快应用是什么?'
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
onWelcomeBtnClick() {
|
|
32
|
-
$utils.showToast('快应用:复杂生活的简单答案,让生活更顺畅')
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<style lang="scss">
|
|
38
|
-
@import './../../assets/styles/style.scss';
|
|
39
|
-
|
|
40
|
-
.wrapper {
|
|
41
|
-
@include flex-box-mixins(column, center, center);
|
|
42
|
-
margin: 0 16 * $size-factor;
|
|
43
|
-
.title {
|
|
44
|
-
font-size: 18 * $size-factor;
|
|
45
|
-
text-align: center;
|
|
46
|
-
color: $black;
|
|
47
|
-
}
|
|
48
|
-
.desc {
|
|
49
|
-
margin-top: 18 * $size-factor;
|
|
50
|
-
color: $grey;
|
|
51
|
-
font-size: 16 * $size-factor;
|
|
52
|
-
}
|
|
53
|
-
.btn {
|
|
54
|
-
width: 150 * $size-factor;
|
|
55
|
-
height: 42 * $size-factor;
|
|
56
|
-
border-radius: 21 * $size-factor;
|
|
57
|
-
background-color: $brand;
|
|
58
|
-
color: $white;
|
|
59
|
-
font-size: 16 * $size-factor;
|
|
60
|
-
margin-top: 20 * $size-factor;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
</style>
|
|
1
|
+
<!--
|
|
2
|
+
Copyright (c) 2021-present, the hapjs-platform Project Contributors
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<!-- template里只能有一个根节点 -->
|
|
8
|
+
<div class="wrapper">
|
|
9
|
+
<text class="title">{{ text }}</text>
|
|
10
|
+
<text class="desc"
|
|
11
|
+
>快应用是移动互联网新型应用生态,与手机系统深度整合,为用户提供更加场景化的体验。具备传统APP完整的应用体验,但无需安装、即点即用。
|
|
12
|
+
</text>
|
|
13
|
+
<text class="desc"
|
|
14
|
+
>标准是由主流手机厂商组成的快应用联盟联合制定。其标准的诞生将在研发接口、能力接入、开发者服务等层面建设标准平台,以平台化的生态模式对个人开发者和企业开发者全品类开放
|
|
15
|
+
</text>
|
|
16
|
+
<input
|
|
17
|
+
class="btn"
|
|
18
|
+
type="button"
|
|
19
|
+
value="欢迎使用"
|
|
20
|
+
onclick="onWelcomeBtnClick"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
export default {
|
|
27
|
+
private: {
|
|
28
|
+
text: '快应用是什么?'
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
onWelcomeBtnClick() {
|
|
32
|
+
$utils.showToast('快应用:复杂生活的简单答案,让生活更顺畅')
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style lang="scss">
|
|
38
|
+
@import './../../assets/styles/style.scss';
|
|
39
|
+
|
|
40
|
+
.wrapper {
|
|
41
|
+
@include flex-box-mixins(column, center, center);
|
|
42
|
+
margin: 0 16 * $size-factor;
|
|
43
|
+
.title {
|
|
44
|
+
font-size: 18 * $size-factor;
|
|
45
|
+
text-align: center;
|
|
46
|
+
color: $black;
|
|
47
|
+
}
|
|
48
|
+
.desc {
|
|
49
|
+
margin-top: 18 * $size-factor;
|
|
50
|
+
color: $grey;
|
|
51
|
+
font-size: 16 * $size-factor;
|
|
52
|
+
}
|
|
53
|
+
.btn {
|
|
54
|
+
width: 150 * $size-factor;
|
|
55
|
+
height: 42 * $size-factor;
|
|
56
|
+
border-radius: 21 * $size-factor;
|
|
57
|
+
background-color: $brand;
|
|
58
|
+
color: $white;
|
|
59
|
+
font-size: 16 * $size-factor;
|
|
60
|
+
margin-top: 20 * $size-factor;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"rules": [{ "rule": "enable", "page": "*" }]
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"rules": [{ "rule": "enable", "page": "*" }]
|
|
3
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
$brand: #09ba07;
|
|
2
|
-
|
|
3
|
-
$white: #ffffff;
|
|
4
|
-
$black: #000000;
|
|
5
|
-
$grey: #9393aa;
|
|
6
|
-
$red: #fa0101;
|
|
7
|
-
$yellow: #ffff00;
|
|
8
|
-
|
|
9
|
-
// $size-factor 为 3px,对应的 designWidth 为 1080,长度使用:360的设计稿尺寸数字 * $size-factor
|
|
10
|
-
// 如果 designWidth 设置为 360,可修改 $size-factor 为 1px
|
|
11
|
-
$size-factor: 3px;
|
|
12
|
-
|
|
13
|
-
@mixin flex-box-mixins($direction: row, $justify: center, $align-items: center) {
|
|
14
|
-
flex-direction: $direction;
|
|
15
|
-
justify-content: $justify;
|
|
16
|
-
align-items: $align-items;
|
|
1
|
+
$brand: #09ba07;
|
|
2
|
+
|
|
3
|
+
$white: #ffffff;
|
|
4
|
+
$black: #000000;
|
|
5
|
+
$grey: #9393aa;
|
|
6
|
+
$red: #fa0101;
|
|
7
|
+
$yellow: #ffff00;
|
|
8
|
+
|
|
9
|
+
// $size-factor 为 3px,对应的 designWidth 为 1080,长度使用:360的设计稿尺寸数字 * $size-factor
|
|
10
|
+
// 如果 designWidth 设置为 360,可修改 $size-factor 为 1px
|
|
11
|
+
$size-factor: 3px;
|
|
12
|
+
|
|
13
|
+
@mixin flex-box-mixins($direction: row, $justify: center, $align-items: center) {
|
|
14
|
+
flex-direction: $direction;
|
|
15
|
+
justify-content: $justify;
|
|
16
|
+
align-items: $align-items;
|
|
17
17
|
}
|