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
443a03ed
authored
Jan 02, 2020
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
4e256bae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
27 deletions
+53
-27
src/views/tempaltes/editMenu.vue
+6
-4
src/views/tempaltes/editMore.vue
+47
-23
No files found.
src/views/tempaltes/editMenu.vue
View file @
443a03ed
...
...
@@ -390,9 +390,9 @@ export default {
inputValueChange
(
item
,
value
,
isList
,
key
,
Listindex
)
{
this
.
valueChange2
();
let
errorData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
errorData
));
function
isArray
(
obj
)
{
Object
.
prototype
.
toString
.
call
(
obj
)
===
"[object Array]"
;
}
//
function isArray(obj) {
//
Object.prototype.toString.call(obj) === "[object Array]";
//
}
// function isReg(obj) {
// Object.prototype.toString.call(obj) === "[object String]";
// }
...
...
@@ -426,7 +426,7 @@ export default {
delete
errorData
[
key
+
Listindex
];
this
.
$store
.
commit
(
"SET_ERROR_DATA"
,
errorData
);
}
if
(
item
.
valueRule
&&
isArray
(
item
.
valueRule
)
)
{
if
(
item
.
valueRule
)
{
if
(
isList
===
"list"
)
{
if
(
new
RegExp
(
item
.
valueRule
,
"g"
).
test
(
val
))
{
delete
this
.
errorData
[
item
.
dataKey
];
...
...
@@ -435,6 +435,7 @@ export default {
console
.
error
(
errorData
);
this
.
$toast
(
"数据不合法"
);
}
}
else
{
if
(
new
RegExp
(
item
.
valueRule
,
"g"
).
test
(
val
))
{
delete
errorData
[
item
.
dataKey
];
...
...
@@ -443,6 +444,7 @@ export default {
this
.
$toast
(
"数据不合法"
);
}
}
this
.
$store
.
commit
(
"SET_ERROR_DATA"
,
errorData
);
}
else
{
// this.valueChange2();
}
...
...
src/views/tempaltes/editMore.vue
View file @
443a03ed
...
...
@@ -4,7 +4,7 @@
<NavBar
title=
"编辑作品"
v-if=
"!is_mini_token"
left-arrow
>
<div
@
click=
"pageShow"
>
页面管理
</div>
</NavBar>
<svg
<
!--
<
svg
v-show=
"!gifloaded && !loaded && !iframeLoaded"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
...
...
@@ -127,7 +127,7 @@
/>
</circle>
</g>
</svg>
</svg>
-->
<div
class=
"content"
v-show=
"gifloaded && iframeLoaded"
>
<div
class=
"content-left"
...
...
@@ -314,7 +314,7 @@ export default {
return
{
activeName
:
"0"
,
canvasImg
:
""
,
gifloaded
:
false
,
// gif 图加载控制
gifloaded
:
false
,
// gif 图加载控制
is_mini_token
:
false
,
time
:
new
Date
().
getTime
(),
showSheet
:
false
,
// 页面管理菜单显示控制
...
...
@@ -383,23 +383,32 @@ export default {
}
},
watch
:
{
currentPage
:
function
()
{
// 页面改变时 改变编辑项的索引
currentPage
:
function
()
{
// 页面改变时 改变编辑项的索引
this
.
itemListIndex
=
0
;
}
},
activated
()
{
// keepalive 下显示触发
activated
()
{
// keepalive 下显示触发
document
.
title
=
"编辑作品"
;
window
.
addEventListener
(
"popstate"
,
listenRouterBack
,
false
);
// this.currentPage = JSON.parse(JSON.stringify(this.currentPage))
this
.
goPage
(
0
)
this
.
goPage
(
0
)
;
},
deactivated
()
{
// keepalive 隐藏显示触发
deactivated
()
{
// keepalive 隐藏显示触发
window
.
removeEventListener
(
"popstate"
,
listenRouterBack
,
false
);
},
destroyed
()
{
// 页面销毁触发
destroyed
()
{
// 页面销毁触发
window
.
removeEventListener
(
"popstate"
,
listenRouterBack
,
false
);
},
created
()
{
// 当前实例创建完成触发
created
()
{
// 当前实例创建完成触发
this
.
$toast
.
loading
({
message
:
"数据加载中..."
,
forbidClick
:
true
});
let
ua
=
window
.
navigator
.
userAgent
;
//$alert('浏览器版本: ' + app + '\n' + '用户代理: ' + ua);
if
(
ua
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
))
{
...
...
@@ -478,7 +487,8 @@ export default {
// }, 1000);
},
methods
:
{
listenRouterBack
()
{
// 监听路由变化防止点击两次返回
listenRouterBack
()
{
// 监听路由变化防止点击两次返回
window
.
wx
.
miniProgram
.
navigateBack
();
},
message
(
data
)
{
...
...
@@ -490,10 +500,12 @@ export default {
// window.frames[1].postMessage(data, "https://visual-clouds.bdideal.com");
// document.querySelector('.iframe').postMessage(data, "https://visual-clouds.bdideal.com")
},
setItemListIndex
(
index
)
{
// 设置编辑项数据激活index
setItemListIndex
(
index
)
{
// 设置编辑项数据激活index
this
.
itemListIndex
=
index
;
},
onSheetSelect
(
item
)
{
// 当actionSheet 被点击时候
onSheetSelect
(
item
)
{
// 当actionSheet 被点击时候
this
.
showSheet
=
false
;
if
(
item
.
action
===
"createPage"
)
{
this
.
createPage
(
this
.
currentPage
);
...
...
@@ -517,22 +529,26 @@ export default {
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
;
this
.
editIndex
=
""
;
this
.
editObj
=
{};
...
...
@@ -547,7 +563,8 @@ export default {
});
this
.
pageViews
=
true
;
},
createPage
(
index
)
{
// 新增页面
createPage
(
index
)
{
// 新增页面
this
.
templateData
.
listData
.
splice
(
index
,
0
,
...
...
@@ -560,7 +577,8 @@ export default {
this
.
$toast
.
success
(
"创建成功"
);
this
.
pageViews
=
false
;
},
deletePage
(
index
)
{
// 删除页面
deletePage
(
index
)
{
// 删除页面
if
(
this
.
templateData
.
listData
.
length
<
2
)
{
this
.
$toast
.
fail
(
"至少存留一页"
);
return
false
;
...
...
@@ -584,7 +602,8 @@ export default {
}
},
1000
);
},
valueChange
()
{
// 当value 变化的时候
valueChange
()
{
// 当value 变化的时候
this
.
message
({
type
:
"setData"
,
index
:
this
.
editIndex
,
...
...
@@ -628,6 +647,7 @@ export default {
this
.
loaded
=
true
;
},
iframeLoad
()
{
this
.
$toast
.
clear
()
this
.
gifloaded
=
true
;
this
.
iframeLoaded
=
true
;
this
.
setList
();
...
...
@@ -648,7 +668,8 @@ 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
,
"作品详情"
);
...
...
@@ -692,7 +713,8 @@ export default {
});
}
},
getTempalteDetail
()
{
// 获取模板详情
getTempalteDetail
()
{
// 获取模板详情
getTempalteDetail
(
this
.
$route
.
query
.
templateId
).
then
(
res
=>
{
console
.
log
(
res
.
data
,
"模板详情"
);
this
.
templateData
.
filmId
=
""
;
...
...
@@ -729,7 +751,8 @@ export default {
}
});
},
publish
()
{
// 发布作品或更新作品
publish
()
{
// 发布作品或更新作品
if
(
!
this
.
templateData
.
listData
.
length
)
{
alert
(
"数据为空"
);
return
;
...
...
@@ -776,7 +799,8 @@ 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