This commit is contained in:
2024-01-19 10:30:00 +08:00
parent 91beed65df
commit 719863c815
6 changed files with 178 additions and 87 deletions

View File

@ -9,6 +9,12 @@
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
}, {
"path": "pages/register/register",
"style": {
"navigationBarTitleText": "注册",
"enablePullDownRefresh": false
}
}, {
"path": "pages/message/message",
"style": {
@ -28,12 +34,6 @@
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/register/register",
"style": {
"navigationBarTitleText": "注册",
"enablePullDownRefresh": false
}
}, {
"path": "pages/medicalservice/medicalservice",
"style": {

View File

@ -70,7 +70,7 @@
};
},
onShow() {
if (uni.getStorageSync('location') && uni.getStorageSync('region')) {} else {
if (!uni.getStorageSync('location') || !uni.getStorageSync('region')) {
this.getAddress()
}
this.phonecode = undefined
@ -120,11 +120,7 @@
},
method: "GET",
success(res) {
if (uni.getStorageSync('location')) {
uni.setStorageSync('location', res.data.result.address_component
.city)
var address = uni.getStorageSync('location')
}
var address = res.data.result.address_component.city
if (address == '德州市') {
uni.setStorageSync("region", 1)
} else if (address == '东营市') {
@ -132,6 +128,8 @@
} else if (address == '济南市') {
uni.setStorageSync("region", 3)
}
uni.setStorageSync('location', res.data.result.address_component
.city)
},
fail: res => {
console.log(res.errMsg, '解析失败返回的错误信息');

View File

@ -7,10 +7,18 @@
</view>
<view class="form">
<u-form :model="query" ref="uForm">
<span>身份证号</span>
<u-form-item prop="cardNo" :border-bottom="false">
<u-input v-model="query.cardNo" placeholder="请输入身份证号" @blur="searchfun_close" />
</u-form-item>
<span>姓名</span>
<u-form-item prop="name" :border-bottom="false">
<u-input v-model="query.patientName" placeholder="请输入姓名" />
</u-form-item>
<span>手机号</span>
<u-form-item prop="phone" :border-bottom="false">
<u-input v-model="query.phone" placeholder="请输入手机号" :disabled="true" />
</u-form-item>
<view class="name">
性别
<view class="sex">
@ -30,14 +38,6 @@
<image src="@/static/huijiantou.png" mode=""></image>
</view>
</view>
<span>手机号</span>
<u-form-item prop="phone" :border-bottom="false">
<u-input v-model="query.phone" placeholder="请输入手机号" :disabled="true" />
</u-form-item>
<span>身份证号</span>
<u-form-item prop="cardNo" :border-bottom="false">
<u-input v-model="query.cardNo" placeholder="请输入身份证号" />
</u-form-item>
<span>户主身份证号</span>
<u-form-item prop="householdCardNo" :border-bottom="false">
<u-input v-model="query.householdCardNo" placeholder="请输入身份证号" />
@ -64,12 +64,6 @@
<u-input :clearable='false' v-model="query.address" type="text" placeholder='小区、单元、门牌号'
maxlength='40' />
</u-form-item>
<!-- <view class="name">
详细地址
<u-input :clearable='false' v-model="query.address" type="text" placeholder='小区、单元、门牌号'
maxlength='40' />
</view> -->
<view class="name">
所在位置
<view class="selectdata" @tap='getlocation'>
@ -125,7 +119,7 @@
</u-picker>
<view class="">
<m-city style='z-index: 10076;' :provinceData="list" headTitle="地区选择" ref="cityPicker"
@funcValue="getpickerParentValue" pickerSize="4">
@funcValue="getpickerParentValue" pickerSize="3">
</m-city>
</view>
<u-select v-model="showNation" :list="actions" @confirm="nationSelect"></u-select>
@ -134,6 +128,9 @@
</template>
<script>
import {
detail,
} from '@/api/pages/homepage/homepage.js'
import {
getCurrentUser,
} from '@/api/pages/homepage/homepage.js'
@ -218,11 +215,6 @@
},
],
tipsText: '',
form: {
name: '',
phone: '',
indent: ''
},
value2: [],
timeshow: false, //
params: {
@ -341,6 +333,45 @@
// uni.$off('code');
// },
methods: {
searchfun_close() {
const idCardReg = /(^\d{15}$)|(^\d{17}([0-9]|X)$)/;
if (!idCardReg.test(this.query.cardNo)) {} else {
//
detail(this.query.cardNo).then(res => {
if (res.code == 200 && res.data) {
this.actions.forEach(e => {
if (e.value == res.data.relationshipWithHouseholder) {
this.householdRelationship = e.label
}
})
let gender = res.data.gender == '2' ? '女' : res.data.gender == '1' ? '男' : ''
let sex = res.data.gender == '2' ? 'FEMALE' : res.data.gender == '1' ? 'MALE' : ''
this.query = {
headPictureUrl: '',
couponId: null,
homeLongitude: '',
homeLatitude: '',
nurseTypeIdList: [],
diseaseInfoList: [],
householdCardNo: '',
cardNo: this.query.cardNo,
patientName: res.data.residentName,
sexname: gender,
sex: sex,
nation: res.data.nation,
address: res.data.address,
phone: res.data.phone,
birthDate: res.data.birthday,
householdRelationship: res.data.relationshipWithHouseholder,
locationName: '',
homeLongitude: '',
homeLatitude: '',
areaCode: '',
}
}
})
}
},
//
getAddress() {
let that = this;
@ -357,7 +388,18 @@
},
method: "GET",
success(res) {
uni.setStorageSync('location', res.data.result.address_component.city)
if (!uni.getStorageSync("region") || !uni.getStorageSync("location")) {
var address = res.data.result.address_component.city
if (address == '德州市') {
uni.setStorageSync("region", 1)
} else if (address == '东营市') {
uni.setStorageSync("region", 2)
} else if (address == '济南市') {
uni.setStorageSync("region", 3)
}
uni.setStorageSync('location', res.data.result.address_component
.city)
}
},
fail: res => {
console.log(res.errMsg, '解析失败返回的错误信息');
@ -517,9 +559,22 @@
},
//
areaInfo() {
getSubordinateRegions().then(res => {
this.list = res.data;
})
// getSubordinateRegions().then(res => {
// this.list = res.data;
// })
this.list = [{
areaCode: "370500000000",
areaLevel: 2,
areaName: "东营市",
id: 255903,
parentId: 188870,
}, {
areaCode: "371400000000",
areaLevel: 2,
areaName: "德州市",
id: 398888,
parentId: 188870,
}]
},
//
getpickerParentValue(e) {
@ -558,13 +613,12 @@
},
//
onLoad(options) {
this.getAddress()
let that = this
uni.$on('headPictureUrl', (res) => {
this.query.headPictureUrl = res.tempImg
uni.$off('headPictureUrl')
})
this.getAddress()
// this.query.headPictureUrl = options.headPictureUrl
// this.query.couponId = Number(options.couponId)
// const value = uni.getStorageSync('patientId');

View File

@ -17,7 +17,7 @@
<u-form-item prop="cardNo" :border-bottom="false">
<view class="name">
身份证号
<u-input v-model="form.cardNo" placeholder="请输入身份证号" />
<u-input v-model="form.cardNo" placeholder="请输入身份证号" @blur="searchfun_close" />
<view class="idScan">
<!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
<image style="width: 28rpx;height: 28rpx;" src="@/static/pagesB/sweep.png" mode="">
@ -26,7 +26,6 @@
</view>
</u-form-item>
<u-form-item prop="patientName" :border-bottom="false">
<view class="name">
姓名
<u-input v-model="form.patientName" placeholder="请输入姓名" />
@ -65,15 +64,6 @@
<image src="@/static/huijiantou.png" mode=""></image>
</view>
</view>
<!-- <view class="name">
出生日期
<view class="select">
<text v-if="!form.birthDate">请选择出生日期</text>
<text v-else class="testitem">{{form.birthDate}}</text>
<image src="@/static/huijiantou.png" mode=""></image>
</view>
</view> -->
</u-form-item>
<u-form-item prop="householdRelationship" :border-bottom="false">
<view class="name">
@ -90,7 +80,6 @@
<u-input v-model="form.householdCardNo" placeholder="请输入身份证号" />
</view>
</u-form-item>
<u-form-item prop="address" :border-bottom="false">
<view class="name">
居住地址
@ -106,13 +95,13 @@
<!-- <image src="@/static/huijiantou.png" mode=""></image> -->
</view>
</view>
<!-- <view class="name">
<view class="name">
所在位置
<view class="selectdata" @tap='getAddress'>
<text v-if="form.locationName ==''">请选择所在位置</text>
<text class="testitem">{{form.locationName}}</text>
</view>
</view> -->
</view>
<u-form-item prop="phone" :border-bottom="false">
<view class="name">
手机号
@ -122,8 +111,6 @@
</u-form>
</view>
<u-toast ref="uToast" />
<view class="nextpage" @tap="register">
添加
</view>
@ -132,19 +119,16 @@
<!-- 与户主关系 -->
<u-select v-model="showRelationshipWithHouseholder" :list="relationship"
@confirm="relationshipSelect"></u-select>
<!-- 出生日期 -->
<u-picker mode="time" v-model="timeshow" :params="params" @confirm='timechange' @canel='timeshow=false'
start-year='1900'>
start-year='1900'>
</u-picker>
<view class="">
<m-city style='z-index: 10076;' :provinceData="list" headTitle="地区选择" ref="cityPicker"
@funcValue="getpickerParentValue" pickerSize="4">
@funcValue="getpickerParentValue" pickerSize="3">
</m-city>
</view>
</view>
</view>
</view>
</template>
@ -157,13 +141,14 @@
import {
getSubordinateRegions,
} from '@/api/pagesB/modifyAddress/modifyAddress.js';
import {
detail,
} from '@/api/pages/homepage/homepage.js'
export default {
components: {
ldSelect,
"m-city": gkcity,
},
data() {
return {
addresslength: null,
@ -213,12 +198,10 @@
},
householdRelationship: '',
userinfo: {},
nation: '',
actions: [{
value: '1',
label: '汉族'
},
{
value: '2',
@ -228,7 +211,6 @@
relationship: [{
value: '1',
label: '户主本人'
},
{
value: '2',
@ -371,11 +353,9 @@
},
}
},
onLoad(options) {
this.form.openid = uni.getStorageSync('openid')
this.areaInfo()
},
onShow() {
if (this.address != uni.getStorageSync('location')) {
@ -396,6 +376,41 @@
})
},
methods: {
searchfun_close() {
const idCardReg = /(^\d{15}$)|(^\d{17}([0-9]|X)$)/;
if (!idCardReg.test(this.form.cardNo)) {} else {
//
detail(this.form.cardNo).then(res => {
if (res.code == 200 && res.data) {
this.actions.forEach(e => {
if (e.value == res.data.nation) {
this.nation = e.label
}
})
this.relationship.forEach(e => {
if (e.value == res.data.relationshipWithHouseholder) {
this.householdRelationship = e.label
}
})
let gender = res.data.gender == '2' ? '女' : res.data.gender == '1' ? '男' : ''
this.form = {
cardNo: this.form.cardNo,
patientName: res.data.residentName,
sexname: gender,
nation: res.data.nation,
address: res.data.address,
phone: res.data.phone,
birthDate: res.data.birthday,
householdRelationship: res.data.relationshipWithHouseholder,
locationName: '',
homeLongitude: '',
homeLatitude: '',
areaCode: '',
}
}
})
}
},
//
getAddress() {
var that = this;
@ -433,9 +448,22 @@
},
//
areaInfo() {
getSubordinateRegions().then(res => {
this.list = res.data;
})
// getSubordinateRegions().then(res => {
// this.list = res.data;
// })
this.list = [{
areaCode: "370500000000",
areaLevel: 2,
areaName: "东营市",
id: 255903,
parentId: 188870,
}, {
areaCode: "371400000000",
areaLevel: 2,
areaName: "德州市",
id: 398888,
parentId: 188870,
}]
},
//
timechange(e) {
@ -484,25 +512,17 @@
delta: 1
})
// this.back()
}
})
} else {
_this.$refs.uToast.show({
title: '所属区域应选择所在的区或街道,请重新选择!',
type: 'error'
})
}
}
}
});
},
back() {
uni.navigateBack({
@ -515,19 +535,16 @@
} else if (e == '女') {
this.form.sex = 'FEMALE';
}
},
//
nationSelect(e) {
this.form.nation = e[0].value
this.nation = e[0].label
},
//
relationshipSelect(e) {
this.form.householdRelationship = e[0].value
this.householdRelationship = e[0].label
},
}
}

