| @@ -11,13 +11,20 @@ Page({ | |||
| verificationCode: '获取验证码',//验证码文案 | |||
| sendCode: true, | |||
| mobileText:"",//手机号 | |||
| verificationText:null, | |||
| getMobileBtnShow:true, | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| if (app.globalData.userMobile) { | |||
| this.setData({ | |||
| getMobileBtnShow: false, | |||
| mobileText: app.globalData.userMobile | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| @@ -128,5 +135,70 @@ Page({ | |||
| }, | |||
| getMoblie:function(e){//获取用户输入的手机号 | |||
| this.data.mobileText = e.detail.value | |||
| }, | |||
| getCodeText: function (e) {//获取用户输入的手机号 | |||
| this.data.verificationText = e.detail.value | |||
| }, | |||
| submitMobile: function (){ | |||
| if (!app.mobileVerify(this.data.mobileText)) { | |||
| if (this.data.mobileText) { | |||
| wx.showToast({ | |||
| title: '请输入正确的电话', | |||
| icon: 'none' | |||
| }) | |||
| } else { | |||
| wx.showToast({ | |||
| title: '请输入电话', | |||
| icon: 'none' | |||
| }) | |||
| } | |||
| return; | |||
| } | |||
| if (!this.data.verificationText) { | |||
| wx.showToast({ | |||
| title: '请输入验证码', | |||
| icon: 'none' | |||
| }) | |||
| return; | |||
| } | |||
| if (!this.data.isAgreement) { | |||
| wx.showToast({ | |||
| title: '请同意协议', | |||
| icon: 'none' | |||
| }) | |||
| return; | |||
| } | |||
| app.wxRequest(app.globalData.urlRoot + "userInfo/getCertificationInfo", { mobile: this.data.mobileText, captcha: this.data.verificationText }, res => { | |||
| if (res.code == 200) { | |||
| wx.setStorageSync('userMobile', this.data.mobileText ); | |||
| app.globalData.userMobile = this.data.mobileText ; | |||
| if (res.data != null) { | |||
| app.globalData.certificationState = res.data.certificationState; | |||
| wx.redirectTo({ | |||
| url: '../scout/scout' | |||
| }) | |||
| } else { | |||
| wx.redirectTo({ | |||
| url: '../scout/register/register' | |||
| }) | |||
| } | |||
| } | |||
| }, this); | |||
| }, | |||
| getPhone(e) { | |||
| this.setData({ | |||
| getMobileBtnShow:false | |||
| }) | |||
| if (e.detail.errMsg == 'getPhoneNumber:ok') { | |||
| app.getMobile(e.detail.encryptedData, e.detail.iv, res => { | |||
| if (res.code == 200) { | |||
| if (res.data.result == 0) { | |||
| this.setData({ | |||
| mobileText: res.data.decodeData.phoneNumber | |||
| }) | |||
| } | |||
| } | |||
| }, this) | |||
| } | |||
| } | |||
| }) | |||
| @@ -12,10 +12,13 @@ | |||
| <view class="inputGroup"> | |||
| <view class="mobileFirst">+86</view> | |||
| <image class="mobilepagedown" src="{{imgUrl+'/images/mobilepagedown.png'}}"></image> | |||
| <input class="inputText" bindinput="getMoblie" placeholder="手机号" type="number" maxlength='11'></input> | |||
| <view class="inputText" style="position: relative;"> | |||
| <input class="inputText" bindinput="getMoblie" value="{{mobileText}}" placeholder="手机号" type="number" maxlength='11'></input> | |||
| <button class="getMobileBtn" wx:if="{{getMobileBtnShow}}" open-type="getPhoneNumber" bindgetphonenumber="getPhone" style="width:100%;height:100%;min-height:0;margin:0;padding:0;"></button> | |||
| </view> | |||
| </view> | |||
| <view class="inputGroup" style="justify-content: space-between;margin-top:30rpx;"> | |||
| <input class="inputText" placeholder="短信验证码"></input> | |||
| <input class="inputText" bindinput="getCodeText" placeholder="短信验证码"></input> | |||
| <view class="codeSty" bindtap="getCode">{{verificationCode}}</view> | |||
| </view> | |||
| </view> | |||
| @@ -23,7 +26,7 @@ | |||
| <image class="agreeIcon" src="{{imgUrl+(isAgreement?'/images/agreeIcon.png':'/images/disagreeIcon.png')}}"></image> | |||
| <view class="agreementText">我仔细阅读并接受所附的《用户协议与隐私政策》</view> | |||
| </view> | |||
| <view class="submitBtn">提交</view> | |||
| <view class="submitBtn" bindtap="submitMobile">提交</view> | |||
| </view> | |||
| </view> | |||
| <tabBar></tabBar> | |||
| @@ -126,4 +126,11 @@ view{ | |||
| font-family:PingFangSC; | |||
| font-weight:300; | |||
| color:rgba(156,157,157,1); | |||
| } | |||
| .getMobileBtn{ | |||
| position: absolute; | |||
| left: 0; | |||
| top: 0; | |||
| z-index: 2; | |||
| opacity: 0; | |||
| } | |||
| @@ -7,6 +7,7 @@ Page({ | |||
| */ | |||
| data: { | |||
| imgUrl: app.globalData.urlStatic,//图片路径 | |||
| isAgreement: true,//是否同意协议 | |||
| phoneInputShow: false,//是否显示电话输入框 | |||
| siteSelect: false,//是否显示位置选择框 | |||
| isLogin:false,//登录状态 | |||
| @@ -321,6 +322,13 @@ Page({ | |||
| }) | |||
| return; | |||
| } | |||
| if (!this.data.isAgreement) { | |||
| wx.showToast({ | |||
| title: '请同意协议', | |||
| icon: 'none' | |||
| }) | |||
| return; | |||
| } | |||
| if (!this.data.appointment) { | |||
| return; | |||
| } | |||
| @@ -507,5 +515,10 @@ Page({ | |||
| wx.navigateTo({ | |||
| url: '../address/address' | |||
| }) | |||
| }, | |||
| agreementState: function () {//协议 | |||
| this.setData({ | |||
| isAgreement: !this.data.isAgreement | |||
| }) | |||
| } | |||
| }) | |||
| @@ -164,7 +164,12 @@ | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view class="subscribeBtn" bindtap="subscribeFun">预约鉴赏</view> | |||
| <view class="agreementGroup" bindtap="agreementState"> | |||
| <image class="agreeIcon" src="{{imgUrl+(isAgreement?'/images/agreeIcon.png':'/images/disagreeIcon.png')}}"></image> | |||
| <view class="agreementText">我仔细阅读并接受所附的《用户协议与隐私政策》</view> | |||
| </view> | |||
| <view class="subscribeBtn" bindtap="subscribeFun">登录/注册</view> | |||
| <view class="subscribeBtn">查看更多车型</view> | |||
| </view> | |||
| <!-- <view class="subscribeGroup" wx:if="{{selectNow==4 && isRegister}}"> | |||
| <view>已预约</view> | |||
| @@ -589,4 +589,23 @@ view{ | |||
| .luckyClaw{ | |||
| width: 198rpx; | |||
| height: 75rpx; | |||
| } | |||
| .agreementGroup{ | |||
| width: 652rpx; | |||
| margin: 0 auto; | |||
| display: flex; | |||
| align-items: center; | |||
| margin-top: 15rpx; | |||
| } | |||
| .agreeIcon{ | |||
| width: 29rpx; | |||
| height: 28rpx; | |||
| margin-right: 17rpx; | |||
| } | |||
| .agreementText{ | |||
| line-height: 24rpx; | |||
| font-size:24rpx; | |||
| font-family:PingFangSC; | |||
| font-weight:300; | |||
| color:rgba(156,157,157,1); | |||
| } | |||
| @@ -6,8 +6,8 @@ | |||
| </view> | |||
| <view class="thirdAward" style="margin-top:0;">一等奖</view> | |||
| <view class="firstPrize"> | |||
| <image class="firstPrizePic" src="{{imgUrl+'/images/firstPrizePic.png'}}"></image> | |||
| <view class="firstPrizeText">欢乐谷全家一日游</view> | |||
| <image class="firstPrizePic" src="{{imgUrl+'/images/firstPrizePic2.png'}}"></image> | |||
| <view class="firstPrizeText">NITORI电动太空舱按摩椅</view> | |||
| </view> | |||
| <view class="thirdAward">二等奖</view> | |||
| <view class="ticketGroup"> | |||
| @@ -144,8 +144,8 @@ view{ | |||
| margin-top: 35rpx; | |||
| } | |||
| .firstPrizePic{ | |||
| width:460rpx; | |||
| height:172rpx; | |||
| width:119rpx; | |||
| height:204rpx; | |||
| } | |||
| .firstPrizeText{ | |||
| line-height: 28rpx; | |||
| @@ -54,21 +54,29 @@ Page({ | |||
| }else{ | |||
| return; | |||
| } | |||
| this.phonebolb(app.globalData.userMobile); | |||
| this.phonebolb(); | |||
| }, | |||
| phonebolb:function(_phone){ | |||
| app.wxRequest(app.globalData.urlRoot + "userInfo/getCertificationInfo", {mobile:_phone}, res => { | |||
| app.wxRequest(app.globalData.urlRoot + "userInfo/getCertificationInfo", {}, res => { | |||
| if (res.code == 200) { | |||
| if(res.data!=null){ | |||
| app.globalData.certificationState=res.data.certificationState; | |||
| // if(res.data!=null){ | |||
| app.globalData.certificationState = res.data.certificationState; | |||
| wx.navigateTo({ | |||
| url: '../scout/scout' | |||
| }) | |||
| }else{ | |||
| wx.navigateTo({ | |||
| url: '../scout/register/register' | |||
| }) | |||
| } | |||
| // }else{ | |||
| // wx.navigateTo({ | |||
| // url: '../scout/register/register' | |||
| // }) | |||
| // } | |||
| } else if (res.code == -307){ | |||
| wx.navigateTo({ | |||
| url: '../mobileVerification/mobileVerification' | |||
| }) | |||
| } else if (res.code == -308) { | |||
| wx.navigateTo({ | |||
| url: '../scout/register/register' | |||
| }) | |||
| }else{ | |||
| this.setData({isbtn: true}) | |||
| } | |||
| @@ -147,21 +155,20 @@ Page({ | |||
| }else{ | |||
| return; | |||
| } | |||
| app.wxRequest(app.globalData.urlRoot + "userInfo/getUserPhoneNumber", { encryptedData: e.detail.encryptedData, iv: e.detail.iv }, res => { | |||
| console.log(res) | |||
| app.getMobile(e.detail.encryptedData, e.detail.iv,res=>{ | |||
| if (res.code == 200) { | |||
| if(res.data.result==0){ | |||
| if (res.data.result == 0) { | |||
| this.phonebolb(res.data.decodeData.phoneNumber); | |||
| app.globalData.userMobile=res.data.decodeData.phoneNumber; | |||
| }else{ | |||
| this.setData({isbtn: true}) | |||
| wx.showToast({title: '获取失败',icon: "none"}) | |||
| app.globalData.userMobile = res.data.decodeData.phoneNumber; | |||
| } else { | |||
| this.setData({ isbtn: true }) | |||
| wx.showToast({ title: '获取失败', icon: "none" }) | |||
| } | |||
| } else { | |||
| this.setData({isbtn: true}) | |||
| wx.showToast({title: res.msg,icon: "none"}) | |||
| this.setData({ isbtn: true }) | |||
| wx.showToast({ title: res.msg, icon: "none" }) | |||
| } | |||
| }, this,"POST"); | |||
| },this) | |||
| } | |||
| }, | |||
| @@ -19,7 +19,7 @@ | |||
| <view class="btnBox"> | |||
| <view class="btn" bindtap="scout">星探任务</view> | |||
| <view class="btn" bindtap="everyDay">每日任务</view> | |||
| <button class="btn2" wx:if="{{phonebol}}" open-type="getPhoneNumber" bindgetphonenumber="getPhone"></button> | |||
| <!-- <button class="btn2" wx:if="{{phonebol}}" open-type="getPhoneNumber" bindgetphonenumber="getPhone"></button> --> | |||
| </view> | |||
| </view> | |||
| <view class="mask" wx:if="{{maskShow}}"> | |||