Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
educationStu
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
向伟
educationStu
Commits
f576a5a8
Commit
f576a5a8
authored
Sep 07, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
33416f68
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
196 additions
and
177 deletions
+196
-177
readingCompre.vue
src/components/subject/readingCompre.vue
+196
-177
No files found.
src/components/subject/readingCompre.vue
View file @
f576a5a8
...
@@ -5,28 +5,48 @@
...
@@ -5,28 +5,48 @@
<view
class=
"name"
>
<view
class=
"name"
>
<view>
<view>
{{
changeNumToHan
(
sortIndex
)
}}
、
{{
data
.
GroupName
}}
{{
changeNumToHan
(
sortIndex
)
}}
、
{{
data
.
GroupName
}}
<text
style=
"color:#999999;"
>
(共
{{
data
.
DetailsList
.
length
}}
道,
{{
Score
}}
分)
</text>
<text
style=
"color: #999999"
>
(共
{{
data
.
DetailsList
.
length
}}
道,
{{
Score
}}
分)
</text
>
</view>
</view>
<view>
<view>
<text
class=
"Single_Before"
>
{{
ExamIndex
}}
</text>
/
<
text
<text
class=
"Single_Before"
>
{{
ExamIndex
}}
</
text
class=
"Exam_Total"
>
{{
data
.
DetailsList
.
length
}}
</text>
>
/
<text
class=
"Exam_Total"
>
{{
data
.
DetailsList
.
length
}}
</text>
</view>
</view>
</view>
</view>
<swiper
class=
"swiper-box"
:autoplay=
"autoplay"
:current=
"current"
@
change=
"onchange"
>
<swiper
class=
"swiper-box"
:autoplay=
"autoplay"
:current=
"current"
@
change=
"onchange"
>
<swiper-item></swiper-item>
<swiper-item></swiper-item>
<swiper-item
v-for=
"(item1, index1) in data.DetailsList"
:key=
"item1.id"
>
<swiper-item
v-for=
"(item1, index1) in data.DetailsList"
:key=
"item1.id"
>
<view
class=
"item1"
>
<view
class=
"item1"
>
<view
class=
"flex flex_start_center"
>
<view
class=
"flex flex_start_center"
>
<view>
{{
index1
+
1
}}
、
</view>
<view>
{{
index1
+
1
}}
、
</view>
<view
class=
"num readTitle"
v-html=
"item1.Title"
></view>
<view
class=
"num readTitle"
v-html=
"item1.Title"
></view>
</view>
</view>
<view
v-for=
"(item2, index2) in item1.QuestionContentObj"
:key=
"item2.id"
<view
class=
"flex item2 flex_start_center"
>
v-for=
"(item2, index2) in item1.QuestionContentObj"
<view
class=
"chooseNum"
:class=
"
{ myAnswer: item1.myAnswer === item2.Name }"
:key=
"item2.id"
@click="change(index1, index2)">
{{
item2
.
Name
}}
class=
"flex item2 flex_start_center"
>
<view
class=
"chooseNum"
:class=
"
{ myAnswer: item1.myAnswer === item2.Name }"
@click="change(index1, index2)"
>
{{
item2
.
Name
}}
</view>
</view>
<view
class=
"chooseName"
@
click=
"change(index1, index2)"
v-html=
"item2.Content"
></view>
<view
class=
"chooseName"
@
click=
"change(index1, index2)"
v-html=
"item2.Content"
></view>
</view>
</view>
</view>
</view>
</swiper-item>
</swiper-item>
...
@@ -38,7 +58,7 @@
...
@@ -38,7 +58,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
import
{
ref
,
ref
,
reactive
,
reactive
,
toRefs
,
toRefs
,
...
@@ -47,20 +67,15 @@
...
@@ -47,20 +67,15 @@
watch
,
watch
,
computed
,
computed
,
onMounted
,
onMounted
,
}
from
"vue"
;
}
from
"vue"
;
import
{
import
{
changeNumToHan
}
from
"../../utils/index"
;
changeNumToHan
export
default
{
}
from
"../../utils/index"
;
export
default
{
props
:
{
props
:
{
paperData
:
Object
,
paperData
:
Object
,
sort
:
Number
sort
:
Number
,
},
},
setup
(
props
,
context
)
{
setup
(
props
,
context
)
{
let
{
let
{
ctx
}
=
getCurrentInstance
();
ctx
}
=
getCurrentInstance
();
let
data
=
reactive
({
let
data
=
reactive
({
autoplay
:
false
,
autoplay
:
false
,
sortIndex
:
props
.
sort
+
1
,
sortIndex
:
props
.
sort
+
1
,
...
@@ -69,6 +84,10 @@
...
@@ -69,6 +84,10 @@
current
:
1
,
//默认从第几个开始-用于从快捷菜单点入
current
:
1
,
//默认从第几个开始-用于从快捷菜单点入
ExamIndex
:
1
,
//第几题
ExamIndex
:
1
,
//第几题
});
});
data
.
data
.
DetailsList
.
forEach
((
item
)
=>
{
item
.
Title
=
item
.
Title
.
replace
(
/\<img/gi
,
'<img style="max-width:100%"'
);
console
.
log
(
90
,
item
.
Title
);
});
let
methods
=
{
let
methods
=
{
changeNumToHan
,
changeNumToHan
,
...
@@ -88,35 +107,35 @@
...
@@ -88,35 +107,35 @@
//获取总分
//获取总分
getScore
()
{
getScore
()
{
data
.
Score
=
0
;
data
.
Score
=
0
;
data
.
data
.
DetailsList
.
forEach
(
x
=>
{
data
.
data
.
DetailsList
.
forEach
((
x
)
=>
{
data
.
Score
+=
parseFloat
(
x
.
Score
);
data
.
Score
+=
parseFloat
(
x
.
Score
);
})
});
},
},
onchange
(
e
)
{
onchange
(
e
)
{
data
.
ExamIndex
=
e
.
detail
.
current
;
data
.
ExamIndex
=
e
.
detail
.
current
;
if
(
data
.
ExamIndex
===
data
.
data
.
DetailsList
.
length
+
1
)
{
if
(
data
.
ExamIndex
===
data
.
data
.
DetailsList
.
length
+
1
)
{
console
.
log
(
'进入'
)
console
.
log
(
"进入"
);
this
.
$emit
(
'getAfterTopic'
);
this
.
$emit
(
"getAfterTopic"
);
}
}
if
(
e
.
detail
.
current
==
0
)
{
if
(
e
.
detail
.
current
==
0
)
{
this
.
$emit
(
'getBeforeTopic'
);
this
.
$emit
(
"getBeforeTopic"
);
}
}
}
},
};
};
onMounted
(()
=>
{
onMounted
(()
=>
{
console
.
log
(
props
.
paperData
,
'props.paperData'
);
console
.
log
(
props
.
paperData
,
"props.paperData"
);
that
.
getScore
();
that
.
getScore
();
})
});
let
that
=
methods
;
let
that
=
methods
;
return
{
return
{
...
toRefs
(
data
),
...
toRefs
(
data
),
...
methods
,
...
methods
,
};
};
},
},
};
};
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.name
{
.name
{
height
:
90
rpx
;
height
:
90
rpx
;
font-size
:
28
rpx
;
font-size
:
28
rpx
;
font-family
:
PingFang
SC
;
font-family
:
PingFang
SC
;
...
@@ -125,54 +144,54 @@
...
@@ -125,54 +144,54 @@
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
justify-content
:
space-between
;
}
}
.Single_Before
{
.Single_Before
{
font-size
:
28
rpx
;
font-size
:
28
rpx
;
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#DA
7878
;
color
:
#da
7878
;
}
}
.Exam_Total
{
.Exam_Total
{
font-size
:
25
rpx
;
font-size
:
25
rpx
;
color
:
gray
;
color
:
gray
;
}
}
.swiper-box
{
.swiper-box
{
height
:
calc
(
100vh
-
270
rpx
);
height
:
calc
(
100vh
-
270
rpx
);
box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
}
.num
{
.num
{
font-size
:
26
rpx
;
font-size
:
26
rpx
;
font-family
:
PingFang
SC
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#111111
;
color
:
#111111
;
}
}
.readTitle
img
{
.readTitle
img
{
max-width
:
100%
;
max-width
:
100%
;
}
}
.item
{
.item
{
/* margin-bottom: 40rpx; */
/* margin-bottom: 40rpx; */
position
:
relative
;
position
:
relative
;
}
}
.item1
{
.item1
{
/* margin: 25rpx 0; */
/* margin: 25rpx 0; */
align-items
:
center
;
align-items
:
center
;
}
}
.item2
{
.item2
{
padding-left
:
25
rpx
;
padding-left
:
25
rpx
;
margin
:
30
rpx
0
;
margin
:
30
rpx
0
;
}
}
.myAnswer
{
.myAnswer
{
background-color
:
#00acf9
!important
;
background-color
:
#00acf9
!important
;
color
:
#ffffff
!important
;
color
:
#ffffff
!important
;
}
}
.chooseNum
{
.chooseNum
{
width
:
40
rpx
;
width
:
40
rpx
;
height
:
40
rpx
;
height
:
40
rpx
;
text-align
:
center
;
text-align
:
center
;
...
@@ -184,12 +203,12 @@
...
@@ -184,12 +203,12 @@
font-family
:
PingFang
SC
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#111111
;
color
:
#111111
;
}
}
.chooseName
{
.chooseName
{
font-size
:
24
rpx
;
font-size
:
24
rpx
;
font-family
:
PingFang
SC
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
font-weight
:
500
;
color
:
#111111
;
color
:
#111111
;
}
}
</
style
>
</
style
>
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