Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoya-agent-program
Project
Project
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
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
chenqian
xiaoya-agent-program
Commits
4d9f1c46
Commit
4d9f1c46
authored
Apr 07, 2020
by
18868195926
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 首页框架开发
parent
7de4e4e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
7 deletions
+95
-7
index.jsx
src/pages/index/index.jsx
+95
-7
No files found.
src/pages/index/index.jsx
View file @
4d9f1c46
import
Taro
from
'@tarojs/taro'
import
BaseComponent
from
'@/helper/baseComponent'
;
import
{
View
,
Image
,
Text
,
Button
}
from
'@tarojs/components'
import
{
View
,
Image
,
Text
,
Swiper
,
SwiperItem
,
ScrollView
}
from
'@tarojs/components'
import
{
connect
}
from
'@tarojs/redux'
import
{
setUserInfo
}
from
'@/actions/user'
import
NavBar
from
'@/components/NavBar'
...
...
@@ -43,18 +43,15 @@ class Index extends BaseComponent {
this
.
setState
({
located
:
true
})
})
}
// 手动选择地址
selectCity
(){
Taro
.
navigateTo
({
url
:
'/pages/citySelect/index'
})
}
bindgetuserinfo
(
e
)
{
console
.
log
(
e
)
}
render
()
{
const
{
nav
}
=
this
.
props
const
titleTop
=
nav
.
globalData
.
navHeight
-
nav
.
globalData
.
navTop
const
titleTop
=
(
nav
.
globalData
.
navHeight
-
nav
.
globalData
.
navTop
-
17
)
/
2
+
nav
.
globalData
.
navTop
const
{
located
}
=
this
.
state
;
const
user
=
this
.
props
.
user
;
console
.
log
(
'user'
,
user
)
...
...
@@ -72,7 +69,98 @@ class Index extends BaseComponent {
<
Text
className=
{
`${noLoc ? 'no-loc' : ''}`
}
>
{
noLoc
?
'未获取定位'
:
user
.
city
}
</
Text
>
</
View
>
</
NavBar
>
<
Button
onGetUserInfo=
{
this
.
bindgetuserinfo
}
openType=
'getUserInfo'
>
获取授权
</
Button
>
<
Swiper
className=
'swpier-view'
indicatorColor=
'#999'
indicatorActiveColor=
'#333'
circular
indicatorDots
autoplay
>
<
SwiperItem
>
<
Image
className=
'img'
src=
'https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1586229157&di=6997346b65b0e2e2ff7a733ae9b5fcc5&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
/>
</
SwiperItem
>
<
SwiperItem
>
<
Image
className=
'img'
src=
'https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1586229157&di=6997346b65b0e2e2ff7a733ae9b5fcc5&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
/>
</
SwiperItem
>
<
SwiperItem
>
<
Image
className=
'img'
src=
'https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1586229157&di=6997346b65b0e2e2ff7a733ae9b5fcc5&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
/>
</
SwiperItem
>
</
Swiper
>
<
View
className=
'sub-nav'
>
<
View
className=
'content'
>
<
Image
className=
'img'
src=
'https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1586229157&di=6997346b65b0e2e2ff7a733ae9b5fcc5&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
/>
<
Text
>
领券
</
Text
>
</
View
>
<
View
className=
'content'
>
<
Image
className=
'img'
src=
'https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1586229157&di=6997346b65b0e2e2ff7a733ae9b5fcc5&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
/>
<
Text
>
券包
</
Text
>
</
View
>
</
View
>
<
View
className=
'sub-title'
>
<
Text
>
领券中心
</
Text
>
<
Text
>
查看全部
</
Text
>
</
View
>
<
View
className=
'store-list-title'
>
<
Text
>
附近门店
</
Text
>
</
View
>
<
View
>
<
ScrollView
className=
'scrollview'
scrollY
>
<
View
className=
'list-view'
>
<
Image
className=
'img'
src=
'https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1586229157&di=6997346b65b0e2e2ff7a733ae9b5fcc5&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
/>
<
View
className=
'text-cont'
>
<
Text
>
米雅遍历(北京店)
</
Text
>
<
Text
>
营业时间 10:00 - 18:00
</
Text
>
</
View
>
<
View
className=
'distance'
>
<
Text
>
200m
</
Text
>
</
View
>
</
View
>
<
View
className=
'list-view'
>
<
Image
className=
'img'
src=
'https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1586229157&di=6997346b65b0e2e2ff7a733ae9b5fcc5&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
/>
<
View
className=
'text-cont'
>
<
Text
>
米雅遍历(北京店)
</
Text
>
<
Text
>
营业时间 10:00 - 18:00
</
Text
>
</
View
>
<
View
className=
'distance'
>
<
Text
>
200m
</
Text
>
</
View
>
</
View
>
<
View
className=
'list-view'
>
<
Image
className=
'img'
src=
'https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1586229157&di=6997346b65b0e2e2ff7a733ae9b5fcc5&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
/>
<
View
className=
'text-cont'
>
<
Text
>
米雅遍历(北京店)
</
Text
>
<
Text
>
营业时间 10:00 - 18:00
</
Text
>
</
View
>
<
View
className=
'distance'
>
<
Text
>
200m
</
Text
>
</
View
>
</
View
>
<
View
className=
'list-view'
>
<
Image
className=
'img'
src=
'https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1586229157&di=6997346b65b0e2e2ff7a733ae9b5fcc5&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
/>
<
View
className=
'text-cont'
>
<
Text
>
米雅遍历(北京店)
</
Text
>
<
Text
>
营业时间 10:00 - 18:00
</
Text
>
</
View
>
<
View
className=
'distance'
>
<
Text
>
200m
</
Text
>
</
View
>
</
View
>
<
View
className=
'list-view'
>
<
Image
className=
'img'
src=
'https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1586229157&di=6997346b65b0e2e2ff7a733ae9b5fcc5&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg'
/>
<
View
className=
'text-cont'
>
<
Text
>
米雅遍历(北京店)
</
Text
>
<
Text
>
营业时间 10:00 - 18:00
</
Text
>
</
View
>
<
View
className=
'distance'
>
<
Text
>
200m
</
Text
>
</
View
>
</
View
>
</
ScrollView
>
</
View
>
</
View
>
)
}
...
...
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