Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d78e0e8d
authored
Dec 12, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
21bc4d14
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
43 deletions
+25
-43
src/views/tempaltes/editMenu.vue
+25
-43
No files found.
src/views/tempaltes/editMenu.vue
View file @
d78e0e8d
...
...
@@ -181,29 +181,27 @@ export default {
};
},
methods
:
{
uploadFile
(
type
)
{
if
(
type
===
"iamge"
)
{
window
.
wx
.
chooseImage
({
count
:
1
,
// 默认9
sizeType
:
[
"original"
,
"compressed"
],
// 可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
"album"
,
"camera"
],
// 可以指定来源是相册还是相机,默认二者都有
success
:
function
(
res
)
{
var
localIds
=
res
.
localIds
;
// 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
console
.
log
(
localIds
);
}
uploadFile
(
data
)
{
this
.
$toast
.
loading
({
mask
:
true
,
duration
:
0
,
message
:
"上传中..."
});
upload
(
data
)
.
then
(
res
=>
{
// this.schemaData[this.dataKey].value = res.data.data;
if
(
this
.
itemKey
)
{
this
.
setSchemaListData
(
res
.
data
.
data
);
}
else
{
this
.
setSchemaData
(
res
.
data
.
data
);
}
if
(
type
===
"video"
)
{
window
.
wx
.
chooseImage
({
count
:
1
,
// 默认9
sizeType
:
[
"original"
,
"compressed"
],
// 可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
"album"
,
"camera"
],
// 可以指定来源是相册还是相机,默认二者都有
success
:
function
(
res
)
{
var
localIds
=
res
.
localIds
;
// 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
console
.
log
(
localIds
);
}
this
.
$toast
.
clear
();
})
.
catch
(
e
=>
{
console
.
log
(
e
);
this
.
$toast
.
clear
();
this
.
$toast
(
"上传失败"
);
});
}
},
onBlur
()
{
window
.
scrollTo
(
0
,
0
);
...
...
@@ -248,7 +246,12 @@ export default {
return
getHostUrl
(
this
.
frameUrl
,
dataUrl
);
},
uploadAfter
(
file
)
{
// console.log(file);
if
(
String
(
file
.
file
.
type
).
indexOf
(
"image"
)
!==
-
1
)
{
this
.
VueCropperOption
.
img
=
file
.
content
;
}
else
{
this
.
uploadFile
(
file
.
file
);
}
},
checkboxChange
(
value
)
{
console
.
log
(
this
.
schemaData
,
value
);
...
...
@@ -269,30 +272,9 @@ export default {
saveCropper
()
{
this
.
VueCropperOption
.
img
=
""
;
this
.
$refs
.
cropper
.
getCropBlob
(
data
=>
{
console
.
log
(
data
)
// do something
this
.
$toast
.
loading
({
mask
:
true
,
duration
:
0
,
message
:
"上传中..."
});
upload
(
data
)
.
then
(
res
=>
{
// this.schemaData[this.dataKey].value = res.data.data;
if
(
this
.
itemKey
)
{
this
.
setSchemaListData
(
res
.
data
.
data
);
}
else
{
this
.
setSchemaData
(
res
.
data
.
data
);
}
this
.
$toast
.
clear
();
})
.
catch
(
e
=>
{
console
.
log
(
e
);
this
.
$toast
.
clear
();
this
.
$toast
(
"上传失败"
);
});
this
.
VueCropperOption
.
preImg
=
data
;
console
.
log
(
data
);
// do something
this
.
uploadFile
(
data
);
});
},
setSelectData
(
item
,
index
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment