Compare commits

...

2 Commits

Author SHA1 Message Date
bibi a4c68718fc 1
3 years ago
bibi f6c0d4f591 1
3 years ago

@ -0,0 +1,39 @@
import httpService from "@/request"
// 商品
// 品牌
export function cateList(params) {
return httpService({
url: `/user/shopCategory/listAll`,
method: 'get',
params: params,
})
}
export function cateShow(params) {
return httpService({
url: `/user/shopCategory/isShow`,
method: 'get',
params: params,
})
}
export function cateInfo(params) {
return httpService({
url: `/user/shopCategory/listByParentId`,
method: 'get',
params: params,
})
}
export function cateUpdate(params) {
return httpService({
url: `/user/shopCategory/updateCategory`,
method: 'post',
data: params,
})
}
export function cateInsert(params) {
return httpService({
url: `/user/shopCategory/insertCategory`,
method: 'post',
data: params,
})
}

@ -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,
})
}

@ -95,15 +95,15 @@ export default [
component: resolve => require(['@/views/Shop/StoreManage'], resolve), component: resolve => require(['@/views/Shop/StoreManage'], resolve),
meta: {title: '店铺管理'} meta: {title: '店铺管理'}
}, },
// { {
// path: '/SwiperManage', path: '/SwiperManage',
// name: "SwiperManage", name: "SwiperManage",
// title: "商城轮播图管理", title: "商城轮播图管理",
// hide: false, hide: false,
// icon: 'bars', icon: 'bars',
// component: resolve => require(['@/views/Shop/SwiperManage'], resolve), component: resolve => require(['@/views/Shop/SwiperManage'], resolve),
// meta: {title: '商城轮播图管理'} meta: {title: '商城轮播图管理'}
// }, },
// { // {
// path: '/ScoreSetting', // path: '/ScoreSetting',
// name: "ScoreSetting", // name: "ScoreSetting",

