Commit 995f667b by sunerhu

1.修改了一些Bug

parent 4c4e0e1c
...@@ -106,10 +106,9 @@ ...@@ -106,10 +106,9 @@
str = str.replace(/\s*/g, ""); str = str.replace(/\s*/g, "");
}, },
saveInfo() { saveInfo() {
console.log(this.applyParam.bankAccountId, 155) uni.showLoading({
console.log(this.sureBankAccountId, 155) title: '加载中...'
console.log(this.applyParam });
.bankAccountOpening, 155)
if (this.applyParam.bankAccountId == '' || this.sureBankAccountId == '' || this.applyParam if (this.applyParam.bankAccountId == '' || this.sureBankAccountId == '' || this.applyParam
.bankAccountOpening == '') { .bankAccountOpening == '') {
uni.showToast({ uni.showToast({
...@@ -148,6 +147,7 @@ ...@@ -148,6 +147,7 @@
}) })
return; return;
} }
uni.hideLoading()
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
......
...@@ -299,15 +299,11 @@ ...@@ -299,15 +299,11 @@
} }
}, },
async queryById(id, userId) { async queryById(id, userId) {
uni.showLoading({
title: '加载中...'
});
await this.erpInitialize(); await this.erpInitialize();
api.queryById({ api.queryById({
id: id, id: id,
userId: userId userId: userId
}).then((res) => { }).then((res) => {
uni.hideLoading();
if (res['success']) { if (res['success']) {
this.applyParam = res['data']['data']; this.applyParam = res['data']['data'];
if (this.applyParam.inviterInvitationCode) { if (this.applyParam.inviterInvitationCode) {
...@@ -335,6 +331,9 @@ ...@@ -335,6 +331,9 @@
}) })
}, },
saveInfo() { saveInfo() {
uni.showLoading({
title: '加载中...'
});
if (this.applyParam.approvalStatus == 0 || this.applyParam.approvalStatus == 2) { if (this.applyParam.approvalStatus == 0 || this.applyParam.approvalStatus == 2) {
if (!this.applyParam.areaId) { if (!this.applyParam.areaId) {
uni.showToast({ uni.showToast({
...@@ -425,6 +424,7 @@ ...@@ -425,6 +424,7 @@
}) })
return; return;
} }
uni.hideLoading()
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<text>最高学历:如本科、专科、硕士</text> <text>最高学历:如本科、专科、硕士</text>
<picker @change="changeEducation" :value="educationIdx" :range="educationLevelList" <picker @change="changeEducation" :value="educationIdx" :range="educationLevelList"
range-key="name" range-key="name"
:disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2"> :disabled="this.educationForm.approvalStatus!= 0 && this.educationForm.approvalStatus != 2">
<view class="uni-input">{{educationLevelList[educationIdx]['name']}} <view class="uni-input">{{educationLevelList[educationIdx]['name']}}
<text class="iconfont icon-youjiantou"></text> <text class="iconfont icon-youjiantou"></text>
</view> </view>
...@@ -38,22 +38,22 @@ ...@@ -38,22 +38,22 @@
</view> </view>
<view class="contentItem"> <view class="contentItem">
<text>毕业学校</text> <text>毕业学校</text>
<input type="text" class="form-control" v-model="applyParam.lastGraduateSchool" <input type="text" class="form-control" v-model="educationForm.lastGraduateSchool"
placeholder="请输入毕业院校" placeholder="请输入毕业院校"
:disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2" /> :disabled="this.educationForm.approvalStatus!= 0 && this.educationForm.approvalStatus != 2" />
</view> </view>
<view class="contentItem" style="border:none;"> <view class="contentItem" style="border:none;">
<text>毕业证</text> <text>毕业证</text>
<view></view> <view></view>
</view> </view>
</view> </view>
<view class="photo_wrapper" v-if="!applyParam.lastGraduateCertificationOssPath" @click="upLoadPhoto()"> <view class="photo_wrapper" v-if="!educationForm.lastGraduateCertificationOssPath" @click="upLoadPhoto()">
<text class="iconfont icon-weibiaoti553"></text> <text class="iconfont icon-weibiaoti553"></text>
<view style="margin-top: 10px;">点击添加毕业证照片</view> <view style="margin-top: 10px;">点击添加毕业证照片</view>
</view> </view>
<!-- mode="widthFix" --> <!-- mode="widthFix" -->
<view class="photo_w" v-if="applyParam.lastGraduateCertificationOssPath"> <view class="photo_w" v-if="educationForm.lastGraduateCertificationOssPath">
<image :src="applyParam.lastGraduateCertificationOssPath" @click="upLoadPhoto()"></image> <image :src="educationForm.lastGraduateCertificationOssPath" @click="upLoadPhoto()"></image>
</view> </view>
<view class="tips"> <view class="tips">
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</view> </view>
</view> </view>
<view class="fixed" @click="saveInfo()"> <view class="fixed" @click="saveInfo()">
{{(this.applyParam.approvalStatus== 0 || this.applyParam.approvalStatus == 2)?'保存并下一步':'下一步'}} {{(this.educationForm.approvalStatus== 0 || this.educationForm.approvalStatus == 2)?'保存并下一步':'下一步'}}
</view> </view>
</view> </view>
</template> </template>
...@@ -80,12 +80,13 @@ ...@@ -80,12 +80,13 @@
name: '请选择' name: '请选择'
}], }],
educationIdx: 0, educationIdx: 0,
applyParam: { educationForm:{
lastGraduateGrade: '', lastGraduateGrade: '',
lastGraduateSchool: '', lastGraduateSchool: '',
lastGraduateCertificationOssPath: '', lastGraduateCertificationOssPath: '',
approvalStatus: '' approvalStatus: ''
}, },
educationForm: {},
shareId: null, shareId: null,
dataForm: { dataForm: {
loginId: uni.getStorageSync('cffp_userId'), loginId: uni.getStorageSync('cffp_userId'),
...@@ -109,10 +110,14 @@ ...@@ -109,10 +110,14 @@
} }
}, },
onShow() { onShow() {
let loadquery = uni.getStorageSync('REFRESH') if(uni.getStorageSync('educationForm')){
if(loadquery == true) { this.educationForm = uni.getStorageSync('educationForm')
this.queryById(null, uni.getStorageSync('cffp_userId'))
} }
uni.$on("ckqueryById", res=>{
if(res == true){
this.queryById(null, uni.getStorageSync('cffp_userId'))
}
});
}, },
methods: { methods: {
educationLevelQuery() { educationLevelQuery() {
...@@ -134,8 +139,18 @@ ...@@ -134,8 +139,18 @@
}).then((res) => { }).then((res) => {
if (res['success']) { if (res['success']) {
this.applyParam = res['data']['data']; this.applyParam = res['data']['data'];
console.log(uni.getStorageSync('educationForm'), 1515115)
if(uni.getStorageSync('educationForm')){
this.educationForm = uni.getStorageSync('educationForm')
}else {
this.educationForm.lastGraduateGrade = this.applyParam.lastGraduateGrade
this.educationForm.lastGraduateSchool = this.applyParam.lastGraduateSchool? this.applyParam.lastGraduateSchool:''
this.educationForm.lastGraduateCertificationOssPath = this.applyParam.lastGraduateCertificationOssPath
this.educationForm.approvalStatus = this.applyParam.approvalStatus
}
this.educationForm.id = this.applyParam.id
for (let i = 0; i < this.educationLevelList.length; i++) { for (let i = 0; i < this.educationLevelList.length; i++) {
if (this.applyParam.lastGraduateGrade == this.educationLevelList[i].name) { if (this.educationForm.lastGraduateGrade == this.educationLevelList[i].name) {
this.educationIdx = i; this.educationIdx = i;
} }
} }
...@@ -144,20 +159,23 @@ ...@@ -144,20 +159,23 @@
}) })
}, },
upLoadPhoto(event) { upLoadPhoto(event) {
if (this.applyParam.approvalStatus == 0 || this.applyParam.approvalStatus == 2) { if (this.educationForm.approvalStatus == 0 || this.educationForm.approvalStatus == 2) {
this.dataForm.targetId = this.applyParam.id this.dataForm.targetId = this.educationForm.id
CommonUpload(this.dataForm).then(res => { CommonUpload(this.dataForm).then(res => {
this.applyParam.lastGraduateCertificationOssPath = res.data.filePath; this.educationForm.lastGraduateCertificationOssPath = res.data.filePath;
}); });
} }
}, },
changeEducation: function(e) { changeEducation: function(e) {
this.educationIdx = e.detail.value; this.educationIdx = e.detail.value;
this.applyParam.lastGraduateGrade = this.educationLevelList[this.educationIdx]['name']; this.educationForm.lastGraduateGrade = this.educationLevelList[this.educationIdx]['name'];
}, },
saveInfo() { saveInfo() {
if (this.applyParam.approvalStatus == 0 || this.applyParam.approvalStatus == 2) { uni.showLoading({
if (!this.applyParam.lastGraduateGrade) { title: '加载中...'
});
if (this.educationForm.approvalStatus == 0 || this.educationForm.approvalStatus == 2) {
if (!this.educationForm.lastGraduateGrade) {
uni.showToast({ uni.showToast({
title: '请选择最高学历', title: '请选择最高学历',
duration: 2000, duration: 2000,
...@@ -165,7 +183,7 @@ ...@@ -165,7 +183,7 @@
}) })
return; return;
} }
if (!this.applyParam.lastGraduateSchool) { if (!this.educationForm.lastGraduateSchool) {
uni.showToast({ uni.showToast({
title: '请输入毕业学校', title: '请输入毕业学校',
duration: 2000, duration: 2000,
...@@ -173,7 +191,7 @@ ...@@ -173,7 +191,7 @@
}) })
return; return;
} }
if (!this.applyParam.lastGraduateCertificationOssPath) { if (!this.educationForm.lastGraduateCertificationOssPath) {
uni.showToast({ uni.showToast({
title: '请上传毕业证书', title: '请上传毕业证书',
duration: 2000, duration: 2000,
...@@ -181,6 +199,11 @@ ...@@ -181,6 +199,11 @@
}) })
return; return;
} }
uni.setStorageSync('educationForm',this.educationForm)
this.applyParam.lastGraduateGrade = this.educationForm.lastGraduateGrade
this.applyParam.lastGraduateSchool= this.educationForm.lastGraduateSchool
this.applyParam.lastGraduateCertificationOssPath=this.educationForm.lastGraduateCertificationOssPath
this.applyParam.approvalStatus=this.educationForm.approvalStatus
this.applyParam = { this.applyParam = {
...this.applyParam, ...this.applyParam,
operatStep: 4, operatStep: 4,
...@@ -200,6 +223,7 @@ ...@@ -200,6 +223,7 @@
}) })
return; return;
} }
uni.hideLoading()
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
......
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
</view> </view>
<view class="content"> <view class="content">
<view class="content_wrapper"> <view class="content_wrapper">
<view class="photo" v-if="!applyParam.idFrontPageOssPath" @click="upLoadPhoto('front')"> <view class="photo" v-if="!cardForm.idFrontPageOssPath" @click="upLoadPhoto('front')">
<image src="../../static/front.png" alt="身份证正面" mode="widthFix"></image> <image src="../../static/front.png" alt="身份证正面" mode="widthFix"></image>
<text class="iconfont icon-weibiaoti553"></text> <text class="iconfont icon-weibiaoti553"></text>
<view class="choseBtn">点击添加身份证正面</view> <view class="choseBtn">点击添加身份证正面</view>
</view> </view>
<view class="content_w" v-if="applyParam.idFrontPageOssPath"> <view class="content_w" v-if="cardForm.idFrontPageOssPath">
<image :src="applyParam.idFrontPageOssPath" @click="upLoadPhoto('front')"></image> <image :src="cardForm.idFrontPageOssPath" @click="upLoadPhoto('front')"></image>
</view> </view>
<view class="tips"> <view class="tips">
<view>(正确示例:身份证正面,字体清晰)</view> <view>(正确示例:身份证正面,字体清晰)</view>
...@@ -40,13 +40,13 @@ ...@@ -40,13 +40,13 @@
</view> </view>
</view> </view>
<view class="content_wrapper" style="margin-top: 25px;"> <view class="content_wrapper" style="margin-top: 25px;">
<view class="photo" v-if="!applyParam.idBackPageOssPath" @click="upLoadPhoto('back')"> <view class="photo" v-if="!cardForm.idBackPageOssPath" @click="upLoadPhoto('back')">
<image src="../../static/back.png" alt="身份证反面" mode="widthFix"></image> <image src="../../static/back.png" alt="身份证反面" mode="widthFix"></image>
<text class="iconfont icon-weibiaoti553"></text> <text class="iconfont icon-weibiaoti553"></text>
<view class="choseBtn">点击添加身份证反面</view> <view class="choseBtn">点击添加身份证反面</view>
</view> </view>
<view class="content_w" v-if="applyParam.idBackPageOssPath"> <view class="content_w" v-if="cardForm.idBackPageOssPath">
<image :src="applyParam.idBackPageOssPath" @click="upLoadPhoto('back')"></image> <image :src="cardForm.idBackPageOssPath" @click="upLoadPhoto('back')"></image>
</view> </view>
<view class="tips"> <view class="tips">
<view>(正确示例:身份证反面,字体清晰)</view> <view>(正确示例:身份证反面,字体清晰)</view>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</view> </view>
</view> </view>
<view class="fixed" @click="saveInfo()"> <view class="fixed" @click="saveInfo()">
{{(this.applyParam.approvalStatus== 0 || this.applyParam.approvalStatus == 2)?'保存并下一步':'下一步'}} {{(this.cardForm.approvalStatus== 0 || this.cardForm.approvalStatus == 2)?'保存并下一步':'下一步'}}
</view> </view>
</view> </view>
</template> </template>
...@@ -69,11 +69,12 @@ ...@@ -69,11 +69,12 @@
export default { export default {
data() { data() {
return { return {
applyParam: { cardForm: {
idFrontPageOssPath: '', idFrontPageOssPath: '',
idBackPageOssPath: '', idBackPageOssPath: '',
approvalStatus: '' approvalStatus: ''
}, },
applyParam: {},
shareId: null, shareId: null,
dataForm: { dataForm: {
loginId: uni.getStorageSync('cffp_userId'), loginId: uni.getStorageSync('cffp_userId'),
...@@ -98,10 +99,14 @@ ...@@ -98,10 +99,14 @@
} }
}, },
onShow() { onShow() {
let loadquery = uni.getStorageSync('REFRESH') if(uni.getStorageSync('cardForm')){
if (loadquery == true) { this.cardForm = uni.getStorageSync('cardForm')
this.queryById(null, uni.getStorageSync('cffp_userId'))
} }
uni.$on("ckqueryById", res=>{
if(res == true){
this.queryById(null, uni.getStorageSync('cffp_userId'))
}
});
}, },
methods: { methods: {
queryById(id, userId) { queryById(id, userId) {
...@@ -114,33 +119,44 @@ ...@@ -114,33 +119,44 @@
}).then((res) => { }).then((res) => {
if (res['success']) { if (res['success']) {
this.applyParam = res['data']['data']; this.applyParam = res['data']['data'];
if(uni.getStorageSync('cardForm')){
this.cardForm = uni.getStorageSync('cardForm')
}else {
this.cardForm.idFrontPageOssPath = this.applyParam.idFrontPageOssPath
this.cardForm.idBackPageOssPath = this.applyParam.idBackPageOssPath
this.cardForm.approvalStatus = this.applyParam.approvalStatus
}
this.cardForm.id = this.applyParam.id
} }
uni.hideLoading() uni.hideLoading()
}) })
}, },
upLoadPhoto(type) { upLoadPhoto(type) {
if (this.applyParam.approvalStatus == 0 || this.applyParam.approvalStatus == 2) { if (this.cardForm.approvalStatus == 0 || this.cardForm.approvalStatus == 2) {
if (type == 'front') { if (type == 'front') {
this.dataForm.targetNo = 2; this.dataForm.targetNo = 2;
} }
if (type == 'back') { if (type == 'back') {
this.dataForm.targetNo = 3; this.dataForm.targetNo = 3;
} }
this.dataForm.targetId = this.applyParam.id this.dataForm.targetId = this.cardForm.id
CommonUpload(this.dataForm).then(res => { CommonUpload(this.dataForm).then(res => {
if (type == 'front') { if (type == 'front') {
this.applyParam.idFrontPageOssPath = res.data.filePath; this.cardForm.idFrontPageOssPath = res.data.filePath;
} }
if (type == 'back') { if (type == 'back') {
this.applyParam.idBackPageOssPath = res.data.filePath; this.cardForm.idBackPageOssPath = res.data.filePath;
} }
console.log(this.applyParam.idBackPageOssPath, 151515) console.log(this.cardForm.idBackPageOssPath, 151515)
}) })
} }
}, },
saveInfo() { saveInfo() {
if (this.applyParam.approvalStatus == 0 || this.applyParam.approvalStatus == 2) { uni.showLoading({
if (!this.applyParam.idFrontPageOssPath) { title: '加载中...'
});
if (this.cardForm.approvalStatus == 0 || this.cardForm.approvalStatus == 2) {
if (!this.cardForm.idFrontPageOssPath) {
uni.showToast({ uni.showToast({
title: '请上传身份证正面照片', title: '请上传身份证正面照片',
duration: 2000, duration: 2000,
...@@ -148,7 +164,7 @@ ...@@ -148,7 +164,7 @@
}) })
return; return;
} }
if (!this.applyParam.idBackPageOssPath) { if (!this.cardForm.idBackPageOssPath) {
uni.showToast({ uni.showToast({
title: '请上传身份证反面照片', title: '请上传身份证反面照片',
duration: 2000, duration: 2000,
...@@ -156,14 +172,17 @@ ...@@ -156,14 +172,17 @@
}) })
return; return;
} }
this.applyParam.idFrontPageOssPath = this.cardForm.idFrontPageOssPath
this.applyParam.idBackPageOssPath = this.cardForm.idBackPageOssPath
this.applyParam.approvalStatus = this.cardForm.approvalStatus
this.applyParam = { this.applyParam = {
...this.applyParam, ...this.applyParam,
operatStep: 3, operatStep: 3,
} }
uni.setStorageSync('cardForm',this.cardForm)
api.saveApplyInfo(this.applyParam).then((res) => { api.saveApplyInfo(this.applyParam).then((res) => {
if (res['success']) { if (res['success']) {
// this.queryById(null, uni.getStorageSync('cffp_userId')) // this.queryById(null, uni.getStorageSync('cffp_userId'))
uni.setStorageSync('REFRESH', true) //用来告诉234步进行加载
uni.navigateTo({ uni.navigateTo({
// url:`id-card?id=${res['data']['id']}` // url:`id-card?id=${res['data']['id']}`
url: `education` url: `education`
...@@ -176,6 +195,7 @@ ...@@ -176,6 +195,7 @@
}) })
return; return;
} }
uni.hideLoading()
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<text>职业类型</text> <text>职业类型</text>
<picker @change="changeIndustry" :value="industryIdx" :range="industry" <picker @change="changeIndustry" :value="industryIdx" :range="industry"
range-key="industryName" range-key="industryName"
:disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2"> :disabled="this.workform.approvalStatus!= 0 && this.workform.approvalStatus != 2">
<view class="uni-input">{{industry[industryIdx]['industryName']}} <view class="uni-input">{{industry[industryIdx]['industryName']}}
<text class="iconfont icon-youjiantou"></text> <text class="iconfont icon-youjiantou"></text>
</view> </view>
...@@ -39,32 +39,31 @@ ...@@ -39,32 +39,31 @@
</view> </view>
<view class="contentItem"> <view class="contentItem">
<text>最近一次工作单位</text> <text>最近一次工作单位</text>
<input type="text" class="form-control" placeholder="非必填" <input type="text" class="form-control" placeholder="非必填" v-model="workform.workingCompany"
v-model="applyParam.workingCompany" :disabled="this.workform.approvalStatus!= 0 && this.workform.approvalStatus != 2" />
:disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2" />
</view> </view>
<view class="contentItem"> <view class="contentItem">
<text>职位</text> <text>职位</text>
<input type="text" class="form-control" placeholder="非必填" v-model="applyParam.position" <input type="text" class="form-control" placeholder="非必填" v-model="workform.position"
:disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2" /> :disabled="this.workform.approvalStatus!= 0 && this.workform.approvalStatus != 2" />
</view> </view>
<view class="contentItem"> <view class="contentItem">
<text>任职开始时间</text> <text>任职开始时间</text>
<picker mode="date" :value="applyParam.workingStart" @change="bindWorkingStart" <picker mode="date" :value="workform.workingStart" @change="bindWorkingStart"
:disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2"> :disabled="this.workform.approvalStatus!= 0 && this.workform.approvalStatus != 2">
<view v-if="!applyParam.workingStart">请选择<text class="iconfont icon-youjiantou"></text> <view v-if="!workform.workingStart">请选择<text class="iconfont icon-youjiantou"></text>
</view> </view>
<view class="uni-input" v-if="applyParam.workingStart">{{applyParam.workingStart}}<text <view class="uni-input" v-if="workform.workingStart">{{workform.workingStart}}<text
class="iconfont icon-youjiantou"></text></view> class="iconfont icon-youjiantou"></text></view>
</picker> </picker>
</view> </view>
<view class="contentItem"> <view class="contentItem">
<text>结束时间</text> <text>结束时间</text>
<picker mode="date" :value="applyParam.workingEnd" @change="bindWorkingEnd" <picker mode="date" :value="workform.workingEnd" @change="bindWorkingEnd"
:disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2"> :disabled="this.workform.approvalStatus!= 0 && this.workform.approvalStatus != 2">
<view v-if="!applyParam.workingEnd">请选择<text class="iconfont icon-youjiantou"></text> <view v-if="!workform.workingEnd">请选择<text class="iconfont icon-youjiantou"></text>
</view> </view>
<view class="uni-input" v-if="applyParam.workingEnd">{{applyParam.workingEnd}}<text <view class="uni-input" v-if="workform.workingEnd">{{workform.workingEnd}}<text
class="iconfont icon-youjiantou"></text></view> class="iconfont icon-youjiantou"></text></view>
</picker> </picker>
</view> </view>
...@@ -72,11 +71,11 @@ ...@@ -72,11 +71,11 @@
<text>荣誉证书</text> <text>荣誉证书</text>
</view> </view>
</view> </view>
<view class="photo_wrapper" @click="upLoadPhoto()" v-if="!applyParam.certificate"> <view class="photo_wrapper" @click="upLoadPhoto()" v-if="!workform.certificate">
<text class="iconfont icon-weibiaoti553"></text> <text class="iconfont icon-weibiaoti553"></text>
<view style="margin-top: 10px;">点击添加荣誉证书照片</view> <view style="margin-top: 10px;">点击添加荣誉证书照片</view>
</view> </view>
<view v-if="applyParam.certificate" style="width: 100%;text-align: center;"> <view v-if="workform.certificate" style="width: 100%;text-align: center;">
<view class="photo_w" v-for="picItem in picList"> <view class="photo_w" v-for="picItem in picList">
<image style="width: 100%;" :src="picItem" @click="clickImg(picItem)"></image> <image style="width: 100%;" :src="picItem" @click="clickImg(picItem)"></image>
</view> </view>
...@@ -85,7 +84,7 @@ ...@@ -85,7 +84,7 @@
<view>(jpg,png 文件大小不大于1mb)</view> <view>(jpg,png 文件大小不大于1mb)</view>
</view> </view>
<view class="upLoadMore" <view class="upLoadMore"
v-if="this.applyParam.approvalStatus== 0 || this.applyParam.approvalStatus == 2" v-if="this.workform.approvalStatus== 0 || this.workform.approvalStatus == 2"
@click="upLoadPhoto()"> @click="upLoadPhoto()">
<view class="iconfont icon-jiahao"></view> <view class="iconfont icon-jiahao"></view>
<view>上传更多</view> <view>上传更多</view>
...@@ -93,7 +92,7 @@ ...@@ -93,7 +92,7 @@
</view> </view>
</view> </view>
<view class="fixed" @click="saveInfo()"> <view class="fixed" @click="saveInfo()">
{{(this.applyParam.approvalStatus== 0 || this.applyParam.approvalStatus == 2)?'保存并下一步':'下一步'}} {{(this.workform.approvalStatus== 0 || this.workform.approvalStatus == 2)?'保存并下一步':'下一步'}}
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
...@@ -113,7 +112,7 @@ ...@@ -113,7 +112,7 @@
industryId: null industryId: null
}], }],
industryIdx: 0, industryIdx: 0,
applyParam: { workform: {
workingCategoryId: '', workingCategoryId: '',
workingCompany: '', workingCompany: '',
position: '', position: '',
...@@ -122,6 +121,7 @@ ...@@ -122,6 +121,7 @@
certificate: '', certificate: '',
approvalStatus: '' approvalStatus: ''
}, },
applyParam: {},
dataForm: { dataForm: {
loginId: uni.getStorageSync('cffp_userId'), loginId: uni.getStorageSync('cffp_userId'),
targetType: "5", targetType: "5",
...@@ -147,10 +147,14 @@ ...@@ -147,10 +147,14 @@
}, 500) }, 500)
}, },
onShow() { onShow() {
let loadquery = uni.getStorageSync('REFRESH') if(uni.getStorageSync('workform')){
if(loadquery == true) { this.workform = uni.getStorageSync('workform')
this.queryById(null, uni.getStorageSync('cffp_userId'))
} }
uni.$on("ckqueryById", res=>{
if(res == true){
this.queryById(null, uni.getStorageSync('cffp_userId'))
}
});
}, },
methods: { methods: {
clickImg(i) { clickImg(i) {
...@@ -159,13 +163,13 @@ ...@@ -159,13 +163,13 @@
changeIndustry: function(e) { changeIndustry: function(e) {
this.industryIdx = e.detail.value; this.industryIdx = e.detail.value;
// this.workingCategory = this.industry[this.industryIdx]['industryName']; // this.workingCategory = this.industry[this.industryIdx]['industryName'];
this.applyParam.workingCategoryId = this.industry[this.industryIdx]['industryId']; this.workform.workingCategoryId = this.industry[this.industryIdx]['industryId'];
}, },
bindWorkingStart: function(e) { bindWorkingStart: function(e) {
this.applyParam.workingStart = e.detail.value; this.workform.workingStart = e.detail.value;
}, },
bindWorkingEnd: function(e) { bindWorkingEnd: function(e) {
this.applyParam.workingEnd = e.detail.value; this.workform.workingEnd = e.detail.value;
}, },
occupationQry() { occupationQry() {
api.occupationQry({ api.occupationQry({
...@@ -182,15 +186,19 @@ ...@@ -182,15 +186,19 @@
}) })
}, },
upLoadPhoto(event) { upLoadPhoto(event) {
this.dataForm.targetId = this.applyParam.id this.dataForm.targetId = this.workform.id
CommonUpload(this.dataForm).then(res => { CommonUpload(this.dataForm).then(res => {
this.applyParam.certificate = res.data.filePath; console.log(res, 1145)
this.picList.push(this.applyParam.certificate); this.workform.certificate = res.data.filePath;
this.picList.push(this.workform.certificate);
}); });
}, },
saveInfo() { saveInfo() {
if (this.applyParam.approvalStatus == 0 || this.applyParam.approvalStatus == 2) { uni.showLoading({
if (!this.applyParam.workingCategoryId) { title: '加载中...'
});
if (this.workform.approvalStatus == 0 || this.workform.approvalStatus == 2) {
if (!this.workform.workingCategoryId) {
uni.showToast({ uni.showToast({
title: '请选择职业类型', title: '请选择职业类型',
duration: 2000, duration: 2000,
...@@ -198,15 +206,22 @@ ...@@ -198,15 +206,22 @@
}) })
return; return;
} }
this.applyParam = { uni.setStorageSync('workform', this.workform)
...this.applyParam, this.applyParam.workingCategoryId= this.workform.workingCategoryId,
operatStep: 2, this.applyParam.workingCompany=this.workform.workingCompany,
certificate: this.picList.join(',') this.applyParam.position= this.workform.position,
} this.applyParam.workingStart= this.workform.workingStart,
this.applyParam.workingEnd=this.workform.workingEnd,
this.applyParam.certificate=this.workform.certificate,
this.applyParam.approvalStatus= this.workform.approvalStatus,
this.applyParam = {
...this.applyParam,
operatStep: 2,
certificate: this.picList.join(',')
}
api.saveApplyInfo(this.applyParam).then((res) => { api.saveApplyInfo(this.applyParam).then((res) => {
// this.queryById(null, uni.getStorageSync('cffp_userId'))
if (res['success']) { if (res['success']) {
this.queryById(null, uni.getStorageSync('cffp_userId'))
uni.setStorageSync('REFRESH', true)
uni.navigateTo({ uni.navigateTo({
// url:`id-card?id=${res['data']['id']}` // url:`id-card?id=${res['data']['id']}`
url: `id-card` url: `id-card`
...@@ -219,6 +234,7 @@ ...@@ -219,6 +234,7 @@
}) })
return; return;
} }
uni.hideLoading()
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
...@@ -228,27 +244,34 @@ ...@@ -228,27 +244,34 @@
} }
}, },
queryById(id, userId) { queryById(id, userId) {
uni.showLoading({
title: '加载中...'
});
api.queryById({ api.queryById({
id: id, id: id,
userId: userId userId: userId
}).then((res) => { }).then((res) => {
console.log(res) console.log(res)
if (res['success']) { if (res['success']) {
console.log(res, 144)
this.applyParam = res['data']['data']; this.applyParam = res['data']['data'];
if(uni.getStorageSync('workform')){
this.workform = uni.getStorageSync('workform')
}else {
this.workform.workingCategoryId = this.applyParam.workingCategoryId;
this.workform.workingCompany = this.applyParam.workingCompany;
this.workform.position = this.applyParam.position;
this.workform.workingStart = this.applyParam.workingStart;
this.workform.workingEnd = this.applyParam.workingEnd;
this.workform.certificate = this.applyParam.certificate;
this.workform.approvalStatus = this.applyParam.approvalStatus;
}
this.workform.id = this.applyParam.id
if (this.applyParam.certificate) { if (this.applyParam.certificate) {
this.picList = this.applyParam.certificate.split(','); this.picList = this.applyParam.certificate.split(',');
} }
for (let i = 0; i < this.industry.length; i++) { for (let i = 0; i < this.industry.length; i++) {
if (this.applyParam.workingCategoryId == this.industry[i].industryId) { if (this.workform.workingCategoryId == this.industry[i].industryId) {
this.industryIdx = i; this.industryIdx = i;
} }
} }
} }
uni.hideLoading()
}) })
} }
}, },
......
...@@ -174,11 +174,16 @@ ...@@ -174,11 +174,16 @@
}) })
}, },
userCoursePackBar(packFileId,orderId,state){ userCoursePackBar(packFileId,orderId,state){
console.log(packFileId,orderId,state, 1141)
if(!packFileId || !orderId){ if(!packFileId || !orderId){
return false; return false;
} }
this.userCoursePackBarList = {}
this.userStudyCountList.barInfos.forEach(item=>item.state=false); this.userStudyCountList.barInfos.forEach(item=>item.state=false);
this.userStudyCountList.barInfos.filter(item=>item.orderId==orderId)[0].state = !state; this.userStudyCountList.barInfos.filter(item=>item.orderId==orderId)[0].state = !state;
if(state){
return false
}
api.userCoursePackBar({userId:this.userId,packFileId:packFileId,orderId:orderId}).then(res=>{ api.userCoursePackBar({userId:this.userId,packFileId:packFileId,orderId:orderId}).then(res=>{
if(res['success']){ if(res['success']){
this.userCoursePackBarList = res['data']['barInfos']; this.userCoursePackBarList = res['data']['barInfos'];
......
...@@ -250,7 +250,7 @@ export default { ...@@ -250,7 +250,7 @@ export default {
create() { create() {
// /uni_modules/lsj-upload/hybrid/html/uploadFile.html // /uni_modules/lsj-upload/hybrid/html/uploadFile.html
// 若iOS端服务端处理不了跨域就将hybrid目录内的html放到服务端去,并将此处path改成服务器上的地址 // 若iOS端服务端处理不了跨域就将hybrid目录内的html放到服务端去,并将此处path改成服务器上的地址
let path = '../../hybrid/html/uploadFile.html'; let path = '/hybrid/html/uploadFile.html';
let dom = this.lsjFile.create(path); let dom = this.lsjFile.create(path);
// #ifdef H5 // #ifdef H5
this.$refs.lsj.$el.appendChild(dom); this.$refs.lsj.$el.appendChild(dom);
......
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title class="title">[文件管理器]</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<style type="text/css">
.content {background: transparent;}
.btn {position: relative;top: 0;left: 0;bottom: 0;right: 0;}
.btn .file {position: fixed;z-index: 93;left: 0;right: 0;top: 0;bottom: 0;width: 100%;opacity: 0;}
</style>
</head>
<body>
<div id="content" class="content">
<div class="btn">
<input multiple @change="onChange" :accept="accept" ref="file" class="file" type="file" />
</div>
</div>
<script type="text/javascript" src="js/vue.min.js"></script>
<script type="text/javascript">
let _this;
var vm = new Vue({
el: '#content',
data: {
accept: '',
},
mounted() {
console.log('加载webview');
_this = this;
this.files = new Map();
document.addEventListener('plusready', (e)=>{
let {debug,instantly,prohibited} = plus.webview.currentWebview();
this.debug = debug;
this.instantly = instantly;
this.prohibited = prohibited;
this.accept = prohibited.accept;
location.href = 'callback?retype=updateOption';
}, false);
},
methods: {
toast(msg) {
plus.nativeUI.toast(msg);
},
clear(name) {
if (!name) {
this.files.clear();
return;
}
this.files.delete(name);
},
setData(option='{}') {
this.debug&&console.log('更新参数:'+option);
try{
_this.option = JSON.parse(option);
}catch(e){
console.error('参数设置错误');
console.error(e);
}
},
async upload(name=''){
if (name && this.files.has(name)) {
await this.createUpload(this.files.get(name));
}
else {
for (let item of this.files.values()) {
if (item.type === 'waiting' || item.type === 'fail') {
await this.createUpload(item);
}
}
}
},
onChange(e) {
let fileDom = this.$refs.file;
let file = fileDom.files[0];
let name = file.name;
fileDom.value = '';
this.debug&&console.log('文件名称',name,'大小',file.size);
if (file) {
// 限制文件格式
let suffix = name.substring(name.lastIndexOf(".")+1).toLowerCase();
let formats = this.prohibited.formats.toLowerCase();
if (formats&&!formats.includes(suffix)) {
this.toast(`不支持上传${suffix.toUpperCase()}格式文件`);
return;
}
console.log('this.size',this.prohibited.size);
// 限制文件大小
if (file.size > 1024 * 1024 * Math.abs(this.prohibited.size)) {
this.toast(`附件大小请勿超过${this.prohibited.size}M`)
return;
}
let path = URL.createObjectURL(file);
this.files.set(file.name,{file,path,name: file.name,size: file.size,progress: 0,type: 'waiting'});
this.callChange();
this.instantly&&this.upload();
}
},
/**
* @returns {Map} 已选择的文件Map集
*/
callChange() {
location.href = 'callback?retype=change&files=' + escape(JSON.stringify([...this.files]));
},
/**
* @returns {object} 正在处理的当前对象
*/
changeFilesItem(item,end='') {
this.files.set(item.name,item);
location.href = 'callback?retype=progress&end='+ end +'&item=' + escape(JSON.stringify(item));
},
createUpload(item) {
this.debug&&console.log('准备上传,option=:'+JSON.stringify(this.option));
item.type = 'loading';
delete item.responseText;
return new Promise((resolve,reject)=>{
let {url,name,method='POST',header={},formData={}} = this.option;
let form = new FormData();
for (let keys in formData) {
form.append(keys, JSON.stringify(formData[keys]))
}
form.append(name, item.file);
let xmlRequest = new XMLHttpRequest();
xmlRequest.open(method, url, true);
for (let keys in header) {
xmlRequest.setRequestHeader(keys, header[keys])
}
xmlRequest.upload.addEventListener(
'progress',
event => {
if (event.lengthComputable) {
let progress = Math.ceil((event.loaded * 100) / event.total)
if (progress <= 100) {
item.progress = progress;
this.changeFilesItem(item);
}
}
},
false
);
xmlRequest.ontimeout = () => {
console.error('请求超时')
item.type = 'fail';
this.changeFilesItem(item,true);
return resolve(false);
}
xmlRequest.onreadystatechange = ev => {
if (xmlRequest.readyState == 4) {
if (xmlRequest.status == 200) {
this.debug && console.log('上传完成:' + xmlRequest.responseText)
item['responseText'] = xmlRequest.responseText;
item.type = 'success';
this.changeFilesItem(item,true);
return resolve(true);
} else if (xmlRequest.status == 0) {
console.error('status = 0 :请检查请求头Content-Type与服务端是否匹配,服务端已正确开启跨域,并且nginx未拦截阻止请求')
}
console.error('--ERROR--:status = ' + xmlRequest.status)
item.type = 'fail';
this.changeFilesItem(item,true);
return resolve(false);
}
}
xmlRequest.send(form)
});
}
}
});
</script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment