@aochuang/client-sdk 1.0.301 → 1.0.302
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3,18 +3,20 @@ import { unique } from '../../../utils/string.js'
|
|
|
3
3
|
|
|
4
4
|
export default class ClientChatDraft {
|
|
5
5
|
data = Vue.observable({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
/**
|
|
7
|
+
* 草稿消息
|
|
8
|
+
* [{
|
|
9
|
+
* id: 'xxx', // 本地唯一id
|
|
10
|
+
* targetId: 'xxx', // 群或者好友id
|
|
11
11
|
* targetType: null, // 草稿类型,0:好友,1:群
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
* msgType: null, // 消息类型
|
|
13
|
+
* content: null, // 消息内容
|
|
14
|
+
* mentions: [], // @成员信息
|
|
15
|
+
* quoteMessage: null, // 引用消息快照
|
|
16
|
+
* createTime: null // 创建时间
|
|
17
|
+
* }]
|
|
18
|
+
*/
|
|
19
|
+
draftData: []
|
|
18
20
|
})
|
|
19
21
|
|
|
20
22
|
constructor (options) {
|
|
@@ -46,7 +48,17 @@ export default class ClientChatDraft {
|
|
|
46
48
|
if (this.data.draftData.some(v => v.targetType === data.targetType && v.targetId === data.targetId)) {
|
|
47
49
|
return
|
|
48
50
|
}
|
|
49
|
-
const
|
|
51
|
+
const nextData = Object.assign({}, data)
|
|
52
|
+
if (data.quoteMessage) {
|
|
53
|
+
const { msgType, content, wechatTime, msgSvrId } = data.quoteMessage
|
|
54
|
+
nextData.quoteMessage = {
|
|
55
|
+
msgType,
|
|
56
|
+
content,
|
|
57
|
+
wechatTime,
|
|
58
|
+
msgSvrId
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const nextItem = Object.assign(nextData, {
|
|
50
62
|
id: unique(),
|
|
51
63
|
createTime: Date.now()
|
|
52
64
|
})
|
|
@@ -89,4 +101,4 @@ export default class ClientChatDraft {
|
|
|
89
101
|
})
|
|
90
102
|
})
|
|
91
103
|
}
|
|
92
|
-
}
|
|
104
|
+
}
|