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
bda6380a
authored
Feb 04, 2020
by
hanjixin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改压缩后视频替换
parent
9cf21866
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
19 deletions
+40
-19
src/api/api.js
+1
-1
src/store/modules/app.js
+3
-1
src/views/tempaltes/editMenu.vue
+6
-4
src/views/tempaltes/editMore.vue
+30
-13
No files found.
src/api/api.js
View file @
bda6380a
...
...
@@ -149,7 +149,7 @@ export function getUserInfo() {
return
get
(
`/user/get/info`
)
}
export
function
checkVideoCompress
(
videoSrc
=
[])
{
return
get
(
`/user/get/info`
,
videoSrc
)
return
post
(
`/common/get/mts/state`
,
{
url
:
videoSrc
}
)
}
export
function
upload
(
file
)
{
// 上传文件
...
...
src/store/modules/app.js
View file @
bda6380a
...
...
@@ -31,7 +31,9 @@ const app = {
state
.
errorData
=
errorData
},
SET_VIDEO_SRC
:
(
state
,
videoSrc
)
=>
{
state
.
videoSrc
=
state
.
videoSrc
.
push
(
videoSrc
)
console
.
log
(
JSON
.
parse
(
JSON
.
stringify
(
state
)),
videoSrc
)
state
.
videoSrc
.
push
(
videoSrc
)
},
CLEAR_VIDEO_SRC
:
(
state
)
=>
{
state
.
videoSrc
=
[]
...
...
src/views/tempaltes/editMenu.vue
View file @
bda6380a
...
...
@@ -302,7 +302,9 @@ export default {
this
.
VueCropperOption
.
fixedNumber
=
[
9
,
16
];
}
},
created
()
{},
created
()
{
// this.$store.commit('SET_VIDEO_SRC', 'https://visual-clouds.bdideal.com/html/156394962402878b178ab4088494e9df36c49ec944add.ttf')
},
computed
:
{
errorData
()
{
return
this
.
$store
.
state
.
app
.
errorData
;
...
...
@@ -369,9 +371,9 @@ export default {
}
// this.schemaData[this.dataKey].value = res.data.data;
if
(
this
.
itemKey
)
{
this
.
setSchemaListData
(
res
.
data
.
data
);
this
.
setSchemaListData
(
res
.
data
.
data
.
replace
(
'-mts'
,
''
)
);
}
else
{
this
.
setSchemaData
(
res
.
data
.
data
);
this
.
setSchemaData
(
res
.
data
.
data
.
replace
(
'-mts'
,
''
)
);
}
this
.
$toast
.
clear
();
})
...
...
@@ -509,7 +511,7 @@ export default {
document
.
querySelector
(
".edit-container"
).
style
.
height
=
"100vh"
;
this
.
VueCropperOption
.
img
=
file
.
content
;
}
else
{
this
.
uploadFile
(
file
.
file
),
String
(
file
.
file
.
type
).
indexOf
(
"image"
)
===
-
1
;
this
.
uploadFile
(
file
.
file
,
String
(
file
.
file
.
type
).
indexOf
(
"image"
)
===
-
1
)
;
}
},
checkboxChange
(
value
)
{
...
...
src/views/tempaltes/editMore.vue
View file @
bda6380a
...
...
@@ -302,7 +302,8 @@ import {
updateFilmInfo
,
upload
,
getTempalteDetail
,
createFilm
createFilm
,
checkVideoCompress
}
from
"@/api/api"
;
import
axios
from
"axios"
;
import
draggable
from
"vuedraggable"
;
...
...
@@ -758,15 +759,22 @@ export default {
alert
(
"数据为空"
);
return
;
}
let
filmData
=
JSON
.
stringify
({
templateInfo
:
this
.
templateData
.
templateInfo
,
pageList
:
this
.
templateData
.
listData
})
// 过滤替换
let
videoSrc
=
this
.
$store
.
state
.
app
.
videoSrc
videoSrc
.
map
(
item
=>
{
// 全部替换
filmData
=
filmData
.
replace
(
new
RegExp
(
item
.
replace
(
'-mts'
,
''
),
"gm"
)
,
item
)
})
if
(
this
.
mode
===
"film"
||
window
.
sessionStorage
.
getItem
(
"filmId"
))
{
const
filmId
=
this
.
$route
.
query
.
filmId
||
window
.
sessionStorage
.
getItem
(
"filmId"
);
updateFilmInfo
(
filmId
,
JSON
.
stringify
({
templateInfo
:
this
.
templateData
.
templateInfo
,
pageList
:
this
.
templateData
.
listData
}),
filmData
,
this
.
templateData
.
filmName
,
this
.
templateData
.
filmDescribe
)
...
...
@@ -783,10 +791,7 @@ export default {
}
else
{
createFilm
({
templateId
:
this
.
$route
.
query
.
templateId
,
filmData
:
JSON
.
stringify
({
templateInfo
:
this
.
templateData
.
templateInfo
,
pageList
:
this
.
templateData
.
listData
}),
filmData
:
filmData
,
filmName
:
this
.
templateData
.
filmName
,
filmDescribe
:
this
.
templateData
.
filmDescribe
})
...
...
@@ -823,16 +828,28 @@ export default {
}
this
.
$toast
.
loading
({
overlay
:
true
,
message
:
"
加载中...
"
,
message
:
"
保存中, 请等待!
"
,
forbidClick
:
true
,
duration
:
0
});
checkVideoCompress
(
this
.
$store
.
state
.
app
.
videoSrc
).
then
(()
=>
{
this
.
publish
();
}).
catch
(()
=>
{
this
.
$toast
.
clear
()
// this.$toast("请重新发布")
})
// this.$toast.loading({
// overlay: true,
// message: "加载中...",
// forbidClick: true,
// duration: 0
// });
// this.message({
// type: "getList"
// });
setTimeout
(()
=>
{
this
.
publish
();
},
500
);
//
setTimeout(() => {
//
this.publish();
//
}, 500);
},
uploadAfter
(
file
)
{
// console.log(file, upload);
...
...
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