Browse Source

星探任务页面逻辑修改

guessPrice
sui 5 years ago
parent
commit
f691eb6393
10 changed files with 155 additions and 29 deletions
  1. +73
    -1
      496_dongfengqichen/pages/mobileVerification/mobileVerification.js
  2. +6
    -3
      496_dongfengqichen/pages/mobileVerification/mobileVerification.wxml
  3. +7
    -0
      496_dongfengqichen/pages/mobileVerification/mobileVerification.wxss
  4. +13
    -0
      496_dongfengqichen/pages/myCenter/myCenter.js
  5. +6
    -1
      496_dongfengqichen/pages/myCenter/myCenter.wxml
  6. +19
    -0
      496_dongfengqichen/pages/myCenter/myCenter.wxss
  7. +2
    -2
      496_dongfengqichen/pages/prizes/prizes.wxml
  8. +2
    -2
      496_dongfengqichen/pages/prizes/prizes.wxss
  9. +26
    -19
      496_dongfengqichen/pages/star/star.js
  10. +1
    -1
      496_dongfengqichen/pages/star/star.wxml

+ 73
- 1
496_dongfengqichen/pages/mobileVerification/mobileVerification.js View File

verificationCode: '获取验证码',//验证码文案 verificationCode: '获取验证码',//验证码文案
sendCode: true, sendCode: true,
mobileText:"",//手机号 mobileText:"",//手机号
verificationText:null,
getMobileBtnShow:true,
}, },


/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {

if (app.globalData.userMobile) {
this.setData({
getMobileBtnShow: false,
mobileText: app.globalData.userMobile
})
}
}, },


/** /**
}, },
getMoblie:function(e){//获取用户输入的手机号 getMoblie:function(e){//获取用户输入的手机号
this.data.mobileText = e.detail.value 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)
}
} }
}) })

+ 6
- 3
496_dongfengqichen/pages/mobileVerification/mobileVerification.wxml View File

<view class="inputGroup"> <view class="inputGroup">
<view class="mobileFirst">+86</view> <view class="mobileFirst">+86</view>
<image class="mobilepagedown" src="{{imgUrl+'/images/mobilepagedown.png'}}"></image> <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>
<view class="inputGroup" style="justify-content: space-between;margin-top:30rpx;"> <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 class="codeSty" bindtap="getCode">{{verificationCode}}</view>
</view> </view>
</view> </view>
<image class="agreeIcon" src="{{imgUrl+(isAgreement?'/images/agreeIcon.png':'/images/disagreeIcon.png')}}"></image> <image class="agreeIcon" src="{{imgUrl+(isAgreement?'/images/agreeIcon.png':'/images/disagreeIcon.png')}}"></image>
<view class="agreementText">我仔细阅读并接受所附的《用户协议与隐私政策》</view> <view class="agreementText">我仔细阅读并接受所附的《用户协议与隐私政策》</view>
</view> </view>
<view class="submitBtn">提交</view>
<view class="submitBtn" bindtap="submitMobile">提交</view>
</view> </view>
</view> </view>
<tabBar></tabBar> <tabBar></tabBar>

+ 7
- 0
496_dongfengqichen/pages/mobileVerification/mobileVerification.wxss View File

font-family:PingFangSC; font-family:PingFangSC;
font-weight:300; font-weight:300;
color:rgba(156,157,157,1); color:rgba(156,157,157,1);
}
.getMobileBtn{
position: absolute;
left: 0;
top: 0;
z-index: 2;
opacity: 0;
} }

+ 13
- 0
496_dongfengqichen/pages/myCenter/myCenter.js View File

*/ */
data: { data: {
imgUrl: app.globalData.urlStatic,//图片路径 imgUrl: app.globalData.urlStatic,//图片路径
isAgreement: true,//是否同意协议
phoneInputShow: false,//是否显示电话输入框 phoneInputShow: false,//是否显示电话输入框
siteSelect: false,//是否显示位置选择框 siteSelect: false,//是否显示位置选择框
isLogin:false,//登录状态 isLogin:false,//登录状态
}) })
return; return;
} }
if (!this.data.isAgreement) {
wx.showToast({
title: '请同意协议',
icon: 'none'
})
return;
}
if (!this.data.appointment) { if (!this.data.appointment) {
return; return;
} }
wx.navigateTo({ wx.navigateTo({
url: '../address/address' url: '../address/address'
}) })
},
agreementState: function () {//协议
this.setData({
isAgreement: !this.data.isAgreement
})
} }
}) })

+ 6
- 1
496_dongfengqichen/pages/myCenter/myCenter.wxml View File

</view> </view>
</picker> </picker>
</view> </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>
<!-- <view class="subscribeGroup" wx:if="{{selectNow==4 && isRegister}}"> <!-- <view class="subscribeGroup" wx:if="{{selectNow==4 && isRegister}}">
<view>已预约</view> <view>已预约</view>

+ 19
- 0
496_dongfengqichen/pages/myCenter/myCenter.wxss View File

.luckyClaw{ .luckyClaw{
width: 198rpx; width: 198rpx;
height: 75rpx; 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);
} }

+ 2
- 2
496_dongfengqichen/pages/prizes/prizes.wxml View File

</view> </view>
<view class="thirdAward" style="margin-top:0;">一等奖</view> <view class="thirdAward" style="margin-top:0;">一等奖</view>
<view class="firstPrize"> <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>
<view class="thirdAward">二等奖</view> <view class="thirdAward">二等奖</view>
<view class="ticketGroup"> <view class="ticketGroup">

+ 2
- 2
496_dongfengqichen/pages/prizes/prizes.wxss View File

margin-top: 35rpx; margin-top: 35rpx;
} }
.firstPrizePic{ .firstPrizePic{
width:460rpx;
height:172rpx;
width:119rpx;
height:204rpx;
} }
.firstPrizeText{ .firstPrizeText{
line-height: 28rpx; line-height: 28rpx;

+ 26
- 19
496_dongfengqichen/pages/star/star.js View File

}else{ }else{
return; return;
} }
this.phonebolb(app.globalData.userMobile);
this.phonebolb();
}, },
phonebolb:function(_phone){ 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.code == 200) {
if(res.data!=null){
app.globalData.certificationState=res.data.certificationState;
// if(res.data!=null){
app.globalData.certificationState = res.data.certificationState;
wx.navigateTo({ wx.navigateTo({
url: '../scout/scout' 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{ }else{
this.setData({isbtn: true}) this.setData({isbtn: true})
} }
}else{ }else{
return; 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.code == 200) {
if(res.data.result==0){
if (res.data.result == 0) {
this.phonebolb(res.data.decodeData.phoneNumber); 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 { } 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)
} }
}, },



+ 1
- 1
496_dongfengqichen/pages/star/star.wxml View File

<view class="btnBox"> <view class="btnBox">
<view class="btn" bindtap="scout">星探任务</view> <view class="btn" bindtap="scout">星探任务</view>
<view class="btn" bindtap="everyDay">每日任务</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> </view>
<view class="mask" wx:if="{{maskShow}}"> <view class="mask" wx:if="{{maskShow}}">

Loading…
Cancel
Save