Bladeren bron

防止重复点击

guessPrice
zhanghaojie 5 jaren geleden
bovenliggende
commit
5de2163203
6 gewijzigde bestanden met toevoegingen van 63 en 15 verwijderingen
  1. +18
    -2
      496_dongfengqichen/pages/scout/register/register.js
  2. +3
    -2
      496_dongfengqichen/pages/scout/register/register.wxml
  3. +15
    -1
      496_dongfengqichen/pages/scout/scout.js
  4. +1
    -3
      496_dongfengqichen/pages/scout/scout.wxml
  5. +3
    -3
      496_dongfengqichen/pages/scout/scout.wxss
  6. +23
    -4
      496_dongfengqichen/pages/star/star.js

+ 18
- 2
496_dongfengqichen/pages/scout/register/register.js Bestand weergeven

getphone:"",//手机号 getphone:"",//手机号
maskShow: false, maskShow: false,
mydata:[],//我的数据 mydata:[],//我的数据
isbtn:true,//防重复点击
}, },
/** /**
* 切换车主非车主 * 切换车主非车主
}else if (!res) { }else if (!res) {
wx.showToast({icon:'none',title: '图形验证码错误'}) wx.showToast({icon:'none',title: '图形验证码错误'})
}else{ }else{
if(this.data.isbtn){
this.setData({isbtn: false})
}else{
return;
}
app.wxRequest(app.globalData.urlRoot + "userInfo/certificationCar", {carInfo:e.detail.value.VIN}, res => { app.wxRequest(app.globalData.urlRoot + "userInfo/certificationCar", {carInfo:e.detail.value.VIN}, res => {
console.log(res)
if (res.code == 200) { if (res.code == 200) {
if(res.data!=null){ if(res.data!=null){
app.globalData.certificationState=res.data.certificationState; app.globalData.certificationState=res.data.certificationState;
wx.navigateTo({url: '../scout/scout'}) wx.navigateTo({url: '../scout/scout'})
}else{ }else{
this.setData({isbtn: true})
wx.showToast({icon:'none',title: '认证失败'}) wx.showToast({icon:'none',title: '认证失败'})
} }
}else{ }else{
this.setData({isbtn: true})
wx.showToast({icon:'none',title: ''+res.msg}) wx.showToast({icon:'none',title: ''+res.msg})
} }
}, this,"POST"); }, this,"POST");
}else if(!this.data.agree){ }else if(!this.data.agree){
wx.showToast({icon:'none',title: '请阅读并同意协议内容'}) wx.showToast({icon:'none',title: '请阅读并同意协议内容'})
}else{ }else{
if(this.data.isbtn){
this.setData({isbtn: false})
}else{
return;
}
app.wxRequest(app.globalData.urlRoot + "userInfo/submitCertificationNoCarInfo", { app.wxRequest(app.globalData.urlRoot + "userInfo/submitCertificationNoCarInfo", {
mobile:e.detail.value.phone, mobile:e.detail.value.phone,
captcha:e.detail.value.code, captcha:e.detail.value.code,
if (res.code == 200) { if (res.code == 200) {
this.setData({maskShow:true}) this.setData({maskShow:true})
}else{ }else{
this.setData({isbtn: true})
wx.showToast({icon:'none',title: ''+res.msg}) wx.showToast({icon:'none',title: ''+res.msg})
} }
}, this,"POST"); }, this,"POST");
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() { onShow: function() {
this.setData({isbtn: true})
this.getshow(); this.getshow();
}, },
getshow(){ getshow(){
console.log(res) console.log(res)
if(res.code=200 && res.data){ if(res.code=200 && res.data){
if(res.data.adminState==1){//审核通过 if(res.data.adminState==1){//审核通过
wx.navigateTo({url: '../../star/star'})
wx.navigateTo({url: '../../scout/scout'})
}else if(res.data.adminState==0 || res.data.adminState==-1){//审核中&审核失败 }else if(res.data.adminState==0 || res.data.adminState==-1){//审核中&审核失败
if(res.data.adminState==0){ if(res.data.adminState==0){
this.setData({maskShow:true}) this.setData({maskShow:true})
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function() { onShareAppMessage: function() {
return app.sharePack();
} }
}) })

+ 3
- 2
496_dongfengqichen/pages/scout/register/register.wxml Bestand weergeven

<view class="showView"> <view class="showView">
<view class="registerContainer"> <view class="registerContainer">
<view class="tabsBox"> <view class="tabsBox">
<view class="item {{type==1?'select':''}}" data-type="1" bindtap="changeType">车主</view>
<view class="item {{type==0?'select':''}}" data-type="0" bindtap="changeType">非车主</view>
<view class="item {{type==1?'select':''}}" data-type="1" bindtap="changeType" style="border-top-left-radius: 8rpx;border-bottom-left-radius: 8rpx;">车主</view>
<view class="item {{type==0?'select':''}}" data-type="0" bindtap="changeType"
style="border-top-right-radius: 8rpx;border-bottom-right-radius: 8rpx;">非车主</view>
</view> </view>
<view class="welcome">欢迎加入星探计划</view> <view class="welcome">欢迎加入星探计划</view>
<form bindsubmit="formSubmit1" wx:if="{{type==1}}"> <form bindsubmit="formSubmit1" wx:if="{{type==1}}">

+ 15
- 1
496_dongfengqichen/pages/scout/scout.js Bestand weergeven

nickName: null, nickName: null,
userLevel: 0 userLevel: 0
}, },
isbtn:true,//防重复点击
}, },
/** /**
* 关闭提示弹窗 * 关闭提示弹窗
}, },
getUserWxMsg:function(e){//通过微信获取用户信息 getUserWxMsg:function(e){//通过微信获取用户信息
if (e.detail.errMsg == "getUserInfo:ok") { if (e.detail.errMsg == "getUserInfo:ok") {
if(this.data.isbtn){
this.setData({isbtn: false})
}else{
return;
}
this.data.userData.avatarUrl = e.detail.userInfo.avatarUrl; this.data.userData.avatarUrl = e.detail.userInfo.avatarUrl;
this.data.userData.nickName = e.detail.userInfo.nickName; this.data.userData.nickName = e.detail.userInfo.nickName;
this.data.userData.userLevel = 0; this.data.userData.userLevel = 0;
} }
}, },
getUserInfo:function(e){//获取个人信息 getUserInfo:function(e){//获取个人信息
if(this.data.isbtn){
this.setData({isbtn: false})
}else{
return;
}
app.wxRequest(app.globalData.urlRoot + 'userInfo/getUserInfo', {}, res => { app.wxRequest(app.globalData.urlRoot + 'userInfo/getUserInfo', {}, res => {
if(res.code==200){ if(res.code==200){
// res.data.userLevel = 3; // res.data.userLevel = 3;
url:'../poster/poster' url:'../poster/poster'
}) })
} }
}else{
this.setData({isbtn: true})
} }
},this) },this)
}, },
}else{ }else{
this.setData({iconShow:false}) this.setData({iconShow:false})
} }
this.setData({isbtn: true})
// wx.navigateTo({ // wx.navigateTo({
// url: './share/share' // url: './share/share'
// }) // })
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
return app.sharePack();
} }
}) })

+ 1
- 3
496_dongfengqichen/pages/scout/scout.wxml Bestand weergeven

<view class="content"> <view class="content">
<image class="bg" src="{{imgUrl+'/star/scout/bg.jpg'}}"></image> <image class="bg" src="{{imgUrl+'/star/scout/bg.jpg'}}"></image>
<image class="reward" src="{{imgUrl+'/star/scout/reward.png'}}"></image> <image class="reward" src="{{imgUrl+'/star/scout/reward.png'}}"></image>
<view class="btn" bindtap="getPoster">立即分享,赚取奖励
<view class="btn" bindtap="getPoster">立即分享,赚取奖励</view>
<button class="btn2" wx:if="{{iconShow}}" open-type="getUserInfo" bindgetuserinfo="getUserWxMsg"></button> <button class="btn2" wx:if="{{iconShow}}" open-type="getUserInfo" bindgetuserinfo="getUserWxMsg"></button>
</view>
</view> </view>
<view class="mask" wx:if="{{maskShow}}"> <view class="mask" wx:if="{{maskShow}}">
<view class="tipContent" wx:if="{{tipShow}}"> <view class="tipContent" wx:if="{{tipShow}}">

+ 3
- 3
496_dongfengqichen/pages/scout/scout.wxss Bestand weergeven

} }
.btn2{ .btn2{
text-align: center; text-align: center;
width: 100%;
height: 100%;
width: 654rpx;
height: 58rpx;
background-color: #2a558d; background-color: #2a558d;
margin: -58rpx auto 0rpx auto;
margin: -110rpx auto 35rpx auto;
opacity:0; opacity:0;
} }
.mask { .mask {

+ 23
- 4
496_dongfengqichen/pages/star/star.js Bestand weergeven

starNumber:4000,//开始人数 starNumber:4000,//开始人数
stopNumber:0,//结束人数 stopNumber:0,//结束人数
numList:[4,0,0,0], numList:[4,0,0,0],
isbtn:true,//防重复点击
}, },
/** /**
* 显示规则页 * 显示规则页
* 每日任务 * 每日任务
*/ */
everyDay:function(){ everyDay:function(){
wx.navigateTo({
url:'../everyday/everyday'
})
if(this.data.isbtn){
this.setData({isbtn: false})
}else{
return;
}
wx.navigateTo({url:'../everyday/everyday'})
}, },
/** /**
* 星探任务 * 星探任务
*/ */
scout:function(){ scout:function(){
if(this.data.isbtn){
this.setData({isbtn: false})
}else{
return;
}
this.phonebolb(app.globalData.userMobile); this.phonebolb(app.globalData.userMobile);
}, },
phonebolb:function(_phone){ phonebolb:function(_phone){
url: '../scout/register/register' url: '../scout/register/register'
}) })
} }
}else{
this.setData({isbtn: true})
} }
}, this); }, this);
}, },
getPhone (e) { getPhone (e) {
console.log(e.detail) console.log(e.detail)
if (e.detail.errMsg=='getPhoneNumber:ok'){ if (e.detail.errMsg=='getPhoneNumber:ok'){
if(this.data.isbtn){
this.setData({isbtn: false})
}else{
return;
}
app.wxRequest(app.globalData.urlRoot + "userInfo/getUserPhoneNumber", { encryptedData: e.detail.encryptedData, iv: e.detail.iv }, res => { app.wxRequest(app.globalData.urlRoot + "userInfo/getUserPhoneNumber", { encryptedData: e.detail.encryptedData, iv: e.detail.iv }, res => {
console.log(res) console.log(res)
if (res.code == 200) { if (res.code == 200) {
this.phonebolb(res.data.decodeData.phoneNumber); this.phonebolb(res.data.decodeData.phoneNumber);
app.globalData.userMobile=res.data.decodeData.phoneNumber; app.globalData.userMobile=res.data.decodeData.phoneNumber;
}else{ }else{
this.setData({isbtn: true})
wx.showToast({title: '获取失败',icon: "none"}) wx.showToast({title: '获取失败',icon: "none"})
} }
} else { } else {
this.setData({isbtn: true})
wx.showToast({title: res.msg,icon: "none"}) wx.showToast({title: res.msg,icon: "none"})
} }
}, this,"POST"); }, this,"POST");
}else{ }else{
this.setData({phonebol: false}) this.setData({phonebol: false})
} }
this.setData({isbtn: true})
}, },


/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
return app.sharePack();
} }
}) })

Laden…
Annuleren
Opslaan