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

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

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