Commit be52cac2 by cen

Merge branch 'SAAS+V5.5.0' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V5.5.0

2 parents 72e84500 dc719d4d
Showing 43 changed files with 820 additions and 533 deletions
...@@ -461,7 +461,7 @@ module.exports = { ...@@ -461,7 +461,7 @@ module.exports = {
// 新 学习中心 - 开始测评 // 新 学习中心 - 开始测评
startExam(data) { startExam(data) {
return http.post({ return http.post({
method: 'dj.pad.api.staff.study.exam.start', method: 'dj.api.pad.learning.center.level.exam',
projectName: 'pad', projectName: 'pad',
...data ...data
}) })
...@@ -506,4 +506,36 @@ module.exports = { ...@@ -506,4 +506,36 @@ module.exports = {
...data ...data
}) })
}, },
// 新学习中心 - 全部课程
getALlCourse(data) {
return http.post({
method: 'dj.pad.api.recommended.course.page',
projectName: 'pad',
...data
})
},
// 新学习中心 - 课程分类树
getCourseCategoryTree(data = {}) {
return http.post({
method: 'dj.pad.api.course.category.list.tree',
projectName: 'pad',
...data
})
},
// 新学习中心 - 员工学习中心剩余时间
getStudyCenterResidueTime(data={}) {
return http.post({
method: 'dj.api.pad.learning.center.residue.time',
projectName: 'pad',
...data
})
},
// 新学习中心 - 查询我的课程页签数量
getMyCourseTabCount(data={}) {
return http.post({
method: 'dj.api.pad.learning.center.myself.course.count',
projectName: 'pad',
...data
})
}
} }
...@@ -61,6 +61,17 @@ module.exports = { ...@@ -61,6 +61,17 @@ module.exports = {
...data ...data
}) })
}, },
/**
* 查询门店录单设置
},
*/
orderSettingList(data) {
return http.post({
method: 'dj.api.smartcarlife.order.field.setting.list',
projectName: 'boutique',
...data
})
},
/** 报价单分页列表 */ /** 报价单分页列表 */
quotationPage(data) { quotationPage(data) {
...@@ -135,6 +146,15 @@ module.exports = { ...@@ -135,6 +146,15 @@ module.exports = {
...data ...data
}) })
}, },
/**
* /** 修改车损报价单信息 */
updateQuotation(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.update',
projectName: 'boutique',
...data
})
},
getCheckEmployeeList(data) { getCheckEmployeeList(data) {
// 0->2.0 1->1.1 2->1.2 3->1.3 场景对应 // 0->2.0 1->1.1 2->1.2 3->1.3 场景对应
// data.sceneList = [1] // data.sceneList = [1]
......
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'
const HOST = { const HOST = {
scrm: domain, scrm: domain,
dj: djDomain, dj: djDomain,
......
...@@ -249,8 +249,6 @@ ...@@ -249,8 +249,6 @@
background-position: calc(100vmin * (1173 / 768) * -0.4761295822676897) calc(100vmin * (1173 / 768) * -0.19138959931798807);} background-position: calc(100vmin * (1173 / 768) * -0.4761295822676897) calc(100vmin * (1173 / 768) * -0.19138959931798807);}
.icon-pbjd-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-pbjd-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.340153452685422) calc(100vmin * (1173 / 768) * -0.15601023017902813);} background-position: calc(100vmin * (1173 / 768) * -0.340153452685422) calc(100vmin * (1173 / 768) * -0.15601023017902813);}
.icon-pdf-xl { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04774083546462063);
background-position: calc(100vmin * (1173 / 768) * -0.1658141517476556) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
.icon-pdf { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-pdf { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.5336743393009378) calc(100vmin * (1173 / 768) * -0.38064791133844844);} background-position: calc(100vmin * (1173 / 768) * -0.5336743393009378) calc(100vmin * (1173 / 768) * -0.38064791133844844);}
.icon-pen-active { width: calc(100vmin * (1173 / 768) * 0.05115089514066496); height: calc(100vmin * (1173 / 768) * 0.05115089514066496); .icon-pen-active { width: calc(100vmin * (1173 / 768) * 0.05115089514066496); height: calc(100vmin * (1173 / 768) * 0.05115089514066496);
...@@ -262,7 +260,7 @@ ...@@ -262,7 +260,7 @@
.icon-point-active { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04859335038363171); .icon-point-active { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04859335038363171);
background-position: calc(100vmin * (1173 / 768) * -0.05754475703324808) calc(100vmin * (1173 / 768) * -0.4825234441602728);} background-position: calc(100vmin * (1173 / 768) * -0.05754475703324808) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
.icon-point { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04774083546462063); .icon-point { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04774083546462063);
background-position: calc(100vmin * (1173 / 768) * -0.21994884910485935) calc(100vmin * (1173 / 768) * -0.4825234441602728);} background-position: calc(100vmin * (1173 / 768) * -0.1658141517476556) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
.icon-points { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646); .icon-points { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646);
background-position: calc(100vmin * (1173 / 768) * -0.4514066496163683) calc(100vmin * (1173 / 768) * -0.6381074168797954);} background-position: calc(100vmin * (1173 / 768) * -0.4514066496163683) calc(100vmin * (1173 / 768) * -0.6381074168797954);}
.icon-promotion { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986); .icon-promotion { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
...@@ -302,7 +300,7 @@ ...@@ -302,7 +300,7 @@
.icon-reception-share { width: calc(100vmin * (1173 / 768) * 0.02216538789428815); height: calc(100vmin * (1173 / 768) * 0.02216538789428815); .icon-reception-share { width: calc(100vmin * (1173 / 768) * 0.02216538789428815); height: calc(100vmin * (1173 / 768) * 0.02216538789428815);
background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.05711849957374254);} background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.05711849957374254);}
.icon-record-active { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04774083546462063); .icon-record-active { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04774083546462063);
background-position: calc(100vmin * (1173 / 768) * -0.27408354646206307) calc(100vmin * (1173 / 768) * -0.4825234441602728);} background-position: calc(100vmin * (1173 / 768) * -0.21994884910485935) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
.icon-record { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763); .icon-record { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.050724637681159424) calc(100vmin * (1173 / 768) * -0.5400682011935208);} background-position: calc(100vmin * (1173 / 768) * -0.050724637681159424) calc(100vmin * (1173 / 768) * -0.5400682011935208);}
.icon-revoke { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197); .icon-revoke { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
...@@ -407,8 +405,16 @@ ...@@ -407,8 +405,16 @@
background-position: calc(100vmin * (1173 / 768) * -0.08013640238704177) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.08013640238704177) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-two-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.010230179028132993); .icon-two-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.010230179028132993);
background-position: calc(100vmin * (1173 / 768) * -0.2885763000852515) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.2885763000852515) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
<<<<<<< HEAD
.icon-up-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.27024722932651324) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
=======
<<<<<<< HEAD
=======
.icon-up-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157); .icon-up-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.27024722932651324) calc(100vmin * (1173 / 768) * -0.6986359761295823);} background-position: calc(100vmin * (1173 / 768) * -0.27024722932651324) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
>>>>>>> 34c2de92db21e1379e36b7dc81196e3b65332eee
>>>>>>> dc719d4d38cfc7fdddfd4c42985841782b9c27f4
.icon-upload-play { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655); .icon-upload-play { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.07033248081841433) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.07033248081841433) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-uploadAdd { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986); .icon-uploadAdd { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
...@@ -424,4 +430,21 @@ ...@@ -424,4 +430,21 @@
.icon-yw-icon { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489); .icon-yw-icon { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489);
background-position: calc(100vmin * (1173 / 768) * -0.18414322250639387) calc(100vmin * (1173 / 768) * -0.6751918158567775);} background-position: calc(100vmin * (1173 / 768) * -0.18414322250639387) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-zj-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-zj-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.1402387041773231) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
\ No newline at end of file \ No newline at end of file
<<<<<<< HEAD
background-position: calc(100vmin * (1173 / 768) * -0.1402387041773231) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
=======
background-position: calc(100vmin * (1173 / 768) * -0.1402387041773231) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
<<<<<<< HEAD
.icon-green-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.23358908780903667) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-normal { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.25191815856777494) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-pdf-xl { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04774083546462063);
background-position: calc(100vmin * (1173 / 768) * -0.27408354646206307) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
.icon-up-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.27024722932651324) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
=======
.icon-pdf-xl { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04774083546462063);
background-position: calc(100vmin * (1173 / 768) * -0.27408354646206307) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
>>>>>>> 34c2de92db21e1379e36b7dc81196e3b65332eee
>>>>>>> dc719d4d38cfc7fdddfd4c42985841782b9c27f4

3.46 KB | W: | H:

3.11 KB | W: | H:

assets/images/studyCenter/Elective.png
assets/images/studyCenter/Elective.png
assets/images/studyCenter/Elective.png
assets/images/studyCenter/Elective.png
  • 2-up
  • Swipe
  • Onion skin

3.66 KB | W: | H:

3.63 KB | W: | H:

assets/images/studyCenter/Required.png
assets/images/studyCenter/Required.png
assets/images/studyCenter/Required.png
assets/images/studyCenter/Required.png
  • 2-up
  • Swipe
  • Onion skin
