From f6c0d4f591e97f0b3d266a19fc9838a74d77cd1d Mon Sep 17 00:00:00 2001 From: bibi <541660090@qq.com> Date: Sat, 26 Feb 2022 15:12:16 +0800 Subject: [PATCH] 1 --- src/api/shop/swiper/index.js | 32 ++ src/router/shop.js | 18 +- .../GoodsManage/_goodsList/depend/config.js | 2 +- .../GoodsManage/_goodsList/depend/form.vue | 2 +- .../Shop/GoodsManage/_goodsList/index.vue | 2 +- src/views/Shop/OrderManage/depend/detail.vue | 70 +--- src/views/Shop/OrderManage/index.vue | 338 ++++++++++-------- src/views/Shop/SwiperManage/depend/config.js | 6 +- src/views/Shop/SwiperManage/depend/table.vue | 79 +--- .../Shop/SwiperManage/depend/tableConfig.js | 334 ++++------------- src/views/Shop/SwiperManage/index.vue | 158 +++----- 11 files changed, 380 insertions(+), 661 deletions(-) create mode 100644 src/api/shop/swiper/index.js diff --git a/src/api/shop/swiper/index.js b/src/api/shop/swiper/index.js new file mode 100644 index 0000000..60dbad4 --- /dev/null +++ b/src/api/shop/swiper/index.js @@ -0,0 +1,32 @@ +import httpService from "@/request" + +// 商品 +// 轮播图 +export function swiperList(params) { + return httpService({ + url: `/user/shopRotation/findRotationList`, + method: 'get', + params: params, + }) +} +export function swiperDel(params) { + return httpService({ + url: `/user/shopRotation/delete`, + method: 'get', + params: params, + }) +} +export function swiperUpdate(params) { + return httpService({ + url: `/user/shopRotation/update`, + method: 'post', + data: params, + }) +} +export function swiperInsert(params) { + return httpService({ + url: `/user/shopRotation/insert`, + method: 'post', + data: params, + }) +} diff --git a/src/router/shop.js b/src/router/shop.js index 24761f9..93584f0 100644 --- a/src/router/shop.js +++ b/src/router/shop.js @@ -95,15 +95,15 @@ export default [ component: resolve => require(['@/views/Shop/StoreManage'], resolve), meta: {title: '店铺管理'} }, - // { - // path: '/SwiperManage', - // name: "SwiperManage", - // title: "商城轮播图管理", - // hide: false, - // icon: 'bars', - // component: resolve => require(['@/views/Shop/SwiperManage'], resolve), - // meta: {title: '商城轮播图管理'} - // }, + { + path: '/SwiperManage', + name: "SwiperManage", + title: "商城轮播图管理", + hide: false, + icon: 'bars', + component: resolve => require(['@/views/Shop/SwiperManage'], resolve), + meta: {title: '商城轮播图管理'} + }, // { // path: '/ScoreSetting', // name: "ScoreSetting", diff --git a/src/views/Shop/GoodsManage/_goodsList/depend/config.js b/src/views/Shop/GoodsManage/_goodsList/depend/config.js index 197f858..b75a0a8 100644 --- a/src/views/Shop/GoodsManage/_goodsList/depend/config.js +++ b/src/views/Shop/GoodsManage/_goodsList/depend/config.js @@ -100,7 +100,7 @@ export const formItem = [ export const pagination = { current: 1, total: 0, - pageSize: 10, + pageSize: 5, showTotal: (total) => `共 ${total} 条`, showSizeChanger: true, showQuickJumper: true, diff --git a/src/views/Shop/GoodsManage/_goodsList/depend/form.vue b/src/views/Shop/GoodsManage/_goodsList/depend/form.vue index 66f3fcc..3b0b4e9 100644 --- a/src/views/Shop/GoodsManage/_goodsList/depend/form.vue +++ b/src/views/Shop/GoodsManage/_goodsList/depend/form.vue @@ -109,7 +109,7 @@ import { brandSelect, goodsEdit, goodsInfo, -} from "@/api/shop/goods"; +} from "@/api/shop/goods/index.js"; export default { props: { show: { diff --git a/src/views/Shop/GoodsManage/_goodsList/index.vue b/src/views/Shop/GoodsManage/_goodsList/index.vue index 9acc325..01ac510 100644 --- a/src/views/Shop/GoodsManage/_goodsList/index.vue +++ b/src/views/Shop/GoodsManage/_goodsList/index.vue @@ -56,7 +56,7 @@ - \ No newline at end of file + diff --git a/src/views/Shop/SwiperManage/depend/config.js b/src/views/Shop/SwiperManage/depend/config.js index abda366..83ed4d9 100644 --- a/src/views/Shop/SwiperManage/depend/config.js +++ b/src/views/Shop/SwiperManage/depend/config.js @@ -1,9 +1,5 @@ export const form = { id: undefined, - type: undefined, - showWeights: 0, - customizeUrl: "", - isShow: false, - associationId: undefined, + appSkuId: undefined, imgUrls: [], } \ No newline at end of file diff --git a/src/views/Shop/SwiperManage/depend/table.vue b/src/views/Shop/SwiperManage/depend/table.vue index 5a6bb53..48fb85b 100644 --- a/src/views/Shop/SwiperManage/depend/table.vue +++ b/src/views/Shop/SwiperManage/depend/table.vue @@ -1,7 +1,7 @@ @@ -131,7 +73,7 @@ import { swiperInsert, swiperDel, swiperUpdate, -} from "@/api/operation/swiper"; +} from "@/api/shop/swiper"; import chooseTable from "./depend/table.vue"; export default { components: { @@ -144,6 +86,7 @@ export default { }, fileList: [], cardList: [], + Listeners:[], add: { show: false, title: "添加轮播图", @@ -157,7 +100,7 @@ export default { methods: { async getData() { let res = await swiperList(); - this.cardList = res.data; + this.Listeners = res.data }, // 新增 newSwiper() { @@ -172,13 +115,8 @@ export default { show: true, title: "修改轮播图", }; - console.log(data); - this.form.id = data.id; - this.form.isShow = data.isShow; - this.form.showWeights = data.showWeights; - this.form.type = data.type; - this.form.customizeUrl = data.customizeUrl; - this.form.associationId = data.associationId; + this.form = data; + this.form.imgUrls = []; if (data.imgList.length > 0) { // 如果已经有图片 this.form.imgUrls.push(data.imgList[0].url); @@ -194,6 +132,7 @@ export default { file.push(obj); } this.fileList = file; + // console.log(this.fileList); } }, newSwiperClose() { @@ -202,21 +141,17 @@ export default { title: "添加轮播图", }; this.fileList = []; - this.form.imgUrls = []; this.form = { id: undefined, - type: undefined, - showWeights: 0, - customizeUrl: "", - isShow: false, - associationId: undefined, + appSkuId: "", imgUrls: [], }; }, // 选择链接确定 - submit(data, customizeUrl) { - this.form.customizeUrl = customizeUrl; - this.form.associationId = data[0]; + submit(id, sku) { + // console.log(id); + // console.log(sku); + this.form.appSkuId = sku; this.close(); }, // 保存 @@ -245,16 +180,13 @@ export default { close() { this.table.show = false; }, - changeType() { - this.form.customizeUrl = ""; - }, // 删除轮播图 async del(id) { this.$confirm({ title: "是否删除", icon: "delete", onOk: async () => { - swiperDel({ homepageCarouselId: id }).then((res) => { + swiperDel({ rotationId: id }).then((res) => { if (res.code === 200) { this.$message.success(res.msg); this.getData(); @@ -267,7 +199,7 @@ export default { }, // 上传图片 handleChange(data) { - console.log(data); + // console.log(data); this.fileList = data; // 删除照片 if (this.fileList.length === 0) { @@ -277,6 +209,15 @@ export default { } }, }, + watch:{ + Listeners:{ + handler(val){ + console.log(val); + this.cardList = val + }, + deep: true + } + } }; @@ -304,4 +245,9 @@ export default { cursor: pointer; font-size: 20px; } +.new-swiper { + display: flex; + flex-direction: column; + justify-content: center; +}