微信小程序,手机号校验

This commit is contained in:
Teng 2025-10-29 17:28:17 +08:00
parent 2294266983
commit 64fbf91182
32 changed files with 786 additions and 216 deletions

View File

@ -232,7 +232,8 @@
}
function isValid11DigitNumber(val) {
return /^(\d{11})$/.test(val);
// return /^(\d{11})$/.test(val);
return /^1[3-9]\d{9}$/.test(val);
}
const ukey = ref(
`${uni.getStorageSync('openid') || ''}jgbg${String(Date.now()).slice(-5)}${String(Math.floor(Math.random() * 900) + 100)}`
@ -333,7 +334,7 @@
} else {
uni.showToast({
title: res.result == '未做变更'? `当前无变更,无需提交` : res.message,
title: res.result == '未做变更' ? `当前无变更,无需提交` : res.message,
icon: 'none'
})
}
@ -474,6 +475,7 @@
form.orgLeaderPhone = data.orgLeaderPhone;
form.orgPropertyType = data.orgPropertyType;
form.orgBuildingArea = data.orgBuildingArea;
console.log("111",form)
} else if (uni.getStorageSync('baddata')) {
let data = uni.getStorageSync('baddata');
if (data.orgProvince_dictText) {
@ -488,6 +490,10 @@
form.orgLeaderPhone = data.orgLeaderPhone;
form.orgPropertyType = data.orgPropertyType;
form.orgBuildingArea = data.orgBuildingArea;
console.log("222",form)
}else{
form.orgLeaderPhone = uni.getStorageSync('tel');
}
})
</script>

View File

