diff --git a/src/apis/modules/raffleProduct.js b/src/apis/modules/raffleProduct.js
new file mode 100644
index 0000000..b7a016f
--- /dev/null
+++ b/src/apis/modules/raffleProduct.js
@@ -0,0 +1,16 @@
+/**
+ * 区域模块接口
+ */
+import request from '@/utils/request'
+// 获取项目列表
+export const getProjectList = (params) => request.basic.get('/api/v1/raffle-products', params)
+// 获取单挑数据
+export const getItem = (id) => request.basic.get(`/api/v1/raffle-products/${id}`)
+// 添加条目
+export const createProject = (params) => request.basic.post('/api/v1/raffle-products', params)
+// 更新role
+export const updateItem = (id, params) => request.basic.put(`/api/v1/raffle-products/${id}`, params)
+// 删除数据
+export const delItem = (id) => request.basic.delete(`/api/v1/raffle-products/${id}`)
+//获取抽奖记录
+export const getRaffleOrders = (params) => request.basic.get('/api/v1/raffle-orders', params)
\ No newline at end of file
diff --git a/src/locales/lang/zh-CN/menu.js b/src/locales/lang/zh-CN/menu.js
index 92a6287..2d662f1 100644
--- a/src/locales/lang/zh-CN/menu.js
+++ b/src/locales/lang/zh-CN/menu.js
@@ -80,6 +80,6 @@ export default {
houseProduct:'案场礼品',
prizeDraw:'抽奖模块',
lotteryRules:'抽奖规则',
- lotteryProduct:'抽奖产品',
+ lotteryProduct:'奖品列表',
lotteryOrders:'抽奖记录',
}
diff --git a/src/views/prizeDraw/lotteryOrders/components/EditDialog.vue b/src/views/prizeDraw/lotteryOrders/components/EditDialog.vue
deleted file mode 100644
index 68dafa6..0000000
--- a/src/views/prizeDraw/lotteryOrders/components/EditDialog.vue
+++ /dev/null
@@ -1,612 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{
- item.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
updateLabel(index, e.target.value)">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 删 除
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 删 除
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/prizeDraw/lotteryOrders/index.vue b/src/views/prizeDraw/lotteryOrders/index.vue
index 5dfb562..2123596 100644
--- a/src/views/prizeDraw/lotteryOrders/index.vue
+++ b/src/views/prizeDraw/lotteryOrders/index.vue
@@ -33,32 +33,11 @@
-
-
-
-
-
- 新增楼盘
-
-
-
-
- {{ record.price+'(元/平)' }}
-
-
-
-
-
- {{ $t('pages.system.user.edit') }}
-
-
-
-
- {{ $t('pages.system.delete') }}
-
+
+ {{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}
@@ -66,7 +45,6 @@
-
diff --git a/src/views/prizeDraw/lotteryProduct/index.vue b/src/views/prizeDraw/lotteryProduct/index.vue
index 0fca314..f6255bd 100644
--- a/src/views/prizeDraw/lotteryProduct/index.vue
+++ b/src/views/prizeDraw/lotteryProduct/index.vue
@@ -38,23 +38,26 @@
- 新增楼盘
+ 新增奖品
-
- {{ record.price+'(元/平)' }}
+
+
+
+
+ 启用
+ 停用
-
{{ $t('pages.system.user.edit') }}
-
+
{{ $t('pages.system.delete') }}
@@ -84,12 +87,13 @@ defineOptions({
})
const { t } = useI18n() // 解构出t方法
const columns = [
- { title: '楼盘名称', dataIndex: 'name' },
- { title: '主力户型', dataIndex: 'masterType', width: 120, align: 'center' },
- { title: '开盘时间', dataIndex: 'openAt', width: 100, align: 'center' },
- { title: '楼盘地址', dataIndex: 'address', align: 'center',ellipsis: true, },
- { title: '楼盘均价', dataIndex: 'price', align: 'center', width: 110 },
- // { title: '待售状态', dataIndex: 'status', key: 'introduce', width: 100, align: 'center' },
+ { title: '奖品图片', dataIndex: 'img', width: 120 , align: 'center'},
+ { title: '奖品名称', dataIndex: 'name' },
+ { title: '抽中限制', dataIndex: 'maxNum', width: 120, align: 'center' },
+ { title: '中奖率', dataIndex: 'probability', width: 100, align: 'center' },
+ { title: '已抽中数', dataIndex: 'realNum', align: 'center', ellipsis: true, },
+ { title: '所属规则', dataIndex: 'raffleName', align: 'center', width: 110 },
+ { title: '奖品状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
@@ -103,7 +107,7 @@ async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
- const { success, data, total } = await apis.house
+ const { success, data, total } = await apis.raffleProduct
.getProjectList({
pageSize,
page: current,
@@ -134,7 +138,7 @@ function handleDelete({ id }) {
return new Promise((resolve, reject) => {
; (async () => {
try {
- const { success } = await apis.house.delItem(id).catch(() => {
+ const { success } = await apis.raffleProduct.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
diff --git a/src/views/prizeDraw/lotteryRules/components/EditDialog.vue b/src/views/prizeDraw/lotteryRules/components/EditDialog.vue
index 1e473ad..830a502 100644
--- a/src/views/prizeDraw/lotteryRules/components/EditDialog.vue
+++ b/src/views/prizeDraw/lotteryRules/components/EditDialog.vue
@@ -70,42 +70,48 @@
v-for="(child, index) of formData.roles" :key="index">
-
+
{{
item.name }}
-
- {{
- item }}
+
+
+ {{
+ item.name }}
-
- {{
- item }}
-
+
+ {{
+ item.name }}
+
-
- {{
- item }}
+
+
+ {{
+ item.name }}
-
- {{
- item }}
+
+ {{
+ item.name }}
+
-
+
+ 删 除
+
@@ -137,11 +143,11 @@ const okText = ref(t('button.confirm'))
const layImgList = []
const hoursArray = Array.from({ length: 24 }, (_, i) => ({
value: i,
- name: i === 0 ? "24:00" : `${i}:00`
+ name: i === 0 ? "24点" : `${i}点`
}));
const minutesArray = Array.from({ length: 60 }, (_, i) => ({
value: i,
- name: `${i.toString().padStart(2, '0')}:00`
+ name: `${i.toString().padStart(2, '0')}分`
}));
const activeKey = ref('1')
const weekDays = ref([
@@ -168,11 +174,11 @@ formRules.value = {
function handleCreate() {
showModal({
type: 'create',
- title: '新增抽奖',
+ title: '新增规则',
})
formData.value.areaId = 1
formData.value.status='enabled'
- formData.value.roles = [{ weekday:1, isActive: true, startH:0, startM:0,endH:0, endM:0 }]
+ formData.value.roles = [{ weekday:1, isActive: true, startH:1, startM:0,endH:0, endM:0 }]
}
/**
@@ -181,7 +187,7 @@ function handleCreate() {
async function handleEdit(record = {}) {
showModal({
type: 'edit',
- title: '编辑抽奖',
+ title: '编辑规则',
})
try {
showSpining()
@@ -192,7 +198,10 @@ async function handleEdit(record = {}) {
}
hideSpining()
formData.value = {
- ...data
+ ...data,
+ startAt:dayjs(data.startAt),
+ endAt:dayjs(data.endAt)
+
}
} catch (error) {
message.error({ content: error.message })
@@ -208,7 +217,8 @@ function handleOk() {
try {
showLoading()
const params = {
- ...values
+ ...values,
+ roles:formData.value.roles
}
let result = null
switch (modal.value.type) {
@@ -275,7 +285,7 @@ defineExpose({
})
//新增户型
const addLayout = () => {
- const params = { weekday: '', isActive: true, startTime: '', endTime: '' }
+ const params = { weekday:1, isActive: true, startH:1, startM:0,endH:0, endM:0 }
formData.value.roles.push(params)
}
//新增顾问
@@ -285,7 +295,7 @@ const addAdviser = () => {
}
//删除户型
const delLayOut = (index) => {
- formData.value.layOuts.splice(index, 1)
+ formData.value.roles.splice(index, 1)
}
diff --git a/src/views/prizeDraw/lotteryRules/index.vue b/src/views/prizeDraw/lotteryRules/index.vue
index f44dbb1..0e8cb6e 100644
--- a/src/views/prizeDraw/lotteryRules/index.vue
+++ b/src/views/prizeDraw/lotteryRules/index.vue
@@ -38,7 +38,7 @@
- 新增楼盘
+ 新增规则
{
; (async () => {
try {
- const { success } = await apis.house.delItem(id).catch(() => {
+ const { success } = await apis.raffles.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {