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", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "pages/register/register",
"style": {
"navigationBarTitleText": "注册",
"enablePullDownRefresh": false
}
}, { }, {
"path": "pages/message/message", "path": "pages/message/message",
"style": { "style": {
@ -28,12 +34,6 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, {
"path": "pages/register/register",
"style": {
"navigationBarTitleText": "注册",
"enablePullDownRefresh": false
}
}, { }, {
"path": "pages/medicalservice/medicalservice", "path": "pages/medicalservice/medicalservice",
"style": { "style": {

View File

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

View File

@ -7,10 +7,18 @@
</view> </view>
<view class="form"> <view class="form">
<u-form :model="query" ref="uForm"> <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> <span>姓名</span>
<u-form-item prop="name" :border-bottom="false"> <u-form-item prop="name" :border-bottom="false">
<u-input v-model="query.patientName" placeholder="请输入姓名" /> <u-input v-model="query.patientName" placeholder="请输入姓名" />
</u-form-item> </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="name">
性别 性别
<view class="sex"> <view class="sex">
@ -30,14 +38,6 @@
<image src="@/static/huijiantou.png" mode=""></image> <image src="@/static/huijiantou.png" mode=""></image>
</view> </view>
</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> <span>户主身份证号</span>
<u-form-item prop="householdCardNo" :border-bottom="false"> <u-form-item prop="householdCardNo" :border-bottom="false">
<u-input v-model="query.householdCardNo" placeholder="请输入身份证号" /> <u-input v-model="query.householdCardNo" placeholder="请输入身份证号" />
@ -64,12 +64,6 @@
<u-input :clearable='false' v-model="query.address" type="text" placeholder='小区、单元、门牌号' <u-input :clearable='false' v-model="query.address" type="text" placeholder='小区、单元、门牌号'
maxlength='40' /> maxlength='40' />
</u-form-item> </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="name">
所在位置 所在位置
<view class="selectdata" @tap='getlocation'> <view class="selectdata" @tap='getlocation'>
@ -125,7 +119,7 @@
</u-picker> </u-picker>
<view class=""> <view class="">
<m-city style='z-index: 10076;' :provinceData="list" headTitle="地区选择" ref="cityPicker" <m-city style='z-index: 10076;' :provinceData="list" headTitle="地区选择" ref="cityPicker"
@funcValue="getpickerParentValue" pickerSize="4"> @funcValue="getpickerParentValue" pickerSize="3">
</m-city> </m-city>
</view> </view>
<u-select v-model="showNation" :list="actions" @confirm="nationSelect"></u-select> <u-select v-model="showNation" :list="actions" @confirm="nationSelect"></u-select>
@ -134,6 +128,9 @@
</template> </template>
<script> <script>
import {
detail,
} from '@/api/pages/homepage/homepage.js'
import { import {
getCurrentUser, getCurrentUser,
} from '@/api/pages/homepage/homepage.js' } from '@/api/pages/homepage/homepage.js'
@ -218,11 +215,6 @@
}, },
], ],
tipsText: '', tipsText: '',
form: {
name: '',
phone: '',
indent: ''
},
value2: [], value2: [],
timeshow: false, // timeshow: false, //
params: { params: {
@ -341,6 +333,45 @@
// uni.$off('code'); // uni.$off('code');
// }, // },
methods: { 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() { getAddress() {
let that = this; let that = this;
@ -357,7 +388,18 @@
}, },
method: "GET", method: "GET",
success(res) { 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 => { fail: res => {
console.log(res.errMsg, '解析失败返回的错误信息'); console.log(res.errMsg, '解析失败返回的错误信息');
@ -517,9 +559,22 @@
}, },
// //
areaInfo() { areaInfo() {
getSubordinateRegions().then(res => { // getSubordinateRegions().then(res => {
this.list = res.data; // 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) { getpickerParentValue(e) {
@ -558,13 +613,12 @@
}, },
// //
onLoad(options) { onLoad(options) {
this.getAddress()
let that = this let that = this
uni.$on('headPictureUrl', (res) => { uni.$on('headPictureUrl', (res) => {
this.query.headPictureUrl = res.tempImg this.query.headPictureUrl = res.tempImg
uni.$off('headPictureUrl') uni.$off('headPictureUrl')
}) })
this.getAddress()
// this.query.headPictureUrl = options.headPictureUrl // this.query.headPictureUrl = options.headPictureUrl
// this.query.couponId = Number(options.couponId) // this.query.couponId = Number(options.couponId)
// const value = uni.getStorageSync('patientId'); // const value = uni.getStorageSync('patientId');

View File

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

View File

@ -53,6 +53,7 @@
}, },
onLoad() { onLoad() {
this.address = uni.getStorageSync('location') this.address = uni.getStorageSync('location')
this.address()
}, },
methods: { methods: {
searchChange(value) { searchChange(value) {
@ -125,8 +126,16 @@
}, },
method: "GET", method: "GET",
success(res) { success(res) {
console.log(res) var address = res.data.result.address_component.city
uni.setStorageSync('location', 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 => { fail: res => {
console.log(res.errMsg, '解析失败返回的错误信息'); console.log(res.errMsg, '解析失败返回的错误信息');

View File

@ -96,7 +96,7 @@
</u-mask> </u-mask>
<view class=""> <view class="">
<m-city style='z-index: 10076;' :provinceData="list" headTitle="地区选择" ref="cityPicker" <m-city style='z-index: 10076;' :provinceData="list" headTitle="地区选择" ref="cityPicker"
@funcValue="getpickerParentValue" pickerSize="4"> @funcValue="getpickerParentValue" pickerSize="3">
</m-city> </m-city>
</view> </view>
<u-picker mode="time" v-model="timeshow" :params="params" @confirm='timechange' @canel='timeshow=false'> <u-picker mode="time" v-model="timeshow" :params="params" @confirm='timechange' @canel='timeshow=false'>
@ -412,9 +412,22 @@
// }, // },
// //
areaInfo() { areaInfo() {
getSubordinateRegions().then(res => { // getSubordinateRegions().then(res => {
this.list = res.data; // 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() { changeRadio() {
if (this.radio == 1) { if (this.radio == 1) {