Commit a9b52cf5 by 胡悦

提交学习中心联调

1 parent fefcf818
......@@ -88,8 +88,7 @@ export default {
collectTrack:false,
hasPerson: false,
messageType: 'study',
sopCount: 0,
tokenUrl: ''
sopCount: 0
}
},
watch: {
......@@ -164,7 +163,7 @@ export default {
const url = 'https%3A%2F%2Fcloud.italent.cn%2FPageHome%2FIndex%3Fproduct%3DLearning%26keyName%3DNusion%26pageCode%3DLearningNewHomepage%26appCode%3DLearning%26_qsrcapp%3DLearning%26_qrt%3Dhtml%26quark_s%3D5102bff371c00da5b19968ee53a8c3f1499ecd2447a19f72f3e3ba2390cc9617%23%2FviewDynamic%3Fshadow_context%3D%257BappModel%253A%2522italent%2522%252Cuppid%253A%25221%2522%257D%26quark_s%3D028930f1066f8ef8d28790940d53ae64337f44bde3a44cf89a290e4a3611e3e2'
uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
console.log(res, 'res')
this.tokenUrl = res.data
uni.$storage.set('beisenToken', res.data)
const studyUrl = res.data ? `${res.data}&return_url=${url}` : ''
resolve(studyUrl)
})
......@@ -194,7 +193,7 @@ export default {
clearInterval(this.trackInterval)
}
this.$emit('update:tabIndex', index)
this.$emit("changeTab", index,jumpUrl, this.tokenUrl)
this.$emit("changeTab", index,jumpUrl)
this.getMessageInfo()
this.getSopCount()
},
......@@ -245,13 +244,16 @@ export default {
// 学习中心消息弹窗,优先级高于有修改话术弹窗
async getMessagePop() {
const res = await uni.$api.commonApi.getMessagePop({})
console.log(res, 'res111')
if (res.ids && res.ids.length > 0) {
if ([1, 2, 3].includes(res.contentType)) {
this.messageType = 'system'
} else if (res.contentType === 5) {
console.log(res.contentType, res.contentType == 5, 'res')
if (res.contentType == 5) {
this.messageType = 'study'
} else {
this.messageType = 'system'
}
this.messageData = res
this.$refs.kfRef.open()
} else {
await this.getMessage()
}
......@@ -299,7 +301,7 @@ export default {
flex-shrink: 0;
background-image: url('@/assets/images/home/left-bg.png');
background-size: 100% 100%;
z-index: 9999;
z-index: 999;
.left-tabs {
width: 100%;
height: toRpx(1080);
......
......@@ -12,7 +12,7 @@
<template v-else-if="type=='study'">
<image class="message-bg" :src="require('@//assets/images/common/study-center-bg.webp')"></image>
<view class="text text-first study-title">学习提醒</view>
<view class="text study-text">当前有{{messageData.total}}个学习任务待完成,请及时处理。</view>
<view class="text study-text">当前有{{messageData.count}}个学习任务待完成,请及时处理。</view>
<view class="text study-text">坚持学习助您能力提升!</view>
<view class="btn study-btn" @click="jumpStudyCenter">去查看</view>
</template>
......@@ -61,8 +61,8 @@ export default {
this.close()
},
jumpSystem() {
// this.getDetailById(this.messageData.ids[0])
this.getDetailById(51)
this.getDetailById(this.messageData.ids[0])
// this.getDetailById(51)
this.close()
},
async getDetailById(id) {
......@@ -83,6 +83,7 @@ export default {
})
} else if (res.contentType == 3) {
const _content = res.content ? JSON.parse(res.content) : []
console.log(_content, 'res.contentType == 3')
const url = _content[0].image
const { content, title, id } = res
uni.navigateTo({
......
<template>
<view class="course-content">
<view class="course-content" v-if="tokenUrl">
<view class="title">
<view>专属必学课程</view>
<view class="course-btn" @click="openAllCourse">
......@@ -31,18 +31,20 @@
size="20"></uni-icons>
</view>
<view class="tips" v-if="firstIndex != 2">
<view class="sprite-icon icon-study-tips"></view>带有“限时学”标签的课程:规定时间内未完成任务,禁止提单!请按时学习。
<view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">带有"限时学"标签的课程:规定时间内未完成任务,禁止提单!请按时学习。</view>
</view>
<scroll-view scroll-y ref="scrollViewRef" :class="['message-list', getScrollHeight]" @scrolltolower="pageonReachBottom"
:scroll-top="scrollTop">
<template v-if="list.length">
<view class="message-list-box">
<view class="message-item" v-for="item in list" :key="item.id" @click="openDetail(item)">
<view class="time-limit-tag" v-if="item.punishType == 1"></view>
<image class="course-bg" src="../../../assets/images/common/course-default-bg.webp" mode="aspectFill" />
<view class="course-info">
<view class="course-title">{{ item.taskTitle }}</view>
<view class="study-status">
<text class="label">学习进度:</text>
<text class="label">学习进度</text>
<view class="value-wrapper">
<view class="status-dot" :class="{
'orange-bg': [1, 2, 3].includes(item.status),
......@@ -63,19 +65,19 @@
</view>
</view>
<view class="info-item">
<text class="label">课程名称:</text>
<text class="value">{{ item.courseName }}</text>
<text class="label">课程名称</text>
<view class="value value-hidden">{{ item.courseName }}</view>
</view>
<view class="info-item">
<text class="label">开始时间:</text>
<text class="label">开始时间</text>
<text class="value">{{ item.createdDate }}</text>
</view>
<view class="info-item">
<text class="label">完成时间:</text>
<text class="value">{{ item.finishDate }}</text>
<text class="label">完成时间</text>
<text class="value">{{ item.finishDate ? item.finishDate : '-' }}</text>
</view>
<view class="info-item">
<text class="label">完成标准:</text>
<text class="label">完成标准</text>
<text class="value">{{ item.taskFinishCriteria === 0 ? '无' : '完成学习 (含考核)' }}</text>
</view>
</view>
......@@ -168,6 +170,7 @@ export default {
total: 0,
pageNum: PAGE_NUM,
pageSize: PAGE_SIZE,
tokenUrl: ''
}
},
computed: {
......@@ -199,8 +202,12 @@ export default {
// },
},
mounted() {
this.getStudyCenterList()
this.getUnreadCount()
console.log(uni.$storage.get('beisenToken'), 'beisenToken')
this.tokenUrl = uni.$storage.get('beisenToken')
if(this.tokenUrl) {
this.getStudyCenterList()
this.getUnreadCount()
}
},
methods: {
// tab切换
......@@ -520,6 +527,10 @@ export default {
margin: toRpx(24) toRpx(64) 0;
font-size: toRpx(24);
color: #FF9D0A;
height: toRpx(48);
&-text {
margin-top: toRpx(4);
}
.icon-study-tips {
margin-right: toRpx(8);
......@@ -548,10 +559,24 @@ export default {
}
.message-item {
position: relative;
width: calc((100% - #{toRpx(144)}) / 4);
border-radius: toRpx(24);
box-shadow: 0 toRpx(8) toRpx(32) 0 #2c66f71a;
box-sizing: border-box;
.time-limit-tag {
position: absolute;
top: 0;
left: 0;
width: toRpx(122);
height: toRpx(48);
background-image: url('../../../assets/images/common/limit-page.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
z-index: 1;
color: #fff;
}
.course-bg {
width: 100%;
......@@ -567,8 +592,10 @@ export default {
font-weight: 500;
}
.label {
margin-right: toRpx(24);
font-size: toRpx(24);
color: #999EA8;
}
.study-status {
display: flex;
......@@ -609,10 +636,17 @@ export default {
}
}
.info-item {
display: flex;
font-size: toRpx(24);
margin-bottom: toRpx(12);
.value {
color: #666666;
&.value-hidden {
width: toRpx(254);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
......
......@@ -107,8 +107,7 @@ export default {
userInfo: {},
tabIndex: 0,
showLeadPage: false,
showBeisen: false,
tokenUrl: ''
showBeisen: false
}
},
mounted() {
......@@ -136,13 +135,12 @@ export default {
}
},
methods: {
async changeTab($event, jumpUrl, tokenUrl) {
console.log($event, 'event', tokenUrl)
async changeTab($event, jumpUrl) {
console.log($event, 'event')
this.$emit('changeTab', $event)
if ($event == 3) {
this.showBeisen = false
this.jumpUrl = jumpUrl
this.tokenUrl = tokenUrl
if (!this.jumpUrl) {
uni.showToast({
title: '培训账号未创建',
......@@ -238,9 +236,9 @@ export default {
const queryString = Object.entries(params)
.map(([key, value]) => `${key}=${value}`)
.join('&');
const tokenUrl = uni.$storage.get('beisenToken')
const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`);
this.jumpUrl = `${this.tokenUrl}&return_url=${url}`;
this.jumpUrl = `${tokenUrl}&return_url=${url}`;
};
// 根据操作类型执行相应逻辑
......
......@@ -220,12 +220,14 @@ export default {
const url = `/pages/common/aiWebview?url=${agentUrl}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}&practice_status=${taskStatus}&checkDate=${checkDate}`;
uni.navigateTo({ url });
// 不刷新列表的更新消息状态
if (row.status == 0) this.getList.find(item => item.boxId == row.boxId).status = 1
// 调用接口更新消息状态
const res = await uni.$api.commonApi.updateMessageStatus({
idList: [row.boxId]
})
console.log(res, '===')
if (row.status == 0) {
this.getList.find(item => item.boxId == row.boxId).status = 1
// 调用接口更新消息状态
const res = await uni.$api.commonApi.updateMessageStatus({
idList: [row.boxId]
})
console.log(res, '===')
}
},
2: () => {
uni.navigateTo({
......@@ -244,7 +246,12 @@ export default {
});
},
0: () => {
this.getDetailById(id, row.readFlag);
if (row.contentType == 5) {
this.back()
uni.$emit('studyCenter')
} else {
this.getDetailById(id, row.readFlag);
}
}
};
const action = actionMap[this.firstIndex];
......
......@@ -38,5 +38,6 @@ export const STORAGE_OBJECTKEY = {
findReceptionpriproConfigList: 'findReceptionpriproConfigList',
appInfoList: 'appInfoList',
leadPage: 'leadPage',
recordTrackList: 'recordTrackList'
recordTrackList: 'recordTrackList',
beisenToken: 'beisenToken'
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!