Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
new-sing
admin-base
Commits
6960f7af
Commit
6960f7af
authored
Sep 11, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused code
parent
ea923599
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
77 deletions
+15
-77
index.vue
src/components/weChat/index.vue
+15
-77
No files found.
src/components/weChat/index.vue
View file @
6960f7af
...
...
@@ -7,7 +7,7 @@
唱唱启蒙英语
</div>
<div
class=
"mobile_bd"
>
<ul
class=
"pre_menu_list grid_line ui-sortable ui-sortable-disabled"
id=
"menuList"
style=
"margin-top:0; margin-bottom: 0"
>
<ul
class=
"pre_menu_list grid_line ui-sortable ui-sortable-disabled"
style=
"margin-top:0; margin-bottom: 0"
>
<li
v-for=
"(item, index) in buttonList"
class=
"jsMenu pre_menu_item grid_item jslevel1 ui-sortable ui-sortable-disabled"
:class=
"(selectedIndex === index && selectedChildIndex === -1) ? 'current selected' : ''"
>
<a
href=
"javascript:void(0);"
class=
"pre_menu_link"
draggable=
"false"
@
click=
"clickMenu(index, item)"
>
<i
class=
"icon_menu_dot js_icon_menu_dot dn"
></i>
...
...
@@ -52,7 +52,7 @@
<div
id=
"js_rightBox"
class=
"portable_editor to_left"
style=
"display: block;"
>
<div
class=
"editor_inner"
>
<div
class=
"menu_form_hd flex-bt"
>
<h4
class=
"global_info"
>
{{
selectedChildIndex
!==
-
1
?
buttonList
[
selectedIndex
].
sub_button
[
selectedChildIndex
].
name
:
buttonList
[
selectedIndex
].
name
}}
</h4>
<h4
class=
"global_info"
>
{{
getName
()
}}
</h4>
<div
class=
"global_extra"
>
<a
v-if=
"selectedChildIndex === -1"
href=
"javascript:void(0);"
@
click=
"delMenu"
>
删除菜单
</a>
<a
v-else
href=
"javascript:void(0);"
@
click=
"delSubMenu"
>
删除子菜单
</a>
...
...
@@ -66,7 +66,8 @@
<label
for=
""
class=
"frm_label"
>
<strong
class=
"title js_menuTitle"
>
{{
selectedChildIndex
===
-
1
?
'菜单名称'
:
'子菜单名称'
}}
</strong>
</label>
<div
class=
"frm_controls"
>
<span
class=
"frm_input_box with_counter counter_in append"
>
<input
:value=
"selectedChildIndex === -1 ? buttonList[selectedIndex].name : buttonList[selectedIndex].sub_button[selectedChildIndex].name"
type=
"text"
class=
"frm_input js_menu_name"
@
input=
"onInput"
/>
<input
v-if=
"selectedChildIndex === -1 && buttonList[selectedIndex]"
v-model=
"buttonList[selectedIndex].name"
type=
"text"
class=
"frm_input js_menu_name"
@
input=
"onInput"
/>
<input
v-else-if=
"selectedChildIndex > -1 && buttonList[selectedIndex].sub_button[selectedChildIndex]"
v-model=
"buttonList[selectedIndex].sub_button[selectedChildIndex].name"
type=
"text"
class=
"frm_input js_menu_name"
@
input=
"onInput"
/>
</span>
<p
class=
"frm_msg fail js_titleEorTips dn"
v-if=
"showErrorTips"
>
字数超过上限
</p>
<p
class=
"frm_msg fail js_titlenoTips dn"
style=
"display: none;"
>
请输入菜单名称
</p>
...
...
@@ -90,7 +91,7 @@
<label
for=
""
class=
"frm_label"
>
页面地址
</label>
<div
class=
"frm_controls"
>
<span
class=
"frm_input_box"
>
<input
v-model=
"buttonList[selectedIndex].url"
type=
"text"
class=
"frm_input"
name=
"urlText"
/>
<input
v-model=
"buttonList[selectedIndex].url"
type=
"text"
class=
"frm_input"
/>
</span>
</div>
</div>
...
...
@@ -101,7 +102,7 @@
<label
for=
""
class=
"frm_label"
>
key
</label>
<div
class=
"frm_controls"
>
<span
class=
"frm_input_box"
>
<input
v-model=
"buttonList[selectedIndex].key"
type=
"text"
class=
"frm_input"
name=
"clickKey"
/>
<input
v-model=
"buttonList[selectedIndex].key"
type=
"text"
class=
"frm_input"
/>
</span>
</div>
</div>
...
...
@@ -114,7 +115,7 @@
<label
for=
""
class=
"frm_label"
>
页面地址
</label>
<div
class=
"frm_controls"
>
<span
class=
"frm_input_box"
>
<input
v-model=
"buttonList[selectedIndex].sub_button[selectedChildIndex].url"
type=
"text"
class=
"frm_input"
name=
"urlText"
/>
<input
v-model=
"buttonList[selectedIndex].sub_button[selectedChildIndex].url"
type=
"text"
class=
"frm_input"
/>
</span>
</div>
</div>
...
...
@@ -125,7 +126,7 @@
<label
for=
""
class=
"frm_label"
>
key
</label>
<div
class=
"frm_controls"
>
<span
class=
"frm_input_box"
>
<input
v-model=
"buttonList[selectedIndex].sub_button[selectedChildIndex].key"
type=
"text"
class=
"frm_input"
name=
"clickKey"
/>
<input
v-model=
"buttonList[selectedIndex].sub_button[selectedChildIndex].key"
type=
"text"
class=
"frm_input"
/>
</span>
</div>
</div>
...
...
@@ -155,11 +156,6 @@
return
{
buttonList
:
[],
selectedIndex
:
0
,
selectedItem
:
{
name
:
''
,
sub_button
:
[],
type
:
'view'
},
selectedChildIndex
:
-
1
,
showErrorTips
:
false
}
...
...
@@ -168,11 +164,17 @@
this
.
getMenu
();
},
methods
:{
getName
(){
if
(
this
.
selectedChildIndex
===
-
1
){
return
this
.
buttonList
[
this
.
selectedIndex
].
name
||
''
}
else
{
return
this
.
buttonList
[
this
.
selectedIndex
].
sub_button
[
this
.
selectedChildIndex
].
name
||
''
}
},
getMenu
(){
getPublicMenuApi
().
then
(
res
=>
{
if
(
res
.
menu
&&
res
.
menu
.
button
)
{
this
.
buttonList
=
res
.
menu
.
button
this
.
selectedItem
=
this
.
buttonList
.
length
>
0
?
this
.
buttonList
[
0
]
:
{}
this
.
selectedIndex
=
0
this
.
selectedChildIndex
=
-
1
}
...
...
@@ -181,13 +183,9 @@
clickMenu
(
index
,
item
){
this
.
selectedIndex
=
index
this
.
selectedChildIndex
=
-
1
this
.
selectedItem
=
item
},
clickSubMenu
(
index
,
item
){
this
.
selectedChildIndex
=
index
this
.
selectedItem
=
item
console
.
log
(
'clickSubMenu'
,
this
.
buttonList
)
console
.
log
(
'click sub menu'
,
this
.
buttonList
[
this
.
selectedIndex
].
sub_button
[
this
.
selectedChildIndex
].
type
);
},
onInput
(
val
)
{
let
value
=
val
.
target
.
value
...
...
@@ -198,7 +196,6 @@
sumLength
=
chineseLength
+
sumLength
}
this
.
showErrorTips
=
sumLength
>
8
this
.
selectedItem
.
name
=
value
},
addSubMenu
(){
let
item
=
{
...
...
@@ -209,19 +206,6 @@
}
this
.
buttonList
[
this
.
selectedIndex
].
sub_button
.
push
(
item
)
this
.
selectedChildIndex
=
this
.
buttonList
[
this
.
selectedIndex
].
sub_button
.
length
-
1
// getPublicMenuApi().then(res=> {
// if (res.menu && res.menu.button) {
// this.buttonList = res.menu.button
// this.selectedItem = {
// name: '子菜单名',
// sub_button: [],
// type: 'view',
// url: ''
// }
// this.buttonList[this.selectedIndex].sub_button.push(this.selectedItem)
// this.selectedChildIndex = this.buttonList[this.selectedIndex].sub_button.length - 1
// }
// })
},
delSubMenu
(){
this
.
$confirm
(
'此操作将删除该子菜单?'
,
'提示'
,
{
...
...
@@ -231,15 +215,6 @@
}).
then
(()
=>
{
this
.
buttonList
[
this
.
selectedIndex
].
sub_button
.
splice
(
this
.
selectedChildIndex
,
1
)
this
.
selectedChildIndex
=
this
.
buttonList
[
this
.
selectedIndex
].
sub_button
.
length
-
1
this
.
selectedItem
=
this
.
selectedChildIndex
>
-
1
?
this
.
buttonList
[
this
.
selectedIndex
][
this
.
selectedChildIndex
]
:
this
.
buttonList
[
this
.
selectedIndex
]
// getPublicMenuApi().then(res => {
// if (res.menu && res.menu.button) {
// this.buttonList = res.menu.button
// this.buttonList[this.selectedIndex].sub_button.splice(this.selectedChildIndex, 1)
// this.selectedChildIndex = this.buttonList[this.selectedIndex].sub_button.length - 1
// this.selectedItem = this.selectedChildIndex > -1 ? this.buttonList[this.selectedIndex][this.selectedChildIndex] : this.buttonList[this.selectedIndex]
// }
// });
});
},
onAddMenu
(){
...
...
@@ -252,22 +227,6 @@
this
.
buttonList
.
push
(
item
)
this
.
selectedIndex
=
this
.
buttonList
.
length
-
1
this
.
selectedChildIndex
=
-
1
console
.
log
(
'this.buttonList'
,
this
.
buttonList
)
console
.
log
(
'this.buttonList selectedChildIndex'
,
this
.
selectedChildIndex
)
// getPublicMenuApi().then(res=> {
// if (res.menu && res.menu.button) {
// this.buttonList = res.menu.button
// this.selectedItem = {
// name: '菜单名',
// sub_button: [],
// type: 'view',
// url: ''
// }
// this.buttonList.push(this.selectedItem)
// this.selectedIndex = this.buttonList.length - 1
// this.selectedChildIndex = -1
// }
// })
},
delMenu
(){
this
.
$confirm
(
'此操作将删除该菜单?'
,
'提示'
,
{
...
...
@@ -286,19 +245,6 @@
}
this
.
selectedIndex
=
this
.
buttonList
.
length
-
1
;
this
.
selectedChildIndex
=
-
1
// getPublicMenuApi().then(res=> {
// if (res.menu && res.menu.button) {
// this.buttonList = res.menu.button
// this.buttonList.splice(this.selectedIndex,1)
// this.selectedItem = this.buttonList.length > 0 ? this.buttonList[0] : {
// name: '菜单名',
// sub_button: [],
// type: 'view',
// url: ''}
// this.selectedChildIndex = -1
// }
// })
});
},
onTypeChange
(
val
){
...
...
@@ -306,17 +252,9 @@
},
onSave
(){
let
buttonList
=
this
.
buttonList
// if (this.selectedIndex > -1 && this.selectedChildIndex > -1) {
// buttonList[this.selectedIndex].sub_button[this.selectedChildIndex] = this.selectedItem
// }
// if (this.selectedIndex > -1 && this.selectedChildIndex === -1) {
// buttonList[this.selectedIndex] = this.selectedItem
// }
let
json
=
{
buttons
:
JSON
.
stringify
(
buttonList
)
}
console
.
log
(
'json'
,
buttonList
)
return
savePublicMenuApi
(
json
).
then
(
res
=>
{
if
(
res
.
errcode
===
0
){
this
.
$message
({
...
...
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