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
20abc632
Commit
20abc632
authored
Jan 05, 2019
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传
parent
276a8da8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
6 deletions
+110
-6
pages/detail/appoint/index.js
+85
-1
pages/detail/appoint/index.json
+4
-1
pages/detail/appoint/index.wxml
+9
-1
pages/detail/appoint/index.wxss
+9
-0
project.config.json
+3
-3
No files found.
pages/detail/appoint/index.js
View file @
20abc632
...
...
@@ -15,8 +15,8 @@ Page({
data
:
{
nickname
:
{},
detail
:
{},
phone
:
''
,
formPhone
:
''
,
date
:
''
,
remark
:
''
,
loading
:
false
,
...
...
@@ -279,5 +279,88 @@ Page({
},
800
)
}
})
},
/**
* 保存手机号
*/
savePhone
()
{
//发送请求保存手机号
const
phone
=
this
.
data
.
formPhone
api
.
getPhoneNumber
({
phone
:
phone
}).
then
(
res
=>
{
if
(
!
res
.
code
)
{
// 将刚拿到的手机号码放到全局数据中,否则phone数据只会是当前页面数据
if
(
app
.
globalData
.
userInfo
)
{
app
.
globalData
.
userInfo
.
phone
=
res
.
data
.
phone
}
this
.
setData
({
phone
:
res
.
data
.
phone
,
visible
:
false
})
if
(
res
.
is_relation
)
{
$Toast
({
content
:
'温馨提示:手机号授权成功,系统已自动关联您在其他平台购买的美行者VIP会员'
,
type
:
'success'
});
}
else
{
$Toast
({
content
:
'手机号授权成功'
,
type
:
'success'
});
}
//在拉去一遍用户信息
this
.
getUserInfo
();
}
else
{
this
.
setData
({
'errMsg'
:
true
,
'errMessage'
:
'*'
+
res
.
msg
})
}
})
},
//获取用户信息
// 获取个人资料
getUserInfo
:
function
()
{
api
.
me
.
info
().
then
(
res
=>
{
if
(
!
res
.
code
)
{
console
.
log
(
res
.
data
);
app
.
globalData
.
userInfo
=
res
.
data
// 渲染数据
this
.
setData
({
user
:
res
.
data
,
})
}
})
},
/**
* 关闭手机号填写弹窗
*/
alertClose
()
{
this
.
setData
({
visible
:
false
});
},
/**
* 打开手机号填写弹窗
*/
openAlert
()
{
this
.
setData
({
visible
:
true
})
},
handlePhone
:
function
(
event
)
{
this
.
setData
({
formPhone
:
event
.
detail
.
detail
.
value
})
},
})
\ No newline at end of file
pages/detail/appoint/index.json
View file @
20abc632
...
...
@@ -7,6 +7,8 @@
"i-cell-group"
:
"/iview/cell-group/index"
,
"i-cell"
:
"/iview/cell/index"
,
"i-button"
:
"/iview/button/index"
,
"i-toast"
:
"/iview/toast/index"
"i-toast"
:
"/iview/toast/index"
,
"i-modal"
:
"/iview/modal/index"
,
"i-input"
:
"/iview/input/index"
}
}
\ No newline at end of file
pages/detail/appoint/index.wxml
View file @
20abc632
...
...
@@ -32,7 +32,7 @@
</i-cell>
<i-cell title="手机号" i-class="cell-class">
<block wx:if="{{phone.length == 0}}">
<button slot="footer" bind
getphonenumber="handlePhoneAuth" type="info" open-type="getPhoneNumber" class="btn-auth-phone">授权
手机号</button>
<button slot="footer" bind
tap='openAlert' type="info" class="btn-auth-phone">填写
手机号</button>
</block>
<block wx:else>
<text slot="footer">{{phone}}</text>
...
...
@@ -56,4 +56,11 @@
</i-row>
</view>
<!-- 手机号授权框 -->
<i-modal title="填写手机号" visible="{{ visible }}" bind:ok="savePhone" bind:cancel="alertClose">
<i-input error="{{ errMsg }}" value="{{ value }}" type="number" bindchange='handlePhone' title="手机号" placeholder="请输入手机号" />
<view class="color-red">{{ errMessage }}</view>
</i-modal>
<!-- 弹窗 -->
<i-toast id="toast" />
\ No newline at end of file
pages/detail/appoint/index.wxss
View file @
20abc632
...
...
@@ -123,3 +123,11 @@ page {
border-bottom: 1rpx solid #e9e9e9;
margin-left: 30rpx;
}
.color-red{
color: #ed3f14;
text-align: left;
padding-top:20rpx;
padding-left: 60rpx;
}
\ No newline at end of file
project.config.json
View file @
20abc632
...
...
@@ -37,7 +37,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
1
1
,
"current"
:
1
4
,
"list"
:
[
{
"id"
:
0
,
...
...
@@ -125,10 +125,10 @@
"scene"
:
"1047"
},
{
"id"
:
-1
,
"id"
:
14
,
"name"
:
"预约下次"
,
"pathName"
:
"pages/detail/appoint/index"
,
"query"
:
"id=
173
"
"query"
:
"id=
298
"
}
]
}
...
...
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