Browse Source

商户登录优化

master
yangrz 2 years ago
parent
commit
c4fb677ac0
  1. 54
      agentApp/pages/merchant-login/index.vue

54
agentApp/pages/merchant-login/index.vue

@ -10,18 +10,21 @@
</view> </view>
<view class="login-item"> <view class="login-item">
<input type="number" class="log-phone log-code" placeholder="请输入验证码" v-model="sms_code" /> <input type="number" class="log-phone log-code" placeholder="请输入验证码" v-model="sms_code" />
<view class="getCode" @click="getCode">
<view class="getCode" @click="getCode" v-if="countdown==0">
获取验证码 获取验证码
</view> </view>
<view class="getCode" v-else>
剩余{{countdown}}
</view>
</view> </view>
<view class="login-btn"> <view class="login-btn">
<button size="default" type="default" @click="btnLogin" <button size="default" type="default" @click="btnLogin"
style="color:#ffffff;backgroundColor:#F52F3E;borderColor:#F52F3EF;border-radius: 50rpx;height: 88rpx;line-height: 88rpx;">登录</button> style="color:#ffffff;backgroundColor:#F52F3E;borderColor:#F52F3EF;border-radius: 50rpx;height: 88rpx;line-height: 88rpx;">登录</button>
</view> </view>
<view class="login-sign"> <view class="login-sign">
<u-radio-group v-model="value">
<u-radio labelSize="13" size="20" label="我同意"></u-radio>
</u-radio-group>
<u-checkbox-group @change="handleCheck">
<u-checkbox labelSize="13" size="20" shape="circle" name="agree" label="我同意"></u-checkbox>
</u-checkbox-group>
<view class="log-link" @click="handlerApply"> <view class="log-link" @click="handlerApply">
排队支付商户用户服务协议 排队支付商户用户服务协议
</view> </view>
@ -31,7 +34,6 @@
</view> </view>
</view> </view>
</view> </view>
<u-toast ref="uToast"></u-toast>
<u-modal :show="show" @confirm="confirm" :title="title" :content='content'></u-modal> <u-modal :show="show" @confirm="confirm" :title="title" :content='content'></u-modal>
</view> </view>
</template> </template>
@ -49,14 +51,25 @@
phone: '', phone: '',
sms_code: '', sms_code: '',
bgColor: '#bgColor', bgColor: '#bgColor',
value: 1,
checked: false,
show: false, show: false,
title: '', title: '',
content: ''
content: '',
countdown: 0
}; };
}, },
methods: { methods: {
getCode() { getCode() {
if (!this.phone) {
uni.$u.toast('请填写手机号')
return
}
if (!this.checked) {
uni.$u.toast('需同意协议')
return
}
let phone = this.phone let phone = this.phone
let nonce_str = md5(Math.random() + ''); let nonce_str = md5(Math.random() + '');
let sign = md5(md5(phone) + md5(nonce_str) + nonce_str) let sign = md5(md5(phone) + md5(nonce_str) + nonce_str)
@ -66,11 +79,27 @@
sign, sign,
type: 1 type: 1
}).then(() => { }).then(() => {
this.$refs.uToast.show({
message: '短信已发送'
})
uni.$u.toast('短信已发送')
this.startCountdown()
}) })
}, },
startCountdown() {
this.countdown = 60;
let h = setInterval(() => {
this.countdown--
if (this.countdown == 0) {
clearInterval(h)
}
}, 1000)
},
handleCheck(detail) {
console.log(detail)
if (detail.indexOf('agree') != -1) {
this.checked = true
} else {
this.checked = false
}
},
handlerApply() { handlerApply() {
this.show = true; this.show = true;
this.title = '排队支付商户用户服务协议'; this.title = '排队支付商户用户服务协议';
@ -85,6 +114,11 @@
this.show = false; this.show = false;
}, },
btnLogin() { btnLogin() {
if (!this.checked) {
uni.$u.toast('需同意协议')
return
}
merchantSmsLogin({ merchantSmsLogin({
phone: this.phone, phone: this.phone,
sms_code: this.sms_code sms_code: this.sms_code

Loading…
Cancel
Save