This commit is contained in:
曹辉 2022-11-09 10:57:02 +08:00
parent 824230893e
commit e19b25ec9b
13 changed files with 290 additions and 472 deletions

View File

@ -2,23 +2,21 @@ import request from "../request.js"
export function userPassWord(data) {
return request({
url: `/nurseApp/PersonLogin/userPassWord`,
url: `/nurseApp/personLogin/userPassWord`,
method: 'POST',
data,
data,
})
}
export function updateHeadAvatarHead(userId,File) {
export function updateHeadAvatarHead(userId, File) {
return request({
url: `/nurseApp/PersonLogin/updateHeadAvatarHead?userId=${userId}&File=${File}`,
url: `/nurseApp/personLogin/updateHeadAvatarHead?userId=${userId}&File=${File}`,
method: 'POST',
data,
data,
})
}
export function nursePerson(phonenumber,password) {
export function nursePerson(phonenumber, password) {
return request({
url: `/nurseApp/PersonLogin/nursePerson?phonenumber=${phonenumber}&password=${password}`,
url: `/nurseApp/personLogin/nursePerson?phonenumber=${phonenumber}&password=${password}`,
method: 'GET'
})
}

View File

@ -1,10 +1,9 @@
import request from "./request.js"
export function selectMission(nursePersonId,orderStatus,pageNum,pageSize) {
export function selectMission(nursePersonId, orderStatus, pageNum, pageSize,nurseItemName) {
return request({
url: `/nurseApp/personLogin/selectMission?nursePersonId=${nursePersonId}&orderStatus=${orderStatus}&pageNum=${pageNum}&pageSize=${pageSize}`,
url: `/nurseApp/personLogin/selectMission?nursePersonId=${nursePersonId}&orderStatus=${orderStatus}&pageNum=${pageNum}&pageSize=${pageSize}&nurseItemName=${nurseItemName}`,
method: 'GET'
})
}

View File

@ -1,4 +1,4 @@
var baseurl = "http://192.168.16.30:8081";
// var baseurl = "http://192.168.16.48:8081";
var baseurl = "http://192.168.16.30:8080";
// var baseurl = "http://192.168.16.49:8080";
// var baseurl = "http://192.168.16.76:8080";
export default baseurl

View File

@ -2,7 +2,7 @@ import request from "../request.js"
export function updatePassword(phonenumber, password,) {
return request({
url: `/nurseApp/PersonLogin/updatePassword?phonenumber=${phonenumber}&password=${password}`,
url: `/nurseApp/personLogin/updatePassword?phonenumber=${phonenumber}&password=${password}`,
method: 'POST'
})
}

View File

@ -3,7 +3,7 @@ import request from "../request.js"
//密码
export function appLogin(phonenumber, password) {
return request({
url: `/nurseApp/PersonLogin/appLogin?phonenumber=${phonenumber}&password=${password}`,
url: `/nurseApp/personLogin/appLogin?phonenumber=${phonenumber}&password=${password}`,
method: 'POST'
})
}

View File

@ -1,7 +1,7 @@
import request from "../request.js"
export function nursePerson(phonenumber,password) {
return request({
url: `/nurseApp/PersonLogin/nursePerson?phonenumber=${phonenumber}&password=${password}`,
url: `/nurseApp/personLogin/nursePerson?phonenumber=${phonenumber}&password=${password}`,
method: 'GET'
})
}

View File

@ -2,7 +2,7 @@ import request from "../request.js"
export function nurseAppLoginSysUser(data) {
return request({
url: `/nurseApp/PersonLogin/nurseAppLoginSysUser`,
url: `/nurseApp/personLogin/nurseAppLoginSysUser`,
method: 'POST',
data,
})
@ -10,7 +10,7 @@ export function nurseAppLoginSysUser(data) {
export function personNurseStationLists(pageNum,pageSize) {
return request({
url: `/nurseApp/PersonLogin/personNurseStationLists?pageNum=${pageNum}&pageSize=${pageSize}`,
url: `/nurseApp/personLogin/personNurseStationLists?pageNum=${pageNum}&pageSize=${pageSize}`,
method: 'get'
})
}

View File

@ -3,7 +3,7 @@
<view class="centercontent">
<view class="Commodity" @tap="uploadImag()">
头像
<image class="picture" :src="baseurl+appPersonallist.avatar" mode=""></image>
<image class="picture" :src="appPersonallist.avatar" mode=""></image>
<image class="pictureA" src="../../static/jiantou.png" mode=""></image>
</view>
<view class="content">
@ -16,30 +16,33 @@
<view class="name">电话
<input type="text" placeholder="请输入" v-model="appPersonallist.phonenumber" />
</view>
<view class="nursetype name" style="border: none;" >
<!-- <view class="nursetype name" style="border: none;" @tap='show=true'>
护理站:{{getNurseStationName(appPersonallist)}}
</view>
</view>
<view class="finish" @tap="gofinish()">完成
</view> -->
</view>
</view>
<u-toast ref="uToast" />
<view class="finish" @tap="gofinish()">完成
</view>
<u-select v-model="show" mode="single-column" :list="NurseStationList" @confirm="confirm"></u-select>
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
personNurseStationLists
} from '@/api/register/index.js'
import {
userPassWord,
nursePerson
} from '@/api/Modifyinformation/Modifyinformation.js';
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
show: false,
baseurl: '', //url
NurseStationList: [], //list
appPersonallist: {
userId: '',
userName: '',
@ -48,33 +51,29 @@
avatar: '',
File: '',
},
}
},
computed:{
computed: {
getNurseStationName() {
return data => data?.nurseStationSysUserVOList?.[0]?.nurseStationName || ''
return data => data?.nurseStationSysUserVOList?. [0]?.nurseStationName || ''
},
},
onLoad(options) {
this.info();
this.baseurl = baseurl;
const that = this
this.baseurl = baseurl;
uni.getStorage({
key: 'phonenumber',
success: function(res) {
that.phonenumber = res.data
console.log(that.phonenumber)
try {
const value = uni.getStorageSync('phonenumber');
if (value) {
that.phonenumber = value
}
});
uni.getStorage({
key: 'password',
success: function(res) {
that.password = res.data
console.log(that.password)
} catch (e) {}
try {
const value = uni.getStorageSync('password');
if (value) {
that.password = value
}
});
console.log(that.password, '-----', that.phonenumber)
} catch (e) {}
this.myInfo()
},
methods: {
@ -86,50 +85,59 @@
sizeType: ['original'],
sourceType: ['album'],
success(res) {
//blob
console.log(res)
uni.uploadFile({
url: baseurl + '/nurseApp/PersonLogin/updateHeadAvatarHead',
filePath: res.tempFilePaths[0], //file: (filePath)
name: 'file',
formData: { //
'userId': '13',
},
timeout: 5000,
success(res) {
console.log(JSON.parse(res.data))
that.appPersonallist.avatar = JSON.parse(res.data).imgUrl
that.appPersonallist.avatar = res.tempFilePaths[0]
}
})
},
myInfo() {
nursePerson(this.phonenumber, this.password).then(res => {
res.data.avatar = baseurl + res.data.avatar
this.appPersonallist = res.data
})
},
gofinish() {
var that = this
uni.uploadFile({
url: baseurl + '/nurseApp/personLogin/updateHeadAvatarHead',
filePath: that.appPersonallist.avatar, //file: (filePath)
name: 'file',
formData: { //
'userId': that.appPersonallist.userId,
},
timeout: 5000,
success(res) {
that.appPersonallist.avatar = JSON.parse(res.data).imgUrl
userPassWord(that.appPersonallist).then(res => {
if (res.code == 200) {
that.$refs.uToast.show({
title: '修改成功',
type: 'success',
url: '/pages/personal/personal',
duration: '1500'
})
} else {
that.$refs.uToast.show({
title: res.msg,
type: 'error'
})
}
})
}
})
},
myInfo() {
nursePerson(this.phonenumber, this.password).then(res => {
console.log(res, 'resresres')
this.appPersonallist = res.data
console.log(this.appPersonallist)
})
confirm(e) {
this.appPersonallist.nurseStationSysUserVOList[0].nurseStationId = e[0].value
this.appPersonallist.nurseStationSysUserVOList[0].nurseStationName = e[0]['label']
},
gofinish() {
// this.appPersonallist = JSON.stringify(this.appPersonallist)
// console.log(this.appPersonallist, 'this.appPersonallist')
userPassWord(this.appPersonallist).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '修改成功',
type: 'success',
url:'/pages/personal/personal',
duration: '1500'
})
} else {
console.log(res)
this.$refs.uToast.show({
title: res.msg,
type: 'error'
})
//
info() {
personNurseStationLists(this.pageNum, this.pageSize).then(res => {
this.NurseStationList = res.rows.map((e) => {
return {
value: e.id,
label: e.nurseStationName,
}
})
})
},
},
@ -144,26 +152,27 @@
padding: 3%;
font-size: 36rpx;
.finish {
width: 217rpx;
font-size: 32rpx;
color: #FFFFFF;
height: 68rpx;
line-height: 68rpx;
text-align: center;
position: absolute;
top: 70%;
left: 70%;
background: #4C7BC9;
border-radius: 26rpx;
}
.centercontent {
width: 99%;
height: 521rpx;
background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
margin: 0 auto;
.finish {
width: 217rpx;
font-size: 32rpx;
color: #FFFFFF;
height: 68rpx;
line-height: 68rpx;
text-align: center;
margin-top: 60%;
margin-left: 70%;
background: #4C7BC9;
border-radius: 26rpx;
}
.content {
line-height: 100rpx;
@ -181,6 +190,8 @@
}
.nursetype {
height: 120rpx;
input {
margin-left: 25%;
}
@ -188,20 +199,26 @@
}
.Commodity {
line-height: 110rpx;
line-height: 130rpx;
margin-left: 5%;
border-bottom: 1rpx solid #D8D4D4;
position: relative;
.picture {
vertical-align: middle;
margin-left: 60%;
width: 103rpx;
height: 103rpx;
position: absolute;
right: 10%;
top: 50%;
transform: translateY(-50%);
width: 110rpx;
height: 110rpx;
border-radius: 50%;
}
.pictureA {
margin-left: 3%;
position: absolute;
right: 2%;
top: 50%;
transform: translateY(-50%);
width: 18rpx;
height: 27rpx;
}

View File

@ -3,6 +3,14 @@
color: #C3C1C1;
font-weight: 400;
.forget {
position: absolute;
top: 56%;
left: 70%;
color: #46ABD7;
}
.switch {
text-align: center;
height: 100rpx;
@ -22,7 +30,7 @@
font-size: 41rpx;
color: #FFFFFF;
position: absolute;
top: 57%;
top: 60%;
left: 10%;
}

View File

@ -19,7 +19,7 @@
<view class="loginbtn" @tap='pwdlogin'>
登录
</view>
<view class="loginbtn" style="top: 65%; color: #969394;background-color: #ffffff;" @tap='goregister'>
<view class="loginbtn" style="top: 70%; color: #969394;background-color: #ffffff;" @tap='goregister'>
注册
</view>
<u-toast ref="uToast" />
@ -35,37 +35,38 @@
checked: false,
phonenumber: '',
password: '',
userId:'',
userId: '',
};
},
//
onLoad(options) {
console.log(options)
},
onLoad(options) {},
methods: {
//
pwdlogin() {
var that = this
appLogin(this.phonenumber, this.password).then(res => {
console.log(res)
if (res.code == 200) {
uni.setStorageSync("phonenumber", that.phonenumber)
uni.setStorageSync("password", that.password)
// uni.setStorage({
// key: 'phonenumber',
// data: that.phonenumber
// })
// uni.setStorage({
// key: 'password',
// data: that.password
// })
this.$refs.uToast.show({
title: '登录成功',
type: 'success',
url: '/pages/homepage/homepage',
duration: '1500'
})
uni.setStorage({
key:'phonenumber',
data:that.phonenumber
})
uni.setStorage({
key:'password',
data:that.password
})
setTimeout(() => {
uni.reLaunch({
url: '/pages/homepage/homepage',
})
}, 1500);
} else {
console.log(res)
this.$refs.uToast.show({
@ -93,96 +94,5 @@
</script>
<style lang="scss">
.app {
font-family: DengXian;
color: #C3C1C1;
font-weight: 400;
height: 100vh;
.forget {
position: absolute;
top: 53%;
left: 70%;
color: #46ABD7;
}
.loginbtn {
width: 80%;
height: 100rpx;
text-align: center;
line-height: 100rpx;
background: #4C7BC9;
border-radius: 51rpx;
font-size: 41rpx;
color: #FFFFFF;
position: absolute;
top: 58%;
left: 10%;
}
// ::v-deep .u-checkbox {
// margin-top: 345%;
// margin-left: 50%;
// font-size: 32rpx;
// color: #BFBFBF;
// }
.loginphone {
background-color: #fff;
width: 80%;
height: 150rpx;
position: absolute;
left: 10%;
top: 23%;
input {
font-size: 45rpx;
color: #000000;
}
::v-deep .uni-input-placeholder {
padding-left: 40rpx;
font-size: 41rpx;
font-weight: 400;
color: #C3C1C1;
}
.phone {
padding-left: 40rpx;
height: 150rpx;
box-shadow: 0px 9px 31px 9px rgba(0, 0, 0, 0.03);
}
}
.logincode {
position: absolute;
left: 10%;
::v-deep .u-input {
border: 0;
}
::v-deep .u-input__input {
padding-left: 20rpx;
color: #000000;
font-size: 42rpx;
font-weight: 400;
height: 100%;
// line-height: 150rpx;
}
}
.title {
height: 50rpx;
font-size: 52rpx;
font-weight: bold;
color: #000000;
line-height: 44rpx;
position: absolute;
top: 13%;
left: 13%;
}
}
@import './login.scss';
</style>

View File

@ -1,14 +1,17 @@
<template>
<view class="app">
<view class="user">
<view class="img">
<view class="img" v-if="appPersonallist.avatar==''||!appPersonallist.avatar">
<image style="height: 110rpx;" src="../../static/person.png" mode=""></image>
</view>
<view class="img" v-else>
<image :src="baseurl+appPersonallist.avatar" mode=""></image>
</view>
<view class="phone">
电话{{appPersonallist.phonenumber}}
</view>
<view class="nickname">昵称
{{appPersonallist.userName}}
<!-- <view class="phone">
{{appPersonallist.phonenumber}}
</view> -->
<view class="nickname">
{{appPersonallist.userName}}
</view>
<view class="modify" @tap='updatainfo()'>
修改信息
@ -58,40 +61,34 @@
return {
baseurl: '', //url
phonenumber: '',
avatar:'',
avatar: '',
password: '',
userId:'',
userId: '',
appPersonallist: [], //
nurseStationSysUserVOList: [],
}
},
onLoad(options) {
//
const that=this
this.baseurl = baseurl;
uni.getStorage({
key: 'phonenumber',
success: function(res) {
that.phonenumber = res.data
console.log(that.phonenumber)
}
});
uni.getStorage({
key: 'password',
success: function(res) {
that.password = res.data
console.log(that.password)
}
});
console.log(that.password,'-----',that.phonenumber)
this.myInfo()
},
onLoad(options) {
this.baseurl = baseurl;
let that = this
try {
const value = uni.getStorageSync('phonenumber');
if (value) {
that.phonenumber = value
}
} catch (e) {}
try {
const value = uni.getStorageSync('password');
if (value) {
that.password = value
}
} catch (e) {}
this.myInfo()
},
methods: {
myInfo() {
console.log(this.phonenumber)
nursePerson(this.phonenumber, this.password).then(res => {
this.appPersonallist = res.data
})
@ -187,35 +184,35 @@
font-size: 32rpx;
position: absolute;
right: 3%;
top: 22%;
top: 18%;
}
.nickname {
position: absolute;
top: 26%;
left: 30%;
top: 18%;
left: 28%;
}
.phone {
position: absolute;
top: 13%;
left: 30%;
left: 28%;
}
.img {
width: 150rpx;
height: 150rpx;
width: 120rpx;
height: 120rpx;
position: absolute;
top: 10%;
left: 8%;
left: 5%;
image {
border-radius: 50%;
width: 130rpx;
width: 120rpx;
margin-left: 50%;
margin-top: 50%;
transform: translate(-50%, -50%);
height: 130rpx;
height: 120rpx;
}
}
}

View File

@ -1,19 +1,114 @@
.app {
font-family: DengXian;
color: #C3C1C1;
font-weight: 400;
.app {
height: 100vh;
padding: 20rpx 0;
.item {
font-size: 34rpx;
margin: 0 auto 20rpx;
width: 94%;
height: 100rpx;
line-height: 100rpx;
background-color: #fff;
box-shadow: 0px 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
position: relative;
span {
margin-left: 3%;
}
.addition {
line-height: 100rpx;
font-size: 34rpx;
font-weight: 400;
margin-left: 3%;
}
.lefttext {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 3%;
}
.righttext {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 18%;
height: 100rpx;
}
.lefttext,
.righttext {
::v-deep .uni-input-input {
font-size: 34rpx;
}
::v-deep .uni-input-wrapper {
height: 100rpx;
line-height: 100rpx;
}
::v-deep .uni-input-placeholder {
line-height: 100rpx;
font-size: 34rpx;
font-weight: 400;
color: #C3C1C1;
}
}
}
.radio-content {
// padding-top: 50rpx;
margin: 50rpx auto;
height: 80rpx;
line-height: 11rpx;
font-size: 28rpx;
.agreement {
color: #878987;
margin-left: 25%;
}
.radio-right {
margin-left: 20%;
.radio-default {
border: 2rpx solid #0fbda6;
}
.radio {
width: 30rpx;
height: 30rpx;
border-radius: 70%;
border: 2rpx solid #178ffb;
margin: 6px 25px -20rpx -5rpx;
.radio-active {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background-color: #178ffb;
margin-left: 22%;
margin-top: 22%;
}
}
}
}
.switch {
text-align: center;
line-height: 60rpx;
color: #46ABD7;
position: absolute;
top: 66%;
left: 10%;
top: 70%;
}
.loginbtn {
width: 80%;
width: 70%;
height: 100rpx;
text-align: center;
line-height: 100rpx;
@ -22,59 +117,8 @@
font-size: 41rpx;
color: #FFFFFF;
position: absolute;
top: 57%;
left: 10%;
top: 60%;
left: 15%;
}
.loginphone {
background-color: #fff;
width: 80%;
height: 162rpx;
position: absolute;
left: 10%;
top: 23%;
input {
font-size: 40rpx;
color: #000000;
}
::v-deep .uni-input-placeholder {
padding-left: 40rpx;
font-size: 41rpx;
font-weight: 400;
color: #C3C1C1;
}
.phone {
padding-left: 40rpx;
height: 100%;
box-shadow: 0px 9px 31px 9px rgba(0, 0, 0, 0.03);
}
}
.logincode {
position: absolute;
left: 10%;
::v-deep .u-input__input {
padding-left: 20rpx;
color: #000000;
font-size: 41rpx;
font-weight: 400;
height: 100%;
}
}
.title {
height: 50rpx;
font-size: 52rpx;
font-weight: bold;
color: #000000;
line-height: 44rpx;
position: absolute;
top: 13%;
left: 13%;
}
}

View File

@ -4,7 +4,7 @@
<view class="lefttext">
姓名
</view>
<input class="righttext" type="text" placeholder="请输入" v-model="appPersonallist.nickName" maxlength="30"/>
<input class="righttext" type="text" placeholder="请输入" v-model="appPersonallist.nickName" maxlength="30" />
</view>
<view class="item">
<view class="lefttext">
@ -30,7 +30,6 @@
<view class="item" @tap='show=true'>
<span>护理站</span>
<text class='addition'>{{nurseStationName}}</text>
<u-select v-model="show" mode="single-column" :list="listinfo" @confirm="confirm"></u-select>
</view>
<view class="radio-content" @tap="changeRadio">
<view class="radio-right">
@ -47,6 +46,7 @@
<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" />
</view>
</template>
@ -54,20 +54,16 @@
import {
nurseAppLoginSysUser,
personNurseStationLists
} from '../../api/register/index.js'
} from '@/api/register/index.js'
export default {
data() {
return {
listinfo: [],
show: false,
radio: 1, //
nickName: '',
userId: 13,
userName: 123,
nurseStationName: '',
pageSize: 999,
pageNum: 1,
total: 0,
appPersonallist: {
nickName: '',
newpassword: '',
@ -75,40 +71,15 @@
password: '',
nurseStationIds: '',
}
};
},
onLoad() {
this.info()
},
onReachBottom() { //
if (this.listinfo.length >= this.total) {} else {
this.pageNum++
personNurseStationLists(this.pageNum, this.pageSize).then(res => {
res.rows.forEach(e => {
this.list.push(e)
})
})
}
},
onPullDownRefresh() { //
this.pageNum = 1;
personNurseStationLists(this.PageNum, this.pageSize).then(res => {
this.listinfo = res.rows
this.total = res.total
})
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
methods: {
//
info() {
personNurseStationLists(this.pageNum, this.pageSize).then(res => {
console.log(res)
this.total = res.total
this.listinfo = res.rows.map((e) => {
return {
value: e.id,
@ -118,12 +89,9 @@
})
},
confirm(e) {
console.log(e);
this.appPersonallist.nurseStationIds = e[0].value
this.nurseStationName = e[0]['label']
console.log(e[0]['label'])
},
//
getInfo() {
nurseAppLoginSysUser(this.appPersonallist).then(res => {
@ -161,7 +129,6 @@
url: `/pages/login/login?phonenumber=${this.phonenumber}&password=${this.password}`
})
},
changeRadio() {
if (this.radio == 1) {
this.radio = 2;
@ -174,127 +141,5 @@
</script>
<style lang="scss">
.app {
height: 100vh;
padding: 20rpx 0;
.item {
font-size: 34rpx;
margin: 0 auto 20rpx;
width: 94%;
height: 100rpx;
line-height: 100rpx;
background-color: #fff;
box-shadow: 0px 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
position: relative;
span {
margin-left: 3%;
}
.addition {
line-height: 100rpx;
font-size: 34rpx;
font-weight: 400;
margin-left: 3%;
}
.lefttext {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 3%;
}
.righttext {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 18%;
height: 100rpx;
}
.lefttext,
.righttext {
::v-deep .uni-input-input {
font-size: 34rpx;
}
::v-deep .uni-input-wrapper {
height: 100rpx;
line-height: 100rpx;
}
::v-deep .uni-input-placeholder {
line-height: 100rpx;
font-size: 34rpx;
font-weight: 400;
color: #C3C1C1;
}
}
}
.radio-content {
padding-top: 50rpx;
height: 80rpx;
line-height: 11rpx;
font-size: 28rpx;
.agreement {
color: #878987;
margin-left: 25%;
}
.radio-right {
margin-left: 20%;
.radio-default {
border: 2rpx solid #0fbda6;
}
.radio {
width: 30rpx;
height: 30rpx;
border-radius: 70%;
border: 2rpx solid #178ffb;
margin: 6px 25px -20rpx -5rpx;
.radio-active {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background-color: #178ffb;
margin-left: 22%;
margin-top: 22%;
}
}
}
}
.switch {
text-align: center;
line-height: 60rpx;
color: #46ABD7;
position: absolute;
top: 70%;
}
.loginbtn {
width: 70%;
height: 100rpx;
text-align: center;
line-height: 100rpx;
background: #4C7BC9;
border-radius: 51rpx;
font-size: 41rpx;
color: #FFFFFF;
position: absolute;
top: 57%;
left: 15%;
}
}
@import './register.scss';
</style>