登录
This commit is contained in:
parent
7408339b73
commit
1ee334a032
@ -1,8 +1,8 @@
|
||||
// 应用全局配置
|
||||
module.exports = {
|
||||
//baseUrl: 'https://www.nuoyunr.com/admin-api',
|
||||
// baseUrl: 'https://3w823u8516.vicp.fun',
|
||||
baseUrl: 'http://192.168.1.4:48080',
|
||||
baseUrl: 'https://3w823u8516.vicp.fun',
|
||||
// baseUrl: 'http://192.168.1.4:48080',
|
||||
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
|
||||
baseImageUrl: 'http://122.51.230.86:9000/',
|
||||
//wsUrl: 'wss://www.nuoyunr.com/admin-api',
|
||||
|
@ -67,7 +67,9 @@ export default {
|
||||
yzm: '',
|
||||
wrod: '',
|
||||
activeid: 0,
|
||||
tenantCode: 'lanan'
|
||||
tenantCode: 'lanan',
|
||||
// 标志位,初始值为false
|
||||
isFirstLoad: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -88,14 +90,41 @@ export default {
|
||||
mounted() {
|
||||
},
|
||||
created(){
|
||||
// 如果是第一次加载,执行一些初始化操作
|
||||
if (!this.isFirstLoad) {
|
||||
this.isFirstLoad = true;
|
||||
// 初始化代码
|
||||
this.checkIfLogin()
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
||||
// 如果不是第一次加载,不执行任何操作
|
||||
if (this.isFirstLoad) {
|
||||
// 每次页面显示时需要做的操作
|
||||
if(getToken()){
|
||||
//已登录
|
||||
uni.reLaunch({
|
||||
url: '/pages/home/home'
|
||||
})
|
||||
}else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请关闭本页面重新打开',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
// 用户点击了确定按钮的相关逻辑可以在这里编写
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
// 用户点击了取消按钮的相关逻辑可以在这里编写
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
checkIfLogin(){
|
||||
if(getToken()){
|
||||
//已登录
|
||||
@ -104,7 +133,7 @@ export default {
|
||||
})
|
||||
}else{
|
||||
//未登录
|
||||
// this.checkIfCode()
|
||||
this.checkIfCode()
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<VNavigationBar title-color="#333" background-color="#fff" title="信息填写"></VNavigationBar>
|
||||
<VNavigationBar title-color="#333" background-color="#fff" title="注册会员"></VNavigationBar>
|
||||
<view class="body">
|
||||
<view class="formItem">
|
||||
<view class="formLabel">姓名</view>
|
||||
@ -25,13 +25,14 @@
|
||||
<input placeholder="请填写你的身份证号" v-model="formData.idCard" type="text"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="formItem">-->
|
||||
<!-- <view class="formLabel">生日</view>-->
|
||||
<!-- <view class="formContainer">-->
|
||||
<!-- <picker mode="date" :value="formData.birthday" start="1900-01-01" end="2050-12-12" :bindchange="bindDateChange">-->
|
||||
<!-- </picker>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<view class="formItem">
|
||||
<view class="formLabel">生日</view>
|
||||
<view class="formContainer">
|
||||
<picker mode="date" :value="formData.birthday" @change="bindDateChange">
|
||||
<view>{{formData.birthday}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<view class="formLabel">手机号</view>
|
||||
<view class="formContainer">
|
||||
@ -69,6 +70,7 @@ export default {
|
||||
cusName: "",
|
||||
sex: "",
|
||||
idCard:"",
|
||||
birthday:"请选择你的生日",
|
||||
phoneNumber:"",
|
||||
address:"",
|
||||
},
|
||||
@ -136,6 +138,13 @@ export default {
|
||||
})
|
||||
return false
|
||||
}
|
||||
if("请选择你的生日"==this.formData.birthday){
|
||||
uni.showToast({
|
||||
title: '请选择生日',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(""==this.formData.phoneNumber || !this.isValidPhoneNumber(this.formData.phoneNumber)){
|
||||
uni.showToast({
|
||||
title: '请填写手机号',
|
||||
@ -172,6 +181,7 @@ export default {
|
||||
},
|
||||
bindDateChange(e) {
|
||||
this.formData.birthday = e.detail.value;
|
||||
this.$forceUpdate()
|
||||
},
|
||||
radioChange: function(e) {
|
||||
let radioItems = this.radioSexItems;
|
||||
@ -254,6 +264,10 @@ export default {
|
||||
color: #333333;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.formLabel:before {
|
||||
content: "*";
|
||||
color: red;
|
||||
}
|
||||
|
||||
.radioGroup {
|
||||
display: flex;
|
||||
|
Loading…
Reference in New Issue
Block a user