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 @@
import { columns, pagination } from "./tableConfig.js";
import { shopPushList } from "@/api/shop/goods";
-import { newsList } from "@/api/operation/news";
-import { announcementList } from "@/api/operation/announcement";
-import { activityList } from "@/api/operation/activity";
export default {
props: {
- type: Number,
show:Boolean
},
data() {
return {
columns,
pagination,
- typeMean: "shop",
tableData: [],
selectedRowKeys: [],
- joinString:''
+ sku:''
};
},
+ mounted() {
+ this.getData()
+ },
methods: {
+ async getData(){
+ let res = await shopPushList({
+ pageNum: this.pagination.current,
+ size: this.pagination.pageSize,
+ })
+ this.tableData = res.data.rows
+ this.pagination.total = res.data.total
+ this.selectedRowKeys =[]
+ },
selectionChoosed(data) {
this.selectedRowKeys = data;
},
@@ -76,67 +83,15 @@ export default {
}else{
for(let k of this.tableData){
if(k.id===this.selectedRowKeys[0]){
- if(this.typeMean === 'shop'){
- this.joinString = k.skuName
- }else if(this.typeMean === 'news'){
- this.joinString = k.title
- }else if(this.typeMean === 'announcement'){
- this.joinString = k.title
- }else if(this.typeMean === 'activity'){
- this.joinString = k.title
- }
+ this.sku = k.skuId
}
}
- this.$emit('submit',this.selectedRowKeys,this.joinString)
+ this.$emit('submit',this.selectedRowKeys,this.sku)
this.selectedRowKeys = []
}
},
},
- watch: {
- type: {
- handler(val) {
- if (val === 2) {
- this.typeMean = 'shop'
- shopPushList({
- pageNum: this.pagination.current,
- size: this.pagination.pageSize,
- }).then((res) => {
- this.tableData = res.data.rows;
- this.pagination.total = res.data.total;
- });
- }else if (val === 3) {
- this.typeMean = 'news'
- newsList({
- pageNum: this.pagination.current,
- size: this.pagination.pageSize,
- }).then((res) => {
- this.tableData = res.data.rows;
- this.pagination.total = res.data.total;
- });
- }else if (val === 4) {
- this.typeMean = 'announcement'
- announcementList({
- pageNum: this.pagination.current,
- size: this.pagination.pageSize,
- }).then((res) => {
- this.tableData = res.data.rows;
- this.pagination.total = res.data.total;
- });
- }else if (val === 5) {
- this.typeMean = 'activity'
- activityList({
- pageNum: this.pagination.current,
- size: this.pagination.pageSize,
- }).then((res) => {
- this.tableData = res.data.rows;
- this.pagination.total = res.data.total;
- });
- }
- },
- immediate: true,
- },
- },
};
diff --git a/src/views/Shop/SwiperManage/depend/tableConfig.js b/src/views/Shop/SwiperManage/depend/tableConfig.js
index cbc879a..937a533 100644
--- a/src/views/Shop/SwiperManage/depend/tableConfig.js
+++ b/src/views/Shop/SwiperManage/depend/tableConfig.js
@@ -1,265 +1,79 @@
-export const columns = {
- shop:[
- {
- title: "商品名称",
- width: "12%",
- dataIndex: "skuName",
- },
- {
- title: "sku编码",
- width: "12%",
- dataIndex: "skuId",
- },
- {
- title: "商品类型",
- width: "7%",
- dataIndex: "mallType",
- customRender: function (mallType) {
- switch (mallType) {
- case 1:
- return 'Jcook'
- break;
- default:
- break;
- }
- }
- },
- {
- title: "店铺名",
- width: "8%",
- dataIndex: "shopName",
- },
- {
- title: "品牌名",
- width: "8%",
- dataIndex: "brandName",
- },
- {
- title: "供应商名",
- width: "8%",
- dataIndex: "vendorName",
- },
- {
- title: "一级分类名称",
- width: "8%",
- dataIndex: "categoryFirstName",
- },
- {
- title: "二级分类名称",
- width: "8%",
- dataIndex: "categorySecondName",
- },
- {
- title: "三级分类名称",
- width: "8%",
- dataIndex: "categoryThirdName",
- },
- {
- title: "主图url",
- width: "8%",
- dataIndex: "mainPhoto",
- },
- {
- title: "售卖价",
- width: "8%",
- dataIndex: "sellPrice",
- },
- {
- title: "折扣价",
- width: "8%",
- dataIndex: "discountPrice",
- },
- {
- title: "浏览量",
- width: "8%",
- dataIndex: "viewsNum",
- },
- ],
- news: [
- {
- title: "标题",
- dataIndex: "title",
- },
- {
- title: "分类",
- dataIndex: "categoryName",
- },
- {
- title: "发布状态",
- dataIndex: "status",
- customRender: function (status) {
- switch (status) {
- case 1:
- return '未发布'
- case 2:
- return '已发布'
- }
- }
- },
- {
- title: "阅读量",
- dataIndex: "viewsNum",
- },
- {
- title: "创建时间",
- dataIndex: "createDate",
- },
- ],
- announcement: [
- {
- title: "标题",
- dataIndex: "title",
- width: "16%",
- },
- {
- title: "推送对象",
- dataIndex: "object",
- width: "10%",
- customRender: function (object) {
- switch (object) {
- case 1:
- return '全部'
- break;
- case 2:
- return '住户'
- break;
- case 3:
- return '业主'
- break;
- case 4:
- return '租户'
- break;
- case 5:
- return '管家'
- break;
- default:
- break;
- }
- }
- },
- {
- title: "状态",
- dataIndex: "status",
- width: "10%",
- customRender: function (status) {
- switch (status) {
- case 1:
- return '未发布'
- break;
- case 2:
- return '已发布'
- break;
- default:
- break;
- }
- }
- },
- {
- title: "内容",
- dataIndex: "content",
- width: "13%",
- },
- {
- title: "阅读量",
- dataIndex: "readingVolume",
- width: "10%",
- },
- {
- title: "附件下载次数",
- dataIndex: "downloadNum",
- width: "10%",
- },
- {
- title: "更新时间",
- dataIndex: "modifyDate",
- width: "14%",
- }
- ],
- activity:[
- {
- title: "发布时间",
- dataIndex: "createDate",
- width: "12%",
- },
- {
- title: "图片",
- dataIndex: "imgpic",
- width: "10%",
- scopedSlots: { customRender: "imgpic"}
- },
- {
- title: "活动状态",
- dataIndex: "status",
- width: "6%",
- customRender: function (status) {
- switch (status) {
- case 1:
- return '报名未开始'
- case 2:
- return '报名进行中'
- case 3:
- return '活动未开始'
- case 4:
- return '活动进行中'
- case 5:
- return '活动已结束'
- }
- }
- },
- {
- title: "活动标题",
- dataIndex: "title",
- width: "8%",
- },
- {
- title: "活动地点",
- dataIndex: "activityAddress",
- width: "8%",
- },
- {
- title: "是否显示在app",
- dataIndex: "isShow",
- width: "5%",
- customRender: function (isShow) {
- switch (isShow) {
- case true:
- return '显示'
- case false:
- return '不显示'
- }
- }
- },
- {
- title: "主办方",
- dataIndex: "organizerName",
- width: "8%",
- },
- {
- title: "活动内容",
- dataIndex: "content",
- width: "8%",
- },
- {
- title: "报名人数",
- dataIndex: "registrationNum",
- width: "5%",
- },
- {
- title: "报名时间",
- width: "12%",
- customRender: function (data) {
- return (data.registrationStartTime + '——' + data.registrationEndTime)
- }
- },
- {
- title: "活动时间",
- width: "12%",
- customRender: function (data) {
- return (data.activityStartTime + '——' + data.activityEndTime)
+export const columns = [
+ {
+ title: "商品名称",
+ width: "12%",
+ dataIndex: "skuName",
+ },
+ {
+ title: "sku编码",
+ width: "12%",
+ dataIndex: "skuId",
+ },
+ {
+ title: "商品类型",
+ width: "7%",
+ dataIndex: "mallType",
+ customRender: function (mallType) {
+ switch (mallType) {
+ case 1:
+ return 'Jcook'
+ break;
+ default:
+ break;
}
}
- ]
-}
+ },
+ {
+ title: "店铺名",
+ width: "8%",
+ dataIndex: "shopName",
+ },
+ {
+ title: "品牌名",
+ width: "8%",
+ dataIndex: "brandName",
+ },
+ {
+ title: "供应商名",
+ width: "8%",
+ dataIndex: "vendorName",
+ },
+ {
+ title: "一级分类名称",
+ width: "8%",
+ dataIndex: "categoryFirstName",
+ },
+ {
+ title: "二级分类名称",
+ width: "8%",
+ dataIndex: "categorySecondName",
+ },
+ {
+ title: "三级分类名称",
+ width: "8%",
+ dataIndex: "categoryThirdName",
+ },
+ {
+ title: "主图url",
+ width: "8%",
+ dataIndex: "mainPhoto",
+ },
+ {
+ title: "售卖价",
+ width: "8%",
+ dataIndex: "sellPrice",
+ },
+ {
+ title: "折扣价",
+ width: "8%",
+ dataIndex: "discountPrice",
+ },
+ {
+ title: "浏览量",
+ width: "8%",
+ dataIndex: "viewsNum",
+ }
+]
export const pagination = {
current: 1,
total: 0,
diff --git a/src/views/Shop/SwiperManage/index.vue b/src/views/Shop/SwiperManage/index.vue
index 8a49538..2505387 100644
--- a/src/views/Shop/SwiperManage/index.vue
+++ b/src/views/Shop/SwiperManage/index.vue
@@ -7,13 +7,14 @@
>
×
-
+
+ appSku编码:{{ item.appSkuId }}
上传图片尺寸: 750*300
@@ -25,19 +26,6 @@
/>
暂无图片
-
-
-
- {{ item.customizeUrl }}
-
-
- {{ item.isShow ? "是" : "否" }}
-
-
- {{ item.showWeights }}
-
-
-
修改设置
@@ -49,78 +37,32 @@
:visible="add.show"
@ok="saveSetting"
@cancel="newSwiperClose"
- width="900px"
+ width="600px"
>
-
-
- 上传图片尺寸: 750*300
-
-
-
-
-
-
-
-
- 自定义链接
- 商城
- 资讯
- 公告
- 活动
-
-
- 请选择链接
-
- {{ form.customizeUrl }}
-
-
-
-
-
-
-
-
-
-
+
+ 上传图片尺寸: 750*300
+
+
+
-
-
+
@@ -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;
+}