Signed-off-by: yanhuan <yanhuan15@huawei.com>
This commit is contained in:
yanhuan 2024-09-19 18:54:46 +08:00
parent 4abe47c758
commit eb28ec64a6
5 changed files with 11 additions and 7 deletions

View File

@ -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
})
}

View File

@ -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;
})
}

View File

@ -60,7 +60,7 @@ export struct CustomDatePicker {
}
}
setCalendarReminder() {
setCalendarReminder(){
let config: calendarManager.CalendarConfig = {
enableReminder: true,
color: '#aabbcc',

View File

@ -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()

View File

@ -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);