chore: 抢单端UI回退前备份当前完整工作区
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { resolveAvatarUrl } = require('../../utils/avatar.js');
|
||||
const { resolveAvatarUrl, getDefaultAvatarUrl } = require('../../utils/avatar.js');
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
@@ -53,7 +53,8 @@ Component({
|
||||
|
||||
// 静音状态
|
||||
isMuted: false,
|
||||
|
||||
formattedTime: '',
|
||||
|
||||
// 自动隐藏计时器
|
||||
autoHideTimeout: null
|
||||
},
|
||||
@@ -123,7 +124,7 @@ Component({
|
||||
let avatar = resolveAvatarUrl(
|
||||
data.avatar || data.message?.senderData?.avatar,
|
||||
app
|
||||
);
|
||||
) || getDefaultAvatarUrl(app);
|
||||
|
||||
this.setData({
|
||||
show: true,
|
||||
@@ -131,6 +132,7 @@ Component({
|
||||
message: data.content || '[消息内容]',
|
||||
avatar: avatar,
|
||||
notificationData: data,
|
||||
formattedTime: this.formatTime(data.timestamp),
|
||||
progress: 100,
|
||||
swipingClass: '',
|
||||
swipeStyle: ''
|
||||
@@ -149,6 +151,7 @@ Component({
|
||||
this.clearTimers();
|
||||
this.setData({
|
||||
show: false,
|
||||
formattedTime: '',
|
||||
progress: 100,
|
||||
swipingClass: '',
|
||||
swipeStyle: ''
|
||||
@@ -265,6 +268,13 @@ Component({
|
||||
this.triggerEvent('close');
|
||||
this.hideNotification();
|
||||
},
|
||||
|
||||
onAvatarError() {
|
||||
const def = getDefaultAvatarUrl(getApp());
|
||||
if (def && this.data.avatar !== def) {
|
||||
this.setData({ avatar: def });
|
||||
}
|
||||
},
|
||||
|
||||
onMute(e) {
|
||||
e.stopPropagation();
|
||||
|
||||
Reference in New Issue
Block a user