新增:优惠券
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
VITE_APP_NAME=后台管理(开发环境)
|
VITE_APP_NAME=后台管理(开发环境)
|
||||||
#VITE_API_URL=http://127.0.0.1:9200/api
|
VITE_API_URL=http://127.0.0.1:9200/api
|
||||||
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page">
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
<div class="ele-body">
|
|
||||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
<ele-pro-table
|
<ele-pro-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
row-key="shopCouponId"
|
row-key="id"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:datasource="datasource"
|
:datasource="datasource"
|
||||||
:customRow="customRow"
|
:customRow="customRow"
|
||||||
@@ -46,8 +45,7 @@
|
|||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<ShopCouponEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<ShopCouponEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
</div>
|
</a-page-header>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -61,6 +59,7 @@
|
|||||||
ColumnItem
|
ColumnItem
|
||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
|
import {getPageTitle} from '@/utils/common';
|
||||||
import ShopCouponEdit from './components/shopCouponEdit.vue';
|
import ShopCouponEdit from './components/shopCouponEdit.vue';
|
||||||
import { pageShopCoupon, removeShopCoupon, removeBatchShopCoupon } from '@/api/shop/shopCoupon';
|
import { pageShopCoupon, removeShopCoupon, removeBatchShopCoupon } from '@/api/shop/shopCoupon';
|
||||||
import type { ShopCoupon, ShopCouponParam } from '@/api/shop/shopCoupon/model';
|
import type { ShopCoupon, ShopCouponParam } from '@/api/shop/shopCoupon/model';
|
||||||
@@ -113,14 +112,14 @@
|
|||||||
key: 'name',
|
key: 'name',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// title: '优惠券描述',
|
||||||
|
// dataIndex: 'description',
|
||||||
|
// key: 'description',
|
||||||
|
// align: 'center',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
title: '优惠券描述',
|
title: '优惠券类型',
|
||||||
dataIndex: 'description',
|
|
||||||
key: 'description',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '优惠券类型(10满减券 20折扣券 30免费劵)',
|
|
||||||
dataIndex: 'type',
|
dataIndex: 'type',
|
||||||
key: 'type',
|
key: 'type',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -132,7 +131,7 @@
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '折扣券-折扣率(0-100)',
|
title: '折扣率(0-100)',
|
||||||
dataIndex: 'discount',
|
dataIndex: 'discount',
|
||||||
key: 'discount',
|
key: 'discount',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -143,18 +142,6 @@
|
|||||||
key: 'minPrice',
|
key: 'minPrice',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '到期类型(10领取后生效 20固定时间)',
|
|
||||||
dataIndex: 'expireType',
|
|
||||||
key: 'expireType',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '领取后生效-有效天数',
|
|
||||||
dataIndex: 'expireDay',
|
|
||||||
key: 'expireDay',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '有效期开始时间',
|
title: '有效期开始时间',
|
||||||
dataIndex: 'startTime',
|
dataIndex: 'startTime',
|
||||||
@@ -168,62 +155,11 @@
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '适用范围(10全部商品 20指定商品 30指定分类)',
|
title: '是否过期',
|
||||||
dataIndex: 'applyRange',
|
|
||||||
key: 'applyRange',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '适用范围配置(json格式)',
|
|
||||||
dataIndex: 'applyRangeConfig',
|
|
||||||
key: 'applyRangeConfig',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '是否过期(0未过期 1已过期)',
|
|
||||||
dataIndex: 'isExpire',
|
dataIndex: 'isExpire',
|
||||||
key: 'isExpire',
|
key: 'isExpire',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '排序(数字越小越靠前)',
|
|
||||||
dataIndex: 'sortNumber',
|
|
||||||
key: 'sortNumber',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '状态, 0正常, 1禁用',
|
|
||||||
dataIndex: 'status',
|
|
||||||
key: 'status',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '是否删除, 0否, 1是',
|
|
||||||
dataIndex: 'deleted',
|
|
||||||
key: 'deleted',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '创建用户ID',
|
|
||||||
dataIndex: 'userId',
|
|
||||||
key: 'userId',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '创建时间',
|
|
||||||
dataIndex: 'createTime',
|
|
||||||
key: 'createTime',
|
|
||||||
align: 'center',
|
|
||||||
sorter: true,
|
|
||||||
ellipsis: true,
|
|
||||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '修改时间',
|
|
||||||
dataIndex: 'updateTime',
|
|
||||||
key: 'updateTime',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '发放总数量(-1表示无限制)',
|
title: '发放总数量(-1表示无限制)',
|
||||||
dataIndex: 'totalCount',
|
dataIndex: 'totalCount',
|
||||||
@@ -248,6 +184,33 @@
|
|||||||
key: 'enabled',
|
key: 'enabled',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '创建用户ID',
|
||||||
|
dataIndex: 'userId',
|
||||||
|
key: 'userId',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '排序',
|
||||||
|
dataIndex: 'sortNumber',
|
||||||
|
key: 'sortNumber',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
key: 'status',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
align: 'center',
|
||||||
|
sorter: true,
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
@@ -278,7 +241,7 @@
|
|||||||
/* 删除单个 */
|
/* 删除单个 */
|
||||||
const remove = (row: ShopCoupon) => {
|
const remove = (row: ShopCoupon) => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
removeShopCoupon(row.shopCouponId)
|
removeShopCoupon(row.id)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page">
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
<div class="ele-body">
|
|
||||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
<ele-pro-table
|
<ele-pro-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
@@ -46,8 +45,7 @@
|
|||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<ShopUserCouponEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<ShopUserCouponEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
</div>
|
</a-page-header>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
|||||||
Reference in New Issue
Block a user