feat: 修改单规格添加时候的skuid取值
This commit is contained in:
@@ -384,6 +384,16 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
hidden: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "points",
|
||||
component: () => import("@/views/application/marketing/points/index.vue"),
|
||||
name: "points",
|
||||
meta: {
|
||||
title: "积分",
|
||||
affix: false,
|
||||
hidden: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "ad",
|
||||
component: () => import("@/views/application/list/ad/index.vue"),
|
||||
|
||||
@@ -28,7 +28,7 @@ const list = ref([
|
||||
{ name: "优惠券", icon: card, path: "coupon" },
|
||||
{ name: "霸王餐", icon: charge, path: "bwc" },
|
||||
{ name: "邀请裂变", icon: invite, path: "" },
|
||||
{ name: "积分锁客", icon: score, path: "" },
|
||||
{ name: "积分锁客", icon: score, path: "points" },
|
||||
]);
|
||||
</script>
|
||||
|
||||
|
||||
68
src/views/application/marketing/points/index.ts
Normal file
68
src/views/application/marketing/points/index.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import request from "@/utils/request";
|
||||
const baseURL = "/account/admin/points/basic-setting";
|
||||
// 积分-配置
|
||||
const AuthAPI = {
|
||||
// 积分基本设置详情
|
||||
getBasicSetting(params: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}`,
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
},
|
||||
// 积分保存
|
||||
BasicSettingadd(data: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}`,
|
||||
method: "post",
|
||||
data: { ...data },
|
||||
});
|
||||
},
|
||||
/** 分页*/
|
||||
getPage(params: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/page`,
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
},
|
||||
// 新增
|
||||
add(data: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}`,
|
||||
method: "post",
|
||||
data: { ...data },
|
||||
});
|
||||
},
|
||||
// 详情
|
||||
getinfo(id: number) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/${id}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
// 编辑
|
||||
update(data: Object) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}`,
|
||||
method: "put",
|
||||
data,
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
deleteByIds(id: number | String) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/${id}`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
export interface Responseres {
|
||||
code?: number | null;
|
||||
data?: any;
|
||||
msg?: null | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export default AuthAPI;
|
||||
26
src/views/application/marketing/points/index.vue
Normal file
26
src/views/application/marketing/points/index.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div style="padding: 15px;">
|
||||
<el-tabs type="border-card" v-model="datas.activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="基本设置" name="BasicSettings">
|
||||
<BasicSettings v-if="datas.activeName == 'BasicSettings'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="商品设置" name="ProductSettings">商品设置</el-tab-pane>
|
||||
<el-tab-pane label="兑换记录" name="Exchangerecords">
|
||||
<Exchangerecords v-if="datas.activeName == 'Exchangerecords'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="会员积分" name="MEMBERPOINTS">会员积分</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import BasicSettings from './pointsconfig/BasicSettings.vue'
|
||||
import Exchangerecords from './pointsconfig/exchangerecords.vue'
|
||||
|
||||
let datas = reactive({
|
||||
activeName: "BasicSettings",
|
||||
|
||||
})
|
||||
function handleClick(tab) {
|
||||
datas.activeName = tab.props.name;
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,241 @@
|
||||
<template>
|
||||
<!-- 基本设置 -->
|
||||
<el-form :model="Elform" label-width="150px">
|
||||
<el-form-item label="是否消费赠送积分">
|
||||
<el-switch v-model="Elform.enableRewards" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="适用群体">
|
||||
<el-radio-group v-model="Elform.rewardsGroup">
|
||||
<el-radio label="全部" value="all" />
|
||||
<el-radio label="仅会员" value="vip" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="消费赠送积分">
|
||||
<el-col :span="7">
|
||||
<el-input v-model="Elform.consumeAmount" type="number" placeholder="">
|
||||
<template #prepend>每消费</template>
|
||||
<template #append>元赠送1积分</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="开启下单积分抵扣">
|
||||
<el-switch v-model="Elform.enableDeduction" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="适用群体">
|
||||
<el-radio-group v-model="Elform.deductionGroup">
|
||||
<el-radio label="全部" value="all" />
|
||||
<el-radio label="仅会员" value="vip" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="下单实付抵扣门槛">
|
||||
<el-col :span="3">
|
||||
<el-input v-model="Elform.minPaymentAmount" type="number" placeholder="">
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="下单最高抵扣比例">
|
||||
<el-col :span="3">
|
||||
<el-input v-model="Elform.maxDeductionRatio" type="number" placeholder="">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="下单抵扣积分比例">
|
||||
<el-col :span="7">
|
||||
<el-input v-model="Elform.equivalentPoints" type="number" placeholder="">
|
||||
<template #prepend>1元等于</template>
|
||||
<template #append>积分</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="开启积分商城">
|
||||
<el-switch v-model="Elform.enablePointsMall" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示样式">
|
||||
<div class="style_wrap">
|
||||
<div class="item style1" :class="{ active: Elform.browseMode == 'list' }" @click="Elform.browseMode = 'list'">
|
||||
<div class="row">
|
||||
<div class="cover"></div>
|
||||
<div class="info">
|
||||
<div class="line"></div>
|
||||
<div class="line"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="cover"></div>
|
||||
<div class="info">
|
||||
<div class="line"></div>
|
||||
<div class="line"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item style2" :class="{ active: Elform.browseMode == 'grid' }" @click="Elform.browseMode = 'grid'">
|
||||
<div class="row">
|
||||
<div class="cover"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="cover"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="cover"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="cover"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">确定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from 'vue'
|
||||
import API from '../index'
|
||||
// do not use same name with ref
|
||||
const Elform = reactive({
|
||||
"enableRewards": 1,
|
||||
"rewardsGroup": "all",
|
||||
"consumeAmount": 0,
|
||||
"enableDeduction": 1,
|
||||
"deductionGroup": 'all',
|
||||
"minPaymentAmount": 0,
|
||||
"maxDeductionRatio": 0,
|
||||
"equivalentPoints": 0,
|
||||
"enablePointsMall": 1,
|
||||
"browseMode": "list",
|
||||
})
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
async function getList() {
|
||||
const res = await API.getBasicSetting({})
|
||||
for (const key in Elform) {
|
||||
Elform[key] = res[key]
|
||||
}
|
||||
}
|
||||
async function onSubmit() {
|
||||
const res = await API.BasicSettingadd(Elform)
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '成功',
|
||||
type: 'success',
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.style_wrap {
|
||||
display: flex;
|
||||
width: 350px;
|
||||
gap: 50px;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
$color: #3F9EFF;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: $color;
|
||||
}
|
||||
|
||||
.cover {
|
||||
background-color: $color;
|
||||
}
|
||||
|
||||
.line {
|
||||
background-color: #D9D9D9;
|
||||
}
|
||||
|
||||
&.style1 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
|
||||
.row {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
|
||||
.cover {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding-left: 10px;
|
||||
|
||||
.line {
|
||||
flex: 1;
|
||||
|
||||
&:nth-child(1) {
|
||||
width: 80%;
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
&:nth-child(3) {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.style2 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: repeat(2, 1fr);
|
||||
grid-column-gap: 10px;
|
||||
grid-row-gap: 10px;
|
||||
|
||||
.row:nth-child(1) {
|
||||
grid-area: 1 / 1 / 2 / 2;
|
||||
}
|
||||
|
||||
.row:nth-child(2) {
|
||||
grid-area: 1 / 2 / 2 / 3;
|
||||
}
|
||||
|
||||
.row:nth-child(3) {
|
||||
grid-area: 2 / 1 / 3 / 2;
|
||||
}
|
||||
|
||||
.row:nth-child(4) {
|
||||
grid-area: 2 / 2 / 3 / 3;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.cover {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.line {
|
||||
height: 4px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<!-- 兑换记录模块 -->
|
||||
<div style="padding: 15px;">
|
||||
<!-- 搜索 -->
|
||||
<Search></Search>
|
||||
<!-- 数据统计 -->
|
||||
<DataStatistics></DataStatistics>
|
||||
<!-- 表格 -->
|
||||
<Content></Content>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import Search from './exchangerecordsconfig/Search.vue'
|
||||
import DataStatistics from './exchangerecordsconfig/DataStatistics.vue'
|
||||
import Content from './exchangerecordsconfig/Content.vue'
|
||||
</script>
|
||||
@@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<div class="Table">
|
||||
<!-- 表格 -->
|
||||
<Table :list="datas.tableData" @handleDelete="handleDelete" @handleEdit="handleEdit"></Table>
|
||||
<!-- 分页 -->
|
||||
<Paging :pagingConfig="datas.pagingConfig" @sizeChange="sizeChange" @currentChange="currentChange"></Paging>
|
||||
<!-- 其他模板 -->
|
||||
<!-- 新增/编辑 -->
|
||||
<myDialog ref="myDialogRef" :title="datas.title" @confirm="confirm" width="30%">
|
||||
<el-form ref="ruleFormRef" :rules="datas.rules" :model="datas.DialogForm" label-width="80px">
|
||||
<el-form-item label="供应商" prop="name">
|
||||
<el-input v-model="datas.DialogForm.name" placeholder="请输入供应商名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话">
|
||||
<el-input v-model="datas.DialogForm.telephone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地址">
|
||||
<el-input v-model="datas.DialogForm.address" placeholder="请输入地址" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="datas.DialogForm.remark" placeholder="请输入备注" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</myDialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import Table from './component/Table.vue'
|
||||
import Paging from './component/Paging.vue'
|
||||
import myDialog from '@/components/mycomponents/myDialog.vue'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import API from './api'
|
||||
|
||||
const datas = reactive({
|
||||
tableData: [], // 表格数据
|
||||
title: '新增数据',
|
||||
pagingConfig: {
|
||||
total: 0, // 总数
|
||||
pageSize: 10, // 每页数据数量
|
||||
pageNumber: 1, // 当前页码
|
||||
},
|
||||
DialogForm: { // 弹窗表单数据
|
||||
name: "",
|
||||
telephone: "",
|
||||
address: "",
|
||||
remark: ""
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入供应商名称', trigger: 'blur' },
|
||||
{ min: 3, max: 5, message: 'Length should be 3 to 5', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
})
|
||||
const myDialogRef = ref(null)
|
||||
const ruleFormRef = ref(null)
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
eventBus.on('search', (res) => {
|
||||
getList(res)
|
||||
})
|
||||
async function getList(data = {}) {
|
||||
const res = await API.getPage({ page: datas.pagingConfig.pageNumber, size: datas.pagingConfig.pageSize, ...data })
|
||||
datas.tableData = res.records
|
||||
datas.pagingConfig.total = res.totalRow
|
||||
datas.pagingConfig.pageSize = res.pageSize
|
||||
datas.pagingConfig.pageNumber = res.pageNumber
|
||||
}
|
||||
|
||||
async function handleEdit(row) {
|
||||
datas.title = '编辑数据'
|
||||
const res = await API.getinfo(row.id)
|
||||
datas.DialogForm = res
|
||||
myDialogRef.value.open()
|
||||
}
|
||||
async function confirm() {
|
||||
ruleFormRef.value.validate(async valid => {
|
||||
if (valid) {
|
||||
let res = null
|
||||
if (datas.title == '新增数据') {
|
||||
res = await API.add(datas.DialogForm)
|
||||
} else {
|
||||
res = await API.update(datas.DialogForm)
|
||||
}
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '成功',
|
||||
type: 'success',
|
||||
})
|
||||
rest()
|
||||
getList()
|
||||
myDialogRef.value.close()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 重置
|
||||
function rest() {
|
||||
datas.DialogForm = { sort: "1" }
|
||||
}
|
||||
async function handleDelete(id) {
|
||||
ElMessageBox.confirm("是否删除数据项?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(
|
||||
async () => {
|
||||
let res = await API.deleteByIds(id)
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
})
|
||||
getList()
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
// 分页
|
||||
function sizeChange(val) {
|
||||
datas.pagingConfig.pageSize = val
|
||||
getList()
|
||||
}
|
||||
function currentChange(val) {
|
||||
datas.pagingConfig.pageNumber = val
|
||||
getList()
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.Table {
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #e4e7ed;
|
||||
margin-top: 20px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<div class="DataStatistics">
|
||||
<div style="width: 200px;">
|
||||
<el-icon class="iconStyle">
|
||||
<Dish />
|
||||
</el-icon>
|
||||
<span>总订单数</span>
|
||||
<span>{{ datas.totalRow }}</span>
|
||||
</div>
|
||||
<div style="width: 200px;">
|
||||
<el-icon class="iconStyle">
|
||||
<CreditCard />
|
||||
</el-icon>
|
||||
<span>已支付金额</span>
|
||||
<span>{{ datas.totalRow }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import API from "./api";
|
||||
import { onMounted, reactive } from "vue";
|
||||
onMounted(() => {
|
||||
getPage();
|
||||
})
|
||||
let datas = reactive({
|
||||
totalRow: 0
|
||||
})
|
||||
async function getPage() {
|
||||
let res = await API.gettotal();
|
||||
datas.totalRow = res.totalRow
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
.DataStatistics {
|
||||
border: 1px solid #e4e7ed;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
margin-top: 20px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
|
||||
>div {
|
||||
height: 80px;
|
||||
background-color: #f4f9ff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
|
||||
padding: 20px;
|
||||
|
||||
.iconStyle {
|
||||
background-color: #d4e9fe;
|
||||
border-radius: 50%;
|
||||
padding: 6px;
|
||||
font-size: 36px;
|
||||
color: #3f9eff;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div class="Search">
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item label="订单名称">
|
||||
<el-input v-model="formInline.user" placeholder="请输入订单编号/核销码" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="领取方式">
|
||||
<el-select v-model="formInline.region" placeholder="请选择领取方式" clearable>
|
||||
<el-option label="自取" value="shanghai" />
|
||||
<el-option label="邮寄" value="beijing" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="formInline.region" placeholder="请选择状态" clearable>
|
||||
<el-option label="待支付" value="shanghai" />
|
||||
<el-option label="待自取" value="shanghai" />
|
||||
<el-option label="已完成" value="shanghai" />
|
||||
<el-option label="已取消" value="shanghai" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期">
|
||||
<el-date-picker v-model="formInline.value1" type="daterange" range-separator="-" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="onSubmit">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="reset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import eventBus from '@/utils/eventBus'
|
||||
const formInline = reactive({
|
||||
user: '',
|
||||
region: '',
|
||||
date: '',
|
||||
value1: ""
|
||||
})
|
||||
const onSubmit = () => {
|
||||
eventBus.emit('search', formInline)
|
||||
}
|
||||
const reset = () => {
|
||||
formInline.user = ''
|
||||
formInline.region = ''
|
||||
formInline.date = ''
|
||||
formInline.value1 = ''
|
||||
eventBus.emit('search', formInline)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.Search {
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.demo-form-inline .el-input {
|
||||
--el-input-width: 220px;
|
||||
}
|
||||
|
||||
.demo-form-inline .el-select {
|
||||
--el-select-width: 220px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,66 @@
|
||||
import request from "@/utils/request";
|
||||
const baseURL = "/account/admin/points/exchange-record";
|
||||
// 兑换记录-配置
|
||||
const AuthAPI = {
|
||||
// 列表
|
||||
getList(params: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/list`,
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
},
|
||||
/** 分页*/
|
||||
getPage(params: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/page`,
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
},
|
||||
// 新增
|
||||
add(data: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}`,
|
||||
method: "post",
|
||||
data: { ...data },
|
||||
});
|
||||
},
|
||||
// 详情
|
||||
getinfo(id: number) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/${id}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
// 编辑
|
||||
update(data: Object) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}`,
|
||||
method: "put",
|
||||
data,
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
deleteByIds(id: number | String) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/${id}`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
// 统计
|
||||
gettotal() {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/total`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
};
|
||||
export interface Responseres {
|
||||
code?: number | null;
|
||||
data?: any;
|
||||
msg?: null | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export default AuthAPI;
|
||||
@@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<div style="margin-top: 10px;">
|
||||
<el-pagination background :page-size="props.pagingConfig.pageSize" :page-sizes="[10, 20, 30, 40]"
|
||||
layout="prev,pager,next,jumper,total,sizes" v-model:current-page="props.pagingConfig.pageNumber"
|
||||
:total="props.pagingConfig.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
pagingConfig: {
|
||||
type: Object,
|
||||
default: () => { }
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['sizeChange', 'currentChange'])
|
||||
// 当前条改变
|
||||
function handleSizeChange(val) {
|
||||
emit('sizeChange', val)
|
||||
}
|
||||
// 当前页改变
|
||||
function handleCurrentChange(val) {
|
||||
emit('currentChange', val)
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<div style="margin-top: 10px;">
|
||||
<el-table :data="props.list" border style="width: 100%">
|
||||
<el-table-column prop="orderNo" align="center" label="订单编号" />
|
||||
<el-table-column prop="nickName" align="center" label="用户名">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;align-items: center;">
|
||||
|
||||
<el-image style="width: 40px; height: 40px" :src="scope.row.avatarUrl" fit="contain" />
|
||||
{{ scope.row.nickName }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pointsGoodsName" align="center" label="商品" />
|
||||
<el-table-column prop="name" align="center" label="使用积分" />
|
||||
<el-table-column prop="name" align="center" label="支付金额" />
|
||||
<el-table-column prop="name" align="center" label="支付方式" />
|
||||
<el-table-column prop="name" align="center" label="实际支付时间" />
|
||||
<el-table-column prop="name" align="center" label="下单时间" />
|
||||
<el-table-column prop="name" align="center" label="领取方式" />
|
||||
<el-table-column prop="name" align="center" label="状态" />
|
||||
<el-table-column prop="name" align="center" label="取消/退款" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button size="small" type="primary" link icon="Edit" @click="handleEdit(scope.row)">待核销</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const emit = defineEmits(['handleDelete', 'handleEdit'])
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
})
|
||||
|
||||
function handleEdit(row) {
|
||||
emit('handleEdit', row)
|
||||
}
|
||||
function handleDelete(index, row) {
|
||||
emit('handleDelete', row.id)
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -533,11 +533,13 @@ function selectShopRes(res: Array<any>) {
|
||||
item.proId = item.id
|
||||
item.proName = item.name
|
||||
item.price = item.lowPrice
|
||||
item.skuId = ''
|
||||
item.skuId = item.skuList[0].id
|
||||
item.skuName = ''
|
||||
item.number = 1
|
||||
// 单规格skuid添加
|
||||
return item
|
||||
})
|
||||
|
||||
if (ruleForm.groupType == '0') {
|
||||
let obj = {
|
||||
title: '',
|
||||
|
||||
Reference in New Issue
Block a user