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
a4c93918
authored
Dec 31, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改编辑项的注释
parent
304210bb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
29 deletions
+27
-29
src/views/tempaltes/editMenu.vue
+3
-1
src/views/tempaltes/editMore.vue
+24
-28
No files found.
src/views/tempaltes/editMenu.vue
View file @
a4c93918
...
...
@@ -27,12 +27,14 @@
<div>
<div
class=
"input-title"
v-if=
"item.type === 'text' || item.type === 'textarea'"
v-if=
"item.type === 'text' || item.type === 'textarea'
|| item.type === 'number'
"
>
{{
item
.
description
}}
</div>
<input
v-if=
"item.type === 'text'"
class=
"edit-input"
type=
"text"
:maxlength=
"item.maxlength ? parseInt(item.maxlength) : ''"
:minlength=
"item.minlength ? parseInt(item.maxlength) : ''"
@
blur=
"onBlur"
@
change=
"valueChange2()"
:placeholder=
"item.description"
...
...
src/views/tempaltes/editMore.vue
View file @
a4c93918
...
...
@@ -385,19 +385,19 @@ export default {
this
.
itemListIndex
=
0
;
}
},
activated
()
{
activated
()
{
// keepalive 下显示触发
document
.
title
=
"编辑作品"
;
window
.
addEventListener
(
"popstate"
,
listenRouterBack
,
false
);
// this.currentPage = JSON.parse(JSON.stringify(this.currentPage))
this
.
goPage
(
0
)
},
deactivated
()
{
deactivated
()
{
// keepalive 隐藏显示触发
window
.
removeEventListener
(
"popstate"
,
listenRouterBack
,
false
);
},
destroyed
()
{
destroyed
()
{
// 页面销毁触发
window
.
removeEventListener
(
"popstate"
,
listenRouterBack
,
false
);
},
created
()
{
created
()
{
// 当前实例创建完成触发
let
ua
=
window
.
navigator
.
userAgent
;
//$alert('浏览器版本: ' + app + '\n' + '用户代理: ' + ua);
if
(
ua
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
))
{
...
...
@@ -426,7 +426,8 @@ export default {
window
.
addEventListener
(
"message"
,
function
(
e
)
{
console
.
log
(
e
.
data
,
"模板页面发来的消息"
);
// console.log(e.data, "模板页面发来的消息"); // 监听
if
(
typeof
e
.
data
===
"object"
&&
e
.
data
[
"type"
]
==
"edit"
)
{
vm
.
editIndex
=
e
.
data
.
index
;
vm
.
editObj
=
e
.
data
.
item
;
...
...
@@ -475,7 +476,7 @@ export default {
// }, 1000);
},
methods
:
{
listenRouterBack
()
{
listenRouterBack
()
{
// 监听路由变化防止点击两次返回
window
.
wx
.
miniProgram
.
navigateBack
();
},
message
(
data
)
{
...
...
@@ -487,10 +488,10 @@ export default {
// window.frames[1].postMessage(data, "https://visual-clouds.bdideal.com");
// document.querySelector('.iframe').postMessage(data, "https://visual-clouds.bdideal.com")
},
setItemListIndex
(
index
)
{
setItemListIndex
(
index
)
{
// 设置编辑项数据激活index
this
.
itemListIndex
=
index
;
},
onSheetSelect
(
item
)
{
onSheetSelect
(
item
)
{
// 当actionSheet 被点击时候
this
.
showSheet
=
false
;
if
(
item
.
action
===
"createPage"
)
{
this
.
createPage
(
this
.
currentPage
);
...
...
@@ -500,37 +501,37 @@ export default {
this
.
pageShow
();
}
},
dragChange
(
value
)
{
console
.
log
(
"dragChange"
,
value
);
dragChange
()
{
// 放页面拖拽发生时执行
this
.
message
({
type
:
"setList"
,
pages
:
this
.
templateData
.
listData
});
},
setList
()
{
// 给iframe 设置数据
this
.
message
({
type
:
"setList"
,
pages
:
this
.
templateData
.
listData
});
},
NextSlider
()
{
NextSlider
()
{
// 切换到下一个页面
if
(
this
.
currentPage
<
this
.
templateData
.
listData
.
length
-
1
)
{
++
this
.
currentPage
;
this
.
goPage
(
this
.
currentPage
);
}
},
PreSlider
()
{
PreSlider
()
{
// 切换到上一个页面
if
(
this
.
currentPage
>=
1
)
{
--
this
.
currentPage
;
this
.
goPage
(
this
.
currentPage
);
}
},
setClipImg
(
show
)
{
setClipImg
(
show
)
{
// 当裁剪时触发 暂未使用
this
.
clipImg
=
show
;
},
goPage
(
index
)
{
goPage
(
index
)
{
// 设置页面切换
this
.
currentPage
=
index
;
console
.
log
(
index
);
this
.
editIndex
=
""
;
this
.
editObj
=
{};
this
.
message
({
...
...
@@ -544,7 +545,7 @@ export default {
});
this
.
pageViews
=
true
;
},
createPage
(
index
)
{
createPage
(
index
)
{
// 新增页面
this
.
templateData
.
listData
.
splice
(
index
,
0
,
...
...
@@ -557,7 +558,7 @@ export default {
this
.
$toast
.
success
(
"创建成功"
);
this
.
pageViews
=
false
;
},
deletePage
(
index
)
{
deletePage
(
index
)
{
// 删除页面
if
(
this
.
templateData
.
listData
.
length
<
2
)
{
this
.
$toast
.
fail
(
"至少存留一页"
);
return
false
;
...
...
@@ -581,7 +582,7 @@ export default {
}
},
1000
);
},
valueChange
()
{
valueChange
()
{
// 当value 变化的时候
this
.
message
({
type
:
"setData"
,
index
:
this
.
editIndex
,
...
...
@@ -645,7 +646,7 @@ export default {
// (item = Object.assign(item, item.default));
});
},
getFilmDetail
()
{
getFilmDetail
()
{
// 获取影片详情数据
if
(
this
.
$route
.
query
.
filmId
)
{
getFilmDetail
(
this
.
$route
.
query
.
filmId
).
then
(
res
=>
{
console
.
log
(
res
.
data
,
"作品详情"
);
...
...
@@ -689,7 +690,7 @@ export default {
});
}
},
getTempalteDetail
()
{
getTempalteDetail
()
{
// 获取模板详情
getTempalteDetail
(
this
.
$route
.
query
.
templateId
).
then
(
res
=>
{
console
.
log
(
res
.
data
,
"模板详情"
);
this
.
templateData
.
filmId
=
""
;
...
...
@@ -726,7 +727,7 @@ export default {
}
});
},
publish
()
{
publish
()
{
// 发布作品或更新作品
if
(
!
this
.
templateData
.
listData
.
length
)
{
alert
(
"数据为空"
);
return
;
...
...
@@ -754,11 +755,6 @@ export default {
this
.
$toast
.
clear
();
});
}
else
{
// "templateId": "string",
// "resourceId": "string",
// "frameId": "string",
// "filmData": "string",
// "filmName": "string"
createFilm
({
templateId
:
this
.
$route
.
query
.
templateId
,
filmData
:
JSON
.
stringify
({
...
...
@@ -769,7 +765,7 @@ export default {
filmDescribe
:
this
.
templateData
.
filmDescribe
})
.
then
(
res
=>
{
window
.
sessionStorage
.
setItem
(
"filmId"
,
res
.
data
.
data
);
window
.
sessionStorage
.
setItem
(
"filmId"
,
res
.
data
.
data
);
// 设置id 防止回退的时候再次点击发布执行创建接口
this
.
templateData
.
filmId
=
res
.
data
.
data
;
this
.
navToWx
(
res
.
data
.
data
);
})
...
...
@@ -778,7 +774,7 @@ export default {
});
}
},
navToWx
(
fId
)
{
navToWx
(
fId
)
{
// 跳转到微信小程序选择设备页面
const
filmId
=
this
.
$route
.
query
.
filmId
||
window
.
sessionStorage
.
getItem
(
"filmId"
)
||
...
...
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