Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yikao
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
yikao
Commits
b27c963a
Commit
b27c963a
authored
Apr 24, 2020
by
duanledexianxianxian
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync
parent
9369e86c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
31 deletions
+84
-31
src/views/exam/hospitalFinalExam/components/List.vue
src/views/exam/hospitalFinalExam/components/List.vue
+47
-29
src/views/exam/hospitalFinalExam/index.vue
src/views/exam/hospitalFinalExam/index.vue
+1
-1
src/views/exam/hospitalFinalExam/list/Basic.vue
src/views/exam/hospitalFinalExam/list/Basic.vue
+36
-1
No files found.
src/views/exam/hospitalFinalExam/components/List.vue
View file @
b27c963a
<
template
>
<
template
>
<div
class=
"root"
>
<div
class=
"root"
>
<van-search
v-model=
"value"
placeholder=
"请输入搜索关键词"
/>
<van-search
placeholder=
"请输入搜索关键词"
/>
<div
class=
"list"
>
<div
class=
"list"
>
<van-list
v-model=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"on
Load"
>
<van-list
v-model=
"loading"
:finished=
"listFinished"
finished-text=
"没有更多了"
@
load=
"handle
Load"
>
<div
class=
"item"
v-for=
"(item
,index) in list"
:key=
"index
"
>
<div
class=
"item"
v-for=
"(item
) in dataSouce"
:key=
"item.id
"
>
<img
src=
"@/assets/images/exam1.png"
/>
<img
src=
"@/assets/images/exam1.png"
/>
<div
class=
"right"
>
<div
class=
"right"
>
<div
class=
"title"
>
{{
item
.
title
}}
</div>
<div
class=
"title"
>
{{
item
.
title
}}
</div>
<div
class=
"action"
>
<div
class=
"action"
>
<div
class=
"like flex-space-around"
>
<div
class=
"like flex-space-around"
>
<van-icon
name=
"like"
size=
"24"
:color=
"item.like===0? '#ff7b7b':'#cccccc'"
/>
<van-icon
name=
"like"
size=
"24"
:color=
"item.like===0? '#ff7b7b':'#cccccc'"
@
click=
"handelLike(item.id)"
/>
<div
class=
"label"
>
收藏
</div>
<div
class=
"label"
>
收藏
</div>
</div>
</div>
<div
class=
"share flex-space-around"
>
<div
class=
"share flex-space-around"
>
<van-icon
name=
"share"
size=
"24"
color=
"#cccccc"
/>
<van-icon
name=
"share"
size=
"24"
color=
"#cccccc"
@
click=
"handleShare(item.id)"
/>
<div
class=
"label"
>
分享
</div>
<div
class=
"label"
>
分享
</div>
</div>
</div>
<div
class=
"answer"
>
<div
class=
"answer"
>
...
@@ -28,34 +33,47 @@
...
@@ -28,34 +33,47 @@
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
props
:
{
type
:
{
type
:
Number
,
default
:
0
},
loading
:
{
type
:
Boolean
,
default
:
false
},
finished
:
{
default
:
false
},
list
:
{
default
:
[]
},
onLoad
:
Function
},
data
()
{
data
()
{
return
{
return
{
list
:
[]
,
listLoading
:
this
.
loading
,
loading
:
false
,
listFinished
:
this
.
finished
,
finished
:
false
dataSouce
:
this
.
list
};
};
},
},
methods
:
{
methods
:
{
onLoad
()
{
handleLoad
(
e
)
{
// 异步更新数据
this
.
onLoad
(
e
)
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
},
setTimeout
(()
=>
{
// 处理收藏
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
handleLike
(
id
)
{
this
.
list
.
push
({
const
index
=
this
.
dataSource
.
findIndex
(
value
=>
value
===
id
);
id
:
i
,
if
(
index
>
-
1
)
{
like
:
i
%
3
===
0
?
1
:
0
,
return
title
:
"
2020版中西医结合执业助理医师 模拟试
"
}
});
},
}
// 处理分享
handleShare
(
id
)
{
// 加载状态结束
const
index
=
this
.
dataSource
.
findIndex
(
value
=>
value
===
id
);
this
.
loading
=
false
;
if
(
index
>
-
1
)
{
return
// 数据全部加载完成
}
if
(
this
.
list
.
length
>=
40
)
{
this
.
finished
=
true
;
}
},
1000
);
}
}
}
}
};
};
...
@@ -77,7 +95,7 @@ export default {
...
@@ -77,7 +95,7 @@ export default {
display: flex;
display: flex;
margin: 0 8px 24px;
margin: 0 8px 24px;
justify-content: space-between;
justify-content: space-between;
img {
img {
height: 92px;
height: 92px;
width: 120px;
width: 120px;
...
...
src/views/exam/hospitalFinalExam/index.vue
View file @
b27c963a
...
@@ -26,7 +26,7 @@ export default {
...
@@ -26,7 +26,7 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
active
:
2
active
:
0
};
};
}
}
};
};
...
...
src/views/exam/hospitalFinalExam/list/Basic.vue
View file @
b27c963a
<
template
>
<
template
>
<div
class=
"root"
>
<div
class=
"root"
>
<List></List>
<List
:list=
"list"
:loading=
"loading"
:finished=
"finished"
:onLoad=
"loadData"
></List>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -8,6 +8,41 @@ import List from "../components/List";
...
@@ -8,6 +8,41 @@ import List from "../components/List";
export
default
{
export
default
{
components
:
{
components
:
{
List
List
},
data
()
{
return
{
list
:[],
loading
:
false
,
finished
:
false
};
},
created
()
{
// 加载数据
// this.loadData();
},
methods
:
{
// 加载数据
loadData
:
function
(){
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
setTimeout
(()
=>
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
this
.
list
.
push
({
id
:
i
,
like
:
i
%
3
===
0
?
1
:
0
,
title
:
"
2020版中西医结合执业助理医师 模拟试
"
});
}
// 加载状态结束
this
.
loading
=
false
;
// 数据全部加载完成
if
(
this
.
list
.
length
>=
40
)
{
this
.
finished
=
true
;
}
},
1000
);
}
}
}
};
};
</
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