修复bug暂存-周卡

This commit is contained in:
dragon
2024-07-16 14:18:09 +08:00
parent cb54148f6e
commit 7bdbb9f071
4 changed files with 63 additions and 9 deletions

View File

@@ -85,7 +85,7 @@ export const weekCardTabSave = query => {
return request({
url: '/admin/weekCardTab/save',
method: 'post',
data: query
params: query
});
};
// 周卡激励统计-列表
@@ -130,6 +130,6 @@ export const weekCardSave = query => {
return request({
url: '/admin/weekCard/save',
method: 'post',
data: query
params: query
});
};

View File

@@ -51,6 +51,7 @@ export default {
},
getViewComponent(context, path) {
let component = path;
console.log(component)
if (path && path.endsWith('.html')) {
const pathArray = path.split('/');
const routeName = toCamelCase(pathArray[pathArray.length - 1].replace('.html', ''));

View File

@@ -20,7 +20,11 @@
<el-table-column prop="id" align="center" label="主键" />
<el-table-column prop="seqNo" align="center" label="排序" />
<el-table-column prop="showAmount" align="center" label="展示金额" />
<el-table-column prop="tabName" align="center" label="TAB名称" />
<el-table-column prop="tabName" align="center" label="TAB名称">
<template v-slot="scope">
{{ JsonFunc(scope.row.tabName).zh }}
</template>
</el-table-column>
<el-table-column prop="updateTime" align="center" label="更新时间" />
<el-table-column align="center" label="操作">
<template v-slot="scope">
@@ -191,6 +195,10 @@ export default {
}
});
},
JsonFunc(val) {
var res = JSON.parse(val);
return res;
},
// 分页导航
handleSizeChange(size) {
this.pageSize = size;

View File

@@ -50,7 +50,11 @@
{{ scope.row.rewardType == 1 ? scope.row.rewardNum : "/" }}
</template>
</el-table-column>
<el-table-column prop="rewardType" align="center" label="礼物类型" />
<el-table-column prop="rewardType" align="center" label="礼物类型">
<template v-slot="scope">
{{ rewardTypeNumFun(scope.row.rewardType).name }}
</template>
</el-table-column>
<el-table-column prop="rewardName" align="center" label="礼物名称" />
<el-table-column prop="rewardPrice" align="center" label="礼物价值" />
<el-table-column prop="rewardNum" align="center" label="数量" />
@@ -378,12 +382,12 @@ export default {
};
},
created() {
this.getData();
// this.getData();
listPartitionInfo().then((res) => {
this.inquire.options = res.data;
});
this.loading = true;
getAll().then((res) => {
this.loading = true;
this.giftArr = res.data;
carAll().then((res) => {
this.carArr = res.data;
@@ -423,6 +427,7 @@ export default {
}
});
},
// 查询
getData() {
this.loading = true;
weekCardPage({
@@ -435,7 +440,6 @@ export default {
if (res.code === 200) {
this.tableData = res.data.records;
this.total = res.data.total;
this.loading = false;
} else {
ElMessage({
showClose: true,
@@ -443,6 +447,7 @@ export default {
type: "error",
});
}
this.loading = false;
})
.catch((error) => {
console.error("请求出错:", error);
@@ -451,7 +456,6 @@ export default {
message: "请求出错,请稍后重试",
type: "error",
});
this.loading = false;
});
},
// 监听礼物类型
@@ -596,7 +600,6 @@ export default {
},
// 确认按钮
operationClick() {
console.log(this.operatioObj);
if (this.operationType == 1) {
// 新增
weekCardSave({
@@ -615,12 +618,15 @@ export default {
: this.operation.days == 6
? "第六天"
: "第七天",
rewardPrice: this.operation.gameName,
cardIcon: this.operation.imageUrl1,
rewardType: this.operation.value,
rewardId: this.operation.value2,
rewardName: this.operation.value22,
rewardNum: this.operation.rewardGoldNum,
seqNo: this.operation.seqNo,
partitionId: this.inquire.value1,
tabId: this.inquire.value2,
})
.then((res) => {
if (res.code === 200) {
@@ -661,6 +667,7 @@ export default {
: this.operation.days == 6
? "第六天"
: "第七天",
rewardPrice: this.operation.gameName,
cardIcon: this.operation.imageUrl1,
rewardType: this.operation.value,
rewardId: this.operation.value2,
@@ -668,6 +675,8 @@ export default {
rewardNum: this.operation.rewardGoldNum,
seqNo: this.operation.seqNo,
id: this.operatioObj.id,
partitionId: this.inquire.value1,
tabId: this.inquire.value2,
})
.then((res) => {
if (res.code === 200) {
@@ -692,6 +701,42 @@ export default {
});
}
},
// 单位判断
rewardTypeNumFun(num) {
if (num == 1) {
return { name: "金币", unit: "个" };
} else if (num == 2) {
return { name: "礼物", unit: "个" };
} else if (num == 3) {
return { name: "座驾", unit: "天" };
} else if (num == 4) {
return { name: "头饰", unit: "天" };
} else if (num == 5) {
return { name: "背景", unit: "天" };
} else if (num == 6) {
return { name: "实物", unit: "个" };
} else if (num == 7) {
return { name: "靓号", unit: "天" };
} else if (num == 8) {
return { name: "全麦礼物", unit: "个" };
} else if (num == 9) {
return { name: "随机靓号", unit: "天" };
} else if (num == 10) {
return { name: "锤子", unit: "个" };
} else if (num == 13) {
return { name: "祝福语", unit: "天" };
} else if (num == 14) {
return { name: "铭牌", unit: "天" };
} else if (num == 15) {
return { name: "虚拟货币", unit: "个" };
} else if (num == 16) {
return { name: "聊天气泡", unit: "天" };
} else if (num == 17) {
return { name: "资料卡", unit: "天" };
} else {
return { name: "null", unit: "null" };
}
},
beforeAvatarUpload() {
ElMessage({
showClose: true,