This commit is contained in:
Vinjor 2024-09-24 22:41:07 +08:00
parent 7408339b73
commit 1ee334a032
3 changed files with 58 additions and 15 deletions

View File

@ -1,8 +1,8 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
//baseUrl: 'https://www.nuoyunr.com/admin-api', //baseUrl: 'https://www.nuoyunr.com/admin-api',
// baseUrl: 'https://3w823u8516.vicp.fun', baseUrl: 'https://3w823u8516.vicp.fun',
baseUrl: 'http://192.168.1.4:48080', // baseUrl: 'http://192.168.1.4:48080',
imagesUrl: 'http://shequ.0315e.com/static/images/pages/', imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
baseImageUrl: 'http://122.51.230.86:9000/', baseImageUrl: 'http://122.51.230.86:9000/',
//wsUrl: 'wss://www.nuoyunr.com/admin-api', //wsUrl: 'wss://www.nuoyunr.com/admin-api',

View File

@ -67,7 +67,9 @@ export default {
yzm: '', yzm: '',
wrod: '', wrod: '',
activeid: 0, activeid: 0,
tenantCode: 'lanan' tenantCode: 'lanan',
// false
isFirstLoad: false
} }
}, },
computed: { computed: {
@ -88,14 +90,41 @@ export default {
mounted() { mounted() {
}, },
created(){ created(){
//
if (!this.isFirstLoad) {
this.isFirstLoad = true;
//
this.checkIfLogin() this.checkIfLogin()
}
}, },
onShow() { 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: { methods: {
checkIfLogin(){ checkIfLogin(){
if(getToken()){ if(getToken()){
// //
@ -104,7 +133,7 @@ export default {
}) })
}else{ }else{
// //
// this.checkIfCode() this.checkIfCode()
} }
}, },
/** /**

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="container"> <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="body">
<view class="formItem"> <view class="formItem">
<view class="formLabel">姓名</view> <view class="formLabel">姓名</view>
@ -25,13 +25,14 @@
<input placeholder="请填写你的身份证号" v-model="formData.idCard" type="text"/> <input placeholder="请填写你的身份证号" v-model="formData.idCard" type="text"/>
</view> </view>
</view> </view>
<!-- <view class="formItem">--> <view class="formItem">
<!-- <view class="formLabel">生日</view>--> <view class="formLabel">生日</view>
<!-- <view class="formContainer">--> <view class="formContainer">
<!-- <picker mode="date" :value="formData.birthday" start="1900-01-01" end="2050-12-12" :bindchange="bindDateChange">--> <picker mode="date" :value="formData.birthday" @change="bindDateChange">
<!-- </picker>--> <view>{{formData.birthday}}</view>
<!-- </view>--> </picker>
<!-- </view>--> </view>
</view>
<view class="formItem"> <view class="formItem">
<view class="formLabel">手机号</view> <view class="formLabel">手机号</view>
<view class="formContainer"> <view class="formContainer">
@ -69,6 +70,7 @@ export default {
cusName: "", cusName: "",
sex: "", sex: "",
idCard:"", idCard:"",
birthday:"请选择你的生日",
phoneNumber:"", phoneNumber:"",
address:"", address:"",
}, },
@ -136,6 +138,13 @@ export default {
}) })
return false return false
} }
if("请选择你的生日"==this.formData.birthday){
uni.showToast({
title: '请选择生日',
icon: 'none'
})
return false
}
if(""==this.formData.phoneNumber || !this.isValidPhoneNumber(this.formData.phoneNumber)){ if(""==this.formData.phoneNumber || !this.isValidPhoneNumber(this.formData.phoneNumber)){
uni.showToast({ uni.showToast({
title: '请填写手机号', title: '请填写手机号',
@ -172,6 +181,7 @@ export default {
}, },
bindDateChange(e) { bindDateChange(e) {
this.formData.birthday = e.detail.value; this.formData.birthday = e.detail.value;
this.$forceUpdate()
}, },
radioChange: function(e) { radioChange: function(e) {
let radioItems = this.radioSexItems; let radioItems = this.radioSexItems;
@ -254,6 +264,10 @@ export default {
color: #333333; color: #333333;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.formLabel:before {
content: "*";
color: red;
}
.radioGroup { .radioGroup {
display: flex; display: flex;