release包
这个提交包含在:
父节点
a13026f48a
当前提交
abcaf8d019
@ -0,0 +1,7 @@
|
|||||||
|
export class DeviceInfo{
|
||||||
|
ODID?:string
|
||||||
|
manufacture?:string
|
||||||
|
brand?:string
|
||||||
|
osFullName?:string
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import preferences from '@ohos.data.preferences';
|
import preferences from '@ohos.data.preferences';
|
||||||
|
|
||||||
export class PreferencesHelper {
|
export class PreferencesHelper {
|
||||||
public static async put(key: string, value: preferences.ValueType | undefined) {
|
public static async put(key: string, value: preferences.ValueType | undefined | null) {
|
||||||
|
|
||||||
const pref = await preferences.getPreferences(getContext(), 'PreferencesHelper')
|
const pref = await preferences.getPreferences(getContext(), 'PreferencesHelper')
|
||||||
// 写入数据
|
// 写入数据
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import { BusinessError } from '@kit.BasicServicesKit';
|
import { BusinessError, deviceInfo } from '@kit.BasicServicesKit';
|
||||||
import { HashMap } from '@kit.ArkTS';
|
import { HashMap, util } from '@kit.ArkTS';
|
||||||
|
import { DeviceInfo } from '../bean/DeviceInfo';
|
||||||
|
|
||||||
export interface Btn {
|
export interface Btn {
|
||||||
text?: string | Resource;
|
text?: string | Resource;
|
||||||
@ -67,12 +68,23 @@ function customDialogBuilder<T>(option: ListOptions<T>, dialogId: number) {
|
|||||||
.listDirection(Axis.Vertical) // 排列方向
|
.listDirection(Axis.Vertical) // 排列方向
|
||||||
.scrollBar(BarState.Off)
|
.scrollBar(BarState.Off)
|
||||||
.friction(0.6)
|
.friction(0.6)
|
||||||
.divider({ strokeWidth: 1, color: 0xEEEEEE, startMargin: 20, endMargin: 20 }) // 每行之间的分界线
|
.divider({
|
||||||
|
strokeWidth: 1,
|
||||||
|
color: 0xEEEEEE,
|
||||||
|
startMargin: 20,
|
||||||
|
endMargin: 20
|
||||||
|
}) // 每行之间的分界线
|
||||||
.edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring
|
.edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.height(option.values.length < 8 ? `${option.values.length / 16 * 100}%` : '50%')
|
.height(option.values.length < 8 ? `${option.values.length / 16 * 100}%` : '50%')
|
||||||
.margin({ top: 20 })
|
.margin({ top: 20 })
|
||||||
}.padding({ top: 20, bottom: 20, left: 20, right: 20 })
|
}
|
||||||
|
.padding({
|
||||||
|
top: 20,
|
||||||
|
bottom: 20,
|
||||||
|
left: 20,
|
||||||
|
right: 20
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -209,4 +221,17 @@ export class ToolsHelper {
|
|||||||
}
|
}
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static deviceInfo: DeviceInfo
|
||||||
|
|
||||||
|
static getDeviceInfo() {
|
||||||
|
if (!ToolsHelper.deviceInfo) {
|
||||||
|
ToolsHelper.deviceInfo = new DeviceInfo()
|
||||||
|
ToolsHelper.deviceInfo.ODID = deviceInfo.ODID
|
||||||
|
ToolsHelper.deviceInfo.manufacture = deviceInfo.manufacture
|
||||||
|
ToolsHelper.deviceInfo.brand = deviceInfo.brand
|
||||||
|
ToolsHelper.deviceInfo.osFullName = deviceInfo.osFullName
|
||||||
|
}
|
||||||
|
return ToolsHelper.deviceInfo
|
||||||
|
}
|
||||||
}
|
}
|
||||||
正在加载...
在新工单中引用
屏蔽一个用户