新增注册页面

master
chen 2022-03-16 08:58:52 +08:00
parent 40eada19f8
commit 3690f2da3b
11 changed files with 535 additions and 17 deletions

10
App.vue
View File

@ -8,7 +8,7 @@
// show // show
onLaunch: function() { onLaunch: function() {
// //
uni.setStorageSync('hostapi','https://peili.scdxtc.cn'); uni.setStorageSync('hostapi','http://maintain.7and5.cn');
// //
uni.setStorageSync('publicColor','#000000'); uni.setStorageSync('publicColor','#000000');
}, },
@ -30,9 +30,13 @@
@import url("./commons/icon-font.css"); @import url("./commons/icon-font.css");
/* 阿里巴巴矢量图标库 end */ /* 阿里巴巴矢量图标库 end */
/* 项目主体样式 start */ /* 项目基础样式 start */
@import url("./commons/base.css"); @import url("./commons/base.css");
/* 项目主体样式 end */ /* 项目基础样式 end */
/* 项目页面样式 start */
@import url("./commons/flying-monkey.css");
/* 项目页面样式 end */
/* 动画样式 start */ /* 动画样式 start */
@import url("./commons/animate.min.css"); @import url("./commons/animate.min.css");

58
commons/flying-monkey.css Normal file
View File

