Commit aa699573 by 胡悦

提交学习中心相关代码

1 parent 56d860b6
...@@ -106,5 +106,13 @@ module.exports = { ...@@ -106,5 +106,13 @@ module.exports = {
projectName: 'boutique', projectName: 'boutique',
...data ...data
}) })
},
// 案例视频中心埋点
caseVideoCenter(data) {
return http.post({
method: 'dj.api.boutique.reception.material.point.insert',
projectName: 'boutique',
...data
})
} }
} }
...@@ -417,5 +417,29 @@ module.exports = { ...@@ -417,5 +417,29 @@ module.exports = {
projectName: 'pad', projectName: 'pad',
...data ...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 { ...@@ -118,7 +118,7 @@ export default {
isTrack: true, isTrack: true,
name: 'StudyCenter', name: 'StudyCenter',
eventCode: 'app_study_center', eventCode: 'app_study_center',
hidden: true hidden: false
}, },
{ {
label: "场景集市", label: "场景集市",
...@@ -189,6 +189,7 @@ export default { ...@@ -189,6 +189,7 @@ export default {
created () { created () {
// 监听自定义事件 // 监听自定义事件
uni.$on('pageBack', () => { uni.$on('pageBack', () => {
console.log('pageBack')
this.getMessageInfo(); this.getMessageInfo();
}); });
uni.$on('studyCenter', () => { uni.$on('studyCenter', () => {
...@@ -197,9 +198,9 @@ export default { ...@@ -197,9 +198,9 @@ export default {
this.changeIndex(index, this.tabs[index]) this.changeIndex(index, this.tabs[index])
}); });
this.getUnreadCount() this.getUnreadCount()
this.findBeiSenSSOToken().then(() => { this.getStudyCenterPermission()
this.getMessageInfo() this.getMessageInfo()
}) // 获取北森token后再获取消息 this.findBeiSenSSOToken()
}, },
inject: ['showPage'], inject: ['showPage'],
methods: { methods: {
...@@ -264,18 +265,18 @@ export default { ...@@ -264,18 +265,18 @@ export default {
// if (this.tabIndex == index) return; // if (this.tabIndex == index) return;
// 点击学习中心要跳从北森回后台配置的学习中心,学习中心为3 // 点击学习中心要跳从北森回后台配置的学习中心,学习中心为3
if (this.tabIndex == index && !item.isTrack) return; if (this.tabIndex == index && !item.isTrack) return;
let jumpUrl // let jumpUrl
if (item.isTrack) { if (item.isTrack) {
this.$emit('closeTips') this.$emit('closeTips')
try { // try {
jumpUrl = await this.findBeiSenSSOToken() // jumpUrl = await this.findBeiSenSSOToken()
this.jumpUrl = jumpUrl // this.jumpUrl = jumpUrl
} catch (error) { // } catch (error) {
} // }
if (jumpUrl) { // if (jumpUrl) {
this.addTrack() this.addTrack()
this.startTrack() this.startTrack()
} // }
} else { } else {
this.leaveTrack() this.leaveTrack()
...@@ -286,10 +287,12 @@ export default { ...@@ -286,10 +287,12 @@ export default {
this.$emit('update:tabIndex', index) this.$emit('update:tabIndex', index)
this.$emit("changeTab", { this.$emit("changeTab", {
item, item,
jumpUrl,
index index
}) })
this.getMessageInfo() this.getMessageInfo()
if (item.name == 'StudyCenter') {
this.findBeiSenSSOToken()
}
}, },
async haveCustomerAccess (val) { async haveCustomerAccess (val) {
const { shopMerchantId, sceneType: scene } = val const { shopMerchantId, sceneType: scene } = val
...@@ -307,15 +310,15 @@ export default { ...@@ -307,15 +310,15 @@ export default {
merchantId: shopMerchantId, merchantId: shopMerchantId,
scene scene
}).then(result => { }).then(result => {
uni.$storage.set('isSaleOpen', result) // uni.$storage.set('isSaleOpen', result)
if (result) { if (result) {
this.hasPerson = true this.hasPerson = true
} }
const channelType = 1 // const channelType = 1
// 非直营且非鸿蒙智行, 隐藏学习中心tab // // 非直营且非鸿蒙智行, 隐藏学习中心tab
if (result || channelType == 1) { // if (result || channelType == 1) {
this.tabs[2].hidden = false // this.tabs[2].hidden = false
} // }
}) })
}, },
// 获取话术未读列表 // 获取话术未读列表
...@@ -349,40 +352,24 @@ export default { ...@@ -349,40 +352,24 @@ export default {
// }, // },
// 学习中心消息弹窗,优先级高于有修改话术弹窗 // 学习中心消息弹窗,优先级高于有修改话术弹窗
async getMessagePop () { 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({}) const res = await uni.$api.commonApi.getMessagePop({})
if (res.ids && res.ids.length > 0) { if (res.ids && res.ids.length > 0) {
if (res.contentType == 5) { if (Array.isArray(res.moduleTypeList) && (res.moduleTypeList.includes(3) || res.moduleTypeList.includes(4))
const _token = uni.$storage.get('beisenToken') ) {
if (_token) { // 3, 4学习任务弹窗
this.messageType = 'study' this.messageType = 'study'
this.messageData = res this.messageData = res
this.$refs.kfRef.open() this.$refs.kfRef.open()
// 记录今日已弹窗 // 确认消息
shownData[phone] = today if (res.ids.length) {
uni.$storage.set('messagePopShownDate', shownData) uni.$api.commonApi.getStudyTaskConfirm({
ids: res.ids[0]
})
} }
} else { } else {
this.messageType = 'system' this.messageType = 'system'
this.messageData = res this.messageData = res
this.$refs.kfRef.open() this.$refs.kfRef.open()
// 记录今日已弹窗
shownData[phone] = today
uni.$storage.set('messagePopShownDate', shownData)
} }
} else { } else {
await this.getMessage() await this.getMessage()
...@@ -432,6 +419,15 @@ export default { ...@@ -432,6 +419,15 @@ export default {
uni.$track.add({ uni.$track.add({
eventCode: 'app_scene_change' eventCode: 'app_scene_change'
}) })
},
// 学习中心权限获取
getStudyCenterPermission() {
const res = uni.$storage.get('studyCenterPermission')
const {directSaleAuth, hmzxAuth} = res
if (!directSaleAuth && !hmzxAuth) {
this.tabs[2].hidden = false
}
} }
}, },
beforeCreate () { beforeCreate () {
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
this.close() this.close()
}, },
jumpSystem() { jumpSystem() {
this.getDetailById(this.messageData.ids[0]) this.getDetailById(this.messageData.businessIds[0])
// this.getDetailById(51) // this.getDetailById(51)
this.close() this.close()
}, },
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
<view class="statistics-unit">名</view> <view class="statistics-unit">名</view>
</view> </view>
</view> </view>
<view :class="['progress-box', progressList.filter(item => !item.hidden).length === 1 ? 'only-one' : '']"> <view :class="['progress-box', filteredProgressList.filter(item => !item.hidden).length === 1 ? 'only-one' : '']">
<template v-for="(item, index) in progressList"> <template v-for="(item, index) in filteredProgressList">
<view :class="['progress-item', isBeisen ? 'bg' : '']" :key="index" v-if="!item.hidden"> <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-title', isBeisen ? '' : 'title']">{{ item.title }}</view>
<view class="progress-item-value"> <view class="progress-item-value">
...@@ -63,6 +63,14 @@ export default { ...@@ -63,6 +63,14 @@ export default {
dataInfo: { dataInfo: {
type: Object, type: Object,
default: () => {} default: () => {}
},
isHmzx: {
type: Boolean,
default: false
},
isYb: {
type: Boolean,
default: false
} }
}, },
data() { data() {
...@@ -87,6 +95,15 @@ export default { ...@@ -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() { mounted() {
}, },
methods: { methods: {
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</view> </view>
<view class="task-item-text" v-if="item.courseType === 2"> <view class="task-item-text" v-if="item.courseType === 2">
<view class="task-item-label">课程数</view> <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>
<view class="task-item-text"> <view class="task-item-text">
<view class="task-item-label">完成时间</view> <view class="task-item-label">完成时间</view>
...@@ -170,7 +170,9 @@ export default { ...@@ -170,7 +170,9 @@ export default {
) { ) {
const deadline = new Date(item.taskDeadline); const deadline = new Date(item.taskDeadline);
const diff = deadline - now; 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; hasCountdown = true;
const hours = Math.floor(diff / (1000 * 60 * 60)); const hours = Math.floor(diff / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60)); const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
...@@ -182,11 +184,13 @@ export default { ...@@ -182,11 +184,13 @@ export default {
this.$set(item, '_showDays', false); this.$set(item, '_showDays', false);
this.$set(item, '_leftDays', null); this.$set(item, '_leftDays', null);
this.$set(item, '_timeout', false); this.$set(item, '_timeout', false);
} else if (diff > 24 * 60 * 60 * 1000) { } else if (diff >= oneDayMs) {
// 超过24小时,显示剩余天数 // 超过等于1天,显示剩余天数(不足x天则展示x-1天)
this.$set(item, '_showCountdown', false); this.$set(item, '_showCountdown', false);
this.$set(item, '_showDays', true); 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, '_leftDays', days);
this.$set(item, '_countdownHour', null); this.$set(item, '_countdownHour', null);
this.$set(item, '_countdownMinute', null); this.$set(item, '_countdownMinute', null);
...@@ -361,12 +365,22 @@ export default { ...@@ -361,12 +365,22 @@ export default {
uni.$track.add({eventCode: 'app_short_course', businessId: id, pagePath: '/pages/equity/index'}) uni.$track.add({eventCode: 'app_short_course', businessId: id, pagePath: '/pages/equity/index'})
} }
uni.navigateTo({ 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) => { fail: (err) => {
console.error('页面跳转失败:', 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> </script>
......
<template> <template>
<view :class="['study-box2', isFlag ? '' : 'big-height']"> <view :class="['study-box2', !isHmzx || !isYb ? 'big-height' : '']">
<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">
...@@ -8,14 +8,25 @@ ...@@ -8,14 +8,25 @@
</view> </view>
<view class="rank-title">周转化率排名</view> <view class="rank-title">周转化率排名</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 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>
<view class="bar-container"> <view class="bar-container">
<view class="bar" :class="item.class" :style="{ width: currentConversionData[item.key] + '%' }"></view> <view
<view class="bar-text" :style="{ left: `calc(${currentConversionData[item.key]}%)` }">{{ currentConversionData[item.key] }}%</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> </view>
</view> </view>
...@@ -32,6 +43,14 @@ export default { ...@@ -32,6 +43,14 @@ export default {
dataInfo: { dataInfo: {
type: Object, type: Object,
default: () => {} default: () => {}
},
isHmzx: {
type: Boolean,
default: false
},
isYb: {
type: Boolean,
default: false
} }
}, },
data() { data() {
...@@ -56,61 +75,73 @@ export default { ...@@ -56,61 +75,73 @@ export default {
}, },
computed: { computed: {
tabList() { tabList() {
// const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio
const weekConversionRatio = { // const weekConversionRatio = {
0: { // 0: {
top: 1, // top: 1,
myConversionRatio: '0', // myConversionRatio: '0',
topOneConversionRatio: '94.5' // topOneConversionRatio: '94.5'
}, // },
// 1: { // 1: {
// top: 2, // top: 2,
// myConversionRatio: '74.3', // myConversionRatio: '74.3',
// topOneConversionRatio: '94.5' // topOneConversionRatio: '94.5'
// }, // },
2: { // 2: {
top: 3, // top: 3,
myConversionRatio: '55.7', // myConversionRatio: '55.7',
topOneConversionRatio: '84.5' // topOneConversionRatio: '84.5'
} // },
} // }
if (!weekConversionRatio) return [] if (!weekConversionRatio) return []
// 生成tabList,key为weekConversionRatio的key // 按顺序延保、权益、轻改生成tabList
return Object.keys(weekConversionRatio).map(key => { const order = [0, 2, 1]
// 这里可以根据实际业务自定义title const tabArr = order
// 例如:0-延保,1-精品,2-权益 .filter(key => weekConversionRatio.hasOwnProperty(key))
// 这里暂时用key做title .map(key => {
let title = '' let title = '';
if (key == 0) title = '延保' if (key == 0) title = '延保';
else if (key == 1) title = '轻改' else if (key == 2) title = '权益';
else if (key == 2) title = '权益' else if (key == 1) title = '轻改';
else title = `类型${key}` else title = `类型${key}`;
return { return {
title, title,
value: key 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() { currentConversionData() {
// 返回当前tabIndex对应的weekConversionRatio数据 // 返回当前tabIndex对应的weekConversionRatio数据
// const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio
const weekConversionRatio = { // const weekConversionRatio = {
0: { // 0: {
top: 1, // top: 1,
myConversionRatio: '0', // myConversionRatio: '0',
topOneConversionRatio: '94.5' // topOneConversionRatio: '94.5'
}, // },
// 1: { // 1: {
// top: 2, // top: 2,
// myConversionRatio: '74.3', // myConversionRatio: '74.3',
// topOneConversionRatio: '94.5' // topOneConversionRatio: '94.5'
// }, // },
2: { // 2: {
top: 3, // top: 3,
myConversionRatio: '55.7', // myConversionRatio: '55.7',
topOneConversionRatio: '84.5' // topOneConversionRatio: '84.5'
} // },
} // }
if (!weekConversionRatio) return {} if (!weekConversionRatio) return {}
const key = this.tabList[this.tabIndex] && this.tabList[this.tabIndex].value const key = this.tabList[this.tabIndex] && this.tabList[this.tabIndex].value
return weekConversionRatio[key] || {} return weekConversionRatio[key] || {}
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<view class="title">学习看板</view> <view class="title">学习看板</view>
<view class="study-board-box"> <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', isBeisen ? '' : 'big-height']">
<view :class="['study-box3-title', isBeisen ? '' : 'big-margin']">能力分析</view> <view :class="['study-box3-title', isBeisen ? '' : 'big-margin']">能力分析</view>
<RadarChart :labelColors="labelColors" :heightClass="isBeisen ? '' : 'big-height'" :chartData="chartData" /> <RadarChart :labelColors="labelColors" :heightClass="isBeisen ? '' : 'big-height'" :chartData="chartData" />
...@@ -68,8 +68,10 @@ export default { ...@@ -68,8 +68,10 @@ export default {
firstIndex: 0, firstIndex: 0,
firstLeft: ['first', 'second'], firstLeft: ['first', 'second'],
firstClass: ['short-first-nav', 'short-second-nav'], firstClass: ['short-first-nav', 'short-second-nav'],
isBeisen: true, // 是否是有北森权限,true 有,false无 isBeisen: false, // 是否是有北森权限,true 有,false无
isFlag: true // 当前驻店人员所关联的门店非鸿蒙智行或非延保业务 isFlag: true, // 当前驻店人员所关联的门店非鸿蒙智行或非延保业务
isHmzx: false, // 当前驻店人员所关联的门店是否是鸿蒙智行
isYb: false, // 当前驻店人员所关联的门店是否是延保业务
} }
}, },
created () { created () {
...@@ -81,7 +83,11 @@ export default { ...@@ -81,7 +83,11 @@ export default {
}, },
mounted() { mounted() {
const beisenToken = uni.$storage.get('beisenToken') const beisenToken = uni.$storage.get('beisenToken')
const studyCenterPermission = uni.$storage.get('studyCenterPermission')
console.log(beisenToken, 'beisenToken') console.log(beisenToken, 'beisenToken')
this.isBeisen = !!beisenToken
this.isHmzx = studyCenterPermission.hmzxAuth
this.isYb = studyCenterPermission.authorizedBusinessList && studyCenterPermission.authorizedBusinessList.includes(1)
// this.getServerData(); // this.getServerData();
this.getStudyBoard(); this.getStudyBoard();
}, },
...@@ -90,35 +96,18 @@ export default { ...@@ -90,35 +96,18 @@ export default {
changeType(index, tagIndex) { changeType(index, tagIndex) {
this.firstIndex = index 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() { async getStudyBoard() {
const res = await uni.$api.commonApi.getStudyBoard({}) const res = await uni.$api.commonApi.getStudyBoard({})
console.log(111111, 'res', res) console.log(111111, 'res', res)
this.dataInfo = res this.dataInfo = res
this.dataInfo.shortCourseProgress = 0 // this.dataInfo.shortCourseProgress = 0
this.dataInfo.shortCourseCompletedLearnRatio = 15 // this.dataInfo.shortCourseCompletedLearnRatio = 15
const _chartData = { const _chartData = {
categories: res.abilityAnalysisTag, categories: res.abilityAnalysisTag,
series: [ series: [
{ {
// data: res.abilityAnalysisScore data: res.abilityAnalysisScore
data: [1, 2, 3, 1, 2, 2, 3, 3, 3] // data: [1, 2, 3, 1, 2, 2, 3, 3, 3]
} }
] ]
} }
......
...@@ -155,11 +155,11 @@ ...@@ -155,11 +155,11 @@
ref="webview" ref="webview"
src="/hybrid/html/index.html" src="/hybrid/html/index.html"
></web-view> ></web-view>
<web-view <!-- <web-view
ref="studyWebview" ref="studyWebview"
:src="jumpUrl" :src="jumpUrl"
v-if="showBeisen" v-if="showBeisen"
></web-view> ></web-view> -->
</view> </view>
</template> </template>
<script> <script>
...@@ -243,24 +243,24 @@ export default { ...@@ -243,24 +243,24 @@ export default {
} }
}, },
methods: { methods: {
async changeTab ({ item, jumpUrl, 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)
this.showBeisen = false // this.showBeisen = false
if (item.isTrack) { // if (item.isTrack) {
this.jumpUrl = jumpUrl // // this.jumpUrl = jumpUrl
if (!this.jumpUrl) { // // if (!this.jumpUrl) {
uni.showToast({ // // uni.showToast({
title: '培训账号未创建', // // title: '培训账号未创建',
icon: 'none' // // icon: 'none'
}) // // })
return // // return
} // // }
} else { // } else {
this.jumpUrl = '' // this.jumpUrl = ''
} // }
}, },
handleFooter (val) { handleFooter (val) {
this.footerBox = val this.footerBox = val
......
...@@ -13,6 +13,11 @@ export default { ...@@ -13,6 +13,11 @@ export default {
merchantId, merchantId,
staffUUID: uuid staffUUID: uuid
}).then(result => { }).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店 // 仅一家4s店
if (result?.length == 1) { if (result?.length == 1) {
let { merchantName, merchantId } = result[0] 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 \ No newline at end of file
...@@ -17,28 +17,29 @@ ...@@ -17,28 +17,29 @@
<image class="item-img" src="../../../assets/images/common/long-course-default.webp" <image class="item-img" src="../../../assets/images/common/long-course-default.webp"
mode="scaleToFill" /> mode="scaleToFill" />
<view class="item-content"> <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">
<view class="item-info-label">当前状态</view> <view class="item-info-label">当前状态</view>
<view :class="['item-info-value', item.status === 1 ? 'orange' : 'green']"> <view :class="['item-info-value', item.status === 5 ? 'green' : 'orange']">
<view v-if="item.status === 1" class="dot-value"></view> <view v-if="item.status !== 5" class="dot-value"></view>
{{ item.status === 1 ? `未完成(${item.progress || 0}%)` : item.status === 2 ? '已完成' : '' }} {{ item.status !== 5 ? `${statusMap[item.status]}(${item.progress || 0}%)` : '已完成' }}
</view> </view>
</view> </view>
<view class="item-info"> <view class="item-info">
<view class="item-info-label">考试成绩</view> <view class="item-info-label">考试成绩</view>
<view class="item-info-value">{{ item.score }}</view> <view class="item-info-value">{{ item.totalScore ? '已完成' : '待考核'}}</view>
</view> </view>
<view class="item-info"> <view class="item-info">
<view class="item-info-label">课程时长</view> <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> </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> </view>
<image class="completed-bg" src="../../../assets/images/common/completed-bg.png" mode="scaleToFill"
v-if="item.status === 2" />
</template> </template>
<template v-if="type === 'recommendation'"> <template v-if="type === 'recommendation'">
<image class="recommendation-img" src="../../../assets/images/common/recommend-course-default2.webp" <image class="recommendation-img" src="../../../assets/images/common/recommend-course-default2.webp"
...@@ -49,7 +50,7 @@ ...@@ -49,7 +50,7 @@
<view class="item-info-label">{{ item.times }}min</view> <view class="item-info-label">{{ item.times }}min</view>
</view> </view>
</view> </view>
<view class="item-btn" @click="startStudy(index)"> <view class="item-btn" @click="openCourse(index, item)">
学习 学习
</view> </view>
</template> </template>
...@@ -68,81 +69,90 @@ ...@@ -68,81 +69,90 @@
</template> </template>
<script> <script>
const statusMap = {
1: '未学习',
2: '未完成',
3: '待考核',
4: '未通过',
5: '已完成'
}
export default { export default {
data() { data() {
return { return {
courseList: [ statusMap,
{ courseList: [],
title: '延保营销延保营销延保营销延保营销延保营销延保营销', // courseList: [
status: 1, // {
progress: 25, // title: '延保营销延保营销延保营销延保营销延保营销延保营销',
score: '未完成(25%)', // status: 1,
duration: '未完成(25%)' // progress: 25,
}, // score: '未完成(25%)',
{ // duration: '未完成(25%)'
title: '延保营销', // },
status: 1, // {
progress: 25, // title: '延保营销',
score: '未完成(25%)', // status: 1,
duration: '未完成(25%)' // progress: 25,
}, // score: '未完成(25%)',
{ // duration: '未完成(25%)'
title: '延保营销', // },
status: 1, // {
progress: 25, // title: '延保营销',
score: '未完成(25%)', // status: 1,
duration: '未完成(25%)' // progress: 25,
}, // score: '未完成(25%)',
{ // duration: '未完成(25%)'
title: '延保营销', // },
status: 1, // {
progress: 25, // title: '延保营销',
score: '未完成(25%)', // status: 1,
duration: '未完成(25%)' // progress: 25,
}, // score: '未完成(25%)',
{ // duration: '未完成(25%)'
title: '延保营销', // },
status: 1, // {
progress: 25, // title: '延保营销',
score: '未完成(25%)', // status: 1,
duration: '未完成(25%)' // progress: 25,
}, // score: '未完成(25%)',
{ // duration: '未完成(25%)'
title: '延保营销', // },
status: 2, // {
progress: 25, // title: '延保营销',
score: '未完成(25%)', // status: 2,
duration: '未完成(25%)' // progress: 25,
}, // score: '未完成(25%)',
{ // duration: '未完成(25%)'
title: '延保营销', // },
status: 2, // {
progress: 25, // title: '延保营销',
score: '未完成(25%)', // status: 2,
duration: '未完成(25%)' // progress: 25,
}, // score: '未完成(25%)',
{ // duration: '未完成(25%)'
title: '延保营销', // },
status: 1, // {
progress: 25, // title: '延保营销',
score: '未完成(25%)', // status: 1,
duration: '未完成(25%)' // progress: 25,
}, // score: '未完成(25%)',
{ // duration: '未完成(25%)'
title: '延保营销', // },
status: 2, // {
progress: 25, // title: '延保营销',
score: '未完成(25%)', // status: 2,
duration: '未完成(25%)' // progress: 25,
}, // score: '未完成(25%)',
{ // duration: '未完成(25%)'
title: '延保营销', // },
status: 1, // {
progress: 25, // title: '延保营销',
score: '未完成(25%)', // status: 1,
duration: '未完成(25%)' // progress: 25,
}, // score: '未完成(25%)',
], // duration: '未完成(25%)'
// },
// ],
recommendCourseList: [ recommendCourseList: [
{ {
title: '问界M8延保+安心包套餐谈客案例-产品力篇', title: '问界M8延保+安心包套餐谈客案例-产品力篇',
...@@ -204,6 +214,7 @@ export default { ...@@ -204,6 +214,7 @@ export default {
onLoad(options) { onLoad(options) {
this.type = options.type; this.type = options.type;
this.selectedIndex = options.index; this.selectedIndex = options.index;
this.courseList = JSON.parse(decodeURIComponent(options.courseList));
this.handleOperation('17983a1a-5bcd-4e7d-a180-061ef3f9a49d'); this.handleOperation('17983a1a-5bcd-4e7d-a180-061ef3f9a49d');
// 只在页面初始化时设置webview的样式 // 只在页面初始化时设置webview的样式
this.setWebviewStyle(); this.setWebviewStyle();
...@@ -226,14 +237,16 @@ export default { ...@@ -226,14 +237,16 @@ export default {
} }
uni.navigateBack() uni.navigateBack()
}, },
openCourse(inde, item) { openCourse(index, item) {
console.log(index, 'index') console.log(index, 'index')
this.selectedIndex = 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 // 只更换url
this.handleOperation(arr[index]); this.handleOperation(item.courseId);
if (this.type === 'recommendation') { if (this.type === 'recommendation') {
uni.$track.add({eventCode: 'app_recommend_course', businessId: item.id, pagePath: '/pages/common/studyDetail/detail'}) 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) { handleOperation(courseId) {
......
...@@ -39,6 +39,7 @@ export default { ...@@ -39,6 +39,7 @@ export default {
// 返回 // 返回
back() { back() {
// this.showPage('MessageList') // this.showPage('MessageList')
uni.$emit('pageBack');
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
animationType: 'pop-out', animationType: 'pop-out',
......
...@@ -42,5 +42,5 @@ export const STORAGE_OBJECTKEY = { ...@@ -42,5 +42,5 @@ export const STORAGE_OBJECTKEY = {
beisenToken: 'beisenToken', beisenToken: 'beisenToken',
messagePopShownDate: 'messagePopShownDate', messagePopShownDate: 'messagePopShownDate',
noticeTopInfo: 'noticeTopInfo', 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!