Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-professional-exam
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Culm
pica-professional-exam
提交
1457f765
提交
1457f765
编写于
7月 27, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
项目文件整理
上级
4e385540
变更
13
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
400 行增加
和
5127 行删除
+400
-5127
cell-list-detail copy 2.vue
src/components/business/cell-list-detail copy 2.vue
+0
-619
cell-list-detail copy 3.vue
src/components/business/cell-list-detail copy 3.vue
+0
-669
cell-list-detail copy.vue
src/components/business/cell-list-detail copy.vue
+0
-607
cell-list-detail.vue
src/components/business/cell-list-detail.vue
+1
-2
main.js
src/main.js
+2
-2
env-config.js
src/utils/env-config.js
+1
-0
index copy - new.vue
src/views/index copy - new.vue
+0
-476
index copy 2.vue
src/views/index copy 2.vue
+0
-491
index copy 3.vue
src/views/index copy 3.vue
+0
-539
index copy 4.vue
src/views/index copy 4.vue
+0
-539
index copy.vue
src/views/index copy.vue
+384
-178
index.vue
src/views/index.vue
+12
-27
merge-detail copy.vue
src/views/merge-detail copy.vue
+0
-978
未找到文件。
src/components/business/cell-list-detail copy 2.vue
已删除
100644 → 0
浏览文件 @
4e385540
<
template
>
<!-- 项目组件列表项 -->
<section>
<div
class=
"cell-detail"
v-for=
"(component , index) in projectComponent"
:key=
"index"
>
<van-collapse
v-model=
"activeNames"
@
change=
"changeCollapse"
>
<van-collapse-item
v-for=
"(portalModule, index) in component.portalModuleDTOS"
:key=
"index"
:title=
"(parseInt(index) + 1) + '.' + portalModule.moduleName | shortName(19)"
:name=
"portalModule.expandKey"
:value=
"portalModule.value"
:disabled=
"portalModule.disabled"
@
click
.
native=
"chooseItem(portalModule)"
>
<article
@
click
.
stop=
"deleteFlow()"
class=
"cell-container"
>
<span
class=
""
v-for=
"(item, index) in portalModule.contentList"
:key=
"index"
>
<div
v-if=
"index > 0 && portalModule.contentList[index].templetId!= portalModule.contentList[index-1].templetId"
class=
"bottom-line"
></div>
<div
class=
"cell-container-item"
>
<div
class=
"name"
>
<div
class=
"name-img"
>
<img
v-if=
"item.type == 1 && item.useFlag == 1"
class=
"img-icon"
src=
"../../images/exam.png"
>
<img
v-if=
"item.type == 1 && item.useFlag == 2"
class=
"img-icon"
src=
"../../images/exam-dark.png"
>
<img
v-if=
"item.type == 2 && item.useFlag == 1"
class=
"img-icon"
src=
"../../images/learn.png"
>
<img
v-if=
"item.type == 2 && item.useFlag == 2"
class=
"img-icon"
src=
"../../images/learn-dark.png"
>
</div>
<p
class=
"name-title"
:class=
"
{'name-title-no': item.useFlag == 2}">
{{
item
.
name
|
shortName
(
30
)
}}
</p>
</div>
<span
@
click=
"gotoExamOrCourse(item)"
class=
"text-action"
:class=
"
{'text-action-no': item.useFlag == 2}"
>
{{
getActionText
(
item
.
status
,
item
.
type
)
}}
</span>
<div
class=
"foot-line"
v-if=
"index+1
<
portalModule
.
contentList
.
length
&&
portalModule
.
contentList
[
index
].
templetId =
=
portalModule
.
contentList
[
index
+
1
].
templetId
"
>
</div>
</div>
</span>
</article>
</van-collapse-item>
</van-collapse>
</div>
</section>
</
template
>
<
script
>
import
MergeTitle
from
"@/components/business/merge-title"
;
import
NoMoreContent
from
"@/components/business/no-more-content"
;
import
{
Collapse
,
CollapseItem
,
Dialog
,
Toast
}
from
'vant'
;
import
{
mapGetters
}
from
"vuex"
;
import
{
getAppVersion
}
from
"@/utils"
;
import
vueFilters
from
'@/utils/filter'
;
const
actionMap
=
{
11
:
"去考试"
,
12
:
"再考一次"
,
13
:
"已通过"
,
14
:
"已完成"
,
15
:
"已通过"
,
16
:
"未通过"
,
21
:
"去学习"
,
22
:
"继续学习"
,
23
:
"去复习"
};
const
sendBuriedDataMap
=
{
// 11: "8824",
// 12: "211013",
21
:
"8821"
,
22
:
"8822"
,
23
:
"8823"
}
export
default
{
name
:
"cell-list-item"
,
data
()
{
return
{
appVersion
:
"200"
,
hocImg
:
require
(
"../../images/has-owner-cert.png"
),
activeNames
:
[
1
],
projectId
:
1
};
},
props
:
{
hasBindCard
:
{
type
:
Boolean
,
default
:
false
},
projectComponent
:
{
type
:
Array
,
default
:
()
=>
[]
},
actionList
:
{
type
:
Array
,
default
:
()
=>
[]
},
detailNum
:
{
type
:
Number
|
String
,
default
:
0
},
courseRequire
:
{
type
:
Number
|
String
,
default
:
0
,
},
limitTimes
:
{
type
:
Number
|
String
,
default
:
0
,
}
},
computed
:
{
...
mapGetters
([
"userInfo"
])
},
components
:
{
MergeTitle
,
NoMoreContent
,
Dialog
,
},
watch
:{
actionList
:
{
immediate
:
true
,
handler
(
val
)
{
this
.
activeNames
=
val
;
}
}
},
mounted
()
{
},
created
()
{
this
.
projectId
=
this
.
$route
.
query
.
id
;
},
methods
:
{
// 跳转到考试或课程 type 1: 考试; 2: 课程
// 如果是考试,将根据appVersion判断是新考试还是老考试,如果是301或之前的,都是老考试
gotoExamOrCourse
(
item
)
{
// 埋点:去学习、继续学习、复习、去考试、重考
// let actionCode = sendBuriedDataMap[item.status];
// if(actionCode) {
// this.$sendBuriedData({
// component_tag: `882#${actionCode}#${this.projectId}`
// });
// }
let
appVersion
=
getAppVersion
(
this
.
userInfo
.
appVersion
);
if
(
item
.
useFlag
==
2
)
return
;
if
(
item
.
type
==
1
)
{
if
(
appVersion
<=
300
)
{
Toast
(
'请您下载新版本App'
);
return
;
}
else
{
this
.
gotoExam
(
item
.
id
);
}
}
else
if
(
item
.
type
==
2
)
{
this
.
gotoCourse
(
item
.
id
);
}
},
// 跳转到课程
// TODO 查看课程是否是最后一节课, 如果是,则要查找到相应的考试,并传递给原生端
gotoCourse
:
function
(
courseId
)
{
let
appVersion
=
getAppVersion
(
this
.
userInfo
.
appVersion
);
// 弹框提示下载新版本可以试看
if
(
appVersion
<
343
&&
!
this
.
hasBindCard
)
{
this
.
$dialog
.
confirm
({
className
:
'con-dialog'
,
showCancelButton
:
false
,
message
:
'激活/购买后可学习完整课程'
,
// message: '升级最新版本可试看课程',
confirmButtonText
:
'我知道了'
,
}).
then
(
res
=>
{
})
return
;
}
let
paramList
=
[]
let
limitTimes
=
this
.
limitTimes
-
0
;
if
(
this
.
hasBindCard
)
{
limitTimes
=
-
1
;
}
paramList
=
[
{
key
:
"className"
,
value
:
"com.picahealth.yunque.activitys.courseplaynew.MyTcPlayVideoActivity###CourseMultiMediaPlayController"
,
type
:
4
,
seqNo
:
1
},
{
key
:
"isCHC"
,
value
:
0
,
type
:
4
,
seqNo
:
1
},
{
key
:
"courseId"
,
value
:
courseId
,
type
:
4
,
seqNo
:
1
},
{
key
:
"courseRequire"
,
value
:
this
.
courseRequire
-
0
,
type
:
4
,
seqNo
:
1
},
{
key
:
"limitTimes"
,
value
:
limitTimes
,
type
:
4
,
seqNo
:
1
},
];
console
.
log
(
paramList
);
rocNative
.
dispatchEventByModuleCode
({
modeCode
:
"M200"
,
jsonString
:
paramList
});
},
// 跳转到考试
gotoExam
:
function
(
examId
)
{
let
paramList
=
[
{
key
:
"className"
,
value
:
"com.picahealth.yunque.activitys.exammodule.ExamPreActivity###PicaDo.ExamModuleManager"
,
type
:
4
,
seqNo
:
1
},
{
key
:
"examId"
,
value
:
examId
,
type
:
4
,
seqNo
:
1
}
];
rocNative
.
dispatchEventByModuleCode
({
modeCode
:
"M200"
,
jsonString
:
paramList
});
},
getActionText
(
status
,
type
)
{
let
actionText
=
actionMap
[
status
];
if
(
!
actionText
)
{
actionText
=
type
==
1
?
'去考试'
:
'去学习'
;
}
return
actionText
;
},
// showDialog(introduce) {
// Dialog.alert({
// title: '说明',
// message: introduce,
// confirmButtonText: '我知道了',
// })
// },
changeCollapse
(
activeNames
)
{
console
.
log
(
'activeNames'
,
activeNames
);
let
param
=
{
expandKeys
:
activeNames
,
setEntry
:
true
,
token
:
this
.
userInfo
.
userToken
,
}
this
.
POST
(
"portal/portalApp/updateExpandStatus?projectId="
+
this
.
projectId
,
param
).
then
(
res
=>
{
});
},
deleteFlow
()
{
},
chooseItem
(
item
)
{
let
_this
=
this
;
if
(
item
.
disabled
===
true
)
{
console
.
log
(
'item'
,
item
);
Toast
(
'尚未开始,敬请期待'
);
}
},
// 弹框提示
toastToBuy
()
{
Toast
(
'购买后可学习课程'
);
}
}
};
</
script
>
<
style
lang=
"scss"
>
@import
"../../style/mixin"
;
.van-dialog
{
transform
:
translate
(
-50%
,-
50%
);
width
:
px2rem
(
300px
);
border-radius
:
px2rem
(
3px
);
.van-dialog__header
{
padding-top
:
px2rem
(
30px
);
font-size
:
px2rem
(
18px
);
color
:
#333333
;
}
.van-dialog__content
{
.van-dialog__message--has-title
{
padding-top
:
px2rem
(
14px
);
text-align
:
left
;
color
:
#676869
;
font-weight
:
400
;
}
}
.van-dialog__footer
{
.van-button
{
.van-button__text
{
color
:
#449284
;
font-size
:
px2rem
(
17px
);
}
}
}
}
.van-toast
{
// background: #000000;
div
{
font-size
:px2rem
(
12px
)
;
color
:
#FFFFFF
;
}
}
.van-toast--text
{
padding
:
px2rem
(
7px
)
px2rem
(
8px
);
}
.no-more-bottom
{
position
:
relative
;
width
:
100%
;
height
:
px2rem
(
40px
);
}
.cell-detail
{
.
van-hairline--top
:
:
after
,
.
van-hairline--top-bottom
::
after
{
border-width
:
0px
;
}
.van-collapse-item
{
.van-cell
{
margin
:
px2rem
(
9px
)
auto
0
auto
;
width
:
px2rem
(
345px
);
min-height
:
px2rem
(
48px
);
border-radius
:
px2rem
(
6px
);
}
.van-collapse-item__title
{
background
:
#F8F9FA
;
.van-cell__title
{
max-width
:
px2rem
(
200px
);
vertical-align
:
middle
;
line-height
:
px2rem
(
30px
);
flex
:
auto
;
span
{
color
:
#373839
;
font-weight
:
500
;
font-size
:
px2rem
(
15px
);
height
:
px2rem
(
15px
);
line-height
:
px2rem
(
15px
);
}
}
.van-cell__value
{
// max-width: px2rem(80px);
line-height
:
px2rem
(
30px
);
span
{
color
:
#979899
;
font-weight
:
500
;
font-size
:
px2rem
(
14px
);
line-height
:
px2rem
(
14px
);
}
}
.van-icon
{
margin-top
:
px2rem
(
3px
);
color
:
#999999
;
}
}
.van-collapse-item__title--expanded
{
background
:
#E3EFED
;
.van-cell__title
{
span
{
color
:
#449284
;
font-weight
:
500
;
font-size
:
px2rem
(
15px
);
line-height
:
px2rem
(
15px
);
}
}
.van-cell__value
{
span
{
color
:
#449284
;
font-weight
:
500
;
font-size
:
px2rem
(
14px
);
line-height
:
px2rem
(
14px
);
}
}
.van-icon
{
color
:
#449284
;
}
}
.van-collapse-item__title--disabled
{
.van-cell__right-icon
{
display
:
none
;
}
.van-cell__title
,
.van-cell__value
{
span
{
color
:
#979899
;
}
}
}
.van-collapse-item__content
{
padding
:
0
;
}
}
.line-component
{
position
:
relative
;
margin-top
:
px2rem
(
20px
);
margin-left
:
0
;
width
:
px2rem
(
373px
);
height
:
px2rem
(
6px
);
background
:
#F8F9FA
;
}
}
.cell-container
{
display
:
flex
;
flex-direction
:
column
;
margin
:
px2rem
(
20px
)
px2rem
(
0px
)
px2rem
(
-28px
)
px2rem
(
0px
);
&
-item
{
position
:
relative
;
display
:
flex
;
flex-direction
:
row
;
margin-bottom
:
px2rem
(
39px
);
line-height
:
px2rem
(
51px
);
font-size
:
px2rem
(
15px
);
justify-content
:
space-between
;
align-items
:
center
;
.name
{
.name-img
{
position
:
relative
;
z-index
:
9
;
margin-right
:
px2rem
(
6px
);
width
:
px2rem
(
20px
);
height
:
px2rem
(
20px
);
float
:
left
;
.img-icon
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
px2rem
(
20px
);
height
:
px2rem
(
20px
);
}
}
&
-logo
{
position
:
relative
;
z-index
:
9
;
margin-right
:
px2rem
(
6px
);
width
:
px2rem
(
20px
);
height
:
px2rem
(
20px
);
text-align
:
center
;
background
:rgba
(
68
,
146
,
132
,
1
)
;
font-size
:
px2rem
(
12px
);
font-weight
:
700
;
color
:
#FFFFFF
;
border-radius
:
50%
;
float
:
left
;
line-height
:
px2rem
(
22px
);
// display:table;
// overflow:hidden;
// span {
// color: #FFFFFF;
// font-size: px2rem(12px);
// font-weight: 700;
// display: table-cell;
// text-align: center;
// vertical-align: middle;
// line-height: px2rem(20px);
// }
// &::before {
// position: absolute;
// top: px2rem(-6px);
// left: px2rem(8px);
// display: inline-block;
// height: px2rem(6px);
// width: px2rem(4px);
// background: #FFFFFF;
// content: "";
// }
// &::after {
// position: absolute;
// top: px2rem(20px);
// left: px2rem(8px);
// display: inline-block;
// height: px2rem(6px);
// width: px2rem(4px);
// background: #FFFFFF;
// content: "";
// }
}
&
-learn
{
background
:rgba
(
246
,
131
,
103
,
1
)
;
}
&
-logo-no
{
background
:rgba
(
231
,
232
,
233
,
1
)
;
}
&
-title
{
// font-family: "PingFangSC-Medium", "PingFangSC", "Microsoft Yahei";
width
:
px2rem
(
231px
);
font-size
:
px2rem
(
15px
);
font-weight
:
700
;
line-height
:
px2rem
(
22px
);
color
:
#333333
;
float
:
left
;
}
&
-title-no
{
color
:
#979899
;
}
// &::before {
// position: relative;
// top: px2rem(3px);
// display: inline-block;
// width: px2rem(4px);
// content: "";
// margin-right: px2rem(5px);
// height: px2rem(16px);
// background: #449284;
// border-radius: px2rem(3px);
// }
// span {
// img {
// margin-top: px2rem(4px);
// position: relative;
// top: px2rem(2px);
// width: px2rem(70px);
// height: px2rem(20px);
// }
// }
}
.text-action
{
width
:
px2rem
(
68px
);
height
:
px2rem
(
25px
);
line-height
:
px2rem
(
25px
);
text-align
:
center
;
font-size
:
px2rem
(
12px
);
font-weight
:
700
;
border-radius
:
px2rem
(
15px
);
border
:
px2rem
(
1px
)
solid
rgba
(
68
,
146
,
132
,
0
.6
);
color
:
rgba
(
68
,
146
,
132
,
1
);
img
{
position
:
relative
;
left
:
px2rem
(
2px
);
top
:
px2rem
(
3px
);
width
:
px2rem
(
8px
);
height
:
px2rem
(
12px
);
}
&
-no
{
border
:
px2rem
(
1px
)
solid
#c7c8c9
;
color
:
#c7c8c9
;
}
}
.key
{
width
:
px2rem
(
15px
);
height
:
px2rem
(
15px
);
}
}
span
{
.cert-img
{
margin-left
:
px2rem
(
26px
);
position
:
relative
;
top
:
px2rem
(
-34px
);
width
:
px2rem
(
70px
);
height
:
px2rem
(
20px
);
}
.space2
{
top
:
px2rem
(
-34px
);
}
}
.connect-line
{
position
:
absolute
;
// top: px2rem(32px);
top
:
px2rem
(
3px
);
left
:
px2rem
(
8
.5px
);
height
:
px2rem
(
42px
);
width
:
px2rem
(
3px
);
background
:
#F8F9FA
;
// border: 0.5px dashed rgba(240, 241, 244, 1);
}
.line-complete
{
background
:
#E3EFED
;
}
.len4
{
// height: px2rem(100px);
height
:
px2rem
(
106px
);
}
.len3
{
// height: px2rem(82px);
height
:
px2rem
(
88px
);
}
.len2
{
// height: px2rem(82px);
height
:
px2rem
(
88px
);
}
.len1
{
// height: px2rem(62px);
height
:
px2rem
(
68px
);
}
.bottom-line
{
position
:
relative
;
margin
:
px2rem
(
-19px
)
0
px2rem
(
20px
)
0
;
bottom
:
0px
;
width
:
100%
;
height
:
px2rem
(
6px
);
background
:
#F8F9FA
;
border-radius
:
px2rem
(
2px
);
// border-bottom: 0.5px solid #F0F1F2;
}
.foot-line
{
position
:
absolute
;
width
:
px2rem
(
311px
);
margin-left
:
px2rem
(
34
.5px
);
height
:
px2rem
(
1px
);
background
:
#E7E8E9
;
// border-bottom: 0.5px solid #E7E8E9;
transform
:
scaleY
(
0
.5
);
bottom
:
px2rem
(
-20px
);
}
}
.bg-13
{
background
:
#abcec7
;
}
</
style
>
\ No newline at end of file
src/components/business/cell-list-detail copy 3.vue
已删除
100644 → 0
浏览文件 @
4e385540
<
template
>
<!-- 项目组件列表项 -->
<section>
<div
class=
"cell-detail"
v-for=
"(component , index) in projectComponent"
:key=
"index"
>
<van-collapse
v-model=
"activeNames"
@
change=
"changeCollapse"
>
<van-collapse-item
v-for=
"(portalModule, index) in component.portalModuleDTOS"
:key=
"index"
:title=
"(parseInt(index) + 1) + '.' + portalModule.moduleName | shortName(19)"
:name=
"portalModule.expandKey"
:value=
"portalModule.value"
:disabled=
"portalModule.disabled"
@
click
.
native=
"chooseItem(portalModule)"
>
<article
@
click
.
stop=
"deleteFlow()"
class=
"cell-container"
>
<span
class=
""
v-for=
"(item, index) in portalModule.contentList"
:key=
"index"
>
<div
v-if=
"index > 0 && portalModule.contentList[index].templetId!= portalModule.contentList[index-1].templetId"
class=
"bottom-line"
></div>
<div
class=
"cell-container-item"
>
<div
class=
"name"
>
<div
class=
"name-img"
>
<img
v-if=
"item.type == 1 && item.useFlag == 1"
class=
"img-icon"
src=
"../../images/exam.png"
>
<img
v-if=
"item.type == 1 && item.useFlag == 2"
class=
"img-icon"
src=
"../../images/exam-dark.png"
>
<img
v-if=
"item.type == 2 && item.useFlag == 1"
class=
"img-icon"
src=
"../../images/learn.png"
>
<img
v-if=
"item.type == 2 && item.useFlag == 2"
class=
"img-icon"
src=
"../../images/learn-dark.png"
>
</div>
<p
class=
"name-title"
:class=
"
{'name-title-no': item.useFlag == 2}">
{{
item
.
name
|
shortName
(
30
)
}}
</p>
</div>
<span
@
click=
"gotoExamOrCourse(item, portalModule.contentList, index)"
class=
"text-action"
:class=
"
{'text-action-no': item.useFlag == 2}"
>
{{
getActionText
(
item
.
status
,
item
.
type
)
}}
</span>
<div
class=
"foot-line"
v-if=
"index+1
<
portalModule
.
contentList
.
length
&&
portalModule
.
contentList
[
index
].
templetId =
=
portalModule
.
contentList
[
index
+
1
].
templetId
"
>
</div>
</div>
</span>
</article>
</van-collapse-item>
</van-collapse>
</div>
</section>
</
template
>
<
script
>
import
MergeTitle
from
"@/components/business/merge-title"
;
import
NoMoreContent
from
"@/components/business/no-more-content"
;
import
{
Collapse
,
CollapseItem
,
Dialog
,
Toast
}
from
'vant'
;
import
{
mapGetters
}
from
"vuex"
;
import
{
getAppVersion
}
from
"@/utils"
;
import
vueFilters
from
'@/utils/filter'
;
const
actionMap
=
{
11
:
"去考试"
,
12
:
"再考一次"
,
13
:
"已通过"
,
14
:
"已完成"
,
15
:
"已通过"
,
16
:
"未通过"
,
21
:
"去学习"
,
22
:
"继续学习"
,
23
:
"去复习"
};
const
sendBuriedDataMap
=
{
// 11: "8824",
// 12: "211013",
21
:
"8821"
,
22
:
"8822"
,
23
:
"8823"
}
export
default
{
name
:
"cell-list-item"
,
data
()
{
return
{
appVersion
:
"200"
,
hocImg
:
require
(
"../../images/has-owner-cert.png"
),
activeNames
:
[
1
],
projectId
:
1
};
},
props
:
{
hasBindCard
:
{
type
:
Boolean
,
default
:
false
},
projectComponent
:
{
type
:
Array
,
default
:
()
=>
[]
},
actionList
:
{
type
:
Array
,
default
:
()
=>
[]
},
detailNum
:
{
type
:
Number
|
String
,
default
:
0
},
courseRequire
:
{
type
:
Number
|
String
,
default
:
0
,
},
limitTimes
:
{
type
:
Number
|
String
,
default
:
0
,
}
},
computed
:
{
...
mapGetters
([
"userInfo"
])
},
components
:
{
MergeTitle
,
NoMoreContent
,
Dialog
,
},
watch
:{
actionList
:
{
immediate
:
true
,
handler
(
val
)
{
this
.
activeNames
=
val
;
}
}
},
mounted
()
{
},
created
()
{
this
.
projectId
=
this
.
$route
.
query
.
id
;
},
methods
:
{
// 跳转到考试或课程 type 1: 考试; 2: 课程
// 如果是考试,将根据appVersion判断是新考试还是老考试,如果是301或之前的,都是老考试
gotoExamOrCourse
(
item
,
contentList
,
index
)
{
// 埋点:去学习、继续学习、复习、去考试、重考
// let actionCode = sendBuriedDataMap[item.status];
// if(actionCode) {
// this.$sendBuriedData({
// component_tag: `882#${actionCode}#${this.projectId}`
// });
// }
let
appVersion
=
getAppVersion
(
this
.
userInfo
.
appVersion
);
if
(
item
.
useFlag
==
2
)
return
;
if
(
item
.
type
==
1
)
{
if
(
appVersion
<=
300
)
{
Toast
(
'请您下载新版本App'
);
return
;
}
else
{
this
.
gotoExam
(
item
.
id
);
}
}
else
if
(
item
.
type
==
2
)
{
this
.
gotoCourse
(
item
,
contentList
,
index
);
}
},
// 如果此模块中没有考试,则直接退出;否则
beforeGotoCourse
(
item
,
contentList
,
index
)
{
let
extendsParam
=
[];
let
hasExam
=
false
;
let
currentExam
=
{};
// 查找当前课程后面的有没有考试
for
(
let
i
=
index
;
i
<
contentList
.
length
;
i
++
)
{
if
(
contentList
[
i
].
type
==
1
)
{
hasExam
=
true
;
currentExam
=
contentList
[
i
];
break
;
}
}
// 如果后面没有考试,则直接退出
if
(
!
hasExam
)
return
extendsParam
;
let
hasNoLearningCourse
=
false
;
// 查找本模块中是否还有没有学习完的课程,排除当前这个
for
(
let
i
=
0
;
i
<
contentList
.
length
;
i
++
)
{
if
(
i
==
index
)
continue
;
if
(
contentList
[
i
].
type
==
2
&&
contentList
[
i
].
status
!=
14
)
{
hasNoLearningCourse
=
true
;
break
;
}
}
// 如果还有课程没有学完,则直接退出
if
(
hasNoLearningCourse
)
return
extendsParam
;
let
urlType
=
currentExam
.
urlType
;
let
jumpUrl
=
currentExam
.
url
;
let
jumpContent
=
''
;
let
examType
=
0
;
// (已经与后台约定只判断链接)如果有链接,则要加入相应参数
if
(
jumpUrl
)
{
examType
=
urlType
;
jumpContent
=
jumpUrl
;
}
else
{
examType
=
-
1
;
jumpContent
=
currentExam
.
id
;
}
extendsParam
.
push
({
key
:
"examType"
,
value
:
examType
,
type
:
4
,
seqNo
:
1
});
extendsParam
.
push
({
key
:
"jumpContent"
,
value
:
jumpContent
,
type
:
4
,
seqNo
:
1
});
return
extendsParam
;
},
// 跳转到课程
// TODO 查看课程是否是最后一节课, 如果是,则要查找到相应的考试,并传递给原生端
gotoCourse
:
function
(
item
,
contentList
,
index
)
{
let
extendsParam
=
this
.
beforeGotoCourse
(
item
,
contentList
,
index
);
let
appVersion
=
getAppVersion
(
this
.
userInfo
.
appVersion
);
// 弹框提示下载新版本可以试看
if
(
appVersion
<
343
&&
!
this
.
hasBindCard
)
{
this
.
$dialog
.
confirm
({
className
:
'con-dialog'
,
showCancelButton
:
false
,
message
:
'激活/购买后可学习完整课程'
,
// message: '升级最新版本可试看课程',
confirmButtonText
:
'我知道了'
,
}).
then
(
res
=>
{
})
return
;
}
let
paramList
=
[]
let
limitTimes
=
this
.
limitTimes
-
0
;
if
(
this
.
hasBindCard
)
{
limitTimes
=
-
1
;
}
paramList
=
[
{
key
:
"className"
,
value
:
"com.picahealth.yunque.activitys.courseplaynew.MyTcPlayVideoActivity###CourseMultiMediaPlayController"
,
type
:
4
,
seqNo
:
1
},
{
key
:
"isCHC"
,
value
:
0
,
type
:
4
,
seqNo
:
1
},
{
key
:
"courseId"
,
value
:
courseId
,
type
:
4
,
seqNo
:
1
},
{
key
:
"courseRequire"
,
value
:
this
.
courseRequire
-
0
,
type
:
4
,
seqNo
:
1
},
{
key
:
"limitTimes"
,
value
:
limitTimes
,
type
:
4
,
seqNo
:
1
},
];
console
.
log
(
paramList
);
rocNative
.
dispatchEventByModuleCode
({
modeCode
:
"M200"
,
jsonString
:
paramList
.
concat
(
extendsParam
)
});
},
// 跳转到考试
gotoExam
:
function
(
examId
)
{
let
paramList
=
[
{
key
:
"className"
,
value
:
"com.picahealth.yunque.activitys.exammodule.ExamPreActivity###PicaDo.ExamModuleManager"
,
type
:
4
,
seqNo
:
1
},
{
key
:
"examId"
,
value
:
examId
,
type
:
4
,
seqNo
:
1
}
];
rocNative
.
dispatchEventByModuleCode
({
modeCode
:
"M200"
,
jsonString
:
paramList
});
},
getActionText
(
status
,
type
)
{
let
actionText
=
actionMap
[
status
];
if
(
!
actionText
)
{
actionText
=
type
==
1
?
'去考试'
:
'去学习'
;
}
return
actionText
;
},
// showDialog(introduce) {
// Dialog.alert({
// title: '说明',
// message: introduce,
// confirmButtonText: '我知道了',
// })
// },
changeCollapse
(
activeNames
)
{
console
.
log
(
'activeNames'
,
activeNames
);
let
param
=
{
expandKeys
:
activeNames
,
setEntry
:
true
,
token
:
this
.
userInfo
.
userToken
,
}
this
.
POST
(
"portal/portalApp/updateExpandStatus?projectId="
+
this
.
projectId
,
param
).
then
(
res
=>
{
});
},
deleteFlow
()
{
},
chooseItem
(
item
)
{
let
_this
=
this
;
if
(
item
.
disabled
===
true
)
{
console
.
log
(
'item'
,
item
);
Toast
(
'尚未开始,敬请期待'
);
}
},
// 弹框提示
toastToBuy
()
{
Toast
(
'购买后可学习课程'
);
}
}
};
</
script
>
<
style
lang=
"scss"
>
@import
"../../style/mixin"
;
.van-dialog
{
transform
:
translate
(
-50%
,-
50%
);
width
:
px2rem
(
300px
);
border-radius
:
px2rem
(
3px
);
.van-dialog__header
{
padding-top
:
px2rem
(
30px
);
font-size
:
px2rem
(
18px
);
color
:
#333333
;
}
.van-dialog__content
{
.van-dialog__message--has-title
{
padding-top
:
px2rem
(
14px
);
text-align
:
left
;
color
:
#676869
;
font-weight
:
400
;
}
}
.van-dialog__footer
{
.van-button
{
.van-button__text
{
color
:
#449284
;
font-size
:
px2rem
(
17px
);
}
}
}
}
.van-toast
{
// background: #000000;
div
{
font-size
:px2rem
(
12px
)
;
color
:
#FFFFFF
;
}
}
.van-toast--text
{
padding
:
px2rem
(
7px
)
px2rem
(
8px
);
}
.no-more-bottom
{
position
:
relative
;
width
:
100%
;
height
:
px2rem
(
40px
);
}
.cell-detail
{
.
van-hairline--top
:
:
after
,
.
van-hairline--top-bottom
::
after
{
border-width
:
0px
;
}
.van-collapse-item
{
.van-cell
{
margin
:
px2rem
(
9px
)
auto
0
auto
;
width
:
px2rem
(
345px
);
min-height
:
px2rem
(
48px
);
border-radius
:
px2rem
(
6px
);
}
.van-collapse-item__title
{
background
:
#F8F9FA
;
.van-cell__title
{
max-width
:
px2rem
(
200px
);
vertical-align
:
middle
;
line-height
:
px2rem
(
30px
);
flex
:
auto
;
span
{
color
:
#373839
;
font-weight
:
500
;
font-size
:
px2rem
(
15px
);
height
:
px2rem
(
15px
);
line-height
:
px2rem
(
15px
);
}
}
.van-cell__value
{
// max-width: px2rem(80px);
line-height
:
px2rem
(
30px
);
span
{
color
:
#979899
;
font-weight
:
500
;
font-size
:
px2rem
(
14px
);
line-height
:
px2rem
(
14px
);
}
}
.van-icon
{
margin-top
:
px2rem
(
3px
);
color
:
#999999
;
}
}
.van-collapse-item__title--expanded
{
background
:
#E3EFED
;
.van-cell__title
{
span
{
color
:
#449284
;
font-weight
:
500
;
font-size
:
px2rem
(
15px
);
line-height
:
px2rem
(
15px
);
}
}
.van-cell__value
{
span
{
color
:
#449284
;
font-weight
:
500
;
font-size
:
px2rem
(
14px
);
line-height
:
px2rem
(
14px
);
}
}
.van-icon
{
color
:
#449284
;
}
}
.van-collapse-item__title--disabled
{
.van-cell__right-icon
{
display
:
none
;
}
.van-cell__title
,
.van-cell__value
{
span
{
color
:
#979899
;
}
}
}
.van-collapse-item__content
{
padding
:
0
;
}
}
.line-component
{
position
:
relative
;
margin-top
:
px2rem
(
20px
);
margin-left
:
0
;
width
:
px2rem
(
373px
);
height
:
px2rem
(
6px
);
background
:
#F8F9FA
;
}
}
.cell-container
{
display
:
flex
;
flex-direction
:
column
;
margin
:
px2rem
(
20px
)
px2rem
(
0px
)
px2rem
(
-28px
)
px2rem
(
0px
);
&
-item
{
position
:
relative
;
display
:
flex
;
flex-direction
:
row
;
margin-bottom
:
px2rem
(
39px
);
line-height
:
px2rem
(
51px
);
font-size
:
px2rem
(
15px
);
justify-content
:
space-between
;
align-items
:
center
;
.name
{
.name-img
{
position
:
relative
;
z-index
:
9
;
margin-right
:
px2rem
(
6px
);
width
:
px2rem
(
20px
);
height
:
px2rem
(
20px
);
float
:
left
;
.img-icon
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
px2rem
(
20px
);
height
:
px2rem
(
20px
);
}
}
&
-logo
{
position
:
relative
;
z-index
:
9
;
margin-right
:
px2rem
(
6px
);
width
:
px2rem
(
20px
);
height
:
px2rem
(
20px
);
text-align
:
center
;
background
:rgba
(
68
,
146
,
132
,
1
)
;
font-size
:
px2rem
(
12px
);
font-weight
:
700
;
color
:
#FFFFFF
;
border-radius
:
50%
;
float
:
left
;
line-height
:
px2rem
(
22px
);
// display:table;
// overflow:hidden;
// span {
// color: #FFFFFF;
// font-size: px2rem(12px);
// font-weight: 700;
// display: table-cell;
// text-align: center;
// vertical-align: middle;
// line-height: px2rem(20px);
// }
// &::before {
// position: absolute;
// top: px2rem(-6px);
// left: px2rem(8px);
// display: inline-block;
// height: px2rem(6px);
// width: px2rem(4px);
// background: #FFFFFF;
// content: "";
// }
// &::after {
// position: absolute;
// top: px2rem(20px);
// left: px2rem(8px);
// display: inline-block;
// height: px2rem(6px);
// width: px2rem(4px);
// background: #FFFFFF;
// content: "";
// }
}
&
-learn
{
background
:rgba
(
246
,
131
,
103
,
1
)
;
}
&
-logo-no
{
background
:rgba
(
231
,
232
,
233
,
1
)
;
}
&
-title
{
// font-family: "PingFangSC-Medium", "PingFangSC", "Microsoft Yahei";
width
:
px2rem
(
231px
);
font-size
:
px2rem
(
15px
);
font-weight
:
700
;
line-height
:
px2rem
(
22px
);
color
:
#333333
;
float
:
left
;
}
&
-title-no
{
color
:
#979899
;
}
// &::before {
// position: relative;
// top: px2rem(3px);
// display: inline-block;
// width: px2rem(4px);
// content: "";
// margin-right: px2rem(5px);
// height: px2rem(16px);
// background: #449284;
// border-radius: px2rem(3px);
// }
// span {
// img {
// margin-top: px2rem(4px);
// position: relative;
// top: px2rem(2px);
// width: px2rem(70px);
// height: px2rem(20px);
// }
// }
}
.text-action
{
width
:
px2rem
(
68px
);
height
:
px2rem
(
25px
);
line-height
:
px2rem
(
25px
);
text-align
:
center
;
font-size
:
px2rem
(
12px
);
font-weight
:
700
;
border-radius
:
px2rem
(
15px
);
border
:
px2rem
(
1px
)
solid
rgba
(
68
,
146
,
132
,
0
.6
);
color
:
rgba
(
68
,
146
,
132
,
1
);
img
{
position
:
relative
;
left
:
px2rem
(
2px
);
top
:
px2rem
(
3px
);
width
:
px2rem
(
8px
);
height
:
px2rem
(
12px
);
}
&
-no
{
border
:
px2rem
(
1px
)
solid
#c7c8c9
;
color
:
#c7c8c9
;
}
}
.key
{
width
:
px2rem
(
15px
);
height
:
px2rem
(
15px
);
}
}
span
{
.cert-img
{
margin-left
:
px2rem
(
26px
);
position
:
relative
;
top
:
px2rem
(
-34px
);
width
:
px2rem
(
70px
);
height
:
px2rem
(
20px
);
}
.space2
{
top
:
px2rem
(
-34px
);
}
}
.connect-line
{
position
:
absolute
;
// top: px2rem(32px);
top
:
px2rem
(
3px
);
left
:
px2rem
(
8
.5px
);
height
:
px2rem
(
42px
);
width
:
px2rem
(
3px
);
background
:
#F8F9FA
;
// border: 0.5px dashed rgba(240, 241, 244, 1);
}
.line-complete
{
background
:
#E3EFED
;
}
.len4
{
// height: px2rem(100px);
height
:
px2rem
(
106px
);
}
.len3
{
// height: px2rem(82px);
height
:
px2rem
(
88px
);
}
.len2
{
// height: px2rem(82px);
height
:
px2rem
(
88px
);
}
.len1
{
// height: px2rem(62px);
height
:
px2rem
(
68px
);
}
.bottom-line
{
position
:
relative
;
margin
:
px2rem
(
-19px
)
0
px2rem
(
20px
)
0
;
bottom
:
0px
;
width
:
100%
;
height
:
px2rem
(
6px
);
background
:
#F8F9FA
;
border-radius
:
px2rem
(
2px
);
// border-bottom: 0.5px solid #F0F1F2;
}
.foot-line
{
position
:
absolute
;
width
:
px2rem
(
311px
);
margin-left
:
px2rem
(
34
.5px
);
height
:
px2rem
(
1px
);
background
:
#E7E8E9
;
// border-bottom: 0.5px solid #E7E8E9;
transform
:
scaleY
(
0
.5
);
bottom
:
px2rem
(
-20px
);
}
}
.bg-13
{
background
:
#abcec7
;
}
</
style
>
\ No newline at end of file
src/components/business/cell-list-detail copy.vue
已删除
100644 → 0
浏览文件 @
4e385540
<
template
>
<!-- 项目组件列表项 -->
<section>
<div
class=
"cell-detail"
v-for=
"(component , index) in projectComponent"
:key=
"index"
>
<!--
<CommonTitle
:fontWeight=
"500"
:title=
"component.name"
:isShowCert=
"true"
:isShowExplain=
"true"
@
showDialog=
"showDialog(component.introduce)"
></CommonTitle>
-->
<!--
<MergeTitle
:fontWeight=
"500"
:title=
"component.name"
:isShowCert=
"component.status"
:isShowExplain=
"true"
@
showDialog=
"showDialog(component.introduce)"
></MergeTitle>
-->
<van-collapse
v-model=
"activeNames"
@
change=
"changeCollapse"
>
<van-collapse-item
v-for=
"(portalModule, index) in component.portalModuleDTOS"
:key=
"index"
:title=
"(parseInt(index) + 1) + '.' + portalModule.moduleName | shortName(19)"
:name=
"portalModule.expandKey"
:value=
"portalModule.value"
:disabled=
"portalModule.disabled"
@
click
.
native=
"chooseItem(portalModule)"
>
<!-- @click.native="chooseItem(item)" -->
<article
@
click
.
stop=
"deleteFlow()"
class=
"cell-container"
>
<span
class=
""
v-for=
"(item, index) in portalModule.contentList"
:key=
"index"
>
<div
v-if=
"index > 0 && portalModule.contentList[index].templetId!= portalModule.contentList[index-1].templetId"
class=
"bottom-line"
></div>
<div
class=
"cell-container-item"
>
<div
class=
"name"
>
<div
class=
"name-img"
>
<img
v-if=
"item.type == 1 && item.useFlag == 1"
class=
"img-icon"
src=
"../../images/exam.png"
>
<img
v-if=
"item.type == 1 && item.useFlag == 2"
class=
"img-icon"
src=
"../../images/exam-dark.png"
>
<img
v-if=
"item.type == 2 && item.useFlag == 1"
class=
"img-icon"
src=
"../../images/learn.png"
>
<img
v-if=
"item.type == 2 && item.useFlag == 2"
class=
"img-icon"
src=
"../../images/learn-dark.png"
>
</div>
<p
class=
"name-title"
:class=
"
{'name-title-no': item.useFlag == 2}">
{{
item
.
name
|
shortName
(
30
)
}}
</p>
</div>
<span
@
click=
"gotoExamOrCourse(item)"
v-show=
"hasBindCard"
class=
"text-action"
:class=
"
{'text-action-no': item.useFlag == 2}"
>
{{
getActionText
(
item
.
status
)
}}
</span>
<img
@
click=
"toastToBuy"
class=
"key"
v-show=
"!hasBindCard"
src=
"../../images/cme/phrase2/key.png"
alt=
""
>
<div
class=
"foot-line"
v-if=
"index+1
<
portalModule
.
contentList
.
length
&&
portalModule
.
contentList
[
index
].
templetId =
=
portalModule
.
contentList
[
index
+
1
].
templetId
"
>
</div>
</div>
<span
v-if=
"item.certificateFlag == 2"
>
<img
class=
"cert-img"
:class=
"
{'space2': item.height == 2 }" src="../../images/has-cert-new.png">
</span>
</span>
</article>
</van-collapse-item>
</van-collapse>
</div>
<van-dialog
v-model=
"dialogState"
title=
"标题"
>
</van-dialog>
</section>
</
template
>
<
script
>
import
MergeTitle
from
"@/components/business/merge-title"
;
import
NoMoreContent
from
"@/components/business/no-more-content"
;
import
CertShow
from
"@/components/business/cert-show"
;
import
{
Collapse
,
CollapseItem
,
Dialog
,
Toast
}
from
'vant'
;
import
{
mapGetters
}
from
"vuex"
;
import
{
getAppVersion
}
from
"@/utils"
;
import
vueFilters
from
'@/utils/filter'
;
const
actionMap
=
{
11
:
"去考试"
,
12
:
"再考一次"
,
13
:
"已通过"
,
14
:
"已完成"
,
15
:
"已通过"
,
16
:
"未通过"
,
21
:
"去学习"
,
22
:
"继续学习"
,
23
:
"去复习"
};
const
sendBuriedDataMap
=
{
// 11: "8824",
// 12: "211013",
21
:
"8821"
,
22
:
"8822"
,
23
:
"8823"
}
export
default
{
name
:
"cell-list-item"
,
data
()
{
return
{
appVersion
:
"200"
,
hocImg
:
require
(
"../../images/has-owner-cert.png"
),
activeNames
:
[
1
],
dialogState
:
false
,
projectId
:
1
};
},
props
:
{
hasBindCard
:
{
type
:
Boolean
,
default
:
false
},
projectComponent
:
{
type
:
Array
,
default
:
()
=>
[]
},
actionList
:
{
type
:
Array
,
default
:
()
=>
[]
},
detailNum
:
{
type
:
Number
|
String
,
default
:
0
},
courseRequire
:
{
type
:
Number
|
String
,
default
:
0
,
}
},
computed
:
{
...
mapGetters
([
"userInfo"
])
},
components
:
{
MergeTitle
,
CertShow
,
NoMoreContent
,
Dialog
,
},
watch
:{
actionList
:
{
immediate
:
true
,
handler
(
val
)
{
this
.
activeNames
=
val
;
}
}
},
mounted
()
{
},
created
()
{
this
.
projectId
=
this
.
$route
.
query
.
id
;
},
methods
:
{
// 跳转到考试或课程 type 1: 考试; 2: 课程
// 如果是考试,将根据appVersion判断是新考试还是老考试,如果是301或之前的,都是老考试
gotoExamOrCourse
(
item
)
{
// 埋点:去学习、继续学习、复习、去考试、重考
// let actionCode = sendBuriedDataMap[item.status];
// if(actionCode) {
// this.$sendBuriedData({
// component_tag: `882#${actionCode}#${this.projectId}`
// });
// }
let
appVersion
=
getAppVersion
(
this
.
userInfo
.
appVersion
);
if
(
item
.
useFlag
==
2
)
return
;
if
(
window
.
__isWeb
)
{
// this.$refs.toastTitle.toast("请您下载App");
Toast
(
'请您下载App'
);
return
;
}
if
(
item
.
type
==
1
)
{
if
(
appVersion
<=
300
)
{
// this.$refs.toastTitle.toast("请您下载新版本App");
Toast
(
'请您下载新版本App'
);
return
;
}
else
{
this
.
gotoExam
(
item
.
id
);
}
}
else
if
(
item
.
type
==
2
)
{
this
.
gotoCourse
(
item
.
id
);
}
},
// 跳转到课程
gotoCourse
:
function
(
courseId
)
{
let
paramList
=
[]
paramList
=
[
{
key
:
"className"
,
value
:
"com.picahealth.yunque.activitys.courseplaynew.MyTcPlayVideoActivity###CourseMultiMediaPlayController"
,
type
:
4
,
seqNo
:
1
},
{
key
:
"isCHC"
,
value
:
0
,
type
:
4
,
seqNo
:
1
},
{
key
:
"courseId"
,
value
:
courseId
,
type
:
4
,
seqNo
:
1
},
{
key
:
"courseRequire"
,
value
:
this
.
courseRequire
-
0
,
type
:
4
,
seqNo
:
1
},
];
rocNative
.
dispatchEventByModuleCode
({
modeCode
:
"M200"
,
jsonString
:
paramList
});
},
// 跳转到考试
gotoExam
:
function
(
examId
)
{
let
paramList
=
[
{
key
:
"className"
,
value
:
"com.picahealth.yunque.activitys.exammodule.ExamPreActivity###PicaDo.ExamModuleManager"
,
type
:
4
,
seqNo
:
1
},
{
key
:
"examId"
,
value
:
examId
,
type
:
4
,
seqNo
:
1
}
];
rocNative
.
dispatchEventByModuleCode
({
modeCode
:
"M200"
,
jsonString
:
paramList
});
},
getActionText
(
status
)
{
return
actionMap
[
status
];
},
// showDialog(introduce) {
// Dialog.alert({
// title: '说明',
// message: introduce,
// confirmButtonText: '我知道了',
// })
// },
changeCollapse
(
activeNames
)
{
console
.
log
(
'activeNames'
,
activeNames
);
let
param
=
{
expandKeys
:
activeNames
,
setEntry
:
true
,
token
:
this
.
userInfo
.
userToken
,
}
this
.
POST
(
"portal/portalApp/updateExpandStatus?projectId="
+
this
.
projectId
,
param
).
then
(
res
=>
{
});
},
deleteFlow
()
{
},
chooseItem
(
item
)
{
let
_this
=
this
;
if
(
item
.
disabled
===
true
)
{
console
.
log
(
'item'
,
item
);
Toast
(
'尚未开始,敬请期待'
);
}
},
// 弹框提示
toastToBuy
()
{
Toast
(
'购买后可学习课程'
);
}
}
};
</
script
>
<
style
lang=
"scss"
>
@import
"../../style/mixin"
;
.van-dialog
{
transform
:
translate
(
-50%
,-
50%
);
width
:
px2rem
(
300px
);
border-radius
:
px2rem
(
3px
);
.van-dialog__header
{
padding-top
:
px2rem
(
30px
);
font-size
:
px2rem
(
18px
);
color
:
#333333
;
}
.van-dialog__content
{
.van-dialog__message--has-title
{
padding-top
:
px2rem
(
14px
);
text-align
:
left
;
color
:
#676869
;
font-weight
:
400
;
}
}
.van-dialog__footer
{
.van-button
{
.van-button__text
{
color
:
#449284
;
font-size
:
px2rem
(
17px
);
}
}
}
}
.van-toast
{
// background: #000000;
div
{
font-size
:px2rem
(
12px
)
;
color
:
#FFFFFF
;
}
}
.van-toast--text
{
padding
:
px2rem
(
7px
)
px2rem
(
8px
);
}
.no-more-bottom
{
position
:
relative
;
width
:
100%
;
height
:
px2rem
(
40px
);
}
.cell-detail
{
.
van-hairline--top
:
:
after
,
.
van-hairline--top-bottom
::
after
{
border-width
:
0px
;
}
.van-collapse-item
{
.van-cell
{
margin
:
px2rem
(
9px
)
auto
0
auto
;
width
:
px2rem
(
345px
);
min-height
:
px2rem
(
48px
);
border-radius
:
px2rem
(
6px
);
}
.van-collapse-item__title
{
background
:
#F8F9FA
;
.van-cell__title
{
max-width
:
px2rem
(
200px
);
vertical-align
:
middle
;
line-height
:
px2rem
(
30px
);
flex
:
auto
;
span
{
color
:
#373839
;
font-weight
:
500
;
font-size
:
px2rem
(
15px
);
height
:
px2rem
(
15px
);
line-height
:
px2rem
(
15px
);
}
}
.van-cell__value
{
// max-width: px2rem(80px);
line-height
:
px2rem
(
30px
);
span
{
color
:
#979899
;
font-weight
:
500
;
font-size
:
px2rem
(
14px
);
line-height
:
px2rem
(
14px
);
}
}
.van-icon
{
margin-top
:
px2rem
(
3px
);
color
:
#999999
;
}
}
.van-collapse-item__title--expanded
{
background
:
#E3EFED
;
.van-cell__title
{
span
{
color
:
#449284
;
font-weight
:
500
;
font-size
:
px2rem
(
15px
);
line-height
:
px2rem
(
15px
);
}
}
.van-cell__value
{
span
{
color
:
#449284
;
font-weight
:
500
;
font-size
:
px2rem
(
14px
);
line-height
:
px2rem
(
14px
);
}
}
.van-icon
{
color
:
#449284
;
}
}
.van-collapse-item__title--disabled
{
.van-cell__right-icon
{
display
:
none
;
}
.van-cell__title
,
.van-cell__value
{
span
{
color
:
#979899
;
}
}
}
.van-collapse-item__content
{
padding
:
0
;
}
}
.line-component
{
position
:
relative
;
margin-top
:
px2rem
(
20px
);
margin-left
:
0
;
width
:
px2rem
(
373px
);
height
:
px2rem
(
6px
);
background
:
#F8F9FA
;
}
}
.cell-container
{
display
:
flex
;
flex-direction
:
column
;
margin
:
px2rem
(
20px
)
px2rem
(
0px
)
px2rem
(
-28px
)
px2rem
(
0px
);
&
-item
{
position
:
relative
;
display
:
flex
;
flex-direction
:
row
;
margin-bottom
:
px2rem
(
39px
);
line-height
:
px2rem
(
51px
);
font-size
:
px2rem
(
15px
);
justify-content
:
space-between
;
align-items
:
center
;
.name
{
.name-img
{
position
:
relative
;
z-index
:
9
;
margin-right
:
px2rem
(
6px
);
width
:
px2rem
(
20px
);
height
:
px2rem
(
20px
);
float
:
left
;
.img-icon
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
px2rem
(
20px
);
height
:
px2rem
(
20px
);
}
}
&
-logo
{
position
:
relative
;
z-index
:
9
;
margin-right
:
px2rem
(
6px
);
width
:
px2rem
(
20px
);
height
:
px2rem
(
20px
);
text-align
:
center
;
background
:rgba
(
68
,
146
,
132
,
1
)
;
font-size
:
px2rem
(
12px
);
font-weight
:
700
;
color
:
#FFFFFF
;
border-radius
:
50%
;
float
:
left
;
line-height
:
px2rem
(
22px
);
// display:table;
// overflow:hidden;
// span {
// color: #FFFFFF;
// font-size: px2rem(12px);
// font-weight: 700;
// display: table-cell;
// text-align: center;
// vertical-align: middle;
// line-height: px2rem(20px);
// }
// &::before {
// position: absolute;
// top: px2rem(-6px);
// left: px2rem(8px);
// display: inline-block;
// height: px2rem(6px);
// width: px2rem(4px);
// background: #FFFFFF;
// content: "";
// }
// &::after {
// position: absolute;
// top: px2rem(20px);
// left: px2rem(8px);
// display: inline-block;
// height: px2rem(6px);
// width: px2rem(4px);
// background: #FFFFFF;
// content: "";
// }
}
&
-learn
{
background
:rgba
(
246
,
131
,
103
,
1
)
;
}
&
-logo-no
{
background
:rgba
(
231
,
232
,
233
,
1
)
;
}
&
-title
{
// font-family: "PingFangSC-Medium", "PingFangSC", "Microsoft Yahei";
width
:
px2rem
(
231px
);
font-size
:
px2rem
(
15px
);
font-weight
:
700
;
line-height
:
px2rem
(
22px
);
color
:
#333333
;
float
:
left
;
}
&
-title-no
{
color
:
#979899
;
}
// &::before {
// position: relative;
// top: px2rem(3px);
// display: inline-block;
// width: px2rem(4px);
// content: "";
// margin-right: px2rem(5px);
// height: px2rem(16px);
// background: #449284;
// border-radius: px2rem(3px);
// }
// span {
// img {
// margin-top: px2rem(4px);
// position: relative;
// top: px2rem(2px);
// width: px2rem(70px);
// height: px2rem(20px);
// }
// }
}
.text-action
{
width
:
px2rem
(
68px
);
height
:
px2rem
(
25px
);
line-height
:
px2rem
(
25px
);
text-align
:
center
;
font-size
:
px2rem
(
12px
);
font-weight
:
700
;
border-radius
:
px2rem
(
15px
);
border
:
px2rem
(
1px
)
solid
rgba
(
68
,
146
,
132
,
0
.6
);
color
:
rgba
(
68
,
146
,
132
,
1
);
img
{
position
:
relative
;
left
:
px2rem
(
2px
);
top
:
px2rem
(
3px
);
width
:
px2rem
(
8px
);
height
:
px2rem
(
12px
);
}
&
-no
{
border
:
px2rem
(
1px
)
solid
#c7c8c9
;
color
:
#c7c8c9
;
}
}
.key
{
width
:
px2rem
(
15px
);
height
:
px2rem
(
15px
);
}
}
span
{
.cert-img
{
margin-left
:
px2rem
(
26px
);
position
:
relative
;
top
:
px2rem
(
-34px
);
width
:
px2rem
(
70px
);
height
:
px2rem
(
20px
);
}
.space2
{
top
:
px2rem
(
-34px
);
}
}
.connect-line
{
position
:
absolute
;
// top: px2rem(32px);
top
:
px2rem
(
3px
);
left
:
px2rem
(
8
.5px
);
height
:
px2rem
(
42px
);
width
:
px2rem
(
3px
);
background
:
#F8F9FA
;
// border: 0.5px dashed rgba(240, 241, 244, 1);
}
.line-complete
{
background
:
#E3EFED
;
}
.len4
{
// height: px2rem(100px);
height
:
px2rem
(
106px
);
}
.len3
{
// height: px2rem(82px);
height
:
px2rem
(
88px
);
}
.len2
{
// height: px2rem(82px);
height
:
px2rem
(
88px
);
}
.len1
{
// height: px2rem(62px);
height
:
px2rem
(
68px
);
}
.bottom-line
{
position
:
relative
;
margin
:
px2rem
(
-19px
)
0
px2rem
(
20px
)
0
;
bottom
:
0px
;
width
:
100%
;
height
:
px2rem
(
6px
);
background
:
#F8F9FA
;
border-radius
:
px2rem
(
2px
);
// border-bottom: 0.5px solid #F0F1F2;
}
.foot-line
{
position
:
absolute
;
width
:
px2rem
(
311px
);
margin-left
:
px2rem
(
34
.5px
);
height
:
px2rem
(
1px
);
background
:
#E7E8E9
;
// border-bottom: 0.5px solid #E7E8E9;
transform
:
scaleY
(
0
.5
);
bottom
:
px2rem
(
-20px
);
}
}
.bg-13
{
background
:
#abcec7
;
}
</
style
>
\ No newline at end of file
src/components/business/cell-list-detail.vue
浏览文件 @
1457f765
...
...
@@ -158,7 +158,6 @@ export default {
// }
// this.gotoCourse(item, contentList, index, trySee);
let
appVersion
=
getAppVersion
(
this
.
userInfo
.
appVersion
);
if
(
item
.
useFlag
==
2
)
return
;
if
(
item
.
type
==
1
)
{
...
...
@@ -174,6 +173,7 @@ export default {
},
// 如果此模块中没有考试,则直接退出;否则
// 查看课程是否是最后一节课, 如果是,则要查找到相应的考试,并传递给原生端
beforeGotoCourse
(
item
,
contentList
,
index
)
{
let
extendsParam
=
[];
let
hasExam
=
false
;
...
...
@@ -222,7 +222,6 @@ export default {
},
// 跳转到课程
// TODO 查看课程是否是最后一节课, 如果是,则要查找到相应的考试,并传递给原生端
gotoCourse
:
function
(
item
,
contentList
,
index
,
trySee
)
{
let
extendsParam
=
this
.
beforeGotoCourse
(
item
,
contentList
,
index
);
let
appVersion
=
getAppVersion
(
this
.
userInfo
.
appVersion
);
...
...
src/main.js
浏览文件 @
1457f765
...
...
@@ -16,8 +16,8 @@ import clipboard from 'clipboard';
//注册到vue原型上
Vue
.
prototype
.
clipboard
=
clipboard
;
if
(
!
(
process
.
env
.
BUILD_ENV
===
'uat'
||
process
.
env
.
BUILD_ENV
===
'pro'
))
{
//
if(!(process.env.BUILD_ENV === 'pro')) {
//
if (!(process.env.BUILD_ENV === 'uat' || process.env.BUILD_ENV === 'pro')) {
if
(
!
(
process
.
env
.
BUILD_ENV
===
'pro'
))
{
let
vConsole
=
new
VConsole
()
// 初始化
}
...
...
src/utils/env-config.js
浏览文件 @
1457f765
...
...
@@ -7,6 +7,7 @@ export const envConfig = {
// baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'http://10.177.15.180:10202/',
// baseUrl: 'http://192.168.140.14:10201/',
apiUrl
:
'https://dev-api.yunqueyi.com/'
,
webPageUrl
:
'https://dev-phome.yunqueyi.com/'
,
baseUrl
:
'https://dev-sc.yunqueyi.com/'
,
...
...
src/views/index copy - new.vue
已删除
100644 → 0
浏览文件 @
4e385540
<
template
>
<!-- 专业选择列表 -->
<div
class=
"page-container"
>
<CommonNavbar
:bgColor=
"bgColor"
v-show=
"isShowNavbar"
:title=
"navTitle"
:isFixNavbar=
"isFixNavbar"
:burialPoint=
"pointStyle"
borderStyle=
"1px solid #fff"
></CommonNavbar>
<section
class=
"page-content"
>
<section
v-show=
"!existBind"
class=
"cb-wrapper padding-top-111"
>
<CardBanner
:userMobile=
"userMobile"
></CardBanner>
</section>
<section
class=
"body"
>
<ul
class=
"left"
>
<li
v-for=
"(model, mIndex) in titleTestModelList"
:key=
"mIndex"
:class=
"
{active: crrentModelIndex == mIndex}"
@click="selectModel(model, mIndex)"
>
<span>
{{
model
.
title
}}
</span>
</li>
</ul>
<article
class=
"right"
>
<ul
class=
"list-wrapper"
>
<li
class=
"list"
v-for=
"(item, index) in listData"
:key=
"index"
>
<span
class=
"title"
>
{{
item
.
name
}}
</span>
<ul
class=
"item"
>
<li
:id=
"'subject_' + sIndex"
:class=
"
{'no-active' : subject.openFlag == 0, 'has-bind' : subject.bindCardStatus == 1}"
v-for="(subject, sIndex) in item.secondSubjectModelList"
:key="sIndex"
@click="coopDetails(subject)"
>
<span>
{{
subject
.
name
}}
</span>
<span>
(
{{
subject
.
code
}}
)
</span>
<span
v-show=
"subject.bindCardStatus == 1"
class=
"buy"
>
己购
</span>
<span
v-show=
"subject.openFlag == 0"
class=
"time"
>
{{
formatTime
(
subject
.
predictTime
,
'{y
}
年{m
}
月'
)
}}
上线
<
/span
>
<
/li
>
<
/ul
>
<
/li
>
<
li
class
=
"no-list"
v
-
show
=
"!listData.length"
>
<
img
src
=
"../images/subject/no-subject.png"
alt
/>
<
span
>
正在更新中,敬请期待
<
/span
>
<
/li
>
<
/ul
>
<
/article
>
<
/section
>
<
/section
>
<
transition
name
=
"fade"
>
<
article
v
-
show
=
"needShowBackup"
@
click
=
"scrollTop"
class
=
"back-up-icon"
>
<
img
src
=
"../images/cme/phrase2/back-top.png"
alt
/>
<
/article
>
<
/transition
>
<
Loading
v
-
if
=
"showLoading"
/>
<
/div
>
<
/template
>
<
script
>
import
CommonNavbar
from
"@/components/common/common-navbar"
;
import
CardBanner
from
"@/components/cme/card-banner"
;
import
Loading
from
"@/components/common/common-loading"
;
import
CommonTitle
from
"@/components/common/common-title"
;
import
{
mapGetters
,
mapActions
}
from
"vuex"
;
import
{
getWebPageUrl
,
parseTime
}
from
'@/utils/index'
export
default
{
data
()
{
return
{
existBind
:
0
,
crrentModelIndex
:
0
,
titleTestModelList
:
[],
showLoading
:
false
,
isWeb
:
window
.
__isWeb
,
isAndroid
:
window
.
__isAndroid
,
isIOS
:
window
.
__isIOS
,
bgColor
:
"#fff"
,
isShow
:
false
,
navTitle
:
"选择专业"
,
isShowNavbar
:
true
,
isFixNavbar
:
true
,
pointStyle
:
"activity"
,
tabIndex
:
1
,
joinProjectList
:
[],
// 我的项目
otherProjectList
:
[],
// 全部项目
token
:
""
,
userMobile
:
""
,
needShowBackup
:
false
,
listData
:
[
{
name
:
"中医"
,
list
:
[
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"中医内科学中医内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
,
{
name
:
"妇科"
,
list
:
[
{
name
:
"妇产科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"中医内科学中医内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
,
{
name
:
"内科"
,
list
:
[
{
name
:
"肾内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"肾内科学肾内科学肾内科学肾内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
],
isInfresh
:
false
,
}
;
}
,
computed
:
{
...
mapGetters
([
"userInfo"
])
}
,
components
:
{
CardBanner
,
CommonNavbar
,
Loading
,
CommonTitle
}
,
created
()
{
var
_this
=
this
;
_this
.
crrentModelIndex
=
0
;
window
.
__getUserInfo
=
function
(
param
)
{
_this
.
setUserInfo
(
param
);
_this
.
token
=
param
.
userToken
;
_this
.
checkToken
();
_this
.
userMobile
=
param
.
userMobile
;
_this
.
getListData
();
console
.
log
(
"__getUserInfo"
,
param
);
}
;
_this
.
getUserInfo
();
if
(
__isWeb
)
{
_this
.
getListData
();
}
window
.
__refresh
=
function
()
{
_this
.
isInfresh
=
true
;
_this
.
getUserInfo
();
}
;
// 打开页面埋点
// this.$sendBuriedData(
{
// component_tag: "210#0#0#0"
//
}
);
window
.
addEventListener
(
"scroll"
,
this
.
scrollFun
);
}
,
mounted
()
{
var
_this
=
this
;
this
.
listData
=
[];
}
,
methods
:
{
...
mapActions
([
"setUserInfo"
]),
// 选择职称
selectModel
(
model
,
index
)
{
this
.
crrentModelIndex
=
index
;
this
.
listData
=
this
.
titleTestModelList
[
index
].
firstSubjectModelList
||
[];
}
,
// 跳转到项目页面
coopDetails
(
item
)
{
if
(
item
.
openFlag
==
0
)
return
;
// this.$sendBuriedData(
{
// component_tag: `880#8803#$
{
item
.
id
}#
$
{
item
.
name
}
` //'210#210002#0#'+item.projectName
//
}
);
// 临时添加
if (window.__isWeb) {
this.$router.push({
path: "/coop",
query: {
id: item.projectId
}
}
);
return;
}
let appVersion = this.userInfo.appVersion;
let appVersionNum = appVersion.split(".").join("");
console.log("appVersionNum", appVersionNum);
if (appVersionNum < 341) {
Toast("请您下载新版本App");
return;
}
let paramList = [
{
key: "pageUrl",
value: getWebPageUrl(
`
profexam
/
#
/
coop
?
id
=
$
{
item
.
projectId
}
`
),
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
}
);
}
,
//获取版本号
getUserInfo() {
rocNative.getUserInfo({
__funcName: "__getUserInfo"
}
);
}
,
// 查询列表
getListData() {
let _this = this;
let param = {
token: _this.token,
setEntry: true
}
;
this.showLoading = true;
this.GET(`
portal
/
titleTestApp
/
list
`, param).then(res => {
this.showLoading = false;
if (res.code == "000000") {
this.existBind = res.data.existBind || 0;
this.titleTestModelList = res.data.titleTestModelList;
if(this.existBind) {
this.resetPosition(this.titleTestModelList);
}
this.listData = res.data.titleTestModelList[0].firstSubjectModelList;
}
else {
this.message.error(res.message);
}
}
);
}
,
// 查找对应的职称与专业
resetPosition(list) {
if(!list.length) return;
let parentIndex = 0, subIndex = 0, firstSub = [], secondSub = [];
for(let i = 0; i < list.length; i ++) {
firstSub = list[i].firstSubjectModelList;
for(let j = 0; j < firstSub.length; j ++) {
secondSub = firstSub[j].secondSubjectModelList;
for(let k = 0; k < secondSub.length; k ++) {
if(secondSub[k].bindCardStatus) {
parentIndex = i;
subIndex = k;
break;
}
}
}
}
this.crrentModelIndex = parentIndex;
this.resetProjectPosition(subIndex);
}
,
// 将定位到的元素,滚动到最上面
resetProjectPosition(subIndex) {
this.$nextTick( () => {
setTimeout(() => {
// let scrollTop = this.$refs['subject_' + subIndex].offsetTop;
let scrollTop = document.getElementById('subject_' + subIndex).offsetTop;
console.log(scrollTop);
window.scrollTo(0, scrollTop);
}
, 100);
}
)
}
,
// 监听滚动事件
scrollFun() {
let scrollTop = window.scrollY;
if (scrollTop >= 500) {
this.needShowBackup = true;
}
else {
this.needShowBackup = false;
}
}
,
// 滚动到顶部
scrollTop() {
window.scrollTo(0, 0);
}
,
// 格式化时间
formatTime(time, cFormat) {
return parseTime(time, cFormat)
}
,
// token是否失效校验
checkToken() {
let _this = this;
let param = {
token: _this.userInfo.userToken || _this.token,
setEntry: true
}
;
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
//未登录 跳转登录页
console.log("跳登录", _this.isInfresh);
if(_this.isInfresh) {
rocNative.goBack();
}
else {
rocNative.gotoLogin();
}
_this.isInfresh = false;
}
}
);
}
,
}
}
;
</script>
<style lang="scss" scoped>
@import "../style/mixin";
.page-content {
padding-top: px2rem(74px);
min-height: 100vh;
.body {
min-height: 90vh;
display: flex;
flex-direction: row;
font-size: px2rem(14px);
color: #676869;
.left {
width: px2rem(130px);
background: #f8f9fa;
li {
position: relative;
display: block;
height: px2rem(60px);
line-height: px2rem(60px);
padding-left: px2rem(15px);
&.active {
color: #449284;
background: #fff;
&.active::before {
position: absolute;
left: 0;
top: px2rem(20px);
z-index: 1;
content: "";
height: px2rem(20px);
width: px2rem(3px);
border-radius: px2rem(2px);
background: #449284;
}
}
}
}
.right {
flex: 1;
padding: 0 px2rem(15px) px2rem(30px);
.list-wrapper {
.list {
.title {
display: block;
height: px2rem(35px);
line-height: px2rem(35px);
margin-top: px2rem(14px);
font-size: px2rem(15px);
font-weight: 700;
}
.item {
li {
position: relative;
top: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: column;
// height: px2rem(55px);
padding: px2rem(12px) 0;
margin-bottom: px2rem(6px);
justify-content: center;
text-align: center;
border-radius: px2rem(4px);
background: #f8f9fa;
align-items: center;
span {
display: inline-block;
// height: px2rem(20px);
line-height: px2rem(20px);
padding: 0 px2rem(20px);
}
&.has-bind {
color: #449284;
.buy {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: px2rem(15px);
line-height: px2rem(15px);
padding: 0 px2rem(4px);
border-radius: 0px px2rem(4px) 0px px2rem(4px);
font-size: px2rem(11px);
color: #fff;
background: #449284;
}
}
&.no-active {
color: #c7c8c9;
.time {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: px2rem(15px);
line-height: px2rem(15px);
padding: 0 px2rem(4px);
border-radius: 0px px2rem(4px) 0px px2rem(4px);
opacity: 0.4;
font-size: px2rem(11px);
background: rgba(0, 0, 0, 1);
}
}
}
}
}
.no-list {
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
align-items: center;
margin-top: px2rem(30px);
// width: px2rem(50px);
// height: px2rem(50px);
img {
width: px2rem(100px);
height: px2rem(100px);
}
span {
font-size: px2rem(12px);
color: #c7c8c9;
}
}
}
}
}
}
.back-up-icon {
position: fixed;
bottom: px2rem(50px);
right: px2rem(15px);
img {
width: px2rem(35px);
height: px2rem(35px);
}
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
</style>
src/views/index copy 2.vue
已删除
100644 → 0
浏览文件 @
4e385540
<
template
>
<!-- 专业选择列表 -->
<div
class=
"page-container"
>
<CommonNavbar
:bgColor=
"bgColor"
v-show=
"isShowNavbar"
:title=
"navTitle"
:isFixNavbar=
"isFixNavbar"
:burialPoint=
"pointStyle"
borderStyle=
"1px solid #fff"
></CommonNavbar>
<section
class=
"page-content"
>
<section
v-show=
"!existBind"
class=
"cb-wrapper padding-top-111"
>
<CardBanner
:hasLogin=
"hasLogin"
></CardBanner>
</section>
<section
class=
"body"
>
<ul
class=
"left"
>
<li
v-for=
"(model, mIndex) in titleTestModelList"
:key=
"mIndex"
:class=
"
{active: currentModelIndex == mIndex}"
@click="selectModel(model, mIndex)"
>
<span>
{{
model
.
title
}}
</span>
</li>
</ul>
<article
class=
"right"
>
<ul
class=
"list-wrapper"
>
<li
class=
"list"
v-for=
"(item, index) in listData"
:key=
"index"
>
<span
class=
"title"
>
{{
item
.
name
}}
</span>
<ul
class=
"item"
>
<li
:id=
"'subject_' + sIndex"
:class=
"
{'no-active' : subject.openFlag == 0, 'has-bind' : subject.bindCardStatus == 1}"
v-for="(subject, sIndex) in item.secondSubjectModelList"
:key="sIndex"
@click="coopDetails(subject)"
>
<span>
{{
subject
.
name
}}
</span>
<span>
(
{{
subject
.
code
}}
)
</span>
<span
v-show=
"subject.bindCardStatus == 1"
class=
"buy"
>
己购
</span>
<span
v-show=
"subject.openFlag == 0"
class=
"time"
>
{{
formatTime
(
subject
.
predictTime
,
'{y
}
年{m
}
月'
)
}}
上线
<
/span
>
<
/li
>
<
/ul
>
<
/li
>
<
li
class
=
"no-list"
v
-
show
=
"!listData.length"
>
<
img
src
=
"../images/subject/no-subject.png"
alt
/>
<
span
>
正在更新中,敬请期待
<
/span
>
<
/li
>
<
/ul
>
<
/article
>
<
/section
>
<
/section
>
<
transition
name
=
"fade"
>
<
article
v
-
show
=
"needShowBackup"
@
click
=
"scrollTop"
class
=
"back-up-icon"
>
<
img
src
=
"../images/cme/phrase2/back-top.png"
alt
/>
<
/article
>
<
/transition
>
<
Loading
v
-
if
=
"showLoading"
/>
<
/div
>
<
/template
>
<
script
>
import
CommonNavbar
from
"@/components/common/common-navbar"
;
import
CardBanner
from
"@/components/cme/card-banner"
;
import
Loading
from
"@/components/common/common-loading"
;
import
CommonTitle
from
"@/components/common/common-title"
;
import
{
mapGetters
,
mapActions
}
from
"vuex"
;
import
{
getWebPageUrl
,
parseTime
}
from
"@/utils/index"
;
export
default
{
data
()
{
return
{
existBind
:
0
,
currentModelIndex
:
0
,
titleTestModelList
:
[],
showLoading
:
false
,
isWeb
:
window
.
__isWeb
,
isAndroid
:
window
.
__isAndroid
,
isIOS
:
window
.
__isIOS
,
bgColor
:
"#fff"
,
isShow
:
false
,
navTitle
:
"选择专业"
,
isShowNavbar
:
true
,
isFixNavbar
:
true
,
pointStyle
:
"activity"
,
tabIndex
:
1
,
joinProjectList
:
[],
// 我的项目
otherProjectList
:
[],
// 全部项目
token
:
""
,
userMobile
:
""
,
needShowBackup
:
false
,
listData
:
[
{
name
:
"中医"
,
list
:
[
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"中医内科学中医内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
,
{
name
:
"妇科"
,
list
:
[
{
name
:
"妇产科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"中医内科学中医内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
,
{
name
:
"内科"
,
list
:
[
{
name
:
"肾内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"肾内科学肾内科学肾内科学肾内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
],
isInfresh
:
false
,
hasLogin
:
false
}
;
}
,
computed
:
{
...
mapGetters
([
"userInfo"
])
}
,
components
:
{
CardBanner
,
CommonNavbar
,
Loading
,
CommonTitle
}
,
created
()
{
var
_this
=
this
;
_this
.
currentModelIndex
=
0
;
window
.
__getUserInfo
=
function
(
param
)
{
_this
.
setUserInfo
(
param
);
_this
.
token
=
param
.
userToken
;
_this
.
checkToken
();
_this
.
userMobile
=
param
.
userMobile
;
_this
.
getListData
();
console
.
log
(
"__getUserInfo"
,
param
);
}
;
_this
.
getUserInfo
();
if
(
__isWeb
)
{
_this
.
getListData
();
}
window
.
__refresh
=
function
()
{
_this
.
isInfresh
=
true
;
_this
.
currentModelIndex
=
0
;
console
.
log
(
_this
.
currentModelIndex
);
_this
.
getUserInfo
();
}
;
// 打开页面埋点
// this.$sendBuriedData(
{
// component_tag: "210#0#0#0"
//
}
);
window
.
addEventListener
(
"scroll"
,
this
.
scrollFun
);
}
,
mounted
()
{
this
.
listData
=
[];
this
.
currentModelIndex
=
0
;
}
,
methods
:
{
...
mapActions
([
"setUserInfo"
]),
// 选择职称
selectModel
(
model
,
index
)
{
this
.
currentModelIndex
=
index
;
this
.
listData
=
this
.
titleTestModelList
[
index
].
firstSubjectModelList
||
[];
}
,
// 跳转到项目页面
coopDetails
(
item
)
{
if
(
item
.
openFlag
==
0
)
return
;
// this.$sendBuriedData(
{
// component_tag: `880#8803#$
{
item
.
id
}#
$
{
item
.
name
}
` //'210#210002#0#'+item.projectName
//
}
);
// 临时添加
if (window.__isWeb) {
this.$router.push({
path: "/coop",
query: {
id: item.projectId
}
}
);
return;
}
let appVersion = this.userInfo.appVersion;
let appVersionNum = appVersion.split(".").join("");
console.log("appVersionNum", appVersionNum);
if (appVersionNum < 341) {
Toast("请您下载新版本App");
return;
}
let paramList = [
{
key: "pageUrl",
value: getWebPageUrl(`
profexam
/
#
/
coop
?
id
=
$
{
item
.
projectId
}
`),
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
}
);
}
,
//获取版本号
getUserInfo() {
rocNative.getUserInfo({
__funcName: "__getUserInfo"
}
);
}
,
// 查询列表
getListData() {
let _this = this;
let param = {
token: _this.token,
setEntry: true
}
;
this.showLoading = true;
this.GET(`
portal
/
titleTestApp
/
list
`, param).then(res => {
this.showLoading = false;
if (res.code == "000000") {
this.existBind = res.data.existBind || 0;
this.titleTestModelList = res.data.titleTestModelList;
if (this.existBind) {
this.resetPosition(this.titleTestModelList);
}
else {
this.listData = res.data.titleTestModelList[0].firstSubjectModelList;
}
}
else {
this.message.error(res.message);
}
}
);
}
,
// 查找对应的职称与专业
resetPosition(list) {
if (!list.length) return;
let parentIndex = 0,
subIndex = 0,
firstSub = [],
secondSub = [];
for (let i = 0; i < list.length; i++) {
firstSub = list[i].firstSubjectModelList;
for (let j = 0; j < firstSub.length; j++) {
secondSub = firstSub[j].secondSubjectModelList;
for (let k = 0; k < secondSub.length; k++) {
if (secondSub[k].bindCardStatus) {
parentIndex = i;
subIndex = k;
break;
}
}
}
}
this.currentModelIndex = parentIndex;
this.listData = this.titleTestModelList[parentIndex].firstSubjectModelList || [];
console.log('查找对应的职称与专业', this.currentModelIndex, this.listData);
this.$forceUpdate();
this.resetProjectPosition(subIndex);
}
,
// 将定位到的元素,滚动到最上面
resetProjectPosition(subIndex) {
this.$nextTick(() => {
setTimeout(() => {
// let scrollTop = this.$refs['subject_' + subIndex].offsetTop;
let scrollTop = document.getElementById("subject_" + subIndex)
.offsetTop;
console.log(scrollTop);
window.scrollTo(0, scrollTop);
}
, 100);
}
);
}
,
// 监听滚动事件
scrollFun() {
let scrollTop = window.scrollY;
if (scrollTop >= 500) {
this.needShowBackup = true;
}
else {
this.needShowBackup = false;
}
}
,
// 滚动到顶部
scrollTop() {
window.scrollTo(0, 0);
}
,
// 格式化时间
formatTime(time, cFormat) {
return parseTime(time, cFormat);
}
,
// token是否失效校验
checkToken() {
let _this = this;
let param = {
token: _this.userInfo.userToken || _this.token,
setEntry: true
}
;
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
//未登录 跳转登录页
console.log("跳登录", _this.isInfresh);
if (_this.isInfresh) {
rocNative.goBack();
}
else {
rocNative.gotoLogin();
}
_this.isInfresh = false;
}
else {
_this.hasLogin = true;
}
}
);
}
}
}
;
</script>
<style lang="scss" scoped>
@import "../style/mixin";
.page-content {
padding-top: px2rem(74px);
min-height: 100vh;
.body {
min-height: 90vh;
display: flex;
flex-direction: row;
font-size: px2rem(14px);
color: #676869;
.left {
width: px2rem(130px);
background: #f8f9fa;
li {
position: relative;
display: block;
height: px2rem(60px);
line-height: px2rem(60px);
padding-left: px2rem(15px);
&.active {
color: #449284;
background: #fff;
&.active::before {
position: absolute;
left: 0;
top: px2rem(20px);
z-index: 1;
content: "";
height: px2rem(20px);
width: px2rem(3px);
border-radius: px2rem(2px);
background: #449284;
}
}
}
}
.right {
flex: 1;
padding: 0 px2rem(15px) px2rem(30px);
.list-wrapper {
.list {
.title {
display: block;
height: px2rem(35px);
line-height: px2rem(35px);
margin-top: px2rem(14px);
font-size: px2rem(15px);
font-weight: 700;
}
.item {
li {
position: relative;
top: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: column;
// height: px2rem(55px);
padding: px2rem(12px) 0;
margin-bottom: px2rem(6px);
justify-content: center;
text-align: center;
border-radius: px2rem(4px);
background: #f8f9fa;
align-items: center;
span {
display: inline-block;
// height: px2rem(20px);
line-height: px2rem(20px);
padding: 0 px2rem(20px);
}
&.has-bind {
color: #449284;
background: rgba(68, 146, 132, 0.1);
.buy {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: px2rem(15px);
line-height: px2rem(15px);
padding: 0 px2rem(4px);
border-radius: 0px px2rem(4px) 0px px2rem(4px);
font-size: px2rem(11px);
color: #fff;
background: #449284;
}
}
&.no-active {
color: #c7c8c9;
.time {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: px2rem(15px);
line-height: px2rem(15px);
padding: 0 px2rem(4px);
border-radius: 0px px2rem(4px) 0px px2rem(4px);
opacity: 0.4;
font-size: px2rem(11px);
background: rgba(0, 0, 0, 1);
}
}
}
}
}
.no-list {
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
align-items: center;
margin-top: px2rem(30px);
// width: px2rem(50px);
// height: px2rem(50px);
img {
width: px2rem(100px);
height: px2rem(100px);
}
span {
font-size: px2rem(12px);
color: #c7c8c9;
}
}
}
}
}
}
.back-up-icon {
position: fixed;
bottom: px2rem(50px);
right: px2rem(15px);
img {
width: px2rem(35px);
height: px2rem(35px);
}
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
</style>
src/views/index copy 3.vue
已删除
100644 → 0
浏览文件 @
4e385540
<
template
>
<!-- 专业选择列表 -->
<div
class=
"page-container"
>
<CommonNavbar
:bgColor=
"bgColor"
v-show=
"isShowNavbar"
:title=
"navTitle"
:isFixNavbar=
"isFixNavbar"
:burialPoint=
"pointStyle"
borderStyle=
"1px solid #fff"
></CommonNavbar>
<section
class=
"page-content"
>
<section
v-show=
"!existBind"
class=
"cb-wrapper padding-top-111"
>
<CardBanner
:hasLogin=
"hasLogin"
></CardBanner>
</section>
<section
class=
"body"
:class=
"
{'body-pt': !existBind}">
<ul
class=
"left fixed"
:class=
"
{'top': !existBind}">
<li
v-for=
"(model, mIndex) in titleTestModelList"
:key=
"mIndex"
:class=
"
{active: currentModelIndex == mIndex}"
@click="selectModel(model, mIndex)"
>
<span>
{{
model
.
title
}}
</span>
</li>
</ul>
<ul
class=
"left"
>
<!--
<li
v-for=
"(model, mIndex) in titleTestModelList"
:key=
"mIndex"
:class=
"
{active: currentModelIndex == mIndex}"
@click="selectModel(model, mIndex)"
>
<span>
{{
model
.
title
}}
</span>
</li>
-->
</ul>
<article
class=
"right"
>
<ul
class=
"list-wrapper"
>
<li
class=
"list"
v-for=
"(item, index) in listData"
:key=
"index"
>
<span
class=
"title"
>
{{
item
.
name
}}
</span>
<ul
class=
"item"
>
<li
:id=
"'subject_' + index + '_' + sIndex"
:class=
"
{'no-active' : subject.openFlag == 0, 'has-bind' : subject.bindCardStatus == 1}"
v-for="(subject, sIndex) in item.secondSubjectModelList"
:key="sIndex"
@click="coopDetails(subject)"
>
<span>
{{
subject
.
name
}}
</span>
<span>
(
{{
subject
.
code
}}
)
</span>
<span
v-show=
"subject.bindCardStatus == 1"
class=
"buy"
>
己购
</span>
<span
v-show=
"subject.openFlag == 0"
class=
"time"
>
{{
formatTime
(
subject
.
predictTime
,
'{y
}
年{m
}
月'
)
}}
上线
<
/span
>
<
/li
>
<
/ul
>
<
/li
>
<
li
class
=
"no-list"
v
-
show
=
"!listData.length"
>
<
img
src
=
"../images/subject/no-subject.png"
alt
/>
<
span
>
正在更新中,敬请期待
<
/span
>
<
/li
>
<
/ul
>
<
/article
>
<
/section
>
<!--
<
section
class
=
"body"
>
<
ul
class
=
"left-fixed"
>
<
li
v
-
for
=
"(model, mIndex) in titleTestModelList"
:
key
=
"mIndex"
:
class
=
"{active: currentModelIndex == mIndex
}
"
@
click
=
"selectModel(model, mIndex)"
>
<
span
>
{{
model
.
title
}}
<
/span
>
<
/li
>
<
/ul>
<
/section> --
>
<
/section
>
<
transition
name
=
"fade"
>
<
article
v
-
show
=
"needShowBackup"
@
click
=
"scrollTop"
class
=
"back-up-icon"
>
<
img
src
=
"../images/cme/phrase2/back-top.png"
alt
/>
<
/article
>
<
/transition
>
<
Loading
v
-
if
=
"showLoading"
/>
<
/div
>
<
/template
>
<
script
>
import
CommonNavbar
from
"@/components/common/common-navbar"
;
import
CardBanner
from
"@/components/cme/card-banner"
;
import
Loading
from
"@/components/common/common-loading"
;
import
CommonTitle
from
"@/components/common/common-title"
;
import
{
mapGetters
,
mapActions
}
from
"vuex"
;
import
{
getWebPageUrl
,
parseTime
}
from
"@/utils/index"
;
export
default
{
data
()
{
return
{
existBind
:
0
,
currentModelIndex
:
0
,
titleTestModelList
:
[],
showLoading
:
false
,
isWeb
:
window
.
__isWeb
,
isAndroid
:
window
.
__isAndroid
,
isIOS
:
window
.
__isIOS
,
bgColor
:
"#fff"
,
isShow
:
false
,
navTitle
:
"选择专业"
,
isShowNavbar
:
true
,
isFixNavbar
:
true
,
pointStyle
:
"activity"
,
tabIndex
:
1
,
joinProjectList
:
[],
// 我的项目
otherProjectList
:
[],
// 全部项目
token
:
""
,
userMobile
:
""
,
needShowBackup
:
false
,
listData
:
[
{
name
:
"中医"
,
list
:
[
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"中医内科学中医内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
,
{
name
:
"妇科"
,
list
:
[
{
name
:
"妇产科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"中医内科学中医内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
,
{
name
:
"内科"
,
list
:
[
{
name
:
"肾内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"肾内科学肾内科学肾内科学肾内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
],
isInfresh
:
false
,
hasLogin
:
false
,
hasResetPosition
:
false
,
}
;
}
,
computed
:
{
...
mapGetters
([
"userInfo"
])
}
,
components
:
{
CardBanner
,
CommonNavbar
,
Loading
,
CommonTitle
}
,
created
()
{
var
_this
=
this
;
_this
.
currentModelIndex
=
0
;
window
.
__getUserInfo
=
function
(
param
)
{
_this
.
setUserInfo
(
param
);
_this
.
token
=
param
.
userToken
;
_this
.
checkToken
();
_this
.
userMobile
=
param
.
userMobile
;
_this
.
getListData
();
console
.
log
(
"__getUserInfo"
,
param
);
}
;
_this
.
getUserInfo
();
if
(
__isWeb
)
{
_this
.
getListData
();
}
window
.
__refresh
=
function
()
{
_this
.
isInfresh
=
true
;
_this
.
currentModelIndex
=
0
;
console
.
log
(
_this
.
currentModelIndex
);
_this
.
getUserInfo
();
}
;
// 打开页面埋点
// this.$sendBuriedData(
{
// component_tag: "210#0#0#0"
//
}
);
window
.
addEventListener
(
"scroll"
,
this
.
scrollFun
);
}
,
mounted
()
{
this
.
listData
=
[];
this
.
currentModelIndex
=
0
;
}
,
methods
:
{
...
mapActions
([
"setUserInfo"
]),
// 选择职称
selectModel
(
model
,
index
)
{
this
.
currentModelIndex
=
index
;
this
.
listData
=
this
.
titleTestModelList
[
index
].
firstSubjectModelList
||
[];
}
,
// 跳转到项目页面
coopDetails
(
item
)
{
if
(
item
.
openFlag
==
0
)
return
;
// this.$sendBuriedData(
{
// component_tag: `880#8803#$
{
item
.
id
}#
$
{
item
.
name
}
` //'210#210002#0#'+item.projectName
//
}
);
// 临时添加
if (window.__isWeb) {
this.$router.push({
path: "/coop",
query: {
id: item.projectId
}
}
);
return;
}
let appVersion = this.userInfo.appVersion;
let appVersionNum = appVersion.split(".").join("");
console.log("appVersionNum", appVersionNum);
if (appVersionNum < 341) {
Toast("请您下载新版本App");
return;
}
let paramList = [
{
key: "pageUrl",
value: getWebPageUrl(`
profexam
/
#
/
coop
?
id
=
$
{
item
.
projectId
}
`),
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
}
);
}
,
//获取版本号
getUserInfo() {
rocNative.getUserInfo({
__funcName: "__getUserInfo"
}
);
}
,
// 查询列表
getListData() {
let _this = this;
let param = {
token: _this.token,
setEntry: true
}
;
this.showLoading = true;
this.GET(`
portal
/
titleTestApp
/
list
`, param).then(res => {
this.showLoading = false;
if (res.code == "000000") {
this.existBind = res.data.existBind || 0;
this.titleTestModelList = res.data.titleTestModelList;
if (this.existBind && !this.hasResetPosition) {
this.hasResetPosition = true;
this.resetPosition(this.titleTestModelList);
}
else {
this.listData = res.data.titleTestModelList[0].firstSubjectModelList;
}
}
else {
this.message.error(res.message);
}
}
);
}
,
// 查找对应的职称与专业
resetPosition(list) {
if (!list.length) return;
let parentIndex = 0,
fIndex = 0,
subIndex = 0,
firstSub = [],
secondSub = [];
flag = false;
outloop: for (let i = 0; i < list.length; i++) {
if(flag) break;
firstSub = list[i].firstSubjectModelList;
for (let j = 0; j < firstSub.length; j++) {
secondSub = firstSub[j].secondSubjectModelList;
for (let k = 0; k < secondSub.length; k++) {
if (secondSub[k].bindCardStatus) {
parentIndex = i;
fIndex = j;
subIndex = k;
flag = true;
break outloop;
}
}
}
}
this.currentModelIndex = parentIndex;
this.listData = this.titleTestModelList[parentIndex].firstSubjectModelList || [];
console.log('查找对应的职称与专业', this.currentModelIndex, this.listData);
this.$forceUpdate();
this.resetProjectPosition(fIndex, subIndex);
}
,
// 将定位到的元素,滚动到最上面
resetProjectPosition(fIndex, subIndex) {
this.$nextTick(() => {
setTimeout(() => {
// let scrollTop = this.$refs['subject_' + subIndex].offsetTop;
let scrollTop = document.getElementById(`
subject_$
{
fIndex
}
_$
{
subIndex
}
`).offsetTop;
console.log('in resetProjectPosition', scrollTop);
window.scrollTo(0, scrollTop - 74);
}
, 100);
}
);
}
,
// 监听滚动事件
scrollFun() {
let scrollTop = window.scrollY;
if (scrollTop >= 500) {
this.needShowBackup = true;
}
else {
this.needShowBackup = false;
}
}
,
// 滚动到顶部
scrollTop() {
window.scrollTo(0, 0);
}
,
// 格式化时间
formatTime(time, cFormat) {
return parseTime(time, cFormat);
}
,
// token是否失效校验
checkToken() {
let _this = this;
let param = {
token: _this.userInfo.userToken || _this.token,
setEntry: true
}
;
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
//未登录 跳转登录页
console.log("跳登录", _this.isInfresh);
if (_this.isInfresh) {
rocNative.goBack();
}
else {
rocNative.gotoLogin();
}
_this.isInfresh = false;
}
else {
_this.hasLogin = true;
}
}
);
}
}
}
;
</script>
<style lang="scss" scoped>
@import "../style/mixin";
.page-content {
padding-top: px2rem(74px);
min-height: 100vh;
.body {
// min-height: 90vh;
display: flex;
flex-direction: row;
font-size: px2rem(14px);
color: #676869;
&.body-pt {
padding-top: px2rem(40px);
}
.left {
width: px2rem(130px);
background: #fff;
li {
position: relative;
display: block;
height: px2rem(60px);
line-height: px2rem(60px);
padding-left: px2rem(15px);
&.active {
color: #449284;
background: #fff;
&.active::before {
position: absolute;
left: 0;
top: px2rem(20px);
z-index: 1;
content: "";
height: px2rem(20px);
width: px2rem(3px);
border-radius: px2rem(2px);
background: #449284;
}
}
}
&.fixed {
position: fixed;
top: px2rem(74px);
left: 0;
bottom: 0;
right: px2rem(130px);
z-index: 1;
background: #f8f9fa;
&.top {
top: px2rem(114px);
}
}
}
.right {
flex: 1;
padding: 0 px2rem(15px) px2rem(30px);
.list-wrapper {
.list {
.title {
display: block;
height: px2rem(35px);
line-height: px2rem(35px);
margin-top: px2rem(14px);
font-size: px2rem(15px);
font-weight: 700;
}
.item {
li {
position: relative;
top: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: column;
// height: px2rem(55px);
padding: px2rem(12px) 0;
margin-bottom: px2rem(6px);
justify-content: center;
text-align: center;
border-radius: px2rem(4px);
background: #f8f9fa;
align-items: center;
span {
display: inline-block;
// height: px2rem(20px);
line-height: px2rem(20px);
padding: 0 px2rem(20px);
}
&.has-bind {
color: #449284;
background: rgba(68, 146, 132, 0.1);
.buy {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: px2rem(15px);
line-height: px2rem(15px);
padding: 0 px2rem(4px);
border-radius: 0px px2rem(4px) 0px px2rem(4px);
font-size: px2rem(11px);
color: #fff;
background: #449284;
}
}
&.no-active {
color: #c7c8c9;
.time {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: px2rem(15px);
line-height: px2rem(15px);
padding: 0 px2rem(4px);
border-radius: 0px px2rem(4px) 0px px2rem(4px);
opacity: 0.4;
font-size: px2rem(11px);
background: rgba(0, 0, 0, 1);
}
}
}
}
}
.no-list {
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
align-items: center;
margin-top: px2rem(30px);
// width: px2rem(50px);
// height: px2rem(50px);
img {
width: px2rem(100px);
height: px2rem(100px);
}
span {
font-size: px2rem(12px);
color: #c7c8c9;
}
}
}
}
}
.cb-wrapper {
position: fixed;
z-index: 2;
width: 100%;
}
}
.back-up-icon {
position: fixed;
bottom: px2rem(50px);
right: px2rem(15px);
img {
width: px2rem(35px);
height: px2rem(35px);
}
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
</style>
src/views/index copy 4.vue
已删除
100644 → 0
浏览文件 @
4e385540
<
template
>
<!-- 专业选择列表 -->
<div
class=
"page-container"
>
<CommonNavbar
:bgColor=
"bgColor"
v-show=
"isShowNavbar"
:title=
"navTitle"
:isFixNavbar=
"isFixNavbar"
:burialPoint=
"pointStyle"
borderStyle=
"1px solid #fff"
></CommonNavbar>
<section
class=
"page-content"
>
<section
v-show=
"!existBind"
class=
"cb-wrapper padding-top-111"
>
<CardBanner
:hasLogin=
"hasLogin"
></CardBanner>
</section>
<section
class=
"body"
:class=
"
{'body-pt': !existBind}">
<ul
class=
"left fixed"
:class=
"
{'top': !existBind}">
<li
v-for=
"(model, mIndex) in titleTestModelList"
:key=
"mIndex"
:class=
"
{active: currentModelIndex == mIndex}"
@click="selectModel(model, mIndex)"
>
<span>
{{
model
.
title
}}
</span>
</li>
</ul>
<ul
class=
"left"
>
<!--
<li
v-for=
"(model, mIndex) in titleTestModelList"
:key=
"mIndex"
:class=
"
{active: currentModelIndex == mIndex}"
@click="selectModel(model, mIndex)"
>
<span>
{{
model
.
title
}}
</span>
</li>
-->
</ul>
<article
class=
"right"
>
<ul
class=
"list-wrapper"
>
<li
class=
"list"
v-for=
"(item, index) in listData"
:key=
"index"
>
<span
class=
"title"
>
{{
item
.
name
}}
</span>
<ul
class=
"item"
>
<li
:id=
"'subject_' + index + '_' + sIndex"
:class=
"
{'no-active' : subject.openFlag == 0, 'has-bind' : subject.bindCardStatus == 1}"
v-for="(subject, sIndex) in item.secondSubjectModelList"
:key="sIndex"
@click="coopDetails(subject)"
>
<span>
{{
subject
.
name
}}
</span>
<span>
(
{{
subject
.
code
}}
)
</span>
<span
v-show=
"subject.bindCardStatus == 1"
class=
"buy"
>
己购
</span>
<span
v-show=
"subject.openFlag == 0"
class=
"time"
>
{{
formatTime
(
subject
.
predictTime
,
'{y
}
年{m
}
月'
)
}}
上线
<
/span
>
<
/li
>
<
/ul
>
<
/li
>
<
li
class
=
"no-list"
v
-
show
=
"!listData.length"
>
<
img
src
=
"../images/subject/no-subject.png"
alt
/>
<
span
>
正在更新中,敬请期待
<
/span
>
<
/li
>
<
/ul
>
<
/article
>
<
/section
>
<!--
<
section
class
=
"body"
>
<
ul
class
=
"left-fixed"
>
<
li
v
-
for
=
"(model, mIndex) in titleTestModelList"
:
key
=
"mIndex"
:
class
=
"{active: currentModelIndex == mIndex
}
"
@
click
=
"selectModel(model, mIndex)"
>
<
span
>
{{
model
.
title
}}
<
/span
>
<
/li
>
<
/ul>
<
/section> --
>
<
/section
>
<
transition
name
=
"fade"
>
<
article
v
-
show
=
"needShowBackup"
@
click
=
"scrollTop"
class
=
"back-up-icon"
>
<
img
src
=
"../images/cme/phrase2/back-top.png"
alt
/>
<
/article
>
<
/transition
>
<
Loading
v
-
if
=
"showLoading"
/>
<
/div
>
<
/template
>
<
script
>
import
CommonNavbar
from
"@/components/common/common-navbar"
;
import
CardBanner
from
"@/components/cme/card-banner"
;
import
Loading
from
"@/components/common/common-loading"
;
import
CommonTitle
from
"@/components/common/common-title"
;
import
{
mapGetters
,
mapActions
}
from
"vuex"
;
import
{
getWebPageUrl
,
parseTime
}
from
"@/utils/index"
;
export
default
{
data
()
{
return
{
existBind
:
0
,
currentModelIndex
:
0
,
titleTestModelList
:
[],
showLoading
:
false
,
isWeb
:
window
.
__isWeb
,
isAndroid
:
window
.
__isAndroid
,
isIOS
:
window
.
__isIOS
,
bgColor
:
"#fff"
,
isShow
:
false
,
navTitle
:
"选择专业"
,
isShowNavbar
:
true
,
isFixNavbar
:
true
,
pointStyle
:
"activity"
,
tabIndex
:
1
,
joinProjectList
:
[],
// 我的项目
otherProjectList
:
[],
// 全部项目
token
:
""
,
userMobile
:
""
,
needShowBackup
:
false
,
listData
:
[
{
name
:
"中医"
,
list
:
[
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"中医内科学中医内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
,
{
name
:
"妇科"
,
list
:
[
{
name
:
"妇产科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"中医内科学中医内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
,
{
name
:
"内科"
,
list
:
[
{
name
:
"肾内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"肾内科学肾内科学肾内科学肾内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
],
isInfresh
:
false
,
hasLogin
:
false
,
hasResetPosition
:
false
,
}
;
}
,
computed
:
{
...
mapGetters
([
"userInfo"
])
}
,
components
:
{
CardBanner
,
CommonNavbar
,
Loading
,
CommonTitle
}
,
created
()
{
var
_this
=
this
;
_this
.
currentModelIndex
=
0
;
window
.
__getUserInfo
=
function
(
param
)
{
_this
.
setUserInfo
(
param
);
_this
.
token
=
param
.
userToken
;
_this
.
checkToken
();
_this
.
userMobile
=
param
.
userMobile
;
_this
.
getListData
();
console
.
log
(
"__getUserInfo"
,
param
);
}
;
_this
.
getUserInfo
();
if
(
__isWeb
)
{
_this
.
getListData
();
}
window
.
__refresh
=
function
()
{
_this
.
isInfresh
=
true
;
_this
.
currentModelIndex
=
0
;
console
.
log
(
_this
.
currentModelIndex
);
_this
.
getUserInfo
();
}
;
// 打开页面埋点
// this.$sendBuriedData(
{
// component_tag: "210#0#0#0"
//
}
);
window
.
addEventListener
(
"scroll"
,
this
.
scrollFun
);
}
,
mounted
()
{
this
.
listData
=
[];
this
.
currentModelIndex
=
0
;
}
,
methods
:
{
...
mapActions
([
"setUserInfo"
]),
// 选择职称
selectModel
(
model
,
index
)
{
this
.
currentModelIndex
=
index
;
this
.
listData
=
this
.
titleTestModelList
[
index
].
firstSubjectModelList
||
[];
}
,
// 跳转到项目页面
coopDetails
(
item
)
{
if
(
item
.
openFlag
==
0
)
return
;
// this.$sendBuriedData(
{
// component_tag: `880#8803#$
{
item
.
id
}#
$
{
item
.
name
}
` //'210#210002#0#'+item.projectName
//
}
);
// 临时添加
if (window.__isWeb) {
this.$router.push({
path: "/coop",
query: {
id: item.projectId
}
}
);
return;
}
let appVersion = this.userInfo.appVersion;
let appVersionNum = appVersion.split(".").join("");
console.log("appVersionNum", appVersionNum);
if (appVersionNum < 341) {
Toast("请您下载新版本App");
return;
}
let paramList = [
{
key: "pageUrl",
value: getWebPageUrl(`
profexam
/
#
/
coop
?
id
=
$
{
item
.
projectId
}
`),
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
}
);
}
,
//获取版本号
getUserInfo() {
rocNative.getUserInfo({
__funcName: "__getUserInfo"
}
);
}
,
// 查询列表
getListData() {
let _this = this;
let param = {
token: _this.token,
setEntry: true
}
;
this.showLoading = true;
this.GET(`
portal
/
titleTestApp
/
list
`, param).then(res => {
this.showLoading = false;
if (res.code == "000000") {
this.existBind = res.data.existBind || 0;
this.titleTestModelList = res.data.titleTestModelList;
if (this.existBind && !this.hasResetPosition) {
this.hasResetPosition = true;
this.resetPosition(this.titleTestModelList);
}
else {
this.listData = res.data.titleTestModelList[0].firstSubjectModelList;
}
}
else {
this.message.error(res.message);
}
}
);
}
,
// 查找对应的职称与专业
resetPosition(list) {
if (!list.length) return;
let parentIndex = 0,
fIndex = 0,
subIndex = 0,
firstSub = [],
secondSub = [];
// flag = false;
outloop: for (let i = 0; i < list.length; i++) {
// if(flag) break;
firstSub = list[i].firstSubjectModelList;
for (let j = 0; j < firstSub.length; j++) {
secondSub = firstSub[j].secondSubjectModelList;
for (let k = 0; k < secondSub.length; k++) {
if (secondSub[k].bindCardStatus) {
parentIndex = i;
fIndex = j;
subIndex = k;
// flag = true;
break outloop;
}
}
}
}
this.currentModelIndex = parentIndex;
this.listData = this.titleTestModelList[parentIndex].firstSubjectModelList || [];
console.log('查找对应的职称与专业', this.currentModelIndex, this.listData);
this.$forceUpdate();
this.resetProjectPosition(fIndex, subIndex);
}
,
// 将定位到的元素,滚动到最上面
resetProjectPosition(fIndex, subIndex) {
this.$nextTick(() => {
setTimeout(() => {
// let scrollTop = this.$refs['subject_' + subIndex].offsetTop;
let scrollTop = document.getElementById(`
subject_$
{
fIndex
}
_$
{
subIndex
}
`).offsetTop;
console.log('in resetProjectPosition', scrollTop);
window.scrollTo(0, scrollTop - 74);
}
, 100);
}
);
}
,
// 监听滚动事件
scrollFun() {
let scrollTop = window.scrollY;
if (scrollTop >= 500) {
this.needShowBackup = true;
}
else {
this.needShowBackup = false;
}
}
,
// 滚动到顶部
scrollTop() {
window.scrollTo(0, 0);
}
,
// 格式化时间
formatTime(time, cFormat) {
return parseTime(time, cFormat);
}
,
// token是否失效校验
checkToken() {
let _this = this;
let param = {
token: _this.userInfo.userToken || _this.token,
setEntry: true
}
;
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
//未登录 跳转登录页
console.log("跳登录", _this.isInfresh);
if (_this.isInfresh) {
rocNative.goBack();
}
else {
rocNative.gotoLogin();
}
_this.isInfresh = false;
}
else {
_this.hasLogin = true;
}
}
);
}
}
}
;
</script>
<style lang="scss" scoped>
@import "../style/mixin";
.page-content {
padding-top: px2rem(74px);
min-height: 100vh;
.body {
// min-height: 90vh;
display: flex;
flex-direction: row;
font-size: px2rem(14px);
color: #676869;
&.body-pt {
padding-top: px2rem(40px);
}
.left {
width: px2rem(130px);
background: #fff;
li {
position: relative;
display: block;
height: px2rem(60px);
line-height: px2rem(60px);
padding-left: px2rem(15px);
&.active {
color: #449284;
background: #fff;
&.active::before {
position: absolute;
left: 0;
top: px2rem(20px);
z-index: 1;
content: "";
height: px2rem(20px);
width: px2rem(3px);
border-radius: px2rem(2px);
background: #449284;
}
}
}
&.fixed {
position: fixed;
top: px2rem(74px);
left: 0;
bottom: 0;
right: px2rem(130px);
z-index: 1;
background: #f8f9fa;
&.top {
top: px2rem(114px);
}
}
}
.right {
flex: 1;
padding: 0 px2rem(15px) px2rem(30px);
.list-wrapper {
.list {
.title {
display: block;
height: px2rem(35px);
line-height: px2rem(35px);
margin-top: px2rem(14px);
font-size: px2rem(15px);
font-weight: 700;
}
.item {
li {
position: relative;
top: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: column;
// height: px2rem(55px);
padding: px2rem(12px) 0;
margin-bottom: px2rem(6px);
justify-content: center;
text-align: center;
border-radius: px2rem(4px);
background: #f8f9fa;
align-items: center;
span {
display: inline-block;
// height: px2rem(20px);
line-height: px2rem(20px);
padding: 0 px2rem(20px);
}
&.has-bind {
color: #449284;
background: rgba(68, 146, 132, 0.1);
.buy {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: px2rem(15px);
line-height: px2rem(15px);
padding: 0 px2rem(4px);
border-radius: 0px px2rem(4px) 0px px2rem(4px);
font-size: px2rem(11px);
color: #fff;
background: #449284;
}
}
&.no-active {
color: #c7c8c9;
.time {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: px2rem(15px);
line-height: px2rem(15px);
padding: 0 px2rem(4px);
border-radius: 0px px2rem(4px) 0px px2rem(4px);
opacity: 0.4;
font-size: px2rem(11px);
background: rgba(0, 0, 0, 1);
}
}
}
}
}
.no-list {
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
align-items: center;
margin-top: px2rem(30px);
// width: px2rem(50px);
// height: px2rem(50px);
img {
width: px2rem(100px);
height: px2rem(100px);
}
span {
font-size: px2rem(12px);
color: #c7c8c9;
}
}
}
}
}
.cb-wrapper {
position: fixed;
z-index: 2;
width: 100%;
}
}
.back-up-icon {
position: fixed;
bottom: px2rem(50px);
right: px2rem(15px);
img {
width: px2rem(35px);
height: px2rem(35px);
}
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
</style>
src/views/index copy.vue
浏览文件 @
1457f765
<
template
>
<!-- 专
项合作首页: 我参与的,其它项目
-->
<!-- 专
业选择列表
-->
<div
class=
"page-container"
>
<CommonNavbar
:bgColor=
"bgColor"
...
...
@@ -10,62 +10,73 @@
borderStyle=
"1px solid #fff"
></CommonNavbar>
<section
class=
"page-content"
>
<table
class=
"page-content-table"
>
<tr>
<td
@
click=
"changeTab(1)"
:class=
"
{'active': tabIndex === 1}">
<div
class=
"tap-title"
>
<span
:style=
"
{'color': tabIndex === 1 ? '#333' : '#999'}">我的项目
</span>
<span
:class=
"
{'android': isAndroid, 'ios': isIOS}">
</span>
</div>
</td>
<td
@
click=
"changeTab(2)"
:class=
"
{'active': tabIndex === 2}">
<div
class=
"tap-title"
>
<span
:style=
"
{'color': tabIndex === 2 ? '#333' : '#999'}">全部项目
</span>
<span
:class=
"
{'android': isAndroid, 'ios': isIOS}">
</span>
</div>
</td>
</tr>
</table>
<!--
<article
v-show=
"isShow"
class=
"cb-wrapper"
:class=
"
{'padding-top-111': !isWeb}">
<CardBanner
:userMobile=
"userMobile"
></CardBanner>
</article>
-->
<article
class=
"page-content-list"
>
<CommonTitle
title=
"国家级继续医学教育项目(远程)"
:isShowCert=
"false"
></CommonTitle>
<ICardItem
:oneLevelUrl=
"oneLevelUrl"
:provinceId=
"provinceId"
:organizationId=
"organizationId"
:cmeToken=
"token"
></ICardItem>
<CommonTitle
class=
"mt-10"
v-show=
"isShow && ((tabIndex === 1 && joinProjectList.length) || (tabIndex === 2 && otherProjectList.length))"
:title=
"tabIndex === 1 ? '我的继续医学教育课程' : '继续医学教育课程'"
:isShowCert=
"false"
/>
<section
v-if=
"tabIndex === 1"
>
<CoopListItem
:paramData=
"joinProjectList"
:coopType=
"1"
:tabTo=
"1"
:isShow=
"isShow"
:userMobile=
"userMobile"
:provinceId=
"provinceId"
:organizationId=
"organizationId"
></CoopListItem>
</section>
<section
v-if=
"tabIndex === 2"
>
<CoopListItem
:paramData=
"otherProjectList"
:coopType=
"1"
:tabTo=
"2"
:isShow=
"isShow"
:userMobile=
"userMobile"
:provinceId=
"provinceId"
:organizationId=
"organizationId"
></CoopListItem>
</section>
</article>
<section
v-show=
"!existBind"
class=
"cb-wrapper padding-top-111"
>
<CardBanner
:hasLogin=
"hasLogin"
></CardBanner>
</section>
<section
class=
"body"
:class=
"
{'body-pt': !existBind}">
<ul
class=
"left fixed"
:class=
"
{'top': !existBind}">
<li
v-for=
"(model, mIndex) in titleTestModelList"
:key=
"mIndex"
:class=
"
{active: currentModelIndex == mIndex}"
@click="selectModel(model, mIndex)"
>
<span>
{{
model
.
title
}}
</span>
</li>
</ul>
<ul
class=
"left"
>
<!--
<li
v-for=
"(model, mIndex) in titleTestModelList"
:key=
"mIndex"
:class=
"
{active: currentModelIndex == mIndex}"
@click="selectModel(model, mIndex)"
>
<span>
{{
model
.
title
}}
</span>
</li>
-->
</ul>
<article
class=
"right"
>
<ul
class=
"list-wrapper"
>
<li
class=
"list"
v-for=
"(item, index) in listData"
:key=
"index"
>
<span
class=
"title"
>
{{
item
.
name
}}
</span>
<ul
class=
"item"
>
<li
:id=
"'subject_' + index + '_' + sIndex"
:class=
"
{'no-active' : subject.openFlag == 0, 'has-bind' : subject.bindCardStatus == 1}"
v-for="(subject, sIndex) in item.secondSubjectModelList"
:key="sIndex"
@click="coopDetails(subject)"
>
<span>
{{
subject
.
name
}}
</span>
<span>
(
{{
subject
.
code
}}
)
</span>
<span
v-show=
"subject.bindCardStatus == 1"
class=
"buy"
>
己购
</span>
<span
v-show=
"subject.openFlag == 0"
class=
"time"
>
{{
formatTime
(
subject
.
predictTime
,
'{y
}
年{m
}
月'
)
}}
上线
<
/span
>
<
/li
>
<
/ul
>
<
/li
>
<
li
class
=
"no-list"
v
-
show
=
"!listData.length"
>
<
img
src
=
"../images/subject/no-subject.png"
alt
/>
<
span
>
正在更新中,敬请期待
<
/span
>
<
/li
>
<
/ul
>
<
/article
>
<
/section
>
<!--
<
section
class
=
"body"
>
<
ul
class
=
"left-fixed"
>
<
li
v
-
for
=
"(model, mIndex) in titleTestModelList"
:
key
=
"mIndex"
:
class
=
"{active: currentModelIndex == mIndex
}
"
@
click
=
"selectModel(model, mIndex)"
>
<
span
>
{{
model
.
title
}}
<
/span
>
<
/li
>
<
/ul>
<
/section> --
>
<
/section
>
<!--
<div>
<iframe
src=
"https://www.baidu.com"
id=
"mobsf"
frameborder=
"0"
style=
"width:100%;height:500px;"
></iframe>
</div>
-->
<!--
<discuss-topic-stencil
/>
-->
<
transition
name
=
"fade"
>
<
article
v
-
show
=
"needShowBackup"
@
click
=
"scrollTop"
class
=
"back-up-icon"
>
<
img
src
=
"../images/cme/phrase2/back-top.png"
alt
/>
...
...
@@ -76,69 +87,98 @@
<
/template
>
<
script
>
import
CommonNavbar
from
"@/components/common/common-navbar"
;
import
CoopListItem
from
"@/components/business/coop-list-item"
;
import
Loading
from
"@/components/common/common-loading"
;
import
CardBanner
from
"@/components/cme/card-banner"
;
import
ICardItem
from
"@/components/cme/I-card-item
"
;
import
Loading
from
"@/components/common/common-loading
"
;
import
CommonTitle
from
"@/components/common/common-title"
;
import
{
mapGetters
,
mapActions
}
from
"vuex"
;
import
{
getWebPageUrl
,
parseTime
}
from
"@/utils/index"
;
export
default
{
data
()
{
return
{
existBind
:
0
,
currentModelIndex
:
0
,
titleTestModelList
:
[],
showLoading
:
false
,
isWeb
:
window
.
__isWeb
,
isAndroid
:
window
.
__isAndroid
,
isIOS
:
window
.
__isIOS
,
bgColor
:
"#fff"
,
isShow
:
false
,
navTitle
:
"继教课程"
,
compTitle
:
"组件名称"
,
navTitle
:
"选择专业"
,
isShowNavbar
:
true
,
isFixNavbar
:
fals
e
,
isFixNavbar
:
tru
e
,
pointStyle
:
"activity"
,
descTitle
:
"规定从何处开始选取。如果是负数"
,
tabIndex
:
1
,
joinProjectList
:
[],
// 我的项目
otherProjectList
:
[],
// 全部项目
token
:
""
,
toastTitle
:
""
,
userMobile
:
""
,
needShowBackup
:
false
,
showGoUpdate
:
false
,
oneLevelUrl
:
''
,
provinceId
:
0
,
organizationId
:
0
,
listData
:
[
{
name
:
"中医"
,
list
:
[
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"中医内科学中医内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
,
{
name
:
"妇科"
,
list
:
[
{
name
:
"妇产科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"中医内科学中医内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
,
{
name
:
"内科"
,
list
:
[
{
name
:
"肾内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"肾内科学肾内科学肾内科学肾内科学"
,
code
:
201
,
bindStatus
:
0
}
,
{
name
:
"全科中医"
,
code
:
201
,
bindStatus
:
0
}
]
}
],
isInfresh
:
false
,
hasLogin
:
false
,
hasResetPosition
:
false
,
}
;
}
,
computed
:
{
...
mapGetters
([
"
projectTabIndex"
,
"organization
Info"
])
...
mapGetters
([
"
user
Info"
])
}
,
components
:
{
// DiscussTopicStencil
,
CardBanner
,
CommonNavbar
,
CoopListItem
,
Loading
,
CardBanner
,
CommonTitle
,
ICardItem
,
CommonTitle
}
,
created
()
{
var
_this
=
this
;
_this
.
currentModelIndex
=
0
;
window
.
__getUserInfo
=
function
(
param
)
{
_this
.
setUserInfo
(
param
);
_this
.
token
=
param
.
userToken
;
_this
.
checkToken
();
_this
.
userMobile
=
param
.
userMobile
;
_this
.
get
Coop
Data
();
console
.
log
(
'__getUserInfo'
,
param
);
_this
.
get
List
Data
();
console
.
log
(
"__getUserInfo"
,
param
);
}
;
_this
.
getUserInfo
();
if
(
__isWeb
)
{
_this
.
get
Coop
Data
();
_this
.
get
List
Data
();
}
window
.
__refresh
=
function
()
{
//_this.tabIndex = _this.projectTabIndex;
_this
.
isInfresh
=
true
;
// _this.currentModelIndex = 0;
console
.
log
(
_this
.
currentModelIndex
);
_this
.
getUserInfo
();
}
;
...
...
@@ -147,30 +187,63 @@ export default {
// component_tag: "210#0#0#0"
//
}
);
// TEST
// window.__getPositionData = function(param) {
// console.log(param)
// }
// TEST
// this.getPositionData();
window
.
addEventListener
(
"scroll"
,
this
.
scrollFun
);
}
,
mounted
()
{
var
_this
=
this
;
this
.
tabIndex
=
this
.
projectTabIndex
;
this
.
listData
=
[]
;
// this.currentModelIndex = 0
;
}
,
methods
:
{
...
mapActions
([
"setUserInfo"
,
"setOrganizationInfo"
,
"setJumpURLForI"
]),
...
mapActions
([
"setUserInfo"
]),
// 选择职称
selectModel
(
model
,
index
)
{
this
.
currentModelIndex
=
index
;
this
.
listData
=
this
.
titleTestModelList
[
index
].
firstSubjectModelList
||
[];
}
,
// //获取位置信息 测试代码 TEST
// getPositionData() {
// console.log('getPositionData');
// rocNative.getPositionData({
// __funcName: "__getPositionData"
// });
// },
// 跳转到项目页面
coopDetails
(
item
)
{
if
(
item
.
openFlag
==
0
)
return
;
// this.$sendBuriedData(
{
// component_tag: `880#8803#$
{
item
.
id
}#
$
{
item
.
name
}
` //'210#210002#0#'+item.projectName
//
}
);
// 临时添加
if (window.__isWeb) {
this.$router.push({
path: "/coop",
query: {
id: item.projectId
}
}
);
return;
}
let appVersion = this.userInfo.appVersion;
let appVersionNum = appVersion.split(".").join("");
console.log("appVersionNum", appVersionNum);
if (appVersionNum < 341) {
Toast("请您下载新版本App");
return;
}
let paramList = [
{
key: "pageUrl",
value: getWebPageUrl(`
profexam
/
#
/
coop
?
id
=
$
{
item
.
projectId
}
`),
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
}
);
}
,
//获取版本号
getUserInfo() {
...
...
@@ -178,52 +251,69 @@ export default {
__funcName: "__getUserInfo"
}
);
}
,
// 切换列表
changeTab
(
index
)
{
let
tag
=
index
==
1
?
"210#210001#0"
:
"210#210001#1"
;
this
.
tabIndex
=
index
;
if
(
index
==
1
&&
!
this
.
userMobile
)
{
rocNative
.
gotoLogin
();
this
.
tabIndex
=
2
;
}
// this.$sendBuriedData({
// component_tag: tag
// });
},
//
获取所有项目:我的项目、其它项目
get
Coop
Data
()
{
//
查询列表
get
List
Data() {
let _this = this;
let param = {
token: _this.token,
setEntry: true
}
;
_this
.
joinProjectList
=
[];
_this
.
otherProjectList
=
[];
_this
.
showLoading
=
true
;
this
.
GET
(
"cme/project/list"
,
param
).
then
(
res
=>
{
_this
.
showLoading
=
false
;
this.showLoading = true;
this.GET(`
portal
/
titleTestApp
/
list
`, param).then(res => {
this.showLoading = false;
if (res.code == "000000") {
// let organizationInfo = {}
_this
.
joinProjectList
=
res
.
data
.
myCMEProjectListDtoList
;
_this
.
otherProjectList
=
res
.
data
.
allCMEProjectListDtoList
;
_this
.
provinceId
=
res
.
data
.
provinceId
;
_this
.
organizationId
=
res
.
data
.
organizationId
;
_this
.
oneLevelUrl
=
res
.
data
.
oneLevelUrl
;
// I类学习卡列表地址
// 不做相应判断
if
(
_this
.
userMobile
)
{
_this
.
tabIndex
=
1
;
this.existBind = res.data.existBind || 0;
this.titleTestModelList = res.data.titleTestModelList;
// 如果有绑定的卡,并且之前没有做定位,则进行定位
if (this.existBind && !this.hasResetPosition) {
this.hasResetPosition = true;
this.resetPosition(this.titleTestModelList);
// 否则直接使用当前的位置信息
}
else {
_this
.
tabIndex
=
2
;
}
if
(
_this
.
joinProjectList
&&
_this
.
joinProjectList
.
length
===
0
)
{
_this
.
tabIndex
=
2
;
this.listData = res.data.titleTestModelList[this.currentModelIndex].firstSubjectModelList;
}
}
else {
this.message.error(res.message);
}
}
);
}
,
_this
.
isShow
=
true
;
// 查找对应的职称与专业
resetPosition(list) {
if (!list.length) return;
let parentIndex = 0,
fIndex = 0,
subIndex = 0,
firstSub = [],
secondSub = [];
outloop: for (let i = 0; i < list.length; i++) {
firstSub = list[i].firstSubjectModelList;
for (let j = 0; j < firstSub.length; j++) {
secondSub = firstSub[j].secondSubjectModelList;
for (let k = 0; k < secondSub.length; k++) {
if (secondSub[k].bindCardStatus) {
parentIndex = i;
fIndex = j;
subIndex = k;
break outloop;
}
}
}
}
this.currentModelIndex = parentIndex;
this.listData = this.titleTestModelList[parentIndex].firstSubjectModelList || [];
this.$forceUpdate();
this.resetProjectPosition(fIndex, subIndex);
}
,
// 将定位到的元素,滚动到最上面
resetProjectPosition(fIndex, subIndex) {
this.$nextTick(() => {
setTimeout(() => {
let scrollTop = document.getElementById(`
subject_$
{
fIndex
}
_$
{
subIndex
}
`).offsetTop;
window.scrollTo(0, scrollTop - 120);
}
, 100);
}
);
}
,
...
...
@@ -240,7 +330,35 @@ export default {
// 滚动到顶部
scrollTop() {
window.scrollTo(0, 0);
},
}
,
// 格式化时间
formatTime(time, cFormat) {
return parseTime(time, cFormat);
}
,
// token是否失效校验
checkToken() {
let _this = this;
let param = {
token: _this.userInfo.userToken || _this.token,
setEntry: true
}
;
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
//未登录 跳转登录页
console.log("跳登录", _this.isInfresh);
if (_this.isInfresh) {
rocNative.goBack();
}
else {
rocNative.gotoLogin();
}
_this.isInfresh = false;
}
else {
_this.hasLogin = true;
}
}
);
}
}
}
;
</script>
...
...
@@ -248,70 +366,158 @@ export default {
@import "../style/mixin";
.page-content {
&
-table
{
position
:
fixed
;
z-index
:
100
;
width
:
100%
;
text-align
:
center
;
border-bottom
:
1px
solid
#e7e7e7
;
background
:
#fff
;
tr
{
font-size
:
px2rem
(
15px
);
font-weight
:
700
;
height
:
px2rem
(
44px
);
td
{
width
:
50%
;
padding-top
:
px2rem
(
6px
);
.tap-title
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
color
:
#999
;
span
:nth-child
(
2
)
{
position
:
relative
;
padding-top: px2rem(74px);
min-height: 100vh;
.body {
// min-height: 90vh;
display: flex;
flex-direction: row;
font-size: px2rem(14px);
color: #676869;
&.body-pt {
padding-top: px2rem(40px);
}
.left {
width: px2rem(130px);
background: #fff;
li {
position: relative;
display: block;
height: px2rem(60px);
line-height: px2rem(60px);
padding-left: px2rem(15px);
&.active {
color: #449284;
background: #fff;
&.active::before {
position: absolute;
left: 0;
bottom
:
px2rem
(
-8px
);
z-index
:
2
;
width
:
px2rem
(
10px
);
height
:
px2rem
(
3px
);
background
:
rgba
(
255
,
255
,
255
,
1
);
border-radius
:
px2rem
(
3px
);
top: px2rem(20px);
z-index: 1;
content: "";
height: px2rem(20px);
width: px2rem(3px);
border-radius: px2rem(2px);
background: #449284;
}
}
&
.active
{
span
:nth-child
(
2
)
{
background
:
rgba
(
68
,
146
,
132
,
1
);
}
&.fixed {
position: fixed;
top: px2rem(74px);
left: 0;
bottom: 0;
right: px2rem(130px);
z-index: 1;
background: #f8f9fa;
&.top {
top: px2rem(114px);
}
}
}
.right {
flex: 1;
padding: 0 px2rem(15px) px2rem(30px);
.list-wrapper {
.list {
.title {
display: inline-block;
// height: px2rem(35px);
padding: px2rem(6px) 0 px2rem(10px);
line-height: px2rem(1.2);
margin-top: px2rem(14px);
font-size: px2rem(15px);
font-weight: 700;
}
span
.android
:nth-child
(
2
)
{
bottom
:
px2rem
(
-12px
);
.item {
li {
position: relative;
top: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: column;
// height: px2rem(55px);
padding: px2rem(12px) 0;
margin-bottom: px2rem(6px);
justify-content: center;
text-align: center;
border-radius: px2rem(4px);
background: #f8f9fa;
align-items: center;
span {
display: inline-block;
// height: px2rem(20px);
line-height: px2rem(20px);
padding: 0 px2rem(20px);
}
&.has-bind {
color: #449284;
background: rgba(68, 146, 132, 0.1);
.buy {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: px2rem(15px);
line-height: px2rem(15px);
padding: 0 px2rem(4px);
border-radius: 0px px2rem(4px) 0px px2rem(4px);
font-size: px2rem(11px);
color: #fff;
background: #449284;
}
}
&.no-active {
color: #c7c8c9;
.time {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: px2rem(15px);
line-height: px2rem(15px);
padding: 0 px2rem(4px);
border-radius: 0px px2rem(4px) 0px px2rem(4px);
opacity: 0.4;
font-size: px2rem(11px);
background: rgba(0, 0, 0, 1);
}
}
}
}
span
.ios
:nth-child
(
2
)
{
bottom
:
px2rem
(
-10px
);
}
.no-list {
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
align-items: center;
margin-top: px2rem(30px);
// width: px2rem(50px);
// height: px2rem(50px);
img {
width: px2rem(100px);
height: px2rem(100px);
}
span {
font-size: px2rem(12px);
color: #c7c8c9;
}
}
}
}
}
.cb-wrapper {
width
:
100%
;
position: fixed;
top
:
px2rem
(
49px
);
left
:
0
;
z-index
:
90
;
// margin-bottom: 30px;
&
.padding-top-111
{
top
:
px2rem
(
111px
);
}
}
&
-list
{
padding-top
:
px2rem
(
50px
);
.mt-10
{
margin-bottom
:
px2rem
(
-10px
);
}
z-index: 2;
width: 100%;
}
}
.back-up-icon {
position: fixed;
z-index: 10;
bottom: px2rem(50px);
right: px2rem(15px);
img {
...
...
src/views/index.vue
浏览文件 @
1457f765
...
...
@@ -23,17 +23,8 @@
>
<span>
{{
model
.
title
}}
</span>
</li>
</ul>
<ul
class=
"left"
>
<!--
<li
v-for=
"(model, mIndex) in titleTestModelList"
:key=
"mIndex"
:class=
"
{active: currentModelIndex == mIndex}"
@click="selectModel(model, mIndex)"
>
<span>
{{
model
.
title
}}
</span>
</li>
-->
</ul>
<ul
class=
"left"
></ul>
<article
class=
"right"
>
<ul
class=
"list-wrapper"
>
<li
class=
"list"
v-for=
"(item, index) in listData"
:key=
"index"
>
...
...
@@ -63,18 +54,6 @@
<
/ul
>
<
/article
>
<
/section
>
<!--
<
section
class
=
"body"
>
<
ul
class
=
"left-fixed"
>
<
li
v
-
for
=
"(model, mIndex) in titleTestModelList"
:
key
=
"mIndex"
:
class
=
"{active: currentModelIndex == mIndex
}
"
@
click
=
"selectModel(model, mIndex)"
>
<
span
>
{{
model
.
title
}}
<
/span
>
<
/li
>
<
/ul>
<
/section> --
>
<
/section
>
<
transition
name
=
"fade"
>
...
...
@@ -147,7 +126,7 @@ export default {
],
isInfresh
:
false
,
hasLogin
:
false
,
hasResetPosition
:
false
,
hasResetPosition
:
false
}
;
}
,
computed
:
{
...
...
@@ -269,9 +248,12 @@ export default {
if (this.existBind && !this.hasResetPosition) {
this.hasResetPosition = true;
this.resetPosition(this.titleTestModelList);
// 否则直接使用当前的位置信息
// 否则直接使用当前的位置信息
}
else {
this.listData = res.data.titleTestModelList[this.currentModelIndex].firstSubjectModelList;
this.listData =
res.data.titleTestModelList[
this.currentModelIndex
].firstSubjectModelList;
}
}
else {
this.message.error(res.message);
...
...
@@ -302,7 +284,8 @@ export default {
}
}
this.currentModelIndex = parentIndex;
this.listData = this.titleTestModelList[parentIndex].firstSubjectModelList || [];
this.listData =
this.titleTestModelList[parentIndex].firstSubjectModelList || [];
this.$forceUpdate();
this.resetProjectPosition(fIndex, subIndex);
}
,
...
...
@@ -311,7 +294,9 @@ export default {
resetProjectPosition(fIndex, subIndex) {
this.$nextTick(() => {
setTimeout(() => {
let scrollTop = document.getElementById(`
subject_$
{
fIndex
}
_$
{
subIndex
}
`).offsetTop;
let scrollTop = document.getElementById(
`
subject_$
{
fIndex
}
_$
{
subIndex
}
`
).offsetTop;
window.scrollTo(0, scrollTop - 120);
}
, 100);
}
);
...
...
src/views/merge-detail copy.vue
已删除
100644 → 0
浏览文件 @
4e385540
<
template
>
<!-- 组件详情页面:模块列表及其下面的元件列表 -->
<div
class=
"page-container-merge"
>
<CommonNavbar
id=
"header"
:bgColor=
"bgColor"
v-show=
"isShowNavbar"
:isBlack=
"isBlack"
:isShowShare=
"isShowShare"
:title=
"navTitle"
:shareTitle=
"project.projectName"
:shareTitleInfo=
"project.projectIntro"
:isFixNavbar=
"isFixNavbar"
:burialPoint=
"pointStyle"
borderStyle=
"0px solid #fff"
:backMethod=
"from"
></CommonNavbar>
<div
class=
"page-content list-container"
>
<!-- banner图片 -->
<div
v-if=
"bannerType == 1"
class=
"page-content-img-container"
>
<img
class=
"banner-img"
:src=
"attachmentUrl"
/>
<!--
<img
v-show=
"project.status == 1"
class=
"banner-img-1"
src=
"../images/status-join.png"
/>
-->
<img
v-show=
"project.status == 5"
class=
"banner-img-5"
src=
"../images/status-keep-on.png"
/>
<img
v-show=
"project.status == 10"
class=
"banner-img-10"
src=
"../images/status-end-cme.png"
/>
</div>
<!-- banner视频 -->
<CommonTcPlayer
v-if=
"bannerType == 2"
style=
"flex"
:options=
"videoOptions"
></CommonTcPlayer>
<!-- 项目标题 -->
<CommonDescription
:projectName=
"project.projectName"
:studyNum=
"project.studyNum"
:subject=
"project.subject"
/>
<CommonAdertImg
:advertInfoList=
"advertInfoList"
position=
"0"
/>
<!-- 简介和目录 -->
<div
class=
"intro-catalogue-container"
>
<div
id=
"content-title"
class=
"title"
:class=
"
{'fixed-title-1': (fixedFlag
&&
!isWeb), 'fixed-title-2': (fixedFlag
&&
isWeb)}"
>
<span
:class=
"
{'focus': tabFlag}" @click="jumpIntro">简介
</span>
<span
:class=
"
{'focus': !tabFlag}" @click="jumpCatalogue">目录
</span>
</div>
<div
v-show=
"fixedFlag"
class=
"fixed-flag-height"
></div>
<div
id=
"intro-content"
class=
"intro-content"
>
<BasicInfo
:projectNo=
"project.projectNo"
:credit=
"project.credit"
:level=
"project.level"
:scope=
"project.scope"
:startDate=
"project.startDate"
:endDate=
"project.endDate"
:organName=
"project.organName"
:remind=
"project.remind"
:projectCredit=
"project.projectCredit"
:projectName=
"project.projectName"
/>
<LearnKnow
v-if=
"project.mustKnow"
:mustKnow=
"project.mustKnow"
></LearnKnow>
<CommonSpliteLine></CommonSpliteLine>
<ItemIntro
v-if=
"textContent"
:textContent=
"textContent"
@
itemIntroText=
"itemIntroText"
></ItemIntro>
<ItemLeader
v-if=
"projectLeader"
:projectLeader=
"projectLeader"
:leaderText=
"leaderText"
@
changeLeaderText=
"changeLeaderText"
/>
<TeacterIntro
v-if=
"doctorList.length"
:doctorList=
"doctorList"
></TeacterIntro>
</div>
<CommonSpliteLine></CommonSpliteLine>
<div
id=
"catalogue-content"
class=
"catalogue-content"
>
<div
class=
"catalogue-title"
>
<span
class=
"c-title"
>
目录
</span>
<span
v-if=
"needShowUpdate"
class=
"c-sub"
>
每周更新课程
</span>
</div>
<CellListDetail
:projectComponent=
"projectComponentDTOS"
:actionList=
"actionList"
:detailNum=
"detailNum"
:courseRequire=
"courseRequire"
:hasBindCard=
"hasBindCard"
:limitTimes=
"limitTimes"
/>
</div>
</div>
<CommonAdertImg
needPadTop
:advertInfoList=
"advertInfoList"
position=
"1"
/>
<NoMoreContent
/>
<div
v-if=
"detailNum
<
=
9
"
class=
"no-more-bottom"
></div>
</div>
<!--
<ExjumperButton
@
btnClick=
"beforeJumpToExam"
v-if=
"hasBindCard"
:btnText=
"project.currentProgress > 1 ? '参加考试' : '学完全部课程,可参加考试'"
:type=
"project.currentProgress > 1 ? 'primary' : 'disabled'"
></ExjumperButton>
-->
<div
v-if=
"!hasBindCard && !isWeb"
style=
"padding-top: 30px"
></div>
<BindCardButton
v-if=
"!hasBindCard && !isWeb"
:cardInfo=
"cardInfo"
@
changeClick=
"changeClick"
@
gotoBuy=
"confirm"
></BindCardButton>
<!--去激活-->
<ChangeCard
:changeErrorMsg=
"changeCardErrorMsg"
:isShow=
"showChangeCard"
@
cancle=
"cancleChangeCard"
@
confirm=
"changeCardAction"
>
</ChangeCard>
<Loading
v-show=
"showLoading"
/>
<div>
<span
ref=
"copyLinkBtn"
data-clipboard-action=
"copy"
class=
"cobyOrderSn"
:data-clipboard-text=
"this.project.cardKey"
@
click=
"copyLink"
></span>
</div>
</div>
</
template
>
<
script
>
import
CommonNavbar
from
"@/components/common/common-navbar"
;
import
CommonDescription
from
"@/components/common/common-description"
;
import
CommonSpliteLine
from
"@/components/common/common-splite-line"
;
import
CellListDetail
from
"@/components/business/cell-list-detail"
;
import
CommonTcPlayer
from
"@/components/common/common-tcplayer"
;
import
Loading
from
"@/components/common/common-loading"
;
import
BasicInfo
from
"@/components/cme/basic-info"
;
import
LearnKnow
from
"@/components/cme/learn-know"
;
import
ItemIntro
from
"@/components/cme/item-intro"
;
import
ItemLeader
from
"@/components/cme/item-leader"
;
import
TeacterIntro
from
"@/components/cme/teacter-intro"
;
import
CommonDialog
from
"@/components/cme/common-dialog"
;
import
ExjumperButton
from
"@/components/cme/exjumper-button"
;
import
NoMoreContent
from
"@/components/business/no-more-content"
;
import
CommonAdertImg
from
"@/components/common/common-advert-img"
;
import
{
getWebPageUrl
,
gotoPage
}
from
"@/utils/index"
;
import
{
mapGetters
,
mapActions
}
from
"vuex"
;
import
vueFilters
from
"@/utils/filter"
;
import
{
Toast
}
from
"vant"
;
import
BindCardButton
from
"@/components/cme/bind-card-button"
;
import
ChangeCard
from
"@/components/cme/change-card"
;
let
cataOffsetTop
=
0
;
let
intorOffsetTop
=
0
;
let
titleOffsetHeight
=
50
;
export
default
{
data
()
{
return
{
// token: "9B62E5874DA94979A54DB3E9DFC1443F",
isWeb
:
window
.
__isWeb
,
textContent
:
""
,
leaderText
:
""
,
pageTitle
:
""
,
isShowShare
:
true
,
tabFlag
:
true
,
// 显示目录还是简介
fixedFlag
:
false
,
// 目录和简介是否固定
project
:
{
credit
:
""
,
// 学分
creditId
:
0
,
// 学分Id
level
:
""
,
// 项目等级
scope
:
""
,
// 申请范围
remind
:
""
,
// 在不在范围提醒
startDate
:
0
,
// 开始时间
endDate
:
0
,
// 结束时间
organName
:
""
,
// 发起机构
projectName
:
""
,
// 项目名称
projectNo
:
""
,
// 项目编号
currentProgress
:
0
,
// 项目进度
projectIntro
:
""
,
// 项目介绍
mustKnow
:
""
,
// 学习须知
studyNum
:
0
,
// 学习人数
studyProgress
:
"0%"
,
// 学习进度
subject
:
""
,
// 学科
status
:
0
,
// 项目状态 5是进行中 10是已结束
certificateUrl
:
""
,
// 证书url
inScope
:
0
,
// 是否在范围内判断
projectCredit
:
""
,
// 学分
certificateId
:
"0"
,
examBtnUrl
:
""
,
// 考试按钮跳转连接
firstIntoExam
:
false
,
// true弹框,是否首次进入考试,用于首次跳转弹框提示,只跟项目和人员有关
jumpToContents
:
false
,
// 是否跳转到目录
cardStatus
:
0
,
cardKey
:
''
,
},
hasBindCard
:
false
,
// 是否绑定过学习卡或激活过 没有绑定,则显示绑定按钮
limitTimes
:
60
,
projectLeader
:
{},
doctorList
:
[],
from
:
"inner"
,
isBlack
:
false
,
showLoading
:
false
,
projectId
:
"1"
,
contentList
:
[],
//moduleName: "",
bannerType
:
1
,
// 1 图片 2视频
videoOptions
:
{
mp4
:
""
,
autoplay
:
false
,
//iOS下safari浏览器,以及大部分移动端浏览器是不开放视频自动播放这个能力的
coverpic
:
require
(
"../images/video-cover.png"
),
width
:
"415"
,
//视频的显示宽度,请尽量使用视频分辨率宽度
height
:
"210"
//视频的显示高度,请尽量使用视频分辨率高度
},
//projectStatus: 1, //1没有获得证书 2是获得全部证书
attachmentUrl
:
require
(
"../images/banner-default.png"
),
bgColor
:
"none"
,
navTitle
:
"项目详情"
,
// compTitle: "组件名称",
isShowNavbar
:
true
,
isFixNavbar
:
true
,
pointStyle
:
"activity"
,
projectComponentDTOS
:
[],
actionList
:
[],
detailNum
:
0
,
courseRequire
:
0
,
clientType
:
0
,
// currentProgress>1时考试按钮显示并可用
btnType
:
"primary"
,
// primary: 可跳转时(currentProgress = 1); disabled: 不可跳转时
btnText
:
"学完全部课程,可参加考试"
,
// 参加考试(currentProgress = 1); 或者学完全部课程,可参加考试
provinceId
:
""
,
organizationId
:
""
,
cardInfo
:
{
id
:
0
},
advertInfoList
:
[],
showChangeCard
:
false
,
//是否展示激活弹框,
changeCardErrorMsg
:
""
,
isInfresh
:
false
,
needShowUpdate
:
false
,
};
},
components
:
{
CommonNavbar
,
CommonDescription
,
CommonSpliteLine
,
CellListDetail
,
Loading
,
CommonTcPlayer
,
BasicInfo
,
LearnKnow
,
ItemIntro
,
ItemLeader
,
TeacterIntro
,
CommonDialog
,
ExjumperButton
,
CommonAdertImg
,
NoMoreContent
,
BindCardButton
,
ChangeCard
},
computed
:
{
...
mapGetters
([
"userInfo"
])
},
created
()
{
let
_this
=
this
;
this
.
from
=
this
.
$route
.
query
.
from
||
this
.
from
||
"native"
;
this
.
projectId
=
this
.
$route
.
query
.
id
||
1
;
window
.
__getUserInfo64Comp
=
function
(
param
)
{
// appVersion 安卓 3.2.2 iOS
console
.
log
(
"__getUserInfo64Comp"
,
param
);
_this
.
token
=
param
.
userToken
;
_this
.
setUserInfo
(
param
);
_this
.
checkToken
();
_this
.
getProjectInfoById
();
};
_this
.
getUserInfo
();
// if (__isWeb && process.env.BUILD_ENV == "development") {
// let param = {};
// __getUserInfo64Comp(param);
// }
if
(
__isWeb
)
{
_this
.
getProjectInfoById
();
}
window
.
__refresh
=
function
()
{
_this
.
isInfresh
=
true
;
_this
.
getUserInfo
();
};
window
.
__getPositionData
=
function
(
param
)
{
console
.
log
(
param
);
// _this.showLoading = false;
param
.
setEntry
=
true
;
_this
.
getProvinceIdByPosition
(
param
);
};
// 调用广告位接口
this
.
getAdvertInfoList
();
},
mounted
()
{
window
.
addEventListener
(
"scroll"
,
this
.
scrollFun
);
const
_this
=
this
;
},
beforeDestroyed
()
{
window
.
removeEventListener
(
"scroll"
,
this
.
scrollFun
);
},
methods
:
{
...
mapActions
([
"setUserInfo"
]),
cancleChangeCard
()
{
this
.
showChangeCard
=
false
;
},
// 激活 返回值:0绑定失败,1绑定成功
changeCardAction
(
cardKey
)
{
let
_this
=
this
;
let
param
=
{
cardKey
:
cardKey
,
cardType
:
3
,
portalProjectId
:
this
.
projectId
,
setEntry
:
true
};
_this
.
changeCardErrorMsg
=
""
;
this
.
POST
(
"cme/projectCard/bind"
,
param
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
data
==
0
)
{
_this
.
changeCardErrorMsg
=
"请输入正确的激活码"
;
}
else
{
_this
.
showChangeCard
=
false
;
Toast
(
"激活成功,开始学习"
);
_this
.
getProjectInfoById
();
}
}
else
{
}
}).
catch
(
e
=>
{
_this
.
changeCardErrorMsg
=
"请输入正确的激活码"
;
});
},
// 复制卡密
copyLink
()
{
let
_this
=
this
;
let
clipboard
=
new
this
.
clipboard
(
".cobyOrderSn"
);
clipboard
.
on
(
"success"
,
function
()
{
e
.
clearSelection
();
Toast
(
"已成功复制激活码"
);
});
clipboard
.
on
(
"error"
,
function
()
{
e
.
clearSelection
();
Toast
(
"复制激活码失败"
);
});
},
// 查询教培项目广告位配置信息
getAdvertInfoList
()
{
let
param
=
{
setEntry
:
true
};
this
.
GET
(
`portal/jump/
${
this
.
projectId
}
/1`
,
param
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
this
.
advertInfoList
=
(
res
.
data
&&
res
.
data
.
list
)
||
[];
console
.
log
(
"advertInfoList"
,
this
.
advertInfoList
);
}
});
},
// 点击“参与考试”
beforeJumpToExam
()
{
// this.$sendBuriedData({
// component_tag: `882#8824`
// });
// 如果是首次,则弹出弹框
this
.
jumpToCardList
();
},
// 跳转II类学习详情页面(跳转的页面由后面配置)
jumpToCardList
()
{
// this.$sendBuriedData({
// component_tag: `885#8851`
// });
this
.
showLoading
=
false
;
// 判断版本号,如果小于3.4.0,则只做提示
let
appVersion
=
this
.
userInfo
.
appVersion
;
let
appVersionNum
=
appVersion
.
split
(
"."
).
join
(
""
);
if
(
appVersionNum
<
341
)
{
Toast
(
"请您下载新版本App"
);
return
;
}
// 复制卡密
this
.
$refs
.
copyLinkBtn
.
click
();
setTimeout
(()
=>
{
if
(
window
.
__isWeb
)
{
return
;
}
else
{
let
pageUrl
=
this
.
project
.
examBtnUrl
;
let
paramList
=
[
{
key
:
"pageUrl"
,
value
:
pageUrl
,
type
:
4
,
seqNo
:
1
},
// 此字段不配置,则用原来的逻辑
{
key
:
"needCache"
,
value
:
"1"
,
// 0不缓存,其它值都做缓存
type
:
4
,
seqNo
:
1
}
];
rocNative
.
dispatchEventByModuleCode
({
modeCode
:
"M300"
,
jsonString
:
paramList
});
}
},
1000
);
},
// 跳转前判断是否有机构,否则使用定位信息
preJumper
()
{
// TODO 测试代码
if
(
window
.
__isWeb
)
{
this
.
getCardInfoByProvinceId
(
310
);
}
else
{
if
(
this
.
organizationId
!=
0
&&
this
.
provinceId
!=
0
)
{
this
.
getCardInfoByProvinceId
(
this
.
provinceId
);
}
else
{
this
.
getPositionData
();
}
}
},
// 根据位置信息获取省ID
getProvinceIdByPosition
(
param
)
{
param
.
setEntry
=
true
;
this
.
POST
(
"aggregate/cme/convertLocationToProvinceId"
,
param
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
this
.
getCardInfoByProvinceId
(
res
.
data
);
}
}
);
},
// 根据省ID,获取学习卡信息
getCardInfoByProvinceId
(
provinceId
)
{
let
param
=
{
area
:
provinceId
+
""
,
cardType
:
3
,
pageNum
:
1
,
pageSize
:
1
};
param
.
setEntry
=
true
;
this
.
POST
(
"trade/goods/cardList"
,
param
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
this
.
showLoading
=
false
;
this
.
cardInfo
=
(
res
.
data
&&
res
.
data
[
0
])
||
{
id
:
0
};
}
});
},
// 获取地理位置信息
getPositionData
()
{
// this.showLoading = true;
console
.
log
(
"getPositionData"
);
rocNative
.
getPositionData
({
__funcName
:
"__getPositionData"
});
},
// 跳转到原生的购买页面
confirm
()
{
let
appVersion
=
this
.
userInfo
.
appVersion
||
""
;
let
appVersionNum
=
appVersion
.
split
(
"."
).
join
(
""
);
if
(
appVersionNum
<
344
)
{
Toast
(
"请您下载新版本App"
);
return
;
}
// this.$sendBuriedData({
// component_tag: `885#8852`
// });
// let pageUrl = this.project.examBtnUrl;
// 直接传入项目ID(projectId)
let
projectId
=
this
.
project
.
projectId
;
let
pageUrl
=
getWebPageUrl
(
`/profexam/#/index?id=
${
projectId
}
&projectName=
${
this
.
project
.
projectName
}
&profexamProjectId=
${
projectId
}
`
);
let
paramList
=
[
{
key
:
"className"
,
value
:
"com.picahealth.yunque.activitys.studycard.StudyCardDetailActivity###PicaDo.LearningCardVC"
,
type
:
4
,
seqNo
:
1
},
{
key
:
"goodId"
,
value
:
this
.
cardInfo
.
id
,
type
:
4
,
seqNo
:
1
},
{
key
:
"courseUrl"
,
value
:
encodeURIComponent
(
pageUrl
),
// value: projectId,
type
:
4
,
seqNo
:
1
}
];
rocNative
.
dispatchEventByModuleCode
({
modeCode
:
"M200"
,
jsonString
:
paramList
});
},
// 跳转到原生的购买页面
confirmOld
()
{
// this.$sendBuriedData({
// component_tag: `885#8852`
// });
let
pageUrl
=
this
.
project
.
examBtnUrl
;
let
paramList
=
[
{
key
:
"className"
,
value
:
"com.picahealth.yunque.activitys.studycard.StudyCardDetailActivity###PicaDo.LearningCardVC"
,
type
:
4
,
seqNo
:
1
},
{
key
:
"goodId"
,
value
:
this
.
cardInfo
.
id
,
type
:
4
,
seqNo
:
1
},
{
key
:
"courseUrl"
,
value
:
encodeURIComponent
(
pageUrl
),
type
:
4
,
seqNo
:
1
}
];
rocNative
.
dispatchEventByModuleCode
({
modeCode
:
"M200"
,
jsonString
:
paramList
});
},
// 首次进入考试时记录(点击‘我知道了’时调用)
firstIntoExamAction
()
{
let
_this
=
this
;
let
param
=
{
token
:
_this
.
userInfo
.
userToken
||
this
.
token
,
setEntry
:
true
};
this
.
NEW_POST
(
`cme/project/
${
_this
.
projectId
}
/firstIntoExam`
,
param
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
this
.
project
.
firstIntoExam
=
false
;
}
}
);
},
//获取用户信息
getUserInfo
()
{
rocNative
.
getUserInfo
({
__funcName
:
"__getUserInfo64Comp"
});
},
// token是否失效校验
checkToken
()
{
let
_this
=
this
;
let
param
=
{
token
:
_this
.
userInfo
.
userToken
||
_this
.
token
,
setEntry
:
true
};
this
.
GET
(
"campaign/admin/task/checkToken"
,
param
).
then
(
res
=>
{
if
(
res
.
code
!==
"000000"
)
{
//未登录 跳转登录页
console
.
log
(
"跳登录"
,
_this
.
isInfresh
);
if
(
_this
.
isInfresh
)
{
rocNative
.
goBack
();
}
else
{
rocNative
.
gotoLogin
();
}
_this
.
isInfresh
=
false
;
}
});
},
//去激活
changeClick
(
msg
)
{
console
.
log
(
"in changeClick"
);
this
.
showChangeCard
=
true
;
},
scrollFun
()
{
//如果是第一次的弹框,则直接退出
let
scrollTop
=
document
.
body
.
scrollTop
||
document
.
documentElement
.
scrollTop
;
let
h
=
intorOffsetTop
-
135
;
// 显示头部导航
if
(
scrollTop
>
20
)
{
this
.
isBlack
=
true
;
this
.
bgColor
=
"#fff"
;
}
else
{
this
.
isBlack
=
false
;
this
.
bgColor
=
"none"
;
}
if
(
window
.
__isWeb
)
{
h
=
intorOffsetTop
-
75
;
}
else
if
(
window
.
__isIOS
)
{
h
=
intorOffsetTop
-
140
;
}
// 如果滚动高度大于简介头部(并减去tab高度),则进行固定
if
(
scrollTop
>
h
)
{
this
.
fixedFlag
=
true
;
}
else
{
this
.
fixedFlag
=
false
;
}
// 如果滚动高度大于
if
(
scrollTop
>
cataOffsetTop
-
600
)
{
this
.
tabFlag
=
false
;
}
else
{
this
.
tabFlag
=
true
;
}
},
// 锚点到简介
jumpIntro
()
{
if
(
!
this
.
tabFlag
)
{
this
.
tabFlag
=
true
;
}
if
(
!
this
.
fixedFlag
)
{
this
.
fixedFlag
=
true
;
}
let
h
;
if
(
this
.
isWeb
)
{
h
=
intorOffsetTop
-
30
-
titleOffsetHeight
;
}
else
{
h
=
intorOffsetTop
-
85
-
titleOffsetHeight
;
}
window
.
scrollTo
(
0
,
h
);
this
.
isBlack
=
true
;
this
.
bgColor
=
"#fff"
;
// this.$sendBuriedData({
// component_tag: `211#211007#${this.projectId}`
// });
},
// 锚点到目录
jumpCatalogue
()
{
if
(
this
.
tabFlag
)
{
this
.
tabFlag
=
false
;
}
if
(
!
this
.
fixedFlag
)
{
this
.
fixedFlag
=
true
;
}
let
h
;
if
(
this
.
isWeb
)
{
h
=
cataOffsetTop
-
titleOffsetHeight
;
}
else
{
h
=
cataOffsetTop
-
100
;
}
window
.
scrollTo
(
0
,
h
);
this
.
isBlack
=
true
;
this
.
bgColor
=
"#fff"
;
// this.$sendBuriedData({
// component_tag: `211#211008#${this.projectId}`
// });
},
// 获取项目详情
getProjectInfoById
()
{
let
_this
=
this
;
let
param
=
{
token
:
_this
.
userInfo
.
userToken
||
this
.
token
,
setEntry
:
true
};
_this
.
showLoading
=
true
;
this
.
NEW_GET
(
`cme/project/
${
_this
.
projectId
}
/info`
,
param
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
// 先设置视频URL再显示视频组件 ------------ BEGIN
if
(
res
.
data
.
attachmentType
==
2
)
{
_this
.
videoOptions
.
mp4
=
res
.
data
.
attachmentUrl
;
}
else
{
_this
.
attachmentUrl
=
res
.
data
.
attachmentUrl
;
}
_this
.
bannerType
=
res
.
data
.
attachmentType
;
if
(
_this
.
bannerType
==
2
)
{
_this
.
clientType
=
__isWeb
?
1
:
__isAndroid
?
2
:
3
;
}
// 先设置视频URL再显示视频组件 ------------ END
_this
.
project
=
res
.
data
;
if
(
_this
.
project
.
projectIntro
)
{
_this
.
textContent
=
_this
.
project
.
projectIntro
.
length
>
70
?
_this
.
project
.
projectIntro
.
slice
(
0
,
70
)
+
"..."
:
this
.
project
.
projectIntro
;
}
_this
.
project
.
mustKnow
=
_this
.
project
.
mustKnow
.
replace
(
/
(\r\n)
|
\r
|
\n
/g
,
"<br>"
);
_this
.
projectLeader
=
res
.
data
.
projectLeader
;
if
(
_this
.
projectLeader
&&
_this
.
projectLeader
.
info
)
{
_this
.
leaderText
=
_this
.
projectLeader
.
info
.
length
>
70
?
_this
.
projectLeader
.
info
.
slice
(
0
,
70
)
+
"..."
:
this
.
projectLeader
.
info
;
}
_this
.
doctorList
=
res
.
data
.
doctorList
;
//_this.projectStatus = res.data.projectStatus;
_this
.
projectComponentDTOS
=
_this
.
setListData
(
res
.
data
.
projectComponentDTOS
);
// TODO Add by Anndy Yang
if
(
_this
.
project
.
currentProgress
==
2
)
{
_this
.
$nextTick
(()
=>
{
window
.
scrollTo
(
0
,
0
);
});
}
_this
.
provinceId
=
res
.
data
.
positionModel
.
provinceId
;
_this
.
organizationId
=
res
.
data
.
positionModel
.
organizationId
;
_this
.
courseRequire
=
res
.
data
.
courseRequire
||
0
;
setTimeout
(()
=>
{
cataOffsetTop
=
document
.
getElementById
(
"catalogue-content"
)
.
offsetTop
;
intorOffsetTop
=
document
.
getElementById
(
"intro-content"
).
offsetTop
;
console
.
log
(
"getProjectInfoById"
,
cataOffsetTop
,
intorOffsetTop
);
// 直接跳转
if
(
_this
.
project
.
jumpToContents
)
{
setTimeout
(()
=>
{
this
.
jumpCatalogue
();
},
200
);
}
// _this.copyLink();
},
200
);
setTimeout
(()
=>
{
_this
.
showLoading
=
false
;
},
800
);
// 如果 hasBindCard 为false,则获取卡信息 0:未绑卡 1:已绑卡
_this
.
hasBindCard
=
res
.
data
.
cardStatus
==
0
?
false
:
true
;
_this
.
limitTimes
=
res
.
data
.
trySeeTime
;
if
(
!
_this
.
hasBindCard
)
{
_this
.
preJumper
();
}
}
});
},
// 项目负责人--详情(收起)
changeLeaderText
(
data
)
{
let
_this
=
this
;
if
(
_this
.
projectLeader
.
info
)
{
if
(
!
data
.
allTextFlag
)
{
_this
.
leaderText
=
_this
.
projectLeader
.
info
.
length
>
70
?
_this
.
projectLeader
.
info
.
slice
(
0
,
70
)
+
"..."
:
this
.
projectLeader
.
info
;
}
else
{
_this
.
leaderText
=
_this
.
projectLeader
.
info
;
}
}
},
// 项目介绍
itemIntroText
(
data
)
{
let
_this
=
this
;
if
(
_this
.
project
.
projectIntro
)
{
if
(
!
data
.
allTextFlag
)
{
_this
.
textContent
=
_this
.
project
.
projectIntro
.
length
>
70
?
_this
.
project
.
projectIntro
.
slice
(
0
,
70
)
+
"..."
:
this
.
project
.
projectIntro
;
}
else
{
_this
.
textContent
=
_this
.
project
.
projectIntro
;
}
}
},
setListData
(
data
)
{
let
_this
=
this
;
let
list
=
data
;
let
actionList
=
[];
let
detailNum
=
0
;
let
needShowUpdate
=
false
;
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
list
[
i
].
portalModuleDTOS
.
length
;
j
++
)
{
detailNum
++
;
list
[
i
].
portalModuleDTOS
[
j
].
value
=
"共"
+
list
[
i
].
portalModuleDTOS
[
j
].
nodeCount
+
"节"
;
// if (list[i].portalModuleDTOS[j].status === 2) {
// list[i].portalModuleDTOS[j].value =
// "共" + list[i].portalModuleDTOS[j].nodeCount + "节";
// } else {
// list[i].portalModuleDTOS[j].value = "尚未开始";
// }
// list[i].portalModuleDTOS[j].disabled =
// list[i].portalModuleDTOS[j].status === 2 ? false : true;
//展开项记录
if
(
list
[
i
].
portalModuleDTOS
[
j
].
expandStatus
==
1
)
{
actionList
.
push
(
list
[
i
].
portalModuleDTOS
[
j
].
expandKey
);
}
for
(
let
z
=
0
;
z
<
list
[
i
].
portalModuleDTOS
[
j
].
contentList
.
length
;
z
++
)
{
if
(
!
needShowUpdate
)
{
if
(
!
list
[
i
].
portalModuleDTOS
[
j
].
contentList
[
z
].
id
)
{
this
.
needShowUpdate
=
true
;
}
}
list
[
i
].
portalModuleDTOS
[
j
].
contentList
[
z
].
height
=
_this
.
getHight
(
list
[
i
].
portalModuleDTOS
[
j
].
contentList
[
z
]
);
}
}
}
_this
.
needShowUpdate
=
needShowUpdate
;
_this
.
actionList
=
actionList
;
_this
.
detailNum
=
detailNum
;
// console.log("list转为:", list, actionList, detailNum);
return
list
;
},
// 这里?
getHight
(
data
)
{
let
len
=
vueFilters
.
strLength
(
data
.
name
);
let
certificate
=
data
.
certificateFlag
;
if
(
len
>
30
&&
certificate
==
2
)
{
return
"2"
;
}
else
if
(
len
>
30
&&
certificate
!=
2
)
{
return
2
;
}
else
if
(
len
<=
30
&&
certificate
==
2
)
{
return
"1"
;
}
else
if
(
len
<=
30
&&
certificate
!=
2
)
{
return
1
;
}
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
@import
"../style/mixin"
;
.page-container-merge
{
.nav-top
.nav-title
{
height
:
px2rem
(
0px
);
// padding: px2rem(18px);
}
.banner-img
{
display
:
inherit
;
width
:
px2rem
(
375px
);
height
:
px2rem
(
210px
);
&
-1
{
position
:
absolute
;
left
:
0
;
top
:
px2rem
(
180px
);
width
:
px2rem
(
76px
);
height
:
px2rem
(
30px
);
}
&
-5
{
position
:
absolute
;
left
:
0
;
top
:
px2rem
(
180px
);
width
:
px2rem
(
76px
);
height
:
px2rem
(
30px
);
}
&
-10
{
position
:
absolute
;
left
:
0
;
top
:
px2rem
(
180px
);
width
:
px2rem
(
76px
);
height
:
px2rem
(
30px
);
}
}
.list-container
{
// margin-bottom: px2rem(40px);
}
.intro-catalogue-container
{
.title
{
height
:
px2rem
(
50px
);
line-height
:
px2rem
(
30px
);
padding
:
0
px2rem
(
15px
);
border-bottom
:
1px
solid
#f0f1f2
;
span
{
display
:
inline-block
;
line-height
:
px2rem
(
15px
);
font-size
:
px2rem
(
15px
);
color
:
#979899
;
padding-right
:
px2rem
(
35px
);
}
span
.focus
{
position
:
relative
;
color
:
#373839
;
}
span
.focus
:after
{
content
:
""
;
position
:
absolute
;
left
:
px2rem
(
9px
);
bottom
:
px2rem
(
-14px
);
background
:
#449284
;
// border-bottom: px2rem(1px) solid #449284;
width
:
px2rem
(
10px
);
height
:
px2rem
(
3px
);
border-radius
:
px2rem
(
3px
);
}
}
.title.fixed-title-1
{
position
:
fixed
;
left
:
0
;
top
:
px2rem
(
60px
);
background
:
#fff
;
width
:
100%
;
z-index
:
999
;
}
.title.fixed-title-2
{
position
:
fixed
;
left
:
0
;
top
:
px2rem
(
0px
);
background
:
#fff
;
width
:
100%
;
z-index
:
999
;
}
.catalogue-content
{
padding
:
0
px2rem
(
15px
);
.catalogue-title
{
// display: flex;
// flex-direction: row;
// align-items: center;
// align-content: center;
margin-top
:
px2rem
(
5px
);
// margin-bottom: px2rem(16px);
.c-title
{
font-size
:
px2rem
(
18px
);
color
:
#373839
;
font-weight
:
700
;
}
.c-sub
{
margin-left
:
px2rem
(
-6px
);
font-size
:
px2rem
(
12px
);
color
:
#979899
;
}
}
}
.fixed-flag-height
{
height
:
px2rem
(
50px
);
}
}
}
.no-more-bottom
{
position
:
relative
;
width
:
100%
;
height
:
px2rem
(
40px
);
}
</
style
>
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录