Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-ui

master
Chopper711 2022-12-07 17:01:28 +08:00
commit 235d582ae2
5 changed files with 608 additions and 494 deletions

174
buyer/package-lock.json generated
View File

@ -477,70 +477,6 @@
"webpack-merge": "^4.2.2" "webpack-merge": "^4.2.2"
}, },
"dependencies": { "dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"json5": {
"version": "2.2.1",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.3",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.3.tgz",
"integrity": "sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"postcss-loader": { "postcss-loader": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmmirror.com/postcss-loader/-/postcss-loader-3.0.0.tgz", "resolved": "https://registry.npmmirror.com/postcss-loader/-/postcss-loader-3.0.0.tgz",
@ -585,28 +521,6 @@
"ajv-errors": "^1.0.0", "ajv-errors": "^1.0.0",
"ajv-keywords": "^3.1.0" "ajv-keywords": "^3.1.0"
} }
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
} }
} }
}, },
@ -10278,6 +10192,94 @@
} }
} }
}, },
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"json5": {
"version": "2.2.1",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-piczoom": { "vue-piczoom": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmmirror.com/vue-piczoom/-/vue-piczoom-1.0.6.tgz", "resolved": "https://registry.npmmirror.com/vue-piczoom/-/vue-piczoom-1.0.6.tgz",

View File

@ -25,14 +25,25 @@
<div class="item" v-for="(item, index) in list" :key="index"> <div class="item" v-for="(item, index) in list" :key="index">
<div>{{ item.name || "暂无模板昵称" }}</div> <div>{{ item.name || "暂无模板昵称" }}</div>
<div class="item-config"> <div class="item-config">
<i-switch v-model="item.pageShow" @on-change="releaseTemplate(item.id)"> <i-switch
v-model="item.pageShow"
@on-change="releaseTemplate(item.id)"
>
<span slot="open"></span> <span slot="open"></span>
<span slot="close"></span> <span slot="close"></span>
</i-switch> </i-switch>
<Button type="info" placement="right" @click="Template(item)" size="small" <Button
type="info"
placement="right"
@click="Template(item)"
size="small"
>编辑</Button >编辑</Button
> >
<Button type="success" placement="right" @click="decorate(item)" size="small" <Button
type="success"
placement="right"
@click="decorate(item)"
size="small"
>装修</Button >装修</Button
> >
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)"> <Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)">
@ -42,7 +53,18 @@
</div> </div>
<div class="no-more" v-if="list.length == 0"></div> <div class="no-more" v-if="list.length == 0"></div>
</div> </div>
<Page show-total :total="total" show-sizer size="small" :page-size-opts="[10, 20, 50]" show-elevator style="float:right;overflow:hidden;" @on-change="changePageNum" @on-page-size-change="changePageSize" :page-size="searchForm.pageSize"/> <Page
show-total
:total="total"
show-sizer
size="small"
:page-size-opts="[10, 20, 50]"
show-elevator
style="float: right; overflow: hidden"
@on-change="changePageNum"
@on-page-size-change="changePageSize"
:page-size="searchForm.pageSize"
/>
</Card> </Card>
<Modal <Modal
v-model="showModal" v-model="showModal"
@ -72,19 +94,19 @@ export default {
return { return {
showModal: false, // modal showModal: false, // modal
selectedIndex: 0, // index selectedIndex: 0, // index
total:0, total: 0,
formData: { formData: {
// //
status: false, // status: false, //
name: "", // name: "", //
}, },
searchForm:{ searchForm: {
pageNumber:1, pageNumber: 1,
pageSize:10, pageSize: 10,
sort: 'createTime', sort: "createTime",
order: 'desc', order: "desc",
pageType:"INDEX", pageType: "INDEX",
pageClientType:"PC", pageClientType: "PC",
}, },
columns: [ columns: [
// column // column
@ -111,7 +133,7 @@ export default {
{ {
type: "SPECIAL", type: "SPECIAL",
title: "专题", title: "专题",
} },
], ],
list: [], // list: [], //
}; };
@ -128,7 +150,8 @@ export default {
data.status ? (data.pageShow = "OPEN") : (data.pageShow = "CLOSE"); data.status ? (data.pageShow = "OPEN") : (data.pageShow = "CLOSE");
delete data.status; delete data.status;
// (data.pageType = "INDEX"), (data.pageClientType = "PC"); // (data.pageType = "INDEX"), (data.pageClientType = "PC");
(data.pageType = this.searchForm.pageType), (data.pageClientType = "PC"); (data.pageType = this.searchForm.pageType),
(data.pageClientType = "PC");
if (data.id) { if (data.id) {
API_floor.updateHome(data.id, data).then((res) => { API_floor.updateHome(data.id, data).then((res) => {
this.$Message.success("编辑模板成功"); this.$Message.success("编辑模板成功");
@ -148,8 +171,8 @@ export default {
}); });
}, },
clickType(type,index){ clickType(type, index) {
this.searchForm.pageNumber = 1 this.searchForm.pageNumber = 1;
this.searchForm.pageType = type; this.searchForm.pageType = type;
this.selectedIndex = index; this.selectedIndex = index;
this.getTemplateList(); this.getTemplateList();
@ -176,13 +199,13 @@ export default {
}); });
}, },
// //
changePageNum (val) { changePageNum(val) {
this.searchForm.pageNumber = val; this.searchForm.pageNumber = val;
this.getTemplateList(); this.getTemplateList();
}, },
// //
changePageSize (val) { changePageSize(val) {
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
this.searchForm.pageSize = val; this.searchForm.pageSize = val;
this.getTemplateList(); this.getTemplateList();
@ -198,7 +221,7 @@ export default {
API_floor.getHomeList(this.searchForm).then((res) => { API_floor.getHomeList(this.searchForm).then((res) => {
if (res.success) { if (res.success) {
// this.total // this.total
this.total = res.result.total this.total = res.result.total;
this.list = res.result.records; this.list = res.result.records;
this.list.forEach((e) => { this.list.forEach((e) => {
if (e.pageShow === "OPEN") { if (e.pageShow === "OPEN") {

View File

@ -25,14 +25,25 @@
<div class="item" v-for="(item, index) in list" :key="index"> <div class="item" v-for="(item, index) in list" :key="index">
<div>{{ item.name || "暂无模板昵称" }}</div> <div>{{ item.name || "暂无模板昵称" }}</div>
<div class="item-config"> <div class="item-config">
<i-switch v-model="item.pageShow" @on-change="releaseTemplate(item.id)"> <i-switch
v-model="item.pageShow"
@on-change="releaseTemplate(item.id)"
>
<span slot="open"></span> <span slot="open"></span>
<span slot="close"></span> <span slot="close"></span>
</i-switch> </i-switch>
<Button type="info" placement="right" @click="Template(item)" size="small" <Button
type="info"
placement="right"
@click="Template(item)"
size="small"
>编辑</Button >编辑</Button
> >
<Button type="success" placement="right" @click="decorate(item)" size="small" <Button
type="success"
placement="right"
@click="decorate(item)"
size="small"
>装修</Button >装修</Button
> >
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)"> <Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)">
@ -42,7 +53,17 @@
</div> </div>
<div class="no-more" v-if="list.length == 0"></div> <div class="no-more" v-if="list.length == 0"></div>
</div> </div>
<Page show-total :total="total" show-sizer :page-size-opts="[10, 20, 50]" show-elevator style="float:right;overflow:hidden;" @on-change="changePageNum" @on-page-size-change="changePageSize" :page-size="searchForm.pageSize"/> <Page
show-total
:total="total"
show-sizer
:page-size-opts="[10, 20, 50]"
show-elevator
style="float: right; overflow: hidden"
@on-change="changePageNum"
@on-page-size-change="changePageSize"
:page-size="searchForm.pageSize"
/>
</Card> </Card>
<Modal <Modal
v-model="showModal" v-model="showModal"
@ -72,18 +93,18 @@ export default {
return { return {
showModal: false, // modal showModal: false, // modal
selectedIndex: 0, // index selectedIndex: 0, // index
total:0, total: 0,
formData: { formData: {
// //
status: false, // status: false, //
name: "", // name: "", //
}, },
searchForm:{ searchForm: {
pageNumber:1, pageNumber: 1,
pageSize:10, pageSize: 10,
sort: 'createTime', sort: "createTime",
order: 'desc', order: "desc",
pageClientType:'PC' pageClientType: "PC",
}, },
columns: [ columns: [
// column // column
@ -167,13 +188,13 @@ export default {
}); });
}, },
// //
changePageNum (val) { changePageNum(val) {
this.searchForm.pageNumber = val; this.searchForm.pageNumber = val;
this.getTemplateList(); this.getTemplateList();
}, },
// //
changePageSize (val) { changePageSize(val) {
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
this.searchForm.pageSize = val; this.searchForm.pageSize = val;
this.getTemplateList(); this.getTemplateList();
@ -189,7 +210,7 @@ export default {
API_floor.getHomeList(this.searchForm).then((res) => { API_floor.getHomeList(this.searchForm).then((res) => {
if (res.success) { if (res.success) {
// this.total // this.total
this.total = res.result.total this.total = res.result.total;
this.list = res.result.records; this.list = res.result.records;
this.list.forEach((e) => { this.list.forEach((e) => {
if (e.pageShow === "OPEN") { if (e.pageShow === "OPEN") {

View File

@ -1,385 +1,443 @@
<template> <template>
<div class="model-form"> <div class="model-form">
<div class="model-content"> <div class="model-content">
<!-- 头部广告登录信息不需要拖拽 --> <!-- 头部广告登录信息不需要拖拽 -->
<div class="top-fixed-advert" :style="{backgroundColor:topAdvert.bgColor}"> <div
<img :src="topAdvert.img" width="1200" height="80" alt=""> class="top-fixed-advert"
<div class="setup-box"> :style="{ backgroundColor: topAdvert.bgColor }"
<Button size="small" @click.stop="handleModel('topAdvert')">编辑</Button> >
</div> <!-- <img :src="topAdvert.img" width="1200" height="80" alt="" /> -->
</div> <div class="setup-box">
<div class="header-con"> <Button size="small" @click.stop="handleModel('topAdvert')"
<div></div> >编辑</Button
<ul class="detail"> >
<li>立即注册</li>
<li>请登录</li>
<li>我的订单</li>
<li>我的足迹</li>
<li><Icon size="18" type="ios-cart-outline" ></Icon>购物车</li>
<li>店铺入驻</li>
</ul>
</div>
<div class="search-con">
<img :src="require('@/assets/logo.png')" class="logo" alt="">
<div class="search">
<i-input size="large" placeholder="输入你想查找的商品">
<Button slot="append">搜索</Button>
</i-input>
</div>
</div>
<div class="nav-con">
<div class="all-categories">全部商品分类</div>
<ul class="nav-item">
<li v-for="(item,index) in navList.list" :key="index">
<a href="#">{{item.name}}</a>
</li>
</ul>
<div class="setup-box">
<Button size="small" @click.stop="handleModel('quickNav')">编辑</Button>
</div>
</div>
<!-- 装修主体 -->
<div>
<draggable class="model-form-list"
v-model="data.list"
v-bind="{group:'model', ghostClass: 'ghost'}"
@end="handleMoveEnd"
@add="handleModelAdd"
>
<template v-for="(element, index) in data.list">
<model-form-item v-if="element && element.key" :key="element.key" :element="element" :index="index" :data="data"></model-form-item>
</template>
</draggable>
</div>
</div> </div>
<Modal </div>
v-model="showModal" <div class="header-con">
title="顶部广告" <div></div>
draggable <ul class="detail">
width="800" <li>立即注册</li>
:z-index="100" <li>请登录</li>
:mask-closable="false" <li>我的订单</li>
<li>我的足迹</li>
<li><Icon size="18" type="ios-cart-outline"></Icon>购物车</li>
> <li>店铺入驻</li>
<!-- 顶部广告 --> </ul>
<div class="modal-top-advert"> </div>
<div> <div class="search-con">
<img class="show-image" width="600" height="40" :src="topAdvert.img" alt /> <img :src="require('@/assets/logo.png')" class="logo" alt="" />
</div> <div class="search">
<div class="tips"> <i-input size="large" placeholder="输入你想查找的商品">
建议尺寸<span>{{ topAdvert.size }}</span> <Button class="soubenStore" slot="append">搜本店</Button>
</div> <Button slot="append">搜索</Button>
<div> </i-input>
图片链接<span>{{ topAdvert.url }}</span><Button size="small" type="primary" @click="handleSelectLink"></Button> </div>
</div> </div>
<div> <!-- <div class="nav-con">
选择图片<Button size="small" type="primary" @click="handleSelectImg"></Button>&nbsp; <div class="all-categories">全部商品分类</div>
</div> <ul class="nav-item">
<div> <li v-for="(item, index) in navList.list" :key="index">
选择背景色<ColorPicker v-model="topAdvert.bgColor" /> <a href="#">{{ item.name }}</a>
</div> </li>
</div> </ul>
</Modal> <div class="setup-box">
<Modal <Button size="small" @click.stop="handleModel('quickNav')"
v-model="showModalNav" >编辑</Button
title="快捷导航" >
draggable </div>
width="800" </div> -->
:z-index="100" <!-- 装修主体 -->
:mask-closable="false" <div>
> <draggable
<!-- 分类tab栏 --> class="model-form-list"
<div class="modal-tab-bar"> v-model="data.list"
<Button type="primary" size='small' @click="handleAddNav"></Button> v-bind="{ group: 'model', ghostClass: 'ghost' }"
<table cellspacing="0"> @end="handleMoveEnd"
<thead> @add="handleModelAdd"
<tr> >
<th width="250">分类名称</th> <template v-for="(element, index) in data.list">
<th width="250">链接地址</th> <model-form-item
<!-- <th width="150">排序</th> --> v-if="element && element.key"
<th width="250">操作</th> :key="element.key"
</tr> :element="element"
</thead> :index="index"
<tbody> :data="data"
<tr v-for="(item, index) in navList.list" :key="index"> ></model-form-item>
<td><Input v-model="item.name" /></td> </template>
<td><Input v-model="item.url" disabled /></td> </draggable>
<!-- <td><Input v-model="item.sort"/></td> --> </div>
<td>
<Button type="primary" size="small" @click="handleSelectLink(item,index)"></Button>&nbsp;
<Button type="error" size="small" @click="handleDelNav(index)"></Button>
</td>
</tr>
</tbody>
</table>
</div>
</Modal>
<!-- 选择商品链接 -->
<liliDialog
ref="liliDialog"
@selectedLink="selectedLink"
></liliDialog>
<!-- 选择图片 -->
<Modal width="1200px" v-model="picModelFlag" footer-hide>
<ossManage @callback="callbackSelected" :isComponent="true" ref="ossManage" />
</Modal>
</div> </div>
<Modal
v-model="showModal"
title="顶部广告"
draggable
width="800"
:z-index="100"
:mask-closable="false"
>
<!-- 顶部广告 -->
<div class="modal-top-advert">
<div>
<img
class="show-image"
width="600"
height="40"
:src="topAdvert.img"
alt
/>
</div>
<div class="tips">
建议尺寸<span>{{ topAdvert.size }}</span>
</div>
<div>
图片链接<span>{{ topAdvert.url }}</span
><Button size="small" type="primary" @click="handleSelectLink"
>选择链接</Button
>
</div>
<div>
选择图片<Button size="small" type="primary" @click="handleSelectImg"
>选择图片</Button
>&nbsp;
</div>
<div>选择背景色<ColorPicker v-model="topAdvert.bgColor" /></div>
</div>
</Modal>
<Modal
v-model="showModalNav"
title="快捷导航"
draggable
width="800"
:z-index="100"
:mask-closable="false"
>
<!-- 分类tab栏 -->
<div class="modal-tab-bar">
<Button type="primary" size="small" @click="handleAddNav"
>添加分类</Button
>
<table cellspacing="0">
<thead>
<tr>
<th width="250">分类名称</th>
<th width="250">链接地址</th>
<!-- <th width="150">排序</th> -->
<th width="250">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in navList.list" :key="index">
<td><Input v-model="item.name" /></td>
<td><Input v-model="item.url" disabled /></td>
<!-- <td><Input v-model="item.sort"/></td> -->
<td>
<Button
type="primary"
size="small"
@click="handleSelectLink(item, index)"
>选择链接</Button
>&nbsp;
<Button type="error" size="small" @click="handleDelNav(index)"
>删除</Button
>
</td>
</tr>
</tbody>
</table>
</div>
</Modal>
<!-- 选择商品链接 -->
<liliDialog ref="liliDialog" @selectedLink="selectedLink"></liliDialog>
<!-- 选择图片 -->
<Modal width="1200px" v-model="picModelFlag" footer-hide>
<ossManage
@callback="callbackSelected"
:isComponent="true"
ref="ossManage"
/>
</Modal>
</div>
</template> </template>
<script> <script>
import Draggable from 'vuedraggable' import Draggable from "vuedraggable";
import ModelFormItem from './modelFormItem.vue' import ModelFormItem from "./modelFormItem.vue";
import ossManage from "@/views/sys/oss-manage/ossManage"; import ossManage from "@/views/sys/oss-manage/ossManage";
export default { export default {
name:'modelForm', name: "modelForm",
components:{ components: {
Draggable, Draggable,
ModelFormItem, ModelFormItem,
ossManage ossManage,
},
props: ["data"],
data() {
return {
picModelFlag: false, //
showModal: false, // 广
showModalNav: false, // nav
selectedNav: null, //nav
//
promotionTags: [
"买2免1",
"领200神券",
"199减100",
"母婴5折抢",
"充100送20",
], //
topAdvert: {
// 广
type: "topAdvert",
img: "",
url: "",
bgColor: "#de000d",
size: "1200*80",
},
navList: {
// nav
type: "navBar",
list: [
{ name: "秒杀", url: "" },
{ name: "闪购", url: "" },
{ name: "优惠券", url: "" },
{ name: "拍卖", url: "" },
{ name: "服装城", url: "" },
],
},
};
},
mounted() {
document.body.ondrop = function (event) {
let isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
if (isFirefox) {
event.preventDefault();
event.stopPropagation();
}
};
},
methods: {
handleSelectLink(item, index) {
//
if (item) this.selectedNav = item;
this.$refs.liliDialog.open("link");
}, },
props:['data'], //
data(){ selectedLink(val) {
return{ console.log(val);
picModelFlag: false, // if (this.showModalNav) {
showModal: false, // 广 this.selectedNav.url = this.$options.filters.formatLinkType(val);
showModalNav: false, // nav } else {
selectedNav:null, //nav this.topAdvert.url = this.$options.filters.formatLinkType(val);
// }
promotionTags: [ "买2免1", "领200神券", "199减100", "母婴5折抢", "充100送20"], //
topAdvert:{ // 广
type:'topAdvert',
img:'',
url:'',
bgColor:'#de000d',
size:'1200*80'
},
navList:{ // nav
type:'navBar',
list:[
{name:'秒杀', url:''}, {name:'闪购', url:''}, {name:'优惠券', url:''}, {name:'拍卖', url:''}, {name:'服装城', url:''},
]
}
}
}, },
mounted(){ handleDelNav(index) {
document.body.ondrop = function (event) { //
let isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1 this.navList.list.splice(index, 1);
if (isFirefox) {
event.preventDefault()
event.stopPropagation()
}
}
}, },
methods:{ handleAddNav() {
handleSelectLink(item,index) { // //
if(item) this.selectedNav = item; this.navList.list.push({ name: "", url: "" });
this.$refs.liliDialog.open('link') console.log(this.navList.list);
}, },
// //
selectedLink(val) { handleMoveEnd({ newIndex, oldIndex }) {
console.log(val); console.log("index", newIndex, oldIndex);
if(this.showModalNav){ },
this.selectedNav.url = this.$options.filters.formatLinkType(val); // 广
}else { handleModel(type) {
this.topAdvert.url = this.$options.filters.formatLinkType(val); if (type == "topAdvert") {
} this.showModal = true;
}, } else {
handleDelNav(index){ // this.showModalNav = true;
this.navList.list.splice(index,1) }
}, },
handleAddNav(){ // //
this.navList.list.push( handleSelectImg() {
{name:'',url:''} this.$refs.ossManage.selectImage = true;
) this.picModelFlag = true;
console.log(this.navList.list) },
}, callbackSelected(item) {
// //
handleMoveEnd ({newIndex, oldIndex}) { this.picModelFlag = false;
console.log('index', newIndex, oldIndex) this.topAdvert.img = item.url;
}, },
// 广 handleModelAdd(evt) {
handleModel (type) { //
if(type == 'topAdvert'){ const newIndex = evt.newIndex;
this.showModal = true;
} else {
this.showModalNav = true;
}
},
//
handleSelectImg() {
this.$refs.ossManage.selectImage = true;
this.picModelFlag = true;
},
callbackSelected (item) { //
this.picModelFlag = false;
this.topAdvert.img = item.url;
},
handleModelAdd (evt) { //
const newIndex = evt.newIndex
// key // key
this.data.list[newIndex] = JSON.parse(JSON.stringify(this.data.list[newIndex])) this.data.list[newIndex] = JSON.parse(
const key = Date.parse(new Date()) + '_' + Math.ceil(Math.random() * 99999) JSON.stringify(this.data.list[newIndex])
this.$set(this.data.list, newIndex, { );
...this.data.list[newIndex], const key =
options: { Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
...this.data.list[newIndex].options, this.$set(this.data.list, newIndex, {
}, ...this.data.list[newIndex],
key, options: {
// ...this.data.list[newIndex].options,
model: this.data.list[newIndex].type + '_' + key
})
}, },
} key,
} //
model: this.data.list[newIndex].type + "_" + key,
});
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import './modelList/setup-box.scss'; @import "./modelList/setup-box.scss";
.model-form { .model-form {
width: 1500px; width: 1500px;
} }
.model-content { .model-content {
width: 1200px; width: 1200px;
margin: 0 auto; margin: 0 auto;
background: #fff; background: #fff;
min-height: 1200px; min-height: 1200px;
} }
.model-form-list{ .model-form-list {
min-height: 500px; min-height: 500px;
} }
/** 顶部广告,头部,搜索框 start */ /** 顶部广告,头部,搜索框 start */
.top-fixed-advert{ .top-fixed-advert {
display: flex; display: flex;
width:1500px; width: 1500px;
margin-left: -150px; margin-left: -150px;
background: $theme_color; background: $theme_color;
justify-content: center; justify-content: center;
} }
.header-con { .header-con {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: 35px; height: 35px;
padding: 0 15px; padding: 0 15px;
line-height: 35px; line-height: 35px;
color: #999;
font-weight: bold;
div,
li {
&:hover {
color: $theme_color;
cursor: pointer;
}
}
.detail {
display: flex;
> li {
margin-left: 10px;
&::after {
content: "|";
padding-left: 10px;
}
&:last-child::after {
content: "";
padding-left: 0;
}
&:hover::after {
color: #999; color: #999;
font-weight: bold; }
div,li{
&:hover{
color: $theme_color;
cursor: pointer;
}
}
.detail{
display: flex;
>li{
margin-left: 10px;
&::after{
content: "|";
padding-left: 10px;
}
&:last-child::after{
content:'';
padding-left: 0;
}
&:hover::after{
color: #999;
}
}
}
} }
/** 搜索框 */ }
.search-con { }
padding-top: 15px; /** 搜索框 */
margin: 0px auto; .search-con {
margin-bottom: 10px; padding-top: 15px;
width: 1200px; margin: 0px auto;
position: relative; margin-bottom: 10px;
.logo{ width: 1200px;
position: absolute; position: relative;
top: 10px; .logo {
left: 10px; position: absolute;
width: 150px; top: 10px;
height: 50px; left: 10px;
} width: 150px;
.search { height: 50px;
width: 460px; }
margin: 0 auto; .search {
/deep/ .ivu-input.ivu-input-large { width: 460px;
border: 2px solid $theme_color; margin: 0 auto;
font-size: 12px; /deep/ .ivu-input.ivu-input-large {
height: 34px; border: 2px solid $theme_color;
&:focus { font-size: 12px;
box-shadow: none; height: 34px;
} &:focus {
} box-shadow: none;
/deep/ .ivu-input-group-append { }
border: 1px solid $theme_color;
border-left: none;
height: 30px;
background-color: $theme_color;
color: #ffffff;
button {
font-size: 14px;
font-weight: 600;
line-height: 1;
}
}
}
} }
/** 商品分类 */ /deep/ .ivu-input-group-append {
.nav-con{ border: 1px solid $theme_color;
width:1200px; border-left: none;
height: 40px; height: 30px;
background: #eee; background-color: $theme_color;
display: flex; color: #ffffff;
.all-categories{ button {
width: 200px; font-size: 14px;
line-height: 40px; font-weight: 600;
color: #fff; line-height: 1;
background-color: $theme_color; }
text-align: center;
font-size: 16px;
}
.nav-item {
width: 1000px;
height: 40px;
line-height: 40px;
overflow: hidden;
list-style: none;
background-color: #eee;
display: flex;
li{
font-size: 16px;
font-weight: bold;
margin-left: 20px;
a{
color:rgb(89, 88, 88);
font-size: 15px;
&:hover{color:$theme_color}
}
}
}
} }
/** 顶部广告,头部,搜索框 end */ .soubenStore {
font-size: 14px;
font-weight: 600;
background-color: #f90;
}
}
}
/** 商品分类 */
.nav-con {
width: 1200px;
height: 40px;
background: #eee;
display: flex;
.all-categories {
width: 200px;
line-height: 40px;
color: #fff;
background-color: $theme_color;
text-align: center;
font-size: 16px;
}
.nav-item {
width: 1000px;
height: 40px;
line-height: 40px;
overflow: hidden;
list-style: none;
background-color: #eee;
display: flex;
li {
font-size: 16px;
font-weight: bold;
margin-left: 20px;
a {
color: rgb(89, 88, 88);
font-size: 15px;
&:hover {
color: $theme_color;
}
}
}
}
}
/** 顶部广告,头部,搜索框 end */
.top-fixed-advert, .nav-con{ .top-fixed-advert,
position: relative; .nav-con {
&:hover{ position: relative;
.setup-box{ &:hover {
display: block; .setup-box {
} display: block;
}
}
/** 装修模态框 内部样式start */
.modal-top-advert{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
>*{
margin-bottom: 10px;
}
} }
}
}
/** 装修模态框 内部样式start */
.modal-top-advert {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
> * {
margin-bottom: 10px;
}
}
</style> </style>

View File

@ -3,10 +3,18 @@
<!-- 左侧模块列表 --> <!-- 左侧模块列表 -->
<div class="model-list"> <div class="model-list">
<div class="classification-title">基础模块</div> <div class="classification-title">基础模块</div>
<draggable tag="ul" :list="modelData" v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}" > <draggable
tag="ul"
:list="modelData"
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"> <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>
</li> </li>
</draggable> </draggable>
</div> </div>
@ -16,7 +24,9 @@
</div> </div>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<div class="btn-bar"> <div class="btn-bar">
<Button type="primary" :loading="submitLoading" @click="saveTemplate"></Button> <Button type="primary" :loading="submitLoading" @click="saveTemplate"
>保存模板</Button
>
<Button class="ml_10" @click="resetTemplate"></Button> <Button class="ml_10" @click="resetTemplate"></Button>
</div> </div>
</div> </div>
@ -44,21 +54,21 @@ export default {
methods: { methods: {
saveTemplate() { saveTemplate() {
// //
this.submitTemplate(this.$route.query.pageShow ? 'OPEN' : 'CLOSE') this.submitTemplate(this.$route.query.pageShow ? "OPEN" : "CLOSE");
}, },
// //
submitTemplate(pageShow) { submitTemplate(pageShow) {
this.submitLoading = true this.submitLoading = true;
const modelForm = JSON.parse(JSON.stringify(this.modelForm)) const modelForm = JSON.parse(JSON.stringify(this.modelForm));
modelForm.list.unshift(this.$refs.modelForm.navList); modelForm.list.unshift(this.$refs.modelForm.navList);
modelForm.list.unshift(this.$refs.modelForm.topAdvert); modelForm.list.unshift(this.$refs.modelForm.topAdvert);
const data = { const data = {
id: this.$route.query.id, id: this.$route.query.id,
pageData: JSON.stringify(modelForm), pageData: JSON.stringify(modelForm),
pageShow pageShow,
}; };
API_floor.updateHome(this.$route.query.id, data).then((res) => { API_floor.updateHome(this.$route.query.id, data).then((res) => {
this.submitLoading = false this.submitLoading = false;
if (res.success) { if (res.success) {
this.$Message.success("保存模板成功"); this.$Message.success("保存模板成功");
} }