<!-- 学习中心首页 - 全部课程 -->
<template> <template>
<view class="recommend-course"> <view class="recommend-course">
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom" <scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
...@@ -93,7 +94,7 @@ export default { ...@@ -93,7 +94,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.getCourseTaskPage() this.getALlCourse()
this.asyncfindBeiSenSSOToken() this.asyncfindBeiSenSSOToken()
}, },
methods: { methods: {
...@@ -114,19 +115,19 @@ export default { ...@@ -114,19 +115,19 @@ export default {
} }
}, },
// 获取我的任务接口, completeStatus: 完成状态 0=待完成 1=已完成, courseType: 课程类型 1=短课程 2=长课程 // 获取我的任务接口, completeStatus: 完成状态 0=待完成 1=已完成, courseType: 课程类型 1=短课程 2=长课程
async getCourseTaskPage() { async getALlCourse() {
try { try {
uni.showLoading({ uni.showLoading({
mask: true mask: true
}) })
const { pageNum, pageSize } = this const { pageNum, pageSize } = this
const params = { const params = {
recommendStatus: 1, // 推荐状态 0=无推荐 1=推荐课程 staffPhone: uni.$storage.get('userInfo').phone, // 推荐状态 0=无推荐 1=推荐课程
pageNum, pageNum,
pageSize pageSize
} }
const res = await uni.$api.commonApi.getCourseTaskPage(params) const res = await uni.$api.commonApi.getALlCourse(params)
console.log(res, '全部课程')
// 临时添加测试数据字段 // 临时添加测试数据字段
const listWithTestData = res.list.map((item, index) => ({ const listWithTestData = res.list.map((item, index) => ({
...item, ...item,
...@@ -157,7 +158,7 @@ export default { ...@@ -157,7 +158,7 @@ export default {
let { pageNum, total, nothing = 'nothing', pageSize } = this; let { pageNum, total, nothing = 'nothing', pageSize } = this;
if (Math.ceil(total / pageSize) > pageNum) { if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1; this.pageNum += 1;
this.getCourseTaskPage() this.getALlCourse()
} else { } else {
this.nothing = true; this.nothing = true;
} }
...@@ -178,8 +179,9 @@ export default { ...@@ -178,8 +179,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.recommend-course { .recommend-course {
height: calc(100% - #{toRpx(100)}); height: calc(100% - #{toRpx(300)});
padding-bottom: toRpx(100); // padding-bottom: toRpx(100);
.scroll-view { .scroll-view {
margin-top: toRpx(40); margin-top: toRpx(40);
height: calc(100% - #{toRpx(70)}); height: calc(100% - #{toRpx(70)});
...@@ -193,7 +195,7 @@ export default { ...@@ -193,7 +195,7 @@ export default {
&.fixed-width { &.fixed-width {
grid-template-columns: repeat(4, toRpx(530)); grid-template-columns: repeat(4, toRpx(530));
justify-content: center; justify-content: center;
.recommend-course-item { .recommend-course-item {
width: toRpx(530) !important; width: toRpx(530) !important;
max-width: toRpx(530); max-width: toRpx(530);
...@@ -274,6 +276,7 @@ export default { ...@@ -274,6 +276,7 @@ export default {
align-items: center; align-items: center;
font-size: toRpx(24); font-size: toRpx(24);
color: #666666; color: #666666;
.duration-value { .duration-value {
color: #999ea8; color: #999ea8;
font-size: toRpx(24); font-size: toRpx(24);
...@@ -348,7 +351,7 @@ export default { ...@@ -348,7 +351,7 @@ export default {
.nothing { .nothing {
width: 100%; width: 100%;
flex-direction: column; flex-direction: column;
margin-top: toRpx(380); margin-top: toRpx(280);
font-size: toRpx(28); font-size: toRpx(28);
color: #999999; color: #999999;
...@@ -362,7 +365,7 @@ export default { ...@@ -362,7 +365,7 @@ export default {
.end-text { .end-text {
color: #999; color: #999;
text-align: center; text-align: center;
padding: toRpx(30) 0; padding: toRpx(30) 0 toRpx(50);
font-size: toRpx(24); font-size: toRpx(24);
} }
......
...@@ -6,42 +6,32 @@ ...@@ -6,42 +6,32 @@
<view class="exam-list" :class="{ 'fixed-width': cardWidth > 0 }"> <view class="exam-list" :class="{ 'fixed-width': cardWidth > 0 }">
<view class="exam-item" v-for="(item, index) in examList" :key="index" <view class="exam-item" v-for="(item, index) in examList" :key="index"
@click="viewExam(item, index)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''"> @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" <image class="exam-item-img"
src="../../../../assets/images/common/recommend-course-default.webp" mode="scaleToFill" /> src="../../../../assets/images/common/course-default-bg.webp" mode="scaleToFill" />
<view class="exam-content"> <view class="exam-content">
<view class="exam-item-title"> <view class="exam-item-title">
{{ item.courseName || item.examName }} {{ item.title }}
</view> </view>
<view class="exam-item-text"> <view class="exam-item-text">
<text class="duration-value">考试时间</text> <text class="duration-value">考试时间</text>
<text>{{ (item.totalDuration || item.totalDuration === 0) ? <text>{{ filterValue(item.duration, 'min') }} | {{ filterValue(item.questionCount, '题') }}</text>
`${item.totalDuration}min` : '-' }} | 20题</text>
</view> </view>
<!-- 考试次数 --> <!-- 考试次数 -->
<view class="exam-times"> <view class="exam-times">
<text class="times-value">剩余考试次数</text> <text class="times-value">剩余考试次数</text>
<text>{{ item.examCount || 0 }}次</text> <text>{{ filterValue(item.remainingTimes) }}/{{ filterValue(item.examTimes) }}次</text>
</view> </view>
<!-- 最高得分 --> <!-- 最高得分 -->
<view class="exam-score"> <view class="exam-score">
<text class="score-label">最高得分</text> <text class="score-label">最高得分</text>
<text class="score-value failed">{{ item.highestScore || 0 }}分|未通过</text> <text class="score-value failed">{{ filterValue(item.highestScore, '分') }}|未通过</text>
</view> </view>
<!-- 重新考试按钮 --> <!-- 重新考试按钮 -->
<view class="retake-btn" @click.stop="retakeExam(item)"> <view v-if="item.remainingTimes > 0" class="retake-btn" @click.stop="retakeExam(item)">
<text class="retake-text">重新考试</text> <text class="retake-text">重新考试</text>
</view> </view>
</view> </view>
...@@ -50,7 +40,7 @@ ...@@ -50,7 +40,7 @@
</template> </template>
<template v-else> <template v-else>
<view class="nothing flex"> <view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" /> <image class="icon" src="../../../../assets/images/common/noData.png" />
暂无数据 暂无数据
</view> </view>
</template> </template>
...@@ -62,6 +52,7 @@ ...@@ -62,6 +52,7 @@
</template> </template>
<script> <script>
import utils from '@/utils/utils'
export default { export default {
name: 'FailedExam', name: 'FailedExam',
props: { props: {
...@@ -93,47 +84,33 @@ export default { ...@@ -93,47 +84,33 @@ export default {
this.getExamList() this.getExamList()
}, },
methods: { methods: {
// val:判断的值,unit单位
filterValue(val, unit) {
return utils.filterValue(val, unit)
},
async getExamList() { async getExamList() {
console.log(22)
try { try {
uni.showLoading({ uni.showLoading({
mask: true mask: true
}) })
const { pageNum, pageSize } = this const { pageNum, pageSize } = this
const params = { const params = {
examStatus: 'failed', // 未通过 examResult: 2, // 不通过
pageNum, pageNum,
pageSize pageSize,
staffPhone: uni.$storage.get('userInfo').phone
} }
// TODO: 替换为实际的考试列表接口 // TODO: 替换为实际的考试列表接口
// const res = await this.$http.post({ method: 'exam.list', ...params }) const res = await uni.$api.commonApi.getExamPage(params)
console.log(res)
// 临时测试数据 if (pageNum == 1) {
const mockData = [ this.examList = res.list.concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list)
{ } else {
id: 3, this.examList = this.examList.concat(res.list)
examName: '产品知识考试', }
courseName: '产品知识考试', this.total = res.total
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 this.nothing = this.examList.length >= this.total && this.pageNum > 1
uni.hideLoading() uni.hideLoading()
} catch (err) { } catch (err) {
console.log(err) console.log(err)
...@@ -164,17 +141,16 @@ export default { ...@@ -164,17 +141,16 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.failed-exam { .failed-exam {
width: 100%; width: 100%;
height: 100%;
.scroll-view { .scroll-view {
height: 100%; max-height: toRpx(1225);
} }
.exam-list { .exam-list {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
gap: toRpx(32); gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32); font-size: 0;
&.fixed-width { &.fixed-width {
grid-template-columns: repeat(4, toRpx(530)); grid-template-columns: repeat(4, toRpx(530));
...@@ -197,51 +173,13 @@ export default { ...@@ -197,51 +173,13 @@ export default {
background: #ffffff; background: #ffffff;
position: relative; 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 { .exam-item-img {
width: 100%; width: 100%;
height: toRpx(240); height: toRpx(180);
} }
.exam-content { .exam-content {
padding: toRpx(24) toRpx(24) toRpx(32); padding: toRpx(32);
.exam-item-title { .exam-item-title {
width: 100%; width: 100%;
...@@ -249,7 +187,6 @@ export default { ...@@ -249,7 +187,6 @@ export default {
color: #292d33; color: #292d33;
font-size: toRpx(30); font-size: toRpx(30);
font-weight: 500; font-weight: 500;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36); line-height: toRpx(36);
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
...@@ -265,14 +202,14 @@ export default { ...@@ -265,14 +202,14 @@ export default {
align-items: center; align-items: center;
margin-bottom: toRpx(12); margin-bottom: toRpx(12);
height: toRpx(36); height: toRpx(36);
color: #999ea8; color: #666;
font-size: toRpx(24); font-size: toRpx(24);
font-weight: 400; font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36); line-height: toRpx(36);
.duration-value { .duration-value {
margin-right: toRpx(8); margin-right: toRpx(24);
color: #999ea8;
} }
} }
...@@ -282,14 +219,14 @@ export default { ...@@ -282,14 +219,14 @@ export default {
align-items: center; align-items: center;
margin-bottom: toRpx(12); margin-bottom: toRpx(12);
height: toRpx(36); height: toRpx(36);
color: #999ea8; color: #666;
font-size: toRpx(24); font-size: toRpx(24);
font-weight: 400; font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36); line-height: toRpx(36);
.times-value { .times-value {
margin-right: toRpx(8); margin-right: toRpx(24);
color: #999ea8;
} }
} }
...@@ -297,28 +234,20 @@ export default { ...@@ -297,28 +234,20 @@ export default {
.exam-score { .exam-score {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: toRpx(12); margin-bottom: toRpx(20);
font-size: toRpx(24);
font-weight: 400;
.score-label { .score-label {
width: toRpx(96);
height: toRpx(36); height: toRpx(36);
opacity: 1;
color: #999ea8; color: #999ea8;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left; text-align: left;
line-height: toRpx(36); line-height: toRpx(36);
margin-right: toRpx(24); margin-right: toRpx(24);
} }
.score-value { .score-value {
width: toRpx(346.5);
height: toRpx(36); height: toRpx(36);
opacity: 1;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left; text-align: left;
line-height: toRpx(36); line-height: toRpx(36);
...@@ -341,13 +270,12 @@ export default { ...@@ -341,13 +270,12 @@ export default {
cursor: pointer; cursor: pointer;
.retake-text { .retake-text {
width: toRpx(104); // width: toRpx(104);
height: toRpx(32); height: toRpx(32);
opacity: 1; opacity: 1;
color: #3b73ff; color: #3b73ff;
font-size: toRpx(26); font-size: toRpx(26);
font-weight: 400; font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center; text-align: center;
line-height: toRpx(32); line-height: toRpx(32);
} }
...@@ -361,14 +289,13 @@ export default { ...@@ -361,14 +289,13 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
height: toRpx(600); height: toRpx(1000);
color: #999999; color: #999999;
font-size: toRpx(28); font-size: toRpx(24);
.icon { .icon {
width: toRpx(400); width: toRpx(344);
height: toRpx(400); height: toRpx(208);
margin-bottom: toRpx(40);
} }
} }
......
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,7 @@ export default {
padding: toRpx(24); padding: toRpx(24);
margin: 0 toRpx(32) toRpx(16); margin: 0 toRpx(32) toRpx(16);
&.big-height { &.big-height {
height: toRpx(764); height: toRpx(704);
} }
&.all-height { &.all-height {
height: calc(100% - #{toRpx(32)}); height: calc(100% - #{toRpx(32)});
......
...@@ -73,9 +73,9 @@ ...@@ -73,9 +73,9 @@
<template v-if="firstIndex == 0"> <template v-if="firstIndex == 0">
<view class="tips"> <view class="tips">
<view class="sprite-icon icon-study-tips"></view> <view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">本周学习时长X小时,超过X%的人</view> <view class="tips-text">本周学习时长{{dataInfo.weekHour == null ? '-' : dataInfo.weekHour}}小时</view>
</view> </view>
<MyTask ref="myTask" /> <Studying ref="myTask" />
</template> </template>
<template v-if="firstIndex == 1"> <template v-if="firstIndex == 1">
<!-- 搜索框 --> <!-- 搜索框 -->
...@@ -96,13 +96,18 @@ ...@@ -96,13 +96,18 @@
<view class="filter-container"> <view class="filter-container">
<view class="filter-left"> <view class="filter-left">
<!-- 综合排序 --> <!-- 综合排序 -->
<view class="filter-item"> <view class="filter-item">
<SelectComponent ref="sortSelect" :selectList="sortOptions" @chooseType="handleSortChange" /> <select-component
ref="sortSelect"
:selectList="sortOptions"
:defaultValue="currentSortValue"
@chooseType="handleSortChange"
/>
</view> </view>
<!-- 全部课程(两级) --> <!-- 全部课程(两级) -->
<view class="filter-item"> <view class="filter-item">
<TwoLevelSelectComponent ref="categorySelect" :selectList="categoryOptions" <TwoLevelSelectComponent ref="categorySelect" labelKey="categoryName" :selectList="categoryOptions"
@chooseType="handleCategoryChange" /> @chooseType="handleCategoryChange" />
</view> </view>
...@@ -119,7 +124,7 @@ ...@@ -119,7 +124,7 @@
<view class="sprite-icon icon-study-tips"></view> <view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">本周学习时长X小时,超过X%的人</view> <view class="tips-text">本周学习时长X小时,超过X%的人</view>
</view> --> </view> -->
<RecommendCourse ref="recommendCourse" /> <Course ref="recommendCourse" />
</template> </template>
</view> </view>
</view> </view>
...@@ -133,8 +138,8 @@ ...@@ -133,8 +138,8 @@
<script> <script>
import LearnStatistics from './Study/LearnStatistics.vue' import LearnStatistics from './Study/LearnStatistics.vue'
import WeeklyConversionRate from './Study/WeeklyConversionRate.vue' import WeeklyConversionRate from './Study/WeeklyConversionRate.vue'
import MyTask from './Study/MyTask.vue' import Studying from './Study/Studying.vue'
import RecommendCourse from './Study/RecommendCourse.vue' import Course from './Study/Course.vue'
import RadarChart from 'pages/common/studyDetail/components/RadarChart.vue' import RadarChart from 'pages/common/studyDetail/components/RadarChart.vue'
import SelectComponent from '@/components/SelectComponent.vue' import SelectComponent from '@/components/SelectComponent.vue'
import TwoLevelSelectComponent from '@/components/TwoLevelSelectComponent.vue' import TwoLevelSelectComponent from '@/components/TwoLevelSelectComponent.vue'
...@@ -146,8 +151,8 @@ export default { ...@@ -146,8 +151,8 @@ export default {
components: { components: {
LearnStatistics, LearnStatistics,
WeeklyConversionRate, WeeklyConversionRate,
MyTask, Studying,
RecommendCourse, Course,
RadarChart, RadarChart,
SelectComponent, SelectComponent,
TwoLevelSelectComponent, TwoLevelSelectComponent,
...@@ -157,8 +162,9 @@ export default { ...@@ -157,8 +162,9 @@ export default {
return { return {
chartData: {}, chartData: {},
dataInfo: { dataInfo: {
totalHour: 999.99, totalHour: 0,
monHour: 12, monHour: 0,
weekHour: 0,
monHourRatio: null, monHourRatio: null,
unReadCount: 0 unReadCount: 0
}, },
...@@ -217,6 +223,7 @@ export default { ...@@ -217,6 +223,7 @@ export default {
] ]
} }
], ],
currentSortValue: 'default',
} }
}, },
created() { created() {
...@@ -229,7 +236,6 @@ export default { ...@@ -229,7 +236,6 @@ export default {
} else { } else {
this.$refs.myTask.getCourseTaskPage(tabIndex, finishIndex) this.$refs.myTask.getCourseTaskPage(tabIndex, finishIndex)
} }
this.getStudyBoard()
}) })
}, },
async mounted() { async mounted() {
...@@ -250,6 +256,7 @@ export default { ...@@ -250,6 +256,7 @@ export default {
this.showMyTask = await this.checkStudyCenterPermission() this.showMyTask = await this.checkStudyCenterPermission()
this.getMyStudyTime(); this.getMyStudyTime();
this.getCourseCategoryTree()
}, },
methods: { methods: {
// 我的学习时长 // 我的学习时长
...@@ -258,9 +265,27 @@ export default { ...@@ -258,9 +265,27 @@ export default {
staffPhone: uni.$storage.get('userInfo').phone staffPhone: uni.$storage.get('userInfo').phone
}) })
console.log(res, 'res') console.log(res, 'res')
// if (res) { if (res) {
// this.dataInfo = res || {} this.dataInfo = res || {}
// } }
},
// 新学习中心 - 课程分类树
async getCourseCategoryTree() {
const res = await uni.$api.commonApi.getCourseCategoryTree()
console.log(res, 'res')
if (res) {
const list = Array.isArray(res) ? res : []
const filtered = list
.filter(item => item && item.categoryName !== '未分组')
.map(item => ({
...item,
children: [
{ categoryName: '全部' },
...((item.children && Array.isArray(item.children)) ? item.children : [])
]
}))
this.categoryOptions = filtered
}
}, },
// 聚焦搜索框 // 聚焦搜索框
focusSearch() { focusSearch() {
...@@ -283,6 +308,7 @@ export default { ...@@ -283,6 +308,7 @@ export default {
// 处理排序变化 // 处理排序变化
handleSortChange({ item, index }) { handleSortChange({ item, index }) {
console.log('排序变化:', item, index) console.log('排序变化:', item, index)
this.currentSortValue = item.value
// TODO: 调用课程列表接口,传入排序参数 // TODO: 调用课程列表接口,传入排序参数
}, },
// 处理分类变化 // 处理分类变化
...@@ -363,52 +389,6 @@ export default { ...@@ -363,52 +389,6 @@ export default {
// tab切换 // tab切换
changeType(index, tagIndex) { changeType(index, tagIndex) {
this.firstIndex = index this.firstIndex = index
},
async getStudyBoard() {
const res = await uni.$api.commonApi.getStudyBoard({})
console.log(111111, 'res', res)
this.dataInfo = res
// 虚增已完成学习学员比例
const boostRatio = (val) => {
const numVal = Number(val)
if (isNaN(numVal)) return val
if (numVal < 60) {
return String(numVal + 30)
} else if (numVal >= 60 && numVal < 90) {
return '90'
} else {
return String(numVal)
}
}
if (this.dataInfo) {
if (this.dataInfo.shortCourseCompletedLearnRatio !== undefined && this.dataInfo.shortCourseCompletedLearnRatio !== null) {
this.dataInfo.shortCourseCompletedLearnRatio = boostRatio(this.dataInfo.shortCourseCompletedLearnRatio)
}
if (this.dataInfo.longCourseCompletedLearnRatio !== undefined && this.dataInfo.longCourseCompletedLearnRatio !== null) {
this.dataInfo.longCourseCompletedLearnRatio = boostRatio(this.dataInfo.longCourseCompletedLearnRatio)
}
}
const _chartData = {
categories: res.abilityAnalysisTag,
series: [
{
data: res.abilityAnalysisScore
// data: [1, 2, 3, 1, 2, 2, 3, 3, 3]
}
]
}
this.chartData = _chartData
// 设置雷达图标签颜色,1为红色,否则为灰色
if (_chartData.series && _chartData.series[0] && Array.isArray(_chartData.series[0].data)) {
const dataArr = _chartData.series[0].data;
let _labelColors = [];
if (dataArr.every(val => val === 0)) {
_labelColors = [];
} else {
_labelColors = dataArr.map(val => val === 1 ? '#EB4E4E' : '#666666');
}
this.labelColors = _labelColors;
}
} }
} }
} }
...@@ -723,7 +703,8 @@ export default { ...@@ -723,7 +703,8 @@ export default {
.data-container { .data-container {
background: #ffffff; background: #ffffff;
border-radius: toRpx(48); border-radius: toRpx(48);
height: calc(100vh - #{toRpx(136)}); // height: calc(100vh - #{toRpx(136)});
height: toRpx(1392);
box-shadow: inset 0 0 toRpx(16) 0 #ffffff; box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border: toRpx(2) solid #fff; border: toRpx(2) solid #fff;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -38,8 +38,13 @@ export default { ...@@ -38,8 +38,13 @@ export default {
] ]
this.updateParams(params, data) this.updateParams(params, data)
}, },
initData (data) { initData (list) {
this.list = data const { params:{idKey}, data } = this
if(data[idKey]) {
this.currentId = data[idKey]
this.$emit('choose', data[idKey])
}
this.list = list
this.$emit('onComplete') this.$emit('onComplete')
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
......
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (carData) { initData (carData) {
let { params: { idKey }, data: { customer } } = this, let { params: { idKey }, data: { customer, carInfo }, sceneType } = this,
letterList = Array.from(new Set([...carData.map((e) => e.letter)])), letterList = Array.from(new Set([...carData.map((e) => e.letter)])),
carModelList = letterList.map(e => { carModelList = letterList.map(e => {
let list = [] let list = []
...@@ -100,10 +100,21 @@ export default { ...@@ -100,10 +100,21 @@ export default {
c.childs.map((s) => { c.childs.map((s) => {
s.carChildsBrandId = c.id; s.carChildsBrandId = c.id;
s.carChildsBrandName = c.name; s.carChildsBrandName = c.name;
if (customer && customer[idKey]) { if (sceneType == 1) {
if (s.id == customer[idKey]) { if (customer && customer[idKey]) {
s.active = true; if (s.id == customer[idKey]) {
this.letter = i.letter; s.active = true;
this.letter = i.letter;
this.choose(s, c)
}
}
} else {
if (carInfo && carInfo[idKey]) {
if (s.id == carInfo[idKey]) {
s.active = true;
this.letter = i.letter;
this.choose(s, c)
}
} }
} }
}); });
......
...@@ -153,11 +153,15 @@ export default { ...@@ -153,11 +153,15 @@ export default {
this.updateParams(params, province) this.updateParams(params, province)
}, },
initData (listData) { initData (listData) {
let {data, params:{idKeys}} = this, let { data, params: { idKeys } } = this,
[provinceKey, cityKey] = idKeys [provinceKey, cityKey] = idKeys
if(data[cityKey]){ if (data[cityKey]) {
this.currentIds = [data[provinceKey], data[cityKey]] this.currentIds = [data[provinceKey], data[cityKey]]
this.currentStep = 2 this.currentStep = 2
this.$emit('choose', {
province: data[provinceKey],
city: data[cityKey]
})
} }
this.list = listData this.list = listData
this.$emit('onComplete') this.$emit('onComplete')
......
...@@ -90,12 +90,12 @@ export default { ...@@ -90,12 +90,12 @@ export default {
}) })
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (data) { initData (dataList) {
let couponTypeList = Array.from(new Set([...data.map((e) => e.couponInfo.couponType)])), let couponTypeList = Array.from(new Set([...dataList.map((e) => e.couponInfo.couponType)])),
couponList = couponTypeList.map((e, index) => { couponList = couponTypeList.map((e, index) => {
let list = []; let list = [];
let title = ""; let title = "";
data.map((i) => { dataList.map((i) => {
i.merchantCouponCode = i.merchantCouponCode.split("-")[0]; i.merchantCouponCode = i.merchantCouponCode.split("-")[0];
if (i.couponInfo.couponType == e) { if (i.couponInfo.couponType == e) {
list.push(i); list.push(i);
...@@ -107,12 +107,30 @@ export default { ...@@ -107,12 +107,30 @@ export default {
list, list,
}; };
}) })
const { params: { idKey }, data, customerCouponList } = this
this.$emit('onComplete') this.$emit('onComplete')
this.list = couponList this.list = couponList
if (data[idKey]) {
this.currentId = data[idKey]
let item = null,
isCustomer = false
couponList.map(e => {
e.list.map(i => {
if (i.merchantCouponCode == data[idKey]) item = i
})
})
customerCouponList.map(i => {
if (i.customerCouponCode == data[idKey]) {
item = i
isCustomer = true
}
})
if (item) this.choose(item, isCustomer)
}
}, },
async getCustomerCouponList (customerPhone) { async getCustomerCouponList (customerPhone) {
const phoneRex = /^[1]([3-9])[0-9]{9}$/, const phoneRex = /^[1]([3-9])[0-9]{9}$/,
{ data: orderObj } = this, { data: orderObj, params: { idKey } } = this,
params = { params = {
customerPhone, customerPhone,
statusList: [0, 1], statusList: [0, 1],
...@@ -126,7 +144,7 @@ export default { ...@@ -126,7 +144,7 @@ export default {
(item.status == 1 && item.id == orderObj.customerCouponId) (item.status == 1 && item.id == orderObj.customerCouponId)
); );
}) })
if(this.customerCouponList.length) this.choose(this.customerCouponList[0],true) if (this.customerCouponList.length && !orderObj[idKey]) this.choose(this.customerCouponList[0], true, true)
} }
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
...@@ -155,7 +173,7 @@ export default { ...@@ -155,7 +173,7 @@ export default {
this.searchStatus = true this.searchStatus = true
} }
}, },
choose (item, isCustomer = false) { choose (item, isCustomer = false, autoSelect = false) {
if (item.disabled) return if (item.disabled) return
let customerCouponCode = isCustomer ? item.customerCouponCode : item.merchantCouponCode, let customerCouponCode = isCustomer ? item.customerCouponCode : item.merchantCouponCode,
key = isCustomer ? 'customerCouponId' : 'merchantCouponId', key = isCustomer ? 'customerCouponId' : 'merchantCouponId',
...@@ -167,6 +185,7 @@ export default { ...@@ -167,6 +185,7 @@ export default {
} }
this.currentId = customerCouponCode this.currentId = customerCouponCode
this.$emit('choose', chooseItem) this.$emit('choose', chooseItem)
if (autoSelect) this.$emit('confirm', true)
}, },
checkDisabled (item) { checkDisabled (item) {
let disabled = false, let disabled = false,
......
...@@ -53,8 +53,14 @@ export default { ...@@ -53,8 +53,14 @@ export default {
const { list } = await uni.$api.popupApi.getQuotationCustomerList(apiParams) const { list } = await uni.$api.popupApi.getQuotationCustomerList(apiParams)
this.updateParams(params, list || []) this.updateParams(params, list || [])
}, },
initData (data) { initData (list) {
this.list = data const { params: { idKey }, data } = this
if (data[idKey]) {
this.currentId = data[idKey]
let item = list.find(i => i.customerPhone == this.currentId)
this.$emit('choose', item)
}
this.list = list
this.$emit('onComplete') this.$emit('onComplete')
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
......
...@@ -38,8 +38,14 @@ export default { ...@@ -38,8 +38,14 @@ export default {
}) })
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (data) { initData (list) {
this.list = data const { params: { idKey }, data } = this
if (data[idKey]) {
this.currentId = data[idKey]
let item = list.find(i => i.subMerchantId == this.currentId)
this.$emit('choose', item)
}
this.list = list
this.$emit('onComplete') this.$emit('onComplete')
}, },
choose (i) { choose (i) {
......
...@@ -22,14 +22,14 @@ export default { ...@@ -22,14 +22,14 @@ export default {
computed: { computed: {
idKey () { idKey () {
let { params: { idKey }, sceneType } = this let { params: { idKey }, sceneType } = this
return idKey[sceneType] || idKey
return Array.isArray(idKey) ? idKey[sceneType] : idKey
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
async getList (searchValue, search) { async getList (searchValue, search) {
const { userInfo, params } = this, const { userInfo, params } = this,
{ cacheData } = params { cacheData } = params
this.currentId = '' this.currentId = ''
...@@ -48,8 +48,15 @@ export default { ...@@ -48,8 +48,15 @@ export default {
const data = await uni.$api.popupApi[apiTargetName](apiParams) const data = await uni.$api.popupApi[apiTargetName](apiParams)
this.updateParams(params, data || []) this.updateParams(params, data || [])
}, },
initData (data) { initData (list) {
this.list = data const { idKey, data } = this
console.log(idKey)
if (data[idKey]) {
this.currentId = data[idKey]
let item = list.find(i => i.uuid == this.currentId)
this.$emit('choose', item)
}
this.list = list
this.$emit('onComplete') this.$emit('onComplete')
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
......
...@@ -121,8 +121,8 @@ export default { ...@@ -121,8 +121,8 @@ export default {
} }
}, },
initData (goodsData) { initData (goodsData) {
let { data, dataKey, isDefeatOrder, baseConfigData, positionTypeList } = this, let { data, dataKey, isDefeatOrder, baseConfigData, positionTypeList, params } = this,
{ goodsType } = this.params, { goodsType } = params,
arr = [] arr = []
if (isDefeatOrder) { if (isDefeatOrder) {
let arrData = [] let arrData = []
...@@ -168,18 +168,31 @@ export default { ...@@ -168,18 +168,31 @@ export default {
if (goodsType.includes(subVal.merchantGoodsPosition)) arr.push(val) if (goodsType.includes(subVal.merchantGoodsPosition)) arr.push(val)
} }
}) })
let paramsData = dataKey ? data[dataKey] : data }
if (paramsData && paramsData.length) paramsData.map(e => { let paramsData = dataKey ? data[dataKey] : data
this.currentIds.push(e.goods.goodsId) if (paramsData && paramsData.length) {
this.chooseList.push(e) // let idName = isDefeatOrder ? 'id' : 'goodsId'
// paramsData.map(e => {
// this.currentIds.push(e.goods[idName])
// this.chooseList.push(e)
// })
arr.map(i => {
console.log(i)
if (isDefeatOrder) i.upgradeGoodsList.map(e => {
paramsData.map(c => {
if (c.goods.id == e.id) this.choose(e)
})
})
else paramsData.map(c => {
if (i.goods.goodsId == c.goods.goodsId) this.choose(i)
})
}) })
} }
this.$emit('choose', this.chooseList)
this.$emit('onComplete') this.$emit('onComplete')
this.list = arr this.list = arr
}, },
choose (i) { choose (i) {
let { currentIds, isDefeatOrder } = this, let { currentIds, isDefeatOrder } = this,
id = '' id = ''
if (isDefeatOrder) id = i.id if (isDefeatOrder) id = i.id
......
...@@ -108,6 +108,7 @@ export default { ...@@ -108,6 +108,7 @@ export default {
this.currentIds.push(e.packageGoods.packageCode) this.currentIds.push(e.packageGoods.packageCode)
this.chooseList.push(e) this.chooseList.push(e)
}) })
this.$emit('choose', this.chooseList)
this.$emit('onComplete') this.$emit('onComplete')
this.list = arr this.list = arr
}, },
......
...@@ -40,8 +40,13 @@ export default { ...@@ -40,8 +40,13 @@ export default {
] ]
this.updateParams(params, data) this.updateParams(params, data)
}, },
initData (data) { initData (list) {
this.list = data const { params:{idKey}, data } = this
if(data[idKey]) {
this.currentId = data[idKey]
this.$emit('choose', data[idKey])
}
this.list = list
this.$emit('onComplete') this.$emit('onComplete')
}, },
handleSearch (searchValue) { handleSearch (searchValue) {
......
...@@ -313,10 +313,11 @@ export default { ...@@ -313,10 +313,11 @@ export default {
if (e.goodsFlag != 2) { if (e.goodsFlag != 2) {
let id = '' let id = ''
if (e.goodsFlag == 3) id = e.packageGoods.packageCode if (e.goodsFlag == 3) id = e.packageGoods.packageCode
if (e.goodsFlag == 1) id = e.goods.goodsId if (e.goodsFlag == 1) id = String(e.goods.goodsId)
this.currentIds.push(id) this.currentIds.push(id)
this.chooseList.push(e) this.chooseList.push(e)
} }
this.$emit('choose', this.chooseList)
}) })
this.list = arr this.list = arr
this.$emit('onComplete') this.$emit('onComplete')
...@@ -338,7 +339,7 @@ export default { ...@@ -338,7 +339,7 @@ export default {
id = packageCode id = packageCode
} else { } else {
let { goodsId } = i.goods let { goodsId } = i.goods
id = goodsId id = String(goodsId)
} }
let { currentIds } = this, let { currentIds } = this,
index = currentIds.indexOf(id) index = currentIds.indexOf(id)
...@@ -378,7 +379,7 @@ export default { ...@@ -378,7 +379,7 @@ export default {
} }
if (goodsFlag == 3) id = packageGoods.packageCode if (goodsFlag == 3) id = packageGoods.packageCode
else id = goods.goodsId else id = goods.goodsId
if (currentIds.length) active = currentIds.includes(id) if (currentIds.length) active = currentIds.includes(String(id))
return active return active
}, },
handlePickerChange (e, { handlePickerChange (e, {
......
...@@ -184,12 +184,14 @@ const componentConfig = { ...@@ -184,12 +184,14 @@ const componentConfig = {
15: { 15: {
name: 'GoodsCategory', name: 'GoodsCategory',
title: '选择商品类目', title: '选择商品类目',
hideSearch: true, hideSearch: true,
loadComplete: false loadComplete: false
}, },
16: { 16: {
name: 'AgeRange', name: 'AgeRange',
title: '年龄区间', title: '年龄区间',
nullTips: '请选择年龄区间',
idKey: 'ageRange', idKey: 'ageRange',
hideSearch: true, hideSearch: true,
loadComplete: false loadComplete: false
...@@ -207,6 +209,7 @@ const componentConfig = { ...@@ -207,6 +209,7 @@ const componentConfig = {
18: { 18: {
name: 'Seat', name: 'Seat',
title: '座位数', title: '座位数',
nullTips: '请选择座位数',
idKey: 'seat', idKey: 'seat',
hideSearch: true, hideSearch: true,
loadComplete: false loadComplete: false
...@@ -216,6 +219,7 @@ const componentConfig = { ...@@ -216,6 +219,7 @@ const componentConfig = {
title: '客户档案', title: '客户档案',
loadComplete: false, loadComplete: false,
placeholder: '查找', placeholder: '查找',
nullTips: '请选择客户',
idKey: 'phone', idKey: 'phone',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
......
<template> <template>
<view class="order-popup"> <view class="order-popup">
<popup :position="position" :animation="animation" ref="popup" @onConfirm="confirm" @onCancel="cancel" @onReset="reset" :showReset="popupType === 15"> <popup
:position="position"
:animation="animation"
ref="popup"
@onConfirm="confirm"
@onCancel="cancel"
@onReset="reset"
:showReset="popupType === 15"
>
<view class="popup-title flex"> <view class="popup-title flex">
{{ title }} {{ title }}
<view class="popup-close flex" @click="close"> <view
<uni-icons type="closeempty" size="16"></uni-icons> class="popup-close flex"
@click="close"
>
<uni-icons
type="closeempty"
size="16"
></uni-icons>
</view> </view>
</view> </view>
<template v-if="!componentObject[popupType].hideSearch"> <template v-if="!componentObject[popupType].hideSearch">
<view class="popup-search"> <view class="popup-search">
<input class="input" type="text" :placeholder="componentObject[popupType].placeholder || '请输入'" placeholder-class="placeholder" v-model="componentObject[popupType].searchValue" confirm-type="search" @confirm="handleSearch" /> <input
<view class="clear flex" @click="clear"> class="input"
<uni-icons type="closeempty" size="16" v-if="componentObject[popupType].searchValue"></uni-icons> type="text"
:placeholder="componentObject[popupType].placeholder || '请输入'"
placeholder-class="placeholder"
v-model="componentObject[popupType].searchValue"
confirm-type="search"
@confirm="handleSearch"
/>
<view
class="clear flex"
@click="clear"
>
<uni-icons
type="closeempty"
size="16"
v-if="componentObject[popupType].searchValue"
></uni-icons>
</view> </view>
</view> </view>
</template> </template>
<view :class="['popup-body', { 'hide-search': componentObject[popupType].hideSearch }]"> <view :class="['popup-body', { 'hide-search': componentObject[popupType].hideSearch }]">
<scroll-view scroll-y :class="['popup-scroll-view', { show: componentObject[popupType].loadComplete }]"> <scroll-view
<component :is="componentObject[popupType].name" :params.sync="componentObject[popupType]" :data="data" :dataKey="dataKey" :isDefeatOrder="isDefeatOrder" :defaultTime="defaultTime" :positionTypeList="positionTypeList" ref="componentRef" @choose="chooseContent = $event" @openSkuPopup="openSkuPopup" @onComplete="componentObject[popupType].loadComplete = true"></component> scroll-y
:class="['popup-scroll-view', { show: componentObject[popupType].loadComplete }]"
>
<component
:is="componentObject[popupType].name"
:params.sync="componentObject[popupType]"
:data="data"
:dataKey="dataKey"
:isDefeatOrder="isDefeatOrder"
:defaultTime="defaultTime"
:positionTypeList="positionTypeList"
ref="componentRef"
@choose="chooseContent = $event"
@openSkuPopup="openSkuPopup"
@onComplete="componentObject[popupType].loadComplete = true"
@confirm="confirm"
></component>
<template v-if="componentObject[popupType].noData"> <template v-if="componentObject[popupType].noData">
<view class="nothing flex">暂无数据</view> <view class="nothing flex">暂无数据</view>
</template> </template>
</scroll-view> </scroll-view>
<image v-if="!componentObject[popupType].loadComplete" class="loading" src="../../assets/images/common/loadding.gif" /> <image
v-if="!componentObject[popupType].loadComplete"
class="loading"
src="../../assets/images/common/loadding.gif"
/>
</view> </view>
</popup> </popup>
<sku-popup ref="skuPopupRef" @onConfirm="skuConfirm"></sku-popup> <sku-popup
ref="skuPopupRef"
@onConfirm="skuConfirm"
></sku-popup>
</view> </view>
</template> </template>
...@@ -147,7 +199,7 @@ export default { ...@@ -147,7 +199,7 @@ export default {
baseConfigData () { baseConfigData () {
return this.$store.state.boutique.baseConfigData return this.$store.state.boutique.baseConfigData
}, },
sceneType(){ sceneType () {
const { sceneType } = uni.$storage.get('userInfo') const { sceneType } = uni.$storage.get('userInfo')
return sceneType return sceneType
} }
...@@ -171,6 +223,7 @@ export default { ...@@ -171,6 +223,7 @@ export default {
this.$emit('close') this.$emit('close')
}, },
initPopupData () { initPopupData () {
this.chooseContent = null
let componentRef = this.componentRef() let componentRef = this.componentRef()
if (!componentRef) setTimeout(this.initPopupData, .1e3) if (!componentRef) setTimeout(this.initPopupData, .1e3)
else componentRef.getList && componentRef.getList(this.componentObject[this.popupType].searchValue) else componentRef.getList && componentRef.getList(this.componentObject[this.popupType].searchValue)
...@@ -183,18 +236,18 @@ export default { ...@@ -183,18 +236,18 @@ export default {
}) })
else componentRef.handleSearch(this.componentObject[this.popupType].searchValue) else componentRef.handleSearch(this.componentObject[this.popupType].searchValue)
}, },
confirm () { confirm (autoClose) {
try { try {
let { chooseContent, popupType, componentObject } = this let { chooseContent, popupType, componentObject } = this
if (popupType == 13 ) { if (popupType == 13) {
chooseContent = this.componentRef().getResult() chooseContent = this.componentRef().getResult()
} }
if(popupType == 15 ) { if (popupType == 15) {
this.$emit('onConfirm', { this.$emit('onConfirm', {
chooseContent, chooseContent,
popupType popupType
}) })
this.$refs.popup.close() if (!autoClose) this.$refs.popup.close()
return return
} }
if (chooseContent) { if (chooseContent) {
...@@ -203,7 +256,7 @@ export default { ...@@ -203,7 +256,7 @@ export default {
chooseContent, chooseContent,
popupType popupType
}) })
this.$refs.popup.close() if (!autoClose) this.$refs.popup.close()
} else { } else {
if (componentObject[popupType].nullTips) throw componentObject[popupType].nullTips if (componentObject[popupType].nullTips) throw componentObject[popupType].nullTips
} }
...@@ -231,7 +284,7 @@ export default { ...@@ -231,7 +284,7 @@ export default {
}, },
reset () { reset () {
let componentRef = this.componentRef() let componentRef = this.componentRef()
if (!componentRef) uni.showToast({ if (!componentRef) uni.showToast({
title: '请稍后再试', title: '请稍后再试',
icon: 'none' icon: 'none'
}) })
......
...@@ -11,21 +11,19 @@ ...@@ -11,21 +11,19 @@
class="pop-box" class="pop-box"
v-if="isSelect" v-if="isSelect"
> >
<!-- 一级菜单 --> <view class="first-level-box">
<view <view
v-for="(item, index) in selectList" v-for="(item, index) in selectList"
:key="index" :key="index"
class="type-item flex" class="type-item flex"
:class="getItemClass(index, item)" :class="getItemClass(index, item)"
@click="chooseFirstLevel(index, item)" @click="chooseFirstLevel(index, item)"
> >
<view class="item-label">{{ item[labelKey] }}</view> <view class="item-label">{{ item[labelKey] }}</view>
</view>
</view> </view>
<!-- 二级菜单 -->
<view <view
class="second-level-box" class="second-level-box"
v-if="showSecondLevel && currentFirstLevel && currentFirstLevel.children"
> >
<view <view
v-for="(child, childIndex) in currentFirstLevel.children" v-for="(child, childIndex) in currentFirstLevel.children"
...@@ -56,8 +54,11 @@ export default { ...@@ -56,8 +54,11 @@ export default {
selectFirstIndex: 0, selectFirstIndex: 0,
selectSecondIndex: -1, selectSecondIndex: -1,
isSelect: false, isSelect: false,
showSecondLevel: false, currentFirstLevel: [{
currentFirstLevel: null categoryName: '全部分类',
id: 'all',
children: [{ categoryName: '全部', id: 'all_all' }]
}]
} }
}, },
computed: { computed: {
...@@ -87,27 +88,24 @@ export default { ...@@ -87,27 +88,24 @@ export default {
}, },
hideSelect() { hideSelect() {
this.isSelect = false this.isSelect = false
this.showSecondLevel = false
}, },
chooseFirstLevel(index, item) { chooseFirstLevel(index, item) {
// 如果有二级菜单,显示二级菜单 // 如果有二级菜单,显示二级菜单
if (item.children && item.children.length) { if (item.children && item.children.length) {
this.showSecondLevel = true
this.currentFirstLevel = item this.currentFirstLevel = item
this.selectFirstIndex = index this.selectFirstIndex = index
// this.selectSecondIndex = -1
} else { } else {
// 没有二级菜单,直接选中 // 没有二级菜单,直接选中
this.selectFirstIndex = index this.selectFirstIndex = index
this.selectSecondIndex = -1 this.selectSecondIndex = -1
this.isSelect = false this.isSelect = false
this.showSecondLevel = false
this.$emit('chooseType', { item, index, level: 1 }) this.$emit('chooseType', { item, index, level: 1 })
} }
}, },
chooseSecondLevel(childIndex, child) { chooseSecondLevel(childIndex, child) {
this.selectSecondIndex = childIndex this.selectSecondIndex = childIndex
this.isSelect = false this.isSelect = false
this.showSecondLevel = false
this.$emit('chooseType', { this.$emit('chooseType', {
item: child, item: child,
index: childIndex, index: childIndex,
...@@ -140,14 +138,24 @@ export default { ...@@ -140,14 +138,24 @@ export default {
position: absolute; position: absolute;
top: toRpx(100); top: toRpx(100);
left: 0; left: 0;
width: 100%; // width: 100%;
// width: toRpx(592);
background: #ffffff; background: #ffffff;
box-shadow: 0 0 toRpx(16) 0 #99999933; box-shadow: 0 0 toRpx(16) 0 #99999933;
border-radius: toRpx(16); border-radius: toRpx(16);
padding: toRpx(16) 0; padding: toRpx(16) 0;
text-align: center;
animation: show-view-opacity 0.15s forwards; animation: show-view-opacity 0.15s forwards;
display: flex;
.first-level-box {
min-width: toRpx(176);
}
.second-level-box {
width: toRpx(400);
// border-left: 1px solid #f0f0f0;
}
.type-item { .type-item {
padding: 0 toRpx(28); padding: 0 toRpx(28);
margin-bottom: toRpx(8); margin-bottom: toRpx(8);
...@@ -165,20 +173,6 @@ export default { ...@@ -165,20 +173,6 @@ export default {
} }
} }
.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> </style>
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
}, },
styleV2: { styleV2: {
type: Boolean, type: Boolean,
default: true default: false
} }
}, },
name: '', name: '',
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<view class="upload-box flex flex-wrap"> <view class="upload-box flex flex-wrap">
<view class="upload-item" @click.stop="selectImg"></view> <view class="upload-item" @click.stop="selectImg"></view>
<view v-for="(item, index) in payVoucherList" :key="index" class="previewImageList"> <view v-for="(item, index) in payVoucherList" :key="index" class="previewImageList">
<image :src="item"></image> <image :src="item" mode="aspectFill" @click="previewMedia(index)"></image>
<view class="close-box" @click="deleteImg(index)"> <view class="close-box" @click="deleteImg(index)">
<uni-icons class="icon-close" type="closeempty" color="#ffffff"></uni-icons> <uni-icons class="icon-close" type="closeempty" color="#ffffff"></uni-icons>
</view> </view>
...@@ -111,6 +111,13 @@ export default { ...@@ -111,6 +111,13 @@ export default {
uni.showToast({ title: '提交成功', icon: 'success' }) uni.showToast({ title: '提交成功', icon: 'success' })
this.$emit('jump', 'OrderDetail', data) this.$emit('jump', 'OrderDetail', data)
}) })
},
previewMedia(current){
const {payVoucherList} = this
uni.previewImage({
current,
urls: payVoucherList
})
} }
} }
} }
...@@ -119,6 +126,9 @@ export default { ...@@ -119,6 +126,9 @@ export default {
.px-48 { .px-48 {
padding: 0 toRpx(48); padding: 0 toRpx(48);
} }
.back {
height: 40rpx;
}
.upload-proof-of-payment { .upload-proof-of-payment {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -143,6 +153,7 @@ export default { ...@@ -143,6 +153,7 @@ export default {
} }
.uni-input { .uni-input {
text-align: right; text-align: right;
width: 80%;
.uni-input-placeholder { .uni-input-placeholder {
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
...@@ -162,9 +173,11 @@ export default { ...@@ -162,9 +173,11 @@ export default {
} }
} }
.upload-box { .upload-box {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: toRpx(20); gap: toRpx(20);
.upload-item { .upload-item {
width: toRpx(320) !important; width: 100%;
height: toRpx(240) !important; height: toRpx(240) !important;
border-radius: toRpx(12); border-radius: toRpx(12);
background: url('@/assets/images/boutique/uploadImage.png') no-repeat; background: url('@/assets/images/boutique/uploadImage.png') no-repeat;
...@@ -172,9 +185,10 @@ export default { ...@@ -172,9 +185,10 @@ export default {
} }
.previewImageList { .previewImageList {
position: relative; position: relative;
height: toRpx(240) !important;
image { image {
width: toRpx(320) !important; width: 100% !important;
height: toRpx(240) !important; height: 100% !important;
border-radius: toRpx(12); border-radius: toRpx(12);
} }
.close-box { .close-box {
......
...@@ -7,20 +7,22 @@ ...@@ -7,20 +7,22 @@
<view class="completed-course-item" v-for="(item, index) in completedCourseList" :key="index" <view class="completed-course-item" v-for="(item, index) in completedCourseList" :key="index"
@click="startStudy(item, index)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''"> @click="startStudy(item, index)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''">
<!-- 左上角:必修/选修标签 --> <!-- 左上角:必修/选修标签 -->
<image v-if="item.required !== undefined" class="course-tag-left" <template v-if="item.planCourseType">
:src="item.required ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')" <image class="course-tag-left"
:src="item.planCourseType == 1 ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')"
mode="aspectFit" /> mode="aspectFit" />
</template>
<!-- 右上角:文档/视频标签 --> <!-- 右上角:文档/视频标签 -->
<view v-if="item.courseType" class="course-tag-right"> <view class="course-tag-right" v-if="item.courseFileType">
<text class="tag-text">{{ item.courseType === 'video' ? '视频' : '文档' }}</text> <text class="tag-text">{{ COURSE_TYPE[item.courseFileType].name}}</text>
</view> </view>
<image class="completed-course-item-img" <image class="completed-course-item-img"
src="../../../../assets/images/common/recommend-course-default.webp" mode="scaleToFill" /> src="../../../../assets/images/common/course-default-bg.webp" mode="scaleToFill" />
<view class="completed-course-content"> <view class="completed-course-content">
<view class="completed-course-item-title"> <view class="completed-course-item-title">
{{ item.taskTitle || item.courseName }} {{ item.title }}
</view> </view>
<!-- 成功图片 --> <!-- 成功图片 -->
...@@ -42,6 +44,7 @@ ...@@ -42,6 +44,7 @@
</view> </view>
</template> </template>
<script> <script>
import { COURSE_TYPE } from '../contant.js'
export default { export default {
name: 'CompletedCourse', name: 'CompletedCourse',
props: { props: {
...@@ -59,6 +62,7 @@ export default { ...@@ -59,6 +62,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 12, pageSize: 12,
scrollTop: 0, scrollTop: 0,
COURSE_TYPE
} }
}, },
computed: { computed: {
...@@ -82,23 +86,16 @@ export default { ...@@ -82,23 +86,16 @@ export default {
}) })
const { pageNum, pageSize } = this const { pageNum, pageSize } = this
const params = { const params = {
completeStatus: 1, // 完成状态 1=已完成 learnStatus: 2, // 学习状态 0:待学习 1: 正在学习 2:已学完
pageNum, pageNum,
pageSize pageSize
} }
const res = await uni.$api.commonApi.getCourseTaskPage(params) const res = await uni.$api.commonApi.getMyCourseList(params)
// 临时添加测试数据字段
const listWithTestData = res.list.map((item, index) => ({
...item,
required: index % 3 === 0, // 每3个课程第1个是必修
courseType: index % 2 === 0 ? 'video' : 'document', // 交替显示视频/文档
}))
if (pageNum == 1) { if (pageNum == 1) {
this.completedCourseList = listWithTestData this.completedCourseList = res.list
} else { } else {
this.completedCourseList = this.completedCourseList.concat(listWithTestData) this.completedCourseList = this.completedCourseList.concat(res.list)
} }
uni.hideLoading() uni.hideLoading()
this.total = res.total this.total = res.total
...@@ -152,6 +149,7 @@ export default { ...@@ -152,6 +149,7 @@ export default {
width: toRpx(530) !important; width: toRpx(530) !important;
max-width: toRpx(530); max-width: toRpx(530);
min-width: toRpx(530); min-width: toRpx(530);
font-size: 0;
} }
} }
...@@ -209,6 +207,8 @@ export default { ...@@ -209,6 +207,8 @@ export default {
padding: toRpx(32); padding: toRpx(32);
position: relative; position: relative;
min-height: toRpx(196); min-height: toRpx(196);
background-color: #fff;
border-radius: 0 0 toRpx(16) toRpx(16);
.completed-course-item-title { .completed-course-item-title {
font-size: toRpx(30); font-size: toRpx(30);
......
<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,14 +14,17 @@ ...@@ -14,14 +14,17 @@
<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 class="tips" v-if="tabIndex === 0">
<view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">带有"限时学"标签的课程:规定时间内未完成任务,禁止提单!请按时学习。</view>
</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" :class="{ 'fixed-width': cardWidth > 0 }"> <view class="task-list">
<view class="task-item" v-for="(item, index) in taskList" :key="index" @click="handleTaskItemClick(item)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''"> <view class="task-item" v-for="(item, index) in taskList" :key="index" @click="handleTaskItemClick(item)">
<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">
...@@ -58,26 +61,25 @@ ...@@ -58,26 +61,25 @@
/> />
<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-text"> <view class="task-item-value">
{{ 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>
...@@ -93,21 +95,12 @@ ...@@ -93,21 +95,12 @@
<view class="end-text">到底了!</view> <view class="end-text">到底了!</view>
</template> </template>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<script> <script>
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
name: 'MyTask', name: 'MyTask',
props: {
// 卡片宽度,不传则使用默认的响应式布局
cardWidth: {
type: Number,
default: 0
}
},
data() { data() {
return { return {
tabList: ['待完成', '已完成'], tabList: ['待完成', '已完成'],
...@@ -293,20 +286,12 @@ export default { ...@@ -293,20 +286,12 @@ 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);
} }
if (pageNum == 1) { if (pageNum == 1) {
this.taskList = newList this.taskList = newList.concat(newList)
} else { } else {
// 合并新数据到已有数据 // 合并新数据到已有数据
this.taskList = this.taskList.concat(newList) this.taskList = this.taskList.concat(newList)
...@@ -314,7 +299,6 @@ export default { ...@@ -314,7 +299,6 @@ export default {
uni.hideLoading() uni.hideLoading()
this.total = res.total this.total = res.total
this.nothing = res.length ? true : false this.nothing = res.length ? true : false
// 只在tabIndex为0时处理倒计时 // 只在tabIndex为0时处理倒计时
if (completeStatus === 0) { if (completeStatus === 0) {
// 启动定时器(不管是第一页还是翻页都要) // 启动定时器(不管是第一页还是翻页都要)
...@@ -404,9 +388,8 @@ export default { ...@@ -404,9 +388,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.task-box { .task-box {
padding-top: toRpx(32); padding-top: toRpx(32);
height: calc(100% + #{toRpx(72)}); height: calc(100% - #{toRpx(100)});
} }
.tab-list { .tab-list {
display: flex; display: flex;
width: toRpx(436); width: toRpx(436);
...@@ -415,7 +398,6 @@ export default { ...@@ -415,7 +398,6 @@ export default {
border-radius: toRpx(16); border-radius: toRpx(16);
color: #666666; color: #666666;
font-size: toRpx(28); font-size: toRpx(28);
.tab-item { .tab-item {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
...@@ -423,7 +405,6 @@ export default { ...@@ -423,7 +405,6 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin: toRpx(6); margin: toRpx(6);
&.active { &.active {
background-color: #fff; background-color: #fff;
color: #1A1A1A; color: #1A1A1A;
...@@ -432,7 +413,6 @@ export default { ...@@ -432,7 +413,6 @@ export default {
} }
} }
} }
.tips { .tips {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -443,26 +423,21 @@ export default { ...@@ -443,26 +423,21 @@ export default {
color: #FF9D0A; color: #FF9D0A;
height: toRpx(48); height: toRpx(48);
margin: toRpx(24) toRpx(40) 0; margin: toRpx(24) toRpx(40) 0;
&-text { &-text {
margin-top: toRpx(4); margin-top: toRpx(4);
} }
.icon-study-tips { .icon-study-tips {
margin-right: toRpx(8); margin-right: toRpx(8);
} }
} }
.tab-box { .tab-box {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin: 0 toRpx(40); margin: 0 toRpx(40);
} }
.finish-tab { .finish-tab {
display: flex; display: flex;
&-item { &-item {
width: toRpx(148); width: toRpx(148);
height: toRpx(64); height: toRpx(64);
...@@ -473,11 +448,9 @@ export default { ...@@ -473,11 +448,9 @@ export default {
line-height: toRpx(68); line-height: toRpx(68);
text-align: center; text-align: center;
margin-right: toRpx(16); margin-right: toRpx(16);
&:last-child { &:last-child {
margin-right: 0; margin-right: 0;
} }
&.finish-active { &.finish-active {
background: #2d66f71a; background: #2d66f71a;
font-weight: 500; font-weight: 500;
...@@ -485,34 +458,19 @@ export default { ...@@ -485,34 +458,19 @@ export default {
} }
} }
} }
.task-list-box { .task-list-box {
margin-top: toRpx(24); margin-top: toRpx(24);
height: calc(100% - #{toRpx(210)}); height: calc(100% - #{toRpx(210)});
} }
.task-finish-box { .task-finish-box {
margin-top: toRpx(24); margin-top: toRpx(24);
height: calc(100% - #{toRpx(138)}); height: calc(100% - #{toRpx(138)});
} }
.task-list { .task-list {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
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%;
...@@ -521,44 +479,6 @@ export default { ...@@ -521,44 +479,6 @@ export default {
border-radius: toRpx(24); border-radius: toRpx(24);
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;
...@@ -572,7 +492,6 @@ export default { ...@@ -572,7 +492,6 @@ export default {
z-index: 1; z-index: 1;
color: #fff; color: #fff;
} }
.time-limit-countdown { .time-limit-countdown {
position: absolute; position: absolute;
right: toRpx(18); right: toRpx(18);
...@@ -582,7 +501,6 @@ export default { ...@@ -582,7 +501,6 @@ export default {
justify-content: center; justify-content: center;
font-size: toRpx(24); font-size: toRpx(24);
z-index: 1; z-index: 1;
.countdown-num { .countdown-num {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -613,17 +531,14 @@ export default { ...@@ -613,17 +531,14 @@ export default {
font-size: toRpx(24); font-size: toRpx(24);
} }
} }
.task-item-img { .task-item-img {
width: 100%; width: 100%;
height: toRpx(180); height: toRpx(180);
border-radius: toRpx(16) toRpx(16) 0 0; border-radius: toRpx(16) toRpx(16) 0 0;
} }
.task-item-content { .task-item-content {
padding: toRpx(32); padding: toRpx(32);
} }
.task-item-title { .task-item-title {
font-size: toRpx(30); font-size: toRpx(30);
color: #292D33; color: #292D33;
...@@ -634,20 +549,17 @@ export default { ...@@ -634,20 +549,17 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.task-item-text { .task-item-text {
position: relative; position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
font-size: toRpx(24); font-size: toRpx(24);
margin-bottom: toRpx(24); margin-bottom: toRpx(24);
.task-item-label { .task-item-label {
width: toRpx(96); width: toRpx(96);
color: #999EA8; color: #999EA8;
margin-right: toRpx(24); margin-right: toRpx(24);
} }
.task-item-value { .task-item-value {
color: #666666; color: #666666;
display: inline-flex; display: inline-flex;
...@@ -665,13 +577,11 @@ export default { ...@@ -665,13 +577,11 @@ export default {
} }
} }
} }
.task-item-progress { .task-item-progress {
width: toRpx(151); width: toRpx(151);
height: toRpx(16); height: toRpx(16);
background: linear-gradient(128.8deg, rgba(117, 188, 255, .35) 0%, rgba(44, 102, 247, .35) 100%); background: linear-gradient(128.8deg, rgba(117, 188, 255, .35) 0%, rgba(44, 102, 247, .35) 100%);
border-radius: toRpx(8); border-radius: toRpx(8);
.task-item-progress-text { .task-item-progress-text {
color: #3B73FF; color: #3B73FF;
font-size: toRpx(24); font-size: toRpx(24);
...@@ -680,7 +590,6 @@ export default { ...@@ -680,7 +590,6 @@ export default {
right: 0; right: 0;
transform: translateY(-50%); transform: translateY(-50%);
} }
.task-item-progress-bar { .task-item-progress-bar {
height: 100%; height: 100%;
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%); background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
...@@ -689,28 +598,24 @@ export default { ...@@ -689,28 +598,24 @@ export default {
} }
} }
} }
.nothing { .nothing {
width: 100%; width: 100%;
flex-direction: column; flex-direction: column;
margin-top: toRpx(270); margin-top: toRpx(270);
font-size: toRpx(28); font-size: toRpx(28);
color: #999999; color: #999999;
.icon { .icon {
width: toRpx(678); width: toRpx(678);
height: toRpx(284); height: toRpx(284);
margin-bottom: toRpx(24); margin-bottom: toRpx(24);
} }
} }
.end-text { .end-text {
color: #999; color: #999;
text-align: center; text-align: center;
padding: toRpx(30) 0; padding: toRpx(30) 0;
font-size: toRpx(24); font-size: toRpx(24);
} }
/deep/ { /deep/ {
.uni-scroll-view-content { .uni-scroll-view-content {
height: calc(100% - #{toRpx(20)}); height: calc(100% - #{toRpx(20)});
......
<template>
<view class="recommend-course">
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
:class="getScrollHeight">
<template v-if="recommendCourseList.length">
<view class="recommend-course-list">
<view class="recommend-course-item" v-for="(item, index) in recommendCourseList" :key="index" @click="startStudy(item, index)">
<image
class="recommend-course-item-img"
src="../../../../assets/images/common/recommend-course-default.webp"
mode="scaleToFill"
/>
<view class="recommend-course-content">
<view class="recommend-course-item-title">
{{ item.courseName }}
</view>
<view class="recommend-course-item-text">{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}</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: 'RecommendCourse',
data() {
return {
recommendCourseList: [],
nothing: false,
total: 0,
pageNum: 1,
pageSize: 12,
scrollTop: 0,
}
},
computed: {
getScrollHeight() {
const list = this.recommendCourseList;
if (!list || list.length === 0) {
return '';
}
return 'scroll-view'
}
},
mounted() {
this.getCourseTaskPage()
this.asyncfindBeiSenSSOToken()
},
methods: {
// 获取我的任务接口, completeStatus: 完成状态 0=待完成 1=已完成, courseType: 课程类型 1=短课程 2=长课程
async getCourseTaskPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
recommendStatus: 1, // 推荐状态 0=无推荐 1=推荐课程
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getCourseTaskPage(params)
if (pageNum == 1) {
this.recommendCourseList = res.list
} else {
this.recommendCourseList = this.recommendCourseList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
pageonReachBottom() {
console.log('到底了');
// 解构赋值,设置 nothing 的默认值
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_recommend_course', businessId: item.id, pagePath: '/pages/equity/index'})
uni.navigateTo({
url: `/pages/common/studyDetail/detail?type=recommendation&index=${index}&recommendCourseList=${encodeURIComponent(JSON.stringify(this.recommendCourseList))}&pageNum=${pageNum}&pageSize=${pageSize}&total=${total}`
})
},
async asyncfindBeiSenSSOToken () {
const res = await uni.$api.commonApi.findBeiSenSSOToken({})
uni.$storage.set('beisenToken', res.data)
},
}
}
</script>
<style lang="scss" scoped>
.recommend-course {
height: calc(100% - #{toRpx(100)});
.scroll-view {
margin-top: toRpx(40);
height: calc(100% - #{toRpx(70)});
.recommend-course-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32);
.recommend-course-item {
width: 100%;
height: toRpx(376);
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
border-radius: toRpx(24);
.recommend-course-item-img {
width: 100%;
height: toRpx(180);
border-radius: toRpx(16) toRpx(16) 0 0;
}
.recommend-course-content {
padding: toRpx(32);
.recommend-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;
margin-bottom: toRpx(16);
height: calc(2 * 1.2em); // 固定两行高度,1.4为行高倍数,可根据实际调整
line-height: 1.2;
}
.recommend-course-item-text {
font-size: toRpx(24);
color: #999EA8;
}
}
}
}
}
}
.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>
\ No newline at end of file \ No newline at end of file
const COURSE_TYPE = {
10: {
name: '视频',
image: 'short-course-default'
},
80: {
name: '音频',
image: 'course-default-bg'
},
20: {
name: '混合',
image: 'short-course-default'
},
30: {
name: '文档',
image: 'course-default-bg'
},
40: {
name: 'H5',
image: 'course-default-bg'
},
70: {
name: 'URL',
image: 'course-default-bg'
},
120: {
name: '图文',
image: 'course-default-bg'
}
}
export {
COURSE_TYPE
}
\ No newline at end of file \ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class="back" @click="back"> <view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000000"></uni-icons> <uni-icons type="left" :size="20" color="#000000"></uni-icons>
</view> </view>
<view class="title">我的课程</view> <view class="title">我的课程1</view>
</view> </view>
</view> </view>
...@@ -23,17 +23,18 @@ ...@@ -23,17 +23,18 @@
</view> </view>
<!-- 提示信息 --> <!-- 提示信息 -->
<view class="tips"> <view class="tips" v-if="residueInfo.remindType != 0">
<view class="sprite-icon icon-study-tips"></view> <view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">剩余X天完成必修课学习及通过课后考试,过期将锁定开单权限</view> <view class="tips-text" v-if="residueInfo.remindType == '1'">剩余{{ residueInfo.residueDays }}天完成必修课学习及通过课后考试,过期将锁定开单权限</view>
<view class="tips-text" v-if="residueInfo.remindType == '2'">完成必修课学习及通过课后考试后,即可解锁开单权限</view>
</view> </view>
<!-- 课程列表 --> <!-- 课程列表 -->
<view class="course-content"> <view class="course-content" :class="residueInfo.remindType != 0 ? 'with-tips' : 'no-tips'">
<!-- 待学习 tab:使用 RecommendCourse 组件 --> <!-- 待学习 tab:使用 ToLearnCourse 组件 -->
<RecommendCourse v-if="currentTab === 0" ref="recommendCourse" :cardWidth="530" /> <ToLearnCourse v-if="currentTab === 0" ref="toLearnCourse" :cardWidth="530" />
<!-- 正在学习 tab:使用 MyTask 组件 --> <!-- 正在学习 tab:使用 Studying 组件 -->
<MyTask v-else-if="currentTab === 1" ref="myTask" :cardWidth="530" /> <Studying v-else-if="currentTab === 1" ref="studying" :cardWidth="530" />
<!-- 已学完 tab:使用 CompletedCourse 组件 --> <!-- 已学完 tab:使用 CompletedCourse 组件 -->
<CompletedCourse v-else-if="currentTab === 2" ref="completedCourse" :cardWidth="530" /> <CompletedCourse v-else-if="currentTab === 2" ref="completedCourse" :cardWidth="530" />
</view> </view>
...@@ -41,33 +42,51 @@ ...@@ -41,33 +42,51 @@
</template> </template>
<script> <script>
import RecommendCourse from '@/components/HomeFrame/components/Study/RecommendCourse.vue' import ToLearnCourse from './components/ToLearnCourse.vue'
import MyTask from '@/components/HomeFrame/components/Study/MyTask.vue' import Studying from './components/Studying.vue'
import CompletedCourse from '@/components/HomeFrame/components/Study/CompletedCourse.vue' import CompletedCourse from './components/CompletedCourse.vue'
export default { export default {
name: 'MyCoursePage', name: 'MyCoursePage',
components: { components: {
RecommendCourse, ToLearnCourse,
MyTask, Studying,
CompletedCourse CompletedCourse
}, },
data() { data() {
return { return {
currentTab: 0, currentTab: 0,
tabList: [ tabList: [
{ label: '待学习', count: '8' }, { label: '待学习', count: '0', key: 'unLearnCount' },
{ label: '正在学习', count: '5' }, { label: '正在学习', count: '0', key: 'learningCount' },
{ label: '已学完', count: '6' } { label: '已学完', count: '0', key: 'completedCount' }
] ],
residueInfo: {}
} }
}, },
mounted() {
console.log('MyCoursePage mounted')
this.getMyCourseTabCount()
this.getStudyCenterResidueTime()
},
methods: { methods: {
back() { back() {
uni.navigateBack() uni.navigateBack()
}, },
switchTab(index) { switchTab(index) {
this.currentTab = index this.currentTab = index
},
// tab 页面数量
async getMyCourseTabCount() {
const res = await uni.$api.commonApi.getMyCourseTabCount()
this.tabList.forEach((tab, index) => {
tab.count = res[tab.key] || '0'
})
},
// 学习中心 - 我的课程剩余开单时间
async getStudyCenterResidueTime() {
const res = await uni.$api.commonApi.getStudyCenterResidueTime()
this.residueInfo = res
} }
} }
} }
...@@ -191,9 +210,15 @@ export default { ...@@ -191,9 +210,15 @@ export default {
.course-content { .course-content {
width: 100%; width: 100%;
max-height: toRpx(1200); // height: toRpx(1200);
overflow-y: auto; // overflow-y: auto;
padding: 0 toRpx(64); // padding: 0 toRpx(64);
&.no-tips {
height: calc(100vh - #{toRpx(300)});
}
&.with-tips {
height: calc(100vh - #{toRpx(380)});
}
} }
} }
</style> </style>
......
<template> <template>
<view class="my-exam-container"> <view class="my-exam-container">
<!-- 顶部导航 --> <!-- 顶部导航 -->
<view class="header"> <view class="nav-bar">
<view class="nav-bar"> <view class="back" @click="back">
<view class="back" @click="back"> <uni-icons type="left" :size="20" color="#000000"></uni-icons>
<uni-icons type="left" :size="20" color="#000000"></uni-icons>
</view>
<view class="title">我的考试</view>
</view> </view>
<view class="title">我的考试</view>
</view> </view>
<!-- Tab 切换 --> <!-- Tab 切换 -->
...@@ -51,12 +49,23 @@ export default { ...@@ -51,12 +49,23 @@ export default {
] ]
} }
}, },
mounted() {
this.getExamStatistics()
},
methods: { methods: {
back() { back() {
uni.navigateBack() uni.navigateBack()
}, },
switchTab(index) { switchTab(index) {
this.currentTab = index this.currentTab = index
},
async getExamStatistics() {
const res = await uni.$api.commonApi.getExamStatistics({
staffPhone: uni.$storage.get('userInfo').phone
})
console.log(res)
this.tabList[0].count = res.passCount || '0'
this.tabList[1].count = res.failCount || '0'
} }
} }
} }
...@@ -64,60 +73,50 @@ export default { ...@@ -64,60 +73,50 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.my-exam-container { .my-exam-container {
width: 100%;
height: 100vh;
position: relative; position: relative;
overflow: hidden; width: 100vw;
height: 100vh;
&::after { background-image: url('@/assets/images/common/page-bg.webp');
content: ''; background-size: 100%;
background-image: url('@/assets/images/common/home-bg-1.webp'); box-sizing: border-box;
background-size: 100% 100%; padding-top: toRpx(112);
background-repeat: no-repeat; }
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.header { .nav-bar {
position: relative; position: fixed;
z-index: 10; width: 100%;
background: transparent; height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.nav-bar { .back {
display: flex; height: 100%;
align-items: center; aspect-ratio: 1/1;
justify-content: center; display: flex;
height: toRpx(88); align-items: center;
position: relative; justify-content: center;
pointer-events: auto;
.back { }
position: absolute;
left: toRpx(32);
display: flex;
align-items: center;
justify-content: center;
width: toRpx(60);
height: toRpx(60);
}
.title { .title {
font-size: toRpx(36); position: absolute;
font-weight: 500; top: 50%;
color: #000000; left: 50%;
} transform: translate(-50%, -50%);
} font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
} }
}
.tab-container { .tab-container {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: toRpx(44);
margin-bottom: toRpx(28);
padding: 0 toRpx(64); padding: 0 toRpx(64);
margin-top: toRpx(52);
margin-bottom: toRpx(32);
.tab-item { .tab-item {
width: toRpx(208); width: toRpx(208);
height: toRpx(72); height: toRpx(72);
...@@ -160,11 +159,8 @@ export default { ...@@ -160,11 +159,8 @@ export default {
.exam-content { .exam-content {
width: 100%; width: 100%;
max-height: toRpx(1200); // overflow-y: auto;
overflow-y: auto;
padding: 0 toRpx(64);
} }
}
</style> </style>
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
<script> <script>
import LearnStatistics from '@/components/HomeFrame/components/Study/LearnStatistics.vue' import LearnStatistics from '@/components/HomeFrame/components/Study/LearnStatistics.vue'
import WeeklyConversionRate from '@/components/HomeFrame/components/Study/WeeklyConversionRate.vue' import WeeklyConversionRate from '@/components/HomeFrame/components/Study/WeeklyConversionRate.vue'
import MyTask from '@/components/HomeFrame/components/Study/MyTask.vue' import MyTask from './components/MyTask.vue'
import RecommendCourse from '@/components/HomeFrame/components/Study/RecommendCourse.vue' import RecommendCourse from './components/RecommendCourse.vue'
import RadarChart from '@/pages/common/studyDetail/components/RadarChart.vue' import RadarChart from '@/pages/common/studyDetail/components/RadarChart.vue'
export default { export default {
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
.data-container { .data-container {
background: #ffffff; background: #ffffff;
border-radius: toRpx(48); border-radius: toRpx(48);
height: toRpx(1312); height: toRpx(1326);
box-shadow: inset 0 0 toRpx(16) 0 #ffffff; box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border: toRpx(2) solid #fff; border: toRpx(2) solid #fff;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -71,7 +71,12 @@ export default { ...@@ -71,7 +71,12 @@ export default {
async getQuotationInfoById (id) { async getQuotationInfoById (id) {
const data = await uni.$api.equityApi.getQuotationInfoById({ id }) const data = await uni.$api.equityApi.getQuotationInfoById({ id })
this.orderInfo = data this.orderInfo = data
this.zyVoucherStatus = data.zyVoucherStatus const params = {
goodsIds: data?.vdQuotationGoodsList?.map(v => v.goodsId),
merchantId: data.merchantId4s
}
const res = await uni.$api.equityApi.checkZyPayFlag(params)
this.zyVoucherStatus = res ? 1 : 0
if (data.payType == 1) this.createWxQrcode() if (data.payType == 1) this.createWxQrcode()
if (data.payType == 3) this.createQrCodeImg() if (data.payType == 3) this.createQrCodeImg()
this.getOrderDetail() this.getOrderDetail()
...@@ -80,26 +85,26 @@ export default { ...@@ -80,26 +85,26 @@ export default {
async getOrderDetail () { async getOrderDetail () {
uni.hideLoading() uni.hideLoading()
if (!this.show) return if (!this.show) return
const { payId, id } = this.orderInfo, const { payId } = this.orderInfo
data = await uni.$api.equityApi.getOrderDetail({ orderCode: payId }) if (payId) {
this.orderInfo.total_price = data.totalPrice const data = await uni.$api.equityApi.getOrderDetail({ orderCode: payId })
let { payOrder, status } = data console.log(data,'----')
if (payOrder?.payStatus == 2 || status == 4) { this.orderInfo.total_price = data.totalPrice
uni.showToas({ let { payOrder, status } = data
title: '支付成功', if (payOrder?.payStatus == 2 || status == 4) {
icon: 'none', this.closePopup()
mask: true uni.showToast({
}) title: '支付成功',
setTimeout(() => { icon: 'none',
this.$emit('jumpSuccess', { payId }) mask: true
}, 1.5e3) })
setTimeout(() => {
this.$emit('jumpSuccess', { payId })
}, 1.5e3)
}
} }
setTimeout(() => this.getOrderDetail(), 5e3) setTimeout(() => this.getOrderDetail(), 5e3)
}, },
clearTimer () {
if (this.time) clearInterval(this.time)
this.time = null
},
// 生成小程序码 // 生成小程序码
createWxQrcode () { createWxQrcode () {
let { zyVoucherStatus, orderInfo } = this, let { zyVoucherStatus, orderInfo } = this,
......
...@@ -192,7 +192,6 @@ export default { ...@@ -192,7 +192,6 @@ export default {
// 验证价格输入 // 验证价格输入
validatePrice (event, item, index, cindex) { validatePrice (event, item, index, cindex) {
let value = event.detail.value let value = event.detail.value
console.log('value', value)
// 如果为空则设置为0 // 如果为空则设置为0
if (!value || value.trim() === '') { if (!value || value.trim() === '') {
value = '0' value = '0'
...@@ -223,7 +222,6 @@ export default { ...@@ -223,7 +222,6 @@ export default {
// if (!item.multipleSpecificationsGoods) { // if (!item.multipleSpecificationsGoods) {
// // 普通商品的最小价格检查 // // 普通商品的最小价格检查
// if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) { // if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) {
// console.log('最小值', item.goods.minSellPrice)
// uni.showToast({ // uni.showToast({
// title: '单价不可低于商品最低价', // title: '单价不可低于商品最低价',
// icon: 'none' // icon: 'none'
...@@ -233,7 +231,6 @@ export default { ...@@ -233,7 +231,6 @@ export default {
// } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) { // } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
// // 多规格商品的最小价格检查 // // 多规格商品的最小价格检查
// if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' && item.multipleSpecificationsGoods.goods.minSellPrice && parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) { // if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' && item.multipleSpecificationsGoods.goods.minSellPrice && parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) {
// console.log('最小值', item.multipleSpecificationsGoods.goods.minSellPrice)
// uni.showToast({ // uni.showToast({
// title: '单价不可低于商品最低价', // title: '单价不可低于商品最低价',
// icon: 'none' // icon: 'none'
...@@ -246,7 +243,6 @@ export default { ...@@ -246,7 +243,6 @@ export default {
//如果没有多规格商品,更新普通商品的价格 //如果没有多规格商品,更新普通商品的价格
this.$set(this.list[index].goods, 'sellPrice', value) this.$set(this.list[index].goods, 'sellPrice', value)
} else { } else {
console.log(123)
this.$set(this.list[index].packageGoods.goodsList[cindex], 'sellPrice', value) this.$set(this.list[index].packageGoods.goodsList[cindex], 'sellPrice', value)
} }
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) { } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
...@@ -264,7 +260,6 @@ export default { ...@@ -264,7 +260,6 @@ export default {
if (!value || value.trim() === '' || parseInt(value) === 0) { if (!value || value.trim() === '' || parseInt(value) === 0) {
value = '1' value = '1'
} }
console.log(value, '1')
// 更新值 // 更新值
if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
this.$set(item.goods, 'number', value) this.$set(item.goods, 'number', value)
...@@ -272,7 +267,6 @@ export default { ...@@ -272,7 +267,6 @@ export default {
// 强制更新多规格商品的数量 // 强制更新多规格商品的数量
this.$set(item.multipleSpecificationsGoods, 'number', value) this.$set(item.multipleSpecificationsGoods, 'number', value)
} }
console.log(item, '2')
this.$emit('changeTotalPrice') this.$emit('changeTotalPrice')
}, },
// 增加数量 // 增加数量
...@@ -356,7 +350,7 @@ export default { ...@@ -356,7 +350,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.shop-list { .shop-list {
padding-right: toRpx(32); padding: 0 toRpx(32) toRpx(32) 0;
.shop-item { .shop-item {
display: flex; display: flex;
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
:key="index" :key="index"
class="previewImageList" class="previewImageList"
> >
<image :src="item"></image> <image :src="item" mode="aspectFill" @click="previewMedia(index)"></image>
<view <view
class="close-box" class="close-box"
@click="deleteImg(index)" @click="deleteImg(index)"
...@@ -132,6 +132,13 @@ export default { ...@@ -132,6 +132,13 @@ export default {
deleteImg (index) { deleteImg (index) {
this.payVoucherList.splice(index, 1) this.payVoucherList.splice(index, 1)
}, },
previewMedia(current){
const {payVoucherList} = this
uni.previewImage({
current,
urls: payVoucherList
})
}
} }
} }
</script> </script>
...@@ -187,10 +194,10 @@ export default { ...@@ -187,10 +194,10 @@ export default {
} }
.upload-box { .upload-box {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(4, 1fr);
gap: toRpx(20); gap: toRpx(20);
.upload-item { .upload-item {
width: toRpx(320) !important; width: 100%;
height: toRpx(240) !important; height: toRpx(240) !important;
border-radius: toRpx(12); border-radius: toRpx(12);
background: url('@/assets/images/boutique/uploadImage.png') no-repeat; background: url('@/assets/images/boutique/uploadImage.png') no-repeat;
......
...@@ -80,7 +80,8 @@ const FORM_LIST = [ ...@@ -80,7 +80,8 @@ const FORM_LIST = [
label: '证件号码', label: '证件号码',
value: 'certificateNo', value: 'certificateNo',
maxlength: '18', maxlength: '18',
type: 'input' type: 'input',
required: false
}, },
{ {
label: '兴趣爱好', label: '兴趣爱好',
...@@ -101,7 +102,7 @@ const FORM_LIST = [ ...@@ -101,7 +102,7 @@ const FORM_LIST = [
value: 'carBrandText', value: 'carBrandText',
type: 'select', type: 'select',
key: 'carBrand', key: 'carBrand',
required: true required:false
}, },
{ {
label: '车辆颜色', label: '车辆颜色',
...@@ -114,7 +115,7 @@ const FORM_LIST = [ ...@@ -114,7 +115,7 @@ const FORM_LIST = [
value: 'carVin', value: 'carVin',
maxlength: '17', maxlength: '17',
type: 'input', type: 'input',
required: true required:false
}, },
{ {
label: '座位数', label: '座位数',
......
...@@ -257,6 +257,14 @@ const refreshPageData = notRefreshOrder => { ...@@ -257,6 +257,14 @@ const refreshPageData = notRefreshOrder => {
getApp().globalDataorderListDateListScreenRefresh = true getApp().globalDataorderListDateListScreenRefresh = true
} }
// val:判断的值,unit单位
const filterValue = (val, unit = '') => {
if (val === null || val === undefined) {
return '-'
}
return `${val}${unit}`
}
export default { export default {
compareVersions, compareVersions,
convertDateTimeFormat, convertDateTimeFormat,
...@@ -276,5 +284,6 @@ export default { ...@@ -276,5 +284,6 @@ export default {
decimal, decimal,
showNoAccess, showNoAccess,
setCopyData, setCopyData,
refreshPageData refreshPageData,
filterValue
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!