feat: 积分模块完成
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<el-dialog v-model="dialogVisible" title="选择图片" width="50%">
|
||||
<el-container>
|
||||
<el-aside style="background-color: #fff;border-right: 1px solid #ccc;" width="150px">
|
||||
<el-button @click="addtype" type="">新增分类</el-button>
|
||||
<el-button @click="addtype">新增分类</el-button>
|
||||
<ul style="padding-left: 0;margin: 0;">
|
||||
<li style="cursor: pointer;width: 90%;margin: 10px 0 ;" v-for="item in options" :key="item.id"
|
||||
:class="[activedata == item.id ? 'activedata' : '']" @click="changeEvent(item.id)">
|
||||
@@ -32,15 +32,12 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<myDialog :title="title" width="20%" ref="myDialogRef" @Confirm="subitgood">
|
||||
<el-input v-model="typedata" placeholder="输入分类" />
|
||||
</myDialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { getcommonCategor, getcommonpicture, storeAddcategory, addImg, delcate } from "@/api/imagesPhp";
|
||||
import API from './addImgconfig/gallery'
|
||||
import API2 from './addImgconfig/picture'
|
||||
import myDialog from './myDialog.vue'
|
||||
@@ -104,14 +101,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
// uplocation() {
|
||||
// this.activedata = -1
|
||||
// this.page = 1
|
||||
// this.dataImages = []
|
||||
// // this.pageSize = 17
|
||||
// this.getList()
|
||||
// },
|
||||
|
||||
changeEvent(id) {
|
||||
this.page = 1
|
||||
this.pageSize = 18
|
||||
@@ -126,31 +115,6 @@ export default {
|
||||
this.dialogVisible = false
|
||||
this.$emit('successEvent', this.selectImage)
|
||||
},
|
||||
// 刷新列表数据
|
||||
async doSubmit() {
|
||||
this.showUpload = false;
|
||||
let arr = []
|
||||
if (this.files.length) {
|
||||
this.files.forEach(ele => {
|
||||
arr.push({
|
||||
url: ele.response.data[0],
|
||||
name: ele.name
|
||||
})
|
||||
})
|
||||
return
|
||||
const res = await addImg({
|
||||
category: this.value,
|
||||
store_id: localStorage.getItem("shopId"),
|
||||
url: arr
|
||||
})
|
||||
if (res.code == 1) {
|
||||
this.getType(this.value)
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
this.files = [];
|
||||
}
|
||||
},
|
||||
handleBeforeRemove(file, fileList) {
|
||||
let index = this.files.findIndex(ele => ele.name == file.name)
|
||||
this.files.splice(index, 1);
|
||||
|
||||
@@ -4,18 +4,23 @@
|
||||
<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="ProductSettings">
|
||||
<ProductSettings v-if="datas.activeName == '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-tab-pane label="会员积分" name="Memberpoints">
|
||||
<Memberpoints v-if="datas.activeName == 'Memberpoints'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import BasicSettings from './pointsconfig/BasicSettings.vue'
|
||||
import Exchangerecords from './pointsconfig/exchangerecords.vue'
|
||||
|
||||
import Memberpoints from './pointsconfig/Memberpoints.vue'
|
||||
import ProductSettings from './pointsconfig/ProductSettings.vue'
|
||||
let datas = reactive({
|
||||
activeName: "BasicSettings",
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<!-- 会员积分模块 -->
|
||||
<div style="padding: 15px;">
|
||||
<!-- 搜索 -->
|
||||
<Search></Search>
|
||||
<!-- 表格 -->
|
||||
<Content></Content>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import Search from './Memberpointsconfig/Search.vue'
|
||||
import Content from './Memberpointsconfig/Content.vue'
|
||||
</script>
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div class="Table">
|
||||
<!-- 表格 -->
|
||||
<Table :list="datas.tableData" @handleDelete="handleDelete" @handleEdit="handleEdit"></Table>
|
||||
<!-- 分页 -->
|
||||
<Paging :pagingConfig="datas.pagingConfig" @sizeChange="sizeChange" @currentChange="currentChange"></Paging>
|
||||
<!-- 其他模板 -->
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import Table from './component/Table.vue'
|
||||
import Paging from './component/Paging.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
|
||||
}
|
||||
function add() {
|
||||
rest()
|
||||
datas.title = '新增数据'
|
||||
myDialogRef.value.open()
|
||||
}
|
||||
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,54 @@
|
||||
<template>
|
||||
<div class="Search">
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item label="用户昵称">
|
||||
<el-input v-model="formInline.nickName" placeholder="请输入用户昵称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<el-input v-model="formInline.phone" placeholder="请输入手机号" clearable />
|
||||
</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({
|
||||
keywords: '',
|
||||
phone: '',
|
||||
})
|
||||
const onSubmit = () => {
|
||||
eventBus.emit('search', formInline)
|
||||
}
|
||||
const reset = () => {
|
||||
for (let key in formInline) {
|
||||
formInline[key] = ''
|
||||
}
|
||||
eventBus.emit('search', formInline)
|
||||
}
|
||||
function dateChange(d) {
|
||||
formInline.endDate = d[1]
|
||||
formInline.beginDate = d[0]
|
||||
}
|
||||
</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,60 @@
|
||||
import request from "@/utils/request";
|
||||
const baseURL = "/account/admin/points/member-points";
|
||||
// 会员积分-配置
|
||||
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",
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
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,44 @@
|
||||
<template>
|
||||
<div style="margin-top: 10px;">
|
||||
<el-table :data="props.list" border style="width: 100%">
|
||||
<el-table-column prop="userId" align="center" label="会员ID" />
|
||||
<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.headImg" fit="contain" />
|
||||
{{ scope.row.nickName }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phone" align="center" label="手机号码" />
|
||||
<el-table-column prop="accountPoints" align="center" label="账户积分" />
|
||||
<el-table-column prop="lastPointsChangeTime" align="center" label="积分变动时间" />
|
||||
<el-table-column prop="lastFloatPoints" 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>
|
||||
<el-button size="small" type="danger" link icon="Delete" style="color: #f89797;"
|
||||
@click="handleDelete(scope.$index, 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>
|
||||
@@ -0,0 +1,10 @@
|
||||
<template>
|
||||
<!-- 会员商品设置模块 -->
|
||||
<div style="padding: 15px;">
|
||||
<!-- 表格 -->
|
||||
<Content></Content>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import Content from './ProductSettingsconfig/Content.vue'
|
||||
</script>
|
||||
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<div class="Table">
|
||||
<!-- 按钮 -->
|
||||
<AddButton @add="add"></AddButton>
|
||||
<!-- 表格 -->
|
||||
<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="奖品类型">
|
||||
<el-radio-group v-model="datas.DialogForm.goodsCategory">
|
||||
<el-radio label="实物" value="physical" />
|
||||
<el-radio label="优惠劵" value="coupon" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品图片" required prop="goodsImageUrl">
|
||||
<div style="display: flex; flex-wrap: wrap">
|
||||
<div v-for="(item, index) in datas.DialogForm.goodsImageUrl" :key="index" style="position: relative"
|
||||
class="showStyle">
|
||||
<el-icon class="buttonstyle" @click="deleteEvent(item)">
|
||||
<DeleteFilled />
|
||||
</el-icon>
|
||||
<img style="width: 148px; height: 148px; margin-right: 6px" class="imgStyle" :src="item" alt="" />
|
||||
</div>
|
||||
<div class="upImgStyle" @click="addimgEvent">+</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="datas.DialogForm.goodsName" placeholder="请输入商品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所需积分">
|
||||
<el-col :span="10">
|
||||
<el-input v-model="datas.DialogForm.requiredPoints" type="number" placeholder="">
|
||||
<template #append>积分</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="额外价格">
|
||||
<el-col :span="10">
|
||||
<el-input v-model="datas.DialogForm.extraPrice" type="number" placeholder="">
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量">
|
||||
<el-input-number v-model="datas.DialogForm.quantity" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-input-number v-model="datas.DialogForm.sort" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否上架">
|
||||
<el-switch v-model="datas.DialogForm.status" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</myDialog>
|
||||
<!-- 选择图片 -->
|
||||
<AddImg ref="addImg" @successEvent="successEvent"></AddImg>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import AddButton from './component/AddButton.vue'
|
||||
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: { // 弹窗表单数据
|
||||
goodsCategory: 'physical',
|
||||
goodsName: '',
|
||||
requiredPoints: 0,
|
||||
extraPrice: 0,
|
||||
quantity: 1,
|
||||
sort: 1,
|
||||
status: 1,
|
||||
goodsImageUrl: []
|
||||
},
|
||||
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
|
||||
}
|
||||
function add() {
|
||||
if (datas.DialogForm.id) {
|
||||
rest()
|
||||
}
|
||||
datas.title = '新增数据'
|
||||
myDialogRef.value.open()
|
||||
}
|
||||
async function handleEdit(row) {
|
||||
datas.title = '编辑数据'
|
||||
const res = await API.getinfo(row.id)
|
||||
datas.DialogForm = res
|
||||
// 有图片
|
||||
datas.DialogForm.goodsImageUrl = res.goodsImageUrl.split(',')
|
||||
myDialogRef.value.open()
|
||||
}
|
||||
async function confirm() {
|
||||
ruleFormRef.value.validate(async valid => {
|
||||
if (valid) {
|
||||
let res = null
|
||||
if (datas.title == '新增数据') {
|
||||
// 图片处理
|
||||
datas.DialogForm.goodsImageUrl = datas.DialogForm.goodsImageUrl.join(',')
|
||||
res = await API.add(datas.DialogForm)
|
||||
} else {
|
||||
datas.DialogForm.goodsImageUrl = datas.DialogForm.goodsImageUrl.join(',')
|
||||
res = await API.update(datas.DialogForm)
|
||||
}
|
||||
if (res) {
|
||||
ElMessage({
|
||||
message: '成功',
|
||||
type: 'success',
|
||||
})
|
||||
rest()
|
||||
getList()
|
||||
myDialogRef.value.close()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 重置
|
||||
function rest() {
|
||||
datas.DialogForm = {
|
||||
goodsCategory: 'physical',
|
||||
goodsName: '',
|
||||
requiredPoints: 0,
|
||||
extraPrice: 0,
|
||||
quantity: 1,
|
||||
sort: 1,
|
||||
status: 1,
|
||||
goodsImageUrl: []
|
||||
}
|
||||
}
|
||||
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()
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
// 图片
|
||||
const addImg = ref(null)
|
||||
function addimgEvent() {
|
||||
(addImg.value)?.show()
|
||||
}
|
||||
function successEvent(d) {
|
||||
datas.DialogForm['goodsImageUrl'].push(d[0].url);
|
||||
}
|
||||
function deleteEvent(d) {
|
||||
let index = datas.DialogForm.goodsImageUrl.findIndex((ele) => ele == d);
|
||||
datas.DialogForm.goodsImageUrl.splice(index, 1);
|
||||
}
|
||||
// 分页
|
||||
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;
|
||||
}
|
||||
|
||||
// 图片库样式
|
||||
.upImgStyle {
|
||||
cursor: pointer;
|
||||
width: 148px;
|
||||
height: 148px;
|
||||
line-height: 148px;
|
||||
text-align: center;
|
||||
border: 1px dashed #ccc;
|
||||
border-radius: 1%;
|
||||
font-size: 30px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.buttonstyle {
|
||||
border-radius: 50%;
|
||||
color: #db1616;
|
||||
background-color: #fff;
|
||||
font-size: 20px;
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: -10px;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,60 @@
|
||||
import request from "@/utils/request";
|
||||
const baseURL = "/account/admin/points/goods-setting";
|
||||
// 商品设置-配置
|
||||
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",
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
export interface Responseres {
|
||||
code?: number | null;
|
||||
data?: any;
|
||||
msg?: null | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export default AuthAPI;
|
||||
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<el-button type="success" icon="Plus" @click="addEvent">新增</el-button>
|
||||
</template>
|
||||
<script setup>
|
||||
const emit = defineEmits(['add']);
|
||||
function addEvent() {
|
||||
emit('add');
|
||||
}
|
||||
</script>
|
||||
@@ -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,49 @@
|
||||
<template>
|
||||
<div style="margin-top: 10px;">
|
||||
<el-table :data="props.list" border style="width: 100%">
|
||||
<el-table-column prop="name" align="center" label="商品">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-image style="width: 40px; height: 40px" :src="scope.row.goodsImageUrl" fit="contain" />
|
||||
{{ scope.row.goodsName }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所需积分" align="center" prop="requiredPoints" />
|
||||
<el-table-column label="额外价格(元)" align="center" prop="extraPrice" />
|
||||
<el-table-column label="累计兑换次数" align="center" prop="totalExchangeCount" />
|
||||
<el-table-column label="库存" align="center" prop="quantity" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">{{ scope.row.status === 1 ? '上架' : '下架'
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button size="small" type="primary" link icon="Edit" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button size="small" type="danger" link icon="Delete" style="color: #f89797;"
|
||||
@click="handleDelete(scope.$index, 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>
|
||||
@@ -100,16 +100,16 @@ function rest() {
|
||||
datas.DialogForm = { sort: "1" }
|
||||
}
|
||||
async function handleDelete(id) {
|
||||
ElMessageBox.confirm("是否删除数据项?", "提示", {
|
||||
ElMessageBox.confirm("是否核销?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(
|
||||
async () => {
|
||||
let res = await API.deleteByIds(id)
|
||||
let res = await API.isCheckout(id)
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '删除成功',
|
||||
message: '成功',
|
||||
type: 'success',
|
||||
})
|
||||
getList()
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
<Dish />
|
||||
</el-icon>
|
||||
<span>总订单数</span>
|
||||
<span>{{ datas.totalRow }}</span>
|
||||
<span>{{ datas.count }}</span>
|
||||
</div>
|
||||
<div style="width: 200px;">
|
||||
<el-icon class="iconStyle">
|
||||
<CreditCard />
|
||||
</el-icon>
|
||||
<span>已支付金额</span>
|
||||
<span>{{ datas.totalRow }}</span>
|
||||
<span>{{ datas.totalAmount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -23,11 +23,14 @@ onMounted(() => {
|
||||
getPage();
|
||||
})
|
||||
let datas = reactive({
|
||||
totalRow: 0
|
||||
count: 0,
|
||||
totalAmount: 0,
|
||||
})
|
||||
async function getPage() {
|
||||
let res = await API.gettotal();
|
||||
datas.totalRow = res.totalRow
|
||||
for (let i in res) {
|
||||
datas[i] = res[i]
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<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 label="名称">
|
||||
<el-input v-model="formInline.keywords" 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 v-model="formInline.pickupMethod" placeholder="请选择领取方式" clearable>
|
||||
<el-option label="自取" value="self" />
|
||||
<el-option label="邮寄" value="post" />
|
||||
</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 v-model="formInline.status" placeholder="请选择状态" clearable>
|
||||
<el-option label="待支付" value="unpaid" />
|
||||
<el-option label="待自取" value="waiting" />
|
||||
<el-option label="已完成" value="done" />
|
||||
<el-option label="已取消" value="cancel" />
|
||||
</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-date-picker v-model="formInline.date" type="daterange" range-separator="-" start-placeholder="开始日期"
|
||||
value-format="YYYY-MM-DD" @change="dateChange" end-placeholder="结束日期" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="onSubmit">搜索</el-button>
|
||||
@@ -33,21 +33,24 @@
|
||||
<script setup>
|
||||
import eventBus from '@/utils/eventBus'
|
||||
const formInline = reactive({
|
||||
user: '',
|
||||
region: '',
|
||||
keywords: '',
|
||||
pickupMethod: '',
|
||||
date: '',
|
||||
value1: ""
|
||||
status: ""
|
||||
})
|
||||
const onSubmit = () => {
|
||||
eventBus.emit('search', formInline)
|
||||
}
|
||||
const reset = () => {
|
||||
formInline.user = ''
|
||||
formInline.region = ''
|
||||
formInline.date = ''
|
||||
formInline.value1 = ''
|
||||
for (let key in formInline) {
|
||||
formInline[key] = ''
|
||||
}
|
||||
eventBus.emit('search', formInline)
|
||||
}
|
||||
function dateChange(d) {
|
||||
formInline.endDate = d[1]
|
||||
formInline.beginDate = d[0]
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -55,6 +55,14 @@ const AuthAPI = {
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
// 核销
|
||||
isCheckout(data: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/checkout?couponCode=${data}`,
|
||||
method: "post",
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
export interface Responseres {
|
||||
code?: number | null;
|
||||
|
||||
@@ -5,24 +5,45 @@
|
||||
<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 prop="pointsGoodsName" align="center" label="商品">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-image style="width: 40px; height: 40px" :src="scope.row.goodsImageUrl" fit="contain" />
|
||||
{{ scope.row.pointsGoodsName }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="spendPoints" align="center" label="消耗积分" />
|
||||
<el-table-column prop="extraPaymentAmount" align="center" label="支付金额" />
|
||||
<el-table-column prop="payMethod" align="center" label="支付方式" />
|
||||
<el-table-column prop="payTime" align="center" label="实际支付时间" />
|
||||
<el-table-column prop="createTime" align="center" label="下单时间" />
|
||||
<el-table-column prop="name" align="center" label="领取方式">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="success" effect="plain" disable-transitions v-if="scope.row.pickupMethod == 'self'">自取</el-tag>
|
||||
<el-tag type="info" effect="plain" disable-transitions v-if="scope.row.pickupMethod == 'post'">邮寄
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" align="center" label="状态">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="warning" disable-transitions v-if="scope.row.status == 'waiting'">待自取</el-tag>
|
||||
<el-tag type="success" disable-transitions v-if="scope.row.status == 'done'">已完成</el-tag>
|
||||
<el-tag type="warning" disable-transitions v-if="scope.row.status == 'unpaid'">待支付</el-tag>
|
||||
<el-tag type="info" disable-transitions v-if="scope.row.status == 'cancel'">已取消</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cancelOrRefundReason" 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>
|
||||
<el-button size="small" type="primary" link icon="Finished" @click="handleDelete(scope.$index, scope.row)">
|
||||
待核销
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -37,12 +58,11 @@ const props = defineProps({
|
||||
default: () => []
|
||||
}
|
||||
})
|
||||
|
||||
function handleEdit(row) {
|
||||
emit('handleEdit', row)
|
||||
}
|
||||
function handleDelete(index, row) {
|
||||
emit('handleDelete', row.id)
|
||||
emit('handleDelete', row.couponCode)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -10,20 +10,44 @@
|
||||
<!-- 新增/编辑 -->
|
||||
<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 label="商品图片" required prop="images">
|
||||
<div style="display: flex; flex-wrap: wrap">
|
||||
<div v-for="(item, index) in datas.DialogForm.images" :key="index" style="position: relative"
|
||||
class="showStyle">
|
||||
<el-icon class="buttonstyle" @click="deleteEvent(item)">
|
||||
<DeleteFilled />
|
||||
</el-icon>
|
||||
<img style="width: 148px; height: 148px; margin-right: 6px" class="imgStyle" :src="item" alt="" />
|
||||
</div>
|
||||
<div class="upImgStyle" @click="addimgEvent">+</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="适用群体">
|
||||
<el-radio-group v-model="datas.DialogForm.deductionGroup">
|
||||
<el-radio label="全部" value="all" />
|
||||
<el-radio label="仅会员" value="vip" />
|
||||
</el-radio-group>
|
||||
</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 label="开启下单积分抵扣">
|
||||
<el-switch v-model="datas.DialogForm.enableDeduction" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="额外价格">
|
||||
<el-col :span="3">
|
||||
<el-input v-model="datas.DialogForm.minPaymentAmount" type="number" placeholder="">
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="datas.DialogForm.remark" placeholder="请输入备注" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</myDialog>
|
||||
<!-- 选择图片 -->
|
||||
<AddImg ref="addImg" @successEvent="successEvent"></AddImg>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
@@ -46,7 +70,8 @@ const datas = reactive({
|
||||
name: "",
|
||||
telephone: "",
|
||||
address: "",
|
||||
remark: ""
|
||||
remark: "",
|
||||
images: []
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
@@ -71,7 +96,9 @@ async function getList(data = {}) {
|
||||
datas.pagingConfig.pageNumber = res.pageNumber
|
||||
}
|
||||
function add() {
|
||||
rest()
|
||||
if (datas.DialogForm.id) {
|
||||
rest()
|
||||
}
|
||||
datas.title = '新增数据'
|
||||
myDialogRef.value.open()
|
||||
}
|
||||
@@ -79,6 +106,8 @@ async function handleEdit(row) {
|
||||
datas.title = '编辑数据'
|
||||
const res = await API.getinfo(row.id)
|
||||
datas.DialogForm = res
|
||||
// 有图片
|
||||
// datas.DialogForm.goodsImageUrl = res.goodsImageUrl.split(',')
|
||||
myDialogRef.value.open()
|
||||
}
|
||||
async function confirm() {
|
||||
@@ -86,8 +115,11 @@ async function confirm() {
|
||||
if (valid) {
|
||||
let res = null
|
||||
if (datas.title == '新增数据') {
|
||||
// 图片处理
|
||||
// datas.DialogForm.goodsImageUrl = datas.DialogForm.goodsImageUrl.join(',')
|
||||
res = await API.add(datas.DialogForm)
|
||||
} else {
|
||||
// datas.DialogForm.goodsImageUrl = datas.DialogForm.goodsImageUrl.join(',')
|
||||
res = await API.update(datas.DialogForm)
|
||||
}
|
||||
if (res.code == 200) {
|
||||
@@ -104,7 +136,7 @@ async function confirm() {
|
||||
}
|
||||
// 重置
|
||||
function rest() {
|
||||
datas.DialogForm = { sort: "1" }
|
||||
datas.DialogForm = { sort: 1, images: [] }
|
||||
}
|
||||
async function handleDelete(id) {
|
||||
ElMessageBox.confirm("是否删除数据项?", "提示", {
|
||||
@@ -124,6 +156,19 @@ async function handleDelete(id) {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// 图片
|
||||
const addImg = ref(null)
|
||||
function addimgEvent() {
|
||||
(addImg.value)?.show()
|
||||
}
|
||||
function successEvent(d) {
|
||||
datas.DialogForm['images'].push(d[0].url);
|
||||
}
|
||||
function deleteEvent(d) {
|
||||
let index = datas.DialogForm.images.findIndex((ele) => ele == d);
|
||||
datas.DialogForm.images.splice(index, 1);
|
||||
}
|
||||
// 分页
|
||||
function sizeChange(val) {
|
||||
datas.pagingConfig.pageSize = val
|
||||
@@ -143,4 +188,29 @@ function currentChange(val) {
|
||||
margin-top: 20px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
// 图片库样式
|
||||
.upImgStyle {
|
||||
cursor: pointer;
|
||||
width: 148px;
|
||||
height: 148px;
|
||||
line-height: 148px;
|
||||
text-align: center;
|
||||
border: 1px dashed #ccc;
|
||||
border-radius: 1%;
|
||||
font-size: 30px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.buttonstyle {
|
||||
border-radius: 50%;
|
||||
color: #db1616;
|
||||
background-color: #fff;
|
||||
font-size: 20px;
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: -10px;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
@@ -12,7 +12,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="日期">
|
||||
<el-date-picker v-model="formInline.value1" type="daterange" range-separator="-" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" />
|
||||
value-format="YYYY-MM-DD" @change="dateChange" end-placeholder="结束日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排列方式">
|
||||
<el-select v-model="formInline.region" placeholder="请选择排列方式" clearable>
|
||||
@@ -40,12 +40,15 @@ const onSubmit = () => {
|
||||
eventBus.emit('search', formInline)
|
||||
}
|
||||
const reset = () => {
|
||||
formInline.user = ''
|
||||
formInline.region = ''
|
||||
formInline.date = ''
|
||||
formInline.value1 = ''
|
||||
for (let key in formInline) {
|
||||
formInline[key] = ''
|
||||
}
|
||||
eventBus.emit('search', formInline)
|
||||
}
|
||||
function dateChange(d) {
|
||||
formInline.endDate = d[1]
|
||||
formInline.beginDate = d[0]
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
<template>
|
||||
<div style="margin-top: 10px;">
|
||||
<el-table :data="props.list" border style="width: 100%">
|
||||
<el-table-column prop="date" align="center" label="Date" width="180" />
|
||||
<el-table-column prop="name" align="center" label="Name" width="180" />
|
||||
<el-table-column prop="date" align="center" label="Date" />
|
||||
<el-table-column prop="name" align="center" label="Name">
|
||||
<template v-slot="scope">
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-image style="width: 40px; height: 40px" :src="scope.row.headImg" fit="contain" />
|
||||
{{ scope.row.nickName }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">{{ scope.row.status === 1 ? '上架' : '下架'
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" align="center" label="Address" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
|
||||
Reference in New Issue
Block a user