@ -0,0 +1,58 @@
/* 注册页面 */
.register-close {width: 26rpx;height: 25rpx;}
.register-title {color: #03affb;}
.register-phone-img{
width: 0;
height: 0;
border-left: 8rpx solid transparent;
border-top: 10rpx solid #000;
border-right: 8rpx solid transparent;
margin: 0 20rpx 0 10rpx;
}
.clear-input {
width: 100%;
border: none;
border-bottom: 1rpx solid #d9d9d9;
font-weight: 400;
font-size: 24rpx;
box-sizing: border-box;
height: 66rpx;
padding-right: 60rpx;
}
.obtain-code {
flex-shrink: 0;
border: 1rpx solid #03affb;
color: #03affb;
height: 45rpx;
line-height: 45rpx;
border-radius: 24rpx;
padding: 4rpx 20rpx;
margin-left: 20rpx;
}
.placeholderColor {color: #bfbfbf;}
.register-radio {transform: scale(0.5);margin-left: -10rpx;margin-right: -10rpx;}
uni-radio .uni-radio-input {border: 1rpx solid #444444;}
.register-agree-policy {color: #03affb;}
.register-btn {width: 422rpx;height: 76rpx;line-height: 76rpx;text-align: center;margin: 0 auto;border-radius: 76rpx;margin-top: 60rpx; background-color: #03affb;color: #FFFFFF;}
.clear-box {
position: absolute;right: 0;
top: 50%;
transform: translateY(-50%);
}
.clear-close {
position: relative;
display: flex;justify-content: center;align-items: center;
width: 40rpx;height: 40rpx;
border-radius: 100%;
background-color: rgba(0,0,0,.3);
}
.clear-close span {
position: absolute;
width: 0;
border: 2rpx solid #FFFFFF;
height: 20rpx;
border-radius: 2rpx;
}
.clear-close span:first-child {transform: rotate(45deg);}
.clear-close span:last-child {transform: rotate(-45deg);}

View File

@ -0,0 +1,64 @@
<template>
<view>
<view class="pad-zy30" :style="{paddingTop:statusBarHeight + 'px',paddingBottom: '70px'}">
<slot name="content"></slot>
</view>
</view>
</template>
<script>
export default {
name:"container-subgroup",
props:{
ifLoading:{
type:Boolean,
default:true
}
},
data() {
return {
statusBarHeight:uni.getSystemInfoSync().statusBarHeight + 50,
loading:true,
exist:''
};
},
//
beforeCreate(){
},
//
created(){
},
//
beforeMount(){
},
//
mounted(){
setTimeout(()=>{
this.loading = false;
},500)
},
//
beforeUpdate(){
},
//
updated(){
},
//
beforeDestroy(){
},
//
destroyed(){
}
}
</script>
<style scoped>
</style>

View File

@ -10,8 +10,10 @@
<!-- 返回键 --> <!-- 返回键 -->
<view class="return-box" @tap="backEv" v-if="ifReturn" <view class="return-box" @tap="backEv" v-if="ifReturn"
:style="{height: navBarHeight+'px'}"> :style="{height: navBarHeight+'px'}">
<i class="icon icon-return" style="font-size: 40rpx;" <slot name="leftContent">
:style="{color: returnColor}"></i> <i class="icon icon-return" style="font-size: 40rpx;"
:style="{color: returnColor}"></i>
</slot>
</view> </view>
<!-- 标题 --> <!-- 标题 -->
<view class="tab-title" v-if="ifTitle && ifNet" <view class="tab-title" v-if="ifTitle && ifNet"
@ -65,7 +67,7 @@
// //
navBarTitle: { navBarTitle: {
type:String, type:String,
default:'佩丽商城' default:''
}, },
// //
clipNumber: { clipNumber: {

View File

@ -0,0 +1,190 @@
<template>
<view class="status-box statusHNH">
<!-- 网络电量栏 start -->
<view :style="{height: statusBarHeight+'px',background: backgroudColor}"></view>
<!-- 网络电量栏 end -->
<!-- 头部状态栏 start -->
<view class="status-nav"
:style="{background: backgroudColor,height: navBarHeight+'px'}">
<!-- 返回键 -->
<view class="return-box" @tap="backEv" v-if="ifReturn"
:style="{height: navBarHeight+'px'}">
<slot name="leftContent"></slot>
</view>
<!-- 标题 -->
<view class="tab-title" v-if="ifTitle && ifNet"
:style="{
color: titleColor,
justifyContent: ifCenter ? 'center' : '',
padding: ifCenter ? '0px' : `${ifReturn ? '0 38' : '0 15'}px`}">
<view class="title-box" :class="['','clips1','clips2'][clipNumber]" :style="{maxWidth: ifCenter ? '360rpx' : '70%'}">
<slot name="centerContent">{{navBarTitle}}</slot>
</view>
</view>
<!-- 右边功能 -->
<view class="right-box">
<slot name="rightContent"></slot>
</view>
</view>
<!-- 头部状态栏 end -->
</view>
</template>
<script>
export default {
name:'status-nav',
props:{
//
backgroudColor:{
type:String,
default:'#FFFFFF'
},
//
navBarHeight: {
type:Number,
default:50
},
//
ifReturn:{
type:Boolean,
default:true
},
//
returnColor: {
type:String,
default:'#000'
},
//
ifTitle:{
type:Boolean,
default:true
},
//
navBarTitle: {
type:String,
default:''
},
//
clipNumber: {
type:Number,
default:1
},
//
titleColor:{
type:String,
default:'#333333'
},
//
ifCenter: {
type:Boolean,
default: true
},
//
fromWhere: {
type:Number,
default:0
}
},
data(){
return {
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
ifNet:true ,//
netText:'当前无网络',
netTimer:null
}
},
mounted() {
//
this.$toolAll.tools.networkStatus();
// +
// const query = wx.createSelectorQuery().in(this)
// query.select('.statusHNH').boundingClientRect((rect) => {
// uni.setStorageSync('statusHNH',rect.height)
// }).exec();
//
this.$toolAll.tools.obtainUrl();
this.$toolAll.tools.obtainUrlParam();
setTimeout(()=>{
this.ifNet = uni.getStorageSync('isNet');
},500)
},
methods:{
//
refreshEv(){
this.netText = '正在刷新...';
let outTime = 0;//
this.netTimer = setInterval(()=>{
outTime++;
this.$toolAll.tools.networkStatus();
if(uni.getStorageSync('isNet')) {
clearInterval(this.netTimer);
this.ifNet = true;
}
if(outTime==10) {
clearInterval(this.netTimer);
this.netText = '刷新失败';
outTime = 0;
}
},1000)
},
//
backEv(){
if(uni.getStorageSync('outside')*1==2){
this.fromWhere = uni.getStorageSync('outside')*1;
}
switch (this.fromWhere){
case 1:
case 2:
uni.navigateTo({
url:'/pages/tabbar/pagehome/pagehome'
})
uni.setStorageSync('outside',0)
break;
case 0:
uni.navigateBack({
delta:1
})
break;
default:
break;
}
}
}
}
</script>
<style scoped>
.clips1{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;overflow: hidden;text-overflow: ellipsis;word-wrap: break-word;word-break:break-all;}
.clips2{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;text-overflow: ellipsis;word-wrap: break-word;word-break:break-all;}
.status-box{
position: fixed;top: 0;left: 0;right: 0;z-index: 10;
}
.status-nav{
width: 100%;
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
height: 50px;
line-height: 50px;
padding: 0 30rpx;
box-sizing: border-box;
}
.return-box {
display: flex;justify-content: center;align-items: center;flex-shrink: 0;
position: absolute;
padding: 0rpx 10rpx;
}
.return-box i {font-size: 56rpx;}
.tab-title{
width: 100%;
font-size: 38rpx;
display: flex;
}
.tab-title .title-box{margin-top: -4rpx;}
.right-box {flex-shrink: 0;font-size: 30rpx;}
</style>

View File

@ -60,6 +60,20 @@
"navigationBarTitleText": "意见反馈", "navigationBarTitleText": "意见反馈",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}
,{
"path" : "pages/register/register",
"style" :{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom",//
"navigationBarTextStyle":"black",
"app-plus": {
"titleNView": false ,//APPH5
"bounce":"none",
"scrollIndicator":"none"
}
}
} }
], ],
@ -69,12 +83,10 @@
"pages": [ "pages": [
{ {
"path" : "test/test", "path" : "test/test",
"style" : "style" : {
{ "navigationBarTitleText": "",
"navigationBarTitleText": "", "enablePullDownRefresh": false
"enablePullDownRefresh": false }
}
} }
] ]
} }

