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();
@ -177,12 +200,12 @@ 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
@ -168,12 +189,12 @@ 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

@ -2,10 +2,15 @@
<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"
:style="{ backgroundColor: topAdvert.bgColor }"
>
<!-- <img :src="topAdvert.img" width="1200" height="80" alt="" /> -->
<div class="setup-box"> <div class="setup-box">
<Button size="small" @click.stop="handleModel('topAdvert')">编辑</Button> <Button size="small" @click.stop="handleModel('topAdvert')"
>编辑</Button
>
</div> </div>
</div> </div>
<div class="header-con"> <div class="header-con">
@ -15,39 +20,49 @@
<li>请登录</li> <li>请登录</li>
<li>我的订单</li> <li>我的订单</li>
<li>我的足迹</li> <li>我的足迹</li>
<li><Icon size="18" type="ios-cart-outline" ></Icon>购物车</li> <li><Icon size="18" type="ios-cart-outline"></Icon>购物车</li>
<li>店铺入驻</li> <li>店铺入驻</li>
</ul> </ul>
</div> </div>
<div class="search-con"> <div class="search-con">
<img :src="require('@/assets/logo.png')" class="logo" alt=""> <img :src="require('@/assets/logo.png')" class="logo" alt="" />
<div class="search"> <div class="search">
<i-input size="large" placeholder="输入你想查找的商品"> <i-input size="large" placeholder="输入你想查找的商品">
<Button class="soubenStore" slot="append">搜本店</Button>
<Button slot="append">搜索</Button> <Button slot="append">搜索</Button>
</i-input> </i-input>
</div> </div>
</div> </div>
<div class="nav-con"> <!-- <div class="nav-con">
<div class="all-categories">全部商品分类</div> <div class="all-categories">全部商品分类</div>
<ul class="nav-item"> <ul class="nav-item">
<li v-for="(item,index) in navList.list" :key="index"> <li v-for="(item, index) in navList.list" :key="index">
<a href="#">{{item.name}}</a> <a href="#">{{ item.name }}</a>
</li> </li>
</ul> </ul>
<div class="setup-box"> <div class="setup-box">
<Button size="small" @click.stop="handleModel('quickNav')">编辑</Button> <Button size="small" @click.stop="handleModel('quickNav')"
</div> >编辑</Button
>
</div> </div>
</div> -->
<!-- 装修主体 --> <!-- 装修主体 -->
<div> <div>
<draggable class="model-form-list" <draggable
class="model-form-list"
v-model="data.list" v-model="data.list"
v-bind="{group:'model', ghostClass: 'ghost'}" v-bind="{ group: 'model', ghostClass: 'ghost' }"
@end="handleMoveEnd" @end="handleMoveEnd"
@add="handleModelAdd" @add="handleModelAdd"
> >
<template v-for="(element, index) in data.list"> <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> <model-form-item
v-if="element && element.key"
:key="element.key"
:element="element"
:index="index"
:data="data"
></model-form-item>
</template> </template>
</draggable> </draggable>
</div> </div>
@ -59,26 +74,33 @@
width="800" width="800"
:z-index="100" :z-index="100"
:mask-closable="false" :mask-closable="false"
> >
<!-- 顶部广告 --> <!-- 顶部广告 -->
<div class="modal-top-advert"> <div class="modal-top-advert">
<div> <div>
<img class="show-image" width="600" height="40" :src="topAdvert.img" alt /> <img
class="show-image"
width="600"
height="40"
:src="topAdvert.img"
alt
/>
</div> </div>
<div class="tips"> <div class="tips">
建议尺寸<span>{{ topAdvert.size }}</span> 建议尺寸<span>{{ topAdvert.size }}</span>
</div> </div>
<div> <div>
图片链接<span>{{ topAdvert.url }}</span><Button size="small" type="primary" @click="handleSelectLink"></Button> 图片链接<span>{{ topAdvert.url }}</span
><Button size="small" type="primary" @click="handleSelectLink"
>选择链接</Button
>
</div> </div>
<div> <div>
选择图片<Button size="small" type="primary" @click="handleSelectImg"></Button>&nbsp; 选择图片<Button size="small" type="primary" @click="handleSelectImg"
</div> >选择图片</Button
<div> >&nbsp;
选择背景色<ColorPicker v-model="topAdvert.bgColor" />
</div> </div>
<div>选择背景色<ColorPicker v-model="topAdvert.bgColor" /></div>
</div> </div>
</Modal> </Modal>
<Modal <Modal
@ -91,7 +113,9 @@
> >
<!-- 分类tab栏 --> <!-- 分类tab栏 -->
<div class="modal-tab-bar"> <div class="modal-tab-bar">
<Button type="primary" size='small' @click="handleAddNav"></Button> <Button type="primary" size="small" @click="handleAddNav"
>添加分类</Button
>
<table cellspacing="0"> <table cellspacing="0">
<thead> <thead>
<tr> <tr>
@ -107,8 +131,15 @@
<td><Input v-model="item.url" disabled /></td> <td><Input v-model="item.url" disabled /></td>
<!-- <td><Input v-model="item.sort"/></td> --> <!-- <td><Input v-model="item.sort"/></td> -->
<td> <td>
<Button type="primary" size="small" @click="handleSelectLink(item,index)"></Button>&nbsp; <Button
<Button type="error" size="small" @click="handleDelNav(index)"></Button> type="primary"
size="small"
@click="handleSelectLink(item, index)"
>选择链接</Button
>&nbsp;
<Button type="error" size="small" @click="handleDelNav(index)"
>删除</Button
>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -116,91 +147,104 @@
</div> </div>
</Modal> </Modal>
<!-- 选择商品链接 --> <!-- 选择商品链接 -->
<liliDialog <liliDialog ref="liliDialog" @selectedLink="selectedLink"></liliDialog>
ref="liliDialog"
@selectedLink="selectedLink"
></liliDialog>
<!-- 选择图片 --> <!-- 选择图片 -->
<Modal width="1200px" v-model="picModelFlag" footer-hide> <Modal width="1200px" v-model="picModelFlag" footer-hide>
<ossManage @callback="callbackSelected" :isComponent="true" ref="ossManage" /> <ossManage
@callback="callbackSelected"
:isComponent="true"
ref="ossManage"
/>
</Modal> </Modal>
</div> </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'], props: ["data"],
data(){ data() {
return{ return {
picModelFlag: false, // picModelFlag: false, //
showModal: false, // 广 showModal: false, // 广
showModalNav: false, // nav showModalNav: false, // nav
selectedNav:null, //nav selectedNav: null, //nav
// //
promotionTags: [ "买2免1", "领200神券", "199减100", "母婴5折抢", "充100送20"], // promotionTags: [
topAdvert:{ // 广 "买2免1",
type:'topAdvert', "领200神券",
img:'', "199减100",
url:'', "母婴5折抢",
bgColor:'#de000d', "充100送20",
size:'1200*80' ], //
topAdvert: {
// 广
type: "topAdvert",
img: "",
url: "",
bgColor: "#de000d",
size: "1200*80",
}, },
navList:{ // nav navList: {
type:'navBar', // nav
list:[ type: "navBar",
{name:'秒杀', url:''}, {name:'闪购', url:''}, {name:'优惠券', url:''}, {name:'拍卖', url:''}, {name:'服装城', url:''}, list: [
] { name: "秒杀", url: "" },
} { name: "闪购", url: "" },
} { name: "优惠券", url: "" },
{ name: "拍卖", url: "" },
{ name: "服装城", url: "" },
],
}, },
mounted(){ };
},
mounted() {
document.body.ondrop = function (event) { document.body.ondrop = function (event) {
let isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1 let isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
if (isFirefox) { if (isFirefox) {
event.preventDefault() event.preventDefault();
event.stopPropagation() event.stopPropagation();
}
} }
};
}, },
methods:{ methods: {
handleSelectLink(item,index) { // handleSelectLink(item, index) {
if(item) this.selectedNav = item; //
this.$refs.liliDialog.open('link') if (item) this.selectedNav = item;
this.$refs.liliDialog.open("link");
}, },
// //
selectedLink(val) { selectedLink(val) {
console.log(val); console.log(val);
if(this.showModalNav){ if (this.showModalNav) {
this.selectedNav.url = this.$options.filters.formatLinkType(val); this.selectedNav.url = this.$options.filters.formatLinkType(val);
}else { } else {
this.topAdvert.url = this.$options.filters.formatLinkType(val); this.topAdvert.url = this.$options.filters.formatLinkType(val);
} }
}, },
handleDelNav(index){ // handleDelNav(index) {
this.navList.list.splice(index,1) //
this.navList.list.splice(index, 1);
}, },
handleAddNav(){ // handleAddNav() {
this.navList.list.push( //
{name:'',url:''} this.navList.list.push({ name: "", url: "" });
) console.log(this.navList.list);
console.log(this.navList.list)
}, },
// //
handleMoveEnd ({newIndex, oldIndex}) { handleMoveEnd({ newIndex, oldIndex }) {
console.log('index', newIndex, oldIndex) console.log("index", newIndex, oldIndex);
}, },
// 广 // 广
handleModel (type) { handleModel(type) {
if(type == 'topAdvert'){ if (type == "topAdvert") {
this.showModal = true; this.showModal = true;
} else { } else {
this.showModalNav = true; this.showModalNav = true;
@ -211,16 +255,21 @@ export default {
this.$refs.ossManage.selectImage = true; this.$refs.ossManage.selectImage = true;
this.picModelFlag = true; this.picModelFlag = true;
}, },
callbackSelected (item) { // callbackSelected(item) {
//
this.picModelFlag = false; this.picModelFlag = false;
this.topAdvert.img = item.url; this.topAdvert.img = item.url;
}, },
handleModelAdd (evt) { // handleModelAdd(evt) {
const newIndex = evt.newIndex //
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])
);
const key =
Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
this.$set(this.data.list, newIndex, { this.$set(this.data.list, newIndex, {
...this.data.list[newIndex], ...this.data.list[newIndex],
options: { options: {
@ -228,36 +277,36 @@ export default {
}, },
key, key,
// //
model: this.data.list[newIndex].type + '_' + 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;
@ -265,38 +314,39 @@ export default {
line-height: 35px; line-height: 35px;
color: #999; color: #999;
font-weight: bold; font-weight: bold;
div,li{ div,
&:hover{ li {
&:hover {
color: $theme_color; color: $theme_color;
cursor: pointer; cursor: pointer;
} }
} }
.detail{ .detail {
display: flex; display: flex;
>li{ > li {
margin-left: 10px; margin-left: 10px;
&::after{ &::after {
content: "|"; content: "|";
padding-left: 10px; padding-left: 10px;
} }
&:last-child::after{ &:last-child::after {
content:''; content: "";
padding-left: 0; padding-left: 0;
} }
&:hover::after{ &:hover::after {
color: #999; color: #999;
} }
} }
} }
} }
/** 搜索框 */ /** 搜索框 */
.search-con { .search-con {
padding-top: 15px; padding-top: 15px;
margin: 0px auto; margin: 0px auto;
margin-bottom: 10px; margin-bottom: 10px;
width: 1200px; width: 1200px;
position: relative; position: relative;
.logo{ .logo {
position: absolute; position: absolute;
top: 10px; top: 10px;
left: 10px; left: 10px;
@ -326,15 +376,20 @@ export default {
line-height: 1; line-height: 1;
} }
} }
.soubenStore {
font-size: 14px;
font-weight: 600;
background-color: #f90;
} }
} }
/** 商品分类 */ }
.nav-con{ /** 商品分类 */
width:1200px; .nav-con {
width: 1200px;
height: 40px; height: 40px;
background: #eee; background: #eee;
display: flex; display: flex;
.all-categories{ .all-categories {
width: 200px; width: 200px;
line-height: 40px; line-height: 40px;
color: #fff; color: #fff;
@ -350,36 +405,39 @@ export default {
list-style: none; list-style: none;
background-color: #eee; background-color: #eee;
display: flex; display: flex;
li{ li {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
margin-left: 20px; margin-left: 20px;
a{ a {
color:rgb(89, 88, 88); color: rgb(89, 88, 88);
font-size: 15px; font-size: 15px;
&:hover{color:$theme_color} &:hover {
color: $theme_color;
} }
} }
} }
} }
/** 顶部广告,头部,搜索框 end */ }
/** 顶部广告,头部,搜索框 end */
.top-fixed-advert, .nav-con{ .top-fixed-advert,
.nav-con {
position: relative; position: relative;
&:hover{ &:hover {
.setup-box{ .setup-box {
display: block; display: block;
} }
} }
} }
/** 装修模态框 内部样式start */ /** 装修模态框 内部样式start */
.modal-top-advert{ .modal-top-advert {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
>*{ > * {
margin-bottom: 10px; 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("保存模板成功");
} }