mirror of
https://gitee.com/openharmony/applications_app_samples
synced 2025-02-17 02:08:44 +00:00
优化
Signed-off-by: yanhuan <yanhuan15@huawei.com>
This commit is contained in:
parent
4abe47c758
commit
eb28ec64a6
@ -32,7 +32,7 @@ export struct AlarmClock {
|
||||
private datePicker: CustomDialogController | null = null;
|
||||
private storage: StorageModel = StorageModel.getInstance();
|
||||
private calendar : calendarManager.Calendar | undefined = undefined;
|
||||
@State isDefault: boolean= false;
|
||||
@State isDefault: boolean = false;
|
||||
|
||||
async getTest(): Promise<void> {
|
||||
this.listItems.replaceData([]);
|
||||
@ -53,7 +53,7 @@ export struct AlarmClock {
|
||||
}
|
||||
|
||||
// 获取设备类型
|
||||
async getDeviceType() {
|
||||
async getDeviceType(){
|
||||
try {
|
||||
let deviceType = deviceInfo.deviceType;
|
||||
Logger.info(`deviceType` + JSON.stringify(deviceType));
|
||||
@ -94,7 +94,11 @@ export struct AlarmClock {
|
||||
.onClick(() => {
|
||||
if (this.datePicker === null) {
|
||||
this.datePicker = new CustomDialogController({
|
||||
builder: CustomDatePicker({ total: this.total, countChange: this.countChange.bind(this), isDefault: this.isDefault }),
|
||||
builder: CustomDatePicker({
|
||||
total: this.total,
|
||||
countChange: this.countChange.bind(this),
|
||||
isDefault: this.isDefault
|
||||
}),
|
||||
autoCancel: true
|
||||
})
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ struct Time {
|
||||
TextPicker({ range: this.pickerArrayGen(60) })
|
||||
.width(60)
|
||||
.height('100%')
|
||||
.onChange((value: string| string[], index: number| number[]) => {
|
||||
.onChange((value: string | string[], index: number| number[]) => {
|
||||
pickerS = index as number;
|
||||
})
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ export struct CustomDatePicker {
|
||||
}
|
||||
}
|
||||
|
||||
setCalendarReminder() {
|
||||
setCalendarReminder(){
|
||||
let config: calendarManager.CalendarConfig = {
|
||||
enableReminder: true,
|
||||
color: '#aabbcc',
|
||||
|
@ -127,7 +127,7 @@ export class Contact {
|
||||
}
|
||||
|
||||
export class ContactSource extends BasicDataSource {
|
||||
public dataArray: Array<Contact> = new Array<Contact>();
|
||||
public dataArray: Contact[] = [];
|
||||
|
||||
constructor(data: Array<Contact>) {
|
||||
super()
|
||||
|
@ -48,7 +48,7 @@ export default class StorageModel {
|
||||
await this.storage!.flush();
|
||||
}
|
||||
|
||||
async putTotalStorageValue(putKey: string, alarmClock: number) {
|
||||
async putTotalStorageValue(putKey: string, alarmClock: number){
|
||||
let value = JSON.stringify(alarmClock);
|
||||
this.storage = await this.getStorage();
|
||||
await this.storage!.put(putKey, value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user