init
这个提交包含在:
父节点
072a435205
当前提交
f7c6e451e7
3
.gitmodules
vendored
普通文件
3
.gitmodules
vendored
普通文件
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "HarmonyOSBaseLibs"]
|
||||||
|
path = HarmonyOSBaseLibs
|
||||||
|
url = https://xuqinmin.com/xuqinmin12/HarmonyOSBaseLibs.git
|
||||||
1
HarmonyOSBaseLibs
子模块
1
HarmonyOSBaseLibs
子模块
@ -0,0 +1 @@
|
|||||||
|
Subproject commit c76be010962baf3e318d1cc3e76eb3128bdcc8de
|
||||||
18
app/oh-package-lock.json5
普通文件
18
app/oh-package-lock.json5
普通文件
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"meta": {
|
||||||
|
"stableOrder": true
|
||||||
|
},
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
||||||
|
"specifiers": {
|
||||||
|
"@szyx/sdk_base@../HarmonyOSBaseLibs": "@szyx/sdk_base@../HarmonyOSBaseLibs"
|
||||||
|
},
|
||||||
|
"packages": {
|
||||||
|
"@szyx/sdk_base@../HarmonyOSBaseLibs": {
|
||||||
|
"name": "@szyx/sdk_base",
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "../HarmonyOSBaseLibs",
|
||||||
|
"registryType": "local"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,6 +5,8 @@
|
|||||||
"main": "",
|
"main": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "",
|
"license": "",
|
||||||
"dependencies": {}
|
"dependencies": {
|
||||||
|
"@szyx/sdk_base": "file:../HarmonyOSBaseLibs"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit';
|
import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit';
|
||||||
import { hilog } from '@kit.PerformanceAnalysisKit';
|
import { hilog } from '@kit.PerformanceAnalysisKit';
|
||||||
import { window } from '@kit.ArkUI';
|
import { window } from '@kit.ArkUI';
|
||||||
|
import { GlobalContext } from '@szyx/sdk_base';
|
||||||
|
|
||||||
export default class AppAbility extends UIAbility {
|
export default class AppAbility extends UIAbility {
|
||||||
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
|
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
|
||||||
@ -22,6 +23,7 @@ export default class AppAbility extends UIAbility {
|
|||||||
}
|
}
|
||||||
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.');
|
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.');
|
||||||
});
|
});
|
||||||
|
GlobalContext.setContext(this.context)
|
||||||
}
|
}
|
||||||
|
|
||||||
onWindowStageDestroy(): void {
|
onWindowStageDestroy(): void {
|
||||||
|
|||||||
@ -1,10 +1,40 @@
|
|||||||
@Entry
|
import { SZYXLocalStorageHelper, SZYXLocalStorageKeys, WindowHelper } from '@szyx/sdk_base';
|
||||||
|
import { RouterBuilder, RouterKeys } from './RouterBuilder';
|
||||||
|
|
||||||
|
@Entry(SZYXLocalStorageHelper.storage)
|
||||||
@Component
|
@Component
|
||||||
struct Index {
|
struct Index {
|
||||||
|
@Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack()
|
||||||
@State message: string = 'Hello World';
|
@State message: string = 'Hello World';
|
||||||
|
@State isLoading: boolean = false
|
||||||
|
@State isOut: boolean = false
|
||||||
|
@LocalStorageLink(SZYXLocalStorageKeys.HttpHandlerListLength) @Watch('loadingChange') handlerLength: number = 0
|
||||||
|
|
||||||
|
loadingChange() {
|
||||||
|
if (this.handlerLength > 0 && !this.isLoading && !this.isOut) {
|
||||||
|
this.isOut = true
|
||||||
|
setTimeout(() => {
|
||||||
|
this.isOut = false
|
||||||
|
if (this.handlerLength > 0) {
|
||||||
|
this.isLoading = true
|
||||||
|
}
|
||||||
|
}, 300)
|
||||||
|
} else if (this.handlerLength == 0) {
|
||||||
|
this.isLoading = false
|
||||||
|
this.isOut = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
aboutToAppear(): void {
|
||||||
|
WindowHelper.setWindowLayoutFullScreen(true)
|
||||||
|
WindowHelper.hideStatusBar()
|
||||||
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
RelativeContainer() {
|
Stack() {
|
||||||
|
Navigation(this.pageInfos) {
|
||||||
|
Column() {
|
||||||
|
|
||||||
Text(this.message)
|
Text(this.message)
|
||||||
.id('HelloWorld')
|
.id('HelloWorld')
|
||||||
.fontSize(50)
|
.fontSize(50)
|
||||||
@ -13,8 +43,34 @@ struct Index {
|
|||||||
center: { anchor: '__container__', align: VerticalAlign.Center },
|
center: { anchor: '__container__', align: VerticalAlign.Center },
|
||||||
middle: { anchor: '__container__', align: HorizontalAlign.Center }
|
middle: { anchor: '__container__', align: HorizontalAlign.Center }
|
||||||
})
|
})
|
||||||
|
.onClick(() => {
|
||||||
|
this.pageInfos.pushPathByName(RouterKeys.Login, undefined)
|
||||||
|
})
|
||||||
|
|
||||||
|
}.width('100%').height('100%')
|
||||||
|
.linearGradient({
|
||||||
|
// 0点方向顺时针旋转为正向角度,线性渐变起始角度的默认值为180°
|
||||||
|
colors: [
|
||||||
|
[0xC1E7FC, 0], // 颜色断点1的颜色和比重,对应组件在180°方向上的起始位置
|
||||||
|
[0xffffff, 1.0],// 颜色断点2的颜色和比重,对应组件在180°方向上的终点位置
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
}.navDestination(RouterBuilder).hideTitleBar(true)
|
||||||
|
|
||||||
|
Column() {
|
||||||
|
LoadingProgress()
|
||||||
|
.color(Color.White)
|
||||||
|
.width(80).height(80)
|
||||||
|
Text('努力加载中..')
|
||||||
|
.fontSize(16)
|
||||||
|
.fontColor(Color.White)
|
||||||
}
|
}
|
||||||
.height('100%')
|
.visibility(this.isLoading ? Visibility.Visible : Visibility.None)
|
||||||
.width('100%')
|
.width('100%')
|
||||||
|
.height('100%')
|
||||||
|
.backgroundColor('#40000000')
|
||||||
|
.justifyContent(FlexAlign.Center)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
import { LoginView } from './login/LoginView'
|
||||||
|
|
||||||
|
|
||||||
|
export class RouterKeys {
|
||||||
|
public static Login = 'Login'
|
||||||
|
}
|
||||||
|
|
||||||
|
@Builder
|
||||||
|
export function RouterBuilder(name: string, param: ESObject) {
|
||||||
|
if (name === RouterKeys.Login) {
|
||||||
|
LoginView()
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
import { SafeView, WindowHelper } from '@szyx/sdk_base'
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Preview
|
||||||
|
export struct LoginView {
|
||||||
|
@Consume('pageInfos') pageInfos: NavPathStack
|
||||||
|
// 手机号
|
||||||
|
@State phone: string | undefined = undefined
|
||||||
|
// 密码
|
||||||
|
@State pwd: string | undefined = undefined
|
||||||
|
// 是否勾选协议
|
||||||
|
@State checkAgreement: boolean = false
|
||||||
|
// 是不是验证码登录
|
||||||
|
@State isCode: boolean = true
|
||||||
|
|
||||||
|
aboutToAppear(): void {
|
||||||
|
WindowHelper.showStatusBar()
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
SafeView({
|
||||||
|
pageInfos: this.pageInfos ?? undefined
|
||||||
|
}) {
|
||||||
|
Text('登录')
|
||||||
|
.id('HelloWorld')
|
||||||
|
.fontSize(50)
|
||||||
|
.fontWeight(FontWeight.Bold)
|
||||||
|
.alignRules({
|
||||||
|
center: { anchor: '__container__', align: VerticalAlign.Center },
|
||||||
|
middle: { anchor: '__container__', align: HorizontalAlign.Center }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -36,6 +36,10 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "basic",
|
||||||
|
"srcPath": "./HarmonyOSBaseLibs"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
正在加载...
在新工单中引用
屏蔽一个用户