This commit is contained in:
魏啾
2024-04-08 13:50:05 +08:00
parent 2b723694fa
commit d844832aad
13 changed files with 1309 additions and 124 deletions

View File

@@ -1,16 +1,15 @@
<template>
<view class="container">
<view class="box flex-colum-start">
<text>您好</text>
<text>欢迎使用银收客</text>
<view class="box flex-center">
<!-- <text>欢迎登录零点八零</text> -->
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/login/czgqrlogin.png" mode=""></image>
</view>
<view class="top_box" :style="h">
<view class="top_box_one">
<view class="top_box">
<view class="top_box_one" v-if="showbox">
<text class="top_box_one_text">手机号码</text>
<input type="text" v-model="form.loginName" :adjust-position="false" placeholder="请输入手机号码"
maxlength="-1" data-key="mobile" />
<input type="text" v-model="form.loginName" :adjust-position="false" placeholder="请输入手机号码" />
</view>
<view class="top_box_one">
<!-- <view class="top_box_one" v-if="showbox">
<text class="top_box_one_text">密码</text>
<input type="mobile" v-model="form.password" :adjust-position="false" placeholder="8-16位密码"
maxlength="16" :password="!showPassword" />
@@ -18,22 +17,42 @@
<u-icon name="eye" v-if="showPassword"></u-icon>
<u-icon v-else name="eye-off"></u-icon>
</view>
</view> -->
<view class="top_box_one" v-if="showbox">
<text class="top_box_one_text">验证码</text>
<input type="mobile" v-model="form.code" placeholder="请输入短信验证码" maxlength="6" />
<view class="repeats">
<view v-if="showText == true" class="yzm"
style="padding: 8rpx 16rpx 6rpx 16rpx; background: #288efb; border-radius: 15rpx"
@click="CodeRegister">
{{ Recapture }}
</view>
<view v-else
style="color: #ccc; background-color: #f9f9f9; padding: 8rpx 16rpx 6rpx 16rpx; border-radius: 15rpx">
{{ second }}s重新发送
</view>
</view>
</view>
<view class="top_box_tow flex-between">
<view class="top_box_tow flex-between" v-if="showbox">
<text @click="register">注册账号</text>
<text @click="passwords">忘记密码</text>
</view>
<view class="toLogin" @click="toLogin">登录</view>
<button class="toLogin" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="!showbox">手机号快速登录
</button>
<view class="toLogins" @click="showbox = !showbox">其他手机号登录/注册</view>
<view class="agreement flex-start">
<u-checkbox-group><u-checkbox shape="circle" @change="radioChange"
size="12"></u-checkbox></u-checkbox-group>
size="24"></u-checkbox></u-checkbox-group>
<text>阅读并同意银收客</text>
<view class="agreement-Item" @click="Privacy(1)">用户协议</view>
<view class="agreement-Item" @click="Privacy(2)">隐私政策</view>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<view class="box_conf" v-if="debug" @click="showpicker = true">{{ baseUrl || '切换' }}</view>
<!-- #endif -->
<u-overlay :show="agreeShow">
<view class="warp">
<view class="rect">
@@ -41,7 +60,7 @@
<view class="rect_text flex-colum">
<view class="rect_text_one">用户须知</view>
<view class="rect_text_tow">
感谢您使用银收客我们非常重视您的个 人信息和隐私保护在您使用服务前请仔 细阅读
感谢您使用银收客,我们非常重视您的个 人信息和隐私保护在您使用服务前请仔 细阅读
<text @click="Privacy(1)">用户协议</text>
<text @click="Privacy(2)">隐私协议</text>
@@ -73,6 +92,7 @@
showpicker: false,
showpopup: false,
valueinput: '',
showbox: false,
columns: [
['http://admintestapi.sxczgkj.cn/', 'https://ky.sxczgkj.cn', 'http://192.168.2.22:7004',
'http://admintestapi.sxczgkj.cn/', '自定义输入'
@@ -84,10 +104,16 @@
showPassword: false, //是否显示密码
debug: uni.conf.debug,
baseUrl: uni.conf.baseUrl,
// 注册定时器 初始值
second: 60,
showText: true,
Recapture: '发送验证码',
form: {
//密码
loginName: '',
password: ''
password: '',
code: '',
inviteCode: ''
}
};
},
@@ -135,6 +161,39 @@
// 切换图片显示隐藏
this.showPassword = !this.showPassword;
},
async CodeRegister() {
//发起验证码
if (this.form.telephone == null || this.form.telephone == '') {
uni.showToast({
title: '请输入电话号码',
icon: 'none'
});
return false;
}
const res = await this.apix.phoneValidateCode({
// post 手机验证码
phone: this.form.telephone
});
console.log(res);
if (res) {
uni.showToast({
title: '验证码获取成功',
icon: 'none'
});
// 定时器
this.showText = false;
this.Recapture = '重新获取';
var interval = setInterval(() => {
let times = --this.second;
this.second = times < 10 ? '0' + times : times; //小于10秒补 0
}, 1000);
setTimeout(() => {
clearInterval(interval);
this.second = 60;
this.showText = true;
}, 60000);
}
},
async Privacy(e) {
if (e == 1) {
//用户协议
@@ -244,7 +303,32 @@
} else {
this.$api.msg(res.message);
}
}
},
async getPhoneNumber(res) { // 获取手机号
var resdataa = res
console.log(res)
// #ifdef MP-WEIXIN
uni.login({
provider: 'weixin',
success: async (data) => {
let resdata = await this.api.logingetPhoneNumber({
code: data.code,
iv: resdataa.detail.iv,
encryptedData: resdataa.detail.encryptedData
})
console.log(resdata)
if (resdata.data) {
this.phone = resdata.data
this.userlogin()
}
// this.userlogin()
}
});
// #endif
// #ifdef MP-WEIXIN
// #endif
},
}
};
</script>
@@ -253,7 +337,7 @@
page {
width: 100%;
height: 100%;
background: linear-gradient(104deg, #4679ff 0%, #2868e8 47%, #2a94fc 100%);
background: #FFFFFF;
}
.container {
@@ -269,16 +353,11 @@
}
.box {
padding-top: 228rpx;
padding-left: 64rpx;
padding-bottom: 144rpx;
box-sizing: border-box;
padding-top: 110rpx;
text {
font-size: 40rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #ffffff;
image {
width: 128rpx;
height: 128rpx;
}
}
@@ -363,8 +442,8 @@
.box_conf {
position: fixed;
top: 10%;
color: #fff;
top: 0;
color: #000;
padding: 20rpx;
right: 2%;
}
@@ -385,7 +464,6 @@
box-sizing: border-box;
width: 100%;
position: fixed;
bottom: 0;
display: flex;
flex-direction: column;
align-items: center;
@@ -417,6 +495,18 @@
width: 25rpx;
height: 17rpx;
}
.repeats {
position: absolute;
bottom: 26rpx;
right: 0;
font-size: 24rpx;
z-index: 9;
font-family: $uni_family;
font-weight: 400;
color: #ffffff;
border-radius: 12rpx;
}
}
.top_box_tow {
@@ -432,27 +522,50 @@
}
.toLogin {
width: 570rpx;
margin-top: 112rpx;
padding: 10rpx 0;
margin-top: 212rpx;
width: 100%;
background: #F1CB66;
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #333333;
height: 84rpx;
line-height: 84rpx;
text-align: center;
background: #288efb;
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-size: 36rpx;
font-family: $uni_family;
border: none;
}
.toLogin::after {
background: none;
border: none;
}
.toLogins {
margin-top: 32rpx;
width: 100%;
line-height: 84rpx;
height: 84rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 2rpx solid #333333;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
color: #ffffff;
font-size: 32rpx;
color: #333333;
text-align: center;
}
.agreement {
margin-top: 14rpx;
font-size: 20rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
width: 100%;
margin-top: 40rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
color: #7c8e97;
font-size: 20rpx;
color: #999999;
text-align: left;
.agreement-Item {
color: #4ca1fc;
color: #333333;
}
}
}