修改商家端商品发布样式问题,修改楼层装修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

@ -3,12 +3,7 @@
<!-- 左侧模块列表 --> <!-- 左侧模块列表 -->
<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'}"
@end="handleMoveEnd"
@start="handleMoveStart"
:move="handleMove"
>
<li v-for="(model, index) in modelData" :key="index" class="model-item"> <li v-for="(model, index) in modelData" :key="index" class="model-item">
<Icon :type="model.icon" /> <Icon :type="model.icon" />
<span>{{model.name}}</span> <span>{{model.name}}</span>
@ -24,78 +19,94 @@
</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() { mounted() {
this.getTemplateItem(this.$route.query.id) this.getTemplateItem(this.$route.query.id);
}, },
data() { data() {
return { return {
modelData, // modelData, //
modelForm:{list:[]} // modelForm: { list: [] }, //
} };
}, },
methods: { methods: {
saveTemplate(){ // saveTemplate() {
this.modelForm.list.unshift(this.$refs.modelForm.navList) //
this.modelForm.list.unshift(this.$refs.modelForm.topAdvert) this.$Modal.confirm({
const modelForm = JSON.stringify(this.modelForm) title: "是否立即发布?",
onOk: () => {
this.submitTemplate("OPEN");
},
onCancel: () => {
this.submitTemplate("CLOSE");
},
});
},
//
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 = { const data = {
id: this.$route.query.id, id: this.$route.query.id,
pageData: modelForm, pageData: modelForm,
} pageShow,
API_floor.updateHome(this.$route.query.id, data).then(res=> { };
API_floor.updateHome(this.$route.query.id, data).then((res) => {
if (res.success) { if (res.success) {
this.$Message.success('保存模板成功'); this.$Message.success("保存模板成功");
} else { } else {
this.$Message.error(res.message) this.$Message.error(res.message);
} }
}) });
}, },
resetTemplate(){ // resetTemplate() {
this.getTemplateItem(this.$route.query.id) //
this.getTemplateItem(this.$route.query.id);
}, },
getTemplateItem(id){ // getTemplateItem(id) {
API_floor.getHomeData(id).then(res => { //
API_floor.getHomeData(id).then((res) => {
if (res.success) { if (res.success) {
let pageData = res.result.pageData; let pageData = res.result.pageData;
if (pageData) { if (pageData) {
pageData = JSON.parse(pageData); pageData = JSON.parse(pageData);
if (pageData.list[0].type === 'topAdvert') { // topAdvert 广 navList if (pageData.list[0].type === "topAdvert") {
// topAdvert 广 navList
this.$refs.modelForm.topAdvert = pageData.list[0]; this.$refs.modelForm.topAdvert = pageData.list[0];
this.$refs.modelForm.navList = pageData.list[1]; this.$refs.modelForm.navList = pageData.list[1];
pageData.list.splice(0,2) pageData.list.splice(0, 2);
this.modelForm = pageData; this.modelForm = pageData;
} else { } else {
this.modelForm = {list:[]} this.modelForm = { list: [] };
} }
} else { } else {
this.modelForm = {list:[]} this.modelForm = { list: [] };
} }
} }
// this.$refs.modelForm.topAdvert = {}; // this.$refs.modelForm.topAdvert = {};
// this.$refs.modelForm.navList = {} // this.$refs.modelForm.navList = {}
}) });
} },
}, },
watch: { watch: {
modelForm: { modelForm: {
deep: true, deep: true,
handler: function (val) { handler: function (val) {
console.log(val) console.log(val);
} },
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.renovation { .renovation {
@ -125,15 +136,15 @@ export default {
text-align: center; text-align: center;
color: #999; color: #999;
&:hover { &:hover {
border: 1px dashed #409EFF; border: 1px dashed #409eff;
color: #409EFF; color: #409eff;
cursor: move; cursor: move;
} }
} }
.ghost::after { .ghost::after {
border: none; border: none;
height: 0; height: 0;
content: ''; content: "";
} }
} }
.show-content { .show-content {
@ -145,11 +156,11 @@ export default {
height: 30px; height: 30px;
position: relative; position: relative;
&::after { &::after {
content: '松开鼠标添加模块'; content: "松开鼠标添加模块";
position: absolute; position: absolute;
background: #fff; background: #fff;
border: 1px dashed #409EFF; border: 1px dashed #409eff;
color: #409EFF; color: #409eff;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
@ -168,5 +179,4 @@ export default {
z-index: 99; z-index: 99;
top: 100px; top: 100px;
} }
</style> </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: [
{ {