Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_front_2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenqikuai
fns_front_2
Commits
67621719
Commit
67621719
authored
Sep 18, 2021
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页-banner
parent
46eae6f5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
9 deletions
+44
-9
index.ts
src/service/BannerService/index.ts
+12
-0
index.ts
src/service/FileService/index.ts
+3
-0
Banner.vue
src/views/withMenu/Home/Banner/Banner.vue
+6
-3
index.vue
src/views/withMenu/Home/index.vue
+23
-6
No files found.
src/service/BannerService/index.ts
0 → 100644
View file @
67621719
import
baseAxios
from
'../index'
export
function
queryBannerList
(
data
:
{
location
:
string
})
{
return
baseAxios
<
{
count
:
number
file_name
:
string
[]
}
>
({
url
:
'/banner/query/list'
,
method
:
'get'
,
params
:
data
,
})
}
src/service/FileService/index.ts
0 → 100644
View file @
67621719
export
function
getImageSrcFromFileHash
(
file_hash
:
string
)
{
return
`/proxyApi/api/v1/image/show?file_hash=
${
file_hash
}
`
}
src/views/withMenu/Home/Banner/Banner.vue
View file @
67621719
...
...
@@ -6,7 +6,7 @@
</van-swipe>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
"vue"
;
import
{
defineComponent
,
PropType
}
from
"vue"
;
import
{
Image
}
from
"vant"
;
export
default
defineComponent
({
...
...
@@ -15,7 +15,7 @@ export default defineComponent({
},
props
:
{
bannerUrls
:
{
type
:
Array
,
type
:
Array
as
PropType
<
string
[]
>
,
default
()
{
return
[
"https://img01.yzcdn.cn/vant/apple-1.jpg"
,
...
...
@@ -28,11 +28,14 @@ export default defineComponent({
</
script
>
<
style
scoped
lang=
"less"
>
.my-swipe {
min-height: 200px;
}
.my-swipe .van-swipe-item {
color: #fff;
font-size: 20px;
line-height: 100px;
text-align: center;
background-color: #
818c92
;
background-color: #
e8edf0
;
}
</
style
>
src/views/withMenu/Home/index.vue
View file @
67621719
<
template
>
<div
class=
"page flex-col"
>
<div
class=
"outer1 flex-col"
>
<Banner
class=
"w-full overflow-hidden"
/>
<Banner
class=
"w-full overflow-hidden"
:bannerUrls=
"bannerList"
/>
<AppList
:appList=
"appList"
class=
"mt-7"
/>
<Notify
class=
"mt-2.5"
/>
<!--
<group-title
class=
"mt-7"
title=
"精选理财"
/>
-->
<!--
<div
class=
"mx-5 flex justify-between mt-5"
>
<FnsCard
v-for=
"(item, index) in loopData0"
:item=
"item"
:key=
"index"
/>
</div>
-->
<group-title
class=
"mt-7"
title=
"热门贷款"
@
click=
"$router.push(
{
name: 'Loan'})"
/>
</div>
-->
<group-title
class=
"mt-7"
title=
"热门贷款"
@
click=
"$router.push(
{
name: 'Loan' })"
/>
<LoanCard
class=
"mt-5"
/>
<group-title
class=
"mt-7"
title=
"精彩直播"
/>
<LiveCard
class=
"mt-4"
/>
...
...
@@ -16,17 +16,17 @@
<img
class=
"mx-5 mt-5"
src=
"https://alipic.lanhuapp.com/SketchPng94bbf087d5f40926bfd40b724cb11350e55eec2bd48ad126dcc60c87d685ff2d"
alt
=
""
alt
@
click=
"$router.push('ActivityDetail')"
/>
<group-title
class=
"mt-7"
title=
"热门资讯"
@
click=
"$router.push('News')"
/>
<group-title
class=
"mt-7"
title=
"热门资讯"
@
click=
"$router.push('News')"
/>
<HotNews
v-for=
"n in 2"
:key=
"n"
/>
</div>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
"vue"
;
import
{
defineComponent
}
from
"vue"
;
import
Banner
from
"./Banner/Banner.vue"
;
import
AppList
from
"./AppList/index.vue"
;
import
appList
from
"./appList"
;
...
...
@@ -37,6 +37,8 @@ import FnsCard from "./FnsCard/index.vue";
import
LoanCard
from
"@/components/Loan/LoanCard/index.vue"
;
import
LiveCard
from
"@/components/LiveCard/index.vue"
;
import
HotNews
from
"@/components/HotNews/index.vue"
;
import
{
queryBannerList
}
from
"@/service/BannerService"
;
import
{
getImageSrcFromFileHash
}
from
"@/service/FileService"
;
export
default
defineComponent
({
components
:
{
...
...
@@ -53,6 +55,7 @@ export default defineComponent({
data
()
{
return
{
appList
,
bannerList
:
[]
as
string
[],
loopData0
:
[
{
lanhutext0
:
"货币市场基金"
,
...
...
@@ -76,6 +79,20 @@ export default defineComponent({
constants
:
{},
};
},
mounted
(){
this
.
fetchBannerList
();
},
methods
:
{
async
fetchBannerList
()
{
const
ret
=
await
queryBannerList
({
location
:
'1'
});
if
(
ret
.
code
===
200
)
{
const
list
=
ret
.
data
.
file_name
.
map
(
i
=>
{
return
getImageSrcFromFileHash
(
i
)
})
this
.
bannerList
=
list
;
}
}
}
});
</
script
>
<
style
scoped
>
...
...
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