|
@@ -75,24 +75,43 @@ export class SImageItem extends SObjectItem {
|
|
|
this._url = v;
|
|
|
this.img = new Image();
|
|
|
this.img.onload = (e): void => {
|
|
|
- // @ts-ignore
|
|
|
- const imgSrc = e.path[0].src;
|
|
|
- if (this.isUrlIdentical(imgSrc)) {
|
|
|
+ const isiOS = !!navigator.userAgent.match(
|
|
|
+ /\(i[^;]+;( U;)? CPU.+Mac OS X/
|
|
|
+ ); //ios终端
|
|
|
+ if (isiOS) {
|
|
|
this.isLoadOver = true;
|
|
|
this.computeImgSize();
|
|
|
this.$emit("imgLoadOver");
|
|
|
this.update();
|
|
|
+ } else {
|
|
|
+ // @ts-ignore
|
|
|
+ const imgSrc = e.path[0].src;
|
|
|
+ if (this.isUrlIdentical(imgSrc)) {
|
|
|
+ this.isLoadOver = true;
|
|
|
+ this.computeImgSize();
|
|
|
+ this.$emit("imgLoadOver");
|
|
|
+ this.update();
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
this.img.onerror = (e): void => {
|
|
|
- // @ts-ignore
|
|
|
- const imgSrc = e.path[0].src;
|
|
|
- if (this.isUrlIdentical(imgSrc)) {
|
|
|
+ const isiOS = !!navigator.userAgent.match(
|
|
|
+ /\(i[^;]+;( U;)? CPU.+Mac OS X/
|
|
|
+ ); //ios终端
|
|
|
+ if (isiOS) {
|
|
|
this.isLoadOver = false;
|
|
|
this.$emit("imgLoadOver");
|
|
|
this.update();
|
|
|
- console.log("加载图片错误!", e);
|
|
|
+ } else {
|
|
|
+ // @ts-ignore
|
|
|
+ const imgSrc = e.path[0].src;
|
|
|
+ if (this.isUrlIdentical(imgSrc)) {
|
|
|
+ this.isLoadOver = false;
|
|
|
+ this.$emit("imgLoadOver");
|
|
|
+ this.update();
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log("加载图片错误!", e);
|
|
|
};
|
|
|
this.img.src = v;
|
|
|
}
|