Commit ba66cb7b authored by 徐一鸣's avatar 徐一鸣

menu报错的问题

parent 85c67c0f
This diff is collapsed.
This diff is collapsed.
<template> <template>
<div class="menu"> <div class="menu">
<img src="../assets/imgs/home_img_logo.png" alt class="logo" /> <img src="../assets/imgs/home_img_logo.png" alt class="logo" />
<div style="float:right;cursor: pointer;position:relative;" class="user_hover"> <div
style="float:right;cursor: pointer;position:relative;"
class="user_hover"
>
<span <span
v-if="userInfo.user_name && userInfo.user_name !=''" v-if="userInfo.user_name && userInfo.user_name != ''"
class="user" class="user"
>{{ userInfo.user_name }}</span> >{{ userInfo.user_name }}</span
>
<span v-else @click="gotopage('login')" class="user">请登录</span> <span v-else @click="gotopage('login')" class="user">请登录</span>
<img <img
:class="userInfo.picture_path ? 'user_pic': 'user_default'" :class="userInfo.picture_path ? 'user_pic' : 'user_default'"
:src=" :src="
userInfo.picture_path || require('../assets/imgs/home_ic_user.png') userInfo.picture_path || require('../assets/imgs/home_ic_user.png')
" "
/> />
<div v-if="userInfo.user_name && userInfo.user_name !=''" class="user_menu"> <div
v-if="userInfo.user_name && userInfo.user_name != ''"
class="user_menu"
>
<div <div
v-for="(item, index) in user_arr" v-for="(item, index) in user_arr"
:key="index + 700" :key="index + 700"
@click="gotopage(item.path)" @click="gotopage(item.path)"
>{{ item.name }}</div> >
{{ item.name }}
</div>
</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>
<div <div
style="float:right;cursor: pointer;position:relative;" style="float:right;cursor: pointer;position:relative;"
...@@ -28,10 +40,18 @@ ...@@ -28,10 +40,18 @@
@click="gotopage('/shop/shopping_cart')" @click="gotopage('/shop/shopping_cart')"
> >
<div class="car"> <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" /> <img src="../assets/imgs/home_ic_shop.png" alt class="car_img" />
</div> </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 class="shop_list_title">最近加入的服务:</div>
<div <div
v-for="(item, index) in shopping_list" v-for="(item, index) in shopping_list"
...@@ -42,35 +62,44 @@ ...@@ -42,35 +62,44 @@
<div class="shop_cell_msgs"> <div class="shop_cell_msgs">
<p @click="getDetail(item.id)" class="shop_cell_name over_one"> <p @click="getDetail(item.id)" class="shop_cell_name over_one">
{{ {{
item.service_id == 0 item.service_id == 0
? item.application.app_name ? item.application.app_name
: item.service.name : item.service.name
}} }}
</p> </p>
<p class="shop_cell_msg bover_one"> <p class="shop_cell_msg bover_one">
{{ {{
item.service_id == 0 item.service_id == 0
? item.application.ywly ? item.application.ywly
: item.service.sectors_name : item.service.sectors_name
}} }}
</p> </p>
<p class="shop_cell_msg over_one"> <p class="shop_cell_msg over_one">
{{ {{
item.service_id == 0 item.service_id == 0
? item.application.org ? item.application.org
: item.service.organization_name : item.service.organization_name
}} }}
</p> </p>
</div> </div>
<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> </div>
<div class="shop_footer"> <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> </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>
<div style="float:right"> <div style="float:right">
...@@ -82,14 +111,24 @@ ...@@ -82,14 +111,24 @@
:style="{ color: now_menu == item.visit_url ? '#fff' : '' }" :style="{ color: now_menu == item.visit_url ? '#fff' : '' }"
> >
{{ item.menu_name }} {{ item.menu_name }}
<div class="user_menu" v-if="item.Child && item.Child.length" style="left: 30px;"> <div
class="user_menu"
v-if="item.Child && item.Child.length"
style="left: 30px;"
>
<div <div
v-for="(v, indexs) in item.Child" v-for="(v, indexs) in item.Child"
:key="indexs + 700" :key="indexs + 700"
@click.stop="gotoChildPage(v, item.visit_url)" @click.stop="gotoChildPage(v, item.visit_url)"
>{{ v.menu_name }}</div> >
{{ v.menu_name }}
</div>
</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 class="bottom_show" v-if="now_menu == item.visit_url"></div>
</div> </div>
</div> </div>
...@@ -107,10 +146,10 @@ export default { ...@@ -107,10 +146,10 @@ export default {
{ name: "消息通知", path: "/user/message" }, { name: "消息通知", path: "/user/message" },
{ name: "收银中心", path: "" }, { name: "收银中心", path: "" },
{ name: "关于BD-aPaaS", path: "" }, { name: "关于BD-aPaaS", path: "" },
{ name: "退出登录", path: "logout" } { name: "退出登录", path: "logout" },
], ],
shopping_list: [], shopping_list: [],
menuCartNum: 0 menuCartNum: 0,
}; };
}, },
mounted() { mounted() {
...@@ -123,12 +162,12 @@ export default { ...@@ -123,12 +162,12 @@ export default {
}, },
userInfo() { userInfo() {
return this.$store.state.userInfo || {}; return this.$store.state.userInfo || {};
} },
}, },
watch: { watch: {
getMenuCartState(newVal) { getMenuCartState(newVal) {
this.getList(); this.getList();
} },
}, },
methods: { methods: {
gotopage(n) { gotopage(n) {
...@@ -146,7 +185,7 @@ export default { ...@@ -146,7 +185,7 @@ export default {
}, },
deleteItem(id) { deleteItem(id) {
let query = [id]; let query = [id];
this.$api.serviceShop.delShoppingCart(query).then(response => { this.$api.serviceShop.delShoppingCart(query).then((response) => {
this.getList(); this.getList();
}); });
}, },
...@@ -175,7 +214,7 @@ export default { ...@@ -175,7 +214,7 @@ export default {
} }
}, },
getList() { getList() {
this.$api.serviceShop.getShoppingCart().then(response => { this.$api.serviceShop.getShoppingCart().then((response) => {
if (response.data.success == "1") { if (response.data.success == "1") {
this.menuCartNum = response.data.data.valid this.menuCartNum = response.data.data.valid
? response.data.data.valid.length ? response.data.data.valid.length
...@@ -194,14 +233,15 @@ export default { ...@@ -194,14 +233,15 @@ export default {
this.now_menu = visit_url ? visit_url : "/services_shop"; this.now_menu = visit_url ? visit_url : "/services_shop";
}, },
getNowMenu() { getNowMenu() {
this.$api.general.getNowMenu({ teamName: "APAAS3" }).then(response => { this.$api.general.getNowMenu({ teamName: "APAAS3" }).then((response) => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.menu_arr = response.data.data[0].Child; this.menu_arr =
(response.data.data[0] && response.data.data[0].Child) || [];
this.getMenuIndex(); this.getMenuIndex();
} }
}); });
} },
} },
}; };
</script> </script>
...@@ -415,4 +455,4 @@ export default { ...@@ -415,4 +455,4 @@ export default {
line-height: 18px; line-height: 18px;
padding: 0 7px; padding: 0 7px;
} }
</style> </style>
\ No newline at end of file
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
下一步 下一步
</el-button> </el-button>
</div> </div>
<image-detail ref="imageDetail" :image="selectedImage"></image-detail>
</app-build-step> </app-build-step>
<app-build-step <app-build-step
title="上传部署文件" title="上传部署文件"
...@@ -282,6 +283,7 @@ import appBuildStep from "@/components/app-build-steps/app-build-step"; ...@@ -282,6 +283,7 @@ import appBuildStep from "@/components/app-build-steps/app-build-step";
import apassTable from "@/components/apass-table"; import apassTable from "@/components/apass-table";
import uploadFile from "@/components/general/upload_file"; import uploadFile from "@/components/general/upload_file";
import apassDialog from "@/components/apass-dialog"; import apassDialog from "@/components/apass-dialog";
import imageDetail from "@/components/image-detail";
export default { export default {
components: { components: {
...@@ -290,6 +292,7 @@ export default { ...@@ -290,6 +292,7 @@ export default {
apassTable, apassTable,
uploadFile, uploadFile,
apassDialog, apassDialog,
imageDetail,
}, },
data: () => ({ data: () => ({
step: 0, step: 0,
...@@ -357,6 +360,7 @@ export default { ...@@ -357,6 +360,7 @@ export default {
msg: "", msg: "",
submit: null, submit: null,
}, },
selectedImage: null,
}), }),
methods: { methods: {
preStep() { preStep() {
...@@ -570,8 +574,9 @@ export default { ...@@ -570,8 +574,9 @@ export default {
return ""; return "";
} }
}, },
showDetail(item) { showImageDetail(item) {
console.log(item); this.selectedImage = item;
this.$refs.imageDetail.showDialog();
}, },
}, },
mounted() { mounted() {
...@@ -581,7 +586,7 @@ export default { ...@@ -581,7 +586,7 @@ export default {
prop: "name", prop: "name",
align: "left", align: "left",
type: "button", type: "button",
callback: this.showDetail, callback: this.showImageDetail,
}, },
{ {
label: "版本号", label: "版本号",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment