添加成员+切换账号+注册
This commit is contained in:
parent
bb428bdcf5
commit
31f4717f78
@ -20,3 +20,39 @@ export function inviteFriends(patientId) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取已绑定家庭成员列表
|
||||||
|
export function getFamilyList(openid,patientCode) {
|
||||||
|
return request({
|
||||||
|
url: `/applet/register/switchResident/${openid}/${patientCode}`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 添加家庭成员
|
||||||
|
export function registerdata(data) {
|
||||||
|
return request({
|
||||||
|
url: '/applet/register',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获取当前注册居民
|
||||||
|
export function getCurrentUser(openid) {
|
||||||
|
return request({
|
||||||
|
url: `/applet/register/getList/${openid}`,
|
||||||
|
method: 'GET',
|
||||||
|
header: {
|
||||||
|
// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 切换
|
||||||
|
export function switchResident(openid,patientCode) {
|
||||||
|
return request({
|
||||||
|
url: `/applet/register/switchResident/${openid}/${patientCode}`,
|
||||||
|
method: 'GET',
|
||||||
|
header: {
|
||||||
|
// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
96
pages.json
96
pages.json
@ -3,13 +3,30 @@
|
|||||||
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
||||||
},
|
},
|
||||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||||
|
{
|
||||||
|
"path": "pages/myinformation/myinformation",
|
||||||
|
"style": {
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/register/register",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "注册",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "pages/startup/startup",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "pages/startup/startup",
|
|
||||||
"style": {
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/homepage/homepage",
|
"path": "pages/homepage/homepage",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
@ -22,13 +39,7 @@
|
|||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/myinformation/myinformation",
|
|
||||||
"style": {
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/login/login",
|
"path": "pages/login/login",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "登录",
|
"navigationBarTitleText": "登录",
|
||||||
@ -41,13 +52,7 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/register/register",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "注册",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/facecollection/facecollection",
|
"path": "pages/facecollection/facecollection",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "人脸采集",
|
"navigationBarTitleText": "人脸采集",
|
||||||
@ -61,8 +66,7 @@
|
|||||||
"path": "Behaviorpoints/Behaviorpoints",
|
"path": "Behaviorpoints/Behaviorpoints",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "行为积分",
|
"navigationBarTitleText": "行为积分",
|
||||||
"onReachBottomDistance": 40, //距离底部多远时触发 单位为px
|
"enablePullDownRefresh": false
|
||||||
"enablePullDownRefresh": true //设置参数为true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -70,6 +74,7 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "预约详情",
|
"navigationBarTitleText": "预约详情",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
|
// "navigationStyle": "default",
|
||||||
"navigationBarBackgroundColor": "#4ac4ab"
|
"navigationBarBackgroundColor": "#4ac4ab"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -360,8 +365,7 @@
|
|||||||
"path": "PointsMall/PointsMall",
|
"path": "PointsMall/PointsMall",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "积分商城",
|
"navigationBarTitleText": "积分商城",
|
||||||
"onReachBottomDistance": 40, //距离底部多远时触发 单位为px
|
"enablePullDownRefresh": false
|
||||||
"enablePullDownRefresh": true //设置参数为true
|
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "screeningResult/screeningResult",
|
"path": "screeningResult/screeningResult",
|
||||||
@ -399,8 +403,24 @@
|
|||||||
"navigationBarTitleText": "履约详情",
|
"navigationBarTitleText": "履约详情",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
}
|
},{
|
||||||
]
|
"path" : "AddMembers/AddMembers",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "添加成员",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
,{
|
||||||
|
"path" : "Serviceevaluation/Serviceevaluation",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "服务评价",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
}, {
|
}, {
|
||||||
"root": "pagesC",
|
"root": "pagesC",
|
||||||
"pages": [{
|
"pages": [{
|
||||||
@ -410,13 +430,13 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
"path": "Filinginformation/Filinginformation",
|
// "path": "Filinginformation/Filinginformation",
|
||||||
"style": {
|
// "style": {
|
||||||
"navigationBarTitleText": "查看建档信息"
|
// "navigationBarTitleText": "查看建档信息"
|
||||||
// "enablePullDownRefresh": false
|
// // "enablePullDownRefresh": false
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
"path": "Onlinesigning/Onlinesigning",
|
"path": "Onlinesigning/Onlinesigning",
|
||||||
"style": {
|
"style": {
|
||||||
@ -504,13 +524,21 @@
|
|||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "contractsigningprotocol/contractsigningprotocol",
|
"path": "contractsigningprotocol/contractsigningprotocol",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "签约协议",
|
"navigationBarTitleText": "签约协议",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// {
|
||||||
|
// "path": "contractsigningprotocol/contractsigningprotocol",
|
||||||
|
// "style": {
|
||||||
|
// "navigationBarTitleText": "签约协议",
|
||||||
|
// "enablePullDownRefresh": false
|
||||||
|
// }
|
||||||
|
// }
|
||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@ -162,13 +162,16 @@
|
|||||||
},
|
},
|
||||||
// 筛查记录
|
// 筛查记录
|
||||||
gorecords() {
|
gorecords() {
|
||||||
if (!this.userinfo) {
|
uni.navigateTo({
|
||||||
this.gologin();
|
url: "/pagesC/Screeningrecords/Screeningrecords"
|
||||||
} else {
|
})
|
||||||
uni.navigateTo({
|
// if (!this.userinfo) {
|
||||||
url: "/pagesC/Screeningrecords/Screeningrecords"
|
// this.gologin();
|
||||||
})
|
// } else {
|
||||||
}
|
// uni.navigateTo({
|
||||||
|
// url: "/pagesC/Screeningrecords/Screeningrecords"
|
||||||
|
// })
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
// 健康自评
|
// 健康自评
|
||||||
healthtest() {
|
healthtest() {
|
||||||
|
|||||||
@ -89,6 +89,7 @@
|
|||||||
let that = this;
|
let that = this;
|
||||||
isRegistered(that.logincode, that.phonecode).then(resp => {
|
isRegistered(that.logincode, that.phonecode).then(resp => {
|
||||||
uni.setStorageSync("openid", resp.data.openid)
|
uni.setStorageSync("openid", resp.data.openid)
|
||||||
|
uni.setStorageSync("phone", resp.data.phone)
|
||||||
if (resp.data.code == '0') {
|
if (resp.data.code == '0') {
|
||||||
that.$refs.uToast.show({
|
that.$refs.uToast.show({
|
||||||
title: '未注册,请先注册',
|
title: '未注册,请先注册',
|
||||||
@ -114,6 +115,7 @@
|
|||||||
delta: 1
|
delta: 1
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 500)
|
||||||
|
console.log("9999")
|
||||||
} else {
|
} else {
|
||||||
that.$refs.uToast.show({
|
that.$refs.uToast.show({
|
||||||
title: '登录失败',
|
title: '登录失败',
|
||||||
|
|||||||
@ -155,10 +155,13 @@
|
|||||||
<view class="mask" v-show="showhome" @click.stop='showhome = false'>
|
<view class="mask" v-show="showhome" @click.stop='showhome = false'>
|
||||||
<view class="masktext" @click.stop=''>
|
<view class="masktext" @click.stop=''>
|
||||||
<view class="maskcontent">
|
<view class="maskcontent">
|
||||||
|
<!-- <text>{{familyList.patientName}}</text> -->
|
||||||
<template v-for="item in familyList">
|
<template v-for="item in familyList">
|
||||||
<view :class="item.identity === userInfo.identity ? 'p1' : 'p2'" @click.stop="changeFamilyInfo(item)">
|
<view :class="item.cardNo === userinfo.cardNo ? 'p1' : 'p2'"
|
||||||
<text>{{item.residentName}}</text>
|
@click.stop="changeFamilyInfo(item)">
|
||||||
<text>{{item.identity.substring(0,4)}}************{{item.identity.substring(16,18)}}</text>
|
<text>{{item.patientName}}</text>
|
||||||
|
<text
|
||||||
|
v-if="item.cardNo">{{item.cardNo.substring(0,4)}}************{{item.cardNo.substring(16,18)}}</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
@ -167,6 +170,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -176,6 +180,10 @@
|
|||||||
} from "vuex";
|
} from "vuex";
|
||||||
import {
|
import {
|
||||||
appPersonal,
|
appPersonal,
|
||||||
|
getFamilyList,
|
||||||
|
registerdata,
|
||||||
|
getCurrentUser,
|
||||||
|
switchResident
|
||||||
} from '@/api/pages/myinformation/myinformation.js';
|
} from '@/api/pages/myinformation/myinformation.js';
|
||||||
import {
|
import {
|
||||||
existPatientInfo
|
existPatientInfo
|
||||||
@ -184,6 +192,9 @@
|
|||||||
createMobileToken
|
createMobileToken
|
||||||
} from '@/api/pages/login/index.js'
|
} from '@/api/pages/login/index.js'
|
||||||
import baseurl from '@/api/baseurl.js'
|
import baseurl from '@/api/baseurl.js'
|
||||||
|
// import {
|
||||||
|
// ,
|
||||||
|
// } from '@/api/pages/homepage/homepage.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -192,21 +203,61 @@
|
|||||||
timer: null,
|
timer: null,
|
||||||
list: {},
|
list: {},
|
||||||
showhome: false, //切换
|
showhome: false, //切换
|
||||||
|
familyList: {}, //切换列表
|
||||||
|
userinfo: {}, //用户信息
|
||||||
|
valueopenid:'',
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|
||||||
|
|
||||||
// this.bjimg = baseurl + '/profile/appletPicture/inviteFriendsOne.png'
|
// this.bjimg = baseurl + '/profile/appletPicture/inviteFriendsOne.png'
|
||||||
let that = this
|
let that = this
|
||||||
this.baseurl = baseurl
|
that.userinfo = uni.getStorageSync('userinfo')
|
||||||
|
console.log(that.userinfo)
|
||||||
|
that.baseurl = baseurl
|
||||||
const value = uni.getStorageSync('patientId');
|
const value = uni.getStorageSync('patientId');
|
||||||
|
this.valueopenid = uni.getStorageSync('openid');
|
||||||
if (value) {
|
if (value) {
|
||||||
that.myInfo()
|
that.myInfo()
|
||||||
} else {
|
} else {
|
||||||
that.appPersonallist = null
|
that.appPersonallist = null
|
||||||
}
|
}
|
||||||
|
// getCurrentUser(this.valueopenid).then(res => {
|
||||||
|
// console.log(res)
|
||||||
|
// this.familyList = res.data
|
||||||
|
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 切换成员
|
||||||
|
changeFamilyInfo(e) {
|
||||||
|
console.log(e,'000')
|
||||||
|
switchResident(this.valueopenid,e.patientCode).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '切换成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: '1000',
|
||||||
|
})
|
||||||
|
uni.setStorageSync('userinfo', res.data);
|
||||||
|
uni.setStorageSync('patientId', res.data.id);
|
||||||
|
this.myInfo()
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res.msg,
|
||||||
|
type: 'error',
|
||||||
|
duration: '1000',
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.showhome = false
|
||||||
|
},
|
||||||
remove() {
|
remove() {
|
||||||
let that = this
|
let that = this
|
||||||
const value = uni.getStorageSync('patientId');
|
const value = uni.getStorageSync('patientId');
|
||||||
@ -305,7 +356,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 服务评价
|
// 服务评价
|
||||||
evaluation(){
|
evaluation() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesB/Serviceevaluation/Serviceevaluation'
|
url: '/pagesB/Serviceevaluation/Serviceevaluation'
|
||||||
})
|
})
|
||||||
@ -385,9 +436,13 @@
|
|||||||
homeshow() {
|
homeshow() {
|
||||||
// this.getSetting()
|
// this.getSetting()
|
||||||
// this.listquery.bindingCity = uni.getStorageSync('userInfo').bindingCity
|
// this.listquery.bindingCity = uni.getStorageSync('userInfo').bindingCity
|
||||||
// getFamilyList(this.listquery).then(res => {
|
|
||||||
// this.familyList = res.data.data
|
var patientCode = this.userinfo.patientCode
|
||||||
// // })
|
var openid = uni.getStorageSync('openid')
|
||||||
|
// getFamilyList(openid, patientCode).then(res => {
|
||||||
|
// this.familyList = res.data
|
||||||
|
// console.log(this.familyList, '000')
|
||||||
|
// })
|
||||||
this.showhome = true
|
this.showhome = true
|
||||||
},
|
},
|
||||||
//管理家庭成员
|
//管理家庭成员
|
||||||
|
|||||||
@ -33,12 +33,26 @@
|
|||||||
</view>
|
</view>
|
||||||
<span>手机号</span>
|
<span>手机号</span>
|
||||||
<u-form-item prop="phone" :border-bottom="false">
|
<u-form-item prop="phone" :border-bottom="false">
|
||||||
<u-input v-model="query.phone" placeholder="请输入手机号" />
|
<u-input v-model="query.phone" placeholder="请输入手机号" :disabled="true"/>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<span>身份证号</span>
|
<span>身份证号</span>
|
||||||
<u-form-item prop="cardNo" :border-bottom="false">
|
<u-form-item prop="cardNo" :border-bottom="false">
|
||||||
<u-input v-model="query.cardNo" placeholder="请输入身份证号" />
|
<u-input v-model="query.cardNo" placeholder="请输入身份证号" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
<span>户主身份证号</span>
|
||||||
|
<u-form-item prop="householdCardNo" :border-bottom="false">
|
||||||
|
<u-input v-model="query.householdCardNo" placeholder="请输入身份证号" />
|
||||||
|
</u-form-item>
|
||||||
|
<view class="name">
|
||||||
|
与户主关系
|
||||||
|
<view class="select" @click="showNation = true;">
|
||||||
|
<text v-if="!householdRelationship">请选择与户主关系</text>
|
||||||
|
<text v-else class="testitem">{{householdRelationship}}</text>
|
||||||
|
|
||||||
|
|
||||||
|
<image src="../../static/huijiantou.png" mode=""></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="name">
|
<view class="name">
|
||||||
所属区域
|
所属区域
|
||||||
<view class="select" @tap='showPicker'>
|
<view class="select" @tap='showPicker'>
|
||||||
@ -118,6 +132,7 @@
|
|||||||
@funcValue="getpickerParentValue" pickerSize="4">
|
@funcValue="getpickerParentValue" pickerSize="4">
|
||||||
</m-city>
|
</m-city>
|
||||||
</view>
|
</view>
|
||||||
|
<u-select v-model="showNation" :list="actions" @confirm="nationSelect"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -154,6 +169,56 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showNation: false, //户主关系
|
||||||
|
actions: [{
|
||||||
|
value: '1',
|
||||||
|
label: '户主本人'
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '2',
|
||||||
|
label: '配偶'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '3',
|
||||||
|
label: '子女'
|
||||||
|
},{
|
||||||
|
value: '4',
|
||||||
|
label: '(外)孙子女'
|
||||||
|
} ,{
|
||||||
|
value: '5',
|
||||||
|
label: '父母'
|
||||||
|
} ,{
|
||||||
|
value: '6',
|
||||||
|
label: '(外)祖父母'
|
||||||
|
} ,{
|
||||||
|
value: '7',
|
||||||
|
label: '兄弟姐妹'
|
||||||
|
} ,{
|
||||||
|
value: '8',
|
||||||
|
label: '儿媳'
|
||||||
|
} ,{
|
||||||
|
value: '9',
|
||||||
|
label: '女婿'
|
||||||
|
} ,{
|
||||||
|
value: '10',
|
||||||
|
label: '孙子女'
|
||||||
|
} ,{
|
||||||
|
value: '11',
|
||||||
|
label: '侄子女'
|
||||||
|
} ,{
|
||||||
|
value: '12',
|
||||||
|
label: '曾孙子女'
|
||||||
|
},
|
||||||
|
,{
|
||||||
|
value: '13',
|
||||||
|
label: '祖父母'
|
||||||
|
},
|
||||||
|
,{
|
||||||
|
value: '99',
|
||||||
|
label: '其他'
|
||||||
|
},
|
||||||
|
],
|
||||||
tipsText: '',
|
tipsText: '',
|
||||||
form: {
|
form: {
|
||||||
name: '',
|
name: '',
|
||||||
@ -221,8 +286,11 @@
|
|||||||
sex: '',
|
sex: '',
|
||||||
sexname: '',
|
sexname: '',
|
||||||
birthDate: '',
|
birthDate: '',
|
||||||
cityCode: '1'
|
cityCode: '1',
|
||||||
|
householdCardNo:'',
|
||||||
|
householdRelationship:'',
|
||||||
},
|
},
|
||||||
|
householdRelationship:'',
|
||||||
timer: null,
|
timer: null,
|
||||||
addresslength: null,
|
addresslength: null,
|
||||||
patientDiseaseInfoList: [], //获取个人信息
|
patientDiseaseInfoList: [], //获取个人信息
|
||||||
@ -268,6 +336,17 @@
|
|||||||
},
|
},
|
||||||
message: '请输入正确的身份证号',
|
message: '请输入正确的身份证号',
|
||||||
trigger: ['blur'],
|
trigger: ['blur'],
|
||||||
|
}],
|
||||||
|
householdRelationship:[{
|
||||||
|
|
||||||
|
message: '请输入户主身份证号',
|
||||||
|
trigger: ['change', 'blur'],
|
||||||
|
}, {
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
return uni.$u.test.idCard(value);
|
||||||
|
},
|
||||||
|
message: '请输入正确的身份证号',
|
||||||
|
trigger: ['blur'],
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -280,6 +359,14 @@
|
|||||||
// uni.$off('code');
|
// uni.$off('code');
|
||||||
// },
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
|
// 与户主关系
|
||||||
|
nationSelect(e) {
|
||||||
|
console.log(e)
|
||||||
|
this.query.householdRelationship = e[0].value
|
||||||
|
this.householdRelationship = e[0].label
|
||||||
|
// console.log(this.query.householdRelationship)
|
||||||
|
// this.$refs.uForm.validateField('nation')
|
||||||
|
},
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
this.selected = e
|
this.selected = e
|
||||||
// console.log(e)
|
// console.log(e)
|
||||||
@ -288,12 +375,12 @@
|
|||||||
},
|
},
|
||||||
// 下拉框多选
|
// 下拉框多选
|
||||||
selectChange(val) {
|
selectChange(val) {
|
||||||
console.log(val,'999');
|
console.log(val, '999');
|
||||||
},
|
},
|
||||||
cancel() {},
|
cancel() {},
|
||||||
confirm(e) {
|
confirm(e) {
|
||||||
this.query.diseaseList = e.map(Number)
|
this.query.diseaseList = e.map(Number)
|
||||||
console.log(e,'打印e')
|
console.log(e, '打印e')
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
console.log(this.query)
|
console.log(this.query)
|
||||||
@ -381,83 +468,7 @@
|
|||||||
url: '/pages/facecollection/facecollection'
|
url: '/pages/facecollection/facecollection'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//提交信息
|
|
||||||
// informationinfo() {
|
|
||||||
// var that = this
|
|
||||||
// if (that.query.sex == '男') {
|
|
||||||
// that.query.sex = 'MALE';
|
|
||||||
// } else if (that.query.sex == '女') {
|
|
||||||
// that.query.sex = 'FEMALE';
|
|
||||||
// }
|
|
||||||
// if (this.addresslength) {
|
|
||||||
// if (this.addresslength.length > 2) {
|
|
||||||
// const value = uni.getStorageSync('phone');
|
|
||||||
// if (value) {
|
|
||||||
// that.query.phone = value
|
|
||||||
// if (that.radio == 1) {
|
|
||||||
// that.$refs.uToast.show({
|
|
||||||
// title: '请审核并同意用户协议',
|
|
||||||
// type: 'error'
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// const patientId = uni.getStorageSync('patientId');
|
|
||||||
// AppIdentification(patientId).then(resp => {
|
|
||||||
// if (resp.code == 200) {
|
|
||||||
// if (resp.data.loginFlag) {
|
|
||||||
// that.$refs.uToast.show({
|
|
||||||
// title: '您已完善',
|
|
||||||
// type: 'success',
|
|
||||||
// })
|
|
||||||
// if (that.timer) {
|
|
||||||
// clearTimeout(that.timer)
|
|
||||||
// }
|
|
||||||
// that.timer = setTimeout(e => {
|
|
||||||
// uni.navigateBack({
|
|
||||||
// delta: 1
|
|
||||||
// })
|
|
||||||
// }, 1500)
|
|
||||||
// } else {
|
|
||||||
// information(that.query).then(res => {
|
|
||||||
// if (res.code == 200) {
|
|
||||||
// uni.removeStorageSync('invitationPatientId');
|
|
||||||
// that.$refs.uToast.show({
|
|
||||||
// title: '完善信息成功',
|
|
||||||
// type: 'success',
|
|
||||||
// duration: '1500'
|
|
||||||
// })
|
|
||||||
// if (that.timer) {
|
|
||||||
// clearTimeout(that.timer)
|
|
||||||
// }
|
|
||||||
// that.timer = setTimeout(e => {
|
|
||||||
// uni.navigateBack({
|
|
||||||
// delta: 1
|
|
||||||
// })
|
|
||||||
// }, 1500)
|
|
||||||
// } else if (res.code == 500) {
|
|
||||||
// that.$refs.uToast.show({
|
|
||||||
// title: res.msg,
|
|
||||||
// type: 'error',
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// that.$refs.uToast.show({
|
|
||||||
// title: '所属区域应选择所在的区或街道,请重新选择!',
|
|
||||||
// type: 'error'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// that.$refs.uToast.show({
|
|
||||||
// title: '所属区域应选择所在的区或街道,请重新选择!',
|
|
||||||
// type: 'error'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
//性别
|
//性别
|
||||||
sexchange(e) {
|
sexchange(e) {
|
||||||
if (e == '男') {
|
if (e == '男') {
|
||||||
@ -542,12 +553,12 @@
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
// console.log(options, '00')
|
// console.log(options, '00')
|
||||||
uni.$on('headPictureUrl',(res)=>{
|
uni.$on('headPictureUrl', (res) => {
|
||||||
console.log(res,'99999')
|
console.log(res, '99999')
|
||||||
this.query.headPictureUrl = res.tempImg
|
this.query.headPictureUrl = res.tempImg
|
||||||
uni.$off('headPictureUrl')
|
uni.$off('headPictureUrl')
|
||||||
// 为 B 页面传过来的值
|
// 为 B 页面传过来的值
|
||||||
})
|
})
|
||||||
|
|
||||||
// this.query.headPictureUrl = options.headPictureUrl
|
// this.query.headPictureUrl = options.headPictureUrl
|
||||||
// this.query.couponId = Number(options.couponId)
|
// this.query.couponId = Number(options.couponId)
|
||||||
@ -570,6 +581,7 @@
|
|||||||
that.query.source = 'REGISTER_YOURSELF'
|
that.query.source = 'REGISTER_YOURSELF'
|
||||||
that.query.invitationPatientId = null
|
that.query.invitationPatientId = null
|
||||||
}
|
}
|
||||||
|
this.query.phone=uni.getStorageSync("phone")
|
||||||
// const chooseLocation = requirePlugin('chooseLocation');
|
// const chooseLocation = requirePlugin('chooseLocation');
|
||||||
// const location = chooseLocation.getLocation(); // 如果点击确认选点按钮,则返回选点结果对象,否则返回null
|
// const location = chooseLocation.getLocation(); // 如果点击确认选点按钮,则返回选点结果对象,否则返回null
|
||||||
// if (location) {
|
// if (location) {
|
||||||
@ -721,9 +733,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
::v-deep .u-radio.data-v-643b3322{
|
|
||||||
|
::v-deep .u-radio.data-v-643b3322 {
|
||||||
padding-left: 32rpx;
|
padding-left: 32rpx;
|
||||||
padding-top: 7rpx;
|
padding-top: 7rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -759,7 +772,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .u-radio[data-v-643b3322]{
|
::v-deep .u-radio[data-v-643b3322] {
|
||||||
margin-top: 8rpx !important;
|
margin-top: 8rpx !important;
|
||||||
margin-left: 30rpx !important;
|
margin-left: 30rpx !important;
|
||||||
|
|
||||||
|
|||||||
@ -13,70 +13,113 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="contentbottom">
|
<view class="contentbottom">
|
||||||
|
<u-form :model="form" ref="uForm">
|
||||||
|
<u-form-item prop="cardNo" :border-bottom="false">
|
||||||
|
|
||||||
<view class="name">
|
<view class="name">
|
||||||
身份证号
|
身份证号
|
||||||
<u-input @blur="inputBlur()" v-model="form.identity" placeholder="请输入身份证号" />
|
<u-input v-model="form.cardNo" placeholder="请输入身份证号" />
|
||||||
<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="">
|
||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="name">
|
</u-form-item>
|
||||||
姓名
|
<u-form-item prop="patientName" :border-bottom="false">
|
||||||
<u-input v-model="value" placeholder="请输入姓名" />
|
|
||||||
</view>
|
|
||||||
<view class="name">
|
|
||||||
性别
|
|
||||||
<view class="sex">
|
|
||||||
<u-radio-group v-model="form.gender" size='30'>
|
|
||||||
<u-radio @change='changeGender' v-for="(item, index) in sexlist" :key="index"
|
|
||||||
:name="item.name" active-color="#26A888" :disabled="item.disabled">
|
|
||||||
{{item.name}}
|
|
||||||
</u-radio>
|
|
||||||
</u-radio-group>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="name">
|
|
||||||
民族
|
|
||||||
<view class="select" @click="showNation = true;">
|
|
||||||
<text>请选择民族</text>
|
|
||||||
<image src="../../static/huijiantou.png" mode=""></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="name">
|
|
||||||
出生日期
|
|
||||||
<view class="select">
|
|
||||||
<text>请选择出生日期</text>
|
|
||||||
<image src="../../static/huijiantou.png" mode=""></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="name">
|
|
||||||
与户主的关系
|
|
||||||
<view class="select" @click="showRelationshipWithHouseholder = true;">
|
|
||||||
<text>请选择与户主的关系</text>
|
|
||||||
<image src="../../static/huijiantou.png" mode=""></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
<view class="name">
|
||||||
|
姓名
|
||||||
|
<u-input v-model="form.patientName" placeholder="请输入姓名" />
|
||||||
|
</view>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item prop="sex" :border-bottom="false">
|
||||||
|
<view class="name">
|
||||||
|
性别
|
||||||
|
<view class="sex">
|
||||||
|
<u-radio-group v-model="form.sexname" size='30'>
|
||||||
|
<u-radio @change='changeGender' v-for="(item, index) in sexlist" :key="index"
|
||||||
|
:name="item.name" active-color="#26A888" :disabled="item.disabled">
|
||||||
|
{{item.name}}
|
||||||
|
</u-radio>
|
||||||
|
</u-radio-group>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item prop="nation" :border-bottom="false">
|
||||||
|
<view class="name">
|
||||||
|
民族
|
||||||
|
<view class="select" @click="showNation = true;">
|
||||||
|
<text v-if="!nation">请选择民族</text>
|
||||||
|
<!-- <text v-if="!householdRelationship">请选择与户主关系</text> -->
|
||||||
|
<text v-else class="testitem">{{nation}}</text>
|
||||||
|
<image src="../../static/huijiantou.png" mode=""></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item prop="birthDate" :border-bottom="false">
|
||||||
|
<view class="name">
|
||||||
|
出生日期
|
||||||
|
<view class="select" @tap='timeshow=true'>
|
||||||
|
<text v-if="form.birthDate==''">请选择出生日期</text>
|
||||||
|
<text v-else class="testitem">{{form.birthDate}}</text>
|
||||||
|
<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>
|
||||||
|
|
||||||
<view class="name">
|
<image src="../../static/huijiantou.png" mode=""></image>
|
||||||
居住地址
|
</view>
|
||||||
<u-input v-model="form.address" placeholder="请输入居住地址" />
|
</view> -->
|
||||||
</view>
|
</u-form-item>
|
||||||
|
<u-form-item prop="householdRelationship" :border-bottom="false">
|
||||||
|
<view class="name">
|
||||||
|
与户主的关系
|
||||||
|
<view class="select" @click="showRelationshipWithHouseholder = true;">
|
||||||
|
<text v-if="!householdRelationship">请选择与户主关系</text>
|
||||||
|
<text v-else class="testitem">{{householdRelationship}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item prop="" :border-bottom="false">
|
||||||
|
<view class="name">
|
||||||
|
户主身份证号
|
||||||
|
<u-input v-model="form.householdCardNo" placeholder="请输入身份证号" />
|
||||||
|
</view>
|
||||||
|
</u-form-item>
|
||||||
|
|
||||||
<view class="name">
|
<u-form-item prop="address" :border-bottom="false">
|
||||||
手机号
|
<view class="name">
|
||||||
<u-input v-model="form.phone" placeholder="请输入手机号" />
|
居住地址
|
||||||
</view>
|
<u-input v-model="form.address" placeholder="请输入居住地址" />
|
||||||
|
</view>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item prop="phone" :border-bottom="false">
|
||||||
|
<view class="name">
|
||||||
|
手机号
|
||||||
|
<u-input v-model="form.phone" placeholder="请输入手机号" />
|
||||||
|
</view>
|
||||||
|
</u-form-item>
|
||||||
|
</u-form>
|
||||||
</view>
|
</view>
|
||||||
<u-select v-model="showNation" :list="actions" @confirm="nationSelect"></u-select>
|
<u-toast ref="uToast" />
|
||||||
<u-select v-model="showRelationshipWithHouseholder" :list="actions" @confirm="nationSelect"></u-select>
|
|
||||||
|
|
||||||
<view class="nextpage" @tap="gonextstep">
|
|
||||||
|
<view class="nextpage" @tap="register">
|
||||||
添加
|
添加
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 民族 -->
|
||||||
|
<u-select v-model="showNation" :list="actions" @confirm="nationSelect"></u-select>
|
||||||
|
<!-- 与户主关系 -->
|
||||||
|
<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'>
|
||||||
|
</u-picker>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@ -84,6 +127,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
registerdata
|
||||||
|
} from '@/api/pages/register/register.js'
|
||||||
|
|
||||||
// import {
|
// import {
|
||||||
// bindFamilyUser,
|
// bindFamilyUser,
|
||||||
// getDictByType
|
// getDictByType
|
||||||
@ -101,6 +148,15 @@
|
|||||||
disabled: false
|
disabled: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
timeshow: false, //出生日期
|
||||||
|
params: {
|
||||||
|
year: true,
|
||||||
|
month: true,
|
||||||
|
day: true,
|
||||||
|
hour: false,
|
||||||
|
minute: false,
|
||||||
|
second: false
|
||||||
|
},
|
||||||
mode: '',
|
mode: '',
|
||||||
newTime: '',
|
newTime: '',
|
||||||
barTitle: '添加成员',
|
barTitle: '添加成员',
|
||||||
@ -113,17 +169,20 @@
|
|||||||
//校验性别 flag
|
//校验性别 flag
|
||||||
ifSex: '',
|
ifSex: '',
|
||||||
form: {
|
form: {
|
||||||
identity: '',
|
cardNo: '',
|
||||||
residentName: '',
|
patientName: '',
|
||||||
gender: '',
|
sexname: '',
|
||||||
nation: '汉族',
|
nation: '',
|
||||||
address: '',
|
address: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
birthday: '',
|
birthDate: '',
|
||||||
relationshipWithHouseholder: '',
|
|
||||||
bindingCity: ''
|
householdRelationship: '',
|
||||||
},
|
},
|
||||||
relationshipWithHouseholder: '',
|
householdRelationship:'',
|
||||||
|
userinfo:{},
|
||||||
|
|
||||||
|
nation:'',
|
||||||
actions: [{
|
actions: [{
|
||||||
value: '1',
|
value: '1',
|
||||||
label: '汉族'
|
label: '汉族'
|
||||||
@ -134,6 +193,53 @@
|
|||||||
label: '少数名族'
|
label: '少数名族'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
relationship: [{
|
||||||
|
value: '1',
|
||||||
|
label: '户主本人'
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '2',
|
||||||
|
label: '配偶'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '3',
|
||||||
|
label: '子女'
|
||||||
|
}, {
|
||||||
|
value: '4',
|
||||||
|
label: '(外)孙子女'
|
||||||
|
}, {
|
||||||
|
value: '5',
|
||||||
|
label: '父母'
|
||||||
|
}, {
|
||||||
|
value: '6',
|
||||||
|
label: '(外)祖父母'
|
||||||
|
}, {
|
||||||
|
value: '7',
|
||||||
|
label: '兄弟姐妹'
|
||||||
|
}, {
|
||||||
|
value: '8',
|
||||||
|
label: '儿媳'
|
||||||
|
}, {
|
||||||
|
value: '9',
|
||||||
|
label: '女婿'
|
||||||
|
}, {
|
||||||
|
value: '10',
|
||||||
|
label: '孙子女'
|
||||||
|
}, {
|
||||||
|
value: '11',
|
||||||
|
label: '侄子女'
|
||||||
|
}, {
|
||||||
|
value: '12',
|
||||||
|
label: '曾孙子女'
|
||||||
|
}, , {
|
||||||
|
value: '13',
|
||||||
|
label: '祖父母'
|
||||||
|
}, , {
|
||||||
|
value: '99',
|
||||||
|
label: '其他'
|
||||||
|
},
|
||||||
|
],
|
||||||
radiolist: [{
|
radiolist: [{
|
||||||
name: '男',
|
name: '男',
|
||||||
disabled: false
|
disabled: false
|
||||||
@ -144,7 +250,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
identity: [{
|
cardNo: [{
|
||||||
//必填
|
//必填
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入身份证号',
|
message: '请输入身份证号',
|
||||||
@ -160,12 +266,12 @@
|
|||||||
// 触发器可以同时用blur和change
|
// 触发器可以同时用blur和change
|
||||||
trigger: ['change', 'blur'],
|
trigger: ['change', 'blur'],
|
||||||
}],
|
}],
|
||||||
residentName: [{
|
patientName: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入姓名',
|
message: '请输入姓名',
|
||||||
trigger: ['change', 'blur']
|
trigger: ['change', 'blur']
|
||||||
}],
|
}],
|
||||||
gender: [{
|
sex: [{
|
||||||
min: 1,
|
min: 1,
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择性别',
|
message: '请选择性别',
|
||||||
@ -177,18 +283,18 @@
|
|||||||
message: '请选择民族',
|
message: '请选择民族',
|
||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
}],
|
}],
|
||||||
birthday: [{
|
birthDate: [{
|
||||||
min: 1,
|
min: 1,
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择出生日期',
|
message: '请选择出生日期',
|
||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
}],
|
}],
|
||||||
// relationshipWithHouseholder: [{
|
householdRelationship: [{
|
||||||
// min: 1,
|
min: 1,
|
||||||
// required: true,
|
required: true,
|
||||||
// message: '请选择与户主关系',
|
message: '请选择与户主关系',
|
||||||
// trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
// }],
|
}],
|
||||||
address: [{
|
address: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入居住地址',
|
message: '请输入居住地址',
|
||||||
@ -228,41 +334,11 @@
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
console.log(this.address, '546545454');
|
console.log(this.address, '546545454');
|
||||||
getDictByType('householderRelationship').then(res => {
|
this.form.openid = uni.getStorageSync('openid')
|
||||||
this.dictList = res.data.data
|
|
||||||
console.log(res);
|
|
||||||
let arr = []
|
|
||||||
for (let i of res.data.data) {
|
|
||||||
arr.push(i.dictLabel)
|
|
||||||
}
|
|
||||||
this.gxcolumn.push(arr)
|
|
||||||
})
|
|
||||||
this.form.openid = uni.getStorageSync('openId')
|
|
||||||
if (uni.getStorageSync('location') == '德州市') {
|
|
||||||
this.form.bindingCity = '1'
|
|
||||||
} else if (uni.getStorageSync('location') == '东营市') {
|
|
||||||
this.form.bindingCity = '2'
|
|
||||||
} else if (uni.getStorageSync('location') == '济南市') {
|
|
||||||
this.form.bindingCity = '3'
|
|
||||||
}
|
|
||||||
console.log(this.form.bindingCity);
|
|
||||||
if (options.mode) {
|
|
||||||
this.mode = options.mode
|
|
||||||
this.barTitle = '授权登录'
|
|
||||||
} else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.qqmapsdk = new QQMapWX({
|
|
||||||
// 在腾讯平台自己申请的秘钥
|
|
||||||
key: 'Q4DBZ-UIMC2-B63UX-CUZ6A-S3UT7-TBF3V'
|
|
||||||
}),
|
|
||||||
this.getAddress(),
|
|
||||||
this.getLocal(),
|
|
||||||
//进入页面调用
|
|
||||||
this.getAtTime()
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (this.address != uni.getStorageSync('location')) {
|
if (this.address != uni.getStorageSync('location')) {
|
||||||
@ -270,12 +346,10 @@
|
|||||||
delta: 1
|
delta: 1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.address = uni.getStorageSync('location')
|
|
||||||
// console.log('aaaa',this.address);
|
|
||||||
},
|
},
|
||||||
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||||
onReady() {
|
onReady() {
|
||||||
// this.$refs.uForm.setRules(this.rules);
|
this.$refs.uForm.setRules(this.rules);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
wx.exitMiniProgram({
|
wx.exitMiniProgram({
|
||||||
@ -285,65 +359,55 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 注册
|
//选择出生日期
|
||||||
|
timechange(e) {
|
||||||
|
this.form.birthDate = e.year + '-' + e.month + '-' + e.day
|
||||||
|
},
|
||||||
|
// 添加
|
||||||
register() {
|
register() {
|
||||||
const _this = this
|
const _this = this
|
||||||
this.$refs.uForm.validate().then(res => {
|
_this.userinfo = uni.getStorageSync('userinfo');
|
||||||
if (this.form.gender == '男') {
|
_this.form.openid = uni.getStorageSync('openid');
|
||||||
this.form.gender = '1'
|
_this.form.cityCode=_this.userinfo.cityCode
|
||||||
} else {
|
console.log(_this.form, '000')
|
||||||
this.form.gender = '2'
|
if (_this.form.sexname == '男') {
|
||||||
}
|
_this.form.sex = 'MALE';
|
||||||
if (this.form.gender) {
|
} else if (_this.form.sexname == '女') {
|
||||||
bindFamilyUser(_this.form).then(res => {
|
_this.form.sex = 'FEMALE';
|
||||||
if (res.data.code == '0') {
|
}
|
||||||
uni.showModal({
|
if (_this.form.sex == "") {
|
||||||
title: '提示',
|
_this.$refs.uToast.show({
|
||||||
content: res.data.msg,
|
title: '请选择性别',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_this.$refs.uForm.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
registerdata(_this.form).then(res => {
|
||||||
|
if (res.code == 500) {
|
||||||
|
_this.$refs.uToast.show({
|
||||||
|
title: res.data.msg,
|
||||||
|
type: 'error'
|
||||||
})
|
})
|
||||||
}
|
}else{
|
||||||
if (res.header.Authorization) {
|
_this.$refs.uToast.show({
|
||||||
uni.setStorageSync('token', res.header.Authorization)
|
title: '添加成功',
|
||||||
}
|
type: 'success'
|
||||||
if (res.data.msg == '请求成功') {
|
})
|
||||||
if (_this.mode == '注册') {
|
uni.navigateBack({
|
||||||
uni.setStorageSync('userInfo', res.data.data)
|
delta: 1
|
||||||
uni.showToast({
|
})
|
||||||
title: '注册成功',
|
// this.back()
|
||||||
duration: 1000
|
|
||||||
});
|
|
||||||
setTimeout(function() {
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/user/user'
|
|
||||||
})
|
|
||||||
}, 1000);
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '添加成功',
|
|
||||||
duration: 1000
|
|
||||||
});
|
|
||||||
setTimeout(function() {
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1
|
|
||||||
})
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "校验失败"
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}).catch(errors => {
|
|
||||||
uni.showToast({
|
});
|
||||||
title: "校验失败"
|
|
||||||
})
|
|
||||||
})
|
|
||||||
if (this.ifSex == '') {
|
|
||||||
this.ifSex = true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
@ -352,138 +416,24 @@
|
|||||||
},
|
},
|
||||||
changeGender(e) {
|
changeGender(e) {
|
||||||
if (e == '男') {
|
if (e == '男') {
|
||||||
this.form.gender = '1'
|
this.form.sex = 'MALE';
|
||||||
} else {
|
} else if (e == '女') {
|
||||||
this.form.gender = '2'
|
this.form.sex = 'FEMALE';
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
// 民族
|
||||||
nationSelect(e) {
|
nationSelect(e) {
|
||||||
this.form.nation = e.name
|
this.form.nation = e[0].value
|
||||||
this.$refs.uForm.validateField('nation')
|
this.nation = e[0].label
|
||||||
},
|
|
||||||
//点击出生日期按钮 获取当前时间戳 赋值data的newTime newTime传入 最大限制时间
|
|
||||||
getAtTime() {
|
|
||||||
const atNewdate = new Date().getTime();
|
|
||||||
this.newTime = atNewdate
|
|
||||||
},
|
|
||||||
//身份证 自动截取渲染出生日期
|
|
||||||
inputBlur(e) {
|
|
||||||
this.$refs.uForm.validateField('identity', (errorsRes) => {
|
|
||||||
if (errorsRes == '') {
|
|
||||||
const cutIdYear = e.substr(6, 4) //截取年
|
|
||||||
const cutIdMonth = e.substr(10, 2) //截取月
|
|
||||||
const cutIdDay = e.substr(12, 2) //截取日
|
|
||||||
const newCutId = cutIdYear + "-" + cutIdMonth + "-" + cutIdDay //拼接年月日 xxxx-xx-xx
|
|
||||||
this.form.birthday = newCutId
|
|
||||||
this.$refs.uForm.validateField('birthday') //单独校验 修复不实时校验的bug
|
|
||||||
// 渲染性别
|
|
||||||
let mySex = e.substr(16, 1)
|
|
||||||
console.log(mySex)
|
|
||||||
if (parseInt(mySex) % 2 === 1) {
|
|
||||||
this.form.gender = this.radiolist[0].name;
|
|
||||||
} else {
|
|
||||||
this.form.gender = this.radiolist[1].name;
|
|
||||||
}
|
|
||||||
console.log(mySex);
|
|
||||||
} else {
|
|
||||||
this.form.birthday = ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//出生日期确定按钮
|
|
||||||
confirm(e) {
|
|
||||||
this.showBirthday = false //隐藏弹出层
|
|
||||||
const timeFormat = uni.$u.timeFormat //时间戳 → 年月日
|
|
||||||
const newDate = timeFormat(e.value, 'yyyy-mm-dd') //年月日格式
|
|
||||||
this.form.birthday = newDate //赋值
|
|
||||||
this.$refs.uForm.validateField('birthday') //单独校验
|
|
||||||
},
|
|
||||||
//出生日期取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.showBirthday = false //隐藏弹出层
|
|
||||||
this.$refs.uForm.validateField('birthday') //单独校验
|
|
||||||
},
|
|
||||||
gxcancel() {
|
|
||||||
this.showRelationshipWithHouseholder = false
|
|
||||||
this.$refs.uForm.validateField('relationshipWithHouseholder')
|
|
||||||
},
|
|
||||||
gxconfirm(e) {
|
|
||||||
this.relationshipWithHouseholder = e.value[0]
|
|
||||||
this.form.relationshipWithHouseholder = this.dictList.find(item => item.dictLabel == e.value[0]).dictValue
|
|
||||||
this.showRelationshipWithHouseholder = false
|
|
||||||
this.$refs.uForm.validateField('relationshipWithHouseholder')
|
|
||||||
},
|
|
||||||
//校验性别按钮
|
|
||||||
radioChange(e) {
|
|
||||||
this.ifSex = e
|
|
||||||
// if(e == '男') {
|
|
||||||
// this.form.gender = '1'
|
|
||||||
// } else {
|
|
||||||
// this.form.gender = '2'
|
|
||||||
// }
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
// 与户主关系
|
||||||
|
relationshipSelect(e) {
|
||||||
|
this.form.householdRelationship = e[0].value
|
||||||
|
this.householdRelationship = e[0].label
|
||||||
|
|
||||||
//获取当前位置
|
|
||||||
getAddress() {
|
|
||||||
//vm === vue实例对象
|
|
||||||
let vm = this;
|
|
||||||
uni.getLocation({
|
|
||||||
type: 'wgs84',
|
|
||||||
//成功
|
|
||||||
success: (res) => {
|
|
||||||
// console.log(res);
|
|
||||||
vm.addInfo.latitude = res.latitude
|
|
||||||
vm.addInfo.longitude = res.longitude
|
|
||||||
//vm.getLocal Vue实例对象的方法
|
|
||||||
vm.getLocal(vm.addInfo.latitude, vm.addInfo.longitude)
|
|
||||||
},
|
|
||||||
//失败
|
|
||||||
fail: (res) => {
|
|
||||||
// console.log('fail' + JSON.stringify(res))
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '获取地址失败,请打开定位',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
getLocal(latitude, longitude) {
|
|
||||||
let vm = this
|
|
||||||
//调用qqmap里面的 reverseGeocoder 方法
|
|
||||||
vm.qqmapsdk.reverseGeocoder({
|
|
||||||
location: {
|
|
||||||
latitude: latitude,
|
|
||||||
longitude: longitude
|
|
||||||
},
|
|
||||||
success: (res) => {
|
|
||||||
// vm.address = res.result.ad_info.city
|
|
||||||
|
|
||||||
// uni.setStorageSync('location', res.result.ad_info.city)
|
|
||||||
// if (res.result.ad_info.city == '德州市') {
|
|
||||||
// this.form.bindingCity = '1'
|
|
||||||
// } else if (res.result.ad_info.city == '东营市') {
|
|
||||||
// this.form.bindingCity = '2'
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
fail: (res) => {
|
|
||||||
// console.log(res)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// goLocation() {
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url: '/pages/location/location'
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
//赋值定位
|
|
||||||
// FunConfirm(e) {
|
|
||||||
// console.log(e);
|
|
||||||
// this.isShow = false
|
|
||||||
// this.address = e.value[1]
|
|
||||||
// },
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -502,6 +452,7 @@
|
|||||||
border-radius: 5rpx;
|
border-radius: 5rpx;
|
||||||
margin: 15rpx auto;
|
margin: 15rpx auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
::v-deep .u-input {
|
::v-deep .u-input {
|
||||||
width: 630rpx;
|
width: 630rpx;
|
||||||
height: 63rpx;
|
height: 63rpx;
|
||||||
@ -509,10 +460,9 @@
|
|||||||
color: #8E8E8E;
|
color: #8E8E8E;
|
||||||
// border: 1rpx solid red;
|
// border: 1rpx solid red;
|
||||||
// margin: 12rpx auto;
|
// margin: 12rpx auto;
|
||||||
border: none;
|
border: none !important;
|
||||||
border-radius: 5rpx;
|
border-radius: 5rpx;
|
||||||
|
|
||||||
|
|
||||||
.u-input__input {
|
.u-input__input {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-family: Source Han Sans CN;
|
font-family: Source Han Sans CN;
|
||||||
@ -523,6 +473,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.u-form-item{
|
||||||
|
padding: 0 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.text_title {
|
.text_title {
|
||||||
// width: 358rpx;
|
// width: 358rpx;
|
||||||
@ -548,8 +501,8 @@
|
|||||||
border-radius: 2rpx;
|
border-radius: 2rpx;
|
||||||
|
|
||||||
.text_con_pic {
|
.text_con_pic {
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
margin-left: 9rpx;
|
margin-left: 9rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 14rpx;
|
width: 14rpx;
|
||||||
@ -608,9 +561,9 @@
|
|||||||
|
|
||||||
.idScan {
|
.idScan {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 87rpx;
|
top: 75rpx;
|
||||||
right: 60rpx;
|
right: 60rpx;
|
||||||
transform: translate(0%, -40%);
|
// transform: translate(0%, -40%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sex {
|
.sex {
|
||||||
@ -664,7 +617,7 @@
|
|||||||
// color: #8E8E8E !important;
|
// color: #8E8E8E !important;
|
||||||
// font-size: 20rpx !important;
|
// font-size: 20rpx !important;
|
||||||
// }
|
// }
|
||||||
::v-deep .uni-input-input{
|
::v-deep .uni-input-input {
|
||||||
padding-left: 20rpx !important;
|
padding-left: 20rpx !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -677,6 +630,14 @@
|
|||||||
border-radius: 5rpx;
|
border-radius: 5rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
.testitem {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-family: Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #000000;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
text {
|
text {
|
||||||
padding-left: 20rpx;
|
padding-left: 20rpx;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user