Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eduline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
eduline
Commits
3816d04b
Commit
3816d04b
authored
Jun 23, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
7c9916b8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
391 additions
and
112 deletions
+391
-112
apps/exams/Tpl/default/Index/examsresult_w3g.html
+391
-112
No files found.
apps/exams/Tpl/default/Index/examsresult_w3g.html
View file @
3816d04b
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<include
file=
"__THEME__/public_header_w3g"
/>
<head>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/css/public.css"
>
<meta
charset=
"utf-8"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/icon/iconfont.css"
>
<meta
name=
"viewport"
content=
"width=device-width,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/css/public_header_footer_media.css"
>
<title>
练习报告
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{$Think.APPS_URL}/exams/_static/css/exam_2.0.css"
>
<include
file=
"__THEME__/public_header_w3g"
/>
<style
type=
"text/css"
>
</head>
.static-exam
dl
.operation
.analysis
{
display
:
block
;}
<style
type=
"text/css"
>
</style>
/*比较多用到的*/
<div
class=
"min-height-wrap"
>
.box
{
<div
class=
"cstlayer exams_top"
>
display
:
flex
;
display
:
-webkit-flex
;
<div
class=
"cstlayer-header"
>
align-items
:
center
;
<a
href=
"{:U('home/Home/exams')}"
><i
class=
"icon icon-zuojiantou"
></i></a>
}
<h3>
{$paper.exams_paper_title}
</h3>
.boxCn
{
</div>
display
:
flex
!important
;
display
:
-webkit-flex
;
<div
class=
"cstlayer-content"
>
{$answerData.score|default='0'}
</div>
align-items
:
center
;
justify-content
:
center
!important
;
<p
class=
"cstlayer-txt"
></p>
<!--本卷平均分{$avg.avg|default='0'}分,超过{$avg.transcend_rate}的人-->
}
<php>
if($answerData['exams_mode'] != 3
&&
$answerData['exams_mode'] != 4){
</php>
.flex1
{
<a
href=
"{:U('exams/index/examsroom',['paper_id'=>$paper['exams_paper_id'],'joinType'=>$answerData['exams_mode']])}"
class=
"add-eaxm"
>
再次挑战
</a>
flex
:
1
;
<php>
}else if($answerData['exams_mode'] == 4){
</php>
}
<a
href=
"{:U('exams/Index/wrongExamsroom',['joinType'=>1,'paper_id'=>$paper['exams_paper_id'],'temp'=>$answerData['exams_users_id'],'is_highwrong'=>1])}"
class=
"add-eaxm"
>
再次挑战
</a>
/*遮罩层*/
<php>
}else{
</php>
.mask
{
<a
href=
"{:U('exams/Index/wrongExamsroom',['joinType'=>1,'paper_id'=>$paper['exams_paper_id'],'temp'=>$answerData['pid']])}"
class=
"add-eaxm"
>
再次挑战
</a>
position
:
fixed
!important
;
<php>
}
</php>
top
:
0
;
<dl
class=
"business-card"
>
left
:
0
;
<dt>
排名
<h1>
{$rank.now.rank|default='1'}
</h1></dt>
right
:
0
;
<dd>
bottom
:
0
;
<a
href=
"javascript:void(0);"
><img
src=
"{:getUserFace($mid)}"
/></a>
background
:
rgba
(
0
,
0
,
0
,
0.5
);
<span>
transition
:
all
.3s
ease-in-out
;
<h4>
{:getUsername($mid)}
</h4>
z-index
:
8
;
<b>
用时
<em>
{:floor($answerData['anser_time']/60)}'{:$answerData['anser_time'] % 60}
</em></b><b>
得分
<em>
{$answerData.score|default='0'}
</em></b>
}
</span>
</dd>
</dl>
body
{
background-color
:
#fff
;
overflow
:
hidden
;}
</div>
.reportPage
{
padding
:
0
0.75rem
;
box-sizing
:
border-box
;
<!--排名表-->
}
<table
class=
"ranking-all exams_top"
>
.reportTop
{
border-bottom
:
1px
solid
#f5f5f5
;
padding-bottom
:
0.75rem
;}
<tr>
.reportTop_t
{
margin
:
0.5rem
0
0
0
;
padding
:
0
;
font-size
:
0.75rem
;
color
:
#333
;}
<th>
排名
</th>
.reportContent
{
text-align
:
center
;
padding
:
1.75rem
0.75rem
;
box-sizing
:
border-box
;}
<th></th>
.reportContent_de
{
color
:
#999999
;
font-size
:
0.875rem
;}
<th>
用时
</th>
.reportContent_numBox
{
margin
:
0.75rem
0
;
background
:
rgba
(
251
,
255
,
247
,
1
);
border-radius
:
100%
;
text-align
:
center
;
overflow
:
hidden
;
display
:
inline-block
;
<th>
得分
</th>
width
:
9rem
;
height
:
9rem
;}
</tr>
.reportContent_num
{
font-size
:
3rem
;
height
:
3.375rem
;
line-height
:
3.375rem
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
color
:
#65C000
;
margin-top
:
2.3rem
;
display
:
inline-block
;}
<volist
name=
"rank.list"
id=
"item"
>
.reportContent_numZ
{
color
:
#999999
;
font-size
:
0.75rem
;
margin-top
:
-0.25rem
;}
<tr>
.reportContent_btn
{
<td><h6>
{$i}
</h6></td>
width
:
10rem
;
height
:
3rem
;
line-height
:
3rem
;
text-align
:
center
;
border-radius
:
1.5rem
;
background-color
:
#A3E460
;
color
:
#fff
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
font-size
:
1rem
;
margin
:
0
auto
;
<td><a
href=
"{:U('home/UserShow/index',['uid'=>$item['uid']])}"
><img
src=
"{:getUserFace($item['uid'])}"
></a><small>
{:getUsername($item['uid'])}
</small></td>
}
<td><em>
{:floor($item['anser_time']/60)}'{:$item['anser_time'] % 60}
</em></td>
<td><h6>
{$item.score|default="0"}
</h6></td>
.reportLastBox
{
</tr>
position
:
fixed
;
width
:
100%
;
bottom
:
0
;
left
:
0
;
z-index
:
1
;
</volist>
}
</table>
.reportLastBg
{
width
:
100%
;}
.reportLastBtns
{
<!--footer解析-->
position
:
absolute
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
background-color
:
#fff
;
padding
:
0
0.75rem
;
box-sizing
:
border-box
;
<div
class=
"error-box-go exams_top"
>
justify-content
:
space-between
;
height
:
4.5rem
;
z-index
:
1
;
<a
href=
"javascript:;"
data-type=
"all"
class=
"show_analysis"
>
全部解析
</a>
}
<a
href=
"javascript:;"
data-type=
"wrong"
class=
"show_analysis"
>
错题解析
</a>
.reportLastBtn
{
</div>
display
:
inline-block
;
width
:
10rem
;
text-align
:
center
;
height
:
3rem
;
line-height
:
3rem
;
border-radius
:
1.5rem
;
box-sizing
:
border-box
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
font-size
:
1rem
;
<div
class=
"exam-header exams_questions clearfix"
>
}
<div
class=
"back-date"
>
.reportLastBtnL
{
<i
class=
"icon icon-fanhui1"
style=
"display: none;"
></i>
border
:
1px
solid
rgba
(
163
,
228
,
96
,
1
);
color
:
#65C000
;
</div>
}
<div
class=
"view-stop"
>
.reportLastBtnR
{
border
:
1px
solid
rgba
(
245
,
166
,
35
,
1
);
color
:
#F5A623
;
<a
href=
"javascript:;"
id=
"show-answer-card"
><i
class=
"icon icon-datiqia"
></i></a>
}
</div>
</style>
</div>
<body>
<div
id=
"app"
>
<!--解析题卡分为全部解析 or 错题解析-->
<div
class=
"reportPage"
>
<div
class=
"answer-card"
style=
"display: none;"
>
<div
class=
"reportTop"
>
<php>
$question_num = 1;
</php>
<p
class=
"reportTop_t"
>
练习题目:{$paper.exams_paper_title}
</p>
<volist
name=
"paper_options.options_type"
id=
"options_type"
>
<p
class=
"reportTop_t"
>
耗时:{:floor($answerData['anser_time']/60)}m{:$answerData['anser_time'] % 60}s
</p>
<php>
</div>
if(!$paper_options['options_questions_data'][$options_type['question_type']]){
<div
class=
"reportContent"
>
break;
<p
class=
"reportContent_de"
>
得分
</p>
}
<div
class=
"reportContent_numBox"
>
</php>
<span
class=
"reportContent_num"
>
{$answerData.score|default='0'}
</span>
<dl>
<p
class=
"reportContent_numZ"
>
(总分100)
</p>
<dt><h6>
{$options_type.type_info.question_type_title}
</h6></dt>
</div>
<dd>
<p
class=
"reportContent_btn"
><a
href=
"{:U('exams/index/examsroom',['paper_id'=>$paper['exams_paper_id'],'joinType'=>$answerData['exams_mode']])}"
>
再次练习
</a></p>
<volist
name=
"paper_options['options_questions_data'][$options_type['question_type']]"
id=
"question"
>
</div>
<php>
if($_GET['joinType'] == 3
&&
!in_array($question['exams_question_id'],$inQuestions)) continue;
</php>
</div>
<a
id=
"card{$question_num}"
href=
"javascript:;"
data-question_num=
"{$question_num}"
class=
"go_question <php>if(in_array($question['exams_question_id'],$wrongList)){</php>err<php>}</php>"
>
{$question_num}
</a>
<!-- 底部 -->
<php>
$question_num++;
</php>
<div
class=
"reportLastBox"
>
</volist>
<img
class=
"reportLastBg"
src=
"../img/reBg.png"
>
</dd>
<div
class=
"reportLastBtns box"
>
</dl>
<span
@
click=
"onAll"
class=
"reportLastBtn reportLastBtnL"
>
全部解析
</span>
</volist>
<span
@
click=
"onAll"
class=
"reportLastBtn reportLastBtnR"
>
错题解析
</span>
</div>
</div>
</div>
<div
class=
"static-exam exams_questions"
>
</div>
<php>
$question_num = 1;
</php>
</body>
<volist
name=
"paper_options.options_type"
id=
"options_type"
>
</html>
<switch
name=
"options_type.question_type_key"
>
<case
value=
"radio|judge|multiselect"
>
<!-- 单选题 -->
<volist
name=
"paper_options['options_questions_data'][$options_type['question_type']]"
id=
"question"
>
<php>
if($_GET['joinType'] == 3
&&
!in_array($question['exams_question_id'],$inQuestions)) continue;
</php>
<dl
<
php
>
if(in_array($question['exams_question_id'],$wrongList)){
</php>
class="wrong"
<php>
}
</php>
id="ex{$question_num}" data-type="{$options_type.question_type_key}" data-question_num="{$question_num}">
<dt>
<h5><small>
{$question_num}
</small>
/{$answerData['right_count']+$answerData['wrong_count']}
<!-- {$paper_options.questions_count} -->
<strong>
{$options_type.type_info.question_type_title}
</strong></h5>
<h3>
{$question.content}
</h3>
</dt>
<dd>
<volist
name=
"question.answer_options"
id=
"answer"
>
<div
class=
"answer_box"
>
<p
data-answer=
"{$key}"
><em>
{$key}
</em>
{$answer}
</p>
</div>
</volist>
</dd>
<a
href=
"javascript:;"
data-question_num=
"{$question_num}"
class=
"next next_question"
>
下一题
</a>
<div
class=
"operation"
>
<!--答案解析-->
<php>
$content = isset($answerData['content'][$question['exams_question_id']]) ? $answerData['content'][$question['exams_question_id']] : [];
</php>
<div
class=
"analysis"
>
<table
class=
"analysis-pic"
>
<td>
<h6>
正确答案
</h6>
<abbr><volist
name=
"question.answer_true_option"
id=
"answer_true"
>
{$answer_true}
</volist></abbr>
</td>
<td>
<h6>
我的答案
</h6>
<em><php>
if(!$content){
</php>
未作答
<php>
}
</php><volist
name=
"content"
id=
"ans"
>
{$ans|default='未作答'}
</volist></em>
</td>
</table>
<div
class=
"analysis-txt"
>
<h6>
解析
</h6>
<p>
{$question.analyze}
</p>
</div>
</div>
</div>
<div
class=
"collect_hidden"
>
<php>
if($question['is_collect'] == 1){
</php>
<i
data-question_num=
"{$question_num}"
data-question_id=
"{$question.exams_question_id}"
data-action=
"0"
class=
"icon icon-shoucang2"
style=
"color:#F7B659;"
></i>
<php>
}else{
</php>
<i
data-question_num=
"{$question_num}"
data-question_id=
"{$question.exams_question_id}"
data-action=
"1"
class=
"icon icon-shoucang2"
></i>
<php>
}
</php>
</div>
</dl>
<php>
$question_num++;
</php>
</volist>
</case>
<case
value=
"completion"
>
<!-- 填空题 -->
<volist
name=
"paper_options['options_questions_data'][$options_type['question_type']]"
id=
"question"
>
<php>
if($_GET['joinType'] == 3
&&
!in_array($question['exams_question_id'],$inQuestions)) continue;
</php>
<dl
<
php
>
if(in_array($question['exams_question_id'],$wrongList)){
</php>
class="wrong"
<php>
}
</php>
id="ex{$question_num}" data-type="{$options_type.question_type_key}" data-question_num="{$question_num}">
<dt>
<h5><small>
{$question_num}
</small>
/{$answerData['right_count']+$answerData['wrong_count']}
<!-- {$paper_options.questions_count} -->
<strong>
{$options_type.type_info.question_type_title}
</strong></h5>
<h3>
{$question.content}
</h3>
</dt>
<dd>
<php>
$content = isset($answerData['content'][$question['exams_question_id']]) ? $answerData['content'][$question['exams_question_id']] : [];
</php>
<volist
name=
"question.answer_true_option"
id=
"answer"
>
<label>
{$i}、
<input
type=
"text"
class=
"anserItem"
<
php
>
if($content){
</php>
value="{$content[$i-1]}"
<php>
}
</php>
>
</label>
</volist>
</dd>
<a
href=
"javascript:;"
data-question_num=
"{$question_num}"
class=
"next next_question"
>
下一题
</a>
<div
class=
"operation"
>
<!--答案解析-->
<div
class=
"analysis"
>
<div
class=
"analysis-pic"
>
<h5>
正确答案
</h5>
<ul>
<volist
name=
"question.answer_true_option"
id=
"answer_true"
>
<li>
{$i}、{$answer_true}
</li>
</volist>
</ul>
</div>
<div
class=
"analysis-txt"
>
<h6>
解析
</h6>
<p>
{$question.analyze}
</p>
</div>
</div>
</div>
<div
class=
"collect_hidden"
>
<php>
if($question['is_collect'] == 1){
</php>
<i
data-question_num=
"{$question_num}"
data-question_id=
"{$question.exams_question_id}"
data-action=
"0"
class=
"icon icon-shoucang2"
style=
"color:#F7B659;"
></i>
<php>
}else{
</php>
<i
data-question_num=
"{$question_num}"
data-question_id=
"{$question.exams_question_id}"
data-action=
"1"
class=
"icon icon-shoucang2"
></i>
<php>
}
</php>
</div>
</dl>
<php>
$question_num++;
</php>
</volist>
</case>
<case
value=
"essays"
>
<!-- 简述题-->
<volist
name=
"paper_options['options_questions_data'][$options_type['question_type']]"
id=
"question"
>
<php>
if($_GET['joinType'] == 3
&&
!in_array($question['exams_question_id'],$inQuestions)) continue;
</php>
<dl
<
php
>
if(in_array($question['exams_question_id'],$wrongList)){
</php>
class="wrong"
<php>
}
</php>
id="ex{$question_num}" data-type="{$options_type.question_type_key}" data-question_num="{$question_num}">
<dt>
<h5><small>
{$question_num}
</small>
/{$answerData['right_count']+$answerData['wrong_count']}
<!-- {$paper_options.questions_count} -->
<strong>
{$options_type.type_info.question_type_title}
</strong></h5>
<h3>
{$question.content}
</h3>
</dt>
<dd>
<php>
$content = isset($answerData['content'][$question['exams_question_id']]) ? $answerData['content'][$question['exams_question_id']] : [];
</php>
<textarea
class=
"anserItem"
>
{$content[0]|default=''}
</textarea>
</dd>
<a
href=
"javascript:;"
data-question_num=
"{$question_num}"
class=
"next next_question"
>
下一题
</a>
<div
class=
"operation"
>
<!--答案解析-->
<div
class=
"analysis"
>
<div
class=
"analysis-txt"
>
<h6>
解析
</h6>
<p>
{$question.analyze}
</p>
</div>
</div>
</div>
<div
class=
"collect_hidden"
>
<php>
if($question['is_collect'] == 1){
</php>
<i
data-question_num=
"{$question_num}"
data-question_id=
"{$question.exams_question_id}"
data-action=
"0"
class=
"icon icon-shoucang2"
style=
"color:#F7B659;"
></i>
<php>
}else{
</php>
<i
data-question_num=
"{$question_num}"
data-question_id=
"{$question.exams_question_id}"
data-action=
"1"
class=
"icon icon-shoucang2"
></i>
<php>
}
</php>
</div>
</dl>
<php>
$question_num++;
</php>
</volist>
</case>
</switch>
</dl>
</volist>
</div>
</div>
<!--<!– 统计代码–>-->
<div
id=
"site_analytics_code"
style=
"display:none;"
>
{$site.site_analytics_code|base64_decode}
</div>
<eq
name=
'site.site_online_count'
value=
'1'
>
<script
src=
"{:SITE_URL}/online_check.php?uid={$mid}&uname={$user.uname}&mod={:MODULE_NAME}&app={:APP_NAME}&act={:ACTION_NAME}&action=trace"
></script>
</eq>
<script
src=
"__THEMEW3G__/js/script.js"
></script>
</div>
</body>
</html>
<script
src=
"{$Think.APPS_URL}/exams/_static/js/public_header_footer_media.js"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
window
.
onpopstate
=
function
()
{
$
(
function
(){
window
.
location
.
href
=
"{:U('home/Home/exams')}"
// 显示的解析类型
window
.
type
=
1
;
// 下一题
$
(
".next_question,.go_question"
).
click
(
function
(){
if
(
$
(
this
).
hasClass
(
"go_question"
)){
var
question_num
=
parseInt
(
$
(
this
).
data
(
"question_num"
));
}
else
if
(
window
.
type
==
2
){
// 获取下一个错题
var
next_obj
=
$
(
this
).
parents
(
"dl"
).
nextAll
(
".wrong"
).
first
();
var
question_num
=
next_obj
.
length
>
0
?
next_obj
.
data
(
"question_num"
)
:
0
;
}
else
{
var
question_num
=
parseInt
(
$
(
this
).
data
(
"question_num"
))
+
1
;
}
$
(
".answer-card"
).
hide
();
if
(
$
(
"#ex"
+
question_num
).
length
>
0
){
$
(
"#ex"
+
question_num
).
show
().
siblings
().
hide
();
}
else
{
ui
.
confirm
(
'已经是最后一题了,是否返回第一题?'
,
{
yes
:
function
()
{
if
(
window
.
type
==
2
){
$
(
".static-exam .wrong"
).
first
().
show
().
siblings
().
hide
();
}
else
{
$
(
"#ex1"
).
show
().
siblings
().
hide
();
}
question_num
=
1
;
}
});
}
// 添加搜藏标识
var
html
=
$
(
"#ex"
+
question_num
).
find
(
".collect_hidden"
).
html
();
$
(
".exam-header .view-stop>i"
).
remove
();
$
(
".exam-header .view-stop a"
).
before
(
html
);
if
(
question_num
<=
1
){
$
(
".back-date i"
).
hide
();
}
else
{
$
(
".back-date i"
).
show
();
}
$
(
".static-exam,.footer"
).
show
();
});
/** 查看解析 **/
$
(
".show_analysis"
).
click
(
function
(){
var
type
=
$
(
this
).
data
(
"type"
);
$
(
".static-exam dl"
).
hide
();
if
(
type
==
'wrong'
){
$
(
".static-exam .wrong"
).
first
().
show
();
window
.
type
=
2
;
// 添加搜藏标识
var
html
=
$
(
".static-exam .wrong"
).
first
().
find
(
".collect_hidden"
).
html
();
}
else
{
$
(
".static-exam dl"
).
first
().
show
();
window
.
type
=
1
;
// 添加搜藏标识
var
html
=
$
(
".static-exam dl"
).
first
().
find
(
".collect_hidden"
).
html
();
}
}
new
Vue
({
$
(
".exam-header .view-stop>i"
).
remove
();
el
:
"#app"
,
$
(
".exam-header .view-stop a"
).
before
(
html
);
data
:{
$
(
".exams_questions"
).
show
();
$
(
".exams_top"
).
hide
();
},
});
created
:
function
()
{
// 显示答题面板
$
(
"#show-answer-card"
).
click
(
function
(){
if
(
$
(
".answer-card"
).
is
(
":hidden"
)){
$
(
".static-exam,.footer"
).
hide
();
$
(
".answer-card"
).
show
();
}
else
{
$
(
".static-exam,.footer"
).
show
();
$
(
".answer-card"
).
hide
();
}
});
/** 返回前一题 **/
$
(
".back-date i"
).
click
(
function
(){
if
(
window
.
type
==
2
){
// 获取下一个错题
var
prev_obj
=
$
(
".static-exam dl:visible"
).
prev
(
".wrong"
);
var
question_num
=
prev_obj
.
length
>
0
?
prev_obj
.
data
(
"question_num"
)
:
0
;
}
else
{
var
question_num
=
$
(
".static-exam dl:visible"
).
data
(
"question_num"
)
-
1
;
}
if
(
question_num
<=
1
){
if
(
window
.
type
==
2
){
$
(
".static-exam .wrong"
).
first
().
show
().
siblings
().
hide
();
}
else
{
$
(
"#ex1"
).
show
().
siblings
().
hide
();
}
$
(
".back-date i"
).
hide
();
// 添加搜藏标识
var
html
=
$
(
".static-exam dl"
).
first
().
find
(
".collect_hidden"
).
html
();
$
(
".exam-header .view-stop>i"
).
remove
();
$
(
".exam-header .view-stop a"
).
before
(
html
);
}
else
{
if
(
$
(
"#ex"
+
question_num
).
length
>
0
){
$
(
"#ex"
+
question_num
).
show
().
siblings
().
hide
();
$
(
".back-date i"
).
show
();
// 添加搜藏标识
var
html
=
$
(
"#ex"
+
question_num
).
find
(
".collect_hidden"
).
html
();
$
(
".exam-header .view-stop>i"
).
remove
();
$
(
".exam-header .view-stop a"
).
before
(
html
);
}
}
});
// 搜藏
$
(
".exam-header .view-stop>i"
).
die
(
"click"
).
live
(
"click"
,
function
(){
var
_this
=
$
(
this
);
var
action
=
_this
.
data
(
'action'
);
var
question_id
=
_this
.
data
(
'question_id'
);
// 后台
$
.
post
(
U
(
'exams/Index/collect'
),{
action
:
action
,
source_id
:
question_id
},
function
(
res
){
if
(
typeof
(
res
)
!=
'object'
){
try
{
var
res
=
JSON
.
parse
(
res
);
}
catch
(
e
){
ui
.
error
(
"处理异常,请重新尝试"
);
return
false
;
}
}
},
if
(
res
.
status
==
1
){
mounted
:
function
(){
if
(
action
==
1
){
$
(
"#preloader"
).
hide
();
_this
.
css
(
"color"
,
"#F7B659"
);
},
_this
.
data
(
'action'
,
0
);
methods
:{
var
question_num
=
_this
.
data
(
"question_num"
);
onAll
:
function
()
{
var
collect_hidden
=
$
(
"#ex"
+
question_num
).
find
(
".collect_hidden i"
);
let
url
=
"{:U('exams/index/examsroom')}"
+
"&paper_id="
+
"{$paper['exams_paper_id']}"
+
"&joinType=1&review=true"
collect_hidden
.
css
(
"color"
,
"#F7B659"
);
//console.log(url)
collect_hidden
.
attr
(
'data-action'
,
0
);
window
.
location
.
href
=
url
}
else
{
// 取消收藏
_this
.
css
(
"color"
,
"#888"
);
_this
.
data
(
'action'
,
1
);
var
question_num
=
_this
.
data
(
"question_num"
);
var
collect_hidden
=
$
(
"#ex"
+
question_num
).
find
(
".collect_hidden i"
);
collect_hidden
.
css
(
"color"
,
"#888"
);
collect_hidden
.
attr
(
'data-action'
,
1
);
}
}
return
true
;
}
else
{
ui
.
error
(
res
.
message
);
return
false
;
}
}
})
});
});
});
</script>
</script>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment