Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-ui
Commits
c22c4cdf
Commit
c22c4cdf
authored
Jul 04, 2020
by
刘殿昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
没想出来menu啥问题,暂时测试一周吧
parent
51d1b45b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
107 deletions
+36
-107
src/components/menu.vue
src/components/menu.vue
+36
-107
No files found.
src/components/menu.vue
View file @
c22c4cdf
<
template
>
<div
class=
"menu"
>
<img
src=
"../assets/imgs/home_img_logo.png"
alt
class=
"logo"
/>
<div
style=
"float:right;cursor: pointer;position:relative;"
class=
"user_hover"
>
<span
v-if=
"userInfo.user_name && userInfo.user_name != ''"
class=
"user"
>
{{
userInfo
.
user_name
}}
</span
>
<div
style=
"float:right;cursor: pointer;position:relative;"
class=
"user_hover"
>
<span
v-if=
"userInfo.user_name && userInfo.user_name != ''"
class=
"user"
>
{{
userInfo
.
user_name
}}
</span>
<span
v-else
@
click=
"gotopage('login')"
class=
"user"
>
请登录
</span>
<img
:class=
"userInfo.picture_path ? 'user_pic' : 'user_default'"
:src=
"
<img
:class=
"userInfo.picture_path ? 'user_pic' : 'user_default'"
:src=
"
userInfo.picture_path || require('../assets/imgs/home_ic_user.png')
"
/>
<div
v-if=
"userInfo.user_name && userInfo.user_name != ''"
class=
"user_menu"
>
<div
v-for=
"(item, index) in user_arr"
:key=
"index + 700"
@
click=
"gotopage(item.path)"
>
"
/>
<div
v-if=
"userInfo.user_name && userInfo.user_name != ''"
class=
"user_menu"
>
<div
v-for=
"(item, index) in user_arr"
:key=
"index + 700"
@
click=
"gotopage(item.path)"
>
{{
item
.
name
}}
</div>
</div>
<div
v-if=
"userInfo.user_name && userInfo.user_name != ''"
class=
"sj"
></div>
<div
v-if=
"userInfo.user_name && userInfo.user_name != ''"
class=
"sj"
></div>
</div>
<div
style=
"float:right;cursor: pointer;position:relative;"
class=
"shop_hover"
@
click=
"gotopage('/shop/shopping_cart')"
>
<div
style=
"float:right;cursor: pointer;position:relative;"
class=
"shop_hover"
@
click=
"gotopage('/shop/shopping_cart')"
>
<div
class=
"car"
>
<el-badge
v-if=
"menuCartNum != 0"
:value=
"menuCartNum"
:max=
"99"
class=
"number"
></el-badge>
<el-badge
v-if=
"menuCartNum != 0"
:value=
"menuCartNum"
:max=
"99"
class=
"number"
></el-badge>
<img
src=
"../assets/imgs/home_ic_shop.png"
alt
class=
"car_img"
/>
</div>
<div
v-if=
"userInfo.user_name && userInfo.user_name != ''"
class=
"shop_menu"
>
<div
v-if=
"userInfo.user_name && userInfo.user_name != ''"
class=
"shop_menu"
>
<div
class=
"shop_list_title"
>
最近加入的服务:
</div>
<div
v-for=
"(item, index) in shopping_list"
:key=
"'shopping' + index"
class=
"shop_list_cell shop_line"
>
<div
v-for=
"(item, index) in shopping_list"
:key=
"'shopping' + index"
class=
"shop_list_cell shop_line"
>
<img
:src=
"item.service.cover"
class=
"shop_img"
/>
<div
class=
"shop_cell_msgs"
>
<p
@
click=
"getDetail(item.id)"
class=
"shop_cell_name over_one"
>
{{
item
.
service_id
==
0
?
item
.
application
.
app_name
:
item
.
service
.
name
}}
{{
item
.
service_id
==
0
?
item
.
application
.
app_name
:
item
.
service
.
name
}}
</p>
<p
class=
"shop_cell_msg bover_one"
>
{{
item
.
service_id
==
0
?
item
.
application
.
ywly
:
item
.
service
.
sectors_name
}}
{{
item
.
service_id
==
0
?
item
.
application
.
ywly
:
item
.
service
.
sectors_name
}}
</p>
<p
class=
"shop_cell_msg over_one"
>
{{
item
.
service_id
==
0
?
item
.
application
.
org
:
item
.
service
.
organization_name
}}
{{
item
.
service_id
==
0
?
item
.
application
.
org
:
item
.
service
.
organization_name
}}
</p>
</div>
<div>
<img
@
click.stop=
"deleteItem(item.id)"
src=
"../assets/imgs/ic_delete.png"
alt
/>
<img
@
click.stop=
"deleteItem(item.id)"
src=
"../assets/imgs/ic_delete.png"
alt
/>
</div>
</div>
<div
class=
"shop_footer"
>
<el-button
@
click=
"settlement"
size=
"small"
class=
"shop_settlement"
>
去购物车申请结算
</el-button
>
<el-button
@
click=
"settlement"
size=
"small"
class=
"shop_settlement"
>
去购物车申请结算
</el-button>
</div>
</div>
<div
v-if=
"userInfo.user_name && userInfo.user_name != ''"
class=
"shop_sj"
></div>
<div
v-if=
"userInfo.user_name && userInfo.user_name != ''"
class=
"shop_sj"
></div>
</div>
<div
style=
"float:right"
>
<div
v-for=
"(item, index) in menu_arr"
:key=
"index + 200"
class=
"menu_box user_hover"
@
click=
"navAction(item.visit_url)"
:style=
"
{ color: now_menu == item.visit_url ? '#fff' : '' }"
>
<div
v-for=
"(item, index) in menu_arr"
:key=
"index + 200"
class=
"menu_box user_hover"
@
click=
"navAction(item.visit_url)"
:style=
"
{ color: now_menu == item.visit_url ? '#fff' : '' }">
{{
item
.
menu_name
}}
<div
class=
"user_menu"
v-if=
"item.Child && item.Child.length"
style=
"left: 30px;"
>
<div
v-for=
"(v, indexs) in item.Child"
:key=
"indexs + 700"
@
click.stop=
"gotoChildPage(v, item.visit_url)"
>
<div
class=
"user_menu"
v-if=
"item.Child && item.Child.length"
style=
"left: 30px;"
>
<div
v-for=
"(v, indexs) in item.Child"
:key=
"indexs + 700"
@
click.stop=
"gotoChildPage(v, item.visit_url)"
>
{{
v
.
menu_name
}}
</div>
</div>
<div
class=
"sj"
v-if=
"item.Child && item.Child.length"
style=
"left: 60px;"
></div>
<div
class=
"sj"
v-if=
"item.Child && item.Child.length"
style=
"left: 60px;"
></div>
<div
class=
"bottom_show"
v-if=
"now_menu == item.visit_url"
></div>
</div>
</div>
...
...
@@ -146,10 +71,10 @@ export default {
{
name
:
"
消息通知
"
,
path
:
"
/user/message
"
},
{
name
:
"
收银中心
"
,
path
:
""
},
{
name
:
"
关于BD-aPaaS
"
,
path
:
""
},
{
name
:
"
退出登录
"
,
path
:
"
logout
"
}
,
{
name
:
"
退出登录
"
,
path
:
"
logout
"
}
],
shopping_list
:
[],
menuCartNum
:
0
,
menuCartNum
:
0
};
},
mounted
()
{
...
...
@@ -162,15 +87,16 @@ export default {
},
userInfo
()
{
return
this
.
$store
.
state
.
userInfo
||
{};
}
,
}
},
watch
:
{
getMenuCartState
(
newVal
)
{
this
.
getList
();
}
,
}
},
methods
:
{
gotopage
(
n
)
{
console
.
log
(
"
function gotopage,menu test:
"
+
n
);
if
(
n
==
"
logout
"
)
{
window
.
location
.
href
=
"
/iam/api/logout
"
;
}
else
if
(
n
==
"
login
"
)
{
...
...
@@ -185,7 +111,7 @@ export default {
},
deleteItem
(
id
)
{
let
query
=
[
id
];
this
.
$api
.
serviceShop
.
delShoppingCart
(
query
).
then
(
(
response
)
=>
{
this
.
$api
.
serviceShop
.
delShoppingCart
(
query
).
then
(
response
=>
{
this
.
getList
();
});
},
...
...
@@ -195,26 +121,29 @@ export default {
this
.
$router
.
push
({
name
:
"
shoppingCart
"
});
},
navAction
(
path
)
{
this
.
$router
.
push
(
path
);
console
.
log
(
"
function navAction,menu test:
"
+
path
);
this
.
now_menu
=
path
;
window
.
sessionStorage
.
setItem
(
"
menuVisitUrl
"
,
path
);
this
.
$router
.
push
(
path
);
},
gotoChildPage
(
v
,
parent
)
{
console
.
log
(
"
function gotoChildPage,menu test:
"
+
v
+
"
|
"
+
parent
);
if
(
v
.
visit_url
)
{
if
(
v
.
visit_url
==
"
/fwgl/
"
||
v
.
visit_url
==
"
/yygl/
"
)
{
this
.
$router
.
push
(
v
.
visit_url
+
this
.
$store
.
getters
.
level
);
}
else
if
(
parent
==
"
/services_shop
"
)
{
this
.
$router
.
push
(
v
.
visit_url
);
this
.
$store
.
commit
(
"
serviceShopMenuAct
"
,
v
.
visit_url
);
this
.
$router
.
push
(
v
.
visit_url
);
}
else
{
this
.
$router
.
push
(
v
.
visit_url
);
}
this
.
now_menu
=
parent
;
window
.
sessionStorage
.
setItem
(
"
menuVisitUrl
"
,
parent
);
}
},
getList
()
{
this
.
$api
.
serviceShop
.
getShoppingCart
().
then
(
(
response
)
=>
{
this
.
$api
.
serviceShop
.
getShoppingCart
().
then
(
response
=>
{
if
(
response
.
data
.
success
==
"
1
"
)
{
this
.
menuCartNum
=
response
.
data
.
data
.
valid
?
response
.
data
.
data
.
valid
.
length
...
...
@@ -233,15 +162,15 @@ export default {
this
.
now_menu
=
visit_url
?
visit_url
:
"
/services_shop
"
;
},
getNowMenu
()
{
this
.
$api
.
general
.
getNowMenu
({
teamName
:
"
APAAS3
"
}).
then
(
(
response
)
=>
{
this
.
$api
.
general
.
getNowMenu
({
teamName
:
"
APAAS3
"
}).
then
(
response
=>
{
if
(
response
.
data
.
success
==
1
)
{
this
.
menu_arr
=
(
response
.
data
.
data
[
0
]
&&
response
.
data
.
data
[
0
].
Child
)
||
[];
this
.
getMenuIndex
();
}
});
}
,
}
,
}
}
};
</
script
>
...
...
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