View File

@ -12,16 +12,26 @@
} }
}, },
onLoad() { onLoad() {
console.log(16);
this.checkContext(); this.checkContext();
// this.$requst.post('/universal/api.login/register',{
// phone:'18888888888',
// sms_code:'123456',
// password:'123456',
// confirm_password:'123456',
// affiliation:''
// }).then(res=>{
// console.log(res,25);
// })
}, },
methods: { methods: {
// //
checkContext(){ checkContext(){
console.log(20); // #ifdef APP-PLUS
// #ifdef APP-PLUS , H5 , APP
if(uni.getSystemInfoSync().platform != "devtools"){//devtools iosandroidmac3.1.10+windows3.1.10+linux3.1.10+ if(uni.getSystemInfoSync().platform != "devtools"){//devtools iosandroidmac3.1.10+windows3.1.10+linux3.1.10+
console.log = () =>{} console.log = () =>{}
} }
console.log(35);
setTimeout(()=>{ setTimeout(()=>{
uni.reLaunch({ uni.reLaunch({
url:'/pages/login/login' url:'/pages/login/login'
@ -29,9 +39,10 @@
},3000) },3000)
// #endif // #endif
// #ifdef H5 // #ifdef H5
if(uni.getSystemInfoSync().platform != "devtools"){//devtools iosandroidmac3.1.10+windows3.1.10+linux3.1.10+ if(uni.getSystemInfoSync().platform != "development"){//devtools iosandroidmac3.1.10+windows3.1.10+linux3.1.10+
console.log = () =>{} console.log = () =>{}
} }
console.log(46);
setTimeout(()=>{ setTimeout(()=>{
uni.reLaunch({ uni.reLaunch({
url:'/pages/login/login' url:'/pages/login/login'
@ -51,6 +62,7 @@
// - // -
// uni.setStorageSync('hostapi','https://hm.hmzfyy.cn/api/'); // uni.setStorageSync('hostapi','https://hm.hmzfyy.cn/api/');
} }
console.log(66);
setTimeout(()=>{ setTimeout(()=>{
uni.reLaunch({ uni.reLaunch({
url:'/pages/tabbar/pagehome/pagehome' url:'/pages/tabbar/pagehome/pagehome'

View File

@ -15,8 +15,8 @@
}, },
methods: { methods: {
gohome(){ gohome(){
uni.reLaunch({ uni.navigateTo({
url:'/pages/tabbar/pagehome/pagehome' url:'/pages/register/register'
}) })
} }
} }

176
pages/register/register.vue Normal file
View File

@ -0,0 +1,176 @@
<template>
<view>
<status-nav-slot>
<view slot="leftContent" @tap="goLogin"><image class="register-close" src="/static/public/icon-close.png" mode="widthFix" lazy-load></image></view>
<view slot="rightContent" @tap="goLogin"></view>
</status-nav-slot>
<container-subgroup-two>
<view slot="content">
<view class="disjcac">
<image src="/static/public/icon-register.png" mode="widthFix" lazy-load></image>
</view>
<view class="register-title line-h56">
<view class="fon40 bold">注册</view>
<view class="fon28">欢迎来到飞猴云服务平台</view>
</view>
<view class="fon24">
<!-- 手机号 -->
<view class="disac mar-s30">
<view class="disac fon30">+86 <view class="register-phone-img"></view></view>
<view class="posir width100">
<input class="clear-input" type="number" maxlength="11" v-model="register_phone" placeholder="请输入手机号" placeholder-class="placeholderColor" />
<!-- 清除按钮 -->
<view class="clear-box" v-show="register_phone!=''" @tap="clearInput(0)"><view class="clear-close"><span></span><span></span></view></view>
</view>
</view>
<!-- 验证码 -->
<view class="disjbac mar-s50">
<view class="posir width100">
<input class="clear-input" type="number" maxlength="4" v-model="register_code" placeholder="请输入验证码" placeholder-class="placeholderColor" />
<!-- 清除按钮 -->
<view class="clear-box" v-show="register_code!=''" @tap="clearInput(1)"><view class="clear-close"><span></span><span></span></view></view>
</view>
<view class="obtain-code">获取验证码</view>
</view>
<!-- 密码 -->
<view class="disjbac mar-s50">
<view class="posir width100">
<input class="clear-input" type="text" maxlength="16" v-model="register_password" placeholder="请输入密码" placeholder-class="placeholderColor" />
<!-- 清除按钮 -->
<view class="clear-box" v-show="register_password!=''" @tap="clearInput(2)"><view class="clear-close"><span></span><span></span></view></view>
</view>
</view>
<!-- 确认密码 -->
<view class="disjbac mar-s50">
<view class="posir width100">
<input class="clear-input" type="text" maxlength="16" v-model="register_qpassword" placeholder="请再次确认密码" placeholder-class="placeholderColor" />
<!-- 清除按钮 -->
<view class="clear-box" v-show="register_qpassword!=''" @tap="clearInput(3)"><view class="clear-close"><span></span><span></span></view></view>
</view>
</view>
<!-- 单位名称 -->
<view class="disjbac mar-s50">
<view class="posir width100">
<input class="clear-input" type="text" v-model="register_unitName" placeholder="请输入单位名称" placeholder-class="placeholderColor" />
<!-- 清除按钮 -->
<view class="clear-box" v-show="register_unitName!=''" @tap="clearInput(4)"><view class="clear-close"><span></span><span></span></view></view>
</view>
</view>
<!-- 协议政策 -->
<view class="disac mar-s50">
<label class="radio disac col9" @tap="chooseXY">
<radio class="register-radio" color="#03affb" :checked="ifAgreen"/><view>我已阅读并同意 <text @tap.stop="goXY(0)" class="register-agree-policy">飞猴用户服务协议</text> <text @tap.stop="goXY(1)" class="register-agree-policy">飞猴隐私政策</text></view>
</label>
</view>
<!-- 免费注册 -->
<view class="register-btn" @tap="submitEv"></view>
</view>
</view>
</container-subgroup-two>
</view>
</template>
<script>
import statusNavSlot from '@/components/status-navs/status-nav-slot.vue';
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
export default {
components:{
statusNavSlot,
containerSubgroupTwo
},
data() {
return {
register_phone:'', //
register_code:'', //
register_password:'', //
register_qpassword:'', //
register_unitName:'', //
ifAgreen:false //
}
},
methods: {
//
submitEv(){
if(this.checkEmpty()){
console.log('执行事件');
}
},
//
checkEmpty(){
let ifEmpty = true;
if(this.$toolAll.tools.isPhone(this.register_phone)) {
this.$toolAll.tools.showToast('手机号格式不正确');
ifEmpty = false;
return;
}
if(!this.register_code) {
this.$toolAll.tools.showToast('请输入验证码');
ifEmpty = false;
return;
}
if(!this.register_password) {
this.$toolAll.tools.showToast('密码不能为空');
ifEmpty = false;
return;
}
if(!this.register_qpassword) {
this.$toolAll.tools.showToast('确认密码不能为空');
ifEmpty = false;
return;
}
if(this.register_password != this.register_qpassword) {
this.$toolAll.tools.showToast('两次输入的密码必须相同');
ifEmpty = false;
return;
}
if(!this.register_unitName) {
this.$toolAll.tools.showToast('请输入单位名称');
ifEmpty = false;
return;
}
if(!this.ifAgreen) {
this.$toolAll.tools.showToast('请勾选协议与政策');
ifEmpty = false;
return;
}
return ifEmpty;
},
//
goLogin(){
uni.navigateBack({delta:1})
},
//
clearInput(index){
switch (index){
case 0:
this.register_phone = '';
break;
case 1:
this.register_code = '';
break;
case 2:
this.register_password = '';
break;
case 3:
this.register_qpassword = '';
break;
case 4:
this.register_unitName = '';
break;
}
},
//
chooseXY(){
this.ifAgreen = !this.ifAgreen;
},
//
goXY(index){
console.log(index);
}
}
}
</script>
<style scoped>
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB