841 lines
24 KiB
Vue
841 lines
24 KiB
Vue
<template>
|
|
<div class="box">
|
|
<!-- 查询 -->
|
|
<div class="inquire">
|
|
<div class="block">
|
|
<!-- 地区 -->
|
|
<span class="demonstration">地区</span>
|
|
<el-select filterable v-model="inquire.value" placeholder="请选择">
|
|
<el-option
|
|
v-for="item in inquire.options"
|
|
:key="item.id"
|
|
:label="item.desc"
|
|
:value="item.id"
|
|
></el-option>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
<div class="inquire">
|
|
<div class="block">
|
|
<!-- 地区 -->
|
|
<span class="demonstration">周卡栏</span>
|
|
<el-select filterable v-model="inquire.value2" placeholder="请选择">
|
|
<el-option
|
|
v-for="item in inquire.options2"
|
|
:key="item.id"
|
|
:label="item.desc"
|
|
:value="item.id"
|
|
></el-option>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
<!-- 查询按钮 -->
|
|
<el-button class="primary" type="primary" @click="getData()"
|
|
>查询</el-button
|
|
>
|
|
<!-- 新增按钮 -->
|
|
<el-button class="primary" type="primary" @click="add()">新增</el-button>
|
|
</div>
|
|
<!-- 表格 -->
|
|
<el-table
|
|
v-loading="loading"
|
|
:data="tableData"
|
|
border
|
|
style="width: 100%; margin-top: 25px"
|
|
>
|
|
<el-table-column prop="id" align="center" label="ID" />
|
|
<el-table-column prop="groupName" align="center" label="日期" />
|
|
<el-table-column prop="rewardType" align="center" label="金币">
|
|
<template v-slot="scope">
|
|
{{ scope.row.rewardType == 1 ? scope.row.rewardNum : "/" }}
|
|
</template>
|
|
</el-table-column>
|
|
<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="数量" />
|
|
<el-table-column prop="rewardValue" align="center" label="可用天数" />
|
|
<el-table-column prop="seqNo" align="center" label="排序" />
|
|
<el-table-column
|
|
align="center"
|
|
prop="cardIcon"
|
|
label="卡片ICON"
|
|
width="120"
|
|
>
|
|
<template v-slot="scope">
|
|
<el-image
|
|
style="width: 100px; height: 100px"
|
|
:src="scope.row.cardIcon"
|
|
:zoom-rate="1.1"
|
|
:preview-src-list="scope.row.cardIcon"
|
|
fit="cover"
|
|
preview-teleported="true"
|
|
hide-on-click-modal="true"
|
|
/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
align="center"
|
|
prop="rewardIcon"
|
|
label="奖励ICON"
|
|
width="120"
|
|
>
|
|
<template v-slot="scope">
|
|
<el-image
|
|
style="width: 100px; height: 100px"
|
|
:src="scope.row.rewardIcon"
|
|
:zoom-rate="1.1"
|
|
:preview-src-list="scope.row.rewardIcon"
|
|
fit="cover"
|
|
preview-teleported="true"
|
|
hide-on-click-modal="true"
|
|
/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" label="操作">
|
|
<template v-slot="scope">
|
|
<el-button
|
|
@click="eid(scope)"
|
|
class="primary"
|
|
type="primary"
|
|
size="default"
|
|
>编辑</el-button
|
|
>
|
|
<el-button
|
|
@click="
|
|
delDialog = true;
|
|
delObj = scope.row;
|
|
"
|
|
:class="scope.row.isEnabled == 1 ? 'danger' : 'primary'"
|
|
:type="scope.row.isEnabled == 1 ? 'danger' : 'primary'"
|
|
size="default"
|
|
>{{ scope.row.isEnabled == 1 ? "下线" : "上线" }}</el-button
|
|
>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<!-- 分页 -->
|
|
<el-pagination
|
|
style="margin-top: 10px"
|
|
class="paginationClass"
|
|
v-model:current-page="currentPage"
|
|
v-model:page-size="pageSize"
|
|
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
|
layout="sizes, prev, pager, next"
|
|
:total="total"
|
|
@size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
/>
|
|
|
|
<!-- 添加和编辑弹窗 -->
|
|
<el-dialog
|
|
v-model="operationDialog"
|
|
:title="operationTitle"
|
|
width="30%"
|
|
center
|
|
>
|
|
<!-- 输入日期 -->
|
|
<div class="selectBox">
|
|
<span class="left" style="margin-right: 20px">输入日期</span>
|
|
<el-select filterable v-model="operation.days" placeholder="请选择">
|
|
<el-option
|
|
v-for="item in operation.optionsDays"
|
|
:key="item.id"
|
|
:label="item.desc"
|
|
:value="item.id"
|
|
>
|
|
</el-option>
|
|
</el-select>
|
|
</div>
|
|
<!-- 金币数量 -->
|
|
<div class="selectBox">
|
|
<span class="left" style="margin-right: 20px">金币数量</span>
|
|
<el-input
|
|
v-model="operation.gameName"
|
|
size="default"
|
|
placeholder=""
|
|
class="right"
|
|
style="width: 70%"
|
|
></el-input>
|
|
</div>
|
|
<!-- 游戏icon -->
|
|
<div class="selectBox selectBoxImg">
|
|
<span class="left" style="margin-right: 20px">金币icon</span>
|
|
<el-upload
|
|
class="avatar-uploader"
|
|
action="/admin/tencent/cos/upload/file"
|
|
:show-file-list="false"
|
|
:on-success="handleAvatarSuccess"
|
|
:before-upload="beforeAvatarUpload"
|
|
:on-error="handleAvatarError"
|
|
>
|
|
<img
|
|
v-if="operation.imageUrl1"
|
|
:src="operation.imageUrl1"
|
|
class="avatar"
|
|
/>
|
|
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
|
</el-upload>
|
|
</div>
|
|
<!-- 选择礼物类型 -->
|
|
<div style="margin-bottom: 25px; margin-top: 10px; width: 134%">
|
|
<span
|
|
style="display: inline-block; margin-right: 20px"
|
|
class="col-sm-2 control-label"
|
|
>选择礼物类型</span
|
|
>
|
|
<el-select
|
|
filterable
|
|
v-model="operation.value"
|
|
@change="optionsChange()"
|
|
placeholder="请选择"
|
|
>
|
|
<el-option
|
|
v-for="item in operation.options"
|
|
:key="item.id"
|
|
:label="item.desc"
|
|
:value="item.id"
|
|
>
|
|
</el-option>
|
|
</el-select>
|
|
</div>
|
|
<!-- 奖励 -->
|
|
<div
|
|
v-show="operationIsShow"
|
|
style="margin-bottom: 25px; margin-top: 10px; width: 134%"
|
|
>
|
|
<span
|
|
style="display: inline-block; margin-right: 20px"
|
|
class="col-sm-2 control-label"
|
|
>奖励</span
|
|
>
|
|
<el-select
|
|
filterable
|
|
v-model="operation.value2"
|
|
@change="operationChange(e)"
|
|
placeholder="请选择"
|
|
>
|
|
<el-option
|
|
v-for="item in operation.options2"
|
|
:key="item.id"
|
|
:label="
|
|
operation.value == 2
|
|
? JsonFunc(item.giftName).zh
|
|
: operation.value == 16 || operation.value == 17
|
|
? JsonFunc(item.name).zh
|
|
: item.name
|
|
"
|
|
:value="operation.value == 2 ? item.giftId : item.id"
|
|
>
|
|
<!-- item.name -->
|
|
</el-option>
|
|
</el-select>
|
|
</div>
|
|
<!-- 奖励天数 -->
|
|
<div v-show="operationIsShow" class="selectBox">
|
|
<span class="left" style="margin-right: 20px">奖励天数</span>
|
|
<el-input
|
|
v-model="operation.rewardDays"
|
|
size="default"
|
|
placeholder="特权类奖励请输入天数,其他不需要填写"
|
|
class="right"
|
|
style="width: 70%"
|
|
></el-input>
|
|
</div>
|
|
<!-- 奖励个数v-show="!operationIsShow" -->
|
|
<div class="selectBox">
|
|
<span class="left" style="margin-right: 20px">奖励个数</span>
|
|
<el-input
|
|
v-model="operation.rewardGoldNum"
|
|
size="default"
|
|
placeholder="金币/金币礼物请输入数量"
|
|
class="right"
|
|
style="width: 70%"
|
|
></el-input>
|
|
</div>
|
|
<!-- 排序 -->
|
|
<div class="selectBox">
|
|
<span class="left" style="margin-right: 20px">排序</span>
|
|
<el-input
|
|
v-model="operation.seqNo"
|
|
size="default"
|
|
placeholder="请输入排序,越小排序越前 "
|
|
class="right"
|
|
style="width: 70%"
|
|
></el-input>
|
|
</div>
|
|
<!-- 操作 -->
|
|
<template #footer>
|
|
<span class="dialog-footer">
|
|
<el-button @click="operationDialog = false">取消</el-button>
|
|
<el-button type="primary" @click="operationClick()"> 确认 </el-button>
|
|
</span>
|
|
</template>
|
|
</el-dialog>
|
|
|
|
<!-- 二次确认弹窗 -->
|
|
<el-dialog
|
|
destroy-on-close
|
|
v-model="delDialog"
|
|
title="提示"
|
|
width="30%"
|
|
center
|
|
>
|
|
<span> 确定要进行该操作吗?</span>
|
|
<template #footer>
|
|
<span class="dialog-footer">
|
|
<el-button @click="delDialog = false">取消</el-button>
|
|
<el-button type="primary" @click="delClick()"> 确认 </el-button>
|
|
</span>
|
|
</template>
|
|
</el-dialog>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
listPartitionInfo,
|
|
weekCardPage,
|
|
getAll,
|
|
carAll,
|
|
headwearAll,
|
|
nameplateAll,
|
|
chatbubbleAll,
|
|
infocard,
|
|
weekCardSave,
|
|
updateEnabled,
|
|
} from "@/api/weeklyCard/weeklyCard";
|
|
import { dateFormat } from "@/utils/system-helper";
|
|
import { ElMessage } from "element-plus";
|
|
|
|
export default {
|
|
name: "weekCardSet",
|
|
data() {
|
|
return {
|
|
inquire: {
|
|
value: "",
|
|
options: [],
|
|
value2: "",
|
|
value22: "",
|
|
options2: [
|
|
{ desc: "初级周卡", id: 1 },
|
|
{ desc: "中级周卡", id: 2 },
|
|
{ desc: "高级周卡", id: 3 },
|
|
],
|
|
},
|
|
giftArr: [],
|
|
carArr: [],
|
|
headArr: [],
|
|
nameplateArr: [],
|
|
bubbleArr: [],
|
|
cardArr: [],
|
|
loading: false,
|
|
// 表格数据
|
|
tableData: [],
|
|
// 分页
|
|
total: 10, //总页数
|
|
currentPage: 1, //页码
|
|
pageSize: 10, //条数
|
|
// 编辑
|
|
operationDialog: false,
|
|
operationType: 1, //1添加2编辑
|
|
operationTitle: "编辑&添加",
|
|
operatioObj: {},
|
|
operation: {
|
|
days: "",
|
|
optionsDays: [
|
|
{ desc: "第一天", id: 1 },
|
|
{ desc: "第二天", id: 2 },
|
|
{ desc: "第三天", id: 3 },
|
|
{ desc: "第四天", id: 4 },
|
|
{ desc: "第五天", id: 5 },
|
|
{ desc: "第六天", id: 6 },
|
|
{ desc: "第七天", id: 7 },
|
|
],
|
|
gameName: "",
|
|
imageUrl1: "",
|
|
value: "",
|
|
options: [
|
|
{ desc: "金币", id: 1 },
|
|
{ desc: "礼物", id: 2 },
|
|
{ desc: "铭牌", id: 14 },
|
|
{ desc: "头饰", id: 4 },
|
|
{ desc: "气泡", id: 16 },
|
|
{ desc: "资料卡", id: 17 },
|
|
{ desc: "座驾", id: 3 },
|
|
],
|
|
value2: "",
|
|
value22: "",
|
|
options2: [],
|
|
rewardDays: "",
|
|
rewardGoldNum: "",
|
|
seqNo: "",
|
|
},
|
|
operationIsShow: true,
|
|
// 上下线
|
|
delDialog: false,
|
|
delObj: {},
|
|
};
|
|
},
|
|
created() {
|
|
// this.getData();
|
|
listPartitionInfo().then((res) => {
|
|
this.inquire.options = res.data;
|
|
});
|
|
this.loading = true;
|
|
getAll().then((res) => {
|
|
this.giftArr = res.data;
|
|
carAll().then((res) => {
|
|
this.carArr = res.data;
|
|
headwearAll().then((res) => {
|
|
this.headArr = res.data;
|
|
nameplateAll().then((res) => {
|
|
this.nameplateArr = res.data;
|
|
chatbubbleAll().then((res) => {
|
|
this.bubbleArr = res.data;
|
|
infocard().then((res) => {
|
|
this.cardArr = res.data;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
methods: {
|
|
// 上线下线
|
|
delClick() {
|
|
updateEnabled({
|
|
weekCardId: this.delObj.id,
|
|
isEnabled: !this.delObj.isEnabled == true ? 1 : 2,
|
|
}).then((res) => {
|
|
if (res.code === 200) {
|
|
this.getData();
|
|
this.loading = false;
|
|
this.delDialog = false;
|
|
} else {
|
|
ElMessage({
|
|
showClose: true,
|
|
message: res.message,
|
|
type: "error",
|
|
});
|
|
}
|
|
});
|
|
},
|
|
// 查询
|
|
getData() {
|
|
this.loading = true;
|
|
weekCardPage({
|
|
page: this.currentPage,
|
|
pageSize: this.pageSize,
|
|
partitionId: this.inquire.value,
|
|
tabId: this.inquire.value2,
|
|
})
|
|
.then((res) => {
|
|
if (res.code === 200) {
|
|
this.tableData = res.data.records;
|
|
this.total = res.data.total;
|
|
} else {
|
|
ElMessage({
|
|
showClose: true,
|
|
message: res.message || "获取数据失败",
|
|
type: "error",
|
|
});
|
|
}
|
|
this.loading = false;
|
|
})
|
|
.catch((error) => {
|
|
console.error("请求出错:", error);
|
|
ElMessage({
|
|
showClose: true,
|
|
message: "请求出错,请稍后重试",
|
|
type: "error",
|
|
});
|
|
});
|
|
},
|
|
// 监听礼物类型
|
|
optionsChange() {
|
|
let than = this;
|
|
var type = than.operation.value;
|
|
than.operation.value2 = "";
|
|
if (type) {
|
|
than.operationIsShow = true;
|
|
if (type == 2) {
|
|
//礼物
|
|
than.operation.options2 = than.giftArr;
|
|
} else if (type == 3) {
|
|
//座驾
|
|
than.operation.options2 = than.carArr;
|
|
} else if (type == 4) {
|
|
//头饰
|
|
than.operation.options2 = than.headArr;
|
|
} else if (type == 14) {
|
|
//铭牌
|
|
than.operation.options2 = than.nameplateArr;
|
|
} else if (type == 16) {
|
|
//气泡
|
|
than.operation.options2 = than.bubbleArr;
|
|
} else if (type == 17) {
|
|
//资料卡
|
|
than.operation.options2 = than.cardArr;
|
|
} else if (type == 1) {
|
|
//金币
|
|
than.operationIsShow = false;
|
|
}
|
|
}
|
|
},
|
|
operationChange() {
|
|
this.operation.options2.forEach((res, i) => {
|
|
if (this.operation.value == 2) {
|
|
if (res.giftId == this.operation.value2) {
|
|
this.operation.value22 =
|
|
this.operation.value == 2
|
|
? this.JsonFunc(res.giftName).zh
|
|
: this.operation.value == 16 || this.operation.value == 17
|
|
? this.JsonFunc(res.name).zh
|
|
: res.name;
|
|
}
|
|
} else {
|
|
if (res.id == this.operation.value2) {
|
|
this.operation.value22 =
|
|
this.operation.value == 2
|
|
? this.JsonFunc(res.giftName).zh
|
|
: this.operation.value == 16 || this.operation.value == 17
|
|
? this.JsonFunc(res.name).zh
|
|
: res.name;
|
|
}
|
|
}
|
|
});
|
|
},
|
|
// 新增
|
|
add() {
|
|
this.operation = {
|
|
days: "",
|
|
optionsDays: [
|
|
{ desc: "第一天", id: 1 },
|
|
{ desc: "第二天", id: 2 },
|
|
{ desc: "第三天", id: 3 },
|
|
{ desc: "第四天", id: 4 },
|
|
{ desc: "第五天", id: 5 },
|
|
{ desc: "第六天", id: 6 },
|
|
{ desc: "第七天", id: 7 },
|
|
],
|
|
gameName: "",
|
|
imageUrl1: "",
|
|
value: "",
|
|
options: [
|
|
{ desc: "金币", id: 1 },
|
|
{ desc: "礼物", id: 2 },
|
|
{ desc: "铭牌", id: 14 },
|
|
{ desc: "头饰", id: 4 },
|
|
{ desc: "气泡", id: 16 },
|
|
{ desc: "资料卡", id: 17 },
|
|
{ desc: "座驾", id: 3 },
|
|
],
|
|
value2: "",
|
|
options2: [],
|
|
rewardDays: "",
|
|
rewardGoldNum: "",
|
|
seqNo: "",
|
|
};
|
|
this.operationType = 1;
|
|
this.operationTitle = "添加";
|
|
this.operationDialog = true;
|
|
},
|
|
// 编辑
|
|
eid(scope) {
|
|
this.operationDialog = true;
|
|
this.operatioObj = scope.row;
|
|
this.operation = {
|
|
days: this.operatioObj.groupId,
|
|
optionsDays: [
|
|
{ desc: "第一天", id: 1 },
|
|
{ desc: "第二天", id: 2 },
|
|
{ desc: "第三天", id: 3 },
|
|
{ desc: "第四天", id: 4 },
|
|
{ desc: "第五天", id: 5 },
|
|
{ desc: "第六天", id: 6 },
|
|
{ desc: "第七天", id: 7 },
|
|
],
|
|
gameName: this.operatioObj.rewardValue,
|
|
imageUrl1: this.operatioObj.cardIcon,
|
|
value: this.operatioObj.rewardType,
|
|
options: [
|
|
{ desc: "金币", id: 1 },
|
|
{ desc: "礼物", id: 2 },
|
|
{ desc: "铭牌", id: 14 },
|
|
{ desc: "头饰", id: 4 },
|
|
{ desc: "气泡", id: 16 },
|
|
{ desc: "资料卡", id: 17 },
|
|
{ desc: "座驾", id: 3 },
|
|
],
|
|
value2: this.operatioObj.rewardId,
|
|
options2:
|
|
this.operatioObj.rewardType == 2
|
|
? this.giftArr
|
|
: this.operatioObj.rewardType == 3
|
|
? this.carArr
|
|
: this.operatioObj.rewardType == 4
|
|
? this.headArr
|
|
: this.operatioObj.rewardType == 14
|
|
? this.nameplateArr
|
|
: this.operatioObj.rewardType == 16
|
|
? this.bubbleArr
|
|
: this.operatioObj.rewardType == 17
|
|
? this.cardArr
|
|
: "",
|
|
|
|
rewardDays: this.operatioObj.rewardValue,
|
|
rewardGoldNum: this.operatioObj.rewardNum,
|
|
seqNo: this.operatioObj.seqNo,
|
|
};
|
|
this.operationType = 2;
|
|
this.operationTitle = "编辑";
|
|
this.operationDialog = true;
|
|
},
|
|
// 确认按钮
|
|
operationClick() {
|
|
if (this.operationType == 1) {
|
|
// 新增
|
|
weekCardSave({
|
|
groupId: this.operation.days,
|
|
groupName:
|
|
this.operation.days == 1
|
|
? "第一天"
|
|
: this.operation.days == 2
|
|
? "第二天"
|
|
: this.operation.days == 3
|
|
? "第三天"
|
|
: this.operation.days == 4
|
|
? "第四天"
|
|
: this.operation.days == 5
|
|
? "第五天"
|
|
: 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) {
|
|
this.operationDialog = false;
|
|
this.getData();
|
|
this.loading = false;
|
|
} else {
|
|
ElMessage({
|
|
showClose: true,
|
|
message: res.message || "获取数据失败",
|
|
type: "error",
|
|
});
|
|
}
|
|
})
|
|
.catch((error) => {
|
|
console.error("请求出错:", error);
|
|
ElMessage({
|
|
showClose: true,
|
|
message: "请求出错,请稍后重试",
|
|
type: "error",
|
|
});
|
|
});
|
|
} else {
|
|
// 编辑
|
|
weekCardSave({
|
|
groupId: this.operation.days,
|
|
groupName:
|
|
this.operation.days == 1
|
|
? "第一天"
|
|
: this.operation.days == 2
|
|
? "第二天"
|
|
: this.operation.days == 3
|
|
? "第三天"
|
|
: this.operation.days == 4
|
|
? "第四天"
|
|
: this.operation.days == 5
|
|
? "第五天"
|
|
: 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,
|
|
id: this.operatioObj.id,
|
|
partitionId: this.inquire.value1,
|
|
tabId: this.inquire.value2,
|
|
})
|
|
.then((res) => {
|
|
if (res.code === 200) {
|
|
this.getData();
|
|
this.operationDialog = false;
|
|
this.loading = false;
|
|
} else {
|
|
ElMessage({
|
|
showClose: true,
|
|
message: res.message || "获取数据失败",
|
|
type: "error",
|
|
});
|
|
}
|
|
})
|
|
.catch((error) => {
|
|
console.error("请求出错:", error);
|
|
ElMessage({
|
|
showClose: true,
|
|
message: "请求出错,请稍后重试",
|
|
type: "error",
|
|
});
|
|
});
|
|
}
|
|
},
|
|
// 单位判断
|
|
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,
|
|
message: "上传中~",
|
|
type: "warning",
|
|
});
|
|
},
|
|
handleAvatarError() {
|
|
ElMessage({
|
|
showClose: true,
|
|
message: "上传失败!",
|
|
type: "error",
|
|
});
|
|
},
|
|
handleAvatarSuccess(res, file) {
|
|
console.log(file);
|
|
// this.operation.imageUrl1 = URL.createObjectURL();
|
|
this.operation.imageUrl1 = file.response.data;
|
|
ElMessage({
|
|
showClose: true,
|
|
message: "上传成功!",
|
|
type: "success",
|
|
});
|
|
},
|
|
// 分页导航
|
|
handleSizeChange(size) {
|
|
this.pageSize = size;
|
|
this.getData();
|
|
this.loading = false;
|
|
},
|
|
handleCurrentChange(page) {
|
|
this.currentPage = page;
|
|
this.getData();
|
|
this.loading = false;
|
|
},
|
|
JsonFunc(val) {
|
|
var res = JSON.parse(val);
|
|
return res;
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.box {
|
|
padding-top: 20px;
|
|
background: #ecf0f5;
|
|
.inquire {
|
|
display: inline-block;
|
|
margin-right: 20px;
|
|
span {
|
|
margin-right: 10px;
|
|
}
|
|
.input {
|
|
width: 180px;
|
|
margin-right: 10px;
|
|
}
|
|
}
|
|
.paginationClass {
|
|
margin: 15px 0 5px 0px;
|
|
}
|
|
}
|
|
</style>
|
|
<style scoped>
|
|
.avatar-uploader .avatar {
|
|
width: 178px;
|
|
height: 178px;
|
|
display: block;
|
|
}
|
|
.selectBox {
|
|
display: flex;
|
|
height: 35px;
|
|
line-height: 35px;
|
|
margin-bottom: 20px;
|
|
}
|
|
.selectBox span {
|
|
min-width: 80px;
|
|
}
|
|
.selectBoxImg {
|
|
height: 150px;
|
|
}
|
|
</style>
|
|
|
|
<style>
|
|
.avatar-uploader .el-upload {
|
|
border: 1px dashed var(--el-border-color);
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
position: relative;
|
|
overflow: hidden;
|
|
transition: var(--el-transition-duration-fast);
|
|
width: 150px;
|
|
height: 150px;
|
|
}
|
|
|
|
.avatar-uploader .el-upload .el-upload__input {
|
|
display: none;
|
|
}
|
|
.avatar-uploader .el-upload:hover {
|
|
border-color: var(--el-color-primary);
|
|
}
|
|
</style> |