Commit 39ed4a8e by 姜鹏凯

商品中心优化&&路由调整

1 parent 7d33ff72
...@@ -465,7 +465,12 @@ ...@@ -465,7 +465,12 @@
--> -->
<slot> <slot>
<template v-if="multiple">
<i v-if="limit !== fileListWatch.length" class="el-icon-plus uploader-icon upload-action"></i>
</template>
<template v-else>
<i v-if="!loading && !fileUrlWatch" class="el-icon-plus uploader-icon upload-action"></i> <i v-if="!loading && !fileUrlWatch" class="el-icon-plus uploader-icon upload-action"></i>
</template>
<transition> <transition>
<!-- 上传精度条 --> <!-- 上传精度条 -->
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
</template> </template>
<script> <script>
import { constantRoutes } from '@/router' import { constantRoutes } from '@/router'
import { isExternal } from '@/utils/validate' import { isExternal } from '@/utils/validate'
export default { export default {
data() { data() {
return { return {
name: '', name: '',
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
// 是否为首次加载 // 是否为首次加载
isFrist: false, isFrist: false,
// 当前激活菜单的 // 当前激活菜单的
currentIndex: '', currentIndex: ''
} }
}, },
computed: { computed: {
...@@ -95,7 +95,7 @@ export default { ...@@ -95,7 +95,7 @@ export default {
activePath = path activePath = path
} }
return activePath return activePath
}, }
}, },
beforeMount() { beforeMount() {
window.addEventListener('resize', this.setVisibleNumber) window.addEventListener('resize', this.setVisibleNumber)
...@@ -155,16 +155,16 @@ export default { ...@@ -155,16 +155,16 @@ export default {
// } else { // } else {
// } // }
this.activeRoutes(path) this.activeRoutes(path)
// let obj = this.topMenus[index] let obj = this.topMenus[index]
// let path = this.topMenus[index].children[0].path // let path = this.topMenus[index].children[0].path
// console.log(this.topMenus[index].children[0]) // console.log(this.topMenus[index].children[0])
// let path = '' let path = ''
// if (obj.children && obj.children.length) { if (obj.children && obj.children.length) {
// path = path + obj.children[0].path path = path + obj.children[0].path
// } }
// if (obj.children[0].children && obj.children[0].children.length) { if (obj.children[0].children && obj.children[0].children.length) {
// path = path + '/' + obj.children[0].children[0].path path = path + '/' + obj.children[0].children[0].path
// } }
if (!isExternal(path)) { if (!isExternal(path)) {
this.$router.push({ path }) this.$router.push({ path })
} }
...@@ -187,43 +187,43 @@ export default { ...@@ -187,43 +187,43 @@ export default {
}, },
ishttp(url) { ishttp(url) {
return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1 return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
}, }
}, }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.el-menu { .el-menu {
background-color: transparent !important; background-color: transparent !important;
} }
.el-menu.el-menu--horizontal { .el-menu.el-menu--horizontal {
border: none !important; border: none !important;
} }
.el-menu--horizontal > .el-menu-item { .el-menu--horizontal > .el-menu-item {
float: left; float: left;
height: 50px !important; height: 50px !important;
line-height: 50px !important; line-height: 50px !important;
color: #fff !important; color: #fff !important;
// padding: 0 5px !important; // padding: 0 5px !important;
margin: 0 10px !important; margin: 0 10px !important;
} }
.el-menu-item:hover { .el-menu-item:hover {
background-color: transparent !important; background-color: transparent !important;
} }
.el-menu--horizontal > .el-menu-item.is-active, .el-menu--horizontal > .el-menu-item.is-active,
.el-menu--horizontal > .el-submenu.is-active .el-submenu__title { .el-menu--horizontal > .el-submenu.is-active .el-submenu__title {
border-bottom: 2px solid #fff !important; border-bottom: 2px solid #fff !important;
// color: #303133; // color: #303133;
} }
/* submenu item */ /* submenu item */
.el-menu--horizontal > .el-submenu .el-submenu__title { .el-menu--horizontal > .el-submenu .el-submenu__title {
float: left; float: left;
height: 50px !important; height: 50px !important;
line-height: 50px !important; line-height: 50px !important;
color: #999093 !important; color: #999093 !important;
padding: 0 5px !important; padding: 0 5px !important;
margin: 0 10px !important; margin: 0 10px !important;
} }
</style> </style>
...@@ -73,10 +73,12 @@ ...@@ -73,10 +73,12 @@
if (data) { if (data) {
api.getDetail(data.id).then((res) => { api.getDetail(data.id).then((res) => {
this.form = res.data this.form = res.data
if (this.form.attachments) {
let arr = this.form.attachments.split(',') let arr = this.form.attachments.split(',')
arr.forEach((dd) => { arr.forEach((dd) => {
this.fileList.push({ url: dd }) this.fileList.push({ url: dd })
}) })
}
}) })
} else { } else {
this.form = JSON.parse(JSON.stringify(defaultForm)) this.form = JSON.parse(JSON.stringify(defaultForm))
...@@ -237,10 +239,12 @@ ...@@ -237,10 +239,12 @@
<PhoneTemplate> <PhoneTemplate>
<div class="phone-content"> <div class="phone-content">
<el-image <el-image
v-if="form.picture"
class="commodity-img commodity-thumb" class="commodity-img commodity-thumb"
style="width: 100%; height: 100px;" style="width: 100%;"
:src="form.picture" :src="form.picture"
></el-image> ></el-image>
<div v-else class="commodity-img commodity-thumb"></div>
<div class="price">¥{{ form.price }}</div> <div class="price">¥{{ form.price }}</div>
<div class="content">{{ form.describe }}</div> <div class="content">{{ form.describe }}</div>
<el-image v-for="(item, index) in fileList" class="commodity-img" :src="item.url" :key="index"></el-image> <el-image v-for="(item, index) in fileList" class="commodity-img" :src="item.url" :key="index"></el-image>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!