|
|
@@ -3,6 +3,11 @@ interface Gallery {
|
|
|
src: string;
|
|
|
}
|
|
|
|
|
|
+type Result = {
|
|
|
+ thumbnail: Gallery[];
|
|
|
+ source: (Gallery & { target: string; })[];
|
|
|
+}
|
|
|
+
|
|
|
// module/chats/components/message-analysis/message-analysis.ts
|
|
|
|
|
|
const defaultGallery = {
|
|
|
@@ -33,15 +38,15 @@ Component({
|
|
|
if (this.data.source.length) return;
|
|
|
wx.navigateTo({
|
|
|
url: '/module/chats/pages/analysis/analysis',
|
|
|
- events: { update: (data: any[]) => this._update(data) }
|
|
|
+ events: { update: (data: Result) => this._update(data) }
|
|
|
});
|
|
|
},
|
|
|
onCancel() {
|
|
|
this.triggerEvent('next', defaultGallery);
|
|
|
},
|
|
|
|
|
|
- _update(source: (Gallery & { target: string; })[]) {
|
|
|
- this.setData({ source });
|
|
|
+ _update({source, thumbnail}:Result) {
|
|
|
+ this.setData({ source: thumbnail });
|
|
|
const data = {} as AnyObject;
|
|
|
for (const item of source) { data[item.target] = item.src; }
|
|
|
this.triggerEvent('next', {
|