diff --git a/.env.development b/.env.development index cb9a0a3..cea733a 100644 --- a/.env.development +++ b/.env.development @@ -3,6 +3,7 @@ VITE_CLI_PORT = 8088 VITE_SERVER_PORT = 8888 VITE_BASE_API = /api VITE_BASE_PATH = http://192.168.1.133 +//VITE_BASE_PATH = https://admin.api.gwkjxb.com VITE_EDITOR = vscode // VITE_EDITOR = webstorm 如果使用webstorm开发且要使用dom定位到代码行功能 请先自定添加 webstorm到环境变量 再将VITE_EDITOR值修改为webstorm // 如果使用docker-compose开发模式,设置为下面的地址或本机主机IP diff --git a/src/api/integral.js b/src/api/integral.js index 23d9b14..162b79b 100644 --- a/src/api/integral.js +++ b/src/api/integral.js @@ -54,7 +54,7 @@ const api = { editDrawData: data => { // 编辑竞拍 return service({ url: '/lottery', - method: 'post', + method: 'put', data }) }, diff --git a/src/api/userManage.js b/src/api/userManage.js index 02c67bf..7358cb6 100644 --- a/src/api/userManage.js +++ b/src/api/userManage.js @@ -16,8 +16,37 @@ const api = { }, getDealMoneyList: data => { // 获取资金交易明细 return service({ - url: '/user/'+data.id, - method: 'get' + url: '/wallet/log/'+data.id, + method: 'get', + params:data + }) + }, + getDealPointList: data => { // 获取积分交易明细 + return service({ + url: '/point/log/'+data.id, + method: 'get', + params:data + }) + }, + getLearningDetailList: data => { // 获取学习记录 + return service({ + url: '/user/study/record/'+data.id, + method: 'get', + params:data + }) + }, + getLearningDetailReport:data => { // 获取学习报告 + return service({ + url: '/user/study/report/'+data.id, + method: 'get', + params:data + }) + }, + getTestDetailList: data => { // 获取测试记录 + return service({ + url: '/exam/record/'+data.id, + method: 'get', + params:data }) } } diff --git a/src/utils/custom.js b/src/utils/custom.js index e9177a4..76c03cd 100644 --- a/src/utils/custom.js +++ b/src/utils/custom.js @@ -130,6 +130,45 @@ const custom = { else{ return num/flag+'万' } + }, + getDealType() { // 获取交易类型 + return [ + { + name:'课程', + value:1 + }, + { + name:'试卷', + value:4 + },{ + name:'邀请', + value:7 + },{ + name:'提现', + value:8 + },{ + name:'助教', + value:9 + },{ + name:'助教下学员购买试卷', + value:10 + },{ + name:'助教下学员购买课程', + value:11 + },{ + name:'助教下老师卖出试卷', + value:12 + },{ + name:'助教下老师卖出课程', + value:13 + },{ + name:'域内 课程', + value:15 + },{ + name:'域内 试卷', + value:16 + } + ] } } export default custom diff --git a/src/view/dealDetailManage/dealDetailMoney.vue b/src/view/dealDetailManage/dealDetailMoney.vue index a975bb2..b9e448c 100644 --- a/src/view/dealDetailManage/dealDetailMoney.vue +++ b/src/view/dealDetailManage/dealDetailMoney.vue @@ -33,9 +33,12 @@ const dealTypeList = ref([ value:2 }, ]) +const deal_types = ref([]) // 生命周期 onMounted(() => { - // getDealMoneyList() + queryParams.value.id = parseInt(route.params.user_id) + deal_types.value = custom.getDealType() + getDealMoneyList() }) // 方法 async function getDealMoneyList() { @@ -43,6 +46,7 @@ async function getDealMoneyList() { if(res.code === 0) { tableData.value = res.data.records total.value = res.data.total + console.log(res.data) } } function onSubmit() { @@ -64,6 +68,11 @@ function handleSizeChange(val) { queryParams.value.pageSize = val getDealMoneyList() } +function getTypeName(type) { + return deal_types.value.filter((item,i) => { + return item.value == type + })[0].name +} - - - - + + + +
diff --git a/src/view/dealDetailManage/dealDetailPoint.vue b/src/view/dealDetailManage/dealDetailPoint.vue index 64a3d62..f5df15a 100644 --- a/src/view/dealDetailManage/dealDetailPoint.vue +++ b/src/view/dealDetailManage/dealDetailPoint.vue @@ -13,8 +13,15 @@ import {ref,onMounted } from 'vue' import { useRouter, useRoute } from 'vue-router' const router = useRouter() const route = useRoute() +// 生命周期 +onMounted(() => { + queryParams.value.id = parseInt(route.params.user_id) + deal_types.value = custom.getDealType() + getDealPointList() +}) // 变量 const typeList = custom.getExercisesTypeList() +const deal_types = ref([]) const queryParams = ref({ page:1, pageSize:10, @@ -32,10 +39,6 @@ const dealTypeList = ref([ value:2 }, ]) -// 生命周期 -onMounted(() => { - // getDealPointList() -}) // 方法 async function getDealPointList() { const res = await api.getDealPointList(queryParams.value) @@ -63,6 +66,11 @@ function handleSizeChange(val) { queryParams.value.pageSize = val getDealPointList() } +function getTypeName(type) { + return deal_types.value.filter((item,i) => { + return item.value == type + })[0].name +} - - - + + +
diff --git a/src/view/dealDetailManage/learningDetail.vue b/src/view/dealDetailManage/learningDetail.vue index d613647..1dc9a24 100644 --- a/src/view/dealDetailManage/learningDetail.vue +++ b/src/view/dealDetailManage/learningDetail.vue @@ -20,7 +20,6 @@ const queryParams = ref({ user_id:0, last_time:'', subject:'' - }) const subjectParams = ref({ page:1, @@ -28,37 +27,10 @@ const subjectParams = ref({ }) const tableData = ref([]) const subjectList = ref([]) -// const deleteVisible = ref(false) -// const question_ids = ref([]) const total = ref(0) -// const dialogFormVisible = ref(false) -// const dialogTitle = ref('') -// const form =ref({}) -// const rules = ref({ -// name: [{ required: true, message: '请输入课程名称', trigger: 'blur' }] -// }) -// const question_id = ref(0) -// const content = ref(null) -// const options = ref([]) // 答案选项数组 -// const dealTypeList = ref([ -// { -// name:'课程', -// value:1 -// },{ -// name:'测试', -// value:2 -// }, -// ]) -// 生命周期 -onMounted(() => { - // getLearningDetailList() - getSubject() - initChart() -}) -// 方法 -function initChart() { // echart - const myChart = echarts.init(document.getElementById('myEcharts')); - const option = ref({ +// 图表 +// const myChart = echarts.init(document.getElementById('myEcharts')); +const option = ref({ tooltip: { trigger: 'axis', axisPointer: { @@ -90,6 +62,22 @@ function initChart() { // echart } ] }); +// 生命周期 +onMounted(() => { + queryParams.value.id = parseInt(route.params.user_id) + getLearningDetailList() + getSubject() +}) +// 方法 +async function getLearningDetailReport() { + const res = await api.getLearningDetailReport({id:queryParams.value.id}) + if(res.code === 0) { + option.value.series[0].data = res.data + initChart() + } +} +function initChart() { // echart + const myChart = echarts.init(document.getElementById('myEcharts')); option.value && myChart.setOption(option.value); } async function getSubject(){ // 获取课程分类 @@ -104,6 +92,7 @@ async function getLearningDetailList() { if(res.code === 0) { tableData.value = res.data.records total.value = res.data.total + getLearningDetailReport() } } function onSubmit() { @@ -170,16 +159,12 @@ function handleSizeChange(val) { - - - + - +
diff --git a/src/view/dealDetailManage/testDetail.vue b/src/view/dealDetailManage/testDetail.vue index cbd2af5..98fc505 100644 --- a/src/view/dealDetailManage/testDetail.vue +++ b/src/view/dealDetailManage/testDetail.vue @@ -28,7 +28,8 @@ const subjectList = ref([]) const total = ref(0) // 生命周期 onMounted(() => { - // getTestDetailList() + queryParams.value.id = parseInt(route.params.user_id) + getTestDetailList() getSubject() }) // 方法 @@ -66,6 +67,13 @@ function handleSizeChange(val) { queryParams.value.pageSize = val getTestDetailList() } +async function getCourseName(course_id) { + const res = await capi.getCourse({id:course_id}) + if(res.code === 0) { + return res.data.step1.name + } + return '' +}