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),
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",

@ -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>
<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>
<script>
import { cateList, cateInfo,cateShow } from "@/api/shop/goods/cate.js";
import { columns, pagination } from "./depend/config";
export default {
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>
<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 = {
current: 1,
total: 0,
pageSize: 10,
pageSize: 5,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,

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

@ -56,7 +56,7 @@
<script>
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";
export default {
components: {

@ -13,7 +13,7 @@
{{infoData.tradeStatus|tradeStatus}}
</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 :span="12" style="margin-top:20px">
<a-steps :current="1" style="">
@ -51,7 +51,7 @@
{{infoData.receiverTel}}
</a-descriptions-item>
<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>
</span>
@ -110,74 +110,14 @@ import { detailColumns } from './config'
export default {
data(){
return{
infoData:{
"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":'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
},
],
infoData:{},
skuList:[],
detailColumns
}
},
mounted() {
if(this.$route.params.id){
// this.getInfo(this.$route.params.id)
this.getInfo(this.$route.params.id)
}
},
filters: {

@ -1,77 +1,150 @@
<template>
<div>
<div class="cardTitle">订单列表</div>
<div class="search-box">
<a-row>
<a-col :span="20">
<a-space size="large">
<a-input style="width: 200px" v-model="searchForm.code" placeholder="请输入订单号" />
<a-input style="width: 200px" v-model="searchForm.jcookCode" placeholder="请输入jcook订单号" />
<a-select style="width: 200px" v-model="searchForm.tradeStatus" placeholder="请选择交易状态" ></a-select>
<a-button type="primary" @click='getData'> </a-button>
<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>
<div>
<div class="cardTitle">订单列表</div>
<div class="search-box">
<a-row>
<a-col :span="20">
<a-space size="large">
<a-input
style="width: 200px"
v-model="searchForm.code"
placeholder="请输入订单号"
/>
<a-input
style="width: 200px"
v-model="searchForm.jcookCode"
placeholder="请输入jcook订单号"
/>
<a-select
style="width: 200px"
v-model="searchForm.tradeStatus"
placeholder="请选择交易状态"
></a-select>
<a-button type="primary" @click="getData"> </a-button>
<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="">
</template> -->
<a-descriptions-item label="订单状态">
{{record.tradeStatus | tradeStatus}}
</a-descriptions-item>
<a-descriptions-item label="支付人">
{{record.payName + record.payTel}}
</a-descriptions-item>
<a-descriptions-item label="付款金额">
{{record.payPrice}}
</a-descriptions-item>
<a-descriptions-item label="运费">
{{record.freightFee}}
</a-descriptions-item>
<a-descriptions-item label="收货人">
{{record.receiverName + record.receiverTel}}
</a-descriptions-item>
<a-descriptions-item label="地址">
{{record.locationName + record.addressDetail}}
</a-descriptions-item>
<a-descriptions-item label="备注">
{{record.remake||'无'}}
</a-descriptions-item>
<a-descriptions-item label="创建人">
{{record.createName}}
</a-descriptions-item>
<a-descriptions-item label="创建时间">
{{record.createDate}}
</a-descriptions-item>
</a-descriptions>
</div>
<span slot="action" slot-scope="text, record">
<a-space>
<a @click='detail(record)'>查看详情</a>
<a @click='cancelOrder(record)'>取消订单</a>
</a-space>
</span>
</a-table>
</div>
<a-descriptions-item label="订单状态">
{{ record.tradeStatus | tradeStatus }}
</a-descriptions-item>
<a-descriptions-item label="支付人">
{{ record.payName + record.payTel }}
</a-descriptions-item>
<a-descriptions-item label="付款金额">
{{ record.payPrice }}
</a-descriptions-item>
<a-descriptions-item label="运费">
{{ record.freightFee }}
</a-descriptions-item>
<a-descriptions-item label="收货人">
{{ record.receiverName + record.receiverTel }}
</a-descriptions-item>
<a-descriptions-item label="地址">
{{ record.locationName + record.addressDetail }}
</a-descriptions-item>
<a-descriptions-item label="备注">
{{ record.remake || "无" }}
</a-descriptions-item>
<a-descriptions-item label="创建人">
{{ record.createName }}
</a-descriptions-item>
<a-descriptions-item label="创建时间">
{{ record.createDate }}
</a-descriptions-item>
</a-descriptions>
</div>
<span slot="action" slot-scope="text, record">
<a-space>
<a @click="detail(record)"></a>
<a @click="cancelOrder(record.id)"></a>
</a-space>
</span>
</a-table>
<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>
<script>
import { orderList, shopOrderCancel, orderInfo } from '@/api/shop/order'
import { columns,pagination,searchForm } from './depend/config'
import { orderList, shopOrderCancel, orderInfo } from "@/api/shop/order";
import { columns, pagination, searchForm } from "./depend/config";
export default {
data() {
return {
tableData:[],
tableData: [],
modal: {
show: false,
},
columns,
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: {
@ -81,117 +154,80 @@ export default {
// 2.,3.退4.,5.,
// 6.,7.8.9.10.,11.)
case 0:
return '交易创建并等待买家付款'
return "交易创建并等待买家付款";
case 1:
return '交易关闭'
return "交易关闭";
case 2:
return '待发货'
return "待发货";
case 3:
return '交易结束'
return "交易结束";
case 4:
return '待收货'
return "待收货";
case 5:
return '订单完成'
return "订单完成";
case 6:
return '申请取消'
return "申请取消";
case 7:
return '申请拒收'
return "申请拒收";
case 8:
return '取消订单失败'
return "取消订单失败";
case 9:
return '取消订单成功'
return "取消订单成功";
case 10:
return '发生拆单'
return "发生拆单";
case 11:
return '售后换新'
return "售后换新";
default:
break;
}
}
},
},
mounted() {
// 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'
},
]
this.getData();
},
methods: {
async getData(){
const res = await orderList({
async getData() {
const res = await orderList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm
})
this.tableData = res.data.rows
this.pagination.total = res.data.total
...this.searchForm,
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
},
reset(){
reset() {
this.searchForm = {
code: "",
jcookCode: '',
tradeStatus:undefined
jcookCode: "",
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){},
detail(data){
this.$router.push({name:'OrderDetail',params:{id:data.id}})
}
}
handleCancel() {
this.cancelForm = {
orderId: undefined,
cancelReasonCode: undefined,
}
this.modal.show = false;
},
detail(data) {
this.$router.push({ name: "OrderDetail", params: { id: data.id } });
},
},
};
</script>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>

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

@ -1,7 +1,7 @@
<template>
<div>
<a-modal
width="90%"
width="80%"
title="选择链接"
:visible="show"
@ok="handleOk"
@ -9,7 +9,7 @@
>
<div>
<a-table
:columns="columns[typeMean]"
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 1400 }"
@ -33,25 +33,32 @@
<script>
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,
},
},
};
</script>

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

@ -7,13 +7,14 @@
>
<a-card
hoverable
style="width: 70%; margin-top: 10px"
style="width: 600px; margin-top: 10px"
v-for="item in cardList"
:key="item.id"
>
<span class="card-close" @click="del(item.id)">×</span>
<a-row>
<a-col :span="9">
<a-col :span="19">
appSku编码{{ item.appSkuId }}
<div style="color: #00000073; padding-bottom: 10px">
上传图片尺寸: 750*300
</div>
@ -25,19 +26,6 @@
/>
<span v-else></span>
</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-button class="add-btn" @click="edit(item)"></a-button>
</a-col>
@ -49,78 +37,32 @@
:visible="add.show"
@ok="saveSetting"
@cancel="newSwiperClose"
width="900px"
width="600px"
>
<a-row>
<a-col :span="9">
<div style="color: #00000073; padding-bottom: 10px">
上传图片尺寸: 750*300
</div>
<commonUpload
:fileList="fileList"
@handleChange="handleChange"
></commonUpload>
</a-col>
<a-col :span="15">
<a-descriptions layout="vertical" :column="1">
<a-descriptions-item label="链接设置">
<a-input-group compact>
<a-select
style="width: 120px"
v-model="form.type"
placeholder="请选择类型"
@change="changeType"
>
<a-select-option :value="1"> 自定义链接 </a-select-option>
<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>
<div style="color: #00000073; padding-bottom: 10px">
上传图片尺寸: 750*300
</div>
<commonUpload
:fileList="fileList"
@handleChange="handleChange"
></commonUpload>
<div class="new-swiper">
<a-button
style="width: 100px; margin-bottom: 10px"
@click="table.show = true"
>选择商品</a-button
>
appSku编码<a-input
disabled
placeholder="请选择商品"
v-model="form.appSkuId"
style="width: 90%"
></a-input>
</div>
</a-row>
</a-modal>
<chooseTable
:show="table.show"
:type="form.type"
@submit="submit"
@close="close"
/>
<chooseTable :show="table.show" @submit="submit" @close="close" />
</div>
</template>
@ -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
}
}
};
</script>
@ -304,4 +245,9 @@ export default {
cursor: pointer;
font-size: 20px;
}
.new-swiper {
display: flex;
flex-direction: column;
justify-content: center;
}
</style>

Loading…
Cancel
Save