Commit a9b52cf5 by 胡悦

提交学习中心联调

1 parent fefcf818
...@@ -88,8 +88,7 @@ export default { ...@@ -88,8 +88,7 @@ export default {
collectTrack:false, collectTrack:false,
hasPerson: false, hasPerson: false,
messageType: 'study', messageType: 'study',
sopCount: 0, sopCount: 0
tokenUrl: ''
} }
}, },
watch: { watch: {
...@@ -164,7 +163,7 @@ export default { ...@@ -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' 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 => { uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
console.log(res, 'res') console.log(res, 'res')
this.tokenUrl = res.data uni.$storage.set('beisenToken', res.data)
const studyUrl = res.data ? `${res.data}&return_url=${url}` : '' const studyUrl = res.data ? `${res.data}&return_url=${url}` : ''
resolve(studyUrl) resolve(studyUrl)
}) })
...@@ -194,7 +193,7 @@ export default { ...@@ -194,7 +193,7 @@ export default {
clearInterval(this.trackInterval) clearInterval(this.trackInterval)
} }
this.$emit('update:tabIndex', index) this.$emit('update:tabIndex', index)
this.$emit("changeTab", index,jumpUrl, this.tokenUrl) this.$emit("changeTab", index,jumpUrl)
this.getMessageInfo() this.getMessageInfo()
this.getSopCount() this.getSopCount()
}, },
...@@ -245,13 +244,16 @@ export default { ...@@ -245,13 +244,16 @@ export default {
// 学习中心消息弹窗,优先级高于有修改话术弹窗 // 学习中心消息弹窗,优先级高于有修改话术弹窗
async getMessagePop() { async getMessagePop() {
const res = await uni.$api.commonApi.getMessagePop({}) const res = await uni.$api.commonApi.getMessagePop({})
console.log(res, 'res111')
if (res.ids && res.ids.length > 0) { if (res.ids && res.ids.length > 0) {
if ([1, 2, 3].includes(res.contentType)) { console.log(res.contentType, res.contentType == 5, 'res')
this.messageType = 'system' if (res.contentType == 5) {
} else if (res.contentType === 5) {
this.messageType = 'study' this.messageType = 'study'
} else {
this.messageType = 'system'
} }
this.messageData = res this.messageData = res
this.$refs.kfRef.open()
} else { } else {
await this.getMessage() await this.getMessage()
} }
...@@ -299,7 +301,7 @@ export default { ...@@ -299,7 +301,7 @@ export default {
flex-shrink: 0; flex-shrink: 0;
background-image: url('@/assets/images/home/left-bg.png'); background-image: url('@/assets/images/home/left-bg.png');
background-size: 100% 100%; background-size: 100% 100%;
z-index: 9999; z-index: 999;
.left-tabs { .left-tabs {
width: 100%; width: 100%;
height: toRpx(1080); height: toRpx(1080);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<template v-else-if="type=='study'"> <template v-else-if="type=='study'">
<image class="message-bg" :src="require('@//assets/images/common/study-center-bg.webp')"></image> <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 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="text study-text">坚持学习助您能力提升!</view>
<view class="btn study-btn" @click="jumpStudyCenter">去查看</view> <view class="btn study-btn" @click="jumpStudyCenter">去查看</view>
</template> </template>
...@@ -61,8 +61,8 @@ export default { ...@@ -61,8 +61,8 @@ export default {
this.close() this.close()
}, },
jumpSystem() { jumpSystem() {
// this.getDetailById(this.messageData.ids[0]) this.getDetailById(this.messageData.ids[0])
this.getDetailById(51) // this.getDetailById(51)
this.close() this.close()
}, },
async getDetailById(id) { async getDetailById(id) {
...@@ -83,6 +83,7 @@ export default { ...@@ -83,6 +83,7 @@ export default {
}) })
} else if (res.contentType == 3) { } else if (res.contentType == 3) {
const _content = res.content ? JSON.parse(res.content) : [] const _content = res.content ? JSON.parse(res.content) : []
console.log(_content, 'res.contentType == 3')
const url = _content[0].image const url = _content[0].image
const { content, title, id } = res const { content, title, id } = res
uni.navigateTo({ uni.navigateTo({
......
<template> <template>
<view class="course-content"> <view class="course-content" v-if="tokenUrl">
<view class="title"> <view class="title">
<view>专属必学课程</view> <view>专属必学课程</view>
<view class="course-btn" @click="openAllCourse"> <view class="course-btn" @click="openAllCourse">
...@@ -31,18 +31,20 @@ ...@@ -31,18 +31,20 @@
size="20"></uni-icons> size="20"></uni-icons>
</view> </view>
<view class="tips" v-if="firstIndex != 2"> <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> </view>
<scroll-view scroll-y ref="scrollViewRef" :class="['message-list', getScrollHeight]" @scrolltolower="pageonReachBottom" <scroll-view scroll-y ref="scrollViewRef" :class="['message-list', getScrollHeight]" @scrolltolower="pageonReachBottom"
:scroll-top="scrollTop"> :scroll-top="scrollTop">
<template v-if="list.length"> <template v-if="list.length">
<view class="message-list-box"> <view class="message-list-box">
<view class="message-item" v-for="item in list" :key="item.id" @click="openDetail(item)"> <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" /> <image class="course-bg" src="../../../assets/images/common/course-default-bg.webp" mode="aspectFill" />
<view class="course-info"> <view class="course-info">
<view class="course-title">{{ item.taskTitle }}</view> <view class="course-title">{{ item.taskTitle }}</view>
<view class="study-status"> <view class="study-status">
<text class="label">学习进度:</text> <text class="label">学习进度</text>
<view class="value-wrapper"> <view class="value-wrapper">
<view class="status-dot" :class="{ <view class="status-dot" :class="{
'orange-bg': [1, 2, 3].includes(item.status), 'orange-bg': [1, 2, 3].includes(item.status),
...@@ -63,19 +65,19 @@ ...@@ -63,19 +65,19 @@
</view> </view>
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="label">课程名称:</text> <text class="label">课程名称</text>
<text class="value">{{ item.courseName }}</text> <view class="value value-hidden">{{ item.courseName }}</view>
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="label">开始时间:</text> <text class="label">开始时间</text>
<text class="value">{{ item.createdDate }}</text> <text class="value">{{ item.createdDate }}</text>
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="label">完成时间:</text> <text class="label">完成时间</text>
<text class="value">{{ item.finishDate }}</text> <text class="value">{{ item.finishDate ? item.finishDate : '-' }}</text>
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="label">完成标准:</text> <text class="label">完成标准</text>
<text class="value">{{ item.taskFinishCriteria === 0 ? '无' : '完成学习 (含考核)' }}</text> <text class="value">{{ item.taskFinishCriteria === 0 ? '无' : '完成学习 (含考核)' }}</text>
</view> </view>
</view> </view>
...@@ -168,6 +170,7 @@ export default { ...@@ -168,6 +170,7 @@ export default {
total: 0, total: 0,
pageNum: PAGE_NUM, pageNum: PAGE_NUM,
pageSize: PAGE_SIZE, pageSize: PAGE_SIZE,
tokenUrl: ''
} }
}, },
computed: { computed: {
...@@ -199,8 +202,12 @@ export default { ...@@ -199,8 +202,12 @@ export default {
// }, // },
}, },
mounted() { mounted() {
console.log(uni.$storage.get('beisenToken'), 'beisenToken')
this.tokenUrl = uni.$storage.get('beisenToken')
if(this.tokenUrl) {
this.getStudyCenterList() this.getStudyCenterList()
this.getUnreadCount() this.getUnreadCount()
}
}, },
methods: { methods: {
// tab切换 // tab切换
...@@ -520,6 +527,10 @@ export default { ...@@ -520,6 +527,10 @@ export default {
margin: toRpx(24) toRpx(64) 0; margin: toRpx(24) toRpx(64) 0;
font-size: toRpx(24); font-size: toRpx(24);
color: #FF9D0A; color: #FF9D0A;
height: toRpx(48);
&-text {
margin-top: toRpx(4);
}
.icon-study-tips { .icon-study-tips {
margin-right: toRpx(8); margin-right: toRpx(8);
...@@ -548,10 +559,24 @@ export default { ...@@ -548,10 +559,24 @@ export default {
} }
.message-item { .message-item {
position: relative;
width: calc((100% - #{toRpx(144)}) / 4); width: calc((100% - #{toRpx(144)}) / 4);
border-radius: toRpx(24); border-radius: toRpx(24);
box-shadow: 0 toRpx(8) toRpx(32) 0 #2c66f71a; box-shadow: 0 toRpx(8) toRpx(32) 0 #2c66f71a;
box-sizing: border-box; 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 { .course-bg {
width: 100%; width: 100%;
...@@ -567,8 +592,10 @@ export default { ...@@ -567,8 +592,10 @@ export default {
font-weight: 500; font-weight: 500;
} }
.label { .label {
margin-right: toRpx(24);
font-size: toRpx(24); font-size: toRpx(24);
color: #999EA8; color: #999EA8;
} }
.study-status { .study-status {
display: flex; display: flex;
...@@ -609,10 +636,17 @@ export default { ...@@ -609,10 +636,17 @@ export default {
} }
} }
.info-item { .info-item {
display: flex;
font-size: toRpx(24); font-size: toRpx(24);
margin-bottom: toRpx(12); margin-bottom: toRpx(12);
.value { .value {
color: #666666; color: #666666;
&.value-hidden {
width: toRpx(254);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
} }
} }
} }
......
...@@ -107,8 +107,7 @@ export default { ...@@ -107,8 +107,7 @@ export default {
userInfo: {}, userInfo: {},
tabIndex: 0, tabIndex: 0,
showLeadPage: false, showLeadPage: false,
showBeisen: false, showBeisen: false
tokenUrl: ''
} }
}, },
mounted() { mounted() {
...@@ -136,13 +135,12 @@ export default { ...@@ -136,13 +135,12 @@ export default {
} }
}, },
methods: { methods: {
async changeTab($event, jumpUrl, tokenUrl) { async changeTab($event, jumpUrl) {
console.log($event, 'event', tokenUrl) console.log($event, 'event')
this.$emit('changeTab', $event) this.$emit('changeTab', $event)
if ($event == 3) { if ($event == 3) {
this.showBeisen = false this.showBeisen = false
this.jumpUrl = jumpUrl this.jumpUrl = jumpUrl
this.tokenUrl = tokenUrl
if (!this.jumpUrl) { if (!this.jumpUrl) {
uni.showToast({ uni.showToast({
title: '培训账号未创建', title: '培训账号未创建',
...@@ -238,9 +236,9 @@ export default { ...@@ -238,9 +236,9 @@ export default {
const queryString = Object.entries(params) const queryString = Object.entries(params)
.map(([key, value]) => `${key}=${value}`) .map(([key, value]) => `${key}=${value}`)
.join('&'); .join('&');
const tokenUrl = uni.$storage.get('beisenToken')
const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`); 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 { ...@@ -220,12 +220,14 @@ export default {
const url = `/pages/common/aiWebview?url=${agentUrl}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}&practice_status=${taskStatus}&checkDate=${checkDate}`; const url = `/pages/common/aiWebview?url=${agentUrl}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}&practice_status=${taskStatus}&checkDate=${checkDate}`;
uni.navigateTo({ url }); uni.navigateTo({ url });
// 不刷新列表的更新消息状态 // 不刷新列表的更新消息状态
if (row.status == 0) this.getList.find(item => item.boxId == row.boxId).status = 1 if (row.status == 0) {
this.getList.find(item => item.boxId == row.boxId).status = 1
// 调用接口更新消息状态 // 调用接口更新消息状态
const res = await uni.$api.commonApi.updateMessageStatus({ const res = await uni.$api.commonApi.updateMessageStatus({
idList: [row.boxId] idList: [row.boxId]
}) })
console.log(res, '===') console.log(res, '===')
}
}, },
2: () => { 2: () => {
uni.navigateTo({ uni.navigateTo({
...@@ -244,8 +246,13 @@ export default { ...@@ -244,8 +246,13 @@ export default {
}); });
}, },
0: () => { 0: () => {
if (row.contentType == 5) {
this.back()
uni.$emit('studyCenter')
} else {
this.getDetailById(id, row.readFlag); this.getDetailById(id, row.readFlag);
} }
}
}; };
const action = actionMap[this.firstIndex]; const action = actionMap[this.firstIndex];
if (action) { if (action) {
......
...@@ -38,5 +38,6 @@ export const STORAGE_OBJECTKEY = { ...@@ -38,5 +38,6 @@ export const STORAGE_OBJECTKEY = {
findReceptionpriproConfigList: 'findReceptionpriproConfigList', findReceptionpriproConfigList: 'findReceptionpriproConfigList',
appInfoList: 'appInfoList', appInfoList: 'appInfoList',
leadPage: 'leadPage', 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!