|
@@ -13,7 +13,7 @@ import { CommonModule } from '@angular/common';
|
|
|
templateUrl: './notice.component.html',
|
|
|
styleUrls: ['./notice.component.scss'],
|
|
|
standalone: true,
|
|
|
- imports: [SharedModule, ...ionicStandaloneModules,CommonModule],
|
|
|
+ imports: [SharedModule, ...ionicStandaloneModules, CommonModule],
|
|
|
})
|
|
|
export class NoticeComponent implements OnInit {
|
|
|
active: string = 'notice';
|
|
@@ -29,8 +29,22 @@ export class NoticeComponent implements OnInit {
|
|
|
{
|
|
|
text: '确认',
|
|
|
role: 'confirm',
|
|
|
- handler: () => {
|
|
|
- console.log('Alert confirmed');
|
|
|
+ handler: async () => {
|
|
|
+ console.log(this.currentFriend);
|
|
|
+ let query = new Parse.Query('Friends');
|
|
|
+ query.equalTo('channel', this.currentFriend.channel);
|
|
|
+ query.equalTo('company', this.msgServe.company);
|
|
|
+ query.equalTo('isPass', true);
|
|
|
+ query.notEqualTo('isDeleted', true);
|
|
|
+ let f = await query.first();
|
|
|
+ if (f?.id) {
|
|
|
+ let uid = Parse.User.current()?.id!;
|
|
|
+ let config = f?.get('config') || {};
|
|
|
+ config[uid] = new Date()?.getTime();
|
|
|
+ f.set('config', config);
|
|
|
+ await f.save();
|
|
|
+ }
|
|
|
+ this.msgServe.delMsg(this.currentFriend.channel);
|
|
|
},
|
|
|
},
|
|
|
];
|
|
@@ -42,13 +56,14 @@ export class NoticeComponent implements OnInit {
|
|
|
isOpen: boolean = false;
|
|
|
codeUrl: string = '';
|
|
|
notices: Array<any> = [];
|
|
|
+ currentFriend: any; //当前选中的好友
|
|
|
|
|
|
constructor(
|
|
|
private router: Router,
|
|
|
private aiSer: AiChatService,
|
|
|
public msgServe: MessageService,
|
|
|
public deviceSer: DeviceService
|
|
|
- ) { }
|
|
|
+ ) {}
|
|
|
|
|
|
ngOnInit() {
|
|
|
this.refresh();
|
|
@@ -71,8 +86,8 @@ export class NoticeComponent implements OnInit {
|
|
|
this.codeUrl = r?.get('wxCode');
|
|
|
}
|
|
|
async getSysNotice() {
|
|
|
- let result = await this.aiSer.getSysNotice(Parse.User.current()?.id!)
|
|
|
- this.notices = result.data
|
|
|
+ let result = await this.aiSer.getSysNotice(Parse.User.current()?.id!);
|
|
|
+ this.notices = result.data;
|
|
|
console.log(this.notices);
|
|
|
}
|
|
|
segmentChanged(e: any) {
|
|
@@ -80,17 +95,19 @@ export class NoticeComponent implements OnInit {
|
|
|
this.active = value;
|
|
|
}
|
|
|
/* 手指按下 */
|
|
|
- startPress() {
|
|
|
+ startPress(item: any) {
|
|
|
this.showModal = false;
|
|
|
if (this.times >= 500) {
|
|
|
- console.log(this.times);
|
|
|
+ // console.log(this.times);
|
|
|
this.times = 0;
|
|
|
+ this.currentFriend = item;
|
|
|
+ // console.log(this.currentFriend);
|
|
|
this.showModal = true;
|
|
|
return;
|
|
|
}
|
|
|
this.timer = setTimeout(() => {
|
|
|
this.times += 500;
|
|
|
- this.startPress();
|
|
|
+ this.startPress(item);
|
|
|
}, 500);
|
|
|
}
|
|
|
/* 触摸屏幕并移动,取消长按事件 */
|