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
21458125
authored
Jun 24, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片上传模板预览修改
parent
babc733d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
28 deletions
+46
-28
public/template.html
+0
-0
src/api/api.js
+9
-0
src/api/index.js
+3
-2
src/views/layout/navbar.vue
+8
-4
src/views/tempaltes/edit.vue
+0
-0
src/views/tempaltes/preview.vue
+26
-22
No files found.
public/template.html
View file @
21458125
This diff is collapsed.
Click to expand it.
src/api/api.js
View file @
21458125
...
...
@@ -71,4 +71,12 @@ export function updateFilmInfo(filmId, filmData) {
export
function
deleteFilm
(
filmId
)
{
// 删除影片
return
get
(
`/myequipment/del/film/info/
${
filmId
}
`
)
}
export
function
upload
(
file
)
{
// 上传文件
let
formData
=
new
FormData
()
formData
.
append
(
'resource'
,
file
)
return
post
(
`/common/upload/resource`
,
formData
,
{
'Content-Type'
:
'multipart/form-data'
}
)
}
\ No newline at end of file
src/api/index.js
View file @
21458125
...
...
@@ -38,11 +38,12 @@ export function get (url, params) {
params
})
}
export
function
post
(
url
,
data
)
{
export
function
post
(
url
,
data
,
headers
=
{}
)
{
return
apiRequest
({
method
:
'post'
,
url
,
data
data
,
headers
})
}
export
function
deleted
(
url
,
params
)
{
...
...
src/views/layout/navbar.vue
View file @
21458125
<
template
>
<van-nav-bar
:title=
"title"
:left-arrow=
"typeof leftArrow !== 'undefined' ? true : false"
@
click-left=
"onClickLeft"
@
click-left=
"
my
onClickLeft"
@
click-right=
"onClickRight"
>
<div
slot=
"right"
>
<van-icon
v-show=
"showNotice"
@
click=
"goNotice"
name=
"chat-o"
size=
"25"
/>
...
...
@@ -11,7 +11,7 @@
<
script
>
export
default
{
props
:
[
'left-arrow'
,
'title'
],
props
:
[
'left-arrow'
,
'title'
,
'onClickLeft'
],
data
()
{
return
{
left
:
false
,
...
...
@@ -33,8 +33,12 @@ export default {
}
},
methods
:{
onClickLeft
()
{
this
.
$router
.
back
()
myonClickLeft
()
{
if
(
this
.
onClickLeft
)
{
this
.
onClickLeft
()
}
else
{
this
.
$router
.
back
()
}
},
onClickRight
()
{
...
...
src/views/tempaltes/edit.vue
View file @
21458125
This diff is collapsed.
Click to expand it.
src/views/tempaltes/preview.vue
View file @
21458125
<
template
>
<div
class=
"edit-container"
>
<NavBar
title=
"预览"
left-arrow
></NavBar>
<NavBar
title=
"预览"
:onClickLeft=
"myonClickLeft"
left-arrow
></NavBar>
<div
class=
"content"
>
<div
class=
"content-left"
>
<iframe
@
load=
"getData"
class=
"iframe"
v-show=
"loaded"
:src=
"templateData.frameUrl+'?isPreview=1'"
...
...
@@ -16,7 +17,9 @@
<
script
>
import
NavBar
from
"@/views/layout/navbar"
;
// import { setTimeout } from 'timers';
export
default
{
props
:
[
'myonClickLeft'
],
data
()
{
return
{
templateData
:
{
...
...
@@ -38,36 +41,37 @@ export default {
};
},
created
()
{
if
(
this
.
$route
.
query
.
filmId
)
{
this
.
mode
=
"film"
;
this
.
getFilmDetail
();
}
if
(
this
.
$route
.
query
.
templateId
)
{
this
.
mode
=
"template"
;
this
.
getTempalteDetail
();
}
this
.
getData
()
//
if (this.$route.query.filmId) {
//
this.mode = "film";
//
this.getFilmDetail();
//
}
//
if (this.$route.query.templateId) {
//
this.mode = "template";
//
this.getTempalteDetail();
//
}
},
mounted
()
{
var
vm
=
this
window
.
onload
=
function
()
{
window
.
frames
[
0
].
postMessage
(
"getcolor"
,
"http://visual-clouds.bdideal.com"
);
vm
.
message
({
type
:
'setList'
,
list
:
vm
.
templateData
.
listData
})
};
// var vm = this
// vm.message({
// type: 'setList',
// list: vm.templateData.listData
// })
this
.
getData
()
},
methods
:
{
message
(
data
)
{
window
.
frames
[
0
].
postMessage
(
data
,
"http://visual-clouds.bdideal.com"
);
// window.frames[0].postMessage(data, "http://visual-clouds.bdideal.com");
window
.
frames
[
1
].
postMessage
(
data
,
"http://127.0.0.1:9000"
);
},
getData
()
{
this
.
loaded
=
true
this
.
templateData
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'preview'
))
this
.
message
({
type
:
'setList'
,
list
:
this
.
templateData
.
listData
})
}
},
components
:
{
...
...
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