168 lines
4.3 KiB
Vue
168 lines
4.3 KiB
Vue
<template>
|
|
<view class="app">
|
|
<view class="item">
|
|
<view class="lefttext">
|
|
姓名
|
|
</view>
|
|
<input class="righttext" type="text" placeholder="请输入" v-model="appPersonallist.nickName" maxlength="30" />
|
|
</view>
|
|
<view class="item">
|
|
<view class="lefttext">
|
|
输入密码
|
|
</view>
|
|
<u-input class='righttext' style='left:30%' placeholder="请输入密码" maxlength="10"
|
|
v-model="appPersonallist.stationPersonPassword" type="password" :border="false" :password-icon="true" />
|
|
</view>
|
|
<view class="item">
|
|
<view class="lefttext">
|
|
重复密码
|
|
</view>
|
|
<u-input class='righttext' style='left:30%' placeholder="请再次输入密码" maxlength="10"
|
|
v-model="appPersonallist.newpassword" type="password" :border="false" :password-icon="true" />
|
|
</view>
|
|
<view class="item">
|
|
<view class="lefttext">
|
|
手机号
|
|
</view>
|
|
<input class="righttext" style='left:23%' type="text" placeholder="请输入" maxlength="11"
|
|
v-model="appPersonallist.phonenumber" />
|
|
</view>
|
|
<view class="item" @tap='show=true'>
|
|
<span>护理站</span>
|
|
<text class='addition'>{{nurseStationName}}</text>
|
|
</view>
|
|
<view class="radio-content" @tap="changeRadio">
|
|
<view class="radio-right">
|
|
<view class="radio" :class="radio == 2 ? 'radio-default':''">
|
|
<view :class="radio == 2 ? 'radio-active':''"></view>
|
|
</view>
|
|
</view>
|
|
<view class="agreement">我已阅读并同意<text @tap='maskshow=true'
|
|
style="color: #000000;border-bottom: 1rpx solid #000000;">《用户协议》</text></view>
|
|
</view>
|
|
<view class="loginbtn" @tap='getInfo'>
|
|
注册
|
|
</view>
|
|
<view class="switch" style="right:5%" @tap='gologin'>
|
|
已有账号,去登录
|
|
</view>
|
|
<u-select v-model="show" mode="single-column" :list="listinfo" @confirm="confirm"></u-select>
|
|
<u-toast ref="uToast" />
|
|
<!-- //用户协议 -->
|
|
<u-mask :show="maskshow" class='mask' @click='maskshow=false'>
|
|
<view class="Agreement">
|
|
<view class="title">
|
|
用户协议与隐私政策
|
|
</view>
|
|
<scroll-view scroll-y="true" class="scroll-Y" style="">
|
|
<contenttext></contenttext>
|
|
</scroll-view>
|
|
<view class="cancel" @tap='maskshow=false'>
|
|
取消
|
|
</view>
|
|
<view class="determine" @tap='tapradio'>
|
|
确定并同意
|
|
</view>
|
|
</view>
|
|
</u-mask>
|
|
</view>
|
|
</template>
|
|
<script>
|
|
import {
|
|
nurseAppLoginSysUser,
|
|
personNurseStationLists
|
|
} from '@/api/register/index.js'
|
|
import contenttext from './text.vue'
|
|
export default {
|
|
components: {
|
|
contenttext
|
|
},
|
|
data() {
|
|
return {
|
|
maskshow: false, //用户协议
|
|
listinfo: [],
|
|
show: false,
|
|
radio: 1, //用户协议
|
|
nurseStationName: '',
|
|
pageSize: 999,
|
|
pageNum: 1,
|
|
appPersonallist: {
|
|
nickName: '',
|
|
newpassword: '',
|
|
phonenumber: '',
|
|
stationPersonPassword: '',
|
|
nurseStationIds: '',
|
|
}
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.info()
|
|
},
|
|
methods: {
|
|
//护理站
|
|
info() {
|
|
personNurseStationLists(this.pageNum, this.pageSize).then(res => {
|
|
this.listinfo = res.rows.map((e) => {
|
|
return {
|
|
value: e.id,
|
|
label: e.nurseStationName,
|
|
}
|
|
})
|
|
})
|
|
},
|
|
confirm(e) {
|
|
this.appPersonallist.nurseStationIds = e[0].value
|
|
this.nurseStationName = e[0]['label']
|
|
},
|
|
//注册功能
|
|
getInfo() {
|
|
nurseAppLoginSysUser(this.appPersonallist).then(res => {
|
|
console.log(res)
|
|
if (this.appPersonallist.stationPersonPassword !== this.appPersonallist.newpassword) {
|
|
this.$refs.uToast.show({
|
|
title: '密码输入不一致,请重新输入',
|
|
type: 'error',
|
|
duration: '1500'
|
|
})
|
|
} else if (res.code == 200) {
|
|
this.$refs.uToast.show({
|
|
title: '注册成功,前往登录',
|
|
type: 'success',
|
|
url: '/pages/login/login',
|
|
duration: '1500'
|
|
})
|
|
} else if (this.radio == 1) {
|
|
this.$refs.uToast.show({
|
|
title: '请审核并同意用户协议',
|
|
type: 'error'
|
|
})
|
|
} else {
|
|
this.$refs.uToast.show({
|
|
title: res.msg,
|
|
type: 'error'
|
|
})
|
|
}
|
|
|
|
})
|
|
},
|
|
//跳转登录页
|
|
gologin() {
|
|
uni.navigateTo({
|
|
url: `/pages/login/login`
|
|
})
|
|
},
|
|
changeRadio() {
|
|
if (this.radio == 1) {
|
|
this.radio = 2;
|
|
} else {
|
|
this.radio = 1;
|
|
}
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import './register.scss';
|
|
</style>
|