@ -0,0 +1,42 @@
export const columns = [
{
title: "分类名称",
dataIndex: "name",
width: "33%",
},
{
title: "图片",
dataIndex: "imgpic",
width: "33%",
scopedSlots: { customRender: "imgpic"}
},
{
title: "是否显示",
dataIndex: "isShow",
width: "33%",
customRender: function (isShow) {
switch (isShow) {
case 1:
return '显示'
case 0:
return '不显示'
}
}
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -1,14 +1,157 @@
<template> <template>
<div></div> <div>
<div class="cardTitle">商品分类</div>
<div class="content">
<a-button class="add-btn" style="margin-left: 10px" @click="addCate"
>新增商品分类</a-button
>
<a-row>
<a-col
:span="3"
style="
border-right: 1px solid #0000000f;
height: 100vh;
margin-right: 40px;
"
>
<a-tree
class="tree"
v-model="checkedKeys"
:expanded-keys="expandedKeys"
:scroll="{ x: 2600 }"
:auto-expand-parent="autoExpandParent"
:selected-keys="selectedKeys"
:tree-data="treeData"
@expand="onExpand"
@select="onSelect"
:replaceFields="{
children: 'shopCategoryVoList',
title: 'name',
key: 'id',
}"
>
</a-tree>
</a-col>
<a-col :span="18">
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return record.id;
}
"
>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="show(row.id)" v-if="row.isShow===0"></a>
<a class="ant-dropdown-link" @click="show(row.id)" v-else-if="row.isShow===1">隐藏</a>
</a-space>
</span>
<span slot="imgpic" slot-scope="text, row">
<img
v-if="row.imgUrls.length > 0"
:src="$ImgUrl(row.imgUrls[0].url)"
class="table-img"
alt=""
/>
<span v-else></span>
</span>
</a-table>
</a-col>
</a-row>
</div>
<a-drawer
:title="drawer.title"
placement="right"
:closable="false"
:visible="drawer.show"
@close="onClose"
>
<div class="main"></div>
</a-drawer>
</div>
</template> </template>
<script> <script>
import { cateList, cateInfo,cateShow } from "@/api/shop/goods/cate.js";
import { columns, pagination } from "./depend/config";
export default { export default {
data() { data() {
return {}; return {
columns,
pagination,
// index
selectedRowKeys: [],
tableData: [],
drawer: {
show: false,
title: "分类-详情",
},
expandedKeys: [],
autoExpandParent: true,
checkedKeys: [],
selectedKeys: [],
treeData: [],
};
},
mounted() {
this.getData();
},
methods: {
async getData() {
let res = await cateList();
this.treeData = res.data;
},
addCate() {},
onClose() {},
async show(id){
let res = await cateShow({shopCategoryId:id})
if(res.code === 200){
this.$message.success(res.msg)
this.onSelect(this.selectedKeys)
}else{
this.$message.error(res.msg)
}
},
selectionChoosed(data) {
this.selectedRowKeys = data;
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
//
onExpand(expandedKeys) {
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
async onSelect(selectedKeys) {
this.selectedKeys = selectedKeys;
let res = await cateInfo({ parentId: this.selectedKeys[0],pageNum:this.pagination.current,size:this.pagination.pageSize });
this.tableData = res.data.rows
this.pagination.total = res.data.total
},
}, },
methods: {},
}; };
</script> </script>
<style lang="less" scoped></style> <style lang="less" scoped>
.table-img {
width: 40px;
height: 40px;
}
.tree {
padding-left: 10px;
}
</style>

@ -100,7 +100,7 @@ export const formItem = [
export const pagination = { export const pagination = {
current: 1, current: 1,
total: 0, total: 0,
pageSize: 10, pageSize: 5,
showTotal: (total) => `${total}`, showTotal: (total) => `${total}`,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,

@ -109,7 +109,7 @@ import {
brandSelect, brandSelect,
goodsEdit, goodsEdit,
goodsInfo, goodsInfo,
} from "@/api/shop/goods"; } from "@/api/shop/goods/index.js";
export default { export default {
props: { props: {
show: { show: {

@ -56,7 +56,7 @@
<script> <script>
import { columns, pagination, formItem } from "./depend/config.js"; import { columns, pagination, formItem } from "./depend/config.js";
import { shopPushList,offShelf,onShelf} from "@/api/shop/goods"; import { shopPushList,offShelf,onShelf} from "@/api/shop/goods/index.js";
import addForm from "./depend/form.vue"; import addForm from "./depend/form.vue";
export default { export default {
components: { components: {

@ -13,7 +13,7 @@
{{infoData.tradeStatus|tradeStatus}} {{infoData.tradeStatus|tradeStatus}}
</div> </div>
<div style='margin-bottom:10px'>买家已付款至账户请尽快发货否则买家有权申请退款</div> <div style='margin-bottom:10px'>买家已付款至账户请尽快发货否则买家有权申请退款</div>
<a-space size='large'><a-button type="primary">确认发货</a-button><a></a></a-space> <a-space size='large'><a-button type="primary">确认发货</a-button><a v-if="infoData.tradeStatus!==9"></a></a-space>
</a-col> </a-col>
<a-col :span="12" style="margin-top:20px"> <a-col :span="12" style="margin-top:20px">
<a-steps :current="1" style=""> <a-steps :current="1" style="">
@ -51,7 +51,7 @@
{{infoData.receiverTel}} {{infoData.receiverTel}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="收货地址"> <a-descriptions-item label="收货地址">
{{infoData.locationName+infoData.addressDetail+infoData.addressDetail+infoData.addressDetail+infoData.addressDetail+infoData.addressDetail+infoData.addressDetail}} {{infoData.locationName+infoData.addressDetail}}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
</span> </span>
@ -110,74 +110,14 @@ import { detailColumns } from './config'
export default { export default {
data(){ data(){
return{ return{
infoData:{ infoData:{},
"id":1, skuList:[],
"code":"123456",
"jcookCode":"123131241",
"tradeNo":"12123",
"tradeStatus":1,
"payName":"张三",
"payTel":"13738611460",
"payType":1,
"payPrice":13,
"freightFee":4,
"receiverName":"王五",
"receiverTel":"13738611465",
"locationName":"宁波镇海",
"addressDetail":"深蓝大厦",
"remake":null,
"createName":"张三",
"createDate":'2020-1-2',
"skuList":[
{
"mallType":1,
"appSkuId":"235533200452096000",
"skuName":"测试修改",
"mainPhoto":"http://oss.jcook.com.cn/file4/100003980222/100003980222_0.jpg",
"sellPrice":12,
"kind":1,
"weight":1,
"unit":"个",
"num":1,
"payPrice":13,
"goodsId":null
}
]
},
skuList:[
{
"mallType":1,
"appSkuId":"235533200452096000",
"skuName":"测试修改",
"mainPhoto":"http://oss.jcook.com.cn/file4/100003980222/100003980222_0.jpg",
"sellPrice":12,
"kind":1,
"weight":1,
"unit":"个",
"num":1,
"payPrice":13,
"goodsId":null
},
{
"mallType":1,
"appSkuId":"235533200452096000",
"skuName":"测试修改",
"mainPhoto":"http://oss.jcook.com.cn/file4/100003980222/100003980222_0.jpg",
"sellPrice":12,
"kind":1,
"weight":1,
"unit":"个",
"num":1,
"payPrice":13,
"goodsId":null
},
],
detailColumns detailColumns
} }
}, },
mounted() { mounted() {
if(this.$route.params.id){ if(this.$route.params.id){
// this.getInfo(this.$route.params.id) this.getInfo(this.$route.params.id)
} }
}, },
filters: { filters: {

@ -1,77 +1,150 @@
<template> <template>
<div> <div>
<div class="cardTitle">订单列表</div> <div class="cardTitle">订单列表</div>
<div class="search-box"> <div class="search-box">
<a-row> <a-row>
<a-col :span="20"> <a-col :span="20">
<a-space size="large"> <a-space size="large">
<a-input style="width: 200px" v-model="searchForm.code" placeholder="请输入订单号" /> <a-input
<a-input style="width: 200px" v-model="searchForm.jcookCode" placeholder="请输入jcook订单号" /> style="width: 200px"
<a-select style="width: 200px" v-model="searchForm.tradeStatus" placeholder="请选择交易状态" ></a-select> v-model="searchForm.code"
<a-button type="primary" @click='getData'> </a-button> placeholder="请输入订单号"
<a-button> </a-button> />
</a-space> <a-input
</a-col> style="width: 200px"
<a-col :span="4"> v-model="searchForm.jcookCode"
<!-- <a-button class="add-btn" @click="">添加</a-button> --> placeholder="请输入jcook订单号"
</a-col> />
</a-row> <a-select
</div> style="width: 200px"
<a-table :columns="columns" :data-source="tableData" :rowKey="record=>record.id" tableLayout='auto' :pagination="pagination"> v-model="searchForm.tradeStatus"
<div slot="expandedRowRender" slot-scope="record" style="margin: 0"> placeholder="请选择交易状态"
<a-descriptions title="订单信息"> ></a-select>
<!-- 商品图片 --> <a-button type="primary" @click="getData"> </a-button>
<!-- <template> <a-button> </a-button>
</a-space>
</a-col>
<a-col :span="4">
<!-- <a-button class="add-btn" @click="">添加</a-button> -->
</a-col>
</a-row>
</div>
<a-table
:columns="columns"
:data-source="tableData"
:rowKey="(record) => record.id"
tableLayout="auto"
:pagination="pagination"
>
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<a-descriptions title="订单信息">
<!-- 商品图片 -->
<!-- <template>
<img :src="ImgUrl(record)" class='order-pic' alt=""> <img :src="ImgUrl(record)" class='order-pic' alt="">
</template> --> </template> -->
<a-descriptions-item label="订单状态"> <a-descriptions-item label="订单状态">
{{record.tradeStatus | tradeStatus}} {{ record.tradeStatus | tradeStatus }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="支付人"> <a-descriptions-item label="支付人">
{{record.payName + record.payTel}} {{ record.payName + record.payTel }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="付款金额"> <a-descriptions-item label="付款金额">
{{record.payPrice}} {{ record.payPrice }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="运费"> <a-descriptions-item label="运费">
{{record.freightFee}} {{ record.freightFee }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="收货人"> <a-descriptions-item label="收货人">
{{record.receiverName + record.receiverTel}} {{ record.receiverName + record.receiverTel }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="地址"> <a-descriptions-item label="地址">
{{record.locationName + record.addressDetail}} {{ record.locationName + record.addressDetail }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="备注"> <a-descriptions-item label="备注">
{{record.remake||'无'}} {{ record.remake || "无" }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="创建人"> <a-descriptions-item label="创建人">
{{record.createName}} {{ record.createName }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="创建时间"> <a-descriptions-item label="创建时间">
{{record.createDate}} {{ record.createDate }}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
</div> </div>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a-space> <a-space>
<a @click='detail(record)'>查看详情</a> <a @click="detail(record)"></a>
<a @click='cancelOrder(record)'>取消订单</a> <a @click="cancelOrder(record.id)"></a>
</a-space> </a-space>
</span> </span>
</a-table> </a-table>
</div> <a-modal
title="取消订单"
:visible="modal.show"
@ok="handleOk"
@cancel="handleCancel"
>
<div>
<a-select placeholder='请选择原因' v-model="cancelForm.cancelReasonCode" style="width:200px">
<a-select-option v-for="item in options.cancelReasonCode" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</div>
</a-modal>
</div>
</template> </template>
<script> <script>
import { orderList, shopOrderCancel, orderInfo } from '@/api/shop/order' import { orderList, shopOrderCancel, orderInfo } from "@/api/shop/order";
import { columns,pagination,searchForm } from './depend/config' import { columns, pagination, searchForm } from "./depend/config";
export default { export default {
data() { data() {
return { return {
tableData:[], tableData: [],
modal: {
show: false,
},
columns, columns,
pagination, pagination,
searchForm searchForm,
options: {
cancelReasonCode: [
{
id: 1,
name: "订单不能按预计时间送达",
},
{
id: 2,
name: "其他渠道价格更低",
},
{
id: 3,
name: "该商品降价了",
},
{
id: 4,
name: "不想买了",
},
{
id: 5,
name: "其他原因",
},
{
id: 6,
name: "操作有误(商品、地址等选错)",
},
{
id: 7,
name: "商品无货",
},
{
id: 100,
name: "其他",
},
],
},
cancelForm: {
orderId: undefined,
cancelReasonCode: undefined,
},
}; };
}, },
filters: { filters: {
@ -81,117 +154,80 @@ export default {
// 2.,3.退4.,5., // 2.,3.退4.,5.,
// 6.,7.8.9.10.,11.) // 6.,7.8.9.10.,11.)
case 0: case 0:
return '交易创建并等待买家付款' return "交易创建并等待买家付款";
case 1: case 1:
return '交易关闭' return "交易关闭";
case 2: case 2:
return '待发货' return "待发货";
case 3: case 3:
return '交易结束' return "交易结束";
case 4: case 4:
return '待收货' return "待收货";
case 5: case 5:
return '订单完成' return "订单完成";
case 6: case 6:
return '申请取消' return "申请取消";
case 7: case 7:
return '申请拒收' return "申请拒收";
case 8: case 8:
return '取消订单失败' return "取消订单失败";
case 9: case 9:
return '取消订单成功' return "取消订单成功";
case 10: case 10:
return '发生拆单' return "发生拆单";
case 11: case 11:
return '售后换新' return "售后换新";
default: default:
break; break;
} }
} },
}, },
mounted() { mounted() {
// this.getData() this.getData();
this.tableData =[{
"id":1,
"code":"123456",
"jcookCode":"123131241",
"tradeNo":"12123",
"tradeStatus":1,
"payName":"张三",
"payTel":"13738611460",
"payType":1,
"payPrice":13,
"freightFee":4,
"receiverName":"王五",
"receiverTel":"13738611465",
"locationName":"宁波镇海",
"addressDetail":"深蓝大厦",
"remake":null,
"createName":"张三",
"createDate":'2022-2-2'
},{
"id":2,
"code":"123456",
"jcookCode":"123131241",
"tradeNo":"12123",
"tradeStatus":1,
"payName":"张三",
"payTel":"13738611460",
"payType":1,
"payPrice":13,
"freightFee":4,
"receiverName":"王五",
"receiverTel":"13738611465",
"locationName":"宁波镇海",
"addressDetail":"深蓝大厦",
"remake":null,
"createName":"张三",
"createDate":'2022-2-2'
},{
"id":3,
"code":"123456",
"jcookCode":"123131241",
"tradeNo":"12123",
"tradeStatus":1,
"payName":"张三",
"payTel":"13738611460",
"payType":1,
"payPrice":13,
"freightFee":4,
"receiverName":"王五",
"receiverTel":"13738611465",
"locationName":"宁波镇海",
"addressDetail":"深蓝大厦",
"remake":null,
"createName":"张三",
"createDate":'2022-2-2'
},
]
}, },
methods: { methods: {
async getData(){ async getData() {
const res = await orderList({ const res = await orderList({
pageNum: this.pagination.current, pageNum: this.pagination.current,
size: this.pagination.pageSize, size: this.pagination.pageSize,
...this.searchForm ...this.searchForm,
}) });
this.tableData = res.data.rows this.tableData = res.data.rows;
this.pagination.total = res.data.total this.pagination.total = res.data.total;
}, },
reset(){ reset() {
this.searchForm = { this.searchForm = {
code: "", code: "",
jcookCode: '', jcookCode: "",
tradeStatus:undefined tradeStatus: undefined,
};
this.getData();
},
cancelOrder(id) {
this.cancelForm.orderId = id;
this.modal.show = true;
},
async handleOk() {
let res = await shopOrderCancel(this.cancelForm);
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
this.handleCancel();
} else {
this.$message.error(res.msg);
} }
this.getData()
}, },
cancelOrder(data){}, handleCancel() {
detail(data){ this.cancelForm = {
this.$router.push({name:'OrderDetail',params:{id:data.id}}) orderId: undefined,
} cancelReasonCode: undefined,
} }
this.modal.show = false;
},
detail(data) {
this.$router.push({ name: "OrderDetail", params: { id: data.id } });
},
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>

@ -1,9 +1,5 @@
export const form = { export const form = {
id: undefined, id: undefined,
type: undefined, appSkuId: undefined,
showWeights: 0,
customizeUrl: "",
isShow: false,
associationId: undefined,
imgUrls: [], imgUrls: [],
} }

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<a-modal <a-modal
width="90%" width="80%"
title="选择链接" title="选择链接"
:visible="show" :visible="show"
@ok="handleOk" @ok="handleOk"
@ -9,7 +9,7 @@
> >
<div> <div>
<a-table <a-table
:columns="columns[typeMean]" :columns="columns"
:data-source="tableData" :data-source="tableData"
:pagination="pagination" :pagination="pagination"
:scroll="{ x: 1400 }" :scroll="{ x: 1400 }"
@ -33,25 +33,32 @@
<script> <script>
import { columns, pagination } from "./tableConfig.js"; import { columns, pagination } from "./tableConfig.js";
import { shopPushList } from "@/api/shop/goods"; 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 { export default {
props: { props: {
type: Number,
show:Boolean show:Boolean
}, },
data() { data() {
return { return {
columns, columns,
pagination, pagination,
typeMean: "shop",
tableData: [], tableData: [],
selectedRowKeys: [], selectedRowKeys: [],
joinString:'' sku:''
}; };
}, },
mounted() {
this.getData()
},
methods: { 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) { selectionChoosed(data) {
this.selectedRowKeys = data; this.selectedRowKeys = data;
}, },
@ -76,67 +83,15 @@ export default {
}else{ }else{
for(let k of this.tableData){ for(let k of this.tableData){
if(k.id===this.selectedRowKeys[0]){ if(k.id===this.selectedRowKeys[0]){
if(this.typeMean === 'shop'){ this.sku = k.skuId
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.$emit('submit',this.selectedRowKeys,this.joinString) this.$emit('submit',this.selectedRowKeys,this.sku)
this.selectedRowKeys = [] 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,
},
},
}; };
</script> </script>

@ -1,265 +1,79 @@
export const columns = { export const columns = [
shop:[ {
{ title: "商品名称",
title: "商品名称", width: "12%",
width: "12%", dataIndex: "skuName",
dataIndex: "skuName", },
}, {
{ title: "sku编码",
title: "sku编码", width: "12%",
width: "12%", dataIndex: "skuId",
dataIndex: "skuId", },
}, {
{ title: "商品类型",
title: "商品类型", width: "7%",
width: "7%", dataIndex: "mallType",
dataIndex: "mallType", customRender: function (mallType) {
customRender: function (mallType) { switch (mallType) {
switch (mallType) { case 1:
case 1: return 'Jcook'
return 'Jcook' break;
break; default:
default: break;
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: "店铺名",
title: "发布时间", width: "8%",
dataIndex: "createDate", dataIndex: "shopName",
width: "12%", },
}, {
{ title: "品牌名",
title: "图片", width: "8%",
dataIndex: "imgpic", dataIndex: "brandName",
width: "10%", },
scopedSlots: { customRender: "imgpic"} {
}, title: "供应商名",
{ width: "8%",
title: "活动状态", dataIndex: "vendorName",
dataIndex: "status", },
width: "6%", {
customRender: function (status) { title: "一级分类名称",
switch (status) { width: "8%",
case 1: dataIndex: "categoryFirstName",
return '报名未开始' },
case 2: {
return '报名进行中' title: "二级分类名称",
case 3: width: "8%",
return '活动未开始' dataIndex: "categorySecondName",
case 4: },
return '活动进行中' {
case 5: title: "三级分类名称",
return '活动已结束' width: "8%",
} dataIndex: "categoryThirdName",
} },
}, {
{ title: "主图url",
title: "活动标题", width: "8%",
dataIndex: "title", dataIndex: "mainPhoto",
width: "8%", },
}, {
{ title: "售卖价",
title: "活动地点", width: "8%",
dataIndex: "activityAddress", dataIndex: "sellPrice",
width: "8%", },
}, {
{ title: "折扣价",
title: "是否显示在app", width: "8%",
dataIndex: "isShow", dataIndex: "discountPrice",
width: "5%", },
customRender: function (isShow) { {
switch (isShow) { title: "浏览量",
case true: width: "8%",
return '显示' dataIndex: "viewsNum",
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 pagination = { export const pagination = {
current: 1, current: 1,
total: 0, total: 0,

@ -7,13 +7,14 @@
> >
<a-card <a-card
hoverable hoverable
style="width: 70%; margin-top: 10px" style="width: 600px; margin-top: 10px"
v-for="item in cardList" v-for="item in cardList"
:key="item.id" :key="item.id"
> >
<span class="card-close" @click="del(item.id)">×</span> <span class="card-close" @click="del(item.id)">×</span>
<a-row> <a-row>
<a-col :span="9"> <a-col :span="19">
appSku编码{{ item.appSkuId }}
<div style="color: #00000073; padding-bottom: 10px"> <div style="color: #00000073; padding-bottom: 10px">
上传图片尺寸: 750*300 上传图片尺寸: 750*300
</div> </div>
@ -25,19 +26,6 @@
/> />
<span v-else></span> <span v-else></span>
</a-col> </a-col>
<a-col :span="11">
<a-descriptions layout="vertical" :column="1">
<a-descriptions-item label="链接设置">
{{ item.customizeUrl }}
</a-descriptions-item>
<a-descriptions-item label="是否显示在用户端">
{{ item.isShow ? "是" : "否" }}
</a-descriptions-item>
<a-descriptions-item label="显示权重">
{{ item.showWeights }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :span="4"> <a-col :span="4">
<a-button class="add-btn" @click="edit(item)"></a-button> <a-button class="add-btn" @click="edit(item)"></a-button>
</a-col> </a-col>
@ -49,78 +37,32 @@
:visible="add.show" :visible="add.show"
@ok="saveSetting" @ok="saveSetting"
@cancel="newSwiperClose" @cancel="newSwiperClose"
width="900px" width="600px"
> >
<a-row> <a-row>
<a-col :span="9"> <div style="color: #00000073; padding-bottom: 10px">
<div style="color: #00000073; padding-bottom: 10px"> 上传图片尺寸: 750*300
上传图片尺寸: 750*300 </div>
</div> <commonUpload
<commonUpload :fileList="fileList"
:fileList="fileList" @handleChange="handleChange"
@handleChange="handleChange" ></commonUpload>
></commonUpload> <div class="new-swiper">
</a-col> <a-button
<a-col :span="15"> style="width: 100px; margin-bottom: 10px"
<a-descriptions layout="vertical" :column="1"> @click="table.show = true"
<a-descriptions-item label="链接设置"> >选择商品</a-button
<a-input-group compact> >
<a-select appSku编码<a-input
style="width: 120px" disabled
v-model="form.type" placeholder="请选择商品"
placeholder="请选择类型" v-model="form.appSkuId"
@change="changeType" style="width: 90%"
> ></a-input>
<a-select-option :value="1"> 自定义链接 </a-select-option> </div>
<a-select-option :value="2"> 商城 </a-select-option>
<a-select-option :value="3"> 资讯 </a-select-option>
<a-select-option :value="4"> 公告 </a-select-option>
<a-select-option :value="5"> 活动 </a-select-option>
</a-select>
<a-input
v-if="form.type === 1"
style="width: 200px; background: #0000000f"
placeholder="请输入链接"
v-model="form.customizeUrl"
></a-input>
<a-button
v-else-if="form.type !== 1 && form.customizeUrl === ''"
style="width: 100px; background: #0000000f"
@click="table.show = true"
>请选择链接
</a-button>
<a-button
style="width: 70%; background: #0000000f; overflow: hidden"
@click="table.show = true"
v-else
>{{ form.customizeUrl }}</a-button
>
</a-input-group>
</a-descriptions-item>
<a-descriptions-item label="是否显示在用户端">
<a-switch
checked-children="开"
un-checked-children="关"
v-model="form.isShow"
></a-switch>
</a-descriptions-item>
<a-descriptions-item label="显示权重">
<a-input
type="number"
v-model.number="form.showWeights"
></a-input>
</a-descriptions-item>
</a-descriptions>
</a-col>
</a-row> </a-row>
</a-modal> </a-modal>
<chooseTable :show="table.show" @submit="submit" @close="close" />
<chooseTable
:show="table.show"
:type="form.type"
@submit="submit"
@close="close"
/>
</div> </div>
</template> </template>
@ -131,7 +73,7 @@ import {
swiperInsert, swiperInsert,
swiperDel, swiperDel,
swiperUpdate, swiperUpdate,
} from "@/api/operation/swiper"; } from "@/api/shop/swiper";
import chooseTable from "./depend/table.vue"; import chooseTable from "./depend/table.vue";
export default { export default {
components: { components: {
@ -144,6 +86,7 @@ export default {
}, },
fileList: [], fileList: [],
cardList: [], cardList: [],
Listeners:[],
add: { add: {
show: false, show: false,
title: "添加轮播图", title: "添加轮播图",
@ -157,7 +100,7 @@ export default {
methods: { methods: {
async getData() { async getData() {
let res = await swiperList(); let res = await swiperList();
this.cardList = res.data; this.Listeners = res.data
}, },
// //
newSwiper() { newSwiper() {
@ -172,13 +115,8 @@ export default {
show: true, show: true,
title: "修改轮播图", title: "修改轮播图",
}; };
console.log(data); this.form = data;
this.form.id = data.id; this.form.imgUrls = [];
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;
if (data.imgList.length > 0) { if (data.imgList.length > 0) {
// //
this.form.imgUrls.push(data.imgList[0].url); this.form.imgUrls.push(data.imgList[0].url);
@ -194,6 +132,7 @@ export default {
file.push(obj); file.push(obj);
} }
this.fileList = file; this.fileList = file;
// console.log(this.fileList);
} }
}, },
newSwiperClose() { newSwiperClose() {
@ -202,21 +141,17 @@ export default {
title: "添加轮播图", title: "添加轮播图",
}; };
this.fileList = []; this.fileList = [];
this.form.imgUrls = [];
this.form = { this.form = {
id: undefined, id: undefined,
type: undefined, appSkuId: "",
showWeights: 0,
customizeUrl: "",
isShow: false,
associationId: undefined,
imgUrls: [], imgUrls: [],
}; };
}, },
// //
submit(data, customizeUrl) { submit(id, sku) {
this.form.customizeUrl = customizeUrl; // console.log(id);
this.form.associationId = data[0]; // console.log(sku);
this.form.appSkuId = sku;
this.close(); this.close();
}, },
// //
@ -245,16 +180,13 @@ export default {
close() { close() {
this.table.show = false; this.table.show = false;
}, },
changeType() {
this.form.customizeUrl = "";
},
// //
async del(id) { async del(id) {
this.$confirm({ this.$confirm({
title: "是否删除", title: "是否删除",
icon: "delete", icon: "delete",
onOk: async () => { onOk: async () => {
swiperDel({ homepageCarouselId: id }).then((res) => { swiperDel({ rotationId: id }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.getData(); this.getData();
@ -267,7 +199,7 @@ export default {
}, },
// //
handleChange(data) { handleChange(data) {
console.log(data); // console.log(data);
this.fileList = data; this.fileList = data;
// //
if (this.fileList.length === 0) { if (this.fileList.length === 0) {
@ -277,6 +209,15 @@ export default {
} }
}, },
}, },
watch:{
Listeners:{
handler(val){
console.log(val);
this.cardList = val
},
deep: true
}
}
}; };
</script> </script>
@ -304,4 +245,9 @@ export default {
cursor: pointer; cursor: pointer;
font-size: 20px; font-size: 20px;
} }
.new-swiper {
display: flex;
flex-direction: column;
justify-content: center;
}
</style> </style>

Loading…
Cancel
Save