修改商家端商品发布样式问题,修改楼层装修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) => {
return getRequest('/goods/brand/getByPage', params)
}
// 添加或修改品牌设置
// 添加
export const addBrand = (params) => {
return postRequest('/goods/brand', params)
}
// 修改品牌设置
export const updateBrand = (params) => {
return putRequest(`/goods/brand/${params.id}`, params)
}
// 禁用品牌
export const disableBrand = (id, params) => {
return putRequest(`/goods/brand/disable/${id}`, params)

View File

@ -82,7 +82,7 @@
</template>
<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";
export default {
@ -323,7 +323,7 @@
});
} else {
//
addBrand(this.form).then((res) => {
updateBrand(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");

View File

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

View File

@ -1,172 +1,182 @@
<template>
<div class="renovation">
<!-- 左侧模块列表 -->
<div class="model-list">
<div class="classification-title">基础模块</div>
<draggable tag="ul" :list="modelData"
v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}"
@end="handleMoveEnd"
@start="handleMoveStart"
:move="handleMove"
>
<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 class="renovation">
<!-- 左侧模块列表 -->
<div class="model-list">
<div class="classification-title">基础模块</div>
<draggable tag="ul" :list="modelData" v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}" @end="handleMoveEnd" @start="handleMoveStart" :move="handleMove">
<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>
</template>
<script>
import { modelData } from './modelConfig';
import { modelData } from "./modelConfig";
import Draggable from "vuedraggable";
import ModelForm from './modelForm.vue';
import * as API_floor from '@/api/other.js';
import ModelForm from "./modelForm.vue";
import * as API_floor from "@/api/other.js";
export default {
components:{
Draggable, ModelForm
},
mounted(){
this.getTemplateItem(this.$route.query.id)
},
data() {
return {
modelData, //
modelForm:{list:[]} //
}
},
methods:{
saveTemplate(){ //
this.modelForm.list.unshift(this.$refs.modelForm.navList)
this.modelForm.list.unshift(this.$refs.modelForm.topAdvert)
const modelForm = JSON.stringify(this.modelForm)
const data = {
id:this.$route.query.id,
pageData:modelForm,
}
API_floor.updateHome(this.$route.query.id, data).then(res=> {
if(res.success) {
this.$Message.success('保存模板成功');
} else {
this.$Message.error(res.message)
}
})
components: {
Draggable,
ModelForm,
},
mounted() {
this.getTemplateItem(this.$route.query.id);
},
data() {
return {
modelData, //
modelForm: { list: [] }, //
};
},
methods: {
saveTemplate() {
//
this.$Modal.confirm({
title: "是否立即发布?",
onOk: () => {
this.submitTemplate("OPEN");
},
resetTemplate(){ //
this.getTemplateItem(this.$route.query.id)
onCancel: () => {
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: {
deep: true,
handler: function (val) {
console.log(val)
//
submitTemplate(pageShow) {
this.modelForm.list.unshift(this.$refs.modelForm.navList);
this.modelForm.list.unshift(this.$refs.modelForm.topAdvert);
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>
<style lang="scss" scoped>
.renovation{
position: relative;
display: flex;
.renovation {
position: relative;
display: flex;
}
.model-list{
width: 120px;
height:auto;
padding: 10px;
background: #fff;
margin-top: 60px;
position: fixed;
z-index: 100;
box-shadow: 1px 1px 10px #999;
.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;
.model-list {
width: 120px;
height: auto;
padding: 10px;
background: #fff;
margin-top: 60px;
position: fixed;
z-index: 100;
box-shadow: 1px 1px 10px #999;
.classification-title {
width: 100%;
background:#fff;
height: 50px;
padding: 10px;
box-shadow: 1px 1px 10px #999;
z-index: 99;
top: 100px;
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: "";
}
}
</style>
.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%;
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)"
>编辑</Button
>
&nbsp;
<Button
type="info"
size="small"
@ -79,7 +79,7 @@
@click="manage(row)"
>查看</Button
>
&nbsp;
<Button
type="primary"
size="small"
@ -88,7 +88,7 @@
@click="manage(row)"
>管理</Button
>
&nbsp;
<!-- <Button type="success" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW' || row.promotionStatus == 'END'" @click="upper(row)"></Button> -->
<Button
type="error"
@ -100,7 +100,7 @@
@click="off(row)"
>下架</Button
>
&nbsp;
<Button
type="error"
size="small"
@ -311,4 +311,7 @@ export default {
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
.mr_5{
margin: 0 4px;
}
</style>

View File

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

View File

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