Commit d1c1e6c1 by 岑成威

fix: 新增轻改短课程

1 parent 45865762
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-07 17:09:53
* @LastEditors: limin
* @LastEditTime: 2026-02-05 17:52:25
* @FilePath: \gl_tape\App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script> <script>
const PATH = ['/pages/common/caseDetail'] const PATH = ['/pages/common/caseDetail']
const keepAlive = uni.requireNativePlugin('Ba-KeepAliveSuit') const keepAlive = uni.requireNativePlugin('Ba-KeepAliveSuit')
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { Ws } from '@/ws/Ws.js' import { Ws } from '@/ws/Ws.js'
import { RecordSaveService, UploadService } from '@/utils/recordManager/index.js' import { RecordSaveService, UploadService } from '@/utils/recordManager/index.js'
export default { export default {
computed: { computed: {
...mapState('audio', ['isEnd', 'isStart']) ...mapState('audio', ['isEnd', 'isStart'])
}, },
...@@ -21,10 +13,10 @@ export default { ...@@ -21,10 +13,10 @@ export default {
}, },
onLaunch: async function () { onLaunch: async function () {
this.onKeep() this.onKeep()
// this.setAPPVersion() this.setAPPVersion()
setTimeout(() => { setTimeout(() => {
// plus.screen.unlockOrientation() //解除锁定屏幕方向 plus.screen.unlockOrientation() //解除锁定屏幕方向
// plus.screen.lockOrientation('landscape-primary') plus.screen.lockOrientation('landscape-primary')
}, 300) }, 300)
uni.setKeepScreenOn({ uni.setKeepScreenOn({
keepScreenOn: true keepScreenOn: true
...@@ -55,7 +47,6 @@ export default { ...@@ -55,7 +47,6 @@ export default {
uni.$storage.set('storageVersion', version) uni.$storage.set('storageVersion', version)
} }
}, },
onShow: async function () { onShow: async function () {
this.$store.dispatch('setBackgroundState', false) this.$store.dispatch('setBackgroundState', false)
this.$store.dispatch('setActivityWindowPopCount', 1) //冷启动重置活动弹框次数 this.$store.dispatch('setActivityWindowPopCount', 1) //冷启动重置活动弹框次数
...@@ -111,54 +102,47 @@ export default { ...@@ -111,54 +102,47 @@ export default {
console.error('Promise 异常上报失败:', error) console.error('Promise 异常上报失败:', error)
} }
} }
} }
</script> </script>
<style lang="scss">
<style lang="scss"> page {
page {
font-size: 28rpx; font-size: 28rpx;
height: 100%; height: 100%;
min-height: 100%; min-height: 100%;
} }
view,
view, navigator,
navigator, image,
image, text,
text, scroll-view,
scroll-view, swiper,
swiper, swiper-item,
swiper-item, input,
input, textarea,
textarea, button {
button {
box-sizing: border-box; box-sizing: border-box;
} }
/* 文字避头尾法则 */
/* 文字避头尾法则 */ .btw {
.btw {
table-layout: fixed; table-layout: fixed;
word-wrap: break-word; word-wrap: break-word;
word-break: normal; word-break: normal;
text-align: justify; text-align: justify;
text-justify: inter-ideograph; text-justify: inter-ideograph;
} }
.bg-white {
.bg-white {
background: #fff; background: #fff;
} }
.font-weight {
.font-weight {
font-weight: bold; font-weight: bold;
} }
.u-flex-center {
.u-flex-center {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
button {
button {
margin: 0; margin: 0;
padding: 0; padding: 0;
line-height: 1.5; line-height: 1.5;
...@@ -166,22 +150,20 @@ button { ...@@ -166,22 +150,20 @@ button {
background-color: transparent; background-color: transparent;
border-radius: 0; border-radius: 0;
position: relative; position: relative;
} }
button::after {
button::after {
border: none; border: none;
} }
// 指定按钮按下去的样式类
// 指定按钮按下去的样式类 .button-hover {
.button-hover {
transform: translate(1rpx, 1rpx); transform: translate(1rpx, 1rpx);
} }
.webview-container {
.webview-container {
position: absolute; position: absolute;
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
top: 0rpx; top: 0rpx;
left: 0rpx; left: 0rpx;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -451,6 +451,20 @@ module.exports = { ...@@ -451,6 +451,20 @@ module.exports = {
...data ...data
}) })
}, },
// 学习中心-轻改短课程详情
getLightShortCourseDetail(data) {
return http.post({
method: 'dj.pad.api.staff.light.short.course.task.detail',
projectName: 'pad',
...data
})
},
// 学习中心-轻改短课程改进明细
getImprovementDetails(data) {
return http.get({
method: 'http://192.168.1.173:8422/data?recording_id=100002',
})
},
// 学习中心-长课程详情 // 学习中心-长课程详情
getLongCourseDetail(data) { getLongCourseDetail(data) {
return http.post({ return http.post({
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 2 const index = 1
/** /**
* *
0本地 0本地
......
...@@ -5,7 +5,8 @@ const moduleTypeEnum = { ...@@ -5,7 +5,8 @@ const moduleTypeEnum = {
3: '短课程学习', 3: '短课程学习',
4: '长课程学习', 4: '长课程学习',
5: '活动中心', 5: '活动中心',
7: '优秀案例学习' 7: '优秀案例学习',
9: '轻改短课程学习'
} }
const moduleIconEnum = { const moduleIconEnum = {
...@@ -15,7 +16,8 @@ const moduleIconEnum = { ...@@ -15,7 +16,8 @@ const moduleIconEnum = {
3: 'notice-study', 3: 'notice-study',
4: 'notice-study', 4: 'notice-study',
5: 'active-msg', 5: 'active-msg',
7: 'notice-recording' 7: 'notice-recording',
9: 'short-course-learn-room'
} }
const moduleContentEnum = { const moduleContentEnum = {
......
...@@ -73,6 +73,7 @@ export default { ...@@ -73,6 +73,7 @@ export default {
earlyWarnList: [], earlyWarnList: [],
systemList: [], systemList: [],
shortCourseList: [], shortCourseList: [],
lightShortCourseList: [],
longCourseList: [], longCourseList: [],
activityList: [], activityList: [],
caseList: [], caseList: [],
...@@ -98,7 +99,7 @@ export default { ...@@ -98,7 +99,7 @@ export default {
let contentRow = '' let contentRow = ''
// 标题逻辑 // 标题逻辑
if (moduleType === 3 || moduleType === 4) { if (moduleType === 3 || moduleType === 4 || moduleType === 9) {
displayTitle = item.title displayTitle = item.title
} else if (moduleType === 7) { } else if (moduleType === 7) {
displayTitle = this.reminderTypeEnum[item.reminderType] displayTitle = this.reminderTypeEnum[item.reminderType]
...@@ -110,7 +111,7 @@ export default { ...@@ -110,7 +111,7 @@ export default {
const fmt = (t) => this.formatTime(t, 'YYYY-MM-DD HH:mm:ss') const fmt = (t) => this.formatTime(t, 'YYYY-MM-DD HH:mm:ss')
// 任务和内容逻辑 // 任务和内容逻辑
if (moduleType === 3 || moduleType === 4) { if (moduleType === 3 || moduleType === 4 || moduleType === 9) {
if (item.taskType == 1) { if (item.taskType == 1) {
taskNameRow = `学习任务名称:${item.taskName}` taskNameRow = `学习任务名称:${item.taskName}`
finishTimeRow = `任务完成时间:小伙伴,请于${fmt(item.finishTime)}完成哦~` finishTimeRow = `任务完成时间:小伙伴,请于${fmt(item.finishTime)}完成哦~`
...@@ -160,6 +161,8 @@ export default { ...@@ -160,6 +161,8 @@ export default {
return this.earlyWarnList return this.earlyWarnList
case 3: case 3:
return this.shortCourseList return this.shortCourseList
case 9:
return this.lightShortCourseList
case 4: case 4:
return this.longCourseList return this.longCourseList
case 5: case 5:
...@@ -201,7 +204,7 @@ export default { ...@@ -201,7 +204,7 @@ export default {
if (moduleType === 0) { if (moduleType === 0) {
return !item.readFlag return !item.readFlag
} }
if ([1, 2, 3, 4, 5, 6, 7].includes(moduleType)) { if ([1, 2, 3, 4, 5, 6, 7, 9].includes(moduleType)) {
return item.status == 0 return item.status == 0
} }
return false return false
...@@ -226,6 +229,9 @@ export default { ...@@ -226,6 +229,9 @@ export default {
case 3: case 3:
this.getCourseList(3) this.getCourseList(3)
break break
case 9:
this.getCourseList(9)
break
case 4: case 4:
this.getCourseList(4) this.getCourseList(4)
break break
...@@ -415,6 +421,13 @@ export default { ...@@ -415,6 +421,13 @@ export default {
console.error('调用 getCourseList 方法时出错:', error) console.error('调用 getCourseList 方法时出错:', error)
} }
break break
case 9:
try {
this.getCourseList(9)
} catch (error) {
console.error('调用 getCourseList 方法时出错:', error)
}
break
case 4: case 4:
try { try {
this.getCourseList(4) this.getCourseList(4)
...@@ -546,7 +559,7 @@ export default { ...@@ -546,7 +559,7 @@ export default {
}) })
break break
case 9: case 9:
console.log('短课程学习跳转') console.log('轻改短课程学习跳转')
uni.$track.add({ eventCode: 'app_short_course', businessId: item.detailId, pagePath: '/pages/common/serviceDetail/index' }) uni.$track.add({ eventCode: 'app_short_course', businessId: item.detailId, pagePath: '/pages/common/serviceDetail/index' })
// const row = { // const row = {
// ...item, // ...item,
...@@ -580,9 +593,13 @@ export default { ...@@ -580,9 +593,13 @@ export default {
e.time = e.actualSendTimeStr e.time = e.actualSendTimeStr
}) })
if (pageNum == 1) { if (pageNum == 1) {
moduleType == 3 ? (this.shortCourseList = res.list) : (this.longCourseList = res.list) if (moduleType == 3) this.shortCourseList = res.list
else if (moduleType == 4) this.longCourseList = res.list
else if (moduleType == 9) this.lightShortCourseList = res.list
} else { } else {
moduleType == 3 ? (this.shortCourseList = this.shortCourseList.concat(res.list)) : (this.longCourseList = this.longCourseList.concat(res.list)) if (moduleType == 3) this.shortCourseList = this.shortCourseList.concat(res.list)
else if (moduleType == 4) this.longCourseList = this.longCourseList.concat(res.list)
else if (moduleType == 9) this.lightShortCourseList = this.lightShortCourseList.concat(res.list)
} }
uni.hideLoading() uni.hideLoading()
this.total = res.total this.total = res.total
......
<template> <template>
<view > <view >
<template v-if="labelColors && labelColors.length > 0"> <template v-if="hasData">
<qiun-data-charts type="radar" :opts="opts" :tooltipShow="false" :chartData="chartData" :class="['charts-box', heightClass]" /> <qiun-data-charts type="radar" :opts="opts" :tooltipShow="false" :chartData="chartData" :class="['charts-box', heightClass]" />
</template> </template>
<template v-else> <template v-else>
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
props: { props: {
chartData: { chartData: {
type: Object, type: Object,
default: () => {} default: () => ({})
}, },
heightClass: { heightClass: {
type: String type: String
...@@ -27,11 +27,24 @@ export default { ...@@ -27,11 +27,24 @@ export default {
default: () => ['#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666'] default: () => ['#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666']
} }
}, },
computed: {
hasData () {
const c = this.chartData && Array.isArray(this.chartData.categories) ? this.chartData.categories : []
const s0 = this.chartData && Array.isArray(this.chartData.series) ? this.chartData.series[0] : null
const d = s0 && Array.isArray(s0.data) ? s0.data : []
return c.length > 0 && d.length > 0
}
},
watch: { watch: {
labelColors: { labelColors: {
handler(newVal) { handler(newVal) {
console.log(newVal, 'newVal') console.log(newVal, 'newVal')
if (Array.isArray(newVal) && newVal.length) {
this.opts.labelColors = newVal this.opts.labelColors = newVal
} else {
const len = (this.chartData && Array.isArray(this.chartData.categories)) ? this.chartData.categories.length : 0
this.opts.labelColors = len ? Array.from({ length: len }, () => '#666666') : []
}
}, },
} }
}, },
...@@ -68,6 +81,11 @@ export default { ...@@ -68,6 +81,11 @@ export default {
}, },
mounted() { mounted() {
console.log(this.chartData, ' 详情') console.log(this.chartData, ' 详情')
// 首次进入时父组件可能还没算出 labelColors,这里做一次兜底
if (!Array.isArray(this.opts.labelColors) || !this.opts.labelColors.length) {
const len = (this.chartData && Array.isArray(this.chartData.categories)) ? this.chartData.categories.length : 0
if (len) this.opts.labelColors = Array.from({ length: len }, () => '#666666')
}
} }
} }
</script> </script>
......
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2024-09-03 13:48:51
* @LastEditors: cenchengwei@foreverht.com
* @LastEditTime: 2026-04-08 15:31:03
* @FilePath: /gl_tape/utils/logger/LogCat.js
*/
import { getTime } from './util' import { getTime } from './util'
import { serializeIfObject } from '../utils' import { serializeIfObject } from '../utils'
import TaskQueue from '../TaskQueue' import TaskQueue from '../TaskQueue'
class LogCat { class LogCat {
// main = plus.android.runtimeMainActivity() main = plus.android.runtimeMainActivity()
// File = plus.android.importClass('java.io.File') File = plus.android.importClass('java.io.File')
// Environment = plus.android.importClass('android.os.Environment') Environment = plus.android.importClass('android.os.Environment')
// BufferedWriter = plus.android.importClass('java.io.BufferedWriter') BufferedWriter = plus.android.importClass('java.io.BufferedWriter')
// FileOutputStream = plus.android.importClass('java.io.FileOutputStream') FileOutputStream = plus.android.importClass('java.io.FileOutputStream')
// OutputStreamWriter = plus.android.importClass('java.io.OutputStreamWriter') OutputStreamWriter = plus.android.importClass('java.io.OutputStreamWriter')
// // BufferedReader = plus.android.importClass('java.io.BufferedReader') // BufferedReader = plus.android.importClass('java.io.BufferedReader')
// FileInputStream = plus.android.importClass('java.io.FileInputStream') // FileInputStream = plus.android.importClass('java.io.FileInputStream')
// InputStreamReader = plus.android.importClass('java.io.InputStreamReader') // InputStreamReader = plus.android.importClass('java.io.InputStreamReader')
LogPath = '' LogPath = ''
...@@ -33,14 +23,12 @@ class LogCat { ...@@ -33,14 +23,12 @@ class LogCat {
currentFos = null // 当前 FileOutputStream currentFos = null // 当前 FileOutputStream
currentLogFile = '' // 当前打开的日志文件路径 currentLogFile = '' // 当前打开的日志文件路径
closeTimer = null // 自动关闭流的定时器 closeTimer = null // 自动关闭流的定时器
constructor(folderName = '_zyzs_log') { constructor(folderName = '_zyzs_log') {
try { try {
let file = null let file = null
if (this.Environment.MEDIA_MOUNTED || !this.Environment.isExternalStorageRemovable()) { if (this.Environment.MEDIA_MOUNTED || !this.Environment.isExternalStorageRemovable()) {
file = this.main.getExternalFilesDir(null) file = this.main.getExternalFilesDir(null)
} }
if (file) { if (file) {
this.LogPath = file.getPath() + folderName this.LogPath = file.getPath() + folderName
} else { } else {
...@@ -69,12 +57,10 @@ class LogCat { ...@@ -69,12 +57,10 @@ class LogCat {
}) })
}) })
} }
// 真正的写入逻辑(私有方法) // 真正的写入逻辑(私有方法)
_doWriteLog(tag, messages) { _doWriteLog(tag, messages) {
// 如果路径初始化失败,直接放弃写入,避免报错 // 如果路径初始化失败,直接放弃写入,避免报错
if (!this.LogPath) return if (!this.LogPath) return
let msg = '' let msg = ''
try { try {
if (messages instanceof Error) { if (messages instanceof Error) {
...@@ -93,7 +79,6 @@ class LogCat { ...@@ -93,7 +79,6 @@ class LogCat {
if (this.lastCleanDate && date !== this.lastCleanDate) { if (this.lastCleanDate && date !== this.lastCleanDate) {
this.lastCleanDate = date this.lastCleanDate = date
} }
let datetime = getTime() let datetime = getTime()
//文件名 //文件名
let fileName = this.LogPath + '/' + date + '.txt' let fileName = this.LogPath + '/' + date + '.txt'
...@@ -114,7 +99,6 @@ class LogCat { ...@@ -114,7 +99,6 @@ class LogCat {
if (this.logDirFile && !this.logDirFile.exists()) { if (this.logDirFile && !this.logDirFile.exists()) {
this.logDirFile.mkdirs() this.logDirFile.mkdirs()
} }
try { try {
// 1. 如果当前没有流,或者文件名变了(跨天),则重新打开 // 1. 如果当前没有流,或者文件名变了(跨天),则重新打开
if (!this.currentWriter || this.currentLogFile !== fileName) { if (!this.currentWriter || this.currentLogFile !== fileName) {
...@@ -131,7 +115,6 @@ class LogCat { ...@@ -131,7 +115,6 @@ class LogCat {
// 3. 刷新缓冲区,确保内容真正写入磁盘(虽然有性能损耗,但防止崩溃丢日志) // 3. 刷新缓冲区,确保内容真正写入磁盘(虽然有性能损耗,但防止崩溃丢日志)
// 也可以选择积累一定量再 flush,这里为了安全选择每次 flush // 也可以选择积累一定量再 flush,这里为了安全选择每次 flush
this.currentWriter.flush() this.currentWriter.flush()
// 4. 重置自动关闭定时器 (5秒后无操作自动关闭) // 4. 重置自动关闭定时器 (5秒后无操作自动关闭)
if (this.closeTimer) { if (this.closeTimer) {
clearTimeout(this.closeTimer) clearTimeout(this.closeTimer)
...@@ -139,14 +122,12 @@ class LogCat { ...@@ -139,14 +122,12 @@ class LogCat {
this.closeTimer = setTimeout(() => { this.closeTimer = setTimeout(() => {
this._closeStream() this._closeStream()
}, 5000) }, 5000)
} catch (e) { } catch (e) {
console.log('日志写入失败:', e) console.log('日志写入失败:', e)
// 发生异常时尝试关闭流,以便下次重试 // 发生异常时尝试关闭流,以便下次重试
this._closeStream() this._closeStream()
} }
} }
// 关闭当前流 // 关闭当前流
_closeStream() { _closeStream() {
try { try {
...@@ -171,7 +152,6 @@ class LogCat { ...@@ -171,7 +152,6 @@ class LogCat {
console.log('关闭日志流失败:', e) console.log('关闭日志流失败:', e)
} }
} }
// 自动清理旧日志 // 自动清理旧日志
_cleanOldLogs(daysToKeep) { _cleanOldLogs(daysToKeep) {
// 放入队列异步执行,不影响启动速度 // 放入队列异步执行,不影响启动速度
...@@ -203,7 +183,6 @@ class LogCat { ...@@ -203,7 +183,6 @@ class LogCat {
}) })
}) })
} }
// 删除日志 // 删除日志
removeLogFile(fileName) { removeLogFile(fileName) {
try { try {
...@@ -222,7 +201,6 @@ class LogCat { ...@@ -222,7 +201,6 @@ class LogCat {
if (!this.LogPath) return [] if (!this.LogPath) return []
let file = new this.File(this.LogPath) let file = new this.File(this.LogPath)
if (!file.exists()) return [] if (!file.exists()) return []
let tempList = file.listFiles() let tempList = file.listFiles()
if (!tempList || tempList.length === 0) return [] if (!tempList || tempList.length === 0) return []
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!