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
fd519add
Commit
fd519add
authored
Jan 03, 2019
by
汪睦雄
Browse files
Options
Browse Files
Download
Plain Diff
'修改手机号'
parents
668bee6f
7a7e7638
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
302 additions
and
160 deletions
+302
-160
components/catalog-filter/index.js
+8
-8
components/catalog-filter/index.wxml
+12
-12
components/catalog-filter/index.wxss
+4
-2
components/navs/index.js
+5
-5
components/navs/index.wxml
+1
-1
pages/detail/enroll/index.js
+62
-3
pages/detail/index.wxml
+1
-1
pages/guide/index.js
+48
-45
pages/guide/index.json
+2
-0
pages/guide/index.wxml
+7
-4
pages/guide/index.wxss
+12
-6
pages/index/index.wxml
+3
-3
pages/me/vip/index.js
+56
-22
pages/me/vip/index.wxml
+19
-14
pages/me/vip/index.wxss
+38
-16
pages/search/list/list.js
+12
-5
project.config.json
+6
-7
utils/Api.js
+6
-1
utils/Config.js
+0
-5
No files found.
components/catalog-filter/index.js
View file @
fd519add
...
@@ -15,14 +15,14 @@ Component({
...
@@ -15,14 +15,14 @@ Component({
data
:
{
data
:
{
filter_idx
:
0
,
filter_idx
:
0
,
selected
:
{
selected
:
{
sort
:
'default'
,
order
:
'default'
,
region_params
:{}
region_params
:{}
},
},
selected_titles
:
{
selected_titles
:
{
region
:
'全部地域'
,
region
:
'全部地域'
,
sort
:
'默认排序'
order
:
'默认排序'
},
},
sort
s
:
[
order
s
:
[
{
{
id
:
1
,
id
:
1
,
name
:
'默认排序'
,
name
:
'默认排序'
,
...
@@ -31,11 +31,11 @@ Component({
...
@@ -31,11 +31,11 @@ Component({
{
{
id
:
2
,
id
:
2
,
name
:
'最新发布'
,
name
:
'最新发布'
,
value
:
'
latest
'
value
:
'
new
'
},
{
},
{
id
:
3
,
id
:
3
,
name
:
'价格最低'
,
name
:
'价格最低'
,
value
:
'price
low
'
value
:
'price'
}
}
],
],
...
@@ -71,12 +71,12 @@ Component({
...
@@ -71,12 +71,12 @@ Component({
*/
*/
methods
:
{
methods
:
{
// 排序筛选
// 排序筛选
sort
Filter
:
function
(
event
)
{
order
Filter
:
function
(
event
)
{
let
item
=
event
.
target
.
dataset
.
item
let
item
=
event
.
target
.
dataset
.
item
let
_selected
=
this
.
data
.
selected
let
_selected
=
this
.
data
.
selected
_selected
.
sort
=
item
.
value
_selected
.
order
=
item
.
value
let
_selected_titles
=
this
.
data
.
selected_titles
let
_selected_titles
=
this
.
data
.
selected_titles
_selected_titles
.
sort
=
item
.
name
_selected_titles
.
order
=
item
.
name
this
.
setData
({
this
.
setData
({
filter_idx
:
0
,
filter_idx
:
0
,
selected
:
_selected
,
selected
:
_selected
,
...
...
components/catalog-filter/index.wxml
View file @
fd519add
<!--components/search-filter/index.wxml-->
<!--components/search-filter/index.wxml-->
<wxs src="../../pages/common.wxs" module="common"></wxs>
<wxs src="../../pages/common.wxs" module="common"></wxs>
<view class='filter-wrapper' catchtouchmove="true">
<view class='filter-wrapper' catchtouchmove="true">
<i-row i-class='row-filter'>
<i-row i-class='row-filter'>
<!-- 地区筛选 -->
<!-- 地区筛选 -->
<i-col span="1
1
" i-class="col-class">
<i-col span="1
2
" i-class="col-class">
<view class="filter-item">
<view class="filter-item">
<text class="{{filter_idx==1?'active':''}}" catchtap='filterTap' data-idx="1">{{selected_titles.region}}</text>
<text class="{{filter_idx==1?'active':''}}" catchtap='filterTap' data-idx="1">{{selected_titles.region}}</text>
<image class="search-icon" src="/images/icon-down-select{{filter_idx==1?'ed':''}}.png"></image>
<image class="search-icon" src="/images/icon-down-select{{filter_idx==1?'ed':''}}.png"></image>
</view>
</view>
</i-col>
</i-col>
<i-col span="2" i-class="col-class">
<view class="vdivider">
</view>
</i-col>
<!-- 排序筛选 -->
<!-- 排序筛选 -->
<i-col span="11" i-class="col-class">
<i-col span="12" i-class="col-class">
<view class="filter-item">
<view class="filter-item" style='position:relative;'>
<text class="{{filter_idx==2?'active':''}}" catchtap='filterTap' data-idx="2">{{selected_titles.sort}}</text>
<view class='vdivider'></view>
<text class="{{filter_idx==2?'active':''}}" catchtap='filterTap' data-idx="2">{{selected_titles.order}}</text>
<image class="search-icon" src="/images/icon-down-select{{filter_idx==2?'ed':''}}.png"></image>
<image class="search-icon" src="/images/icon-down-select{{filter_idx==2?'ed':''}}.png"></image>
</view>
</view>
</i-col>
</i-col>
</i-row>
</i-row>
<view catchtap='closeFilter' class='filter-content-wrapper' wx:if="{{filter_idx>0}}" catchtouchmove='true'>
<view catchtap='closeFilter' class='filter-content-wrapper' wx:if="{{filter_idx>0}}" catchtouchmove='true'>
<view class="row-content" catchtap='preventEvent'>
<view class="row-content" catchtap='preventEvent'>
<scroll-view class="scroll-view" scroll-y="true" style="width: 100%;height: 100%;">
<scroll-view class="scroll-view" scroll-y="true" style="width: 100%;height: 100%;">
...
@@ -40,9 +40,9 @@
...
@@ -40,9 +40,9 @@
</view>
</view>
<!-- 排序筛选 -->
<!-- 排序筛选 -->
<view wx:if="{{filter_idx==2}}" class='filter-row' wx:for="{{
sort
s}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
<view wx:if="{{filter_idx==2}}" class='filter-row' wx:for="{{
order
s}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
<text bindtap="
sortFilter" data-idx="{{n.id}}" data-item="{{n}}" class="{{selected.sort
==n.value?'seled':''}}">{{n.name}}</text>
<text bindtap="
orderFilter" data-idx="{{n.id}}" data-item="{{n}}" class="{{selected.order
==n.value?'seled':''}}">{{n.name}}</text>
<image wx:if="{{selected.
sort
==n.value}}" class='f-selected' src='/images/icon_filter_selected.png'></image>
<image wx:if="{{selected.
order
==n.value}}" class='f-selected' src='/images/icon_filter_selected.png'></image>
</view>
</view>
</scroll-view>
</scroll-view>
...
...
components/catalog-filter/index.wxss
View file @
fd519add
...
@@ -192,8 +192,9 @@
...
@@ -192,8 +192,9 @@
}
}
.vdivider{
.vdivider{
margin-top: 30rpx;
height: 60rpx;
height: 60rpx;
background: #ccc;
width: 1px;
width: 1px;
background:#ccc;
position: absolute;
left: 0px;
}
}
\ No newline at end of file
components/navs/index.js
View file @
fd519add
...
@@ -75,11 +75,11 @@ Page({
...
@@ -75,11 +75,11 @@ Page({
},
},
// 美行攻略
// 美行攻略
gotoGuides
:
function
(
event
)
{
//
gotoGuides: function(event) {
wx
.
navigateTo
({
//
wx.navigateTo({
url
:
'/pages/guide/index'
,
//
url: '/pages/guide/index',
})
//
})
},
//
},
// 商家合作
// 商家合作
gotoShopJoin
:
function
(
event
)
{
gotoShopJoin
:
function
(
event
)
{
...
...
components/navs/index.wxml
View file @
fd519add
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</i-grid-icon>
</i-grid-icon>
<i-grid-label i-class="nav-label">线下活动</i-grid-label>
<i-grid-label i-class="nav-label">线下活动</i-grid-label>
</i-grid-item>
</i-grid-item>
<i-grid-item i-class="nav-grid-item" catchtap='
gotoGuides
'>
<i-grid-item i-class="nav-grid-item" catchtap='
catalogClick' data-name='转让专区
'>
<i-grid-icon i-class="nav-icon">
<i-grid-icon i-class="nav-icon">
<image src="/images/navs/icon_nav_6.png" />
<image src="/images/navs/icon_nav_6.png" />
</i-grid-icon>
</i-grid-icon>
...
...
pages/detail/enroll/index.js
View file @
fd519add
...
@@ -85,11 +85,62 @@ Page({
...
@@ -85,11 +85,62 @@ Page({
},
},
handlePhoneAuth
:
function
(
event
)
{
handlePhoneAuth
:
function
(
event
)
{
Wx
.
login
().
then
(
res
=>
{
// 获取session key
console
.
log
(
'wx.login'
,
res
,
' event:'
,
event
)
let
encryptedData
=
event
.
detail
.
encryptedData
let
encryptedData
=
event
.
detail
.
encryptedData
let
iv
=
event
.
detail
.
iv
let
iv
=
event
.
detail
.
iv
this
.
decodePhoneData
(
res
.
code
,
encryptedData
,
iv
)
Wx
.
login
().
then
(
res
=>
{
console
.
log
(
'wx.login'
,
res
,
' event:'
,
event
)
if
(
res
.
errMsg
==
'login:ok'
)
{
api
.
getSessionKey
({
code
:
res
.
code
}).
then
(
res
=>
{
if
(
!
res
.
code
)
{
let
sessionId
=
res
.
data
let
that
=
this
api
.
getPhoneNumber
({
sessionId
:
sessionId
,
encryptedData
:
encryptedData
,
iv
:
encodeURIComponent
(
iv
)
}).
then
(
res
=>
{
console
.
log
(
'iv: '
,
iv
,
' res.code: '
,
res
.
code
)
if
(
!
res
.
code
)
{
$Toast
({
content
:
'手机号授权成功'
,
type
:
'success'
});
this
.
setData
({
phone
:
res
.
data
.
phone
})
// 将刚拿到的手机号码放到全局数据中,否则phone数据只会是当前页面数据
if
(
app
.
globalData
.
userInfo
)
{
app
.
globalData
.
userInfo
.
phone
=
res
.
data
.
phone
}
}
else
{
$Toast
({
content
:
res
.
msg
,
type
:
'error'
});
}
})
}
else
{
$Toast
({
content
:
res
.
msg
,
type
:
'error'
});
}
})
}
else
{
$Toast
({
content
:
'wx.login失败'
,
type
:
'error'
});
}
// let encryptedData = event.detail.encryptedData
// let iv = event.detail.iv
// this.decodePhoneData(res.code, encryptedData, iv)
})
})
},
},
...
@@ -184,6 +235,12 @@ Page({
...
@@ -184,6 +235,12 @@ Page({
});
});
return
return
}
}
wx
.
showNavigationBarLoading
()
wx
.
showLoading
({
title
:
'加载中...'
,
})
api
.
project
.
order
({
api
.
project
.
order
({
pid
:
this
.
data
.
id
,
pid
:
this
.
data
.
id
,
sign_limits
:
this
.
data
.
familyNum
+
1
,
sign_limits
:
this
.
data
.
familyNum
+
1
,
...
@@ -195,6 +252,8 @@ Page({
...
@@ -195,6 +252,8 @@ Page({
remark
:
this
.
data
.
remark
,
remark
:
this
.
data
.
remark
,
address
:
this
.
data
.
address
address
:
this
.
data
.
address
}).
then
(
res
=>
{
}).
then
(
res
=>
{
wx
.
hideNavigationBarLoading
()
wx
.
hideLoading
()
if
(
res
.
code
)
{
if
(
res
.
code
)
{
$Toast
({
$Toast
({
content
:
res
.
msg
,
content
:
res
.
msg
,
...
...
pages/detail/index.wxml
View file @
fd519add
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
<i-cell wx-if="{{detail.type=='2'}}">
<i-cell wx-if="{{detail.type=='2'}}">
<image slot="icon" src='/images/icon_rmb.png' mode='scaleToFill' class='icon'></image>
<image slot="icon" src='/images/icon_rmb.png' mode='scaleToFill' class='icon'></image>
<view catchtap='handleMap'>
<view catchtap='handleMap'>
<text>参考价格:<text class='text-red'>¥{{detail.price}}起
/{{detail.night_num}}晚
</text> </text>
<text>参考价格:<text class='text-red'>¥{{detail.price}}起
<text wx-if="{{detail.night_num}}">/{{detail.night_num}}晚</text>
</text> </text>
</view>
</view>
</i-cell>
</i-cell>
<i-cell wx-if="{{detail.type=='1'}}">
<i-cell wx-if="{{detail.type=='1'}}">
...
...
pages/guide/index.js
View file @
fd519add
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
import
api
from
'../../utils/Api.js'
import
api
from
'../../utils/Api.js'
import
Config
from
'../../utils/Config.js'
import
Config
from
'../../utils/Config.js'
import
Schedule
from
'../../utils/Schedule.js'
import
Schedule
from
'../../utils/Schedule.js'
const
{
$Toast
}
=
require
(
'../../iview/base/index'
);
Page
({
Page
({
...
@@ -10,12 +13,13 @@ Page({
...
@@ -10,12 +13,13 @@ Page({
*/
*/
data
:
{
data
:
{
guides
:
[],
guides
:
[],
i
ptValue
:
'
'
,
i
_clear_show
:
'none
'
,
recover
:
'none'
,
recover
:
'none'
,
currentPage
:
1
,
currentPage
:
1
,
loading
:
true
,
loading
:
true
,
hasMore
:
true
,
hasMore
:
true
,
i
:
0
i
:
0
,
keyword
:
''
},
},
/**
/**
...
@@ -54,7 +58,7 @@ Page({
...
@@ -54,7 +58,7 @@ Page({
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'加载中...'
,
title
:
'加载中...'
,
})
})
new
Schedule
().
task
(
this
.
getListData
).
delay
(
16
00
).
task
(()
=>
{
new
Schedule
().
task
(
this
.
getListData
).
delay
(
8
00
).
task
(()
=>
{
wx
.
hideNavigationBarLoading
()
wx
.
hideNavigationBarLoading
()
wx
.
stopPullDownRefresh
()
wx
.
stopPullDownRefresh
()
wx
.
hideLoading
()
wx
.
hideLoading
()
...
@@ -75,7 +79,7 @@ Page({
...
@@ -75,7 +79,7 @@ Page({
loading
:
true
,
loading
:
true
,
currentPage
:
page
currentPage
:
page
})
})
}).
delay
(
10
00
).
task
(
that
.
getListData
)
}).
delay
(
8
00
).
task
(
that
.
getListData
)
}
}
},
},
...
@@ -100,12 +104,14 @@ Page({
...
@@ -100,12 +104,14 @@ Page({
url
:
'/pages/webview/index?url='
+
url
+
'&t=攻略详情'
,
url
:
'/pages/webview/index?url='
+
url
+
'&t=攻略详情'
,
})
})
},
},
// 请求接口
getListData
:
function
(
callback
)
{
getListData
:
function
(
callback
)
{
const
p
=
this
.
data
.
currentPage
const
p
=
this
.
data
.
currentPage
api
.
guide
.
list
({
let
params
=
{
p
p
:
p
,
}).
then
(
res
=>
{
title
:
this
.
data
.
keyword
}
api
.
guide
.
list
(
params
).
then
(
res
=>
{
if
(
res
.
code
)
{
if
(
res
.
code
)
{
this
.
setData
({
this
.
setData
({
hasMore
:
false
,
hasMore
:
false
,
...
@@ -122,61 +128,57 @@ Page({
...
@@ -122,61 +128,57 @@ Page({
}
}
})
})
},
},
/* 美行攻略 的 重置input框的文本*/
/* 美行攻略 的 重置input框的文本*/
clearContent
:
function
()
{
clearContent
:
function
()
{
this
.
setData
({
this
.
setData
({
iptValue
:
''
keyword
:
''
})
})
// 开始请求接口
// wx.startPullDownRefresh()
},
},
/* 美行攻略 的 搜索请求*/
/* 美行攻略 的 搜索请求*/
searchFun
:
function
(
e
,
callback
)
{
searchFun
:
function
(
e
,
callback
)
{
// 显示“取消”按钮
// 显示“取消”按钮
this
.
setData
({
recover
:
"block"
})
this
.
setData
({
recover
:
"block"
})
// 开始请求
// 开始请求
const
p
=
this
.
data
.
currentPage
const
p
=
this
.
data
.
currentPage
let
title
=
e
.
detail
.
value
let
title
=
e
.
detail
.
value
api
.
guide
.
list
({
if
(
title
.
trim
()
==
''
||
title
.
trim
().
length
<=
0
){
title
,
p
$Toast
({
}).
then
(
res
=>
{
content
:
'关键词不能为空'
,
if
(
res
.
code
)
{
type
:
'error'
this
.
setData
({
hasMore
:
false
,
loading
:
false
})
})
}
else
{
return
}
this
.
setData
({
this
.
setData
({
guides
:
this
.
data
.
guides
=
res
.
data
,
keyword
:
title
loading
:
false
,
hasMore
:
res
.
data
&&
res
.
data
.
length
>
0
?
true
:
false
,
currentPage
:
res
.
data
&&
res
.
data
.
length
>
0
?
p
:
(
p
-
1
)
})
})
typeof
callback
==
"function"
&&
callback
()
// 开始请求接口
wx
.
startPullDownRefresh
()
},
// 当搜索框内有内容时,显示输入框的 XX 按钮
iconShow
:
function
(
e
){
if
(
e
.
detail
.
value
==
""
){
this
.
setData
({
i_clear_show
:
"none"
})
}
else
{
this
.
setData
({
i_clear_show
:
"block"
})
}
}
})
},
},
recoverListData
:
function
(
callback
){
this
.
setData
({
recover
:
"none"
})
recoverListData
:
function
(){
// 同时删除搜索框的内容
// 点击取消按钮
this
.
clearContent
()
// 开始重新渲染数据
const
p
=
this
.
data
.
currentPage
api
.
guide
.
list
({
p
}).
then
(
res
=>
{
if
(
res
.
code
)
{
this
.
setData
({
hasMore
:
false
,
loading
:
false
})
}
else
{
this
.
setData
({
this
.
setData
({
guides
:
this
.
data
.
guides
=
res
.
data
,
guides
:
[],
keyword
:
''
,
recover
:
"none"
,
loading
:
false
,
loading
:
false
,
hasMore
:
res
.
data
&&
res
.
data
.
length
>
0
?
true
:
false
,
hasMore
:
true
,
currentPage
:
res
.
data
&&
res
.
data
.
length
>
0
?
p
:
(
p
-
1
)
currentPage
:
1
})
typeof
callback
==
"function"
&&
callback
()
}
})
})
// 开始请求接口
this
.
getListData
()
}
}
})
})
\ No newline at end of file
pages/guide/index.json
View file @
fd519add
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
"enablePullDownRefresh"
:
true
,
"enablePullDownRefresh"
:
true
,
"usingComponents"
:
{
"usingComponents"
:
{
"i-cell"
:
"/iview/cell/index"
,
"i-cell"
:
"/iview/cell/index"
,
"i-toast"
:
"/iview/toast/index"
,
"more"
:
"/components/more/index"
"more"
:
"/components/more/index"
}
}
}
}
\ No newline at end of file
pages/guide/index.wxml
View file @
fd519add
...
@@ -3,19 +3,20 @@
...
@@ -3,19 +3,20 @@
<form>
<form>
<view class="search_out">
<view class="search_out">
<view class='input_box'>
<view class='input_box'>
<icon class='icon-search' type='search' size='14'></icon>
<icon class='icon-search' type='search' size='14'
color="rgb(66, 66, 66)"
></icon>
<input
<input
class="iptSearch"
class="iptSearch"
placeholder="关键词如地名、游泳等"
placeholder="关键词如地名、游泳等"
value='{{
iptValue
}}'
value='{{
keyword
}}'
confirm-type="搜索"
confirm-type="搜索"
type='text'
type='text'
bindconfirm="searchFun"
bindconfirm="searchFun"
bindinput='getIptValue'
bindinput='getIptValue'
bindinput='iconShow'
/>
/>
<icon class='icon-clear' type='clear' size='14' bindtap='clearContent'></icon>
<icon class='icon-clear' type='clear' s
tyle="display: {{i_clear_show}}" s
ize='14' bindtap='clearContent'></icon>
</view>
</view>
<
button class='recoverBnt' style="display: {{recover}};" bindtap='recoverListData'>取消</button
>
<
text class='recoverBnt' style="display: {{recover}};" bindtap='recoverListData'>取消</text
>
</view>
</view>
</form>
</form>
...
@@ -33,4 +34,5 @@
...
@@ -33,4 +34,5 @@
</view>
</view>
</view>
</view>
<more hasMore="{{hasMore}}" loading="{{loading}}" page="{{currentPage}}" />
<more hasMore="{{hasMore}}" loading="{{loading}}" page="{{currentPage}}" />
<i-toast id="toast" />
</view>
</view>
\ No newline at end of file
pages/guide/index.wxss
View file @
fd519add
...
@@ -5,6 +5,7 @@ form{
...
@@ -5,6 +5,7 @@ form{
width: 100%;
width: 100%;
height: 50px;
height: 50px;
display: block;
display: block;
margin-bottom: 2px;
}
}
.search_out{
.search_out{
width: 100%;
width: 100%;
...
@@ -16,7 +17,7 @@ form{
...
@@ -16,7 +17,7 @@ form{
padding: 20rpx;
padding: 20rpx;
box-sizing: border-box;
box-sizing: border-box;
background: rgb(2
07, 207, 207
);
background: rgb(2
55, 255, 255
);
}
}
.search_out .input_box{
.search_out .input_box{
width: 100%;
width: 100%;
...
@@ -33,30 +34,35 @@ form{
...
@@ -33,30 +34,35 @@ form{
margin: 0;
margin: 0;
padding-left: 35px;
padding-left: 35px;
padding-right: 35px;
padding-right: 35px;
background: rgb(2
55, 255, 255
);
background: rgb(2
40, 240, 240
);
border-radius:
3
px;
border-radius:
20
px;
font-size: 12px;
font-size: 12px;
}
}
.search_out .input_box .icon-search{
.search_out .input_box .icon-search{
position: absolute;
position: absolute;
left: 25rpx;
left: 25rpx;
top: calc(50% -
9
px);
top: calc(50% -
7
px);
}
}
.search_out .input_box .icon-clear{
.search_out .input_box .icon-clear{
position: absolute;
position: absolute;
right: 25rpx;
right: 25rpx;
top: calc(50% -
9
px);
top: calc(50% -
7
px);
opacity: 0.85;
opacity: 0.85;
}
}
.search_out .recoverBnt{
.search_out .recoverBnt{
width:
5
0px;
width:
3
0px;
height: 30px;
height: 30px;
display: none;
display: none;
flex-grow: 0;
flex-grow: 0;
box-sizing: border-box;
box-sizing: border-box;
outline: none;
border: none;
background: none;
padding: 0;
padding: 0;
margin-left: 20rpx;
margin-left: 20rpx;
color: rgb(6, 173, 165);
letter-spacing: 1px;
font-size: 12px;
font-size: 12px;
line-height: 30px;
line-height: 30px;
}
}
...
...
pages/index/index.wxml
View file @
fd519add
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<view class='title'>{{n.title}}</view>
<view class='title'>{{n.title}}</view>
<view class='info'>
<view class='info'>
<text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.vip_price, 0)}}</text>
<text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.vip_price, 0)}}</text>
<text> 起
/{{n.night_num}}晚
</text>
<text> 起
<text wx:if="{{n.night_num}}">/{{n.night_num}}晚</text>
</text>
</view>
</view>
</view>
</view>
</i-col>
</i-col>
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<view class='title'>{{n.title}}</view>
<view class='title'>{{n.title}}</view>
<view class='info'>
<view class='info'>
<text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.price, 0)}}</text>
<text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.price, 0)}}</text>
<text> 起
/{{n.night_num}}晚
</text>
<text> 起
<text wx:if="{{n.night_num}}">/{{n.night_num}}晚</text>
</text>
</view>
</view>
</view>
</view>
</i-col>
</i-col>
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
<view class='title'>{{n.title}}</view>
<view class='title'>{{n.title}}</view>
<view class='info'>
<view class='info'>
<text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.price, 0)}}</text>
<text class='text-red text-small mergin-right-2'>¥{{common.numFixed(n.price, 0)}}</text>
<text> 起
/{{n.night_num}}晚
</text>
<text> 起
<text wx:if="{{n.night_num}}">/{{n.night_num}}晚</text>
</text>
</view>
</view>
</view>
</view>
</i-col>
</i-col>
...
...
pages/me/vip/index.js
View file @
fd519add
...
@@ -12,13 +12,15 @@ Page({
...
@@ -12,13 +12,15 @@ Page({
data
:
{
data
:
{
value1
:
1
,
value1
:
1
,
value2
:
0.1
,
value2
:
0.1
,
visible2
:
false
,
vip_price
:
49.9
,
vip_price
:
49.9
,
order
:
{},
order
:
{},
user
:
{},
user
:
{},
name
:
''
,
address
:
''
,
wx_number
:
''
,
visible1
:
false
,
},
},
handleChange1
({
handleChange1
({
...
@@ -37,6 +39,32 @@ Page({
...
@@ -37,6 +39,32 @@ Page({
})
})
},
},
handleName
:
function
(
e
)
{
this
.
setData
({
name
:
e
.
detail
.
detail
.
value
})
},
handleWx
:
function
(
e
)
{
this
.
setData
({
wx_number
:
e
.
detail
.
detail
.
value
})
},
handleAddress
:
function
(
e
)
{
this
.
setData
({
address
:
e
.
detail
.
detail
.
value
})
},
modelCancel
:
function
()
{
console
.
log
(
this
.
data
.
visible2
);
this
.
setData
({
visible2
:
false
})
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
...
@@ -49,28 +77,19 @@ Page({
...
@@ -49,28 +77,19 @@ Page({
getUserInfo
:
function
()
{
getUserInfo
:
function
()
{
api
.
me
.
info
().
then
(
res
=>
{
api
.
me
.
info
().
then
(
res
=>
{
if
(
!
res
.
code
)
{
if
(
!
res
.
code
)
{
//授权手机号
console
.
log
(
res
.
data
);
this
.
dialogPhone
(
res
.
data
)
app
.
globalData
.
userInfo
=
res
.
data
app
.
globalData
.
userInfo
=
res
.
data
// 渲染数据
// 渲染数据
this
.
setData
({
this
.
setData
({
user
:
res
.
data
user
:
res
.
data
,
name
:
res
.
data
.
name
,
wx_number
:
res
.
data
.
wx_number
,
address
:
res
.
data
.
address
,
})
})
}
}
})
})
},
},
/**
* 手机号授权弹窗
*/
dialogPhone
:
function
(
data
)
{
if
(
!
data
.
phone
)
{
this
.
setData
({
visible1
:
true
});
}
},
handlePhoneAuth
:
function
(
event
)
{
handlePhoneAuth
:
function
(
event
)
{
Wx
.
login
().
then
(
res
=>
{
Wx
.
login
().
then
(
res
=>
{
let
encryptedData
=
event
.
detail
.
encryptedData
let
encryptedData
=
event
.
detail
.
encryptedData
...
@@ -91,12 +110,13 @@ Page({
...
@@ -91,12 +110,13 @@ Page({
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
!
res
.
code
)
{
if
(
!
res
.
code
)
{
that
.
setData
({
that
.
setData
({
visible1
:
false
visible1
:
false
})
})
$Toast
({
if
(
res
.
is_relation
){
content
:
'手机号授权成功'
,
that
.
setData
({
type
:
'success'
visible2
:
true
});
})
}
//更新下用户数据
//更新下用户数据
that
.
getUserInfo
()
that
.
getUserInfo
()
}
else
{
}
else
{
...
@@ -180,11 +200,24 @@ Page({
...
@@ -180,11 +200,24 @@ Page({
handleClick
:
function
()
{
handleClick
:
function
()
{
let
that
=
this
let
that
=
this
let
year
=
this
.
data
.
value1
let
year
=
this
.
data
.
value1
let
wx_number
=
this
.
data
.
wx_number
let
name
=
this
.
data
.
name
let
address
=
this
.
data
.
address
let
params
=
{
let
params
=
{
year
:
year
year
:
year
,
wx_number
:
wx_number
,
name
:
name
,
address
:
address
}
}
wx
.
showNavigationBarLoading
()
wx
.
showLoading
({
title
:
'加载中...'
,
})
// 获取支付参数
// 获取支付参数
api
.
me
.
vipOrder
(
params
).
then
(
res
=>
{
api
.
me
.
vipOrder
(
params
).
then
(
res
=>
{
wx
.
hideNavigationBarLoading
()
wx
.
hideLoading
()
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
that
.
setData
({
that
.
setData
({
order
:
res
.
data
order
:
res
.
data
...
@@ -217,6 +250,7 @@ Page({
...
@@ -217,6 +250,7 @@ Page({
}
else
{
}
else
{
wx
.
showToast
({
wx
.
showToast
({
title
:
res
.
msg
,
title
:
res
.
msg
,
icon
:
'none'
})
})
}
}
})
})
...
...
pages/me/vip/index.wxml
View file @
fd519add
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<view class='card-box'>
<view class='card-box'>
<image src="/images/background-{{user.is_vip==1?'':'no'}}vip.png"></image>
<image src="/images/background-{{user.is_vip==1?'':'no'}}vip.png"></image>
<text> {{user.is_vip==1?'过期时间:' + user.vip_endtime:''}}</text>
<text> {{user.is_vip==1?'过期时间:' + user.vip_endtime:''}}</text>
<text wx:if="{{user.is_vip==1}}" class="vip-umber">{{user.vip_number}}</text>
</view>
</view>
<view class='calculation-box'>
<view class='calculation-box'>
...
@@ -17,16 +18,22 @@
...
@@ -17,16 +18,22 @@
</view>
</view>
<view class='vip_intro'>
<view class='vip_intro'>
会员卡说明:用户购买一次会员卡后,增加一年的会员时限,多次购买则在先有的基础上延长时间,单次以1年为标准。
会员卡说明:用户购买一次会员卡后,增加一年的会员时限,多次购买则在先有的基础上延长时间,单次以1年为标准
,已购卡会员请添加美行客服微信(mxkf00),邀请进会员群
。
</view>
</view>
<!-- 用户输入的信息 -->
<!-- 用户输入的信息 -->
<!-- <i-input i-class="right-align" value="" title="姓名" type="text" placeholder="请输入您的姓名" />
<i-input title="姓名" bindchange="handleName" type="text" right="true" value="{{ user.name }}" placeholder="请输入姓名" maxlength="50" />
<view class='phoneGive'>
<view class='phoneGive' wx:if="{{!user.phone}}">
<text>手机号</text>
<text>手机号</text>
<button>授权</button>
<button bindgetphonenumber="handlePhoneAuth" open-type="getPhoneNumber">授权</button>
</view>
</view>
<i-input i-class="right-align right-align-last" type="text" title="地址" placeholder="请输入您的地址" maxlength="50" /> -->
<i-input wx:else title="手机号" type="text" right="true" value="{{ user.phone }}" placeholder="请输入手机号" disabled/>
<i-input bindchange="handleWx" title="微信号" type="text" right="true" value="{{ user.wx_number }}" placeholder="请输入微信号" maxlength="50" />
<i-input bindchange="handleAddress" value="{{ user.address }}" right="true" type="text" title="地址" placeholder="请输入地址" maxlength="50" />
<i-row class='height'>
<i-row class='height'>
<i-col span="20" offset='2' i-class="col-class">
<i-col span="20" offset='2' i-class="col-class">
...
@@ -34,12 +41,9 @@
...
@@ -34,12 +41,9 @@
</i-col>
</i-col>
</i-row>
</i-row>
<!-- 授权弹窗 -->
<i-modal title="请授权手机号" visible="{{ visible1 }}" show-cancel="{{false}}" show-ok="{{false}}" action-mode="{{ vertical }}">
<view class="auth_phone_container">
<i-button i-class="btn_auth_phone" type="info" shape="circle" size="default" bindgetphonenumber="handlePhoneAuth" open-type="getPhoneNumber">授权</i-button>
</view>
</i-modal>
<!-- toast弹窗 -->
<!-- toast弹窗 -->
<i-toast id="toast" />
<i-toast id="toast" />
<i-modal visible="{{ visible2 }}" bind:ok="modelCancel" title="温馨提示" show-cancel="{{false}}">
<view class="modelCancel">系统已自动关联您在其他平台购买的美行者VIP会员,请点击确定查看详情</view>
</i-modal>
\ No newline at end of file
pages/me/vip/index.wxss
View file @
fd519add
...
@@ -5,14 +5,17 @@ page {
...
@@ -5,14 +5,17 @@ page {
}
}
/* 会员信息*/
/* 会员信息*/
.right-align{
.right-align {
border-top: 1px solid rgba(0, 0, 0, 0.1);
border-top: 1px solid rgba(0, 0, 0, 0.1);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
}
.right-align input{
.right-align input {
text-align: right;
text-align: right;
}
}
.phoneGive{
.phoneGive {
width: 100%;
width: 100%;
height: 45px;
height: 45px;
box-sizing: border-box;
box-sizing: border-box;
...
@@ -20,21 +23,22 @@ page {
...
@@ -20,21 +23,22 @@ page {
flex-direction: row;
flex-direction: row;
justify-content: space-between;
justify-content: space-between;
align-items: center;
align-items: center;
padding: 0 15px;
padding: 0 15px;
background: white;
background: white;
}
}
.phoneGive text{
.phoneGive text {
width: 75px;
width: 75px;
min-width:65px;
min-width:
65px;
height: 100%;
height: 100%;
line-height: 45px;
line-height: 45px;
display: inline-block;
display: inline-block;
font-size: 14px;
font-size: 14px;
color:#495060;
color:
#495060;
padding-right: 10px;
padding-right: 10px;
}
}
.phoneGive button{
.phoneGive button {
width: 65px;
width: 65px;
height: 80%;
height: 80%;
padding: 0;
padding: 0;
...
@@ -42,7 +46,7 @@ page {
...
@@ -42,7 +46,7 @@ page {
display: inline-block;
display: inline-block;
border: 1px solid rgba(0, 0, 0, 0.4);
border: 1px solid rgba(0, 0, 0, 0.4);
border-radius: 50px;
border-radius: 50px;
color:#495060;
color:
#495060;
font-size: 14px;
font-size: 14px;
}
}
...
@@ -50,20 +54,30 @@ page {
...
@@ -50,20 +54,30 @@ page {
width: 690rpx;
width: 690rpx;
height: 385rpx;
height: 385rpx;
margin: 40rpx auto;
margin: 40rpx auto;
position: relative
position: relative
;
}
}
.card-box text{
.card-box text {
position: absolute;
position: absolute;
right: 45rpx;
right: 45rpx;
bottom:
18
rpx;
bottom:
22
rpx;
color: #
F1E2C
3;
color: #
f1e2c
3;
font-size: 25rpx
font-size: 25rpx
;
}
}
.card-box image {
.card-box image {
width: 100%;
width: 100%;
height: 100%;
height: 100%;
}
}
.card-box .vip-umber {
position: absolute;
left: 45rpx;
bottom: 22rpx;
color: #f1e2c3;
font-size: 25rpx;
}
.calculation-box {
.calculation-box {
width: 690rpx;
width: 690rpx;
height: 100rpx;
height: 100rpx;
...
@@ -88,17 +102,25 @@ page {
...
@@ -88,17 +102,25 @@ page {
color: #969696;
color: #969696;
font-size: 30rpx;
font-size: 30rpx;
}
}
.vip_num_input{
.vip_num_input {
text-align: right;
text-align: right;
padding-right: 20rpx;
padding-right: 20rpx;
box-sizing: border-box;
box-sizing: border-box;
}
}
.color-orange {
.color-orange {
color: #ff4200;
color: #ff4200;
}
}
/* 授权窗口 */
/* 授权窗口 */
.auth_phone_container{
.auth_phone_container {
width: 80%;
width: 80%;
margin: auto;
margin: auto;
}
}
.modelCancel {
width: 90%;
margin: auto;
}
pages/search/list/list.js
View file @
fd519add
...
@@ -15,14 +15,14 @@ Page({
...
@@ -15,14 +15,14 @@ Page({
currentPage
:
1
,
currentPage
:
1
,
loading
:
true
,
loading
:
true
,
hasMore
:
true
,
hasMore
:
true
,
is_transfer
:
0
,
title
:
''
,
title
:
''
,
tags
:
[],
tags
:
[],
catalog
:
'0'
,
catalog
:
'0'
,
filters
:
{
filters
:
{
region_params
:
{},
region_params
:
{},
sort
:
'default'
order
:
'default'
}
}
},
},
...
@@ -47,6 +47,11 @@ Page({
...
@@ -47,6 +47,11 @@ Page({
this
.
setData
({
this
.
setData
({
catalog
:
_catalog
catalog
:
_catalog
})
})
if
(
_catalog
===
"undefined"
)
{
this
.
setData
({
is_transfer
:
1
});
}
}
}
// 页面title
// 页面title
let
_ptitle
=
options
.
ptitle
let
_ptitle
=
options
.
ptitle
...
@@ -63,8 +68,10 @@ Page({
...
@@ -63,8 +68,10 @@ Page({
*/
*/
getListData
:
function
(
callback
)
{
getListData
:
function
(
callback
)
{
const
p
=
this
.
data
.
currentPage
const
p
=
this
.
data
.
currentPage
const
is_transfer
=
this
.
data
.
is_transfer
let
params
=
{
let
params
=
{
p
:
p
p
:
p
,
is_transfer
:
is_transfer
}
}
if
(
this
.
data
.
tags
.
length
>
0
)
{
if
(
this
.
data
.
tags
.
length
>
0
)
{
params
[
'tags'
]
=
JSON
.
stringify
(
this
.
data
.
tags
)
params
[
'tags'
]
=
JSON
.
stringify
(
this
.
data
.
tags
)
...
@@ -77,7 +84,7 @@ Page({
...
@@ -77,7 +84,7 @@ Page({
}
}
// 地域和排序
// 地域和排序
params
[
'
sort'
]
=
this
.
data
.
filters
.
sort
params
[
'
order'
]
=
this
.
data
.
filters
.
order
let
region_params
=
this
.
data
.
filters
.
region_params
let
region_params
=
this
.
data
.
filters
.
region_params
let
arr
=
Object
.
getOwnPropertyNames
(
region_params
)
let
arr
=
Object
.
getOwnPropertyNames
(
region_params
)
if
(
arr
.
length
>
0
)
{
if
(
arr
.
length
>
0
)
{
...
@@ -187,7 +194,7 @@ Page({
...
@@ -187,7 +194,7 @@ Page({
/**
/**
* 用户进行了筛选操作
* 用户进行了筛选操作
*/
*/
filterChange
:
function
(
event
)
{
filterChange
:
function
(
event
)
{
let
_filters
=
event
.
detail
.
filters
let
_filters
=
event
.
detail
.
filters
this
.
setData
({
this
.
setData
({
filters
:
_filters
filters
:
_filters
...
...
project.config.json
View file @
fd519add
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"ignore"
:
[]
"ignore"
:
[]
},
},
"setting"
:
{
"setting"
:
{
"urlCheck"
:
fals
e
,
"urlCheck"
:
tru
e
,
"es6"
:
true
,
"es6"
:
true
,
"postcss"
:
true
,
"postcss"
:
true
,
"minified"
:
true
,
"minified"
:
true
,
...
@@ -15,11 +15,11 @@
...
@@ -15,11 +15,11 @@
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.3.2"
,
"libVersion"
:
"2.3.2"
,
"appid"
:
"wx1b834552a7d49bb3"
,
"appid"
:
"wx1b834552a7d49bb3"
,
"projectname"
:
"%E7%BE%8E%E8%A1%8C%E8%80%85%E4%BA%B2%E5%AD%90%E6%B8%B8
(git)
"
,
"projectname"
:
"%E7%BE%8E%E8%A1%8C%E8%80%85%E4%BA%B2%E5%AD%90%E6%B8%B8"
,
"debugOptions"
:
{
"debugOptions"
:
{
"hidedInDevtools"
:
[]
"hidedInDevtools"
:
[]
},
},
"
isGameTourist"
:
false
,
"
scripts"
:
{}
,
"condition"
:
{
"condition"
:
{
"search"
:
{
"search"
:
{
"current"
:
-1
,
"current"
:
-1
,
...
@@ -34,11 +34,10 @@
...
@@ -34,11 +34,10 @@
"list"
:
[]
"list"
:
[]
},
},
"game"
:
{
"game"
:
{
"currentL"
:
-1
,
"list"
:
[]
"list"
:
[]
},
},
"miniprogram"
:
{
"miniprogram"
:
{
"current"
:
2
,
"current"
:
10
,
"list"
:
[
"list"
:
[
{
{
"id"
:
0
,
"id"
:
0
,
...
@@ -101,10 +100,10 @@
...
@@ -101,10 +100,10 @@
"query"
:
""
"query"
:
""
},
},
{
{
"id"
:
-1
,
"id"
:
10
,
"name"
:
"立即报名"
,
"name"
:
"立即报名"
,
"pathName"
:
"pages/detail/enroll/index"
,
"pathName"
:
"pages/detail/enroll/index"
,
"query"
:
"id=
1
"
"query"
:
"id=
298
"
},
},
{
{
"id"
:
11
,
"id"
:
11
,
...
...
utils/Api.js
View file @
fd519add
...
@@ -15,7 +15,11 @@ export const shareTicket = params => {
...
@@ -15,7 +15,11 @@ export const shareTicket = params => {
}
}
export
const
getPhoneNumber
=
params
=>
{
export
const
getPhoneNumber
=
params
=>
{
return
req
.
post
(
'user/getPhoneNumber'
,
params
).
then
(
res
=>
res
.
data
)
return
req
.
post
(
'user/getPhoneNumber2'
,
params
).
then
(
res
=>
res
.
data
)
}
export
const
getSessionKey
=
params
=>
{
return
req
.
post
(
'user/getSessionKey'
,
params
).
then
(
res
=>
res
.
data
)
}
}
export
const
home
=
{
export
const
home
=
{
...
@@ -113,6 +117,7 @@ export default {
...
@@ -113,6 +117,7 @@ export default {
login
,
login
,
shareTicket
,
shareTicket
,
getPhoneNumber
,
getPhoneNumber
,
getSessionKey
,
home
,
home
,
guide
,
guide
,
search
,
search
,
...
...
utils/Config.js
View file @
fd519add
// export const Config = {
// apiPath: "https://app.maveler.com/api/",
// mobPath: "https://app.maveler.com/mob/",
// shopJoinPath: "https://app.maveler.com/mob/Index/shopjoin"
// }
export
const
Config
=
{
export
const
Config
=
{
apiPath
:
"https://wxapp.maveler.com/api/"
,
apiPath
:
"https://wxapp.maveler.com/api/"
,
...
...
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