donghaolin 7 months ago
parent
commit
779b653543
  1. 23
      vue/gold-system/src/assets/css/common.css
  2. 4
      vue/gold-system/src/views/audit/rechargeAudit.vue
  3. 94
      vue/gold-system/src/views/audit/refundAudit.vue
  4. 5
      vue/gold-system/src/views/managerecharge/activity.vue
  5. 8
      vue/gold-system/src/views/recharge/adminRecharge.vue
  6. 4
      vue/gold-system/src/views/recharge/allRecharge.vue
  7. 276
      vue/gold-system/src/views/usergold/index.vue
  8. 722
      vue/gold-system/src/views/workspace/index.vue

23
vue/gold-system/src/assets/css/common.css

@ -24,3 +24,26 @@
display: block; display: block;
background-color: grey; background-color: grey;
} }
.yellow-dot {
margin: 7px 5px 0px 0px;
width: 10px;
height: 10px;
display: block;
background-color: #ffe733;
}
.light-green-dot {
margin: 7px 5px 0px 0px;
width: 10px;
height: 10px;
display: block;
background-color: #35e383;
}
.blue-dot {
margin: 7px 5px 0px 0px;
width: 10px;
height: 10px;
display: block;
background-color: #5f8ff5;
}

4
vue/gold-system/src/views/audit/rechargeAudit.vue

