师傅入驻不同状态下的展示及跳转
This commit is contained in:
parent
abd92a200c
commit
600dd845e3
|
|
@ -106,8 +106,7 @@ export default {
|
||||||
let registerRes = await this.registerUser({
|
let registerRes = await this.registerUser({
|
||||||
openId: openId,
|
openId: openId,
|
||||||
name: userInfo.userInfo.nickName,
|
name: userInfo.userInfo.nickName,
|
||||||
workerLogoUrl: userInfo.userInfo.avatarUrl,
|
workerLogoUrl: userInfo.userInfo.avatarUrl
|
||||||
status: 0
|
|
||||||
});
|
});
|
||||||
if (registerRes.code === 0) {
|
if (registerRes.code === 0) {
|
||||||
wxGetUserRes = await this.qryUserInfo(openId);
|
wxGetUserRes = await this.qryUserInfo(openId);
|
||||||
|
|
@ -228,6 +227,11 @@ export default {
|
||||||
}
|
}
|
||||||
return userInfo;
|
return userInfo;
|
||||||
},
|
},
|
||||||
|
async updateCurUserCache() {
|
||||||
|
let curUserInfo = await this.getCurUserNoCache();
|
||||||
|
uni.setStorageSync('userProfile', curUserInfo);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
async uploadFile(filePath) {
|
async uploadFile(filePath) {
|
||||||
let res = await uni.uploadFile({
|
let res = await uni.uploadFile({
|
||||||
url: this.address + '/tool/qiniu/upload',
|
url: this.address + '/tool/qiniu/upload',
|
||||||
|
|
@ -454,4 +458,27 @@ export default {
|
||||||
})
|
})
|
||||||
return res[1].data;
|
return res[1].data;
|
||||||
},
|
},
|
||||||
|
async getWorkerArea(params = {}) {
|
||||||
|
let res = await uni.request({
|
||||||
|
url: '/worker/area/worker',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
return res[1].data;
|
||||||
|
},
|
||||||
|
async getWorkerGoodsCategory(params = {}) {
|
||||||
|
let res = await uni.request({
|
||||||
|
url: '/worker/goods/category/worker',
|
||||||
|
method: 'GET',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
return res[1].data;
|
||||||
|
},
|
||||||
|
async getWorkerSpecialSkill(params = {}) {
|
||||||
|
let res = await uni.request({
|
||||||
|
url: '/worker/special/skill/' + params.workerId,
|
||||||
|
method: 'POST'
|
||||||
|
})
|
||||||
|
return res[1].data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@
|
||||||
"path": "personal-info"
|
"path": "personal-info"
|
||||||
}, {
|
}, {
|
||||||
"path": "account-security"
|
"path": "account-security"
|
||||||
|
}, {
|
||||||
|
"path": "master-settled-info"
|
||||||
}]
|
}]
|
||||||
}],
|
}],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
}, {
|
}, {
|
||||||
name: '师傅入驻',
|
name: '师傅入驻',
|
||||||
icon: 'profile',
|
icon: 'profile',
|
||||||
pageUrl: '/pages/my/master-occupancy'
|
pageUrl: '/pages/my/master-settled-info'
|
||||||
}, {
|
}, {
|
||||||
name: '个人信息',
|
name: '个人信息',
|
||||||
icon: 'lock',
|
icon: 'lock',
|
||||||
|
|
@ -113,9 +113,14 @@
|
||||||
this.myInfo = await this.$api.data('myInfo');
|
this.myInfo = await this.$api.data('myInfo');
|
||||||
},
|
},
|
||||||
clickMenuItem(menu) {
|
clickMenuItem(menu) {
|
||||||
uni.navigateTo({
|
if (menu.prefixFun) {
|
||||||
url: menu.pageUrl
|
this[menu.prefixFun]();
|
||||||
})
|
}
|
||||||
|
if (menu.pageUrl) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: menu.pageUrl
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -459,56 +459,70 @@
|
||||||
this.curStep = this.curStep === 0 ? 0 : --this.curStep;
|
this.curStep = this.curStep === 0 ? 0 : --this.curStep;
|
||||||
},
|
},
|
||||||
async submit() {
|
async submit() {
|
||||||
let workerId = this.curUserInfo.workerId;
|
// let workerId = this.curUserInfo.workerId;
|
||||||
let workerAreas = [];
|
// let workerAreas = [];
|
||||||
let goodsCategories = [];
|
// let goodsCategories = [];
|
||||||
let specialSkills = [];
|
// let specialSkills = [];
|
||||||
// 区域参数
|
// // 区域参数
|
||||||
this.servArea.forEach((item) => {
|
// this.servArea.forEach((item) => {
|
||||||
item.streetIds.forEach((streetId) => {
|
// item.streetIds.forEach((streetId) => {
|
||||||
workerAreas.push({
|
// workerAreas.push({
|
||||||
workerId: workerId,
|
// workerId: workerId,
|
||||||
provinceId: item.provinceObj.areaId,
|
// provinceId: item.provinceObj.areaId,
|
||||||
cityId: item.cityObj.areaId,
|
// cityId: item.cityObj.areaId,
|
||||||
districtId: item.districtObj.areaId,
|
// districtId: item.districtObj.areaId,
|
||||||
streetId: streetId
|
// streetId: streetId
|
||||||
})
|
// })
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
// 服务品类参数
|
// // 服务品类参数
|
||||||
this.servSkill.forEach((item) => {
|
// this.servSkill.forEach((item) => {
|
||||||
item.subSubTypeIds.forEach((goodsCategoryId) => {
|
// item.subSubTypeIds.forEach((goodsCategoryId) => {
|
||||||
goodsCategories.push({
|
// goodsCategories.push({
|
||||||
workerId: workerId,
|
// workerId: workerId,
|
||||||
goodsCategoryId: goodsCategoryId
|
// goodsCategoryId: goodsCategoryId
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
// 特殊技能参数
|
// // 特殊技能参数
|
||||||
this.specialSkill.forEach((item) => {
|
// this.specialSkill.forEach((item) => {
|
||||||
specialSkills.push({
|
// specialSkills.push({
|
||||||
workerId: workerId,
|
// workerId: workerId,
|
||||||
specialSkillId: item.specialSkillObj.specialSkillId,
|
// specialSkillId: item.specialSkillObj.specialSkillId,
|
||||||
credential: item.skillCert[0],
|
// credential: item.skillCert[0],
|
||||||
insurance: item.insurCert[0],
|
// insurance: item.insurCert[0],
|
||||||
insuranceStart: item.insurStartDate,
|
// insuranceStart: item.insurStartDate,
|
||||||
insuranceEnd: item.insurEndDate
|
// insuranceEnd: item.insurEndDate
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
let params = {
|
// let params = {
|
||||||
workerId: workerId,
|
// workerId: workerId,
|
||||||
workerAreas: workerAreas,
|
// workerAreas: workerAreas,
|
||||||
goodsCategories: goodsCategories,
|
// goodsCategories: goodsCategories,
|
||||||
specialSkills: specialSkills
|
// specialSkills: specialSkills
|
||||||
}
|
// }
|
||||||
console.log(params)
|
// let res = await this.$request.workerSettled(params);
|
||||||
let res = await this.$request.workerSettled(params);
|
// if (res.code === 0) {
|
||||||
if (res.code === 0) {
|
// uni.showToast({
|
||||||
uni.showToast({
|
// icon: 'success',
|
||||||
icon: 'success',
|
// title: '提交成功'
|
||||||
title: '提交成功'
|
// })
|
||||||
})
|
// // 更新当前缓存的用户信息
|
||||||
|
// let updateCurUserCacheRes = await this.$request.updateCurUserCache();
|
||||||
|
// if (updateCurUserCacheRes) {
|
||||||
|
// uni.navigateBack({
|
||||||
|
// delta: -1
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'success',
|
||||||
|
title: '提交成功'
|
||||||
|
})
|
||||||
|
// 更新当前缓存的用户信息
|
||||||
|
let updateCurUserCacheRes = await this.$request.updateCurUserCache();
|
||||||
|
if (updateCurUserCacheRes) {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: -1
|
delta: -1
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 顶部操作条 -->
|
||||||
|
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
|
||||||
|
<block slot="backText">返回</block>
|
||||||
|
<block slot="content">师傅入驻信息</block>
|
||||||
|
</cu-custom>
|
||||||
|
<view v-if="curUserInfo.status === 1" class="margin bg-white padding">
|
||||||
|
<view class="margin-bottom-sm">账户未审核,请填写入驻信息</view>
|
||||||
|
<button class="cu-btn bg-main-color shadow-blur" @click="navigate2ApplySettled">填写入驻信息</button>
|
||||||
|
</view>
|
||||||
|
<view v-else class="margin bg-white">
|
||||||
|
<view class="padding">
|
||||||
|
<view class="text-black text-bold">服务区域:</view>
|
||||||
|
<view v-for="(item,index) in servAreas">
|
||||||
|
<text>{{strReplace(item.mergerName, "-", ",")}}</text>
|
||||||
|
<!-- <text v-if="index !== servAreas.length - 1">,</text> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="padding">
|
||||||
|
<view class="text-black text-bold">服务技能:</view>
|
||||||
|
<view v-for="(item,index) in servSkills">
|
||||||
|
<text>{{item.goodsCategoryName}}</text>
|
||||||
|
<!-- <text v-if="index !== servSkills.length - 1">,</text> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="padding">
|
||||||
|
<view class="text-black text-bold">特殊技能:</view>
|
||||||
|
<view class="solid margin-top-sm padding-sm" v-for="(item,index) in servSpecialSkills">
|
||||||
|
<view class="margin-bottom-xs">类目:{{item.specialSkillName}}</view>
|
||||||
|
<view class="margin-bottom-xs">是否危险技能:{{item.dangerous === 0 ? '否' : '是'}}</view>
|
||||||
|
<view class="margin-bottom-xs">
|
||||||
|
<view class="margin-bottom-xs">技能证书:</view>
|
||||||
|
<image style="width: 200px; height: 200px; background-color: #eeeeee;" mode="aspectFit"
|
||||||
|
:src="item.credential" :data-url="item.credential" @click="viewImage($event, [item.credential])"></image>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.dangerous == 1" class="margin-bottom-xs">
|
||||||
|
<view class="margin-bottom-xs">保险证明:</view>
|
||||||
|
<image style="width: 200px; height: 200px; background-color: #eeeeee;" mode="aspectFit"
|
||||||
|
:src="item.insurance" :data-url="item.insurance" @click="viewImage($event, [item.insurance])"></image>
|
||||||
|
</view>
|
||||||
|
<view>保险生效时期:{{item.insuranceStart}} ~ {{item.insuranceEnd}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="padding">
|
||||||
|
<text class="text-black text-bold">审核状态:</text>
|
||||||
|
<text v-if="curUserInfo.status === 0" class="text-green">审核通过</text>
|
||||||
|
<text v-else-if="curUserInfo.status === 3" class="text-yellow">审核中</text>
|
||||||
|
<text v-else-if="curUserInfo.status === 4" class="text-red">审核未通过</text>
|
||||||
|
<button class="cu-btn bg-main-color margin-left-sm shadow-blur" v-if="curUserInfo.status === 4" @click="navigate2ApplySettled">重新填写入驻信息</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
curUserInfo: {},
|
||||||
|
servAreas: [],
|
||||||
|
servSkills: [],
|
||||||
|
servSpecialSkills: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// onLoad() {
|
||||||
|
// this.loadData();
|
||||||
|
// },
|
||||||
|
onShow() {
|
||||||
|
this.loadData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
loadData() {
|
||||||
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
|
this.loadServAreas();
|
||||||
|
this.loadServSkills();
|
||||||
|
this.loadSpecialSkills();
|
||||||
|
},
|
||||||
|
async loadServAreas() {
|
||||||
|
let res = await this.$request.getWorkerArea({
|
||||||
|
workerId: this.curUserInfo.workerId
|
||||||
|
});
|
||||||
|
this.servAreas = res.data;
|
||||||
|
},
|
||||||
|
async loadServSkills() {
|
||||||
|
let res = await this.$request.getWorkerGoodsCategory({
|
||||||
|
workerId: this.curUserInfo.workerId
|
||||||
|
});
|
||||||
|
this.servSkills = res.data;
|
||||||
|
},
|
||||||
|
async loadSpecialSkills() {
|
||||||
|
let res = await this.$request.getWorkerSpecialSkill({
|
||||||
|
workerId: this.curUserInfo.workerId
|
||||||
|
});
|
||||||
|
this.servSpecialSkills = res.data;
|
||||||
|
},
|
||||||
|
viewImage(e, imgList) {
|
||||||
|
uni.previewImage({
|
||||||
|
urls: imgList,
|
||||||
|
current: e.currentTarget.dataset.url
|
||||||
|
});
|
||||||
|
},
|
||||||
|
navigate2ApplySettled() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/my/master-occupancy'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
strReplace(wholeStr, newStr, oldStr) {
|
||||||
|
if (wholeStr && wholeStr.length > 0) {
|
||||||
|
wholeStr = wholeStr.replaceAll(oldStr, newStr);
|
||||||
|
}
|
||||||
|
return wholeStr;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue