@xtdev/xt-miniprogram-ui 1.2.78 → 1.2.79
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/libs/xt-uploader/index.js +13 -5
- package/package.json +1 -1
|
@@ -129,12 +129,20 @@ Component({
|
|
|
129
129
|
onDelete(e) {
|
|
130
130
|
const url = e.currentTarget.dataset.url;
|
|
131
131
|
const index = e.currentTarget.dataset.index;
|
|
132
|
-
this.properties
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
let { tempFileList } = this.properties;
|
|
133
|
+
// 判断删除的本地临时文件还是后台图片
|
|
134
|
+
tempFileList.splice(index, 1);
|
|
135
|
+
this.setData({
|
|
136
|
+
tempFileList,
|
|
137
137
|
});
|
|
138
|
+
if (!url.startsWith('http://tmp')) {
|
|
139
|
+
const fileList = tempFileList.map(item => item.url);
|
|
140
|
+
this.triggerEvent('delete', {
|
|
141
|
+
fileList,
|
|
142
|
+
url,
|
|
143
|
+
index,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
138
146
|
},
|
|
139
147
|
// 上传成功
|
|
140
148
|
onUploadSuccess(files, url) {
|