@ -113,7 +113,7 @@ const reset = function () {
rechargeVo.value.area = ''; rechargeVo.value.area = '';
rechargeVo.value.startDate = ''; rechargeVo.value.startDate = '';
rechargeVo.value.endDate = ''; rechargeVo.value.endDate = '';
get();
getTime.value = {};
} }
// //
const getToday = function () { const getToday = function () {
@ -398,7 +398,7 @@ onMounted(async function () {
<div> <div>
<el-table :data="tableData" :height="tableHeight" style="width: 100%"> <el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table-column prop="username" label="姓名" width="100px" /> <el-table-column prop="username" label="姓名" width="100px" />
<el-table-column prop="homilyId" label="精网号" width="150px" />
<el-table-column prop="jwcode" label="精网号" width="150px" />
<el-table-column prop="area" label="所属地区" width="100px" /> <el-table-column prop="area" label="所属地区" width="100px" />
<el-table-column prop="activityName" label="活动名称" width="150px" /> <el-table-column prop="activityName" label="活动名称" width="150px" />
<el-table-column prop="rechargeGold" label="充值金额" width="100px" /> <el-table-column prop="rechargeGold" label="充值金额" width="100px" />

94
vue/gold-system/src/views/audit/refundAudit.vue

@ -9,8 +9,8 @@ import moment from 'moment';
// //
const tableData = ref([]); const tableData = ref([]);
// ====================================== // ======================================
// rechargeVo
const rechargeVo = ref({});
// consumeDetail
const consumeDetail = ref({});
// //
const getObj = ref({ const getObj = ref({
pageNum: 1, pageNum: 1,
@ -38,27 +38,15 @@ const passObj = ref({});
// //
const activeName = ref('all') const activeName = ref('all')
//
const payWay = [
// 退
const refundType = [
{ {
value: '微信',
label: '微信',
value: '退金币',
label: '退金币',
}, },
{ {
value: '支付宝',
label: '支付宝',
},
{
value: '银联',
label: '银联',
},
{
value: '信用卡',
label: '信用卡',
},
{
value: '借记卡',
label: '借记卡',
value: '退商品',
label: '退商品',
}, },
] ]
@ -82,16 +70,16 @@ const get = async function (val) {
// //
if (getTime.value != null) { if (getTime.value != null) {
if (getTime.value.startDate != '' && getTime.value.endDate != '') { if (getTime.value.startDate != '' && getTime.value.endDate != '') {
rechargeVo.value.startDate = getTime.value[0];
rechargeVo.value.endDate = getTime.value[1];
consumeDetail.value.startDate = getTime.value[0];
consumeDetail.value.endDate = getTime.value[1];
} }
} else { } else {
rechargeVo.value.startDate = '';
rechargeVo.value.endDate = '';
consumeDetail.value.startDate = '';
consumeDetail.value.endDate = '';
} }
console.log('搜索参数', getObj.value); console.log('搜索参数', getObj.value);
// POST // POST
const result = await axios.post('http://192.168.8.93:10030/audit/audit/refund', { ...getObj.value, rechargeVo: { ...rechargeVo.value } });
const result = await axios.post('http://192.168.8.93:10030/audit/audit/refund', { ...getObj.value, consumeDetail: { ...consumeDetail.value } });
// //
console.log('请求成功', result); console.log('请求成功', result);
@ -108,12 +96,10 @@ const get = async function (val) {
} }
// //
const reset = function () { const reset = function () {
rechargeVo.value.activityId = '';
rechargeVo.value.payWay = '';
rechargeVo.value.area = '';
rechargeVo.value.startDate = '';
rechargeVo.value.endDate = '';
get();
consumeDetail.value.area = '';
consumeDetail.value.startDate = '';
consumeDetail.value.endDate = '';
getTime.value = {};
} }
// //
const getToday = function () { const getToday = function () {
@ -146,18 +132,18 @@ const get7Days = function () {
// //
const adminAll = function () { const adminAll = function () {
console.log('adminAll'); console.log('adminAll');
rechargeVo.value.status = '';
consumeDetail.value.status = '';
get(); get();
} }
// //
const adminWait = function () { const adminWait = function () {
rechargeVo.value.status = 0;
consumeDetail.value.status = 0;
get(); get();
console.log('adminWait'); console.log('adminWait');
} }
// //
const adminPass = function () { const adminPass = function () {
rechargeVo.value.status = 1;
consumeDetail.value.status = 1;
get(); get();
console.log('adminPass'); console.log('adminPass');
} }
@ -337,18 +323,18 @@ onMounted(async function () {
<el-row style="margin-bottom: 10px;"> <el-row style="margin-bottom: 10px;">
<el-col :span="8"> <el-col :span="8">
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">活动名称</el-text>
<el-select v-model="rechargeVo.activityId" placeholder="请选择活动名称" size="large"
<el-text class="mx-1" size="large">退款类型</el-text>
<el-select v-model="consumeDetail.refundType" placeholder="请选择退款类型" size="large"
style="width: 240px"> style="width: 240px">
<el-option v-for="item in activity" :key="item.activityId" :label="item.activityName"
:value="item.activityId" />
<el-option v-for="item in refundType" :key="item.value" :label="item.label"
:value="item.value" />
</el-select> </el-select>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">支付方式</el-text>
<el-select v-model="rechargeVo.payWay" placeholder="请选择支付方式" size="large"
<el-text class="mx-1" size="large">退款商品</el-text>
<el-select v-model="consumeDetail.refundGoods" placeholder="请选择退款商品" size="large"
style="width: 240px"> style="width: 240px">
<el-option v-for="item in payWay" :key="item.value" :label="item.label" <el-option v-for="item in payWay" :key="item.value" :label="item.label"
:value="item.value" /> :value="item.value" />
@ -359,7 +345,7 @@ onMounted(async function () {
<el-col :span="8"> <el-col :span="8">
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">所属地区</el-text> <el-text class="mx-1" size="large">所属地区</el-text>
<el-select v-model="rechargeVo.area" placeholder="请选择所属地区" size="large"
<el-select v-model="consumeDetail.area" placeholder="请选择所属地区" size="large"
style="width: 240px"> style="width: 240px">
<el-option v-for="item in area" :key="item" :label="item" :value="item" /> <el-option v-for="item in area" :key="item" :label="item" :value="item" />
</el-select> </el-select>
@ -397,21 +383,21 @@ onMounted(async function () {
</el-tabs> </el-tabs>
<div> <div>
<el-table :data="tableData" :height="tableHeight" style="width: 100%"> <el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table-column prop="name" label="姓名" width="100px" />
<el-table-column prop="homilyId" label="精网号" width="150px" />
<el-table-column prop="user" label="姓名" width="100px" />
<el-table-column prop="jwcode" label="精网号" width="150px" />
<el-table-column prop="area" label="所属地区" width="100px" /> <el-table-column prop="area" label="所属地区" width="100px" />
<el-table-column prop="refundType" label="退款类型" width="150px" /> <el-table-column prop="refundType" label="退款类型" width="150px" />
<el-table-column prop="goods" label="退款商品" width="100px" />
<el-table-column prop="refundCoin" label="退款金币数" width="100px" >
<el-table-column prop="refundGoods" label="退款商品" width="100px" />
<el-table-column prop="refundCoin" label="退款金币数" width="100px">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.rechargeCoin+scope.row.freeCoin+scope.row.taskCoin }}</span>
<span>{{ scope.row.rechargeCoin + scope.row.freeCoin + scope.row.taskCoin }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="rechargeCoin" label="充值金币" width="100px" /> <el-table-column prop="rechargeCoin" label="充值金币" width="100px" />
<el-table-column prop="freeCoin" label="免费金币" width="100px" /> <el-table-column prop="freeCoin" label="免费金币" width="100px" />
<el-table-column prop="taskCoin" label="任务金币" width="100px" /> <el-table-column prop="taskCoin" label="任务金币" width="100px" />
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip /> <el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip />
<el-table-column prop="adminName" label="提交人" width="100px" />
<el-table-column prop="name" label="提交人" width="100px" />
<el-table-column prop="status" label="审核状态" width="100px"> <el-table-column prop="status" label="审核状态" width="100px">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.status === 1"> <span v-if="scope.row.status === 1">
@ -435,13 +421,18 @@ onMounted(async function () {
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="reson" label="驳回理由" width="200px" show-overflow-tooltip /> <el-table-column prop="reson" label="驳回理由" width="200px" show-overflow-tooltip />
<el-table-column prop="createTime" label="提交时间" width="200px" />
<el-table-column prop="createTime" label="提交时间" width="200px">
<template #default="scope">
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column fixed="right" prop="operation" label="操作" width="150px"> <el-table-column fixed="right" prop="operation" label="操作" width="150px">
<template #default="scope"> <template #default="scope">
<div class="operation"> <div class="operation">
<el-popconfirm title="确定要通过此条记录吗?" @confirm="passConfirm"> <el-popconfirm title="确定要通过此条记录吗?" @confirm="passConfirm">
<template #reference> <template #reference>
<el-button :disabled='((scope.row.status === 1 )||(scope.row.status === 2)) ? true : false'
<el-button
:disabled='((scope.row.status === 1) || (scope.row.status === 2)) ? true : false'
type="primary" text @click="pass(scope.row)"> type="primary" text @click="pass(scope.row)">
通过 通过
</el-button> </el-button>
@ -453,8 +444,9 @@ onMounted(async function () {
</el-button> </el-button>
</template> </template>
</el-popconfirm> </el-popconfirm>
<el-button :disabled='((scope.row.status === 1 )||(scope.row.status === 2)) ? true : false' type="primary" text
@click="reject(scope.row)">
<el-button
:disabled='((scope.row.status === 1) || (scope.row.status === 2)) ? true : false'
type="primary" text @click="reject(scope.row)">
驳回 驳回
</el-button> </el-button>
</div> </div>

5
vue/gold-system/src/views/managerecharge/activity.vue

@ -8,8 +8,8 @@ import moment from 'moment';
// //
const admin = ref({ const admin = ref({
adminId: 1, adminId: 1,
name: '客服A',
area: '新加坡'
name: '赵刚',
area: '中国'
}) })
// //
const tableData = ref([]); const tableData = ref([]);
@ -83,7 +83,6 @@ const reset = function () {
getObj.value.pageSize = 5; getObj.value.pageSize = 5;
getTime.value = {}; getTime.value = {};
activity.value = {}; activity.value = {};
get();
} }
// //
const addActivityVisible = ref(false) const addActivityVisible = ref(false)

8
vue/gold-system/src/views/recharge/adminRecharge.vue

@ -9,8 +9,8 @@ import moment from 'moment';
// //
const admin = ref({ const admin = ref({
adminId: 1, adminId: 1,
name: '客服A',
area: '新加坡'
name: '赵刚',
area: '中国'
}) })
// //
@ -113,7 +113,7 @@ const reset = function () {
rechargeVo.value.area = ''; rechargeVo.value.area = '';
rechargeVo.value.startDate = ''; rechargeVo.value.startDate = '';
rechargeVo.value.endDate = ''; rechargeVo.value.endDate = '';
get();
getTime.value = {};
} }
// //
const getToday = function () { const getToday = function () {
@ -337,7 +337,7 @@ onMounted(async function () {
<div> <div>
<el-table :data="tableData" :height="tableHeight" style="width: 100%"> <el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table-column prop="username" label="姓名" width="100px" /> <el-table-column prop="username" label="姓名" width="100px" />
<el-table-column prop="homilyId" label="精网号" width="150px" />
<el-table-column prop="jwcode" label="精网号" width="150px" />
<el-table-column prop="area" label="所属地区" width="100px" /> <el-table-column prop="area" label="所属地区" width="100px" />
<el-table-column prop="activityName" label="活动名称" width="150px" /> <el-table-column prop="activityName" label="活动名称" width="150px" />
<el-table-column prop="rechargeGold" label="充值金额" width="100px" /> <el-table-column prop="rechargeGold" label="充值金额" width="100px" />

4
vue/gold-system/src/views/recharge/allRecharge.vue

@ -103,7 +103,7 @@ const reset = function () {
rechargeVo.value.area = ''; rechargeVo.value.area = '';
rechargeVo.value.startDate = ''; rechargeVo.value.startDate = '';
rechargeVo.value.endDate = ''; rechargeVo.value.endDate = '';
get();
getTime.value={};
} }
// //
const getToday = function () { const getToday = function () {
@ -306,7 +306,7 @@ onMounted(async function () {
<div> <div>
<el-table :data="tableData" :height="tableHeight" style="width: 100%"> <el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table-column prop="username" label="姓名" width="100px" /> <el-table-column prop="username" label="姓名" width="100px" />
<el-table-column prop="homilyId" label="精网号" width="150px" />
<el-table-column prop="jwcode" label="精网号" width="150px" />
<el-table-column prop="area" label="所属地区" width="100px" /> <el-table-column prop="area" label="所属地区" width="100px" />
<el-table-column prop="activityName" label="活动名称" width="150px" /> <el-table-column prop="activityName" label="活动名称" width="150px" />
<el-table-column prop="rechargeGold" label="充值金额" width="100px" /> <el-table-column prop="rechargeGold" label="充值金额" width="100px" />

276
vue/gold-system/src/views/usergold/index.vue

@ -1,128 +1,123 @@
<script setup> <script setup>
import { ref, onMounted, reactive, computed } from "vue"; import { ref, onMounted, reactive, computed } from "vue";
import ElementPlus from "element-plus"; import ElementPlus from "element-plus";
const tableData = [
{
activityName: '这是活动名称',
startTime: '2023-12-22 00:00:00',
endTime: '2024-12-22 23:59:59',
rechargeRatio: '10:1',
status: '进行中',
adminName: '张三',
createTime: '2023-01-01 00:00:00',
},
{
activityName: '这是活动名称2',
startTime: '2023-12-22 00:00:00',
endTime: '2024-12-22 23:59:59',
rechargeRatio: '5:1',
status: '进行中',
adminName: '张三',
createTime: '2023-01-01 00:00:00',
},
{
activityName: '这是活动名称3',
startTime: '2024-12-22 00:00:00',
endTime: '2025-12-22 23:59:59',
rechargeRatio: '10:1',
status: '未开始',
adminName: '张三',
createTime: '2023-01-01 00:00:00',
},
{
activityName: '这是活动名称4',
startTime: '2024-12-22 00:00:00',
endTime: '2025-12-22 23:59:59',
rechargeRatio: '5:1',
status: '未开始',
adminName: '张三',
createTime: '2023-01-01 00:00:00',
},
{
activityName: '这是活动名称5',
startTime: '2023-01-01 00:00:00',
endTime: '2023-12-22 23:59:59',
rechargeRatio: '10:1',
status: '已结束',
adminName: '张三',
createTime: '2023-01-01 00:00:00',
},
{
activityName: '这是活动名称6',
startTime: '2023-01-01 00:00:00',
endTime: '2023-12-22 23:59:59',
rechargeRatio: '5:1',
status: '已结束',
adminName: '张三',
createTime: '2023-01-01 00:00:00',
},
]
//
const value = ref('')
const options = [
{
value: 'Option1',
label: 'Option1',
},
{
value: 'Option2',
label: 'Option2',
},
import axios from 'axios';
//
const tableData = ref([]);
// ===========================================
// detail
const detail = ref({});
//
const getObj = ref({
pageNum: 1,
pageSize: 5,
});
//
const total = ref(100);
//
const getTime = ref([]);
//
const updateType = [
{ {
value: 'Option3',
label: 'Option3',
value: '充值',
label: '充值',
}, },
{ {
value: 'Option4',
label: 'Option4',
value: '消费',
label: '消费',
}, },
{ {
value: 'Option5',
label: 'Option5',
value: '退款',
label: '退款',
}, },
] ]
//
const tableHeight = computed(function () {
return (getObj.value.pageSize + 2) * 60 + 'px';
});
//
// ===========================================================================
//
const get = async function (val) {
try {
//
if (typeof val === 'number') {
getObj.value.pageNum = val;
}
//
if (getTime.value != null) {
if (getTime.value.startDate != '' && getTime.value.endDate != '') {
detail.value.startDate = getTime.value[0];
detail.value.endDate = getTime.value[1];
}
} else {
detail.value.startDate = '';
detail.value.endDate = '';
}
console.log('搜索参数', getObj.value);
// POST
const result = await axios.post('http://192.168.8.93:10040/detail', { ...getObj.value, detail: { ...detail.value } });
//
console.log('请求成功', result);
//
tableData.value = result.data.data.list;
console.log('tableData', tableData.value);
//
total.value = result.data.data.total;
console.log('total', total.value);
} catch (error) {
console.log('请求失败', error);
//
}
}
//
const getObj = ref({
page: 1,
size: 10,
})
//
const total = ref(100)
//
const addActivityVisible = ref(false)
//
const openAddActivityVisible = function () {
addActivityVisible.value = true
//
const reset = function () {
detail.value.jwcode = '';
detail.value.updateType = '';
detail.value.startDate = '';
detail.value.endDate = '';
getTime.value = {};
} }
//
const closeAddActivityVisible = function () {
addActivityVisible.value = false
//
const getToday = function () {
const today = new Date();
const startDate = new Date(today.getFullYear(), today.getMonth(), today.getDate());
const endDate = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1);
getTime.value = [startDate, endDate];
console.log('getTime', getTime.value);
get();
} }
//
const addActicity = function () {
openAddActivityVisible();
//
const getYesterday = function () {
const yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
const startDate = new Date(yesterday.getFullYear(), yesterday.getMonth(), yesterday.getDate());
const endDate = new Date(yesterday.getFullYear(), yesterday.getMonth(), yesterday.getDate() + 1);
getTime.value = [startDate, endDate];
console.log('getTime', getTime.value);
get();
}
// 7
const get7Days = function () {
const today = new Date();
const startDate = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 6);
const endDate = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1);
getTime.value = [startDate, endDate];
console.log('getTime', getTime.value);
get();
} }
//
const addObj = reactive({
activityName: '',
freeGold: '',
rechargeRatio: '',
startTime: '',
endTime: '',
adminName: '',
})
const Delete = function (index, row) {
console.log(index, row)
}
//
onMounted(async function () {
await get();
})
</script> </script>
@ -133,23 +128,23 @@ const Delete = function (index, row) {
<div class="head-card"> <div class="head-card">
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">精网号</el-text> <el-text class="mx-1" size="large">精网号</el-text>
<el-input v-model="input" style="width: 240px" placeholder="请输入活动名称" clearable />
<el-input v-model="detail.jwcode" style="width: 240px" placeholder="请输入精网号" clearable />
</div> </div>
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">更新类型</el-text> <el-text class="mx-1" size="large">更新类型</el-text>
<el-select v-model="value" placeholder="请选择活动名称" size="large" style="width: 240px">
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
<el-select v-model="detail.updateType" placeholder="请选择更新类型" size="large" style="width: 240px">
<el-option v-for="item in updateType" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</div> </div>
<div class="head-card-element"> <div class="head-card-element">
<el-text class="mx-1" size="large">更新时间</el-text> <el-text class="mx-1" size="large">更新时间</el-text>
<el-time-picker v-model="value1" is-range range-separator="" start-placeholder="起始时间"
<el-time-picker v-model="getTime" is-range range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" /> end-placeholder="结束时间" />
</div> </div>
<div class="head-card-btn"> <div class="head-card-btn">
<el-button>重置</el-button>
<el-button type="primary">查询</el-button>
<el-button @click="reset()">重置</el-button>
<el-button type="primary" @click="get()">查询</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
@ -164,21 +159,24 @@ const Delete = function (index, row) {
<div> <div>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column prop="name" label="姓名" /> <el-table-column prop="name" label="姓名" />
<el-table-column prop="homilyId" label="精网号" />
<el-table-column prop="jwcode" label="精网号" />
<el-table-column prop="area" label="所属地区" /> <el-table-column prop="area" label="所属地区" />
<el-table-column prop="gold" label="更新数量" />
<el-table-column prop="gold" label="更新数量">
<template #default="scope">
<span>{{ scope.row.rechargeCoin + scope.row.freeCoin + scope.row.taskCoin }}</span>
</template>
</el-table-column>
<el-table-column prop="updateType" label="更新类型" /> <el-table-column prop="updateType" label="更新类型" />
<el-table-column prop="freeCoin" label="免费金币" />
<el-table-column prop="rechargeCoin" label="充值金币" />
<el-table-column prop="taskCoin" label="任务金币" />
<el-table-column prop="commitName" label="提交人" />
<el-table-column prop="createTime" label="更新时间" />
<el-table-column prop="freeCoin" label="免费金币" />
<el-table-column prop="rechargeCoin" label="充值金币" />
<el-table-column prop="taskCoin" label="任务金币" />
<el-table-column prop="name" label="提交人" />
<el-table-column prop="createTime" label="更新时间" />
</el-table> </el-table>
</div> </div>
<!-- 分页 --> <!-- 分页 -->
<el-pagination background
layout="prev, pager, next" :total="total" />
<el-pagination background layout="prev, pager, next" :total="total" />
</el-card> </el-card>
</el-col> </el-col>
@ -186,22 +184,20 @@ const Delete = function (index, row) {
</template> </template>
<style scoped>
<style scoped>
.status {
display: flex;
}
.head-card {
display: flex;
}
.status {
display: flex;
}
.head-card-element {
margin-right: 20px;
}
.head-card {
display: flex;
}
.head-card-element {
margin-right: 20px;
}
.head-card-btn {
margin-left: auto;
}
.head-card-btn {
margin-left: auto;
}
</style> </style>

722
vue/gold-system/src/views/workspace/index.vue

@ -3,236 +3,406 @@ import { all } from 'axios';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { ref, onMounted, reactive, computed } from "vue"; import { ref, onMounted, reactive, computed } from "vue";
import { VscInfo } from 'vue-icons-plus/vsc' import { VscInfo } from 'vue-icons-plus/vsc'
import { Bs1CircleFill, Bs2CircleFill, Bs3CircleFill, Bs4Circle, Bs5Circle, Bs6Circle, Bs7Circle, Bs8Circle } from 'vue-icons-plus/bs'
//
//
const getObj = ref({
goldType: '',
platform: 'all',
});
// //
const activeName = ref('recharge') const activeName = ref('recharge')
//
const platform = ref('all')
//
const gold = [
{
value: '',
label: '全部类型',
},
{
value: 'rechargeGole',
label: '充值金币',
},
{
value: 'freeGold',
label: '免费金币',
},
{
value: 'taskGold',
label: '付费金币',
},
]
//
//
const option1 = {
tooltip: {
trigger: 'axis',
axisPointer: {
// Use axis to trigger tooltip
type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
}
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
onMounted(function () {
// domecharts
var rechargeBar = echarts.init(document.getElementById('recharge'));
//
var option = {
title: {
text: 'ECharts 入门示例'
},
series: [
{
name: '充值金币',
color: '#35e383',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [320, 302, 301, 334, 390, 330, 320]
}, },
tooltip: {},
legend: {
data: ['销量']
{
name: '免费金币',
color: '#5f8ff5',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '任务金币',
color: '#ffe733',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [220, 182, 191, 234, 290, 330, 310]
}
]
};
const option2 = {
tooltip: {
trigger: 'axis',
axisPointer: {
// Use axis to trigger tooltip
type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
}
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
name: '充值金币',
color: '#35e383',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [320, 302, 301, 334, 390, 330, 320]
}, },
xAxis: {
data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
{
name: '免费金币',
color: '#5f8ff5',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [120, 132, 101, 134, 90, 230, 210]
}, },
yAxis: {},
series: [
{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}
]
};
{
name: '任务金币',
color: '#ffe733',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [220, 182, 191, 234, 290, 330, 310]
}
]
};
const option3 = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
const option4 = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
const option5 = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
const option6 = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
const list = ref([]);
//
//
const get = function () {
console.log(getObj.value);
}
//
const allPlatform = function () {
list.value = [
{ value: 100, name: '项目1' },
{ value: 100, name: '项目2' },
{ value: 100, name: '项目3' },
{ value: 100, name: '项目4' },
{ value: 100, name: '项目5' }
]
option6.series.data = list.value;
// 4 domecharts
var pie = echarts.init(document.getElementById('goldCategory'));
// 使 // 使
rechargeBar.setOption(option);
pie.setOption(option6);
getObj.value.platform = 'all';
get();
}
// HC
const HomilyChart = function () {
list.value = [
{ value: 100, name: '项目1' },
{ value: 200, name: '项目2' },
{ value: 300, name: '项目3' },
{ value: 400, name: '项目4' },
{ value: 500, name: '项目5' }
]
getObj.value.platform = 'HomilyChart';
get();
}
// Link
const HomilyLink = function () {
list.value = [
{ value: 100, name: '项目1' },
{ value: 200, name: '项目2' },
{ value: 100, name: '项目3' },
{ value: 200, name: '项目4' },
{ value: 100, name: '项目5' }
]
getObj.value.platform = 'HomilyLink';
get();
}
onMounted(function () {
get();
// domecharts
var rechargeBar = echarts.init(document.getElementById('recharge'));
// 使
rechargeBar.setOption(option1);
// domecharts // domecharts
var consumeBar = echarts.init(document.getElementById('consume')); var consumeBar = echarts.init(document.getElementById('consume'));
//
var option = {
title: {
text: 'ECharts 入门示例'
},
tooltip: {},
legend: {
data: ['销量']
},
xAxis: {
data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
},
yAxis: {},
series: [
{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}
]
};
// 使 // 使
consumeBar.setOption(option);
consumeBar.setOption(option2);
// domecharts // domecharts
var yearRechargePie = echarts.init(document.getElementById('yearRecharge')); var yearRechargePie = echarts.init(document.getElementById('yearRecharge'));
var option = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
// 使 // 使
yearRechargePie.setOption(option);
yearRechargePie.setOption(option3);
// domecharts // domecharts
var yearConsumePie = echarts.init(document.getElementById('yearConsume')); var yearConsumePie = echarts.init(document.getElementById('yearConsume'));
var option = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
// 使 // 使
yearConsumePie.setOption(option);
yearConsumePie.setOption(option4);
// domecharts // domecharts
var nowGoldPie = echarts.init(document.getElementById('nowGold')); var nowGoldPie = echarts.init(document.getElementById('nowGold'));
var option = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
// 使 // 使
nowGoldPie.setOption(option);
nowGoldPie.setOption(option5);
// domecharts
// 4 domecharts
var goldCategoryPie = echarts.init(document.getElementById('goldCategory')); var goldCategoryPie = echarts.init(document.getElementById('goldCategory'));
var option = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
// 使 // 使
goldCategoryPie.setOption(option);
goldCategoryPie.setOption(option6);
}) })
@ -279,10 +449,124 @@ onMounted(function () {
<el-card> <el-card>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="金币充值" name="recharge"> <el-tab-pane label="金币充值" name="recharge">
<div id="recharge" style="width: 600px;height:400px;"></div>
<div class="bar">
<div id="recharge" style="width: 1200px;height:400px;"></div>
<div>
<div class="goldCategory">
<span class="light-green-dot"></span>
<span>充值金币</span>
</div>
<div class="goldCategory">
<span class="blue-dot"></span>
<span>免费金币</span>
</div>
<div class="goldCategory">
<span class="yellow-dot"></span>
<span>任务金币</span>
</div>
</div>
<div>
<div class="ranking-header">
<span style="margin-right: 40px;">门店金币充值排名</span>
<el-select v-model="getObj.goldType" placeholder="请选择金币类型" size="small"
style="width: 90px;">
<el-option v-for="item in gold" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</div>
<div>
<div class="ranking-item">
<Bs1CircleFill />
</div>
<div class="ranking-item">
<Bs2CircleFill />
</div>
<div class="ranking-item">
<Bs3CircleFill />
</div>
<div class="ranking-item">
<Bs4Circle />
</div>
<div class="ranking-item">
<Bs5Circle />
</div>
<div class="ranking-item">
<Bs1Circle />
</div>
<div class="ranking-item">
<Bs6Circle />
</div>
<div class="ranking-item">
<Bs7Circle />
</div>
<div class="ranking-item">
<Bs8Circle />
</div>
</div>
</div>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="金币消费" name="consume"> <el-tab-pane label="金币消费" name="consume">
<div id="consume" style="width: 600px;height:400px;"></div>
<div class="bar">
<div id="consume" style="width: 1200px;height:400px;"></div>
<div>
<div class="goldCategory">
<span class="light-green-dot"></span>
<span>充值金币</span>
</div>
<div class="goldCategory">
<span class="blue-dot"></span>
<span>免费金币</span>
</div>
<div class="goldCategory">
<span class="yellow-dot"></span>
<span>任务金币</span>
</div>
</div>
<div>
<div class="ranking-header">
<span style="margin-right: 40px;">门店金币消费排名</span>
<el-select v-model="getObj.goldType" placeholder="请选择金币类型" size="small"
style="width: 90px;">
<el-option v-for="item in gold" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</div>
<div>
<div class="ranking-item">
<Bs1CircleFill />
</div>
<div class="ranking-item">
<Bs2CircleFill />
</div>
<div class="ranking-item">
<Bs3CircleFill />
</div>
<div class="ranking-item">
<Bs4Circle />
</div>
<div class="ranking-item">
<Bs5Circle />
</div>
<div class="ranking-item">
<Bs1Circle />
</div>
<div class="ranking-item">
<Bs6Circle />
</div>
<div class="ranking-item">
<Bs7Circle />
</div>
<div class="ranking-item">
<Bs8Circle />
</div>
</div>
</div>
</div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -309,11 +593,11 @@ onMounted(function () {
<template #header> <template #header>
<div class="card-header" style="display: flex;"> <div class="card-header" style="display: flex;">
<span>金币消耗类别占比</span> <span>金币消耗类别占比</span>
<el-radio-group v-model="platform" fill="#ffffff" text-color="#409eff" size="small"
<el-radio-group v-model="getObj.platform" fill="#ffffff" text-color="#409eff" size="small"
style="margin-left: auto;"> style="margin-left: auto;">
<el-radio-button label="全部平台" value="all" />
<el-radio-button label="HC" value="hc" />
<el-radio-button label="Link" value="link" />
<el-radio-button label="全部平台" value="all" @click="allPlatform()" />
<el-radio-button label="HC" value="hc" @click="HomilyChart()" />
<el-radio-button label="Link" value="link" @click="HomilyLink()" />
</el-radio-group> </el-radio-group>
</div> </div>
</template> </template>
@ -324,7 +608,25 @@ onMounted(function () {
</template> </template>
<style scoped> <style scoped>
.pie{
.ranking-item {
margin-bottom: 10px;
}
.ranking-header {
margin-bottom: 10px;
display: flex;
}
.goldCategory {
margin-right: 20px;
display: flex;
}
.bar {
display: flex;
}
.pie {
display: flex; display: flex;
} }

Loading…
Cancel
Save