View File

@ -53,6 +53,7 @@
},
onLoad() {
this.address = uni.getStorageSync('location')
this.address()
},
methods: {
searchChange(value) {
@ -125,8 +126,16 @@
},
method: "GET",
success(res) {
console.log(res)
uni.setStorageSync('location', res.data.result.address_component.city)
var address = res.data.result.address_component.city
if (address == '德州市') {
uni.setStorageSync("region", 1)
} else if (address == '东营市') {
uni.setStorageSync("region", 2)
} else if (address == '济南市') {
uni.setStorageSync("region", 3)
}
uni.setStorageSync('location', res.data.result.address_component
.city)
},
fail: res => {
console.log(res.errMsg, '解析失败返回的错误信息');
@ -254,4 +263,4 @@
}
}
}
</style>
</style>

View File

@ -96,7 +96,7 @@
</u-mask>
<view class="">
<m-city style='z-index: 10076;' :provinceData="list" headTitle="地区选择" ref="cityPicker"
@funcValue="getpickerParentValue" pickerSize="4">
@funcValue="getpickerParentValue" pickerSize="3">
</m-city>
</view>
<u-picker mode="time" v-model="timeshow" :params="params" @confirm='timechange' @canel='timeshow=false'>
@ -412,9 +412,22 @@
// },
//
areaInfo() {
getSubordinateRegions().then(res => {
this.list = res.data;
})
// getSubordinateRegions().then(res => {
// this.list = res.data;
// })
this.list = [{
areaCode: "370500000000",
areaLevel: 2,
areaName: "东营市",
id: 255903,
parentId: 188870,
}, {
areaCode: "371400000000",
areaLevel: 2,
areaName: "德州市",
id: 398888,
parentId: 188870,
}]
},
changeRadio() {
if (this.radio == 1) {