租房申请页面修改
This commit is contained in:
parent
17db37592c
commit
1a725b466b
|
|
@ -11,55 +11,6 @@
|
|||
<view class="content" v-if="currentTabIndex == 0" style="position: relative;">
|
||||
<view class="interviewee">
|
||||
<view class="form-box" style="border-radius: 10upx;">
|
||||
<view v-show="houseApply.userType==2">
|
||||
<view class="form-item" >
|
||||
<text class="label"><text style="color: red;">*</text>姓 名:</text>
|
||||
<view class="ipt-box"><input class="top-t" v-model="houseApply.userName" placeholder="请输入姓名" type="text" maxlength="15"/></view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<text class="label"><text style="color: red;">*</text>联系方式:</text>
|
||||
<view class="ipt-box"><input class="top-t" v-model="houseApply.phone" placeholder="请输入联系方式" type="text" maxlength="11"/></view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<text class="label"><text style="color: red;">*</text>部 门:</text>
|
||||
<view class="ipt-box"><input class="top-t" v-model="houseApply.orgName" placeholder="请输入部门" type="text" maxlength="15"/></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item" >
|
||||
<text class="label"><text style="color: red;">*</text>婚姻状况:</text>
|
||||
<view class="ipt-box select">
|
||||
<radio-group @change="changeMarriageState" style="display: flex;justify-content: flex-start;align-items: center">
|
||||
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in marriageStates" :key="item.id" style="font-size: 26upx;display: flex;justify-content: flex-start;align-items: center;margin-right: 40upx;min-width: 140upx;">
|
||||
<view>
|
||||
<radio color="#4db4ea" :value="item.id" :checked="item.id ==houseApply.marriageState"/>
|
||||
</view>
|
||||
<view>{{item.name}}</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin: 20upx;"><text style="font-size: 28upx;font-weight: bold;"><text style="color: red;">*</text>房查照片(如已婚需要夫妻双方上传房查信息)</text></view>
|
||||
<view style="font-size: 20upx;margin-left: 40upx;"><text>房查网址:</text><text style="color: #0078B8;margin-left: 20upx;" @longpress="copyText" @click="copyText">http://202.103.39.35:9081</text> </view>
|
||||
<view class="pic" style="border-bottom: 1px solid #eee;">
|
||||
<view class="img-box">
|
||||
<view class="img-item" v-for="(item, index) in imgs1" :key="index">
|
||||
<image class="remove-btn" @click="removeImg(index)" src="/static/icons/delete-icon.png"
|
||||
mode=""></image>
|
||||
<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
|
||||
</view>
|
||||
<view class="img-item upload-btn" @click="chooseImg()" v-if="imgs1.length < 2">
|
||||
<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="font-size: 28rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;">互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责!</view>
|
||||
|
||||
|
||||
<view class="form-item" >
|
||||
<text class="label"><text style="color: red;">*</text>工作岗位:</text>
|
||||
<view class="ipt-box"><input class="top-t" v-model="houseApply.position" placeholder="请输入工作岗位" type="text" maxlength="18" /></view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label">人员类别:</text>
|
||||
<view class="ipt-box select">
|
||||
|
|
@ -78,19 +29,108 @@
|
|||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item" v-if="userTypeIndex==1">
|
||||
<text class="label"><text style="color: red;">*</text>分配房源: </text>
|
||||
<text class="infoSpan" @click="houseSelect" style="color:aquamarine;">{{ chosenHouse }}</text>
|
||||
|
||||
<view v-show="houseApply.userType==2">
|
||||
<view class="form-item" >
|
||||
<text class="label"><text style="color: red;">*</text>住房申请人:</text>
|
||||
<view class="ipt-box"><input class="top-t" v-model="houseApply.userName" placeholder="请输入姓名" type="text" maxlength="15"/></view>
|
||||
</view>
|
||||
<!-- <view class="info-item" v-if="examineBatch>=3||item.houseId">
|
||||
<text class="label">租金: </text>
|
||||
<text class="infoSpan" v-if="!item.houseId">{{ chosenHouseCost }}元</text>
|
||||
<text class="infoSpan" v-if="item.houseId">{{ item.rent }}元</text>
|
||||
</view> -->
|
||||
<view class="radio">
|
||||
<view class="form-item" >
|
||||
<text class="label"><text style="color: red;">*</text>所在部门:</text>
|
||||
<view class="ipt-box"><input class="top-t" v-model="houseApply.orgName" placeholder="请输入部门" type="text" maxlength="15"/></view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label"><text style="color: red;">*</text>工作岗位:</text>
|
||||
<view class="ipt-box"><input class="top-t" v-model="houseApply.position" placeholder="请输入工作岗位" type="text" maxlength="18" /></view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<text class="label"><text style="color: red;">*</text>联系方式:</text>
|
||||
<view class="ipt-box"><input class="top-t" v-model="houseApply.phone" placeholder="请输入联系方式" type="text" maxlength="11"/></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-show="houseApply.userType==3">
|
||||
<view class="form-item" >
|
||||
<text class="label"><text style="color: red;">*</text>住房申请人:</text>
|
||||
<view class="ipt-box"><input class="top-t" v-model="houseApply.userName" placeholder="请输入姓名" type="text" maxlength="15"/></view>
|
||||
</view>
|
||||
<view class="form-item" >
|
||||
<text class="label"><text style="color: red;">*</text>联系方式:</text>
|
||||
<view class="ipt-box"><input class="top-t" v-model="houseApply.phone" placeholder="请输入联系方式" type="text" maxlength="11"/></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-item" v-show="houseApply.userType==1||houseApply.userType==2">
|
||||
<text class="label"><text style="color: red;">*</text>婚姻状况:</text>
|
||||
<view class="ipt-box select">
|
||||
<radio-group @change="changeMarriageState" style="display: flex;justify-content: flex-start;align-items: center">
|
||||
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in marriageStates" :key="item.id" style="font-size: 26upx;display: flex;justify-content: flex-start;align-items: center;margin-right: 40upx;min-width: 140upx;">
|
||||
<view>
|
||||
<radio color="#4db4ea" :value="item.id" :checked="item.id ==houseApply.marriageState"/>
|
||||
</view>
|
||||
<view>{{item.name}}</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 房查照片 -->
|
||||
<view v-if="houseApply.userType==1||houseApply.userType==2">
|
||||
<view style="margin: 20upx;"><text style="font-size: 28upx;font-weight: bold;"><text style="color: red;">*</text>房查照片(如已婚需要夫妻双方上传房查信息)</text></view>
|
||||
<view style="font-size: 20upx;margin-left: 40upx;"><text>房查网址:</text><text style="color: #0078B8;margin-left: 20upx;" @longpress="copyText" @click="copyText">http://202.103.39.35:9081</text> </view>
|
||||
<view class="pic" style="border-bottom: 1px solid #eee;">
|
||||
<view class="img-box">
|
||||
<view class="img-item" v-for="(item, index) in imgs1" :key="index">
|
||||
<image class="remove-btn" @click="removeImg(index)" src="/static/icons/delete-icon.png"
|
||||
mode=""></image>
|
||||
<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
|
||||
</view>
|
||||
<view class="img-item upload-btn" @click="chooseImg()" v-if="imgs1.length < 2">
|
||||
<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="font-size: 24rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;padding: 0 20rpx;">互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责!</view>
|
||||
</view>
|
||||
|
||||
<!-- 身份证复印件 -->
|
||||
<view>
|
||||
<view style="margin: 20upx;"><text style="font-size: 28upx;font-weight: bold;"><text style="color: red;">*</text>身份证复印件(正反面):</text></view>
|
||||
<view class="pic" style="border-bottom: 1px solid #eee;">
|
||||
<view class="img-box">
|
||||
<view class="img-item" v-for="(item, index) in imgs2" :key="index">
|
||||
<image class="remove-btn" @click="removeImg2(index)" src="/static/icons/delete-icon.png"
|
||||
mode=""></image>
|
||||
<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
|
||||
</view>
|
||||
<view class="img-item upload-btn" @click="chooseImg2()" v-if="imgs2.length < 2">
|
||||
<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="font-size: 24rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;padding: 0 20rpx;">互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责!</view>
|
||||
</view>
|
||||
<!-- 附件 -->
|
||||
<view v-if="houseApply.userType==3">
|
||||
<view style="margin: 20upx;"><text style="font-size: 28upx;font-weight: bold;">附件:</text></view>
|
||||
<view class="pic" style="border-bottom: 1px solid #eee;">
|
||||
<view class="img-box">
|
||||
<view class="img-item" v-for="(item, index) in imgs3" :key="index">
|
||||
<image class="remove-btn" @click="removeImg3(index)" src="/static/icons/delete-icon.png"
|
||||
mode=""></image>
|
||||
<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
|
||||
</view>
|
||||
<view class="img-item upload-btn" @click="chooseImg3()" v-if="imgs3.length < 2">
|
||||
<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="font-size: 24rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;padding: 0 20rpx;">互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责!</view>
|
||||
</view>
|
||||
|
||||
<view class="radio" v-if="houseApply.userType==1||houseApply.userType==2">
|
||||
<view class="r-div">
|
||||
<text class="input_left">申请事由</text>
|
||||
<!-- <text class="input_right" @click="navTo('/pages/repair-record/repair-record')"><image class="right-img" src="../../static/imgs/liebiao.png"></image></text> -->
|
||||
</view>
|
||||
<view class="" style="border-top:0.5px solid #eeeeee;">
|
||||
<view style="width: 100%;height: 200upx;margin: 20upx;color: #666;text-align: left;font-size: 26upx;">
|
||||
|
|
@ -98,6 +138,17 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="form-item" v-if="houseApply.userType==2">
|
||||
<text class="label"><text style="color: red;">*</text>分配房源: </text>
|
||||
<text class="infoSpan" @click="houseSelect" style="color:aquamarine;">{{ chosenHouse }}</text>
|
||||
</view> -->
|
||||
<!-- <view class="info-item" v-if="examineBatch>=3||item.houseId">
|
||||
<text class="label">租金: </text>
|
||||
<text class="infoSpan" v-if="!item.houseId">{{ chosenHouseCost }}元</text>
|
||||
<text class="infoSpan" v-if="item.houseId">{{ item.rent }}元</text>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
<view class="form-box" style="border-radius: 10upx;">
|
||||
|
||||
|
|
@ -176,18 +227,23 @@ export default {
|
|||
},
|
||||
currentTabIndex:0,
|
||||
genders: [{ id: '男', name: '男' }, { id: '女', name: '女' }],
|
||||
marriageStates: [{ id: '未婚', name: '未婚' }, { id: '已婚', name: '已婚' }],//,{ id: '离婚', name: '离婚' }, { id: '丧偶', name: '丧偶' }
|
||||
marriageStates: [{ id: '未婚', name: '未婚' }, { id: '已婚', name: '已婚' },{ id: '其他', name: '其他' }],//,{ id: '离婚', name: '离婚' }, { id: '丧偶', name: '丧偶' }
|
||||
userTypes:[],
|
||||
houseTypeList:[],
|
||||
userTypeIndex:0,
|
||||
houseType:[],
|
||||
houseTypeIndex:0,
|
||||
houseApply:{
|
||||
userId: getStorage('userInfo').userId,
|
||||
orgId: getStorage('userInfo').department_id,
|
||||
userName: getStorage('userInfo').userName,
|
||||
phone: getStorage('userInfo').mobile,
|
||||
orgName: getStorage('userInfo').departmentName,
|
||||
// userId: getStorage('userInfo').userId,
|
||||
// orgId: getStorage('userInfo').department_id,
|
||||
// userName: getStorage('userInfo').userName,
|
||||
// phone: getStorage('userInfo').mobile,
|
||||
// orgName: getStorage('userInfo').departmentName,
|
||||
userId: "",
|
||||
orgId: "",
|
||||
userName: "",
|
||||
phone: "",
|
||||
orgName: "",
|
||||
marriageState: "未婚",
|
||||
position: '',
|
||||
userType: '',
|
||||
|
|
@ -196,8 +252,12 @@ export default {
|
|||
},
|
||||
reportType:0,
|
||||
reportList:[],
|
||||
imgs1: [],
|
||||
imgs1: [],//房查照片
|
||||
imgsId1: [],
|
||||
imgs2: [],//身份证照片
|
||||
imgsId2: [],
|
||||
imgs3: [],//附件
|
||||
imgsId3: [],
|
||||
showAlert:false,
|
||||
submitFlag:true,
|
||||
chosenHouse:'请选择房源>',
|
||||
|
|
@ -283,11 +343,19 @@ export default {
|
|||
submit() {
|
||||
if(this.submitFlag){
|
||||
this.submitFlag = false;
|
||||
if (!this.houseApply.marriageState) {
|
||||
alertTip('请选择婚姻状况');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
var regexPhone=/^1[3-9]\d{9}$/;
|
||||
|
||||
//外部人员 选房信息
|
||||
// if (this.houseApply.userType==2) {
|
||||
// if (JSON.stringify(this.houseInfo) == "{}") {
|
||||
// alertTip('请先选择房源');
|
||||
// this.submitFlag = true;
|
||||
// return false;
|
||||
// }
|
||||
// this.houseApply.houseId = this.houseInfo.UUID;
|
||||
// }
|
||||
|
||||
if (this.houseApply.userType==1){
|
||||
if (!this.houseApply.marriageState) {
|
||||
alertTip('请选择婚姻状况');
|
||||
this.submitFlag = true;
|
||||
|
|
@ -305,17 +373,27 @@ export default {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
//房查照片
|
||||
this.houseApply.roomInspection=this.imgsId1.toString();
|
||||
var regexPhone=/^1[3-9]\d{9}$/;
|
||||
//外部人员 选房信息
|
||||
if (this.houseApply.userType==2) {
|
||||
if (JSON.stringify(this.houseInfo) == "{}") {
|
||||
alertTip('请先选择房源');
|
||||
if (this.imgsId2.length==0) {
|
||||
alertTip('请选择身份证照片');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
this.houseApply.houseId = this.houseInfo.UUID;
|
||||
if (this.imgsId2.length!=2) {
|
||||
alertTip('需要上传身份证正反两面照片');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
this.houseApply.userId = getStorage('userInfo').userId,
|
||||
this.houseApply.orgId = getStorage('userInfo').department_id,
|
||||
this.houseApply.userName = getStorage('userInfo').userName,
|
||||
this.houseApply.phone = getStorage('userInfo').mobile,
|
||||
this.houseApply.orgName = getStorage('userInfo').departmentName,
|
||||
//房查照片
|
||||
this.houseApply.roomInspection=this.imgsId1.toString();
|
||||
//身份证照片
|
||||
|
||||
}else if(this.houseApply.userType==2){
|
||||
if (!this.houseApply.userName) {
|
||||
alertTip('请输入姓名');
|
||||
this.submitFlag = true;
|
||||
|
|
@ -336,14 +414,73 @@ export default {
|
|||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!this.houseApply.position) {
|
||||
alertTip('请输入工作岗位');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!this.houseApply.marriageState) {
|
||||
alertTip('请选择婚姻状况');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
if (this.imgsId1.length==0) {
|
||||
alertTip('请选择房查照片');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
if (this.houseApply.marriageState=='已婚') {
|
||||
if (this.imgsId1.length==1) {
|
||||
alertTip('已婚需要上传夫妻双方房查照片');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.imgsId2.length==0) {
|
||||
alertTip('请选择身份证照片');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
if (this.imgsId2.length!=2) {
|
||||
alertTip('需要上传身份证正反两面照片');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
//房查照片
|
||||
this.houseApply.roomInspection=this.imgsId1.toString();
|
||||
//身份证照片
|
||||
// this.houseApply. = this.imgsId2.toString();
|
||||
}else if(this.houseApply.userType==3){
|
||||
if (!this.houseApply.userName) {
|
||||
alertTip('请输入姓名');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
if (!this.houseApply.phone) {
|
||||
alertTip('请输入联系方式');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
if(!regexPhone.test(this.houseApply.phone)){
|
||||
alertTip('请确认联系方式手机号是否正确');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
if (this.imgsId2.length==0) {
|
||||
alertTip('请选择身份证照片');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
if (this.imgsId2.length!=2) {
|
||||
alertTip('需要上传身份证正反两面照片');
|
||||
this.submitFlag = true;
|
||||
return false;
|
||||
}
|
||||
//身份证照片
|
||||
// this.houseApply. = this.imgsId2.toString();
|
||||
//附件
|
||||
// this.houseApply. = this.imgsId3.toString();
|
||||
}
|
||||
let params = {
|
||||
method: greenHouseApply,
|
||||
data: this.houseApply
|
||||
|
|
@ -373,6 +510,10 @@ export default {
|
|||
this.houseApply.orgName=getStorage('userInfo').departmentName;
|
||||
this.imgs1 = [];
|
||||
this.imgsId1 = [];
|
||||
this.imgs2 = [];
|
||||
this.imgsId2 = [];
|
||||
this.imgs3 = [];
|
||||
this.imgsId3 = [];
|
||||
this.houseInfo = {}
|
||||
this.currentTabIndex = 1;
|
||||
}, 2000);
|
||||
|
|
@ -382,7 +523,6 @@ export default {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//婚姻 radio选择
|
||||
|
|
@ -737,6 +877,348 @@ export default {
|
|||
this.imgs1.splice(index, 1);
|
||||
this.imgsId1.splice(index, 1);
|
||||
},
|
||||
//身份证照片
|
||||
async chooseImg2() {
|
||||
let chec = 0;
|
||||
let sty = [];
|
||||
let _this = this;
|
||||
uni.showActionSheet({
|
||||
itemList: ['拍照', '相册'],
|
||||
success: function(resp) {
|
||||
chec = resp.tapIndex;
|
||||
if (chec == 0) {
|
||||
sty = ['camera']; //从相册相机选择
|
||||
} else {
|
||||
sty = ['album']; //从相册相机选择
|
||||
}
|
||||
uni.chooseImage({
|
||||
count: 2,
|
||||
sizeType: ['compressed'],
|
||||
sourceType: sty,
|
||||
quality: 1,
|
||||
success: async function(res) {
|
||||
let resData = res.tempFilePaths;
|
||||
for (let i = 0; i < resData.length; i++) {
|
||||
if (_this.imgs2.length > 2) {
|
||||
break;
|
||||
}
|
||||
uni.getImageInfo({
|
||||
src: resData[i],
|
||||
success: async (path) => {
|
||||
convertImgToBase64(path.path,
|
||||
async function(base64) {
|
||||
if (_this.imgs2.length < 2) {
|
||||
// _this.imgs.push(base64);
|
||||
uni.showLoading({
|
||||
title: '图片上传中'
|
||||
})
|
||||
let blength = base64.length;
|
||||
let glength = 7500;
|
||||
console.log("base64:",base64)
|
||||
if (blength <=
|
||||
glength) {
|
||||
let uploadParam = {
|
||||
base64: base64,
|
||||
userId: getStorage('userInfo').userId +i,
|
||||
groupEnd: '1'
|
||||
}
|
||||
await uploadImg(uploadParam)
|
||||
.then(
|
||||
resu => {
|
||||
resu =resu.data;
|
||||
uni.hideLoading();
|
||||
if (resu.returnCode !=1) {
|
||||
alertTip(resu.returnMsg);
|
||||
} else {
|
||||
_this.imgs2.push(base64);
|
||||
_this.imgsId2.push(resu.returnData +".jpg");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
let fnum =parseInt(blength /glength);
|
||||
for (let j =1; j <fnum +1; j++) {
|
||||
if (j ==fnum) {
|
||||
let groupBase =base64.slice((j -1) *glength);
|
||||
console.log(groupBase.length,"groupBaselength");
|
||||
let uploadParam = {
|
||||
base64: groupBase,
|
||||
userId: getStorage(
|
||||
'userInfo'
|
||||
)
|
||||
.userId +
|
||||
i,
|
||||
groupEnd: '1'
|
||||
}
|
||||
await uploadImg
|
||||
(
|
||||
uploadParam)
|
||||
.then(
|
||||
resu => {
|
||||
resu =
|
||||
resu
|
||||
.data;
|
||||
if (resu
|
||||
.returnCode ==
|
||||
1
|
||||
) {
|
||||
_this
|
||||
.imgs2
|
||||
.push(
|
||||
base64
|
||||
);
|
||||
_this
|
||||
.imgsId2
|
||||
.push(
|
||||
resu
|
||||
.returnData +
|
||||
".jpg"
|
||||
);
|
||||
} else {
|
||||
uni
|
||||
.hideLoading();
|
||||
alertTip
|
||||
(resu
|
||||
.returnMsg
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
let groupBase =
|
||||
base64
|
||||
.slice(
|
||||
(j -
|
||||
1) *
|
||||
glength,
|
||||
glength *
|
||||
j
|
||||
);
|
||||
let uploadParam = {
|
||||
base64: groupBase,
|
||||
userId: getStorage(
|
||||
'userInfo'
|
||||
)
|
||||
.userId +
|
||||
i,
|
||||
groupEnd: '0'
|
||||
}
|
||||
await uploadImg
|
||||
(
|
||||
uploadParam)
|
||||
.then(
|
||||
resu => {
|
||||
resu =
|
||||
resu
|
||||
.data;
|
||||
if (resu
|
||||
.returnCode ==
|
||||
1
|
||||
) {} else {
|
||||
uni
|
||||
.hideLoading();
|
||||
alertTip
|
||||
(resu
|
||||
.returnMsg
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
uni
|
||||
.hideLoading();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function(resp) {
|
||||
console.log(resp.errMsg);
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除身份证照片
|
||||
removeImg2(index) {
|
||||
this.imgs2.splice(index, 1);
|
||||
this.imgsId2.splice(index, 1);
|
||||
},
|
||||
//附件照片
|
||||
async chooseImg3() {
|
||||
let chec = 0;
|
||||
let sty = [];
|
||||
let _this = this;
|
||||
uni.showActionSheet({
|
||||
itemList: ['拍照', '相册'],
|
||||
success: function(resp) {
|
||||
chec = resp.tapIndex;
|
||||
if (chec == 0) {
|
||||
sty = ['camera']; //从相册相机选择
|
||||
} else {
|
||||
sty = ['album']; //从相册相机选择
|
||||
}
|
||||
uni.chooseImage({
|
||||
count: 2,
|
||||
sizeType: ['compressed'],
|
||||
sourceType: sty,
|
||||
quality: 1,
|
||||
success: async function(res) {
|
||||
let resData = res.tempFilePaths;
|
||||
for (let i = 0; i < resData.length; i++) {
|
||||
if (_this.imgs3.length > 2) {
|
||||
break;
|
||||
}
|
||||
uni.getImageInfo({
|
||||
src: resData[i],
|
||||
success: async (path) => {
|
||||
convertImgToBase64(path.path,
|
||||
async function(base64) {
|
||||
if (_this.imgs3.length < 2) {
|
||||
// _this.imgs.push(base64);
|
||||
uni.showLoading({
|
||||
title: '图片上传中'
|
||||
})
|
||||
let blength = base64.length;
|
||||
let glength = 7500;
|
||||
console.log("base64:",base64)
|
||||
if (blength <=
|
||||
glength) {
|
||||
let uploadParam = {
|
||||
base64: base64,
|
||||
userId: getStorage('userInfo').userId +i,
|
||||
groupEnd: '1'
|
||||
}
|
||||
await uploadImg(uploadParam)
|
||||
.then(
|
||||
resu => {
|
||||
resu =resu.data;
|
||||
uni.hideLoading();
|
||||
if (resu.returnCode !=1) {
|
||||
alertTip(resu.returnMsg);
|
||||
} else {
|
||||
_this.imgs3.push(base64);
|
||||
_this.imgsId3.push(resu.returnData +".jpg");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
let fnum =parseInt(blength /glength);
|
||||
for (let j =1; j <fnum +1; j++) {
|
||||
if (j ==fnum) {
|
||||
let groupBase =base64.slice((j -1) *glength);
|
||||
console.log(groupBase.length,"groupBaselength");
|
||||
let uploadParam = {
|
||||
base64: groupBase,
|
||||
userId: getStorage(
|
||||
'userInfo'
|
||||
)
|
||||
.userId +
|
||||
i,
|
||||
groupEnd: '1'
|
||||
}
|
||||
await uploadImg
|
||||
(
|
||||
uploadParam)
|
||||
.then(
|
||||
resu => {
|
||||
resu =
|
||||
resu
|
||||
.data;
|
||||
if (resu
|
||||
.returnCode ==
|
||||
1
|
||||
) {
|
||||
_this
|
||||
.imgs3
|
||||
.push(
|
||||
base64
|
||||
);
|
||||
_this
|
||||
.imgsId3
|
||||
.push(
|
||||
resu
|
||||
.returnData +
|
||||
".jpg"
|
||||
);
|
||||
} else {
|
||||
uni
|
||||
.hideLoading();
|
||||
alertTip
|
||||
(resu
|
||||
.returnMsg
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
let groupBase =
|
||||
base64
|
||||
.slice(
|
||||
(j -
|
||||
1) *
|
||||
glength,
|
||||
glength *
|
||||
j
|
||||
);
|
||||
let uploadParam = {
|
||||
base64: groupBase,
|
||||
userId: getStorage(
|
||||
'userInfo'
|
||||
)
|
||||
.userId +
|
||||
i,
|
||||
groupEnd: '0'
|
||||
}
|
||||
await uploadImg
|
||||
(
|
||||
uploadParam)
|
||||
.then(
|
||||
resu => {
|
||||
resu =
|
||||
resu
|
||||
.data;
|
||||
if (resu
|
||||
.returnCode ==
|
||||
1
|
||||
) {} else {
|
||||
uni
|
||||
.hideLoading();
|
||||
alertTip
|
||||
(resu
|
||||
.returnMsg
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
uni
|
||||
.hideLoading();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function(resp) {
|
||||
console.log(resp.errMsg);
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除附件照片
|
||||
removeImg3(index) {
|
||||
this.imgs3.splice(index, 1);
|
||||
this.imgsId3.splice(index, 1);
|
||||
},
|
||||
|
||||
},
|
||||
onReachBottom() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue