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
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
27 deletions
+45
-27
public/template.html
+0
-0
src/api/api.js
+9
-0
src/api/index.js
+3
-2
src/views/layout/navbar.vue
+7
-3
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
...
@@ -72,3 +72,11 @@ export function deleteFilm(filmId) {
...
@@ -72,3 +72,11 @@ export function deleteFilm(filmId) {
// 删除影片
// 删除影片
return
get
(
`/myequipment/del/film/info/
${
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) {
...
@@ -38,11 +38,12 @@ export function get (url, params) {
params
params
})
})
}
}
export
function
post
(
url
,
data
)
{
export
function
post
(
url
,
data
,
headers
=
{}
)
{
return
apiRequest
({
return
apiRequest
({
method
:
'post'
,
method
:
'post'
,
url
,
url
,
data
data
,
headers
})
})
}
}
export
function
deleted
(
url
,
params
)
{
export
function
deleted
(
url
,
params
)
{
...
...
src/views/layout/navbar.vue
View file @
21458125
<
template
>
<
template
>
<van-nav-bar
:title=
"title"
:left-arrow=
"typeof leftArrow !== 'undefined' ? true : false"
<van-nav-bar
:title=
"title"
:left-arrow=
"typeof leftArrow !== 'undefined' ? true : false"
@
click-left=
"onClickLeft"
@
click-left=
"
my
onClickLeft"
@
click-right=
"onClickRight"
>
@
click-right=
"onClickRight"
>
<div
slot=
"right"
>
<div
slot=
"right"
>
<van-icon
v-show=
"showNotice"
@
click=
"goNotice"
name=
"chat-o"
size=
"25"
/>
<van-icon
v-show=
"showNotice"
@
click=
"goNotice"
name=
"chat-o"
size=
"25"
/>
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<
script
>
<
script
>
export
default
{
export
default
{
props
:
[
'left-arrow'
,
'title'
],
props
:
[
'left-arrow'
,
'title'
,
'onClickLeft'
],
data
()
{
data
()
{
return
{
return
{
left
:
false
,
left
:
false
,
...
@@ -33,8 +33,12 @@ export default {
...
@@ -33,8 +33,12 @@ export default {
}
}
},
},
methods
:{
methods
:{
onClickLeft
()
{
myonClickLeft
()
{
if
(
this
.
onClickLeft
)
{
this
.
onClickLeft
()
}
else
{
this
.
$router
.
back
()
this
.
$router
.
back
()
}
},
},
onClickRight
()
{
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
>
<
template
>
<div
class=
"edit-container"
>
<div
class=
"edit-container"
>
<NavBar
title=
"预览"
left-arrow
></NavBar>
<NavBar
title=
"预览"
:onClickLeft=
"myonClickLeft"
left-arrow
></NavBar>
<div
class=
"content"
>
<div
class=
"content"
>
<div
class=
"content-left"
>
<div
class=
"content-left"
>
<iframe
<iframe
@
load=
"getData"
class=
"iframe"
class=
"iframe"
v-show=
"loaded"
v-show=
"loaded"
:src=
"templateData.frameUrl+'?isPreview=1'"
:src=
"templateData.frameUrl+'?isPreview=1'"
...
@@ -16,7 +17,9 @@
...
@@ -16,7 +17,9 @@
<
script
>
<
script
>
import
NavBar
from
"@/views/layout/navbar"
;
import
NavBar
from
"@/views/layout/navbar"
;
// import { setTimeout } from 'timers';
export
default
{
export
default
{
props
:
[
'myonClickLeft'
],
data
()
{
data
()
{
return
{
return
{
templateData
:
{
templateData
:
{
...
@@ -38,36 +41,37 @@ export default {
...
@@ -38,36 +41,37 @@ export default {
};
};
},
},
created
()
{
created
()
{
if
(
this
.
$route
.
query
.
filmId
)
{
//
if (this.$route.query.filmId) {
this
.
mode
=
"film"
;
//
this.mode = "film";
this
.
getFilmDetail
();
//
this.getFilmDetail();
}
//
}
if
(
this
.
$route
.
query
.
templateId
)
{
//
if (this.$route.query.templateId) {
this
.
mode
=
"template"
;
//
this.mode = "template";
this
.
getTempalteDetail
();
//
this.getTempalteDetail();
}
//
}
this
.
getData
()
},
},
mounted
()
{
mounted
()
{
var
vm
=
this
// var vm = this
window
.
onload
=
function
()
{
// vm.message({
window
.
frames
[
0
].
postMessage
(
// type: 'setList',
"getcolor"
,
// list: vm.templateData.listData
"http://visual-clouds.bdideal.com"
// })
);
this
.
getData
()
vm
.
message
({
type
:
'setList'
,
list
:
vm
.
templateData
.
listData
})
};
},
},
methods
:
{
methods
:
{
message
(
data
)
{
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
()
{
getData
()
{
this
.
loaded
=
true
this
.
loaded
=
true
this
.
templateData
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'preview'
))
this
.
templateData
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'preview'
))
this
.
message
({
type
:
'setList'
,
list
:
this
.
templateData
.
listData
})
}
}
},
},
components
:
{
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