Commit aa699573 by 胡悦

提交学习中心相关代码

1 parent 56d860b6
......@@ -106,5 +106,13 @@ module.exports = {
projectName: 'boutique',
...data
})
},
// 案例视频中心埋点
caseVideoCenter(data) {
return http.post({
method: 'dj.api.boutique.reception.material.point.insert',
projectName: 'boutique',
...data
})
}
}
......@@ -417,5 +417,29 @@ module.exports = {
projectName: 'pad',
...data
})
},
// 获取智能体
getAiAgentList(data) {
return http.post({
method: 'dj.pad.api.aiagent.get.special.agent',
projectName: 'pad',
...data
})
},
// 学习任务确认消息弹窗
getStudyTaskConfirm(data) {
return http.post({
method: 'dj.pad.api.staff.message.confirm',
projectName: 'pad',
...data
})
},
// 学习中心-员工学习中心权限授权校验
getStudyCenterPermission(data) {
return http.post({
method: 'dj.pad.api.staff.study.center.access.auth.verify',
projectName: 'pad',
...data
})
}
}

2.44 MB | W: | H:

2.44 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -118,7 +118,7 @@ export default {
isTrack: true,
name: 'StudyCenter',
eventCode: 'app_study_center',
hidden: true
hidden: false
},
{
label: "场景集市",
......@@ -189,6 +189,7 @@ export default {
created () {
// 监听自定义事件
uni.$on('pageBack', () => {
console.log('pageBack')
this.getMessageInfo();
});
uni.$on('studyCenter', () => {
......@@ -197,9 +198,9 @@ export default {
this.changeIndex(index, this.tabs[index])
});
this.getUnreadCount()
this.findBeiSenSSOToken().then(() => {
this.getMessageInfo()
}) // 获取北森token后再获取消息
this.getStudyCenterPermission()
this.getMessageInfo()
this.findBeiSenSSOToken()
},
inject: ['showPage'],
methods: {
......@@ -264,18 +265,18 @@ export default {
// if (this.tabIndex == index) return;
// 点击学习中心要跳从北森回后台配置的学习中心,学习中心为3
if (this.tabIndex == index && !item.isTrack) return;
let jumpUrl
// let jumpUrl
if (item.isTrack) {
this.$emit('closeTips')
try {
jumpUrl = await this.findBeiSenSSOToken()
this.jumpUrl = jumpUrl
} catch (error) {
}
if (jumpUrl) {
// try {
// jumpUrl = await this.findBeiSenSSOToken()
// this.jumpUrl = jumpUrl
// } catch (error) {
// }
// if (jumpUrl) {
this.addTrack()
this.startTrack()
}
// }
} else {
this.leaveTrack()
......@@ -286,10 +287,12 @@ export default {
this.$emit('update:tabIndex', index)
this.$emit("changeTab", {
item,
jumpUrl,
index
})
this.getMessageInfo()
if (item.name == 'StudyCenter') {
this.findBeiSenSSOToken()
}
},
async haveCustomerAccess (val) {
const { shopMerchantId, sceneType: scene } = val
......@@ -307,15 +310,15 @@ export default {
merchantId: shopMerchantId,
scene
}).then(result => {
uni.$storage.set('isSaleOpen', result)
// uni.$storage.set('isSaleOpen', result)
if (result) {
this.hasPerson = true
}
const channelType = 1
// 非直营且非鸿蒙智行, 隐藏学习中心tab
if (result || channelType == 1) {
this.tabs[2].hidden = false
}
// const channelType = 1
// // 非直营且非鸿蒙智行, 隐藏学习中心tab
// if (result || channelType == 1) {
// this.tabs[2].hidden = false
// }
})
},
// 获取话术未读列表
......@@ -349,40 +352,24 @@ export default {
// },
// 学习中心消息弹窗,优先级高于有修改话术弹窗
async getMessagePop () {
// 获取今天日期字符串
const today = new Date().toISOString().slice(0, 10)
// 获取当前用户手机号
const userInfo = uni.$storage.get('userInfo') || {}
const phone = userInfo.phone || ''
// 读取缓存
let shownData = uni.$storage.get('messagePopShownDate') || {}
// shownData 结构: { [phone]: date }
// 把手机号也存到一个变量中
const cachePhone = phone
if (shownData[phone] === today) {
// 今天已经弹过窗,直接返回
await this.getMessage()
return
}
const res = await uni.$api.commonApi.getMessagePop({})
if (res.ids && res.ids.length > 0) {
if (res.contentType == 5) {
const _token = uni.$storage.get('beisenToken')
if (_token) {
this.messageType = 'study'
this.messageData = res
this.$refs.kfRef.open()
// 记录今日已弹窗
shownData[phone] = today
uni.$storage.set('messagePopShownDate', shownData)
if (Array.isArray(res.moduleTypeList) && (res.moduleTypeList.includes(3) || res.moduleTypeList.includes(4))
) {
// 3, 4学习任务弹窗
this.messageType = 'study'
this.messageData = res
this.$refs.kfRef.open()
// 确认消息
if (res.ids.length) {
uni.$api.commonApi.getStudyTaskConfirm({
ids: res.ids[0]
})
}
} else {
this.messageType = 'system'
this.messageData = res
this.$refs.kfRef.open()
// 记录今日已弹窗
shownData[phone] = today
uni.$storage.set('messagePopShownDate', shownData)
}
} else {
await this.getMessage()
......@@ -432,6 +419,15 @@ export default {
uni.$track.add({
eventCode: 'app_scene_change'
})
},
// 学习中心权限获取
getStudyCenterPermission() {
const res = uni.$storage.get('studyCenterPermission')
const {directSaleAuth, hmzxAuth} = res
if (!directSaleAuth && !hmzxAuth) {
this.tabs[2].hidden = false
}
}
},
beforeCreate () {
......
......@@ -61,7 +61,7 @@ export default {
this.close()
},
jumpSystem() {
this.getDetailById(this.messageData.ids[0])
this.getDetailById(this.messageData.businessIds[0])
// this.getDetailById(51)
this.close()
},
......
......@@ -13,8 +13,8 @@
<view class="statistics-unit">名</view>
</view>
</view>
<view :class="['progress-box', progressList.filter(item => !item.hidden).length === 1 ? 'only-one' : '']">
<template v-for="(item, index) in progressList">
<view :class="['progress-box', filteredProgressList.filter(item => !item.hidden).length === 1 ? 'only-one' : '']">
<template v-for="(item, index) in filteredProgressList">
<view :class="['progress-item', isBeisen ? 'bg' : '']" :key="index" v-if="!item.hidden">
<view :class="['progress-item-title', isBeisen ? '' : 'title']">{{ item.title }}</view>
<view class="progress-item-value">
......@@ -63,6 +63,14 @@ export default {
dataInfo: {
type: Object,
default: () => {}
},
isHmzx: {
type: Boolean,
default: false
},
isYb: {
type: Boolean,
default: false
}
},
data() {
......@@ -87,6 +95,15 @@ export default {
],
}
},
computed: {
filteredProgressList() {
// 如果isHmzx或isYb 为false,则不展示短课程(type:3)
if (!this.isHmzx || !this.isYb) {
return this.progressList.filter(item => item.type !== 3);
}
return this.progressList;
}
},
mounted() {
},
methods: {
......
......@@ -70,7 +70,7 @@
</view>
<view class="task-item-text" v-if="item.courseType === 2">
<view class="task-item-label">课程数</view>
<view class="task-item-value">{{ item.courseTotalCount }} | {{ item.totalDuration ? `${item.totalDuration}mi` : '-' }}</view>
<view class="task-item-value">{{ item.courseTotalCount }} 节 | {{ item.totalDuration ? `${item.totalDuration}min` : '-' }}</view>
</view>
<view class="task-item-text">
<view class="task-item-label">完成时间</view>
......@@ -170,7 +170,9 @@ export default {
) {
const deadline = new Date(item.taskDeadline);
const diff = deadline - now;
if (diff > 0 && diff <= 24 * 60 * 60 * 1000) {
const oneDayMs = 24 * 60 * 60 * 1000;
if (diff > 0 && diff < oneDayMs) {
// 小于1天,展示24小时倒计时
hasCountdown = true;
const hours = Math.floor(diff / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
......@@ -182,11 +184,13 @@ export default {
this.$set(item, '_showDays', false);
this.$set(item, '_leftDays', null);
this.$set(item, '_timeout', false);
} else if (diff > 24 * 60 * 60 * 1000) {
// 超过24小时,显示剩余天数
} else if (diff >= oneDayMs) {
// 超过等于1天,显示剩余天数(不足x天则展示x-1天)
this.$set(item, '_showCountdown', false);
this.$set(item, '_showDays', true);
const days = Math.ceil(diff / (24 * 60 * 60 * 1000));
// days = Math.ceil(diff / oneDayMs) - 1, 最小为1天
let days = Math.ceil(diff / oneDayMs) - 1;
if (days < 1) days = 1;
this.$set(item, '_leftDays', days);
this.$set(item, '_countdownHour', null);
this.$set(item, '_countdownMinute', null);
......@@ -361,12 +365,22 @@ export default {
uni.$track.add({eventCode: 'app_short_course', businessId: id, pagePath: '/pages/equity/index'})
}
uni.navigateTo({
url: `/pages/common/studyDetail/${courseType == 1 ? 'shortCourse' : 'longCourse'}?row=${encodeURIComponent(JSON.stringify(item))}`,
url: `/pages/common/studyDetail/${courseType == 1 ? 'shortCourse' : 'longCourse'}?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${this.tabIndex}`,
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
}
},
findBeiSenSSOToken () {
return new Promise(resolve => {
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.$storage.set('beisenToken', res.data)
const studyUrl = res.data ? `${res.data}&return_url=${url}` : ''
resolve(studyUrl)
})
})
},
}
}
</script>
......
<template>
<view :class="['study-box2', isFlag ? '' : 'big-height']">
<view :class="['study-box2', !isHmzx || !isYb ? 'big-height' : '']">
<view class="tab-list">
<view @click="handleTabClick(index)" :class="['tab-item', tabIndex === index ? 'active' : '']"
v-for="(item, index) in tabList" :key="index">
......@@ -8,14 +8,25 @@
</view>
<view class="rank-title">周转化率排名</view>
<view class="rank-value">
<view class="rank-number">{{ currentConversionData.top }}</view>名
<view class="rank-number">{{ currentConversionData.top || '-' }}</view>名
</view>
<view class="bar-box">
<view class="bar-item" v-for="(item, index) in barList" :key="index">
<view class="bar-label">{{ item.label }}</view>
<view class="bar-container">
<view class="bar" :class="item.class" :style="{ width: currentConversionData[item.key] + '%' }"></view>
<view class="bar-text" :style="{ left: `calc(${currentConversionData[item.key]}%)` }">{{ currentConversionData[item.key] }}%</view>
<view
class="bar"
:class="item.class"
:style="{
width: (Number(currentConversionData[item.key]) > 0
? `max(2px, ${currentConversionData[item.key]}%)`
: '2px')
}"
></view>
<view
class="bar-text"
:style="{ left: `calc(${currentConversionData[item.key]}%)` }"
>{{ (Number(currentConversionData[item.key]) || 0).toFixed(1) }}%</view>
</view>
</view>
</view>
......@@ -32,6 +43,14 @@ export default {
dataInfo: {
type: Object,
default: () => {}
},
isHmzx: {
type: Boolean,
default: false
},
isYb: {
type: Boolean,
default: false
}
},
data() {
......@@ -56,61 +75,73 @@ export default {
},
computed: {
tabList() {
// const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio
const weekConversionRatio = {
0: {
top: 1,
myConversionRatio: '0',
topOneConversionRatio: '94.5'
},
// 1: {
// top: 2,
// myConversionRatio: '74.3',
// topOneConversionRatio: '94.5'
// },
2: {
top: 3,
myConversionRatio: '55.7',
topOneConversionRatio: '84.5'
}
}
const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio
// const weekConversionRatio = {
// 0: {
// top: 1,
// myConversionRatio: '0',
// topOneConversionRatio: '94.5'
// },
// 1: {
// top: 2,
// myConversionRatio: '74.3',
// topOneConversionRatio: '94.5'
// },
// 2: {
// top: 3,
// myConversionRatio: '55.7',
// topOneConversionRatio: '84.5'
// },
// }
if (!weekConversionRatio) return []
// 生成tabList,key为weekConversionRatio的key
return Object.keys(weekConversionRatio).map(key => {
// 这里可以根据实际业务自定义title
// 例如:0-延保,1-精品,2-权益
// 这里暂时用key做title
let title = ''
if (key == 0) title = '延保'
else if (key == 1) title = '轻改'
else if (key == 2) title = '权益'
else title = `类型${key}`
return {
title,
value: key
// 按顺序延保、权益、轻改生成tabList
const order = [0, 2, 1]
const tabArr = order
.filter(key => weekConversionRatio.hasOwnProperty(key))
.map(key => {
let title = '';
if (key == 0) title = '延保';
else if (key == 2) title = '权益';
else if (key == 1) title = '轻改';
else title = `类型${key}`;
return {
title,
value: key
}
});
// 默认展示延保,如果没有延保,tabIndex默认为第一个
this.$nextTick(() => {
if (tabArr.length > 0) {
const yanbaoIndex = tabArr.findIndex(item => item.value == 0);
if (yanbaoIndex !== -1) {
if (this.tabIndex !== yanbaoIndex) this.tabIndex = yanbaoIndex;
} else {
if (this.tabIndex !== 0) this.tabIndex = 0;
}
}
})
});
return tabArr;
},
currentConversionData() {
// 返回当前tabIndex对应的weekConversionRatio数据
// const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio
const weekConversionRatio = {
0: {
top: 1,
myConversionRatio: '0',
topOneConversionRatio: '94.5'
},
// 1: {
// top: 2,
// myConversionRatio: '74.3',
// topOneConversionRatio: '94.5'
// },
2: {
top: 3,
myConversionRatio: '55.7',
topOneConversionRatio: '84.5'
}
}
const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio
// const weekConversionRatio = {
// 0: {
// top: 1,
// myConversionRatio: '0',
// topOneConversionRatio: '94.5'
// },
// 1: {
// top: 2,
// myConversionRatio: '74.3',
// topOneConversionRatio: '94.5'
// },
// 2: {
// top: 3,
// myConversionRatio: '55.7',
// topOneConversionRatio: '84.5'
// },
// }
if (!weekConversionRatio) return {}
const key = this.tabList[this.tabIndex] && this.tabList[this.tabIndex].value
return weekConversionRatio[key] || {}
......
......@@ -4,11 +4,11 @@
<view class="title">学习看板</view>
<view class="study-board-box">
<!-- 累计学习看板 -->
<LearnStatistics :dataInfo="dataInfo" :isBeisen="isBeisen" />
<LearnStatistics :dataInfo="dataInfo" :isBeisen="isBeisen" :isHmzx="isHmzx" :isYb="isYb" />
<!-- 周转化率看板 -->
<WeeklyConversionRate :dataInfo="dataInfo" :isFlag="isFlag" />
<WeeklyConversionRate :dataInfo="dataInfo" :isHmzx="isHmzx" :isYb="isYb" />
<!-- 能力分析看板 -->
<template v-if="isFlag">
<template v-if="isHmzx && isYb">
<view :class="['study-box3', isBeisen ? '' : 'big-height']">
<view :class="['study-box3-title', isBeisen ? '' : 'big-margin']">能力分析</view>
<RadarChart :labelColors="labelColors" :heightClass="isBeisen ? '' : 'big-height'" :chartData="chartData" />
......@@ -68,8 +68,10 @@ export default {
firstIndex: 0,
firstLeft: ['first', 'second'],
firstClass: ['short-first-nav', 'short-second-nav'],
isBeisen: true, // 是否是有北森权限,true 有,false无
isFlag: true // 当前驻店人员所关联的门店非鸿蒙智行或非延保业务
isBeisen: false, // 是否是有北森权限,true 有,false无
isFlag: true, // 当前驻店人员所关联的门店非鸿蒙智行或非延保业务
isHmzx: false, // 当前驻店人员所关联的门店是否是鸿蒙智行
isYb: false, // 当前驻店人员所关联的门店是否是延保业务
}
},
created () {
......@@ -81,7 +83,11 @@ export default {
},
mounted() {
const beisenToken = uni.$storage.get('beisenToken')
const studyCenterPermission = uni.$storage.get('studyCenterPermission')
console.log(beisenToken, 'beisenToken')
this.isBeisen = !!beisenToken
this.isHmzx = studyCenterPermission.hmzxAuth
this.isYb = studyCenterPermission.authorizedBusinessList && studyCenterPermission.authorizedBusinessList.includes(1)
// this.getServerData();
this.getStudyBoard();
},
......@@ -90,35 +96,18 @@ export default {
changeType(index, tagIndex) {
this.firstIndex = index
},
getServerData() {
//模拟从服务器获取数据时的延时
setTimeout(() => {
//模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
let res = {
categories: ["身份介绍", "逼单能力", "攻防能力", "案例展示", "场景塑造", "专业知识", "需求分析", "话题介入", "服务意识"],
series: [
{
name: "成交量",
data: [8, 3.5, 3, 8, 9, 3, 6, 2, 8.5]
}
]
};
this.chartData = JSON.parse(JSON.stringify(res));
console.log(this.chartData, ' 首页')
}, 500);
},
async getStudyBoard() {
const res = await uni.$api.commonApi.getStudyBoard({})
console.log(111111, 'res', res)
this.dataInfo = res
this.dataInfo.shortCourseProgress = 0
this.dataInfo.shortCourseCompletedLearnRatio = 15
// this.dataInfo.shortCourseProgress = 0
// this.dataInfo.shortCourseCompletedLearnRatio = 15
const _chartData = {
categories: res.abilityAnalysisTag,
series: [
{
// data: res.abilityAnalysisScore
data: [1, 2, 3, 1, 2, 2, 3, 3, 3]
data: res.abilityAnalysisScore
// data: [1, 2, 3, 1, 2, 2, 3, 3, 3]
}
]
}
......
......@@ -155,11 +155,11 @@
ref="webview"
src="/hybrid/html/index.html"
></web-view>
<web-view
<!-- <web-view
ref="studyWebview"
:src="jumpUrl"
v-if="showBeisen"
></web-view>
></web-view> -->
</view>
</template>
<script>
......@@ -243,24 +243,24 @@ export default {
}
},
methods: {
async changeTab ({ item, jumpUrl, index }) {
async changeTab ({ item, index }) {
if (index == 0) this.$refs.messageRef.getMessageSummary()
this.previewOff = index != 0
this.$emit('changeTab', index)
this.showBeisen = false
if (item.isTrack) {
this.jumpUrl = jumpUrl
if (!this.jumpUrl) {
uni.showToast({
title: '培训账号未创建',
icon: 'none'
})
return
}
// this.showBeisen = false
// if (item.isTrack) {
// // this.jumpUrl = jumpUrl
// // if (!this.jumpUrl) {
// // uni.showToast({
// // title: '培训账号未创建',
// // icon: 'none'
// // })
// // return
// // }
} else {
this.jumpUrl = ''
}
// } else {
// this.jumpUrl = ''
// }
},
handleFooter (val) {
this.footerBox = val
......
......@@ -13,6 +13,11 @@ export default {
merchantId,
staffUUID: uuid
}).then(result => {
console.log(result, 'result')
const merchantIdList = result.map(item => item.merchantId)
uni.$api.commonApi.getStudyCenterPermission({merchantIdList}).then(res => {
uni.$storage.set('studyCenterPermission', res)
})
// 仅一家4s店
if (result?.length == 1) {
let { merchantName, merchantId } = result[0]
......
<template>
<uni-popup
ref="coursePopupRef"
type="center"
:is-mask-click="false"
animation
class="center-popup"
>
<view :class="['box', popType]">
<view class="title flex">
<view :class="['sprite-icon', `icon-defeat-${popType}`]"></view>
<view class="text">{{title}}</view>
<view
class="icon-close-box flex"
@click="close"
>
<uni-icons
class="icon-close"
type="closeempty"
:size="16"
color="#1A1A1A"
></uni-icons>
</view>
</view>
<view class="content">
<slot name="content"></slot>
</view>
</view>
</uni-popup>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'CenterPopup',
props: {
title: String,
popType: String,
},
data () {
return {
}
},
mounted () {
},
methods: {
open () {
this.$refs.coursePopupRef.open();
},
close () {
this.$refs.coursePopupRef.close();
this.$emit('cancel')
},
}
}
</script>
<style scoped lang='scss'>
.center-popup {
z-index: 99 !important;
}
.box {
width: toRpx(1456);
height: toRpx(840);
background: #ffffff;
border-radius: toRpx(48);
&.summary {
width: toRpx(848);
height: toRpx(400);
}
.title {
width: 100%;
height: toRpx(128);
padding-left: toRpx(48);
background: linear-gradient(180deg, #e6f0ff 0%, #e6f0ff00 100%);
position: relative;
border-radius: toRpx(48) toRpx(48) 0 0;
.text {
font-weight: 500;
font-size: toRpx(40);
color: #1a1a1a;
margin-left: toRpx(24);
// position: absolute;
// left: 50%;
// top: 50%;
// transform: translate(-50%, -50%);
}
.icon-close-box {
height: 100%;
margin-left: auto;
padding: 0 toRpx(48);
}
}
.content {
padding: toRpx(16) toRpx(80) toRpx(72);
width: 100%;
height: calc(100% - #{toRpx(160)});
gap: 0 toRpx(64);
.item {
width: calc(50% - #{toRpx(32)});
height: 100%;
background: #ffffff;
box-shadow: 0 toRpx(12) toRpx(24) 0 #2c66f726;
border-radius: toRpx(48);
flex-direction: column;
box-sizing: border-box;
padding-top: toRpx(92);
position: relative;
overflow: hidden;
.tag {
position: absolute;
width: 192rpx;
height: 72rpx;
border-radius: 0 0 toRpx(48) 0;
background: #4673ff1a;
left: 0;
top: 0;
color: #4673ff;
font-size: 28rpx;
justify-content: center;
}
&-title {
font-weight: 500;
font-size: toRpx(40);
color: #1a1a1a;
padding: toRpx(32) 0 toRpx(16);
}
&-describe {
font-size: toRpx(32);
color: #808291;
text-align: center;
}
&:first-child {
&::before,
&::after {
background: #f7f5ff;
}
}
}
}
}
</style>
\ No newline at end of file
......@@ -17,28 +17,29 @@
<image class="item-img" src="../../../assets/images/common/long-course-default.webp"
mode="scaleToFill" />
<view class="item-content">
<view class="item-title">{{ item.title }}</view>
<view class="item-title">{{ item.courseName }}</view>
<view class="item-info">
<view class="item-info-label">当前状态</view>
<view :class="['item-info-value', item.status === 1 ? 'orange' : 'green']">
<view v-if="item.status === 1" class="dot-value"></view>
{{ item.status === 1 ? `未完成(${item.progress || 0}%)` : item.status === 2 ? '已完成' : '' }}
<view :class="['item-info-value', item.status === 5 ? 'green' : 'orange']">
<view v-if="item.status !== 5" class="dot-value"></view>
{{ item.status !== 5 ? `${statusMap[item.status]}(${item.progress || 0}%)` : '已完成' }}
</view>
</view>
<view class="item-info">
<view class="item-info-label">考试成绩</view>
<view class="item-info-value">{{ item.score }}</view>
<view class="item-info-value">{{ item.totalScore ? '已完成' : '待考核'}}</view>
</view>
<view class="item-info">
<view class="item-info-label">课程时长</view>
<view class="item-info-value">{{ item.duration }}</view>
<view class="item-info-value">{{ item.learnDuration ? `${item.learnDuration}min` : '-' }}</view>
</view>
</view>
<view v-if="item.status === 1" class="item-btn" @click="startStudy(index)">
<image class="completed-bg" src="../../../assets/images/common/completed-bg.png" mode="scaleToFill"
v-if="item.status === 5" />
<view v-else class="item-btn" @click="openCourse(index, item)">
开始学习
</view>
<image class="completed-bg" src="../../../assets/images/common/completed-bg.png" mode="scaleToFill"
v-if="item.status === 2" />
</template>
<template v-if="type === 'recommendation'">
<image class="recommendation-img" src="../../../assets/images/common/recommend-course-default2.webp"
......@@ -49,7 +50,7 @@
<view class="item-info-label">{{ item.times }}min</view>
</view>
</view>
<view class="item-btn" @click="startStudy(index)">
<view class="item-btn" @click="openCourse(index, item)">
学习
</view>
</template>
......@@ -68,81 +69,90 @@
</template>
<script>
const statusMap = {
1: '未学习',
2: '未完成',
3: '待考核',
4: '未通过',
5: '已完成'
}
export default {
data() {
return {
courseList: [
{
title: '延保营销延保营销延保营销延保营销延保营销延保营销',
status: 1,
progress: 25,
score: '未完成(25%)',
duration: '未完成(25%)'
},
{
title: '延保营销',
status: 1,
progress: 25,
score: '未完成(25%)',
duration: '未完成(25%)'
},
{
title: '延保营销',
status: 1,
progress: 25,
score: '未完成(25%)',
duration: '未完成(25%)'
},
{
title: '延保营销',
status: 1,
progress: 25,
score: '未完成(25%)',
duration: '未完成(25%)'
},
{
title: '延保营销',
status: 1,
progress: 25,
score: '未完成(25%)',
duration: '未完成(25%)'
},
{
title: '延保营销',
status: 2,
progress: 25,
score: '未完成(25%)',
duration: '未完成(25%)'
},
{
title: '延保营销',
status: 2,
progress: 25,
score: '未完成(25%)',
duration: '未完成(25%)'
},
{
title: '延保营销',
status: 1,
progress: 25,
score: '未完成(25%)',
duration: '未完成(25%)'
},
{
title: '延保营销',
status: 2,
progress: 25,
score: '未完成(25%)',
duration: '未完成(25%)'
},
{
title: '延保营销',
status: 1,
progress: 25,
score: '未完成(25%)',
duration: '未完成(25%)'
},
],
statusMap,
courseList: [],
// courseList: [
// {
// title: '延保营销延保营销延保营销延保营销延保营销延保营销',
// status: 1,
// progress: 25,
// score: '未完成(25%)',
// duration: '未完成(25%)'
// },
// {
// title: '延保营销',
// status: 1,
// progress: 25,
// score: '未完成(25%)',
// duration: '未完成(25%)'
// },
// {
// title: '延保营销',
// status: 1,
// progress: 25,
// score: '未完成(25%)',
// duration: '未完成(25%)'
// },
// {
// title: '延保营销',
// status: 1,
// progress: 25,
// score: '未完成(25%)',
// duration: '未完成(25%)'
// },
// {
// title: '延保营销',
// status: 1,
// progress: 25,
// score: '未完成(25%)',
// duration: '未完成(25%)'
// },
// {
// title: '延保营销',
// status: 2,
// progress: 25,
// score: '未完成(25%)',
// duration: '未完成(25%)'
// },
// {
// title: '延保营销',
// status: 2,
// progress: 25,
// score: '未完成(25%)',
// duration: '未完成(25%)'
// },
// {
// title: '延保营销',
// status: 1,
// progress: 25,
// score: '未完成(25%)',
// duration: '未完成(25%)'
// },
// {
// title: '延保营销',
// status: 2,
// progress: 25,
// score: '未完成(25%)',
// duration: '未完成(25%)'
// },
// {
// title: '延保营销',
// status: 1,
// progress: 25,
// score: '未完成(25%)',
// duration: '未完成(25%)'
// },
// ],
recommendCourseList: [
{
title: '问界M8延保+安心包套餐谈客案例-产品力篇',
......@@ -204,6 +214,7 @@ export default {
onLoad(options) {
this.type = options.type;
this.selectedIndex = options.index;
this.courseList = JSON.parse(decodeURIComponent(options.courseList));
this.handleOperation('17983a1a-5bcd-4e7d-a180-061ef3f9a49d');
// 只在页面初始化时设置webview的样式
this.setWebviewStyle();
......@@ -226,14 +237,16 @@ export default {
}
uni.navigateBack()
},
openCourse(inde, item) {
openCourse(index, item) {
console.log(index, 'index')
this.selectedIndex = index;
const arr = ['80cb90d7-1609-4360-8f23-6c47ddba41c0', '17983a1a-5bcd-4e7d-a180-061ef3f9a49d']
// const arr = ['80cb90d7-1609-4360-8f23-6c47ddba41c0', '17983a1a-5bcd-4e7d-a180-061ef3f9a49d']
// 只更换url
this.handleOperation(arr[index]);
this.handleOperation(item.courseId);
if (this.type === 'recommendation') {
uni.$track.add({eventCode: 'app_recommend_course', businessId: item.id, pagePath: '/pages/common/studyDetail/detail'})
} else if (this.type === 'long') {
uni.$track.add({eventCode: 'app_long_course', businessId: item.id, pagePath: '/pages/common/studyDetail/detail'})
}
},
handleOperation(courseId) {
......
......@@ -39,6 +39,7 @@ export default {
// 返回
back() {
// this.showPage('MessageList')
uni.$emit('pageBack');
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
......
......@@ -42,5 +42,5 @@ export const STORAGE_OBJECTKEY = {
beisenToken: 'beisenToken',
messagePopShownDate: 'messagePopShownDate',
noticeTopInfo: 'noticeTopInfo',
isSaleOpen: 'isSaleOpen'
studyCenterPermission: 'studyCenterPermission'
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!