-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: change demo card path & delete dead code for demo * fix: update size-factor logic for demo * chore: update hap.test snapshot
- Loading branch information
1 parent
511d1fd
commit 790efe1
Showing
13 changed files
with
137 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
packages/hap-dsl-xvm/templates/app/demo/src/CardDemo/index.ux
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
packages/hap-dsl-xvm/templates/app/demo/src/DemoDetail/index.ux
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
17 changes: 17 additions & 0 deletions
17
packages/hap-dsl-xvm/templates/app/demo/src/widgets/CardDemo/assets/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
$brand: #09ba07; | ||
|
||
$white: #ffffff; | ||
$black: #000000; | ||
$grey: #9393aa; | ||
$red: #fa0101; | ||
$yellow: #ffff00; | ||
|
||
// $size-factor 为 3px,对应的 designWidth 为 1080,长度使用:360的设计稿尺寸数字 * $size-factor | ||
// 如果 designWidth 设置为 360,可修改 $size-factor 为 1px | ||
$size-factor: 3px; | ||
|
||
@mixin flex-box-mixins($direction: row, $justify: center, $align-items: center) { | ||
flex-direction: $direction; | ||
justify-content: $justify; | ||
align-items: $align-items; | ||
} |
83 changes: 83 additions & 0 deletions
83
packages/hap-dsl-xvm/templates/app/demo/src/widgets/CardDemo/index.ux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<!-- | ||
Copyright (c) 2021-present, the hapjs-platform Project Contributors | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
<!-- | ||
注意:快应用和卡片混合工程在编译时会将所有资源打包到一个rpk中,在发布时会将卡片资源拆分出来独立分发, | ||
需要将卡片资源放置到卡片路径下,否则卡片无法加载对应资源。 | ||
--> | ||
|
||
<template> | ||
<!-- template里只能有一个根节点 --> | ||
<div class="card-wrapper"> | ||
<div class="title-wrapper"> | ||
<!-- 注意:本地图片资源需要存放到卡片路由路径下,否则发布时无法加载该图片,网络资源不受该限制 --> | ||
<image class="title-logo" src="./assets/logo_card.png"></image> | ||
<text class="title-txt">卡片标题</text> | ||
</div> | ||
<div class="content-wrapper"> | ||
<text class="content-txt">{{ des }}</text> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<!-- 注意:卡片运行时不会加载app.ux,请不要在app.ux中添加卡片相关逻辑 --> | ||
<script> | ||
export default { | ||
private: { | ||
text: '欢迎使用快应用卡片', | ||
des: | ||
'卡片是一种轻量级的快应用,快应用卡片使快应用能够在其他app和系统里提供可扩展的app功能' | ||
}, | ||
onInit() { | ||
console.log('card onInit >>>>') | ||
}, | ||
onShow() { | ||
console.log('card onShow >>>>') | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import './assets/styles.scss'; | ||
|
||
.card-wrapper { | ||
@include flex-box-mixins(column, flex-start, center); | ||
flex: 1; | ||
padding: 16dp; | ||
|
||
.content-wrapper { | ||
@include flex-box-mixins(column, center, center); | ||
width: 100%; | ||
flex: 1; | ||
|
||
.content-txt { | ||
width: 100%; | ||
text-align: center; | ||
font-size: 14 * $size-factor; | ||
line-height: 20 * $size-factor; | ||
color: $black; | ||
} | ||
} | ||
|
||
.title-wrapper { | ||
@include flex-box-mixins(row, flex-start, center); | ||
width: 100%; | ||
height: 16 * $size-factor; | ||
|
||
.title-logo { | ||
width: 16 * $size-factor; | ||
height: 16 * $size-factor; | ||
} | ||
|
||
.title-txt { | ||
line-height: 16 * $size-factor; | ||
font-size: 16 * $size-factor; | ||
margin-left: 4 * $size-factor; | ||
} | ||
} | ||
} | ||
|
||
|
||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ Thumbs.db | |
*.iml | ||
.idea/ | ||
.vscode/ | ||
.history/ | ||
node_modules/ | ||
!fixtures/deps-app/node_modules/ | ||
/lib | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters