打卡新增身份证、银行卡上传-1202

master
Lee 2022-12-02 15:13:41 +08:00
parent 61882a2728
commit b068cb53d5
28 changed files with 342 additions and 34 deletions

View File

@ -283,7 +283,11 @@ page{
box-sizing: border-box; box-sizing: border-box;
width: calc(100% - 90rpx); width: calc(100% - 90rpx);
border-radius: 10rpx; border-radius: 10rpx;
padding: 40rpx 25rpx 50rpx; padding: 10rpx 25rpx 0;
border-top: 30rpx solid #ffffff;
border-bottom: 30rpx solid #ffffff;
max-height: 80vh;
overflow-y: auto;
} }
.register-information .item{ .register-information .item{
@ -308,6 +312,11 @@ page{
padding: 0 10rpx; padding: 0 10rpx;
border: 2rpx solid #dcdcdc; border: 2rpx solid #dcdcdc;
border-radius: 5rpx; border-radius: 5rpx;
}
.register-information .item .textarea{
padding: 10rpx;
height: 90px;
line-height: 1.6;
} }
.register-information .submit-btn{ .register-information .submit-btn{
width: calc(100% - 170rpx); width: calc(100% - 170rpx);
@ -326,7 +335,55 @@ page{
width: 19rpx; width: 19rpx;
height: 14rpx; height: 14rpx;
margin-right: 5rpx; margin-right: 5rpx;
} }
.register-information .item-other{
height: auto;
}
.register-information .item-other>.upload-box{
display: flex;
box-sizing: border-box;
width: calc(100% - 170rpx);
}
.register-information .item-other .img{
position: relative;
width: 160rpx;
height: 120rpx;
margin-right: 10rpx;
border-radius: 10rpx;
overflow: hidden;
}
.register-information .item-other .img>image:first-child{
width: 100%;
min-height: 100%;
}
.register-information .item-other .del-btn{
width: 30rpx;
height: 30rpx;
position: absolute;
right: 2rpx;
top: 2rpx;
}
.register-information .item-other .upload-btn{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 160rpx;
height: 120rpx;
border: 2rpx solid #dcdcdc;
margin-right: 10rpx;
border-radius: 10rpx;
overflow: hidden;
}
.register-information .item-other .upload-btn image{
width: 36rpx;
height: 36rpx;
margin-bottom: 6rpx;
}
/* 加班 */ /* 加班 */
.overtime-from{ .overtime-from{

View File

@ -111,7 +111,37 @@
<view class="item"> <view class="item">
<view class="title">身份证</view> <view class="title">身份证</view>
<input class="input" type="text" v-model="registerObj.card_number"> <input class="input" type="text" v-model="registerObj.card_number">
</view> </view>
<view class="item item-other">
<view class="title">
<text>
身份证照片
(正反面)
</text>
</view>
<view class="upload-box">
<view class="img" v-if="idImgList[0]!==''">
<image :src="idImgList[0]" mode="widthFix"></image>
<image class="del-btn" src="/static/icon/icon-del.png" mode="widthFix" @tap="delImg(index,'positive')"></image>
</view>
<view class="upload-btn" @tap="changeImg('positive')" v-if="idImgList[0]==''">
<image src="/static/icon/icon-release.png" mode="widthFix"></image>
<text class="font22 color-99">身份证正面</text>
</view>
<view class="img" v-if="idImgList[1]!==''">
<image :src="idImgList[1]" mode="widthFix"></image>
<image class="del-btn" src="/static/icon/icon-del.png" mode="widthFix" @tap="delImg(index,'back')"></image>
</view>
<view class="upload-btn" @tap="changeImg('back')" v-if="idImgList[1]==''">
<image src="/static/icon/icon-release.png" mode="widthFix"></image>
<text class="font22 color-99">身份证反面</text>
</view>
</view>
</view>
<view class="item">
<view class="title">现住地址</view>
<input class="input" type="text" v-model="registerObj.address">
</view>
<view class="item"> <view class="item">
<view class="title">技术岗位</view> <view class="title">技术岗位</view>
<picker class="input" mode="selector" :range="positionList" @change="choicePosition" :value="positionIndex" :range-key="'name'"> <picker class="input" mode="selector" :range="positionList" @change="choicePosition" :value="positionIndex" :range-key="'name'">
@ -124,7 +154,7 @@
<view class="item"> <view class="item">
<view class="title">工资</view> <view class="title">工资</view>
<input class="input" type="number" v-model="registerObj.pay"> <input class="input" type="number" v-model="registerObj.pay">
</view> </view>
<view class="item"> <view class="item">
<view class="title">紧急联系人</view> <view class="title">紧急联系人</view>
<input class="input" type="text" v-model="registerObj.emergency_contact"> <input class="input" type="text" v-model="registerObj.emergency_contact">
@ -144,7 +174,24 @@
<view class="item"> <view class="item">
<view class="title">开户行</view> <view class="title">开户行</view>
<input class="input" type="text" v-model="registerObj.bank_name"> <input class="input" type="text" v-model="registerObj.bank_name">
</view> </view>
<view class="item item-other">
<view class="title">银行卡照片</view>
<view class="upload-box">
<view class="img" v-if="registerObj.bank_img!==''">
<image :src="registerObj.bank_img" mode="widthFix"></image>
<image class="del-btn" src="/static/icon/icon-del.png" mode="widthFix" @tap="delImg(index,'bank')"></image>
</view>
<view class="upload-btn" @tap="changeImg('bank')" v-if="registerObj.bank_img==''">
<image src="/static/icon/icon-release.png" mode="widthFix"></image>
<text class="font22 color-99">银行卡</text>
</view>
</view>
</view>
<view class="item item-other" style="align-items: flex-start;">
<view class="title">工作经验</view>
<textarea class="input textarea" v-model="registerObj.experience"></textarea>
</view>
<view class="submit-btn bg-blue color-white font30" @tap="submitRegister"></view> <view class="submit-btn bg-blue color-white font30" @tap="submitRegister"></view>
</view> </view>
</view> </view>
@ -194,8 +241,12 @@
bank_card_name:'', bank_card_name:'',
bank_card_number:'', bank_card_number:'',
bank_name:'', bank_name:'',
worksite_id:-1 worksite_id:-1,
}, // experience:'',
address:'',
bank_img:'',
}, //
idImgList:['',''], //
positionList:[], // positionList:[], //
positionIndex:0, // positionIndex:0, //
finish:false, // finish:false, //
@ -204,9 +255,9 @@
timer:false, // timer:false, //
noticeInfo:'', // noticeInfo:'', //
isNotice:false, // isNotice:false, //
notice:'', // notice:'', //
ifNotice:false, // ifNotice:false, //
stagingImg:'', //img
} }
}, },
onPageScroll(object){ onPageScroll(object){
@ -231,7 +282,7 @@
// //
this.getLocationEv(0); this.getLocationEv(0);
}, },
onShow() { onShow() {
// //
this.getSignInfo(); this.getSignInfo();
// //
@ -602,6 +653,53 @@
this.$toolAll.tools.showToast(res.msg); this.$toolAll.tools.showToast(res.msg);
} }
}) })
},
//
changeImg(type){
uni.chooseImage({
count: 1, //9
sourceType: ['album','camera'], //
success: (res)=> {
this.stagingImg = res.tempFilePaths[0];
//
this.uploadImg(type);
}
})
},
//
uploadImg(type){
uni.showLoading({
title: '上传中'
});
this.$requst.upload('/api/v1/file/upload/image',{path:this.stagingImg}).then(res=>{
if(res.code==0) {
if(type=='positive'){
this.idImgList[0] = this.$hostHttp+res.data.src;
}
if(type=='back'){
this.idImgList[1] = this.$hostHttp+res.data.src;
}
if(type=='bank'){
this.registerObj.bank_img = this.$hostHttp+res.data.src;
}
}
uni.hideLoading();
})
},
//
delImg(index,type){
if(type=='positive'){
this.idImgList[0] = '';
}
if(type=='back'){
this.idImgList[1] = '';
}
if(type=='bank'){
this.registerObj.bank_img = '';
}
} }
} }
} }

BIN
static/icon/icon-del.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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

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

File diff suppressed because one or more lines are too long

View File

@ -462,7 +462,11 @@ page{
box-sizing: border-box; box-sizing: border-box;
width: calc(100% - 90rpx); width: calc(100% - 90rpx);
border-radius: 10rpx; border-radius: 10rpx;
padding: 40rpx 25rpx 50rpx; padding: 10rpx 25rpx 0;
border-top: 30rpx solid #ffffff;
border-bottom: 30rpx solid #ffffff;
max-height: 80vh;
overflow-y: auto;
} }
.register-information .item{ .register-information .item{
display: flex; display: flex;
@ -486,6 +490,11 @@ page{
border: 2rpx solid #dcdcdc; border: 2rpx solid #dcdcdc;
border-radius: 5rpx; border-radius: 5rpx;
} }
.register-information .item .textarea{
padding: 10rpx;
height: 90px;
line-height: 1.6;
}
.register-information .submit-btn{ .register-information .submit-btn{
width: calc(100% - 170rpx); width: calc(100% - 170rpx);
line-height: 80rpx; line-height: 80rpx;
@ -503,6 +512,51 @@ page{
width: 19rpx; width: 19rpx;
height: 14rpx; height: 14rpx;
margin-right: 5rpx; margin-right: 5rpx;
}
.register-information .item-other{
height: auto;
}
.register-information .item-other>.upload-box{
display: flex;
box-sizing: border-box;
width: calc(100% - 170rpx);
}
.register-information .item-other .img{
position: relative;
width: 160rpx;
height: 120rpx;
margin-right: 10rpx;
border-radius: 10rpx;
overflow: hidden;
}
.register-information .item-other .img>image:first-child{
width: 100%;
min-height: 100%;
}
.register-information .item-other .del-btn{
width: 30rpx;
height: 30rpx;
position: absolute;
right: 2rpx;
top: 2rpx;
}
.register-information .item-other .upload-btn{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 160rpx;
height: 120rpx;
border: 2rpx solid #dcdcdc;
margin-right: 10rpx;
border-radius: 10rpx;
overflow: hidden;
}
.register-information .item-other .upload-btn image{
width: 36rpx;
height: 36rpx;
margin-bottom: 6rpx;
} }
/* 加班 */ /* 加班 */
.overtime-from{ .overtime-from{

View File

@ -316,6 +316,53 @@ __webpack_require__.r(__webpack_exports__);
@ -376,8 +423,12 @@ __webpack_require__.r(__webpack_exports__);
bank_card_name: '', bank_card_name: '',
bank_card_number: '', bank_card_number: '',
bank_name: '', bank_name: '',
worksite_id: -1 }, worksite_id: -1,
experience: '',
address: '',
bank_img: '' },
//工人注册信息 //工人注册信息
idImgList: ['', ''], //身份证照片
positionList: [], //技术岗位 positionList: [], //技术岗位
positionIndex: 0, //当前技术岗位 positionIndex: 0, //当前技术岗位
finish: false, //是否完成打卡 finish: false, //是否完成打卡
@ -386,9 +437,9 @@ __webpack_require__.r(__webpack_exports__);
timer: false, //计时器状态 timer: false, //计时器状态
noticeInfo: '', //审核通知 noticeInfo: '', //审核通知
isNotice: false, //是否显示通知 isNotice: false, //是否显示通知
notice: '', //公告 notice: '', //公告
ifNotice: false //是否显示公告 ifNotice: false, //是否显示公告
stagingImg: '' //暂存img
}; };
}, },
onPageScroll: function onPageScroll(object) { onPageScroll: function onPageScroll(object) {
@ -784,6 +835,53 @@ __webpack_require__.r(__webpack_exports__);
_this13.$toolAll.tools.showToast(res.msg); _this13.$toolAll.tools.showToast(res.msg);
} }
}); });
},
// 选择图片
changeImg: function changeImg(type) {var _this14 = this;
uni.chooseImage({
count: 1, //默认9
sourceType: ['album', 'camera'], //从相册选择
success: function success(res) {
_this14.stagingImg = res.tempFilePaths[0];
// 上传图片
_this14.uploadImg(type);
} });
},
// 上传图片
uploadImg: function uploadImg(type) {var _this15 = this;
uni.showLoading({
title: '上传中' });
this.$requst.upload('/api/v1/file/upload/image', { path: this.stagingImg }).then(function (res) {
if (res.code == 0) {
if (type == 'positive') {
_this15.idImgList[0] = _this15.$hostHttp + res.data.src;
}
if (type == 'back') {
_this15.idImgList[1] = _this15.$hostHttp + res.data.src;
}
if (type == 'bank') {
_this15.registerObj.bank_img = _this15.$hostHttp + res.data.src;
}
}
uni.hideLoading();
});
},
// 删除图片
delImg: function delImg(index, type) {
if (type == 'positive') {
this.idImgList[0] = '';
}
if (type == 'back') {
this.idImgList[1] = '';
}
if (type == 'bank') {
this.registerObj.bank_img = '';
}
} } };exports.default = _default; } } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"])) /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB