Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wxapp
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
wxapp
Commits
8812f050
Commit
8812f050
authored
Sep 26, 2018
by
ArronYR
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add api
parent
fdd4d6cd
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
260 additions
and
23 deletions
+260
-23
app.js
+1
-1
app.wxss
+21
-1
components/banners/index.js
+1
-1
components/banners/index.wxss
+1
-2
pages/index/index.js
+8
-2
pages/index/index.json
+6
-1
pages/index/index.wxml
+72
-0
pages/index/index.wxss
+82
-4
pages/me/index.wxss
+8
-6
project.config.json
+4
-4
styles/form.wxss
+26
-0
utils/Api.js
+30
-1
No files found.
app.js
View file @
8812f050
...
...
@@ -5,7 +5,7 @@ App({
onLaunch
:
function
(
options
)
{
this
.
options
=
options
// 用户登录
this
.
checkUserLogin
()
//
this.checkUserLogin()
},
onShow
:
function
(
options
)
{
...
...
app.wxss
View file @
8812f050
...
...
@@ -37,6 +37,26 @@ button.form-button::after {
background-color: transparent;
}
.text-gray{
.text-gray
{
color: rgb(191, 191, 191);
}
.text-red {
color: rgb(255, 68, 0);
}
.text-hint {
color: rgb(153, 153, 153);
}
.text-small {
font-size: 12px;
}
.margin-right-2 {
margin-right: 2px;
}
.margin-top-10 {
motion-path: 20px;
}
components/banners/index.js
View file @
8812f050
...
...
@@ -27,7 +27,7 @@ Component({
data
:
{
banners
:
[],
indicatorDots
:
true
,
autoplay
:
tru
e
,
autoplay
:
fals
e
,
interval
:
5000
,
duration
:
1000
},
...
...
components/banners/index.wxss
View file @
8812f050
/* components/banners/index.wxss */
@import "/styles/form.wxss";
.banners-wrapper {
width: 100%;
position: relative;
box-shadow: 0px 0px 15px #c6c6c6;
border-radius: 0px;
}
.banners-swipper {
...
...
pages/index/index.js
View file @
8812f050
...
...
@@ -53,7 +53,11 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
wx
.
showNavigationBarLoading
()
this
.
getHomeData
(()
=>
{
wx
.
hideNavigationBarLoading
()
wx
.
stopPullDownRefresh
()
})
},
/**
...
...
@@ -70,7 +74,7 @@ Page({
},
getHomeData
:
function
()
{
getHomeData
:
function
(
callback
)
{
api
.
home
.
all
({
token
:
app
.
globalData
.
token
}).
then
(
res
=>
{
...
...
@@ -80,6 +84,7 @@ Page({
businesses
:
res
.
data
.
businessProjects
,
guides
:
res
.
data
.
guides
})
typeof
callback
==
"function"
&&
callback
()
})
}
})
\ No newline at end of file
pages/index/index.json
View file @
8812f050
...
...
@@ -4,6 +4,10 @@
"enablePullDownRefresh"
:
true
,
"usingComponents"
:
{
"banner"
:
"/components/banners/index"
,
"navs"
:
"/components/navs/index"
"navs"
:
"/components/navs/index"
,
"i-cell-group"
:
"/iview/cell-group/index"
,
"i-cell"
:
"/iview/cell/index"
,
"i-row"
:
"/iview/row/index"
,
"i-col"
:
"/iview/col/index"
}
}
\ No newline at end of file
pages/index/index.wxml
View file @
8812f050
...
...
@@ -2,4 +2,75 @@
<view class='v-page'>
<banner />
<navs />
<i-cell-group i-class="section-wrapper">
<i-cell title="最新活动" is-link url="/pages/dashboard/index">
<text slot="footer" class='text-gray text-small'>更多</text>
</i-cell>
<i-row i-class="col-wrapper">
<i-col span="8" i-class="col-class" wx:for="{{news}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id" wx:if="{{idx < 3}}">
<view class='col-item'>
<image class='image' src="{{n.poster}}" mode='aspectFill'></image>
<view class='title'>{{n.title}}</view>
<view class='info'>
<text class='text-red text-small mergin-right-2'>¥ {{n.price}}</text>
<text>元/{{n.night_num}}晚</text>
</view>
</view>
</i-col>
</i-row>
</i-cell-group>
<i-cell-group i-class="section-wrapper">
<i-cell title="爆款专区" is-link url="/pages/dashboard/index">
<text slot="footer" class='text-gray text-small'>更多</text>
</i-cell>
<i-row i-class="col-wrapper">
<i-col span="8" i-class="col-class" wx:for="{{heats}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id" wx:if="{{idx < 3}}">
<view class='col-item'>
<image class='image' src="{{n.poster}}" mode='aspectFill'></image>
<view class='title'>{{n.title}}</view>
<view class='info'>
<text class='text-red text-small mergin-right-2'>¥ {{n.price}}</text>
<text>元/{{n.night_num}}晚</text>
</view>
</view>
</i-col>
</i-row>
</i-cell-group>
<i-cell-group i-class="section-wrapper">
<i-cell title="酒店预订" is-link url="/pages/dashboard/index">
<text slot="footer" class='text-gray text-small'>更多</text>
</i-cell>
<i-row i-class="col-wrapper">
<i-col span="12" i-class="col-class" wx:for="{{businesses}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
<view class='col-item'>
<image class='image' src="{{n.poster}}" mode='aspectFill'></image>
<view class='title'>{{n.title}}</view>
<view class='info'>
<text class='text-red text-small mergin-right-2'>¥ {{n.price}}</text>
<text>元/{{n.night_num}}晚</text>
</view>
</view>
</i-col>
</i-row>
</i-cell-group>
<i-cell-group i-class="section-wrapper">
<i-cell title="美行攻略" is-link url="/pages/guide/index">
<text slot="footer" class='text-gray text-small'>更多</text>
</i-cell>
<view class="guides-wrapper">
<view class='guide-item' wx:for="{{guides}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
<image class='image' src="{{n.poster}}" mode='aspectFill'></image>
<view class='info'>
<view class='text-small intro'>{{n.intro ? n.intro : ''}}</view>
<view class='text-small text-hint'>
<text wx:for="{{n.tags}}" wx:for-index="idx" wx:key="idx" wx:for-item="t">{{t}}</text>
</view>
</view>
</view>
</view>
</i-cell-group>
</view>
\ No newline at end of file
pages/index/index.wxss
View file @
8812f050
/* pages/index.wxss */
.v-page{
}
\ No newline at end of file
page {
background-color: #f5f5f5;
height: 100%;
}
.v-page {
position: relative;
}
.section-wrapper {
margin-top: 10px;
background-color: #fff;
}
.col-wrapper {
padding: 0 7px;
position: relative;
}
.col-class {
padding: 0 7px;
position: relative;
margin-bottom: 7px;
}
.col-item {
position: relative;
border: 1px solid #eee;
padding-bottom: 10px;
}
.col-item .image {
width: 100%;
height: 110px;
}
.col-item .title {
text-align: center;
font-size: 12px;
color: rgb(51, 51, 51);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 2px 2px;
}
.col-item .info {
text-align: center;
font-size: 12px;
color: rgb(153, 153, 153);
margin-top: 2px;
}
.guides-wrapper {
position: relative;
padding: 0 15px;
}
.guide-item {
position: relative;
border-bottom: 1px solid #eee;
padding: 10px 0;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.guide-item image {
display: inline-block;
width: 130px;
height: 95px;
}
.guide-item .info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 5px 10px;
color: rgb(51, 51, 51);
}
pages/me/index.wxss
View file @
8812f050
/* pages/me/index.wxss */
page{
page {
background-color: #f5f5f5;
height: 100%;
height: 100%;
}
.v-page {
background-color: #f5f5f5;
height: 100%;
...
...
@@ -60,6 +62,7 @@ page{
}
/* 我的订单 */
.order-status-box {
background-color: #fff;
height: 182rpx;
...
...
@@ -80,8 +83,8 @@ page{
display: flex;
flex-direction: column;
font-size: 24rpx;
justify-content:
space-between;
align-items:
center
;
justify-content: space-between;
align-items:
center
;
height: 85rpx;
color: rgb(191, 191, 191);
}
...
...
@@ -91,7 +94,6 @@ page{
height: 44rpx;
}
.vip{
.vip
{
margin-bottom: 20rpx;
}
project.config.json
View file @
8812f050
...
...
@@ -37,12 +37,12 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
2
,
"current"
:
0
,
"list"
:
[
{
"id"
:
-1
,
"name"
:
"
logs
"
,
"pathName"
:
"pages/
logs/logs
"
,
"id"
:
0
,
"name"
:
"
美行攻略
"
,
"pathName"
:
"pages/
guide/index
"
,
"query"
:
""
},
{
...
...
styles/form.wxss
0 → 100644
View file @
8812f050
/* 用于收集 formid 的 button 样式 */
button.form-button {
background-color: transparent;
padding: 0;
margin: 0;
display: inline;
position: static;
border: 0;
padding-left: 0;
padding-right: 0;
border-radius: 0;
font-size: 0;
text-align: left;
line-height: normal;
}
button.form-button::after {
content: '';
width: 0;
height: 0;
-webkit-transform: scale(1);
transform: scale(1);
display: none;
background-color: transparent;
}
utils/Api.js
View file @
8812f050
...
...
@@ -23,8 +23,36 @@ export const home = {
}
}
export
const
guide
=
{
list
:
(
params
)
=>
{
return
req
.
post
(
'project/guides'
,
params
).
then
(
res
=>
res
.
data
)
},
detail
:
(
params
)
=>
{
return
req
.
post
(
'guide/detail'
,
params
).
then
(
res
=>
res
.
data
)
}
}
export
const
me
=
{
info
:
params
=>
{
return
req
.
post
(
'user/index'
,
params
).
then
(
res
=>
res
.
data
)
},
update
:
params
=>
{
return
req
.
post
(
'user/update'
,
params
).
then
(
res
=>
res
.
data
)
},
collections
:
params
=>
{
return
req
.
post
(
'user/userCollections'
,
params
).
then
(
res
=>
res
.
data
)
},
vipPrice
:
params
=>
{
return
req
.
post
(
'order/getVipPrice'
,
params
).
then
(
res
=>
res
.
data
)
},
vipOrder
:
params
=>
{
return
req
.
post
(
'order/vipOrder'
,
params
).
then
(
res
=>
res
.
data
)
}
}
export
default
{
login
,
shareTicket
,
home
home
,
guide
}
\ No newline at end of file
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