修改商家端商品发布样式问题,修改楼层装修pc端出现的问题,修改品牌中出现的bug

master
lemon橪 2021-06-17 11:40:27 +08:00
parent 7711e5ca7b
commit 0cbcb4d37a
7 changed files with 189 additions and 166 deletions

View File

@ -5,10 +5,14 @@ import { getRequest, postRequest, putRequest, deleteRequest} from '@/libs/axios'
export const getManagerBrandPage = (params) => { export const getManagerBrandPage = (params) => {
return getRequest('/goods/brand/getByPage', params) return getRequest('/goods/brand/getByPage', params)
} }
// 添加或修改品牌设置 // 添加
export const addBrand = (params) => { export const addBrand = (params) => {
return postRequest('/goods/brand', params) return postRequest('/goods/brand', params)
} }
// 修改品牌设置
export const updateBrand = (params) => {
return putRequest(`/goods/brand/${params.id}`, params)
}
// 禁用品牌 // 禁用品牌
export const disableBrand = (id, params) => { export const disableBrand = (id, params) => {
return putRequest(`/goods/brand/disable/${id}`, params) return putRequest(`/goods/brand/disable/${id}`, params)

View File

@ -82,7 +82,7 @@
</template> </template>
<script> <script>
import {getManagerBrandPage, addBrand, disableBrand} from "@/api/goods"; import {getManagerBrandPage, addBrand,updateBrand, disableBrand} from "@/api/goods";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input"; import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
export default { export default {
@ -323,7 +323,7 @@
}); });
} else { } else {
// //
addBrand(this.form).then((res) => { updateBrand(this.form).then((res) => {
this.submitLoading = false; this.submitLoading = false;
if (res.success) { if (res.success) {
this.$Message.success("操作成功"); this.$Message.success("操作成功");

View File

@ -376,6 +376,7 @@ export default {
}); });
}, },
getAllList(parent_id) { getAllList(parent_id) {
this.sortCateList = []
this.loading = true; this.loading = true;
getCategoryTree(parent_id).then((res) => { getCategoryTree(parent_id).then((res) => {
this.loading = false; this.loading = false;

View File

@ -1,172 +1,182 @@
<template> <template>
<div class="renovation"> <div class="renovation">
<!-- 左侧模块列表 --> <!-- 左侧模块列表 -->
<div class="model-list"> <div class="model-list">
<div class="classification-title">基础模块</div> <div class="classification-title">基础模块</div>
<draggable tag="ul" :list="modelData" <draggable tag="ul" :list="modelData" v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}" @end="handleMoveEnd" @start="handleMoveStart" :move="handleMove">
v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}" <li v-for="(model, index) in modelData" :key="index" class="model-item">
@end="handleMoveEnd" <Icon :type="model.icon" />
@start="handleMoveStart" <span>{{model.name}}</span>
:move="handleMove" </li>
> </draggable>
<li v-for="(model, index) in modelData" :key="index" class="model-item">
<Icon :type="model.icon" />
<span>{{model.name}}</span>
</li>
</draggable>
</div>
<!-- 中间展示模块 -->
<div class="show-content">
<model-form ref="modelForm" :data="modelForm"></model-form>
</div>
<!-- 保存按钮 -->
<div class="btn-bar"><Button type="primary" @click="saveTemplate"></Button> <Button @click="resetTemplate"></Button></div>
</div> </div>
<!-- 中间展示模块 -->
<div class="show-content">
<model-form ref="modelForm" :data="modelForm"></model-form>
</div>
<!-- 保存按钮 -->
<div class="btn-bar"><Button type="primary" @click="saveTemplate"></Button> <Button @click="resetTemplate"></Button></div>
</div>
</template> </template>
<script> <script>
import { modelData } from './modelConfig'; import { modelData } from "./modelConfig";
import Draggable from "vuedraggable"; import Draggable from "vuedraggable";
import ModelForm from './modelForm.vue'; import ModelForm from "./modelForm.vue";
import * as API_floor from '@/api/other.js'; import * as API_floor from "@/api/other.js";
export default { export default {
components:{ components: {
Draggable, ModelForm Draggable,
}, ModelForm,
mounted(){ },
this.getTemplateItem(this.$route.query.id) mounted() {
}, this.getTemplateItem(this.$route.query.id);
data() { },
return { data() {
modelData, // return {
modelForm:{list:[]} // modelData, //
} modelForm: { list: [] }, //
}, };
methods:{ },
saveTemplate(){ // methods: {
this.modelForm.list.unshift(this.$refs.modelForm.navList) saveTemplate() {
this.modelForm.list.unshift(this.$refs.modelForm.topAdvert) //
const modelForm = JSON.stringify(this.modelForm) this.$Modal.confirm({
const data = { title: "是否立即发布?",
id:this.$route.query.id, onOk: () => {
pageData:modelForm, this.submitTemplate("OPEN");
}
API_floor.updateHome(this.$route.query.id, data).then(res=> {
if(res.success) {
this.$Message.success('保存模板成功');
} else {
this.$Message.error(res.message)
}
})
}, },
resetTemplate(){ // onCancel: () => {
this.getTemplateItem(this.$route.query.id) this.submitTemplate("CLOSE");
}, },
getTemplateItem(id){ // });
API_floor.getHomeData(id).then(res => {
if (res.success) {
let pageData = res.result.pageData;
if(pageData) {
pageData = JSON.parse(pageData);
if (pageData.list[0].type === 'topAdvert') { // topAdvert 广 navList
this.$refs.modelForm.topAdvert = pageData.list[0];
this.$refs.modelForm.navList = pageData.list[1];
pageData.list.splice(0,2)
this.modelForm = pageData;
} else {
this.modelForm = {list:[]}
}
} else {
this.modelForm = {list:[]}
}
}
// this.$refs.modelForm.topAdvert = {};
// this.$refs.modelForm.navList = {}
})
}
}, },
watch: { //
modelForm: { submitTemplate(pageShow) {
deep: true, this.modelForm.list.unshift(this.$refs.modelForm.navList);
handler: function (val) { this.modelForm.list.unshift(this.$refs.modelForm.topAdvert);
console.log(val) const modelForm = JSON.stringify(this.modelForm);
const data = {
id: this.$route.query.id,
pageData: modelForm,
pageShow,
};
API_floor.updateHome(this.$route.query.id, data).then((res) => {
if (res.success) {
this.$Message.success("保存模板成功");
} else {
this.$Message.error(res.message);
}
});
},
resetTemplate() {
//
this.getTemplateItem(this.$route.query.id);
},
getTemplateItem(id) {
//
API_floor.getHomeData(id).then((res) => {
if (res.success) {
let pageData = res.result.pageData;
if (pageData) {
pageData = JSON.parse(pageData);
if (pageData.list[0].type === "topAdvert") {
// topAdvert 广 navList
this.$refs.modelForm.topAdvert = pageData.list[0];
this.$refs.modelForm.navList = pageData.list[1];
pageData.list.splice(0, 2);
this.modelForm = pageData;
} else {
this.modelForm = { list: [] };
} }
} } else {
} this.modelForm = { list: [] };
} }
}
// this.$refs.modelForm.topAdvert = {};
// this.$refs.modelForm.navList = {}
});
},
},
watch: {
modelForm: {
deep: true,
handler: function (val) {
console.log(val);
},
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.renovation{ .renovation {
position: relative; position: relative;
display: flex; display: flex;
} }
.model-list{ .model-list {
width: 120px; width: 120px;
height:auto; height: auto;
padding: 10px; padding: 10px;
background: #fff; background: #fff;
margin-top: 60px; margin-top: 60px;
position: fixed; position: fixed;
z-index: 100; z-index: 100;
box-shadow: 1px 1px 10px #999; box-shadow: 1px 1px 10px #999;
.classification-title{ .classification-title {
width: 100%;
height: 30px;
line-height: 30px;
}
.model-item{
width: 100px;
height: 30px;
background: #eee;
margin-top: 10px;
line-height: 30px;
text-align: center;
color: #999;
&:hover{
border: 1px dashed #409EFF;
color: #409EFF;
cursor: move;
}
}
.ghost::after{
border:none;
height: 0;
content: '';
}
}
.show-content{
margin-left: 150px;
margin-top: 60px;
}
.ghost{
background: #fff;
height: 30px;
position: relative;
&::after{
content: '松开鼠标添加模块';
position: absolute;
background: #fff;
border: 1px dashed #409EFF;
color: #409EFF;
top: 0;
left: 0;
width: 100%;
height: 50px;
text-align: center;
line-height: 50px;
}
}
.btn-bar{
position: fixed;
width: 100%; width: 100%;
background:#fff; height: 30px;
height: 50px; line-height: 30px;
padding: 10px; }
box-shadow: 1px 1px 10px #999; .model-item {
z-index: 99; width: 100px;
top: 100px; height: 30px;
background: #eee;
margin-top: 10px;
line-height: 30px;
text-align: center;
color: #999;
&:hover {
border: 1px dashed #409eff;
color: #409eff;
cursor: move;
}
}
.ghost::after {
border: none;
height: 0;
content: "";
}
} }
.show-content {
</style> margin-left: 150px;
margin-top: 60px;
}
.ghost {
background: #fff;
height: 30px;
position: relative;
&::after {
content: "松开鼠标添加模块";
position: absolute;
background: #fff;
border: 1px dashed #409eff;
color: #409eff;
top: 0;
left: 0;
width: 100%;
height: 50px;
text-align: center;
line-height: 50px;
}
}
.btn-bar {
position: fixed;
width: 100%;
background: #fff;
height: 50px;
padding: 10px;
box-shadow: 1px 1px 10px #999;
z-index: 99;
top: 100px;
}
</style>

View File

@ -70,7 +70,7 @@
@click="edit(row)" @click="edit(row)"
>编辑</Button >编辑</Button
> >
&nbsp;
<Button <Button
type="info" type="info"
size="small" size="small"
@ -79,7 +79,7 @@
@click="manage(row)" @click="manage(row)"
>查看</Button >查看</Button
> >
&nbsp;
<Button <Button
type="primary" type="primary"
size="small" size="small"
@ -88,7 +88,7 @@
@click="manage(row)" @click="manage(row)"
>管理</Button >管理</Button
> >
&nbsp;
<!-- <Button type="success" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW' || row.promotionStatus == 'END'" @click="upper(row)"></Button> --> <!-- <Button type="success" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW' || row.promotionStatus == 'END'" @click="upper(row)"></Button> -->
<Button <Button
type="error" type="error"
@ -100,7 +100,7 @@
@click="off(row)" @click="off(row)"
>下架</Button >下架</Button
> >
&nbsp;
<Button <Button
type="error" type="error"
size="small" size="small"
@ -311,4 +311,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "@/styles/table-common.scss"; @import "@/styles/table-common.scss";
.mr_5{
margin: 0 4px;
}
</style> </style>

View File

@ -385,3 +385,9 @@ div.base-info-item {
font-size: 20px; font-size: 20px;
cursor: pointer; cursor: pointer;
} }
.tree-bar{
height: auto !important;
max-height: auto !important;
min-height: 240px !important;
}

View File

@ -485,7 +485,7 @@
</div> </div>
<h4>商品详情描述</h4> <h4>商品详情描述</h4>
<div class="form-item-view"> <div class="form-item-view">
<div class="tree-bar" :style="{ maxHeight: maxHeight }"> <div class="tree-bar" >
<FormItem <FormItem
class="form-item-view-el" class="form-item-view-el"
label="店内分类" label="店内分类"
@ -815,7 +815,6 @@ export default {
/** 3级分类列表*/ /** 3级分类列表*/
categoryListLevel3: [], categoryListLevel3: [],
maxHeight: "240px",
/** 请求的商品参数组列表 */ /** 请求的商品参数组列表 */
goodsParams: [ goodsParams: [
{ {