Commit fcdae7f6a2845368abbf7b0d62f381c1da04faf0
1 parent
38d1e3e7e2
Exists in
master
and in
2 other branches
用户注册
Showing 9 changed files with 79 additions and 113 deletions
- littleApp_child/app.json
- littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.js
- littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.json
- littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.wxml
- littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.wxss
- littleApp_child/pages/Register/Register.js
- littleApp_child/pages/Register/Register.wxss
- littleApp_child/pages/home/home.js
- littleApp_child/utils/apiFile.js
littleApp_child/app.json
View file @
fcdae7f
| 1 | 1 | { | 
| 2 | 2 | "pages": [ | 
| 3 | + | |
| 3 | 4 | "pages/home/home", | 
| 4 | 5 | "pages/Setting/Setting", | 
| 5 | 6 | "pages/PersonalInfo/PersonalInfo", | 
| 6 | 7 | |
| ... | ... | @@ -21,7 +22,9 @@ | 
| 21 | 22 | "pages/system_notifacations/system_notifacations", | 
| 22 | 23 | "pages/vipService/vipService", | 
| 23 | 24 | "pages/childcare_knowledge/childcare_knowledge", | 
| 25 | + "pages/CompleteTouristInfo/CompleteTouristInfo", | |
| 24 | 26 | "pages/Register/Register" | 
| 27 | + | |
| 25 | 28 | ], | 
| 26 | 29 | "window": { | 
| 27 | 30 | "backgroundTextStyle": "light", | 
littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.js
View file @
fcdae7f
| 1 | +// 完善游客信息 | |
| 2 | + | |
| 3 | +// 网络请求工具类 | |
| 4 | +var networkUtil = require('../../utils/network_util.js') | |
| 5 | +var api = require('../../utils/apiFile.js') | |
| 6 | + | |
| 7 | + | |
| 8 | +// 是否有更多 | |
| 9 | +var userId = '' | |
| 10 | +var token = '' | |
| 11 | + | |
| 12 | +Page({ | |
| 13 | + data: { | |
| 14 | + }, | |
| 15 | + /*---------生命周期--------*/ | |
| 16 | + onLoad: function (e) { | |
| 17 | + userId = e.userId | |
| 18 | + token = e.token | |
| 19 | + }, | |
| 20 | + formSubmit: function (e) { | |
| 21 | + networkUtil.showLoading() | |
| 22 | + getApp().globalData.token = token | |
| 23 | + var param = { 'username': '李白', 'birth': '2017-02-15'} | |
| 24 | + networkUtil._put(api.kTourisInfo + userId, param, function (res) { | |
| 25 | + console.log(res) | |
| 26 | + getApp().globalData.token = '' | |
| 27 | + wx.showModal({ | |
| 28 | + title: '提示', | |
| 29 | + content: '注册成功,立即登录', | |
| 30 | + success: function (res) { | |
| 31 | + if (res.confirm) { | |
| 32 | + wx.navigateBack({ | |
| 33 | + delta: 5 | |
| 34 | + }) | |
| 35 | + } | |
| 36 | + } | |
| 37 | + }) | |
| 38 | + }, function (res) { | |
| 39 | + networkUtil.showErrorToast(res.errormsg) | |
| 40 | + }) | |
| 41 | + } | |
| 42 | +}) | 
littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.json
View file @
fcdae7f
littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.wxml
View file @
fcdae7f
| 1 | +<view class="backgroundView" style="background: white"> | |
| 2 | + <form catchsubmit="formSubmit"> | |
| 3 | + | |
| 4 | + <view class="record-input-constainer whiteColor"> | |
| 5 | + <view class="record-input_bg whiteColor" style="border-color:{{inputFocus.nameInput ? '#48C17B' : '#e8eae5'}}"> | |
| 6 | + <label class="record-input_title">姓名</label> | |
| 7 | + <input class="input" id="name" name="name" maxlength="12" placeholder="请输入建档姓名" value="" placeholder-class="input-placeholder" bindinput="blurNameInput"/> | |
| 8 | + </view> | |
| 9 | + <view>生日</view> | |
| 10 | + <view>性别</view> | |
| 11 | + </view> | |
| 12 | + | |
| 13 | + <button class="record-submit-btn" formType="submit">立即注册</button> | |
| 14 | + </form> | |
| 15 | +</view> | 
littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.wxss
View file @
fcdae7f
| 1 | +@import "../home/css/login.wxss"; | 
littleApp_child/pages/Register/Register.js
View file @
fcdae7f
| ... | ... | @@ -12,7 +12,7 @@ | 
| 12 | 12 | Page({ | 
| 13 | 13 | data: { | 
| 14 | 14 | inputFocus: { codeInput: false }, | 
| 15 | - time: '60s', | |
| 15 | + time: '0s', | |
| 16 | 16 | }, | 
| 17 | 17 | // 获取验证码 | 
| 18 | 18 | getVerifyCode: function (e) { | 
| ... | ... | @@ -23,7 +23,7 @@ | 
| 23 | 23 | } | 
| 24 | 24 | if (numberUtil.IsTelPhoneNumber(phone) && name.length > 0) { | 
| 25 | 25 | var that = this | 
| 26 | - networkUtil._post(api.bindDoc, { username: name, phone: phone }, function (res) { | |
| 26 | + networkUtil._post(api.bindDoc, { username: name, phone: phone,'type':2 }, function (res) { | |
| 27 | 27 | console.log("getVerifyCode:", res) | 
| 28 | 28 | |
| 29 | 29 | }, function (res) { | 
| ... | ... | @@ -98,13 +98,10 @@ | 
| 98 | 98 | }) | 
| 99 | 99 | }, | 
| 100 | 100 | loginSuccess(data) { | 
| 101 | - // wx.setStorageSync('userToken', data.token) | |
| 102 | - // wx.setStorageSync('userId', data.patientIds) | |
| 103 | - // wx.setStorageSync('hxName', data.hxName) | |
| 104 | - // wx.setStorageSync('hxPassWord', data.hxPassWord) | |
| 105 | - // getApp().globalData.token = data.token | |
| 106 | - // getApp().globalData.userId = data.patientIds | |
| 107 | - this.homePage() | |
| 101 | + | |
| 102 | + wx.navigateTo({ | |
| 103 | + url: '../CompleteTouristInfo/CompleteTouristInfo?userId=' + data.id + '&token=' + data.token, | |
| 104 | + }) | |
| 108 | 105 | } | 
| 109 | 106 | }) | 
littleApp_child/pages/Register/Register.wxss
View file @
fcdae7f
| 1 | -.input-placeholder { | |
| 2 | - font-size: 13px; | |
| 3 | - color: #999; | |
| 4 | -} | |
| 5 | - | |
| 6 | -page { | |
| 7 | - background-color: white; | |
| 8 | -} | |
| 9 | - | |
| 10 | -.record-topbar { | |
| 11 | - width: 100%; | |
| 12 | - height: 45px; | |
| 13 | - background: #ffd5dd; | |
| 14 | - font-size: 12px; | |
| 15 | - color: #ee7289; | |
| 16 | - text-align: center; | |
| 17 | - line-height: 45px; | |
| 18 | -} | |
| 19 | - | |
| 20 | -.record-input-constainer { | |
| 21 | - margin: 40px 10px 0 10px; | |
| 22 | -} | |
| 23 | - | |
| 24 | -.record-input_bg { | |
| 25 | - /*background: beige;*/ | |
| 26 | - display: flex; | |
| 27 | - align-items: center; | |
| 28 | - justify-content: flex-start; | |
| 29 | - height: 42px; | |
| 30 | - border: solid 1px; | |
| 31 | - border-radius: 5px; | |
| 32 | -} | |
| 33 | - | |
| 34 | -.record-input_title { | |
| 35 | - /*background-color: green;*/ | |
| 36 | - width: 50px; | |
| 37 | - height: 20px; | |
| 38 | - text-align: left; | |
| 39 | - line-height: 20px; | |
| 40 | - font: medium; | |
| 41 | - font-size: 14px; | |
| 42 | - color: #000; | |
| 43 | - padding-left: 15px; | |
| 44 | - border-right: solid #e8eae5 1px; | |
| 45 | -} | |
| 46 | - | |
| 47 | -.input { | |
| 48 | - /*background-color: red;*/ | |
| 49 | - font-size: 13px; | |
| 50 | - color: #999; | |
| 51 | - margin-left: 10px; | |
| 52 | - width: 110px; | |
| 53 | - margin-top: 3px; | |
| 54 | -} | |
| 55 | - | |
| 56 | -.record-submit-btn { | |
| 57 | - font: medium; | |
| 58 | - font-size: 20px; | |
| 59 | - color: white; | |
| 60 | - margin-left: 10px; | |
| 61 | - margin-right: 10px; | |
| 62 | - height: 45px; | |
| 63 | - line-height: 45px; | |
| 64 | - border-radius: 22.5px; | |
| 65 | - background-color: #48c17b; | |
| 66 | - width: calc(100%-20px); | |
| 67 | - margin-top: 200px; | |
| 68 | - text-align: center; | |
| 69 | -} | |
| 70 | - | |
| 71 | -.code-input_bg { | |
| 72 | - /*background: beige;*/ | |
| 73 | - display: flex; | |
| 74 | - align-items: center; | |
| 75 | - justify-content: flex-start; | |
| 76 | - height: 42px; | |
| 77 | - border: solid 1px; | |
| 78 | - border-radius: 5px; | |
| 79 | - width: 70%; | |
| 80 | -} | |
| 81 | - | |
| 82 | -.record-time-text { | |
| 83 | - font: lighter; | |
| 84 | - margin-left: 10px; | |
| 85 | - width: 30%; | |
| 86 | - text-align: center; | |
| 87 | - font-size: 15px; | |
| 88 | - color: #666; | |
| 89 | - height: 42px; | |
| 90 | - line-height: 42px; | |
| 91 | - margin-top: 15px; | |
| 92 | - border-radius: 4px; | |
| 93 | - float: right; | |
| 94 | - background: #f6f6f6; | |
| 95 | - border: 1px solid #d3d3d3; | |
| 96 | - /*background-color: rgba(1, 1, 1, 1);*/ | |
| 97 | -} | |
| 98 | - | |
| 99 | -.code_view { | |
| 100 | - display: flex; | |
| 101 | -} | |
| 1 | +@import "../home/css/login.wxss"; | 
littleApp_child/pages/home/home.js
View file @
fcdae7f