@ -19,12 +19,28 @@
<view class="shu"></view>
<view class="content-weight">监护人基本信息</view>
</view>
<view class="white-photo" @click="selectphoto()">
<view class="photo-left">
<view class="photo-weight">监护人人像面</view>
<view class="photo-font">请上传身份证人像面</view>
</view>
<view style="position: relative;">
<image class="photo"
:src="specialImge ? `${media_base_url}${specialImge}` : `https://www.focusnu.com/media/directive/index/IDfront.png`" />
<image style="width: 100%;height: 100%;top: 0;left: 0;z-index: 1;position: absolute;"
:src="specialImge ? `` : `https://www.focusnu.com/media/directive/index/bian.png`" />
<image v-if="!specialImge"
style="position: absolute;top: 50%;left: 50%;width: 70rpx;height: 60rpx;transform: translate(-50%,-50%);"
src="https://www.focusnu.com/media/directive/index/takephoto.png" />
</view>
</view>
<view class="white-message">
<view>
<view class="one">
<!-- <view class="one">
<view class="one-left">与长者关系</view>
<input class="one-right" maxlength="10" placeholder="请输入与长者关系" v-model="form.relationship" />
</view>
</view> -->
<view class="one">
<view class="one-left">姓名</view>
<input class="one-right" maxlength="5" placeholder="请输入姓名" v-model="form.name" />
@ -55,6 +71,7 @@
提交
</view>
</view>
<u-action-sheet :list="bottomlist" @click="photoclick" v-model="bottomshow"></u-action-sheet>
</div>
</template>
@ -68,7 +85,8 @@
onShow
} from '@dcloudio/uni-app';
import {
base_url
base_url,
media_base_url
} from '@/request/index.js';
import {
savePayer,
@ -78,6 +96,8 @@
getMessage
} from '@/api/loginApi.js'
const bottomshow = ref(false);
const form = reactive({
name: "",
tel: "",
@ -90,25 +110,83 @@
openId: uni.getStorageSync('openid'),
relationship: ""
})
const bottomlist = [{
text: '拍摄图片',
fontSize: 40
}, {
text: '图片预览',
fontSize: 40
}]
function isValid11DigitNumber(val) {
return /^(\d{11})$/.test(val);
// return /^(\d{11})$/.test(val);
return /^1[3-9]\d{9}$/.test(val);
}
function isValid18DigitNumber(val) {
return /^(\d{18})$/.test(val);
}
const photoclick = (element) => {
if (element) {
uni.previewImage({
urls: [specialImgeshow.value], //
current: specialImgeshow.value, // urls[0]
indicator: 'default', // H5/App 'default' 'number'
longPressActions: { // App
itemList: ['保存图片到相册'],
},
});
} else {
angetMessage()
}
}
const specialImge = ref("")
const uping = ref(true)
const selectphoto = () => {
// console.log("0000",bottomshow.value)
if (!uping.value) {
return
}
if (specialImge.value) {
bottomshow.value = true;
} else {
angetMessage()
}
}
//
function angetMessage() {
// 使 UniApp API
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: chooseRes => {
// tempImagePath.value = chooseRes.tempFilePaths[0]
//
uni.navigateTo({
url: `/compontent/public/camera?url=${chooseRes.tempFilePaths[0]}&type=0`
});
},
fail: err => {
console.error('拍照失败:', err)
}
})
}
const ukey = ref(
`${uni.getStorageSync('openid') || ''}jhbg${String(Date.now()).slice(-5)}${String(Math.floor(Math.random() * 900) + 100)}`
)
const next = () => {
if (!form.relationship) {
uni.showToast({
title: '请填写与长者关系',
icon: 'error'
})
} else if (!form.name) {
// if (!form.relationship) {
// uni.showToast({
// title: '',
// icon: 'error'
// })
// } else
if (!form.name) {
uni.showToast({
title: '请填写姓名',
icon: 'error'
@ -154,6 +232,7 @@
data.guardianHomeAddress = form.homeAddress
data.guardianWorkUnit = form.workUnit
data.relationship = form.relationship
data.guardianIdCardPositive = specialImge.value
data.modifyType = "jhr"
const urlpost = `${base_url}/api/elderInfo/updateElderInfo?ukey=${ukey.value}`;
uni.request({
@ -200,6 +279,7 @@
data.guardianHomeAddress = form.homeAddress
data.guardianWorkUnit = form.workUnit
data.relationship = form.relationship
data.guardianIdCardPositive = specialImge.value
const urlpost = `${base_url}/api/elderInfo/addElder?ukey=${ukey.value}`;
uni.request({
url: urlpost,
@ -301,7 +381,7 @@
const goBack = () => {
uni.navigateBack()
}
const specialImgeshow = ref("")
onLoad(() => {
if (uni.getStorageSync('allinfo').name) {
let data = uni.getStorageSync('allinfo');
@ -321,10 +401,90 @@
keys.forEach(key => {
form[key] = data[key] || ""
})
specialImge.value = data.guardianIdCardPositive
specialImgeshow.value = media_base_url + data.guardianIdCardPositive
console.log("????", uni.getStorageSync('allinfo'))
}
})
//
function uploadImage(filePath) {
uping.value = false;
uni.showLoading()
uni.uploadFile({
url: `${base_url}/api/ocr/idCard`, // POST
filePath,
name: 'file', //
header: {
'X-Access-Token': uni.getStorageSync('token') || '',
},
formData: {},
success: uploadRes => {
if (!JSON.parse(uploadRes.data).success) {
uni.hideLoading()
uni.showToast({
title: '识别失败',
icon: 'error',
duration: 2000
})
uping.value = true;
return
}
if (JSON.parse(JSON.parse(uploadRes.data).result.data).data.face) {
let father = JSON.parse(JSON.parse(uploadRes.data).result.data).data.face.data;
specialImgeshow.value = filePath;
form.name = father.name;
form.idCard = father.idNumber;
form.homeAddress = father.address
savephoto(filePath);
}
},
fail: err => {
uni.showToast({
title: '上传出错',
icon: 'error'
})
uni.hideLoading()
}
})
}
const savephoto = (filePath, type) => {
uni.uploadFile({
url: `${base_url}/sys/common/upload`, // POST
filePath,
name: 'file', //
header: {
'X-Access-Token': uni.getStorageSync('token') || '',
},
formData: {
biz: `temp`
},
success: uploadRes => {
specialImge.value = JSON.parse(uploadRes.data).message
uni.hideLoading()
uping.value = true;
},
fail: err => {
uni.showToast({
title: '上传出错',
icon: 'error'
})
uni.hideLoading()
}
})
}
onShow(() => {
const img = uni.getStorageSync('imgkey0')
if (img) {
uploadImage(img)
uni.removeStorageSync('imgkey0')
}
})
</script>
<style lang="scss" scoped>
@ -466,4 +626,32 @@
width: 100%;
height: 700rpx;
}
.white-photo {
width: 100%;
height: 300rpx;
border-radius: 35rpx;
background-color: #fff;
justify-content: space-around;
align-items: center;
display: flex;
.photo {
width: 300rpx;
height: 200rpx;
}
}
.photo-left {
.photo-weight {
font-size: 32rpx;
font-weight: 600;
color: #333;
}
.photo-font {
font-size: 28rpx;
margin-top: 10rpx;
color: #666;
}
}
</style>

View File

@ -31,6 +31,20 @@
修改监护人信息
</view>
</view>
<view class="white-photo" @click="getMessage(headImge0)">
<view class="photo-left">
<view class="photo-weight">监护人人像面</view>
<!-- <view class="photo-font">请上传营业执照</view> -->
</view>
<view style="position: relative;">
<image class="photo"
:src="headImge0 ? headImge0 : `https://www.focusnu.com/media/directive/index/zhizhao.png`" />
<image v-if="!headImge0"
style="position: absolute;top: 50%;left: 50%;width: 70rpx;height: 60rpx;transform: translate(-50%,-50%);"
src="https://www.focusnu.com/media/directive/index/takephoto.png" />
</view>
</view>
<view class="white-message">
<view>
<view v-for="(item,index) in nameArray" :key="index" class="one"
@ -57,7 +71,7 @@
onLoad
} from '@dcloudio/uni-app';
import {
base_url
media_base_url
} from '@/request/index.js';
import {
getrel
@ -66,11 +80,12 @@
const show = ref(false);
const content = ref("");
const headImge0 = ref("");
const statusarray = ["loading", "success", "fail"]
const nameArray = ["与长者关系", "姓名", "电话", "身份证号码", "家庭住址", "工作单位"];
const textArray = reactive(["", "", "", "", "", ""]);
const nameArray = [ "姓名", "电话", "身份证号码", "家庭住址", "工作单位"];
const textArray = reactive(["", "", "", "", ""]);
//
@ -124,12 +139,13 @@
if (data.content) {
contentred.value = data.content
}
textArray[0] = data.relationship
textArray[1] = data.guardianName;
textArray[2] = data.guardianPhone;
textArray[3] = data.guardianIdCard;
textArray[4] = data.guardianHomeAddress;
textArray[5] = data.guardianWorkUnit;
// textArray[0] = data.relationship
textArray[0] = data.guardianName;
textArray[1] = data.guardianPhone;
textArray[2] = data.guardianIdCard;
textArray[3] = data.guardianHomeAddress;
textArray[4] = data.guardianWorkUnit;
headImge0.value = `${media_base_url}${data.guardianIdCardPositive}`;
})
const changeMessage = () => {
if (alldata.value.guardianModifyStatus == '1') {

View File

@ -19,23 +19,40 @@
<view class="shu"></view>
<view class="content-weight">监护人信息</view>
</view>
<view class="white-photo" @click="selectphoto(2)">
<view class="photo-left">
<view class="photo-weight">监护人人像面</view>
<view class="photo-font">请上传身份证人像面</view>
</view>
<view style="position: relative;">
<image class="photo"
:src="specialImge ? `${media_base_url}${specialImge}` : `https://www.focusnu.com/media/directive/index/IDfront.png`" />
<image style="width: 100%;height: 100%;top: 0;left: 0;z-index: 1;position: absolute;"
:src="specialImge ? `` : `https://www.focusnu.com/media/directive/index/bian.png`" />
<image v-if="!specialImge"
style="position: absolute;top: 50%;left: 50%;width: 70rpx;height: 60rpx;transform: translate(-50%,-50%);"
src="https://www.focusnu.com/media/directive/index/takephoto.png" />
</view>
</view>
<!-- margin重叠问题 -->
<view style="height: 10rpx;"></view>
<view class="white-message">
<view>
<view class="one">
<view class="one-left">与长者关系</view>
<input class="one-right" maxlength="10" placeholder="请输入与长者关系" v-model="guanxi" />
</view>
<view class="one">
<view class="one-left">监护人姓名</view>
<input class="one-right" maxlength="5" placeholder="请输入监护人姓名" v-model="form.name" />
<input class="one-right" disabled maxlength="5" placeholder="请输入监护人姓名" v-model="form.name" />
</view>
<view class="one">
<view class="one-left">监护人电话</view>
<input class="one-right" type="number" maxlength="11" placeholder="请输入监护人电话" v-model="form.tel" />
<input class="one-right" type="number" maxlength="11" placeholder="请输入监护人电话"
v-model="form.tel" />
</view>
<view class="one">
<view class="one-left">身份证号</view>
<input class="one-right" maxlength="18" placeholder="请输入身份证号" v-model="form.idCard" />
<input class="one-right" disabled maxlength="18" placeholder="请输入身份证号" v-model="form.idCard" />
</view>
<view class="one">
<view class="one-left">家庭住址</view>
@ -196,8 +213,8 @@
const photoclick = (element) => {
if (element) {
uni.previewImage({
urls: [headImge.value, backImge.value], //
current: targetphoto.value ? backImge.value : headImge.value, // urls[0]
urls: [headImge.value, backImge.value,specialImgeshow.value], //
current: targetphoto.value ? (targetphoto.value==1?backImge.value:specialImgeshow.value) : headImge.value, // urls[0]
indicator: 'default', // H5/App 'default' 'number'
longPressActions: { // App
itemList: ['保存图片到相册'],
@ -212,16 +229,36 @@
const tempImagePath = ref('')
const targetphoto = ref(0)
const isspecial = ref(false);
const selectphoto = (number) => {
if (!uping.value) {
return
}
if (backImge.value && headImge.value) {
// specialImge
targetphoto.value = number
if (!number){
if(headImge.value){
bottomshow.value = true;
} else {
}else{
getMessage()
}
}else if(number==1){
if(backImge.value){
bottomshow.value = true;
}else{
getMessage()
}
}else if(number == 2){
if(specialImge.value){
bottomshow.value = true;
}else{
isspecial.value = true;
getMessage()
}
}
}
//
@ -242,7 +279,8 @@
}
})
}
const specialImge = ref("");
const specialImgeshow = ref("");
const headImge = ref("");
const backImge = ref("");
//
@ -286,7 +324,23 @@
uping.value = true;
return
}
if(isspecial.value || targetphoto.value == 2){
if (JSON.parse(JSON.parse(uploadRes.data).result.data).data.face) {
let father = JSON.parse(JSON.parse(uploadRes.data).result.data).data.face.data;
// textArray[0] = father.name;
// textArray[1] = father.sex;
// textArray[2] = father.idNumber;
// textArray[3] = father.ethnicity;
// textArray[4] = father.birthDate;
// textArray[5] = father.address;
specialImgeshow.value = filePath;
form.name = father.name;
form.idCard = father.idNumber;
form.homeAddress = father.address
savephoto(filePath, 2);
}
isspecial.value = false
}else{
if (JSON.parse(JSON.parse(uploadRes.data).result.data).data.face) {
let father = JSON.parse(JSON.parse(uploadRes.data).result.data).data.face.data;
textArray[0] = father.name;
@ -312,6 +366,8 @@
})
uping.value = true;
}
}
},
fail: err => {
uni.showToast({
@ -337,8 +393,10 @@
success: uploadRes => {
if (!type) {
fontphoto.value = JSON.parse(uploadRes.data).message
} else {
} else if(type==1) {
endphoto.value = JSON.parse(uploadRes.data).message
} else if(type==2){
specialImge.value = JSON.parse(uploadRes.data).message
}
uni.hideLoading()
if (JSON.parse(uploadRes.data).code == 401) {
@ -355,8 +413,10 @@
success: uploadRes => {
if (!type) {
fontphoto.value = JSON.parse(uploadRes.data).message
} else {
} else if(type==1) {
endphoto.value = JSON.parse(uploadRes.data).message
} else if(type==2){
specialImge.value = JSON.parse(uploadRes.data).message
}
uping.value = true;
},
@ -392,7 +452,8 @@
}
function isValid11DigitNumber(val) {
return /^(\d{11})$/.test(val);
// return /^(\d{11})$/.test(val);
return /^1[3-9]\d{9}$/.test(val);
}
function isValid18DigitNumber(val) {
@ -402,6 +463,13 @@
`${uni.getStorageSync('openid') || ''}lrbg${String(Date.now()).slice(-5)}${String(Math.floor(Math.random() * 900) + 100)}`
)
const next = () => {
if (!specialImge.value) {
uni.showToast({
title: '请上传监护人身份证正面',
icon: 'none'
})
return
}
if (!fontphoto.value) {
uni.showToast({
title: '请上传身份证正面',
@ -417,13 +485,14 @@
}
if (canshow.value) {
if (!guanxi.value) {
uni.showToast({
title: '请填写与长者关系',
icon: 'none'
})
return
} else if (!form.name) {
// if (!guanxi.value) {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// return
// } else
if (!form.name) {
uni.showToast({
title: '请填写监护人姓名',
icon: 'none'
@ -486,6 +555,7 @@
data.nuId = uni.getStorageSync('oldman').nuId
data.idCardPositive = fontphoto.value
data.idCardNegative = endphoto.value
data.guardianIdCardPositive = specialImge.value
data.name = textArray[0]
data.sex = textArray[1]
data.idCard = textArray[2]
@ -521,6 +591,7 @@
data.modifyType = "zz"
// console.log("?????", data)
// return
if (id.value) {
data.id = id.value
const urlpost = `${payurl.value}/api/elderInfo/updateElderInfo?ukey=${ukey.value}`;
@ -693,13 +764,14 @@
canshow.value = false;
fontphoto.value = data.idCardPositive
endphoto.value = data.idCardNegative
specialImge.value = data.guardianIdCardPositive
// console.log("???????????", fontphoto.value, endphoto.value)
textArray[0] = data.name
textArray[1] = data.sex
textArray[2] = data.idCard
textArray[3] = data.national
console.log("????", data.dateOfBirth)
// console.log("????", data.dateOfBirth)
textArray[4] = data.dateOfBirth
textArray[5] = data.houseAddress
textArray[6] = data.issuingAuthority
@ -723,6 +795,8 @@
// textArray[7] = formatRange(textArray[7])
// console.log("aaaaaaaaaaaaaaaaaa",textArray[7])
// ischange.value = true;
} else {
form.tel = uni.getStorageSync('tel')
}
})

View File

@ -33,17 +33,18 @@
</view>
</view>
<view class="white-content">
<view class="white-photo" @click="getMessage(`${media_base_url}${fontphoto}`)">
<view class="white-photo" @click="getMessage(`${media_base_url}${specialImge}`)">
<view class="photo-left">
<view class="photo-weight">人像面</view>
<view class="photo-font">请上传身份证人像面</view>
</view>
<view style="position: relative;">
<image class="photo"
:src="fontphoto ? `${media_base_url}${fontphoto}` : `https://www.focusnu.com/media/directive/index/IDcard.png`" />
<image v-if="!fontphoto"
:src="specialImge ? `${media_base_url}${specialImge}` : `https://www.focusnu.com/media/directive/index/IDcard.png`" />
<image v-if="!specialImge"
style="position: absolute;top: 50%;left: 50%;width: 70rpx;height: 60rpx;transform: translate(-50%,-50%);"
src="https://www.focusnu.com/media/directive/index/takephoto.png" />
</view>
@ -193,6 +194,7 @@
textArray[7] = `${data.startTime}-${swapLongTerm(data.endTime)}`;
fontphoto.value = data.idCardPositive
endphoto.value = data.idCardNegative
specialImge.value = data.guardianIdCardPositive
})
const changeMessage = () => {

View File

@ -34,7 +34,7 @@
<view class="white-message">
<view>
<view v-for="(item,index) in nameArray1" :key="index" class="one"
@click="openLook(textArray[index])">
@click="openLook(textArray1[index])">
<view class="one-left">{{item}}</view>
<view class="one-right">{{textArray1[index] ? textArray1[index] : "自动获取" }}</view>
</view>
@ -374,7 +374,7 @@
})
const changeMessage = () => {
console.log("????", alldata.value)
// console.log("????", alldata.value)
if (alldata.value.modifyState == '1') {
openLook("该信息正在审核中,请等待")
} else {

View File

@ -249,10 +249,18 @@
`${uni.getStorageSync('openid') || ''}ygbg${String(Date.now()).slice(-5)}${String(Math.floor(Math.random() * 900) + 100)}`
)
const next = () => {
// uni.showToast({
// title: "999999999999999999",
// icon: 'error'
// })
if (!uping.value) {
return
}
// uni.showToast({
// title: "888888888888",
// icon: 'error'
// })
let data = uni.getStorageSync('backhuancun');
data.healthZmPath = imgArray[0]
data.healthFmPath = imgArray[1]
@ -264,8 +272,22 @@
// data.endTime = swapLongTerm(data.endTime);
data.orgCode = uni.getStorageSync('changeyuangongorgCode')
// uni.showToast({
// title: "888888888888",
// icon: 'error'
// })
console.log("AAAA",data,ukey.value)
changemessage(data, ukey.value).then(res => {
console.log("BBBB",res)
// uni.showToast({
// title: res,
// // icon: 'error'
// })
// uni.showToast({
// title: res.result,
// // icon: 'error'
// })
// return
if (res.result == '重复提交') {
uni.showToast({
title: `重复提交`,

View File

@ -262,7 +262,8 @@
})
function isValid11DigitNumber(val) {
return /^(\d{11})$/.test(val);
// return /^(\d{11})$/.test(val);
return /^1[3-9]\d{9}$/.test(val);
}
const next = () => {
if (!form.maritalStatus) {
@ -327,7 +328,14 @@
title: '请填写户口性质',
icon: 'error'
})
} else {
}
else if (!form.currentAddress) {
uni.showToast({
title: '请填写现住址',
icon: 'error'
})
}
else {
const data = form
const merged2 = {
...uni.getStorageSync('backhuancun'),
@ -374,6 +382,7 @@
form.showweight = form.weight + 'kg';
} else {
uni.setStorageSync("isstaffchange", false)
form.tel = uni.getStorageSync('tel')
}
})

View File

@ -1,5 +1,5 @@
// 全局请求封装
// export const base_url = 'http://192.168.2.26:8081/opeapi'
// export const base_url = 'http://192.168.2.22:8081/opeapi'
export const base_url = 'https://www.focusnu.com/opeapi'
export const media_base_url = 'https://www.focusnu.com/media/upFiles/'

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7050,9 +7050,9 @@ function isConsoleWritable() {
return isWritable;
}
function initRuntimeSocketService() {
const hosts = "192.168.2.27,127.0.0.1";
const hosts = "127.0.0.1";
const port = "8090";
const id = "mp-weixin_s7P1yM";
const id = "mp-weixin_ZPQFk3";
const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => {
} : initOnError();

View File

@ -80,7 +80,7 @@ const _sfc_main = {
}
};
function isValid11DigitNumber(val) {
return /^(\d{11})$/.test(val);
return /^1[3-9]\d{9}$/.test(val);
}
const ukey = common_vendor.ref(
`${common_vendor.index.getStorageSync("openid") || ""}jgbg${String(Date.now()).slice(-5)}${String(Math.floor(Math.random() * 900) + 100)}`
@ -165,7 +165,7 @@ const _sfc_main = {
});
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/addjigou/where.vue:326", "订阅接口调用失败:", err);
common_vendor.index.__f__("error", "at pages/addjigou/where.vue:327", "订阅接口调用失败:", err);
common_vendor.index.showToast({
title: "订阅失败",
icon: "none"
@ -235,7 +235,7 @@ const _sfc_main = {
common_vendor.onShow(() => {
const data = common_vendor.index.getStorageSync("dingwei");
if (data) {
common_vendor.index.__f__("log", "at pages/addjigou/where.vue:410", "data", data);
common_vendor.index.__f__("log", "at pages/addjigou/where.vue:411", "data", data);
jigouweizhi.value = data.name;
form.orgAddress = data.name;
form.orgCoordinateLo = data.lng;
@ -291,6 +291,7 @@ const _sfc_main = {
form.orgLeaderPhone = data.orgLeaderPhone;
form.orgPropertyType = data.orgPropertyType;
form.orgBuildingArea = data.orgBuildingArea;
common_vendor.index.__f__("log", "at pages/addjigou/where.vue:478", "111", form);
} else if (common_vendor.index.getStorageSync("baddata")) {
let data = common_vendor.index.getStorageSync("baddata");
if (data.orgProvince_dictText) {
@ -304,6 +305,9 @@ const _sfc_main = {
form.orgLeaderPhone = data.orgLeaderPhone;
form.orgPropertyType = data.orgPropertyType;
form.orgBuildingArea = data.orgBuildingArea;
common_vendor.index.__f__("log", "at pages/addjigou/where.vue:493", "222", form);
} else {
form.orgLeaderPhone = common_vendor.index.getStorageSync("tel");
}
});
return (_ctx, _cache) => {

View File

@ -2,9 +2,18 @@
const common_vendor = require("../../common/vendor.js");
const request_index = require("../../request/index.js");
const api_loginApi = require("../../api/loginApi.js");
if (!Array) {
const _easycom_u_action_sheet2 = common_vendor.resolveComponent("u-action-sheet");
_easycom_u_action_sheet2();
}
const _easycom_u_action_sheet = () => "../../uni_modules/vk-uview-ui/components/u-action-sheet/u-action-sheet.js";
if (!Math) {
_easycom_u_action_sheet();
}
const _sfc_main = {
__name: "IDcard",
setup(__props) {
const bottomshow = common_vendor.ref(false);
const form = common_vendor.reactive({
name: "",
tel: "",
@ -17,22 +26,68 @@ const _sfc_main = {
openId: common_vendor.index.getStorageSync("openid"),
relationship: ""
});
const bottomlist = [{
text: "拍摄图片",
fontSize: 40
}, {
text: "图片预览",
fontSize: 40
}];
function isValid11DigitNumber(val) {
return /^(\d{11})$/.test(val);
return /^1[3-9]\d{9}$/.test(val);
}
function isValid18DigitNumber(val) {
return /^(\d{18})$/.test(val);
}
const photoclick = (element) => {
if (element) {
common_vendor.index.previewImage({
urls: [specialImgeshow.value],
// 必填,所有要预览的图片地址数组
current: specialImgeshow.value,
// 可选,当前显示图片的地址,默认是 urls[0]
indicator: "default",
// 可选指示器样式H5/App 有效,值为 'default'(圆点)或 'number'(数字)
longPressActions: {
// 可选,仅 App 支持,长按图片时弹出的操作项
itemList: ["保存图片到相册"]
}
});
} else {
angetMessage();
}
};
const specialImge = common_vendor.ref("");
const uping = common_vendor.ref(true);
const selectphoto = () => {
if (!uping.value) {
return;
}
if (specialImge.value) {
bottomshow.value = true;
} else {
angetMessage();
}
};
function angetMessage() {
common_vendor.index.chooseImage({
count: 1,
sourceType: ["album", "camera"],
success: (chooseRes) => {
common_vendor.index.navigateTo({
url: `/compontent/public/camera?url=${chooseRes.tempFilePaths[0]}&type=0`
});
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/addoldman/IDcard.vue:174", "拍照失败:", err);
}
});
}
const ukey = common_vendor.ref(
`${common_vendor.index.getStorageSync("openid") || ""}jhbg${String(Date.now()).slice(-5)}${String(Math.floor(Math.random() * 900) + 100)}`
);
const next = () => {
if (!form.relationship) {
common_vendor.index.showToast({
title: "请填写与长者关系",
icon: "error"
});
} else if (!form.name) {
if (!form.name) {
common_vendor.index.showToast({
title: "请填写姓名",
icon: "error"
@ -78,6 +133,7 @@ const _sfc_main = {
data.guardianHomeAddress = form.homeAddress;
data.guardianWorkUnit = form.workUnit;
data.relationship = form.relationship;
data.guardianIdCardPositive = specialImge.value;
data.modifyType = "jhr";
const urlpost = `${request_index.base_url}/api/elderInfo/updateElderInfo?ukey=${ukey.value}`;
common_vendor.index.request({
@ -113,7 +169,7 @@ const _sfc_main = {
}
},
fail: (e) => {
common_vendor.index.__f__("log", "at pages/addoldman/IDcard.vue:192", "????", e);
common_vendor.index.__f__("log", "at pages/addoldman/IDcard.vue:271", "????", e);
}
});
} else {
@ -124,6 +180,7 @@ const _sfc_main = {
data.guardianHomeAddress = form.homeAddress;
data.guardianWorkUnit = form.workUnit;
data.relationship = form.relationship;
data.guardianIdCardPositive = specialImge.value;
const urlpost = `${request_index.base_url}/api/elderInfo/addElder?ukey=${ukey.value}`;
common_vendor.index.request({
url: urlpost,
@ -172,6 +229,7 @@ const _sfc_main = {
const goBack = () => {
common_vendor.index.navigateBack();
};
const specialImgeshow = common_vendor.ref("");
common_vendor.onLoad(() => {
if (common_vendor.index.getStorageSync("allinfo").name) {
let data = common_vendor.index.getStorageSync("allinfo");
@ -190,28 +248,115 @@ const _sfc_main = {
keys.forEach((key) => {
form[key] = data[key] || "";
});
common_vendor.index.__f__("log", "at pages/addoldman/IDcard.vue:324", "????", common_vendor.index.getStorageSync("allinfo"));
specialImge.value = data.guardianIdCardPositive;
specialImgeshow.value = request_index.media_base_url + data.guardianIdCardPositive;
common_vendor.index.__f__("log", "at pages/addoldman/IDcard.vue:406", "????", common_vendor.index.getStorageSync("allinfo"));
}
});
function uploadImage(filePath) {
uping.value = false;
common_vendor.index.showLoading();
common_vendor.index.uploadFile({
url: `${request_index.base_url}/api/ocr/idCard`,
// 替换为您的POST接口地址
filePath,
name: "file",
// 后端接收时的字段名
header: {
"X-Access-Token": common_vendor.index.getStorageSync("token") || ""
},
formData: {},
success: (uploadRes) => {
if (!JSON.parse(uploadRes.data).success) {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: "识别失败",
icon: "error",
duration: 2e3
});
uping.value = true;
return;
}
if (JSON.parse(JSON.parse(uploadRes.data).result.data).data.face) {
let father = JSON.parse(JSON.parse(uploadRes.data).result.data).data.face.data;
specialImgeshow.value = filePath;
form.name = father.name;
form.idCard = father.idNumber;
form.homeAddress = father.address;
savephoto(filePath);
}
},
fail: (err) => {
common_vendor.index.showToast({
title: "上传出错",
icon: "error"
});
common_vendor.index.hideLoading();
}
});
}
const savephoto = (filePath, type) => {
common_vendor.index.uploadFile({
url: `${request_index.base_url}/sys/common/upload`,
// 替换为您的POST接口地址
filePath,
name: "file",
// 后端接收时的字段名
header: {
"X-Access-Token": common_vendor.index.getStorageSync("token") || ""
},
formData: {
biz: `temp`
},
success: (uploadRes) => {
specialImge.value = JSON.parse(uploadRes.data).message;
common_vendor.index.hideLoading();
uping.value = true;
},
fail: (err) => {
common_vendor.index.showToast({
title: "上传出错",
icon: "error"
});
common_vendor.index.hideLoading();
}
});
};
common_vendor.onShow(() => {
const img = common_vendor.index.getStorageSync("imgkey0");
if (img) {
uploadImage(img);
common_vendor.index.removeStorageSync("imgkey0");
}
});
return (_ctx, _cache) => {
return {
return common_vendor.e({
a: common_vendor.o(goBack),
b: `${common_vendor.index.getStorageSync("moveHeight") + 40}px`,
c: `${common_vendor.index.getStorageSync("moveHeight") + 40}px`,
d: form.relationship,
e: common_vendor.o(($event) => form.relationship = $event.detail.value),
f: form.name,
g: common_vendor.o(($event) => form.name = $event.detail.value),
h: form.tel,
i: common_vendor.o(($event) => form.tel = $event.detail.value),
j: form.idCard,
k: common_vendor.o(($event) => form.idCard = $event.detail.value),
l: form.homeAddress,
m: common_vendor.o(($event) => form.homeAddress = $event.detail.value),
n: form.workUnit,
o: common_vendor.o(($event) => form.workUnit = $event.detail.value),
p: common_vendor.o(next)
};
d: specialImge.value ? `${common_vendor.unref(request_index.media_base_url)}${specialImge.value}` : `https://www.focusnu.com/media/directive/index/IDfront.png`,
e: specialImge.value ? `` : `https://www.focusnu.com/media/directive/index/bian.png`,
f: !specialImge.value
}, !specialImge.value ? {} : {}, {
g: common_vendor.o(($event) => selectphoto()),
h: form.name,
i: common_vendor.o(($event) => form.name = $event.detail.value),
j: form.tel,
k: common_vendor.o(($event) => form.tel = $event.detail.value),
l: form.idCard,
m: common_vendor.o(($event) => form.idCard = $event.detail.value),
n: form.homeAddress,
o: common_vendor.o(($event) => form.homeAddress = $event.detail.value),
p: form.workUnit,
q: common_vendor.o(($event) => form.workUnit = $event.detail.value),
r: common_vendor.o(next),
s: common_vendor.o(photoclick),
t: common_vendor.o(($event) => bottomshow.value = $event),
v: common_vendor.p({
list: bottomlist,
modelValue: bottomshow.value
})
});
};
}
};

View File

@ -1,4 +1,6 @@
{
"navigationBarTitleText": "长者信息采集",
"usingComponents": {}
"usingComponents": {
"u-action-sheet": "../../uni_modules/vk-uview-ui/components/u-action-sheet/u-action-sheet"
}
}

View File

@ -1 +1 @@
<view class="container data-v-5fcb8e22"><image class="greenbgc data-v-5fcb8e22" src="https://www.focusnu.com/media/directive/index/greenbgc.png"/><view class="title-back data-v-5fcb8e22" style="{{'height:' + b}}"><view class="left-father data-v-5fcb8e22" bindtap="{{a}}"><image class="back-img data-v-5fcb8e22" src="https://www.focusnu.com/media/directive/index/left.png"/><view class="data-v-5fcb8e22" style="font-size:30rpx">监护人信息</view></view></view><view class="data-v-5fcb8e22" style="{{'height:' + c}}"></view><view class="white-content data-v-5fcb8e22"><view class="content-title data-v-5fcb8e22"><view class="shu data-v-5fcb8e22"></view><view class="content-weight data-v-5fcb8e22">监护人基本信息</view></view><view class="white-message data-v-5fcb8e22"><view class="data-v-5fcb8e22"><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">与长者关系</view><input class="one-right data-v-5fcb8e22" maxlength="10" placeholder="请输入与长者关系" value="{{d}}" bindinput="{{e}}"/></view><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">姓名</view><input class="one-right data-v-5fcb8e22" maxlength="5" placeholder="请输入姓名" value="{{f}}" bindinput="{{g}}"/></view><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">电话</view><input class="one-right data-v-5fcb8e22" type="number" maxlength="11" placeholder="请输入电话" value="{{h}}" bindinput="{{i}}"/></view><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">身份证号</view><input class="one-right data-v-5fcb8e22" type="number" maxlength="18" placeholder="请输入身份证号" value="{{j}}" bindinput="{{k}}"/></view><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">家庭住址</view><input class="one-right data-v-5fcb8e22" maxlength="30" placeholder="请输入家庭住址" value="{{l}}" bindinput="{{m}}"/></view><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">工作单位</view><input class="one-right data-v-5fcb8e22" maxlength="40" placeholder="请输入工作单位" value="{{n}}" bindinput="{{o}}"/></view></view></view></view><view class="data-v-5fcb8e22" style="display:flex;width:100%;position:fixed;bottom:20rpx;left:0"><view class="finish-button data-v-5fcb8e22" bindtap="{{p}}"> 提交 </view></view></view>
<view class="container data-v-5fcb8e22"><image class="greenbgc data-v-5fcb8e22" src="https://www.focusnu.com/media/directive/index/greenbgc.png"/><view class="title-back data-v-5fcb8e22" style="{{'height:' + b}}"><view class="left-father data-v-5fcb8e22" bindtap="{{a}}"><image class="back-img data-v-5fcb8e22" src="https://www.focusnu.com/media/directive/index/left.png"/><view class="data-v-5fcb8e22" style="font-size:30rpx">监护人信息</view></view></view><view class="data-v-5fcb8e22" style="{{'height:' + c}}"></view><view class="white-content data-v-5fcb8e22"><view class="content-title data-v-5fcb8e22"><view class="shu data-v-5fcb8e22"></view><view class="content-weight data-v-5fcb8e22">监护人基本信息</view></view><view class="white-photo data-v-5fcb8e22" bindtap="{{g}}"><view class="photo-left data-v-5fcb8e22"><view class="photo-weight data-v-5fcb8e22">监护人人像面</view><view class="photo-font data-v-5fcb8e22">请上传身份证人像面</view></view><view class="data-v-5fcb8e22" style="position:relative"><image class="photo data-v-5fcb8e22" src="{{d}}"/><image class="data-v-5fcb8e22" style="width:100%;height:100%;top:0;left:0;z-index:1;position:absolute" src="{{e}}"/><image wx:if="{{f}}" class="data-v-5fcb8e22" style="position:absolute;top:50%;left:50%;width:70rpx;height:60rpx;transform:translate(-50%,-50%)" src="https://www.focusnu.com/media/directive/index/takephoto.png"/></view></view><view class="white-message data-v-5fcb8e22"><view class="data-v-5fcb8e22"><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">姓名</view><input class="one-right data-v-5fcb8e22" maxlength="5" placeholder="请输入姓名" value="{{h}}" bindinput="{{i}}"/></view><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">电话</view><input class="one-right data-v-5fcb8e22" type="number" maxlength="11" placeholder="请输入电话" value="{{j}}" bindinput="{{k}}"/></view><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">身份证号</view><input class="one-right data-v-5fcb8e22" type="number" maxlength="18" placeholder="请输入身份证号" value="{{l}}" bindinput="{{m}}"/></view><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">家庭住址</view><input class="one-right data-v-5fcb8e22" maxlength="30" placeholder="请输入家庭住址" value="{{n}}" bindinput="{{o}}"/></view><view class="one data-v-5fcb8e22"><view class="one-left data-v-5fcb8e22">工作单位</view><input class="one-right data-v-5fcb8e22" maxlength="40" placeholder="请输入工作单位" value="{{p}}" bindinput="{{q}}"/></view></view></view></view><view class="data-v-5fcb8e22" style="display:flex;width:100%;position:fixed;bottom:20rpx;left:0"><view class="finish-button data-v-5fcb8e22" bindtap="{{r}}"> 提交 </view></view><u-action-sheet wx:if="{{v}}" class="data-v-5fcb8e22" bindclick="{{s}}" u-i="5fcb8e22-0" bind:__l="__l" bindupdateModelValue="{{t}}" u-p="{{v}}"></u-action-sheet></view>

View File

@ -144,3 +144,26 @@
width: 100%;
height: 700rpx;
}
.white-photo.data-v-5fcb8e22 {
width: 100%;
height: 300rpx;
border-radius: 35rpx;
background-color: #fff;
justify-content: space-around;
align-items: center;
display: flex;
}
.white-photo .photo.data-v-5fcb8e22 {
width: 300rpx;
height: 200rpx;
}
.photo-left .photo-weight.data-v-5fcb8e22 {
font-size: 32rpx;
font-weight: 600;
color: #333;
}
.photo-left .photo-font.data-v-5fcb8e22 {
font-size: 28rpx;
margin-top: 10rpx;
color: #666;
}

View File

@ -1,5 +1,6 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_index = require("../../request/index.js");
if (!Math) {
model();
}
@ -9,10 +10,35 @@ const _sfc_main = {
setup(__props) {
const show = common_vendor.ref(false);
const content = common_vendor.ref("");
const headImge0 = common_vendor.ref("");
const statusarray = ["loading", "success", "fail"];
const nameArray = ["与长者关系", "姓名", "电话", "身份证号码", "家庭住址", "工作单位"];
const textArray = common_vendor.reactive(["", "", "", "", "", ""]);
const nameArray = ["姓名", "电话", "身份证号码", "家庭住址", "工作单位"];
const textArray = common_vendor.reactive(["", "", "", "", ""]);
common_vendor.ref("");
function getMessage(url) {
if (!url) {
return;
}
common_vendor.index.previewImage({
current: url,
// 当前显示图片的链接
urls: [url],
// 可以预览的图片列表
indicator: "default",
// 显示面板指示点,'default'|'number'|'none'
loop: true,
// 是否可循环预览
longPressActions: {
itemList: ["保存图片"],
success: (data) => {
common_vendor.index.__f__("log", "at pages/addoldman/jianhurenall.vue:107", "长按操作成功", data);
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/addoldman/jianhurenall.vue:110", "长按操作失败", err);
}
}
});
}
function isAtLeastEightChars(str) {
return typeof str === "string" && str.length >= 12;
}
@ -37,12 +63,12 @@ const _sfc_main = {
if (data.content) {
contentred.value = data.content;
}
textArray[0] = data.relationship;
textArray[1] = data.guardianName;
textArray[2] = data.guardianPhone;
textArray[3] = data.guardianIdCard;
textArray[4] = data.guardianHomeAddress;
textArray[5] = data.guardianWorkUnit;
textArray[0] = data.guardianName;
textArray[1] = data.guardianPhone;
textArray[2] = data.guardianIdCard;
textArray[3] = data.guardianHomeAddress;
textArray[4] = data.guardianWorkUnit;
headImge0.value = `${request_index.media_base_url}${data.guardianIdCardPositive}`;
});
const changeMessage = () => {
if (alldata.value.guardianModifyStatus == "1") {
@ -76,7 +102,11 @@ const _sfc_main = {
}, !applyStatus.value ? {
h: common_vendor.o(changeMessage)
} : {}, {
i: common_vendor.f(nameArray, (item, index, i0) => {
i: headImge0.value ? headImge0.value : `https://www.focusnu.com/media/directive/index/zhizhao.png`,
j: !headImge0.value
}, !headImge0.value ? {} : {}, {
k: common_vendor.o(($event) => getMessage(headImge0.value)),
l: common_vendor.f(nameArray, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: common_vendor.t(textArray[index] ? textArray[index] : "自动获取"),

View File

@ -1 +1 @@
<view class="container data-v-b2e00674"><model wx:if="{{b}}" class="data-v-b2e00674" bindclose="{{a}}" u-i="b2e00674-0" bind:__l="__l" u-p="{{b}}"/><image class="greenbgc data-v-b2e00674" src="https://www.focusnu.com/media/directive/index/greenbgc.png"/><view class="title-back data-v-b2e00674" style="{{'height:' + d}}"><view class="left-father data-v-b2e00674" bindtap="{{c}}"><image class="back-img data-v-b2e00674" src="https://www.focusnu.com/media/directive/index/left.png"/><view class="data-v-b2e00674" style="font-size:30rpx">监护人信息</view></view></view><view class="data-v-b2e00674" style="{{'height:' + e}}"></view><view class="white-content data-v-b2e00674"><view class="content-title data-v-b2e00674" style="margin:20rpx 0;justify-content:space-between"><view class="data-v-b2e00674" style="display:flex"><view class="shu data-v-b2e00674"></view><view class="content-weight data-v-b2e00674" style="margin-top:-2rpx">监护人基本信息</view><image class="shu-img data-v-b2e00674" src="{{f}}"/></view><view wx:if="{{g}}" class="small-blue data-v-b2e00674" bindtap="{{h}}"> 修改监护人信息 </view></view><view class="white-message data-v-b2e00674"><view class="data-v-b2e00674"><view wx:for="{{i}}" wx:for-item="item" wx:key="c" class="one data-v-b2e00674" bindtap="{{item.d}}"><view class="one-left data-v-b2e00674">{{item.a}}</view><view class="one-right data-v-b2e00674">{{item.b}}</view></view></view></view></view><view class="data-v-b2e00674" style="display:flex;width:100%;margin-top:40rpx"></view></view>
<view class="container data-v-b2e00674"><model wx:if="{{b}}" class="data-v-b2e00674" bindclose="{{a}}" u-i="b2e00674-0" bind:__l="__l" u-p="{{b}}"/><image class="greenbgc data-v-b2e00674" src="https://www.focusnu.com/media/directive/index/greenbgc.png"/><view class="title-back data-v-b2e00674" style="{{'height:' + d}}"><view class="left-father data-v-b2e00674" bindtap="{{c}}"><image class="back-img data-v-b2e00674" src="https://www.focusnu.com/media/directive/index/left.png"/><view class="data-v-b2e00674" style="font-size:30rpx">监护人信息</view></view></view><view class="data-v-b2e00674" style="{{'height:' + e}}"></view><view class="white-content data-v-b2e00674"><view class="content-title data-v-b2e00674" style="margin:20rpx 0;justify-content:space-between"><view class="data-v-b2e00674" style="display:flex"><view class="shu data-v-b2e00674"></view><view class="content-weight data-v-b2e00674" style="margin-top:-2rpx">监护人基本信息</view><image class="shu-img data-v-b2e00674" src="{{f}}"/></view><view wx:if="{{g}}" class="small-blue data-v-b2e00674" bindtap="{{h}}"> 修改监护人信息 </view></view><view class="white-photo data-v-b2e00674" bindtap="{{k}}"><view class="photo-left data-v-b2e00674"><view class="photo-weight data-v-b2e00674">监护人人像面</view></view><view class="data-v-b2e00674" style="position:relative"><image class="photo data-v-b2e00674" src="{{i}}"/><image wx:if="{{j}}" class="data-v-b2e00674" style="position:absolute;top:50%;left:50%;width:70rpx;height:60rpx;transform:translate(-50%,-50%)" src="https://www.focusnu.com/media/directive/index/takephoto.png"/></view></view><view class="white-message data-v-b2e00674"><view class="data-v-b2e00674"><view wx:for="{{l}}" wx:for-item="item" wx:key="c" class="one data-v-b2e00674" bindtap="{{item.d}}"><view class="one-left data-v-b2e00674">{{item.a}}</view><view class="one-right data-v-b2e00674">{{item.b}}</view></view></view></view></view><view class="data-v-b2e00674" style="display:flex;width:100%;margin-top:40rpx"></view></view>

View File

@ -41,9 +41,9 @@ const _sfc_main = {
const photoclick = (element) => {
if (element) {
common_vendor.index.previewImage({
urls: [headImge.value, backImge.value],
urls: [headImge.value, backImge.value, specialImgeshow.value],
// 必填,所有要预览的图片地址数组
current: targetphoto.value ? backImge.value : headImge.value,
current: targetphoto.value ? targetphoto.value == 1 ? backImge.value : specialImgeshow.value : headImge.value,
// 可选,当前显示图片的地址,默认是 urls[0]
indicator: "default",
// 可选指示器样式H5/App 有效,值为 'default'(圆点)或 'number'(数字)
@ -58,16 +58,32 @@ const _sfc_main = {
};
const tempImagePath = common_vendor.ref("");
const targetphoto = common_vendor.ref(0);
const isspecial = common_vendor.ref(false);
const selectphoto = (number) => {
if (!uping.value) {
return;
}
if (backImge.value && headImge.value) {
targetphoto.value = number;
if (!number) {
if (headImge.value) {
bottomshow.value = true;
} else {
getMessage();
}
} else if (number == 1) {
if (backImge.value) {
bottomshow.value = true;
} else {
getMessage();
}
} else if (number == 2) {
if (specialImge.value) {
bottomshow.value = true;
} else {
isspecial.value = true;
getMessage();
}
}
};
function getMessage() {
common_vendor.index.chooseImage({
@ -80,10 +96,12 @@ const _sfc_main = {
});
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/addoldman/oldIDcard.vue:241", "拍照失败:", err);
common_vendor.index.__f__("error", "at pages/addoldman/oldIDcard.vue:278", "拍照失败:", err);
}
});
}
const specialImge = common_vendor.ref("");
const specialImgeshow = common_vendor.ref("");
const headImge = common_vendor.ref("");
const backImge = common_vendor.ref("");
function uploadImage(filePath) {
@ -110,6 +128,17 @@ const _sfc_main = {
uping.value = true;
return;
}
if (isspecial.value || targetphoto.value == 2) {
if (JSON.parse(JSON.parse(uploadRes.data).result.data).data.face) {
let father = JSON.parse(JSON.parse(uploadRes.data).result.data).data.face.data;
specialImgeshow.value = filePath;
form.name = father.name;
form.idCard = father.idNumber;
form.homeAddress = father.address;
savephoto(filePath, 2);
}
isspecial.value = false;
} else {
if (JSON.parse(JSON.parse(uploadRes.data).result.data).data.face) {
let father = JSON.parse(JSON.parse(uploadRes.data).result.data).data.face.data;
textArray[0] = father.name;
@ -135,6 +164,7 @@ const _sfc_main = {
});
uping.value = true;
}
}
},
fail: (err) => {
common_vendor.index.showToast({
@ -162,8 +192,10 @@ const _sfc_main = {
success: (uploadRes) => {
if (!type) {
fontphoto.value = JSON.parse(uploadRes.data).message;
} else {
} else if (type == 1) {
endphoto.value = JSON.parse(uploadRes.data).message;
} else if (type == 2) {
specialImge.value = JSON.parse(uploadRes.data).message;
}
common_vendor.index.hideLoading();
if (JSON.parse(uploadRes.data).code == 401) {
@ -182,8 +214,10 @@ const _sfc_main = {
success: (uploadRes2) => {
if (!type) {
fontphoto.value = JSON.parse(uploadRes2.data).message;
} else {
} else if (type == 1) {
endphoto.value = JSON.parse(uploadRes2.data).message;
} else if (type == 2) {
specialImge.value = JSON.parse(uploadRes2.data).message;
}
uping.value = true;
},
@ -217,7 +251,7 @@ const _sfc_main = {
}
};
function isValid11DigitNumber(val) {
return /^(\d{11})$/.test(val);
return /^1[3-9]\d{9}$/.test(val);
}
function isValid18DigitNumber(val) {
return /^(\d{18})$/.test(val);
@ -226,6 +260,13 @@ const _sfc_main = {
`${common_vendor.index.getStorageSync("openid") || ""}lrbg${String(Date.now()).slice(-5)}${String(Math.floor(Math.random() * 900) + 100)}`
);
const next = () => {
if (!specialImge.value) {
common_vendor.index.showToast({
title: "请上传监护人身份证正面",
icon: "none"
});
return;
}
if (!fontphoto.value) {
common_vendor.index.showToast({
title: "请上传身份证正面",
@ -240,13 +281,7 @@ const _sfc_main = {
return;
}
if (canshow.value) {
if (!guanxi.value) {
common_vendor.index.showToast({
title: "请填写与长者关系",
icon: "none"
});
return;
} else if (!form.name) {
if (!form.name) {
common_vendor.index.showToast({
title: "请填写监护人姓名",
icon: "none"
@ -304,6 +339,7 @@ const _sfc_main = {
data.nuId = common_vendor.index.getStorageSync("oldman").nuId;
data.idCardPositive = fontphoto.value;
data.idCardNegative = endphoto.value;
data.guardianIdCardPositive = specialImge.value;
data.name = textArray[0];
data.sex = textArray[1];
data.idCard = textArray[2];
@ -358,7 +394,7 @@ const _sfc_main = {
});
},
fail: (e) => {
common_vendor.index.__f__("log", "at pages/addoldman/oldIDcard.vue:559", "????", e);
common_vendor.index.__f__("log", "at pages/addoldman/oldIDcard.vue:630", "????", e);
}
});
} else {
@ -437,11 +473,11 @@ const _sfc_main = {
canshow.value = false;
fontphoto.value = data.idCardPositive;
endphoto.value = data.idCardNegative;
specialImge.value = data.guardianIdCardPositive;
textArray[0] = data.name;
textArray[1] = data.sex;
textArray[2] = data.idCard;
textArray[3] = data.national;
common_vendor.index.__f__("log", "at pages/addoldman/oldIDcard.vue:702", "????", data.dateOfBirth);
textArray[4] = data.dateOfBirth;
textArray[5] = data.houseAddress;
textArray[6] = data.issuingAuthority;
@ -450,6 +486,8 @@ const _sfc_main = {
data.endTime = data.endTime;
id.value = data.id;
textArray[7] = `${data.startTime}-${compontent_public_long.swapLongTerm(data.endTime)}`;
} else {
form.tel = common_vendor.index.getStorageSync("tel");
}
});
common_vendor.onShow(() => {
@ -470,31 +508,34 @@ const _sfc_main = {
d: `${common_vendor.index.getStorageSync("moveHeight") + 40}px`,
e: `${common_vendor.index.getStorageSync("moveHeight") + 30}px`,
f: canshow.value
}, canshow.value ? {
g: guanxi.value,
h: common_vendor.o(($event) => guanxi.value = $event.detail.value),
i: form.name,
j: common_vendor.o(($event) => form.name = $event.detail.value),
k: form.tel,
l: common_vendor.o(($event) => form.tel = $event.detail.value),
m: form.idCard,
n: common_vendor.o(($event) => form.idCard = $event.detail.value),
o: form.homeAddress,
p: common_vendor.o(($event) => form.homeAddress = $event.detail.value),
q: form.workUnit,
r: common_vendor.o(($event) => form.workUnit = $event.detail.value)
} : {}, {
s: fontphoto.value ? `${common_vendor.unref(request_index.media_base_url)}${fontphoto.value}` : `https://www.focusnu.com/media/directive/index/IDfront.png`,
t: fontphoto.value ? `` : `https://www.focusnu.com/media/directive/index/bian.png`,
v: !fontphoto.value
}, canshow.value ? common_vendor.e({
g: specialImge.value ? `${common_vendor.unref(request_index.media_base_url)}${specialImge.value}` : `https://www.focusnu.com/media/directive/index/IDfront.png`,
h: specialImge.value ? `` : `https://www.focusnu.com/media/directive/index/bian.png`,
i: !specialImge.value
}, !specialImge.value ? {} : {}, {
j: common_vendor.o(($event) => selectphoto(2)),
k: form.name,
l: common_vendor.o(($event) => form.name = $event.detail.value),
m: form.tel,
n: common_vendor.o(($event) => form.tel = $event.detail.value),
o: form.idCard,
p: common_vendor.o(($event) => form.idCard = $event.detail.value),
q: form.homeAddress,
r: common_vendor.o(($event) => form.homeAddress = $event.detail.value),
s: form.workUnit,
t: common_vendor.o(($event) => form.workUnit = $event.detail.value)
}) : {}, {
v: fontphoto.value ? `${common_vendor.unref(request_index.media_base_url)}${fontphoto.value}` : `https://www.focusnu.com/media/directive/index/IDfront.png`,
w: fontphoto.value ? `` : `https://www.focusnu.com/media/directive/index/bian.png`,
x: !fontphoto.value
}, !fontphoto.value ? {} : {}, {
w: common_vendor.o(($event) => selectphoto(0)),
x: endphoto.value ? `${common_vendor.unref(request_index.media_base_url)}${endphoto.value}` : `https://www.focusnu.com/media/directive/index/IDend.png`,
y: endphoto.value ? `` : `https://www.focusnu.com/media/directive/index/bian.png`,
z: !endphoto.value
y: common_vendor.o(($event) => selectphoto(0)),
z: endphoto.value ? `${common_vendor.unref(request_index.media_base_url)}${endphoto.value}` : `https://www.focusnu.com/media/directive/index/IDend.png`,
A: endphoto.value ? `` : `https://www.focusnu.com/media/directive/index/bian.png`,
B: !endphoto.value
}, !endphoto.value ? {} : {}, {
A: common_vendor.o(($event) => selectphoto(1)),
B: common_vendor.f(nameArray, (item, index, i0) => {
C: common_vendor.o(($event) => selectphoto(1)),
D: common_vendor.f(nameArray, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: common_vendor.t(textArray[index] ? textArray[index] : "自动获取"),
@ -502,10 +543,10 @@ const _sfc_main = {
d: common_vendor.o(($event) => openLook(textArray[index]), index)
};
}),
C: common_vendor.o(next),
D: common_vendor.o(photoclick),
E: common_vendor.o(($event) => bottomshow.value = $event),
F: common_vendor.p({
E: common_vendor.o(next),
F: common_vendor.o(photoclick),
G: common_vendor.o(($event) => bottomshow.value = $event),
H: common_vendor.p({
list: bottomlist,
modelValue: bottomshow.value
})

File diff suppressed because one or more lines are too long

View File

@ -42,10 +42,10 @@ const _sfc_main = {
longPressActions: {
itemList: ["保存图片"],
success: (data) => {
common_vendor.index.__f__("log", "at pages/addoldman/oldmanall.vue:152", "长按操作成功", data);
common_vendor.index.__f__("log", "at pages/addoldman/oldmanall.vue:153", "长按操作成功", data);
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/addoldman/oldmanall.vue:155", "长按操作失败", err);
common_vendor.index.__f__("error", "at pages/addoldman/oldmanall.vue:156", "长按操作失败", err);
}
}
});
@ -84,6 +84,7 @@ const _sfc_main = {
textArray[7] = `${data.startTime}-${compontent_public_long.swapLongTerm(data.endTime)}`;
fontphoto.value = data.idCardPositive;
endphoto.value = data.idCardNegative;
specialImge.value = data.guardianIdCardPositive;
});
const changeMessage = () => {
if (alldata.value.elderModifyStatus == "1") {
@ -118,10 +119,10 @@ const _sfc_main = {
}, !applyStatus.value ? {
h: common_vendor.o(changeMessage)
} : {}, {
i: fontphoto.value ? `${common_vendor.unref(request_index.media_base_url)}${fontphoto.value}` : `https://www.focusnu.com/media/directive/index/IDcard.png`,
j: !fontphoto.value
}, !fontphoto.value ? {} : {}, {
k: common_vendor.o(($event) => getMessage(`${common_vendor.unref(request_index.media_base_url)}${fontphoto.value}`)),
i: _ctx.specialImge ? `${common_vendor.unref(request_index.media_base_url)}${_ctx.specialImge}` : `https://www.focusnu.com/media/directive/index/IDcard.png`,
j: !_ctx.specialImge
}, !_ctx.specialImge ? {} : {}, {
k: common_vendor.o(($event) => getMessage(`${common_vendor.unref(request_index.media_base_url)}${_ctx.specialImge}`)),
l: endphoto.value ? `${common_vendor.unref(request_index.media_base_url)}${endphoto.value}` : `https://www.focusnu.com/media/directive/index/backIDcard.png`,
m: !endphoto.value
}, !endphoto.value ? {} : {}, {

View File

@ -114,7 +114,6 @@ const _sfc_main = {
textArray1[3] = Number(textArray1[3]) + "kg";
});
const changeMessage = () => {
common_vendor.index.__f__("log", "at pages/addstaff/all.vue:377", "????", alldata.value);
if (alldata.value.modifyState == "1") {
openLook("该信息正在审核中,请等待");
} else {
@ -146,7 +145,7 @@ const _sfc_main = {
a: common_vendor.t(item),
b: common_vendor.t(textArray1[index] ? textArray1[index] : "自动获取"),
c: index,
d: common_vendor.o(($event) => openLook(textArray[index]), index)
d: common_vendor.o(($event) => openLook(textArray1[index]), index)
};
}),
j: common_vendor.s(!applyStatus.value ? {

View File

@ -120,7 +120,9 @@ const _sfc_main = {
data.endTime = compontent_public_long.swapLongTerm(data.endTime);
}
data.orgCode = common_vendor.index.getStorageSync("changeyuangongorgCode");
common_vendor.index.__f__("log", "at pages/addstaff/healthcertificate.vue:279", "AAAA", data, ukey.value);
pages_addstaff_api_addjigou.changemessage(data, ukey.value).then((res) => {
common_vendor.index.__f__("log", "at pages/addstaff/healthcertificate.vue:281", "BBBB", res);
if (res.result == "重复提交") {
common_vendor.index.showToast({
title: `重复提交`,

View File

@ -130,7 +130,7 @@ const _sfc_main = {
openId: common_vendor.index.getStorageSync("openid")
});
function isValid11DigitNumber(val) {
return /^(\d{11})$/.test(val);
return /^1[3-9]\d{9}$/.test(val);
}
const next = () => {
if (!form.maritalStatus) {
@ -195,6 +195,11 @@ const _sfc_main = {
title: "请填写户口性质",
icon: "error"
});
} else if (!form.currentAddress) {
common_vendor.index.showToast({
title: "请填写现住址",
icon: "error"
});
} else {
const data = form;
const merged2 = {
@ -236,6 +241,7 @@ const _sfc_main = {
form.showweight = form.weight + "kg";
} else {
common_vendor.index.setStorageSync("isstaffchange", false);
form.tel = common_vendor.index.getStorageSync("tel");
}
});
return (_ctx, _cache) => {