Commit fcdbebe1 by liaoym

学习中心 ui 完善

1 parent 43fede05
Showing 49 changed files with 2636 additions and 87 deletions
{
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version" : "0.0",
"configurations" : [
{
"app-plus" : {
"launchtype" : "local"
},
"default" : {
"launchtype" : "local"
},
"h5" : {
"launchtype" : "local"
},
"mp-weixin" : {
"launchtype" : "local"
},
"provider" : "aliyun",
"type" : "uniCloud"
},
{
"playground" : "standard",
"type" : "uni-app:app-android"
}
]
}
import sign from './sign.js' import sign from './sign.js'
import { secretKey, pathEnum, domain, djDomain, merchantDomain, djSecretKey } from '../../env' import { secretKey, pathEnum, domain, djDomain, merchantDomain, djSecretKey } from '../../env'
// H5环境下使用相对路径,走代理;其他环境使用完整域名
const isH5 = process.env.VUE_APP_PLATFORM === 'h5'
const HOST = { const HOST = {
scrm: domain, scrm: isH5 ? '' : domain,
dj: djDomain, dj: isH5 ? '' : djDomain,
merchant: merchantDomain, merchant: isH5 ? '' : merchantDomain,
ip: 'http://192.168.1.125:8080' ip: 'http://192.168.1.125:8080'
} }
class Request { class Request {
......
No preview for this file type
<template>
<view class="exam-submit-popup-wrapper">
<!-- 标题 -->
<view :class="['exam-title', { 'title-loading': isLoading }]">是否已提交考试</view>
<!-- 加载状态 -->
<template v-if="isLoading">
<view class="loading-text">正在查询考试结果,请稍后...</view>
<image
class="loading-gif"
:src="require('@/assets/images/common/loadding.gif')"
mode="aspectFit"
/>
</template>
<!-- 按钮组(始终显示) -->
<view class="button-group">
<view class="cancel-button" @click="handleCancel">
未提交
</view>
<view class="confirm-button" @click="handleConfirm">
确认已提交
</view>
</view>
</view>
</template>
<script>
export default {
name: 'ExamSubmitPopup',
props: {
isLoading: {
type: Boolean,
default: false
}
},
watch: {
isLoading(newVal) {
console.log('ExamSubmitPopup isLoading changed:', newVal)
}
},
methods: {
handleCancel() {
this.$emit('cancel')
},
handleConfirm() {
console.log('handleConfirm clicked')
this.$emit('confirm')
}
}
}
</script>
<style lang="scss" scoped>
.exam-submit-popup-wrapper {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.exam-title {
width: toRpx(280);
height: toRpx(48);
color: #333333;
font-size: toRpx(40);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
margin-top: toRpx(96);
margin-bottom: toRpx(136);
}
.exam-title.title-loading {
margin-bottom: toRpx(40);
margin-top: toRpx(0);
}
.loading-text {
height: toRpx(48);
color: #6c6f75;
font-size: toRpx(32);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(48);
margin-bottom: toRpx(40);
}
.loading-gif {
width: toRpx(64);
height: toRpx(64);
margin-bottom: toRpx(48);
}
.button-group {
display: flex;
align-items: center;
justify-content: center;
gap: toRpx(16);
margin-bottom: toRpx(48);
}
.cancel-button {
width: toRpx(344);
height: toRpx(80);
border-radius: toRpx(64);
background: #f0f1f5;
color: #1a1a1a;
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
}
.confirm-button {
width: toRpx(360);
height: toRpx(80);
border-radius: toRpx(48);
border: toRpx(2) solid #979797;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: toRpx(28);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
&:active {
opacity: 0.8;
}
}
</style>
...@@ -186,7 +186,6 @@ export default { ...@@ -186,7 +186,6 @@ export default {
isTrack: true, isTrack: true,
name: 'StudyCenter', name: 'StudyCenter',
eventCode: 'app_study_center', eventCode: 'app_study_center',
hidden: true
}, },
{ {
label: "场景集市", label: "场景集市",
...@@ -439,17 +438,25 @@ export default { ...@@ -439,17 +438,25 @@ export default {
// 学习中心权限获取,场景集市权限 // 学习中心权限获取,场景集市权限
getStudyCenterPermission () { getStudyCenterPermission () {
const userInfo = uni.$storage.get('userInfo') const userInfo = uni.$storage.get('userInfo')
const res = uni.$storage.get('studyCenterPermission')
if(!res){
uni.$api.commonApi.getStudyCenterPermission({yqMerchantIdList}).then(res => {
uni.$storage.set('studyCenterPermission', res)
console.log(res,'res')
})
}
if (userInfo.subLoginUser.channelType == 9) { if (userInfo.subLoginUser.channelType == 9) {
this.tabs[2].hidden = true this.tabs[2].hidden = true
this.tabs[3].hidden = true this.tabs[3].hidden = true
return return
} else { } else {
const res = uni.$storage.get('studyCenterPermission')
const { directSaleAuth, hmzxAuth, authorizedBusinessList } = res // 当驻店人员为非直营,且非鸿蒙智行延保业务驻店人员情况下。隐藏左侧【学习中心】图标 // const { directSaleAuth, hmzxAuth, authorizedBusinessList } = res // 当驻店人员为非直营,且非鸿蒙智行延保业务驻店人员情况下。隐藏左侧【学习中心】图标
const isYb = authorizedBusinessList && authorizedBusinessList.includes(1) // 1.延保 2.轻改 3.权益 // const isYb = authorizedBusinessList && authorizedBusinessList.includes(1) // 1.延保 2.轻改 3.权益
if (directSaleAuth || (hmzxAuth && isYb)) { // if (directSaleAuth || (hmzxAuth && isYb)) {
this.tabs[2].hidden = false // this.tabs[2].hidden = false
} // }
} }
} }
}, },
......
<template>
<view class="completed-course">
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
:class="getScrollHeight">
<template v-if="completedCourseList.length">
<view class="completed-course-list" :class="{ 'fixed-width': cardWidth > 0 }">
<view class="completed-course-item" v-for="(item, index) in completedCourseList" :key="index"
@click="startStudy(item, index)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''">
<!-- 左上角:必修/选修标签 -->
<image v-if="item.required !== undefined" class="course-tag-left"
:src="item.required ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')"
mode="aspectFit" />
<!-- 右上角:文档/视频标签 -->
<view v-if="item.courseType" class="course-tag-right">
<text class="tag-text">{{ item.courseType === 'video' ? '视频' : '文档' }}</text>
</view>
<image class="completed-course-item-img"
src="../../../../assets/images/common/recommend-course-default.webp" mode="scaleToFill" />
<view class="completed-course-content">
<view class="completed-course-item-title">
{{ item.taskTitle || item.courseName }}
</view>
<!-- 成功图片 -->
<image class="success-icon" :src="require('@/assets/images/studyCenter/success.png')" mode="aspectFit" />
</view>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</template>
<script>
export default {
name: 'CompletedCourse',
props: {
// 卡片宽度,不传则使用默认的响应式布局
cardWidth: {
type: Number,
default: 0
}
},
data() {
return {
completedCourseList: [],
nothing: false,
total: 0,
pageNum: 1,
pageSize: 12,
scrollTop: 0,
}
},
computed: {
getScrollHeight() {
const list = this.completedCourseList;
if (!list || list.length === 0) {
return '';
}
return 'scroll-view'
}
},
mounted() {
this.getCourseTaskPage()
},
methods: {
// 获取已完成课程接口
async getCourseTaskPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
completeStatus: 1, // 完成状态 1=已完成
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getCourseTaskPage(params)
// 临时添加测试数据字段
const listWithTestData = res.list.map((item, index) => ({
...item,
required: index % 3 === 0, // 每3个课程第1个是必修
courseType: index % 2 === 0 ? 'video' : 'document', // 交替显示视频/文档
}))
if (pageNum == 1) {
this.completedCourseList = listWithTestData
} else {
this.completedCourseList = this.completedCourseList.concat(listWithTestData)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
pageonReachBottom() {
console.log('到底了');
let { pageNum, total, nothing = 'nothing', pageSize } = this;
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1;
this.getCourseTaskPage()
} else {
this.nothing = true;
}
},
startStudy(item, index) {
let { pageNum, total, nothing = 'nothing', pageSize } = this;
uni.$track.add({ eventCode: 'app_completed_course', businessId: item.id, pagePath: '/pages/studyCenter/myCourse' })
uni.navigateTo({
url: `/pages/common/studyDetail/detail?type=completed&index=${index}&completedCourseList=${encodeURIComponent(JSON.stringify(this.completedCourseList))}&pageNum=${pageNum}&pageSize=${pageSize}&total=${total}`
})
}
}
}
</script>
<style lang="scss" scoped>
.completed-course {
height: calc(100% - #{toRpx(100)});
.scroll-view {
margin-top: toRpx(40);
height: calc(100% - #{toRpx(70)});
.completed-course-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32);
&.fixed-width {
grid-template-columns: repeat(4, toRpx(530));
justify-content: center;
.completed-course-item {
width: toRpx(530) !important;
max-width: toRpx(530);
min-width: toRpx(530);
}
}
.completed-course-item {
width: 100%;
min-height: toRpx(376);
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
border-radius: toRpx(24);
position: relative;
// 左上角标签
.course-tag-left {
position: absolute;
left: 0;
top: 0;
width: toRpx(94);
height: toRpx(48);
border-radius: toRpx(24) 0 toRpx(20) 0;
z-index: 2;
}
// 右上角标签
.course-tag-right {
position: absolute;
right: toRpx(16);
top: toRpx(16);
width: toRpx(72);
height: toRpx(40);
border-radius: toRpx(4);
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
.tag-text {
width: toRpx(48);
height: toRpx(36);
color: #ffffff;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(36);
}
}
.completed-course-item-img {
width: 100%;
height: toRpx(180);
border-radius: toRpx(16) toRpx(16) 0 0;
}
.completed-course-content {
padding: toRpx(32);
position: relative;
min-height: toRpx(196);
.completed-course-item-title {
font-size: toRpx(30);
color: #292D33;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
line-height: 1.2;
max-height: calc(2 * 1.2em);
}
// 成功图片 - 右下角定位
.success-icon {
position: absolute;
bottom: toRpx(32);
right: toRpx(33);
width: toRpx(144);
height: toRpx(144);
}
}
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(380);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0;
font-size: toRpx(24);
}
/deep/ {
.uni-scroll-view-content {
height: calc(100% - #{toRpx(20)});
}
}
</style>
<template>
<view class="failed-exam">
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
:class="getScrollHeight">
<template v-if="examList.length">
<view class="exam-list" :class="{ 'fixed-width': cardWidth > 0 }">
<view class="exam-item" v-for="(item, index) in examList" :key="index"
@click="viewExam(item, index)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''">
<!-- 左上角:必修/选修标签 -->
<image v-if="item.required !== undefined" class="exam-tag-left"
:src="item.required ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')"
mode="aspectFit" />
<!-- 右上角:文档/视频标签 -->
<view v-if="item.examType" class="exam-tag-right">
<text class="tag-text">{{ item.examType === 'video' ? '视频' : '文档' }}</text>
</view>
<image class="exam-item-img"
src="../../../../assets/images/common/recommend-course-default.webp" mode="scaleToFill" />
<view class="exam-content">
<view class="exam-item-title">
{{ item.courseName || item.examName }}
</view>
<view class="exam-item-text">
<text class="duration-value">考试时间</text>
<text>{{ (item.totalDuration || item.totalDuration === 0) ?
`${item.totalDuration}min` : '-' }} | 20题</text>
</view>
<!-- 考试次数 -->
<view class="exam-times">
<text class="times-value">剩余考试次数</text>
<text>{{ item.examCount || 0 }}次</text>
</view>
<!-- 最高得分 -->
<view class="exam-score">
<text class="score-label">最高得分</text>
<text class="score-value failed">{{ item.highestScore || 0 }}分|未通过</text>
</view>
<!-- 重新考试按钮 -->
<view class="retake-btn" @click.stop="retakeExam(item)">
<text class="retake-text">重新考试</text>
</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</template>
<script>
export default {
name: 'FailedExam',
props: {
cardWidth: {
type: Number,
default: 0
}
},
data() {
return {
examList: [],
nothing: false,
total: 0,
pageNum: 1,
pageSize: 12,
scrollTop: 0,
}
},
computed: {
getScrollHeight() {
const list = this.examList;
if (!list || list.length === 0) {
return '';
}
return 'scroll-view'
}
},
mounted() {
this.getExamList()
},
methods: {
async getExamList() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
examStatus: 'failed', // 未通过
pageNum,
pageSize
}
// TODO: 替换为实际的考试列表接口
// const res = await this.$http.post({ method: 'exam.list', ...params })
// 临时测试数据
const mockData = [
{
id: 3,
examName: '产品知识考试',
courseName: '产品知识考试',
totalDuration: 50,
required: true,
examType: 'document',
examCount: 1,
highestScore: 50
},
{
id: 4,
examName: '销售技巧考试',
courseName: '销售技巧考试',
totalDuration: 40,
required: false,
examType: 'video',
examCount: 2,
highestScore: 45
}
]
this.examList = [...this.examList, ...mockData]
this.nothing = this.examList.length >= this.total && this.pageNum > 1
uni.hideLoading()
} catch (err) {
console.log(err)
uni.hideLoading()
}
},
pageonReachBottom() {
if (this.nothing) return
if (this.examList.length >= this.total && this.pageNum > 1) {
this.nothing = true
return
}
this.pageNum++
this.getExamList()
},
viewExam(item) {
console.log('查看考试', item)
// TODO: 跳转到考试详情页
},
retakeExam(item) {
console.log('重新考试', item)
// TODO: 跳转到考试页面
}
}
}
</script>
<style lang="scss" scoped>
.failed-exam {
width: 100%;
height: 100%;
.scroll-view {
height: 100%;
}
.exam-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32);
&.fixed-width {
grid-template-columns: repeat(4, toRpx(530));
justify-content: center;
.exam-item {
width: toRpx(530) !important;
max-width: toRpx(530);
min-width: toRpx(530);
}
}
.exam-item {
width: 100%;
min-height: toRpx(376);
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
border-radius: toRpx(24);
overflow: hidden;
cursor: pointer;
background: #ffffff;
position: relative;
// 左上角标签
.exam-tag-left {
position: absolute;
left: 0;
top: 0;
width: toRpx(94);
height: toRpx(48);
border-radius: toRpx(24) 0 toRpx(20) 0;
z-index: 2;
}
// 右上角标签
.exam-tag-right {
position: absolute;
right: toRpx(16);
top: toRpx(16);
width: toRpx(72);
height: toRpx(40);
border-radius: toRpx(4);
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
.tag-text {
width: toRpx(48);
height: toRpx(36);
opacity: 1;
color: #ffffff;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(36);
}
}
.exam-item-img {
width: 100%;
height: toRpx(240);
}
.exam-content {
padding: toRpx(24) toRpx(24) toRpx(32);
.exam-item-title {
width: 100%;
height: toRpx(36);
color: #292d33;
font-size: toRpx(30);
font-weight: 500;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36);
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
line-clamp: 1;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: toRpx(20);
}
.exam-item-text {
display: flex;
align-items: center;
margin-bottom: toRpx(12);
height: toRpx(36);
color: #999ea8;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36);
.duration-value {
margin-right: toRpx(8);
}
}
// 考试次数
.exam-times {
display: flex;
align-items: center;
margin-bottom: toRpx(12);
height: toRpx(36);
color: #999ea8;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36);
.times-value {
margin-right: toRpx(8);
}
}
// 最高得分
.exam-score {
display: flex;
align-items: center;
margin-bottom: toRpx(12);
.score-label {
width: toRpx(96);
height: toRpx(36);
opacity: 1;
color: #999ea8;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
line-height: toRpx(36);
margin-right: toRpx(24);
}
.score-value {
width: toRpx(346.5);
height: toRpx(36);
opacity: 1;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
line-height: toRpx(36);
&.failed {
color: #eb4e4e;
}
}
}
// 重新考试按钮
.retake-btn {
width: toRpx(466.5);
height: toRpx(56);
border-radius: toRpx(24);
opacity: 1;
background: #f1f7fe;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
.retake-text {
width: toRpx(104);
height: toRpx(32);
opacity: 1;
color: #3b73ff;
font-size: toRpx(26);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(32);
}
}
}
}
}
.nothing {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
height: toRpx(600);
color: #999999;
font-size: toRpx(28);
.icon {
width: toRpx(400);
height: toRpx(400);
margin-bottom: toRpx(40);
}
}
.end-text {
text-align: center;
color: #999999;
font-size: toRpx(24);
padding: toRpx(40) 0;
}
}
</style>
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
align-items: center; align-items: center;
margin-top: toRpx(12); margin-top: toRpx(12);
margin-bottom: toRpx(42); margin-bottom: toRpx(20);
.statistics-item { .statistics-item {
display: flex; display: flex;
......
<template> <template>
<view class="task-box"> <view class="task-box">
<view class="tab-box"> <view class="tab-box">
<view class="tab-list"> <!-- <view class="tab-list">
<view @click="handleTabClick(index)" :class="['tab-item', tabIndex === index ? 'active' : '']" <view @click="handleTabClick(index)" :class="['tab-item', tabIndex === index ? 'active' : '']"
v-for="(item, index) in tabList" :key="index"> v-for="(item, index) in tabList" :key="index">
<view class="tab-item-title">{{ item }}</view> <view class="tab-item-title">{{ item }}</view>
...@@ -14,17 +14,14 @@ ...@@ -14,17 +14,14 @@
<view class="finish-tab-item" @click="handleFinishTabClick(1)" :class="{ 'finish-active': finishIndex === 1 }"> <view class="finish-tab-item" @click="handleFinishTabClick(1)" :class="{ 'finish-active': finishIndex === 1 }">
短课程 短课程
</view> </view>
</view> -->
</view> </view>
</view>
<view class="tips" v-if="tabIndex === 0">
<view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">带有"限时学"标签的课程:规定时间内未完成任务,禁止提单!请按时学习。</view>
</view>
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom" <scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
:class="[getScrollHeight]"> :class="[getScrollHeight]">
<template v-if="taskList.length"> <template v-if="taskList.length">
<view class="task-list"> <view class="task-list" :class="{ 'fixed-width': cardWidth > 0 }">
<view class="task-item" v-for="(item, index) in taskList" :key="index" @click="handleTaskItemClick(item)"> <view class="task-item" v-for="(item, index) in taskList" :key="index" @click="handleTaskItemClick(item)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''">
<view class="time-limit-tag" v-if="tabIndex === 0 && item.punishType == 1"></view> <view class="time-limit-tag" v-if="tabIndex === 0 && item.punishType == 1"></view>
<view v-if="tabIndex === 0 && item.punishType == 1" class="time-limit-countdown "> <view v-if="tabIndex === 0 && item.punishType == 1" class="time-limit-countdown ">
<template v-if="item._timeout"> <template v-if="item._timeout">
...@@ -61,25 +58,26 @@ ...@@ -61,25 +58,26 @@
/> />
<view class="task-item-content"> <view class="task-item-content">
<view class="task-item-title">{{ item.taskTitle }}</view> <view class="task-item-title">{{ item.taskTitle }}</view>
<view class="task-item-text" v-if="item.courseType === 2">
<view class="task-item-label">课程时长</view>
<view class="task-item-value">
{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}
</view>
</view>
<view class="task-item-text"> <view class="task-item-text">
<view class="task-item-label">任务进度</view> <view class="task-item-label">学习进度</view>
<view class="task-item-progress" v-if="item.completeStatus == 0"> <view class="task-item-progress" v-if="item.completeStatus == 0">
<view class="task-item-progress-bar" :style="{ width: Math.floor(item.taskProgress) + '%' }"></view> <view class="task-item-progress-bar" :style="{ width: Math.floor(item.taskProgress) + '%' }"></view>
<view class="task-item-progress-text">{{ Math.floor(item.taskProgress) }}%</view> <view class="task-item-progress-text">{{ Math.floor(item.taskProgress) }}%</view>
</view> </view>
<view class="task-item-value" v-else><view class="dot-value"></view><view class="green">已完成</view></view> <view class="task-item-value" v-else><view class="dot-value"></view><view class="green">已完成</view></view>
</view> </view>
<view class="task-item-text" v-if="item.courseType === 2">
<view class="task-item-label">课程数</view> <!-- 完成时间 - 暂时隐藏 -->
<view class="task-item-value"> <!-- <view class="task-item-text">
{{ item.courseTotalCount }}节 |
{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}
</view>
</view>
<view class="task-item-text">
<view class="task-item-label">完成时间</view> <view class="task-item-label">完成时间</view>
<view class="task-item-value">{{ tabIndex === 0 ? formatTime(item.taskDeadline, 'YYYY-MM-DD HH:mm') : formatTime(item.finishDate, 'YYYY-MM-DD HH:mm') }}</view> <view class="task-item-value">{{ tabIndex === 0 ? formatTime(item.taskDeadline, 'YYYY-MM-DD HH:mm') : formatTime(item.finishDate, 'YYYY-MM-DD HH:mm') }}</view>
</view> </view> -->
<view class="task-item-status">{{ item.status }}</view> <view class="task-item-status">{{ item.status }}</view>
</view> </view>
</view> </view>
...@@ -103,6 +101,13 @@ import dayjs from 'dayjs' ...@@ -103,6 +101,13 @@ import dayjs from 'dayjs'
export default { export default {
name: 'MyTask', name: 'MyTask',
props: {
// 卡片宽度,不传则使用默认的响应式布局
cardWidth: {
type: Number,
default: 0
}
},
data() { data() {
return { return {
tabList: ['待完成', '已完成'], tabList: ['待完成', '已完成'],
...@@ -288,6 +293,14 @@ export default { ...@@ -288,6 +293,14 @@ export default {
const res = await uni.$api.commonApi.getCourseTaskPage(params) const res = await uni.$api.commonApi.getCourseTaskPage(params)
// 处理倒计时相关字段 // 处理倒计时相关字段
let newList = res.list || []; let newList = res.list || [];
// 临时添加测试数据字段
newList = newList.map((item, index) => ({
...item,
required: index % 3 === 0, // 每3个任务第1个是必修
courseTypeLabel: index % 2 === 0 ? 'video' : 'document' // 交替显示视频/文档
}))
// 对新获取的数据初始化倒计时字段 // 对新获取的数据初始化倒计时字段
if (completeStatus === 0) { if (completeStatus === 0) {
this.initCountdownFieldsForList(newList); this.initCountdownFieldsForList(newList);
...@@ -489,6 +502,17 @@ export default { ...@@ -489,6 +502,17 @@ export default {
gap: toRpx(32); gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32); padding: 0 toRpx(40) toRpx(32);
&.fixed-width {
grid-template-columns: repeat(4, toRpx(530));
justify-content: center;
.task-item {
width: toRpx(530) !important;
max-width: toRpx(530);
min-width: toRpx(530);
}
}
.task-item { .task-item {
position: relative; position: relative;
width: 100%; width: 100%;
...@@ -498,6 +522,43 @@ export default { ...@@ -498,6 +522,43 @@ export default {
font-size: 0; font-size: 0;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a; box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
// 左上角:必修/选修标签
.course-tag-left {
position: absolute;
left: 0;
top: 0;
width: toRpx(94);
height: toRpx(48);
border-radius: toRpx(24) 0 toRpx(20) 0;
z-index: 2;
}
// 右上角:文档/视频标签
.course-tag-right {
position: absolute;
right: toRpx(16);
top: toRpx(16);
width: toRpx(72);
height: toRpx(40);
border-radius: toRpx(4);
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
.tag-text {
width: toRpx(48);
height: toRpx(36);
color: #ffffff;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(36);
}
}
.time-limit-tag { .time-limit-tag {
position: absolute; position: absolute;
top: 0; top: 0;
......
...@@ -10,10 +10,13 @@ ...@@ -10,10 +10,13 @@
<view class="tab-item-title">{{ item.title }}</view> <view class="tab-item-title">{{ item.title }}</view>
</view> </view>
</view> </view>
<view class="rank-title">周转化率排名</view> <view class="rank-title">
<view class="rank-title-text">周转化率排名</view>
<view class="rank-value"> <view class="rank-value">
<view class="rank-number">{{ currentConversionData.top || '-' }}</view>名 <view class="rank-number">{{ currentConversionData.top || '-' }}</view>名
</view> </view>
</view>
<view class="bar-box"> <view class="bar-box">
<view class="bar-item" v-for="(item, index) in barList" :key="index"> <view class="bar-item" v-for="(item, index) in barList" :key="index">
<view class="bar-label">{{ item.label }}</view> <view class="bar-label">{{ item.label }}</view>
...@@ -187,6 +190,12 @@ export default { ...@@ -187,6 +190,12 @@ export default {
color: #1A1A1A; color: #1A1A1A;
margin-top: toRpx(32); margin-top: toRpx(32);
margin-left: toRpx(8); margin-left: toRpx(8);
display: flex;
align-items: center;
.rank-title-text {
font-size: toRpx(28);
color: #1A1A1A;
margin-right: toRpx(8);
} }
.rank-value { .rank-value {
...@@ -194,10 +203,7 @@ export default { ...@@ -194,10 +203,7 @@ export default {
align-items: baseline; align-items: baseline;
color: #3B73FF; color: #3B73FF;
font-size: toRpx(22); font-size: toRpx(22);
font-weight: 500; font-weight: 500;s
margin-top: toRpx(16);
margin-left: toRpx(8);
.rank-number { .rank-number {
font-size: toRpx(40); font-size: toRpx(40);
font-weight: 700; font-weight: 700;
...@@ -205,9 +211,11 @@ export default { ...@@ -205,9 +211,11 @@ export default {
} }
} }
}
/* 进度条整体项样式 */ /* 进度条整体项样式 */
.bar-box { .bar-box {
margin-top: toRpx(44); margin-top: toRpx(28);
} }
.bar-item { .bar-item {
......
...@@ -161,6 +161,60 @@ ...@@ -161,6 +161,60 @@
:src="jumpUrl" :src="jumpUrl"
v-if="showBeisen" v-if="showBeisen"
></web-view> --> ></web-view> -->
<!-- 学习中心弹窗 -->
<StudyPopup
:show.sync="showStudyPopup"
title="开始学习学之旅"
:topImage="require('@/assets/images/common/study-center-bg.webp')"
>
<StudyPopupContent
cardTitle="个性化学习路径"
description="根据你的岗位和考卷,我们打造针对性的学习课程内容,帮助你循序渐进,实现快速通关"
:listItems="[
'基于当前岗位定制课程',
'根据你的发展规划匹配你的学习',
'定期推送学习提醒与激励'
]"
tipText="true"
courseName="XXX"
buttonText="开始学习"
@button-click="handleStartAssessment"
/>
</StudyPopup>
<!-- 考试提交确认弹窗 -->
<StudyPopup
:show.sync="showExamPopup"
title=""
:width="848"
:height="isExamLoading ? 740 : 656"
:topImage="require('@/assets/images/common/warning-notice.png')"
:topImageWidth="848"
:topImageHeight="248"
>
<ExamSubmitPopup
:isLoading="isExamLoading"
@cancel="handleExamCancel"
@confirm="handleExamConfirm"
/>
</StudyPopup>
<!-- 学习中心权限弹窗 -->
<StudyPopup
:show.sync="showStudyPermissionPopup"
title=""
:width="848"
:height="870"
:topImage="require('@/assets/images/common/warning-notice.png')"
:topImageWidth="848"
:topImageHeight="248"
style="overflow: hidden;"
>
<StudyCenterPermissionPopup
@confirm="handleStudyPermissionConfirm"
/>
</StudyPopup>
</view> </view>
</template> </template>
<script> <script>
...@@ -191,9 +245,13 @@ import permision from '@/js_sdk/wa-permission/permission.js' ...@@ -191,9 +245,13 @@ import permision from '@/js_sdk/wa-permission/permission.js'
import Entrance from '@/components/Entrance.vue' import Entrance from '@/components/Entrance.vue'
import mediaResourceManager from '@/utils/mediaResourceManager/mediaResourceManager' import mediaResourceManager from '@/utils/mediaResourceManager/mediaResourceManager'
import { interceptionMixin } from '@/mixin/index' import { interceptionMixin } from '@/mixin/index'
import StudyPopup from '@/components/StudyPopup.vue'
import StudyPopupContent from '@/components/StudyPopupContent.vue'
import ExamSubmitPopup from '@/components/ExamSubmitPopup.vue'
import StudyCenterPermissionPopup from '@/components/StudyCenterPermissionPopup.vue'
export default { export default {
mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin], mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin],
components: { ReceptionCenter, StudyCenter, SceneMarket, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History, LevelMedal, MessageDetail, SwiperComponent, MessageIndex, Entrance }, components: { ReceptionCenter, StudyCenter, SceneMarket, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History, LevelMedal, MessageDetail, SwiperComponent, MessageIndex, Entrance, StudyPopup, StudyPopupContent, ExamSubmitPopup, StudyCenterPermissionPopup },
props: { props: {
id: [String, Number], id: [String, Number],
finishDoneText: String, finishDoneText: String,
...@@ -227,9 +285,24 @@ export default { ...@@ -227,9 +285,24 @@ export default {
showBeisen: false, showBeisen: false,
tipsObject: {}, tipsObject: {},
autoplay: true, autoplay: true,
previewOff: false previewOff: false,
showStudyPopup: false,
showExamPopup: false,
isExamLoading: false,
showStudyPermissionPopup: false
} }
}, },
created() {
// 在组件创建时就开始监听,确保事件能被捕获
uni.$on('showExamSubmitPopup', () => {
console.log('接收到考试提交弹窗事件')
this.showExamPopup = true
})
},
beforeDestroy() {
// 组件销毁前移除监听
uni.$off('showExamSubmitPopup')
},
mounted () { mounted () {
const userInfo = uni.$storage.get('userInfo') || {} const userInfo = uni.$storage.get('userInfo') || {}
this.userInfo = userInfo this.userInfo = userInfo
...@@ -258,10 +331,140 @@ export default { ...@@ -258,10 +331,140 @@ export default {
} }
}, },
methods: { methods: {
// 处理开始测评(参考 detail.vue 的实现)
async handleStartAssessment() {
this.showStudyPopup = false
try {
// 获取北森 token
uni.showLoading({ title: '加载中...' })
const token = await this.findBeiSenSSOToken()
console.log('🔑 获取到的 token:', token)
uni.hideLoading()
if (token) {
// 将目标 URL 编码
const targetUrl = 'https://cloud.italent.cn/PageHome/Index?product=Learning&keyName=Nusion&pageCode=LearningExamList&appCode=Learning#/viewDynamic'
console.log('🎯 目标 URL:', targetUrl)
const encodedUrl = encodeURIComponent(targetUrl)
console.log('📝 编码后的 URL:', encodedUrl)
// 拼接完整 URL:token&return_url=编码后的目标URL
const fullUrl = `${token}&return_url=${encodedUrl}`
console.log('✅ 完整拼接的 URL (直接传递给 webview):', fullUrl)
uni.navigateTo({
url: `/pages/common/studyWebview?url=${encodeURIComponent(fullUrl)}&pageTitle=学习测评`
})
} else {
throw new Error('获取 token 失败')
}
} catch (error) {
uni.hideLoading()
console.error('❌ 获取 token 失败:', error)
uni.showToast({
title: '获取授权失败,请重试',
icon: 'none'
})
}
},
// 获取北森 SSO Token(参考 detail.vue 的方法)
findBeiSenSSOToken() {
return new Promise((resolve, reject) => {
uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
uni.$storage.set('beisenToken', res.data)
resolve(res.data || '')
}).catch(err => {
reject(err)
})
})
},
// 处理考试取消(用户选择未提交)
handleExamCancel() {
this.showExamPopup = false
},
handleStudyPermissionConfirm() {
this.showStudyPermissionPopup = false
// 切换到学习中心 tab
const tabs = this.$refs.leftBox?.tabs
if (tabs) {
const studyCenterIndex = tabs.findIndex(tab => tab.name === 'StudyCenter')
if (studyCenterIndex !== -1) {
this.tabIndex = studyCenterIndex
this.changeTab({ item: tabs[studyCenterIndex], index: studyCenterIndex })
}
}
},
// 检查学习中心权限
async checkStudyCenterPermission() {
try {
const userInfo = uni.$storage.get('userInfo')
// 如果是渠道类型为9,没有权限
if (userInfo?.subLoginUser?.channelType == 9) {
return false
}
// 获取权限信息
let studyCenterPermission = uni.$storage.get('studyCenterPermission')
// 如果缓存中没有,调用接口获取
if (!studyCenterPermission) {
const yqMerchantIdList = userInfo?.subLoginUser?.yqMerchantIdList || []
const res = await uni.$api.commonApi.getStudyCenterPermission({ yqMerchantIdList })
studyCenterPermission = res
uni.$storage.set('studyCenterPermission', res)
}
// 判断权限:直营 或者 (鸿蒙智行 且 有延保业务)
const { directSaleAuth, hmzxAuth, authorizedBusinessList } = studyCenterPermission
const isYb = authorizedBusinessList && authorizedBusinessList.includes(1) // 1.延保 2.轻改 3.权益
// 有直营权限 或者 (有鸿蒙智行权限 且 有延保业务权限)则显示
// 这里返回 false 表示没有权限(即未完成学习任务),需要弹出提示
// TODO: 这里后续需要调用接口查询是否完成必修课
return false // 暂时返回 false 用于测试弹窗
} catch (error) {
console.error('获取学习中心权限失败:', error)
return true // 出错时默认允许通过
}
},
// 处理考试确认(用户选择已提交)
async handleExamConfirm() {
console.log('handleExamConfirm 执行开始')
this.isExamLoading = true
console.log('isExamLoading 设置为 true:', this.isExamLoading)
try {
// TODO: 这里后续调用后端查询接口
// const result = await uni.$api.commonApi.checkExamResult({...})
// 模拟延迟
await new Promise(resolve => setTimeout(resolve, 2000))
// 查询完成后关闭弹窗
this.isExamLoading = false
console.log('查询完成,关闭弹窗')
this.showExamPopup = false
} catch (error) {
console.error('查询考试结果失败:', error)
this.isExamLoading = false
uni.showToast({
title: '查询失败,请重试',
icon: 'none'
})
}
},
async changeTab ({ item, index }) { async changeTab ({ item, index }) {
if (index == 0) this.$refs.messageRef.getMessageSummary() if (index == 0) this.$refs.messageRef.getMessageSummary()
this.previewOff = index != 0 this.previewOff = index != 0
this.$emit('changeTab', index) this.$emit('changeTab', index)
// 切换到学习中心时显示弹窗
if (item.name === 'StudyCenter') {
this.showStudyPopup = true
}
// this.showBeisen = false // this.showBeisen = false
// if (item.isTrack) { // if (item.isTrack) {
// // this.jumpUrl = jumpUrl // // this.jumpUrl = jumpUrl
...@@ -413,6 +616,16 @@ export default { ...@@ -413,6 +616,16 @@ export default {
{ sceneType } = this { sceneType } = this
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport(sceneType != 7)))) return if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport(sceneType != 7)))) return
if (sceneType != 7 && await this.inspectionOfProhibitionBill()) return if (sceneType != 7 && await this.inspectionOfProhibitionBill()) return
// 新建工单时检查学习中心权限
if (item.name === 'CreateOrder') {
const hasPermission = await this.checkStudyCenterPermission()
if (!hasPermission) {
this.showStudyPermissionPopup = true
return
}
}
if (item.name === 'EvaluationFormList') { if (item.name === 'EvaluationFormList') {
mediaResourceManager.cleanupExpired() mediaResourceManager.cleanupExpired()
uni.navigateTo({ uni.navigateTo({
......
<template>
<view class="list">
<view
v-for="(item, index) in options"
:key="index"
@click="selectOption(item)"
:class="['item flex', { active: currentId === item.value }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ item.label }}
</view>
</view>
</template>
<script>
export default {
name: 'CourseOptionList',
data() {
return {
currentId: '',
options: []
}
},
props: {
params: Object,
data: [Object, Array]
},
watch: {
currentId: {
handler(value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted() {
this.getList()
},
methods: {
getList() {
const { params } = this
this.options = params.options || []
// 初始化选中值
let { data, params: { idKey } } = this
if (data && data[idKey]) {
this.currentId = data[idKey]
}
this.$emit('onComplete')
},
selectOption(item) {
// 如果点击已选中的选项,则取消选中
if (this.currentId === item.value) {
this.currentId = ''
} else {
this.currentId = item.value
}
}
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
const screenList = [
{
title: '选必修',
componentName: 'CourseOptionList',
params: {
idKey: 'required',
options: [
{ label: '必修', value: 'required' },
{ label: '选修', value: 'optional' }
]
}
},
{
title: '课程类型',
componentName: 'CourseOptionList',
params: {
idKey: 'courseType',
options: [
{ label: '视频', value: 'video' },
{ label: '文档', value: 'document' }
]
}
},
{
title: '评分',
componentName: 'CourseOptionList',
params: {
idKey: 'rating',
options: [
{ label: '4星以上', value: '4' },
{ label: '3星以上', value: '3' }
]
}
}
]
export default { screenList }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
cancelText="清除" cancelText="清除"
> >
<view class="popup-title flex"> <view class="popup-title flex">
工单筛选 {{ popupTitle }}
<view <view
class="popup-close flex" class="popup-close flex"
@click="close" @click="close"
...@@ -72,21 +72,31 @@ import EmployeeList from './components/EmployeeList.vue' ...@@ -72,21 +72,31 @@ import EmployeeList from './components/EmployeeList.vue'
import TimeList from './components/TimeList.vue' import TimeList from './components/TimeList.vue'
import OrderStatusList from './components/OrderStatusList.vue' import OrderStatusList from './components/OrderStatusList.vue'
import PayList from './components/PayList.vue' import PayList from './components/PayList.vue'
import CourseOptionList from './components/CourseOptionList.vue'
export default { export default {
components: { components: {
Popup, Popup,
EmployeeList, EmployeeList,
TimeList, TimeList,
OrderStatusList, OrderStatusList,
PayList PayList,
CourseOptionList
}, },
name: 'OrderScreen', name: 'OrderScreen',
props: { props: {
configData: {
type: Object,
default: null
},
title: {
type: String,
default: '工单筛选'
}
}, },
data () { data () {
return { return {
screenList: config.screenList, screenList: this.configData ? this.configData.screenList : config.screenList,
chooseContent: {}, chooseContent: {},
viewKey: Date.now(), viewKey: Date.now(),
onCompleteNum: 0 onCompleteNum: 0
...@@ -99,6 +109,9 @@ export default { ...@@ -99,6 +109,9 @@ export default {
} }
}, },
computed: { computed: {
popupTitle() {
return this.title
},
userInfo () { userInfo () {
return uni.$storage.get("userInfo") return uni.$storage.get("userInfo")
}, },
......
<template>
<view class="study-permission-popup-wrapper">
<!-- 标题 -->
<view class="popup-title">未完成学习任务,暂不能开单</view>
<!-- 第一段描述 -->
<view class="description-text">
优秀的技能是您接单的通行证,磨刀不误砍柴工,您的专业能力是赢得客户信任的关键。
</view>
<!-- 第二段描述(橙色) -->
<view class="highlight-text">
到学习中心-我的课程-待学习,完成课程学习后,即可解锁开单权限。
</view>
<!-- 第三段描述 -->
<view class="tip-text">
只差一步即可开启您的接单之旅!
</view>
<!-- 按钮 -->
<view class="goto-button" @click="handleGoToStudy">
去往学习中心
</view>
</view>
</template>
<script>
export default {
name: 'StudyCenterPermissionPopup',
methods: {
handleGoToStudy() {
this.$emit('confirm')
}
}
}
</script>
<style lang="scss" scoped>
.study-permission-popup-wrapper {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.popup-title {
height: toRpx(48);
color: #333333;
font-size: toRpx(40);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
margin-bottom: toRpx(40);
}
.description-text {
width: toRpx(720);
min-height: toRpx(96);
color: #6c6f75;
font-size: toRpx(32);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(48);
margin-bottom: toRpx(48);
}
.highlight-text {
width: toRpx(656);
min-height: toRpx(104);
color: #ff9d0a;
font-size: toRpx(32);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(52);
margin-bottom: toRpx(64);
}
.tip-text {
width: toRpx(420);
height: toRpx(34);
color: #6c6f75;
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
margin-bottom: toRpx(16);
}
.goto-button {
width: toRpx(704);
height: toRpx(80);
border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: toRpx(28);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
margin-bottom: toRpx(48);
&:active {
opacity: 0.8;
}
}
</style>
<template>
<view v-if="show" class="study-popup-mask" @click="handleMaskClick">
<view
class="study-popup-content"
:style="contentStyle"
@click.stop
>
<!-- 顶部图片 -->
<image
v-if="topImage"
class="top-image"
:src="topImage"
:style="topImageStyle"
mode="aspectFill"
/>
<!-- 标题 -->
<view v-if="title" class="popup-title">{{ title }}</view>
<!-- 内容区域 - 默认插槽 -->
<view class="popup-body">
<slot></slot>
</view>
<!-- 底部按钮插槽 -->
<slot name="footer"></slot>
</view>
</view>
</template>
<script>
export default {
name: 'StudyPopup',
props: {
show: {
type: Boolean,
default: false
},
width: {
type: [Number, String],
default: 848
},
height: {
type: [Number, String],
default: 1054
},
title: {
type: String,
default: ''
},
topImage: {
type: String,
default: ''
},
topImageWidth: {
type: [Number, String],
default: 848
},
topImageHeight: {
type: [Number, String],
default: 248
},
maskClosable: {
type: Boolean,
default: false
}
},
computed: {
contentStyle() {
return {
width: this.formatSize(this.width),
minHeight: this.formatSize(this.height)
}
},
topImageStyle() {
return {
width: this.formatSize(this.topImageWidth),
height: this.formatSize(this.topImageHeight)
}
}
},
methods: {
formatSize(size) {
return typeof size === 'number' ? `${size}rpx` : size
},
handleMaskClick() {
if (this.maskClosable) {
this.close()
}
},
close() {
this.$emit('update:show', false)
this.$emit('close')
}
}
}
</script>
<style lang="scss" scoped>
.study-popup-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.study-popup-content {
background: #FFFFFF;
border-radius: toRpx(48);
display: flex;
flex-direction: column;
align-items: center;
position: relative;
max-height: toRpx(740);
overflow-y: auto;
}
.top-image {
width: 100%;
display: block;
margin-bottom: toRpx(48);
flex-shrink: 0;
border-radius: toRpx(20) toRpx(20) 0 0;
}
.popup-title {
font-size: toRpx(40);
font-weight: 500;
letter-spacing: 0;
line-height: toRpx(46.88);
color: rgba(51, 51, 51, 1);
text-align: center;
margin-bottom: toRpx(48);
padding: 0 toRpx(32);
}
.popup-body {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 toRpx(32);
}
</style>
<template>
<view class="study-popup-content-wrapper">
<!-- 内容卡片 -->
<view class="content-card">
<!-- 卡片标题 -->
<view v-if="cardTitle" class="card-title">{{ cardTitle }}</view>
<!-- 主要描述文本 -->
<view v-if="description" class="description-text">{{ description }}</view>
<!-- 列表项 -->
<view v-if="listItems && listItems.length" class="list-wrapper">
<view
v-for="(item, index) in listItems"
:key="index"
class="list-item"
>
<view class="dot"></view>
<view class="list-text">{{ item }}</view>
</view>
</view>
<!-- 自定义内容插槽 -->
<slot></slot>
</view>
<!-- 提示文本 -->
<view v-if="tipText" class="tip-text">
请先完成 <text class="highlight"> 【 {{ courseName }} 】</text>考试测评后会推送适合您的课程
</view>
<!-- 按钮 -->
<view v-if="buttonText" class="action-button" @click="handleButtonClick">
{{ buttonText }}
</view>
</view>
</template>
<script>
export default {
name: 'StudyPopupContent',
props: {
cardTitle: {
type: String,
default: ''
},
description: {
type: String,
default: ''
},
listItems: {
type: Array,
default: () => []
},
tipText: {
type: String,
default: ''
},
courseName: {
type: String,
default: 'XXX'
},
buttonText: {
type: String,
default: ''
}
},
methods: {
handleButtonClick() {
this.$emit('button-click')
}
}
}
</script>
<style lang="scss" scoped>
.study-popup-content-wrapper {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.content-card {
width: 720rpx;
opacity: 1;
border-radius: 20rpx;
background: rgba(247, 248, 250, 1);
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
padding: 32rpx 40rpx;
box-sizing: border-box;
}
.card-title {
font-size: 36rpx;
font-weight: 500;
letter-spacing: 0;
line-height: 40rpx;
color: rgba(41, 45, 51, 1);
text-align: left;
margin-bottom: 16rpx;
}
.description-text {
width: 640rpx;
font-size: 32rpx;
font-weight: 400;
letter-spacing: 0;
line-height: 48rpx;
color: rgba(108, 111, 117, 1);
margin-bottom: 16rpx;
}
.list-wrapper {
width: 100%;
margin-top: 16rpx;
}
.list-item {
display: flex;
align-items: flex-start;
margin-bottom: 8rpx;
&:last-child {
margin-bottom: 0;
}
}
.dot {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: rgba(108, 111, 117, 1);
margin-top: 18rpx;
margin-right: 12rpx;
flex-shrink: 0;
}
.list-text {
flex: 1;
font-size: 32rpx;
font-weight: 400;
letter-spacing: 0;
line-height: 52rpx;
color: rgba(108, 111, 117, 1);
}
.tip-text {
width: 720rpx;
font-size: 28rpx;
font-weight: 500;
letter-spacing: 0;
line-height: 32.82rpx;
color: rgba(108, 111, 117, 1);
margin-top: 56rpx;
text-align: center;
.highlight {
color: rgba(59, 115, 255, 1);
}
}
.action-button {
width: 720rpx;
height: 80rpx;
border-radius: 48rpx;
background: linear-gradient(180deg, rgba(44, 102, 247, 1) 0%, rgba(72, 166, 255, 1) 100%);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 16rpx;
font-size: 28rpx;
font-weight: 500;
letter-spacing: 0;
line-height: 40rpx;
color: rgba(255, 255, 255, 1);
text-align: center;
cursor: pointer;
&:active {
opacity: 0.8;
}
}
</style>
<template>
<view class="two-level-select-box">
<view
class="select"
@click.stop="isSelect = !isSelect"
>
{{ currentLabel }}
<view class="sprite-icon icon-arrow-bottom"></view>
</view>
<view
class="pop-box"
v-if="isSelect"
>
<!-- 一级菜单 -->
<view
v-for="(item, index) in selectList"
:key="index"
class="type-item flex"
:class="getItemClass(index, item)"
@click="chooseFirstLevel(index, item)"
>
<view class="item-label">{{ item[labelKey] }}</view>
</view>
<!-- 二级菜单 -->
<view
class="second-level-box"
v-if="showSecondLevel && currentFirstLevel && currentFirstLevel.children"
>
<view
v-for="(child, childIndex) in currentFirstLevel.children"
:key="childIndex"
class="type-item flex"
:class="childIndex === selectSecondIndex ? 'active' : ''"
@click.stop="chooseSecondLevel(childIndex, child)"
>
{{ child[labelKey] }}
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
selectList: Array,
labelKey: {
type: String,
default: 'label'
}
},
name: 'TwoLevelSelectComponent',
data() {
return {
selectFirstIndex: 0,
selectSecondIndex: -1,
isSelect: false,
showSecondLevel: false,
currentFirstLevel: null
}
},
computed: {
currentLabel() {
const firstItem = this.selectList[this.selectFirstIndex]
if (!firstItem) return ''
// 如果有选中的二级分类
if (this.selectSecondIndex >= 0 && firstItem.children && firstItem.children[this.selectSecondIndex]) {
return firstItem.children[this.selectSecondIndex][this.labelKey]
}
// 否则显示一级分类
return firstItem[this.labelKey]
}
},
methods: {
getItemClass(index, item) {
const classes = []
if (index === this.selectFirstIndex && this.selectSecondIndex === -1) {
classes.push('active')
}
if (item.children && item.children.length) {
classes.push('has-children')
}
return classes.join(' ')
},
hideSelect() {
this.isSelect = false
this.showSecondLevel = false
},
chooseFirstLevel(index, item) {
// 如果有二级菜单,显示二级菜单
if (item.children && item.children.length) {
this.showSecondLevel = true
this.currentFirstLevel = item
this.selectFirstIndex = index
} else {
// 没有二级菜单,直接选中
this.selectFirstIndex = index
this.selectSecondIndex = -1
this.isSelect = false
this.showSecondLevel = false
this.$emit('chooseType', { item, index, level: 1 })
}
},
chooseSecondLevel(childIndex, child) {
this.selectSecondIndex = childIndex
this.isSelect = false
this.showSecondLevel = false
this.$emit('chooseType', {
item: child,
index: childIndex,
parentIndex: this.selectFirstIndex,
parent: this.currentFirstLevel,
level: 2
})
}
}
}
</script>
<style scoped lang='scss'>
.two-level-select-box {
position: relative;
z-index: 5;
.select {
display: flex;
align-items: center;
justify-content: flex-end;
height: toRpx(84);
border-radius: toRpx(16);
opacity: 1;
background: #f2f2f2;
padding: 0 toRpx(24) 0 toRpx(40);
}
.pop-box {
position: absolute;
top: toRpx(100);
left: 0;
width: 100%;
background: #ffffff;
box-shadow: 0 0 toRpx(16) 0 #99999933;
border-radius: toRpx(16);
padding: toRpx(16) 0;
text-align: center;
animation: show-view-opacity 0.15s forwards;
.type-item {
padding: 0 toRpx(28);
margin-bottom: toRpx(8);
height: toRpx(84);
justify-content: center;
align-items: center;
&:last-child {
margin-bottom: 0;
}
&.active {
background-color: #ecf1ff;
}
}
}
.second-level-box {
position: absolute;
top: 0;
left: 100%;
width: 100%;
background: #ffffff;
box-shadow: 0 0 toRpx(16) 0 #99999933;
border-radius: toRpx(16);
padding: toRpx(16) 0;
.type-item {
justify-content: center;
}
}
}
</style>
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 3 const index = 2
/** /**
* *
0本地 0本地
......
...@@ -124,7 +124,34 @@ ...@@ -124,7 +124,34 @@
"h5" : { "h5" : {
"devServer" : { "devServer" : {
"port" : 8080, "port" : 8080,
"https" : false "https" : false,
"host" : "0.0.0.0",
"disableHostCheck" : true,
"proxy" : {
"^/rop-scrm-" : {
"target" : "https://scrm.test.glsx.com.cn",
"changeOrigin" : true,
"secure" : false
},
"^/rop-dj-" : {
"target" : "https://183.62.222.180",
"changeOrigin" : true,
"secure" : false,
"headers" : {
"Host" : "dj.test.glsx.com.cn"
}
},
"^/gsc-vcp-" : {
"target" : "http://gsc.test.glsx.com.cn",
"changeOrigin" : true,
"secure" : false
},
"^/rop-merchants/" : {
"target" : "https://rop-merchant.test.glsx.com.cn",
"changeOrigin" : true,
"secure" : false
}
}
} }
} }
} }
...@@ -110,6 +110,36 @@ ...@@ -110,6 +110,36 @@
} }
}, },
{ {
"path": "pages/common/studyWebview",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/studyCenter/myTask",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/studyCenter/myCourse",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/studyCenter/myExam",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/studyCenter/leaderboard",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/msgwebview" "path": "pages/common/msgwebview"
}, },
{ {
......
No preview for this file type
...@@ -83,14 +83,14 @@ export default { ...@@ -83,14 +83,14 @@ export default {
} }
console.log(this.url, 999) console.log(this.url, 999)
// this.url='http://assistant.test.glsx.com.cn/chat/jHpvpOmuMWPxYxKo?business_type=12&brand=%E9%97%AE%E7%95%8C&one_id=266&platformType=2&no_header=1&domain=http://aiassistant.test.glsx.com.cn' // this.url='http://assistant.test.glsx.com.cn/chat/jHpvpOmuMWPxYxKo?business_type=12&brand=%E9%97%AE%E7%95%8C&one_id=266&platformType=2&no_header=1&domain=http://aiassistant.test.glsx.com.cn'
setTimeout(() => { // setTimeout(() => {
const currentWebview = this.$scope.$getAppWebview() // const currentWebview = this.$scope.$getAppWebview()
const wv = currentWebview.children()[0] // const wv = currentWebview.children()[0]
if (wv) { // if (wv) {
this.wv = wv // this.wv = wv
wv.setStyle({ top: '10%', height: '90%' }) // wv.setStyle({ top: '10%', height: '90%' })
} // }
}, 1000) // }, 1000)
}, },
onBackPress (options) { onBackPress (options) {
if (options.from === 'backbutton') { if (options.from === 'backbutton') {
......
...@@ -73,10 +73,7 @@ export default { ...@@ -73,10 +73,7 @@ export default {
// authorizedBusinessList: [1,2] // authorizedBusinessList: [1,2]
// } // }
// uni.$storage.set('studyCenterPermission', _res) // uni.$storage.set('studyCenterPermission', _res)
uni.$api.commonApi.getStudyCenterPermission({yqMerchantIdList}).then(res => {
uni.$storage.set('studyCenterPermission', res)
console.log(res,'res')
})
if (autoLogin) this.chooseAccount(loginUserInfoList[0]) if (autoLogin) this.chooseAccount(loginUserInfoList[0])
} else uni.showToast({ } else uni.showToast({
title: message, title: message,
......
<template>
<view class="study-webview-container">
<!-- <view
class="header"
@click="back"
>
<view class="nav-bar">
<view class="back">
<uni-icons
type="left"
:size="20"
color="#000000"
></uni-icons>
</view>
<view class="title">{{ pageTitle }}</view>
</view>
</view> -->
<view
class="webview-window"
v-if="webviewUrl"
>
<web-view :src="webviewUrl"></web-view>
</view>
</view>
</template>
<script>
export default {
name: 'StudyWebview',
data () {
return {
webviewUrl: '',
pageTitle: '学习测评',
wv: null,
hotArea: null // 存储热区对象
}
},
onLoad (options) {
if (options.pageTitle) {
this.pageTitle = options.pageTitle
}
if (options.url) {
// 和 detail.vue 一样,直接使用 URL,不需要 decode
this.webviewUrl = options.url
}
console.log('📱 学习中心 webview 接收到的 URL (直接使用):', this.webviewUrl)
// 提取并解码 return_url 部分以便查看
try {
const match = this.webviewUrl.match(/return_url=([^&]+)/)
if (match) {
const returnUrl = decodeURIComponent(match[1])
console.log('🎯 return_url 部分 (完全解码,仅用于查看):', returnUrl)
}
} catch (e) {
console.log('⚠️ 解析 return_url 失败')
}
// 设置 webview 样式
setTimeout(() => {
this.setWebviewStyle()
}, 500)
},
mounted() {
// 在 mounted 时也尝试设置,确保样式生效
setTimeout(() => {
this.setWebviewStyle()
this.createHotArea()
// this.hideThirdPartyBackButton() // 不隐藏第三方按钮,只用热区拦截点击
}, 1000)
},
beforeDestroy() {
// 销毁热区
if (this.hotArea) {
this.hotArea.close()
this.hotArea = null
}
},
onBackPress (options) {
if (options.from === 'backbutton') {
this.back()
return true
}
return false
},
onBackPress(options) {
if (options.from === 'backbutton') {
// 阻止默认返回
this.back()
return true
}
return false
},
methods: {
setWebviewStyle() {
// 参照 detail.vue,设置 webview 样式
const setWebviewStyleWithRetry = () => {
console.log('尝试设置 webview 样式')
try {
const currentWebview = this.$scope.$getAppWebview()
const wv = currentWebview.children()[0]
console.log('webview 对象:', wv)
if (wv) {
this.wv = wv
// 设置 webview 从导航栏下方开始显示
wv.setStyle({
top: '56', // 状态栏(48) + 导航栏(88) = 136rpx 转换为 68px
left: '0',
width: '100%',
height: 'calc(100% - 136rpx)' // 减去顶部导航栏高度
})
console.log('✅ webview 样式设置成功')
return true
} else {
console.log('⚠️ 未找到 webview 对象')
return false
}
} catch (error) {
console.error('❌ 设置 webview 样式失败:', error)
return false
}
}
// 尝试设置,如果失败则重试
let retryCount = 0
const maxRetries = 5
const retry = () => {
if (!setWebviewStyleWithRetry() && retryCount < maxRetries) {
retryCount++
console.log(`重试设置 webview 样式 (${retryCount}/${maxRetries})`)
setTimeout(retry, 300)
}
}
retry()
},
back () {
console.log('触发返回,发送事件')
// 先返回上一页
uni.navigateBack({
success: () => {
console.log('返回成功,触发弹窗事件')
// 延迟触发事件,确保页面已经返回
setTimeout(() => {
uni.$emit('showExamSubmitPopup')
}, 100)
}
})
},
// 创建透明热区覆盖在返回按钮位置,拦截点击事件
createHotArea() {
// #ifdef APP-PLUS
try {
// 获取系统状态栏高度
const statusBarHeight = plus.navigator.getStatusbarHeight()
// 创建一个透明的原生 View 作为热区
// 覆盖在第三方页面左上角返回按钮的位置
this.hotArea = new plus.nativeObj.View('hotArea', {
top: statusBarHeight + 'px', // 状态栏下方
left: '0px',
width: '120px', // 热区宽度
height: '88px', // 热区高度(导航栏高度)
backgroundColor: 'rgba(0,0,0,0)' // 完全透明
})
// 监听热区点击事件
this.hotArea.addEventListener('click', () => {
console.log('🎯 热区被点击,触发返回')
this.back()
}, false)
// 显示热区
this.hotArea.show()
console.log('✅ 已创建返回按钮热区')
} catch (error) {
console.error('❌ 创建热区失败:', error)
}
// #endif
}
}
}
</script>
<style scoped lang="scss">
.header {
z-index: 999999999;
background-size: 100% 100%;
position: fixed;
width: 100%;
top: 0;
left: 0;
.nav-bar {
width: 100%;
height: toRpx(88);
display: flex;
align-items: center;
justify-content: center;
position: relative;
.back {
position: absolute;
left: toRpx(32);
display: flex;
align-items: center;
justify-content: center;
width: toRpx(48);
height: toRpx(48);
}
.title {
color: #333333;
font-size: toRpx(36);
font-weight: 500;
text-align: center;
}
}
}
.webview-window {
// webview 样式通过原生 setStyle 方法设置
// 这里只是占位,实际样式由 setWebviewStyle() 控制
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
}
</style>
<template>
<view class="my-course-container">
<!-- 顶部导航 -->
<view class="header">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000000"></uni-icons>
</view>
<view class="title">我的课程</view>
</view>
</view>
<!-- Tab 切换 -->
<view class="tab-container">
<view
v-for="(tab, index) in tabList"
:key="index"
:class="['tab-item', { 'active': currentTab === index }]"
@click="switchTab(index)"
>
<text class="tab-text">{{ tab.label }}{{ tab.count }}</text>
</view>
</view>
<!-- 提示信息 -->
<view class="tips">
<view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">剩余X天完成必修课学习及通过课后考试,过期将锁定开单权限</view>
</view>
<!-- 课程列表 -->
<view class="course-content">
<!-- 待学习 -->
<RecommendCourse v-if="currentTab === 0" ref="recommendCourse" :cardWidth="530" />
<!-- 正在学习 -->
<MyTask v-else-if="currentTab === 1" ref="myTask" :cardWidth="530" />
<!-- 已学完 -->
<CompletedCourse v-else-if="currentTab === 2" ref="completedCourse" :cardWidth="530" />
</view>
</view>
</template>
<script>
import RecommendCourse from '@/components/HomeFrame/components/Study/RecommendCourse.vue'
import MyTask from '@/components/HomeFrame/components/Study/MyTask.vue'
import CompletedCourse from '@/components/HomeFrame/components/Study/CompletedCourse.vue'
export default {
name: 'MyCoursePage',
components: {
RecommendCourse,
MyTask,
CompletedCourse
},
data() {
return {
currentTab: 0,
tabList: [
{ label: '待学习', count: '8' },
{ label: '正在学习', count: '5' },
{ label: '已学完', count: '6' }
]
}
},
methods: {
back() {
uni.navigateBack()
},
switchTab(index) {
this.currentTab = index
}
}
}
</script>
<style lang="scss" scoped>
.my-course-container {
width: 100%;
height: 100vh;
position: relative;
&::after {
content: '';
background-image: url('@/assets/images/common/home-bg-1.webp');
background-size: 100% 100%;
background-repeat: no-repeat;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.header {
position: relative;
margin-bottom: toRpx(16);
.nav-bar {
display: flex;
align-items: center;
justify-content: center;
height: toRpx(88);
position: relative;
.back {
position: absolute;
left: toRpx(32);
display: flex;
align-items: center;
justify-content: center;
width: toRpx(48);
height: toRpx(48);
cursor: pointer;
}
.title {
font-size: toRpx(36);
font-weight: 500;
color: #000000;
text-align: center;
}
}
}
.tab-container {
display: flex;
align-items: center;
padding: 0 toRpx(64);
margin-top: toRpx(32);
.tab-item {
width: toRpx(208);
height: toRpx(72);
border-radius: toRpx(16);
border: toRpx(2) solid #ffffffcc;
background: #ffffff;
backdrop-filter: blur(toRpx(12));
display: flex;
align-items: center;
justify-content: center;
margin-right: toRpx(16);
cursor: pointer;
transition: all 0.3s ease;
.tab-text {
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
color: #666666;
text-align: center;
line-height: toRpx(36);
}
&:last-child {
margin-right: 0;
}
&.active {
border: toRpx(2) solid #ffffff;
background: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%);
box-shadow: toRpx(4) toRpx(8) toRpx(16) 0 #81a3d659;
.tab-text {
color: #ffffff;
font-weight: 500;
}
}
}
}
.tips {
display: flex;
align-items: center;
padding: toRpx(8) toRpx(22);
background-color: rgba(255, 243, 224, 0.8);
border-radius: toRpx(8);
font-size: toRpx(24);
color: #FF9D0A;
height: toRpx(48);
margin: toRpx(28) toRpx(64);
&-text {
margin-top: toRpx(4);
}
.icon-study-tips {
margin-right: toRpx(8);
}
}
.course-content {
flex: 1;
height: calc(100vh - toRpx(300));
overflow: hidden;
}
}
</style>
<template>
<view class="my-exam-container">
<!-- 顶部导航 -->
<view class="header">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000000"></uni-icons>
</view>
<view class="title">我的考试</view>
</view>
</view>
<!-- Tab 切换 -->
<view class="tab-container">
<view
v-for="(tab, index) in tabList"
:key="index"
:class="['tab-item', { 'active': currentTab === index }]"
@click="switchTab(index)"
>
<text class="tab-text">{{ tab.label }}{{ tab.count }}</text>
</view>
</view>
<!-- 考试列表 -->
<view class="exam-content">
<!-- 已通过 -->
<PassedExam v-if="currentTab === 0" ref="passedExam" :cardWidth="530" />
<!-- 未通过 -->
<FailedExam v-else-if="currentTab === 1" ref="failedExam" :cardWidth="530" />
</view>
</view>
</template>
<script>
import PassedExam from '@/components/HomeFrame/components/Study/PassedExam.vue'
import FailedExam from '@/components/HomeFrame/components/Study/FailedExam.vue'
export default {
name: 'MyExamPage',
components: {
PassedExam,
FailedExam
},
data() {
return {
currentTab: 0,
tabList: [
{ label: '已通过', count: '3' },
{ label: '未通过', count: '2' }
]
}
},
methods: {
back() {
uni.navigateBack()
},
switchTab(index) {
this.currentTab = index
}
}
}
</script>
<style lang="scss" scoped>
.my-exam-container {
width: 100%;
height: 100vh;
position: relative;
overflow: hidden;
&::after {
content: '';
background-image: url('@/assets/images/common/home-bg-1.webp');
background-size: 100% 100%;
background-repeat: no-repeat;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.header {
position: relative;
z-index: 10;
background: transparent;
.nav-bar {
display: flex;
align-items: center;
justify-content: center;
height: toRpx(88);
margin-top: var(--status-bar-height);
position: relative;
.back {
position: absolute;
left: toRpx(32);
display: flex;
align-items: center;
justify-content: center;
width: toRpx(60);
height: toRpx(60);
}
.title {
font-size: toRpx(36);
font-weight: 500;
color: #000000;
}
}
}
.tab-container {
display: flex;
align-items: center;
padding: 0 toRpx(64);
margin-top: toRpx(32);
margin-bottom: toRpx(72);
.tab-item {
width: toRpx(208);
height: toRpx(72);
border-radius: toRpx(16);
border: toRpx(2) solid #ffffffcc;
background: #ffffff;
backdrop-filter: blur(toRpx(12));
display: flex;
align-items: center;
justify-content: center;
margin-right: toRpx(16);
cursor: pointer;
transition: all 0.3s ease;
.tab-text {
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
color: #666666;
text-align: center;
line-height: toRpx(36);
}
&:last-child {
margin-right: 0;
}
&.active {
border: toRpx(2) solid #ffffff;
background: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%);
box-shadow: toRpx(4) toRpx(8) toRpx(16) 0 #81a3d659;
.tab-text {
color: #ffffff;
font-weight: 500;
}
}
}
}
.exam-content {
width: 100%;
height: calc(100vh - var(--status-bar-height) - toRpx(88) - toRpx(100));
overflow-y: auto;
}
}
</style>
...@@ -4,19 +4,20 @@ import { getTime, withinSpliter, daysBetween } from './util' ...@@ -4,19 +4,20 @@ import { getTime, withinSpliter, daysBetween } from './util'
class LocalLog { class LocalLog {
logger = null logger = null
constructor() { constructor() {
this.logger = new LogCat() this.logger={}
// this.logger = new LogCat()
} }
debug(msg) { debug(msg) {
this.logger.writeLog(LogLevel.DEBUG, msg) // this.logger.writeLog(LogLevel.DEBUG, msg)
} }
info(msg) { info(msg) {
this.logger.writeLog(LogLevel.INFO, msg) // this.logger.writeLog(LogLevel.INFO, msg)
} }
warn(msg) { warn(msg) {
this.logger.writeLog(LogLevel.WARN, msg) // this.logger.writeLog(LogLevel.WARN, msg)
} }
error(msg) { error(msg) {
this.logger.writeLog(LogLevel.ERROR, msg) // this.logger.writeLog(LogLevel.ERROR, msg)
} }
getFiles(beginDate, endDate) { getFiles(beginDate, endDate) {
const logFiles = this.logger.getLogFileList() const logFiles = this.logger.getLogFileList()
......
...@@ -31,9 +31,61 @@ const spritesmithFunction = data => { ...@@ -31,9 +31,61 @@ const spritesmithFunction = data => {
return `${shared}\n${perSprite}` return `${shared}\n${perSprite}`
} }
const path = require('path') const path = require('path')
const { domain, djDomain, evaluationDomain, merchantDomain } = require('./env.js')
module.exports = { module.exports = {
devServer: { devServer: {
disableHostCheck: true disableHostCheck: true,
host: '0.0.0.0',
port: 8080,
proxy: {
// SCRM 接口代理
'^/rop-scrm-': {
target: 'https://183.62.222.180',
changeOrigin: true,
secure: false,
ws: true,
logLevel: 'debug',
headers: {
Host: 'scrm.test.glsx.com.cn'
}
},
// DJ 接口代理(包括 rop-dj-car-boutique、rop-dj-smartcarlife 等)
'^/rop-dj-': {
target: 'https://183.62.222.180', // 使用IP地址替代域名
changeOrigin: true,
secure: false,
ws: true,
logLevel: 'debug',
headers: {
Host: 'dj.test.glsx.com.cn' // 保持原域名作为Host头
}
},
// DJ PAD 接口代理
'^/rop-dj-pad/': {
target: djDomain,
changeOrigin: true,
secure: false,
ws: true,
logLevel: 'debug'
},
// 评估接口代理
'^/gsc-vcp-': {
target: evaluationDomain,
changeOrigin: true,
secure: false,
ws: true,
logLevel: 'debug'
},
// 商户接口代理
'^/rop-merchants/': {
target: merchantDomain,
changeOrigin: true,
secure: false,
ws: true,
logLevel: 'debug'
}
}
}, },
configureWebpack: { configureWebpack: {
plugins: [ plugins: [
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!