Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
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
Damon
study
Commits
833802ec
Commit
833802ec
authored
Jul 24, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 搜索接口对接
parent
169f88f2
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
222 additions
and
158 deletions
+222
-158
uni-list.vue
src/components/uni-list/uni-list.vue
+106
-0
pages.json
src/pages.json
+1
-2
answer.vue
src/pages/learn/answer.vue
+7
-1
detail.vue
src/pages/search/detail.vue
+108
-155
No files found.
src/components/uni-list/uni-list.vue
0 → 100644
View file @
833802ec
<
template
>
<!-- #ifndef APP-NVUE -->
<view
class=
"uni-list uni-border-top-bottom"
>
<view
v-if=
"border"
class=
"uni-list--border-top"
></view>
<slot
/>
<view
v-if=
"border"
class=
"uni-list--border-bottom"
></view>
</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<list
class=
"uni-list"
:class=
"
{ 'uni-list--border': border }" :enableBackToTop="enableBackToTop" loadmoreoffset="15">
<slot
/></list>
<!-- #endif -->
</
template
>
<
script
>
/**
* List 列表
* @description 列表组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
* @property {String} border = [true|false] 标题
*/
export
default
{
name
:
'uniList'
,
'mp-weixin'
:
{
options
:
{
multipleSlots
:
false
}
},
props
:
{
enableBackToTop
:
{
type
:
[
Boolean
,
String
],
default
:
false
},
scrollY
:
{
type
:
[
Boolean
,
String
],
default
:
false
},
border
:
{
type
:
Boolean
,
default
:
true
}
},
// provide() {
// return {
// list: this
// };
// },
created
()
{
this
.
firstChildAppend
=
false
;
},
methods
:
{
loadMore
(
e
)
{
this
.
$emit
(
'scrolltolower'
);
}
}
};
</
script
>
<
style
lang=
"scss"
>
.uni-list
{
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
background-color
:
$uni-bg-color
;
position
:
relative
;
flex-direction
:
column
;
}
.uni-list--border
{
position
:
relative
;
/* #ifdef APP-NVUE */
border-top-color
:
$uni-border-color
;
border-top-style
:
solid
;
border-top-width
:
0
.5px
;
border-bottom-color
:
$uni-border-color
;
border-bottom-style
:
solid
;
border-bottom-width
:
0
.5px
;
/* #endif */
z-index
:
-1
;
}
/* #ifndef APP-NVUE */
.uni-list--border-top
{
position
:
absolute
;
top
:
0
;
right
:
0
;
left
:
0
;
height
:
1px
;
-webkit-transform
:
scaleY
(
0
.5
);
transform
:
scaleY
(
0
.5
);
background-color
:
$uni-border-color
;
z-index
:
1
;
}
.uni-list--border-bottom
{
position
:
absolute
;
bottom
:
0
;
right
:
0
;
left
:
0
;
height
:
1px
;
-webkit-transform
:
scaleY
(
0
.5
);
transform
:
scaleY
(
0
.5
);
background-color
:
$uni-border-color
;
}
/* #endif */
</
style
>
src/pages.json
View file @
833802ec
...
@@ -63,8 +63,7 @@
...
@@ -63,8 +63,7 @@
"name"
:
"searchDetail"
,
"name"
:
"searchDetail"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"搜索结果"
,
"navigationBarTitleText"
:
"搜索结果"
,
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
"disableScroll"
:
true
}
}
}
}
]
]
...
...
src/pages/learn/answer.vue
View file @
833802ec
...
@@ -525,7 +525,13 @@ export default {
...
@@ -525,7 +525,13 @@ export default {
const
info
=
this
.
list
.
find
(
v
=>
v
.
index
===
this
.
currentIndex
)
const
info
=
this
.
list
.
find
(
v
=>
v
.
index
===
this
.
currentIndex
)
const
action
=
status
?
'removeCollection'
:
'joinCollection'
const
action
=
status
?
'removeCollection'
:
'joinCollection'
this
.
$u
.
api
[
action
]({
questionId
:
info
.
id
}).
then
(
res
=>
{
this
.
$u
.
api
[
action
]({
questionId
:
info
.
id
}).
then
(
res
=>
{
if
(
res
)
info
.
collectionFlag
=
!
status
if
(
res
.
data
)
{
info
.
collectionFlag
=
!
status
if
(
this
.
source
===
1
)
{
//更新缓存数据
this
.
questionList
[
this
.
currentIndex
]
=
info
this
.
$u
.
vuex
(
'questionList'
,
this
.
questionList
)
}
}
})
})
},
},
// 移除
// 移除
...
...
src/pages/search/detail.vue
View file @
833802ec
This diff is collapsed.
Click to expand it.
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