Commit 62af13a8 authored by 杨培's avatar 杨培

修复图片上传,头像上传等组件在iOS Safari 下无法使用的问题

parent 60ce1290
......@@ -628,19 +628,6 @@ a:link, a:active, a:visited {
padding-top: 10px;
}
.upload-avatar input {
display: inline-block;
position: absolute;
left: 0;
top: 0;
opacity: 0;
width: 100px;
height: 100px;
border-radius: 100%;
background-color: #000;
cursor: pointer;
}
.upload-avatar img {
position: absolute;
left: 0;
......@@ -648,7 +635,6 @@ a:link, a:active, a:visited {
height: 100px;
width: 100px;
border-radius: 100%;
z-index: 2;
}
.upload-avatar span.loading-tip {
......@@ -676,7 +662,6 @@ a:link, a:active, a:visited {
color: #fff;
background-color: rgba(0, 0, 0, 0.3);
position: absolute;
z-index: 3;
top: 0;
left: 0;
width: 100px;
......@@ -1131,7 +1116,7 @@ textarea.input-r-control {
width: 300px;
color: #999;
border-radius: 3px;
z-index: 3;
z-index: 0;
}
.upload-video-screen img {
......
......@@ -29,8 +29,6 @@ import str from "../../utils/string";
import qiniu from "../../utils/qiniu";
import Bus from "../bus";
var uploader;
export default {
data() {
return {
......@@ -39,7 +37,8 @@ export default {
videoSize: "",
progress: 0,
speed: "",
uploaderId: "videoUploader" + str.rand(10)
uploaderId: "videoUploader" + str.rand(10),
uploader: null
}
},
props: {
......@@ -47,9 +46,9 @@ export default {
},
methods: {
cancelClick: function() {
uploader.stop();
this.uploader.stop();
this.state = "ready";
uploader.refresh();
this.uploader.refresh();
//本组件的所有视频上传相关事件都会同时向 Bus 发送
this.$emit("video-upload-cancel");
......@@ -86,7 +85,7 @@ export default {
}
});
uploader = new qiniu.Uploader({
self.uploader = new qiniu.Uploader({
browse_button: self.uploaderId,
drop_element: self.uploaderId,
upload_token: self.uptoken,
......@@ -158,16 +157,16 @@ export default {
//状态变化时禁用或启用上传按钮
self.$watch("state", function(val, old) {
if (val == "ready" || val == "error") {
uploader.disableBrowse(false);
self.uploader.disableBrowse(false);
} else {
uploader.disableBrowse();
self.uploader.disableBrowse();
}
self.$emit("video-upload-state-change", val, old);
Bus.$emit("video-upload-state-change", val, old);
});
uploader.init();
self.uploader.init();
});
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment