前端代码完成-1122

master
Lee 2022-11-22 13:47:31 +08:00
parent ab54159785
commit d80f36ce12
24 changed files with 502 additions and 257 deletions

View File

@ -176,6 +176,74 @@ page{
z-index: 999; z-index: 999;
} }
/* 打卡类型 */
.sign-cate{
box-sizing: border-box;
width: calc(100% - 150rpx);
border-radius: 10rpx;
padding: 40rpx 60rpx;
}
.sign-cate .title{
font-weight: bold;
text-align: center;
}
.sign-cate .txt{
display: flex;
align-items: center;
justify-content: space-around;
}
.sign-cate .radio-item{
display: flex;
align-items: center;
height: 60rpx;
margin: 30rpx 0 40rpx;
}
.sign-cate .radio-item>view:first-child{
box-sizing: border-box;
width: 30rpx;
height: 30rpx;
border: 2rpx solid #bdbdbd;
border-radius: 100%;
margin-right: 6rpx;
position: relative;
}
.sign-cate .radio-item>view.checked{
border: 2rpx solid #0788ff;
}
.sign-cate .radio-item>view.checked::after{
content: "";
display: block;
width: 18rpx;
height: 18rpx;
border-radius: 100%;
background-color: #0788ff;
position: absolute;
left: 5rpx;
top: 5rpx;
z-index: 1;
}
.sign-cate-btns{
display: flex;
justify-content: space-around;
align-items: center;
}
.sign-cate-btns .btn{
width: calc(50% - 30rpx);
line-height: 70rpx;
border-radius: 5rpx;
text-align: center;
}
.sign-cate-btns .btn:first-child{
background-color: #b5b5b5;
}
.sign-cate-btns .btn:last-child{
background-image: linear-gradient(to right,#028bfd,#02b4fe);
}
/* 安全公告 */ /* 安全公告 */
.safety-bulletin{ .safety-bulletin{
box-sizing: border-box; box-sizing: border-box;

View File

@ -27,6 +27,7 @@
<text>姓名{{item.worker_name}}</text> <text>姓名{{item.worker_name}}</text>
<text>加班时长{{item.time}}小时</text> <text>加班时长{{item.time}}小时</text>
<text>提交时间{{item.create_time}}</text> <text>提交时间{{item.create_time}}</text>
<text>备注{{item.remarks}}</text>
</view> </view>
<!-- 待确认 --> <!-- 待确认 -->
<view class="examine-btns font24" v-if="item.status==0"> <view class="examine-btns font24" v-if="item.status==0">
@ -185,6 +186,7 @@
create_time: item.create_time, create_time: item.create_time,
status:item.status, status:item.status,
status_text:item.status_text, status_text:item.status_text,
remarks:item.remarks,
ifcheck:false, ifcheck:false,
} }
overtimeArr.push(obj); overtimeArr.push(obj);

View File

@ -1,12 +1,12 @@
<template> <template>
<view> <view>
<view class='login-header'> <view class='login-header'>
<image class="infoImg" mode="aspectFill" :src="userInfo.avatarUrl || imgSrc"></image> <image class="infoImg" mode="aspectFill" :src="imgSrc"></image>
<view class="logo-name font34 color-00">{{appletName}}</view> <view class="logo-name font34 color-00">{{appletName}}</view>
</view> </view>
<view class="login-footer"> <view class="login-footer">
<view class="login-btn color-white font34 bg-blue" type='primary' @tap="empowerShow=true" v-if="!isActive"></view> <view class="login-btn color-white font34 bg-blue" type='primary' @tap="empowerShow=true" v-if="!isActive"></view>
<view class="login-btn color-white font34 bg-blue" type='primary' @tap="getUserProfileEv" v-else></view> <view class="login-btn color-white font34 bg-blue" type='primary' @tap="getUserProfileEv('other')" v-else></view>
<view class="agreement-box color-33 font28">点击授权登录表示您已阅读<text @tap="toAgreement" class="agreement color-blue">免责声明</text></view> <view class="agreement-box color-33 font28">点击授权登录表示您已阅读<text @tap="toAgreement" class="agreement color-blue">免责声明</text></view>
</view> </view>
<!-- 获取头像&昵称 --> <!-- 获取头像&昵称 -->
@ -36,7 +36,7 @@
</view> </view>
<view class="empower-btns font30"> <view class="empower-btns font30">
<view class="btn color-99" @tap="refuseEv"></view> <view class="btn color-99" @tap="refuseEv"></view>
<view class="btn color-blue" @tap="getUserProfileEv"></view> <view class="btn color-blue" @tap="getUserProfileEv('other')"></view>
</view> </view>
</view> </view>
</view> </view>
@ -60,31 +60,13 @@
}; };
}, },
onLoad() { onLoad() {
if (uni.getUserProfile) {
this.canIGetUserProfile = true;
}
}, },
onShow() { onShow() {
if(uni.getStorageSync('token')){ //
// this.getUserProfileEv('enter');
this.getUserInfo();
}
}, },
methods: { methods: {
//
getUserInfo(){
this.$requst.post('/api/v1/user/info').then(res=>{
if(res.code==0){
console.log(res,'用户信息');
if(res.data.is_active == 1){
this.isActive = true;
this.userInfo.nickName = res.data.nickname;
this.userInfo.avatarUrl = res.data.headimgurl;
}
}
})
},
// logo // logo
setLogo(){ setLogo(){
this.$requst.get('/api/v1/index/base-config').then(res=>{ this.$requst.get('/api/v1/index/base-config').then(res=>{
@ -147,74 +129,89 @@
this.empowerShow = false; this.empowerShow = false;
}, },
// //
getUserProfileEv(e) { checkForm(){
if(!this.isActive){ if(!this.isActive){
if(this.userInfo.avatarUrl==''){ if(this.userInfo.avatarUrl==''){
this.$toolAll.tools.showToast('请选择您的头像!') this.$toolAll.tools.showToast('请选择头像!')
return false; return false;
} }else if(this.userInfo.nickName==''){
if(this.userInfo.nickName==''){ this.$toolAll.tools.showToast('请输入昵称!')
this.$toolAll.tools.showToast('请输入您的昵称!')
return false; return false;
}else{
return true;
} }
}else{
return true;
} }
},
//
getUserProfileEv(status) {
// //
uni.getUserProfile({ uni.login({
desc: '登录', provider: 'weixin',
lang: 'zh_CN', success: (res)=> {
success: (res) => { if (res.code) {
uni.login({ this.updateUserInfo(res.code,status);
provider: 'weixin', } else {
success: (res)=> { uni.showToast({
if (res.code) { title: '登录失败!',
this.updateUserInfo(res.code); duration: 2000
} else { });
uni.showToast({ }
title: '登录失败!',
duration: 2000
});
}
},
});
}, },
fail: (res) => {}
}); });
}, },
// //
updateUserInfo(code) { updateUserInfo(code,status) {
uni.showToast({ if(status=='enter'){
title: '登录中...', this.$requst.post('/api/v1/user/login',{code:code}).then(res => {
icon:'loading', if(res.code == 0){
duration:10000 console.log(res,'进入登录信息');
}) if(res.data.is_active==1){
var params = { this.isActive = true;
code:code, }
nickname: this.userInfo.nickName,//
headimgurl: this.userInfo.avatarUrl,//
is_active:1
}
this.$requst.post('/api/v1/user/login',params).then(res => {
if(res.code == 0){
uni.setStorageSync('userId',res.data.account_id)
uni.setStorageSync('token',res.data.token)//token
uni.setStorageSync('openid',res.data.openid)//openid
uni.setStorageSync('expire',res.data.expire)//
uni.setStorageSync('phone_active',res.data.phone_active)//
uni.setStorageSync('is_active',res.data.is_active)//
if(uni.getStorageSync('page-path-options')) {
uni.reLaunch({ //
url:uni.getStorageSync('page-path-options')
})
} else {
uni.reLaunch({
url:'/pages/pagehome/pagehome'
})
} }
},error => {
})
}
if(status=='other'){
if(this.checkForm()){
uni.showToast({
title: '登录中...',
icon:'loading',
duration:10000
})
var params = {
code:code,
nickname: this.userInfo.nickName,//
headimgurl: this.userInfo.avatarUrl,//
is_active:1
}
this.$requst.post('/api/v1/user/login',params).then(res => {
if(res.code == 0){
uni.setStorageSync('userId',res.data.account_id)
uni.setStorageSync('token',res.data.token)//token
uni.setStorageSync('openid',res.data.openid)//openid
uni.setStorageSync('expire',res.data.expire)//
uni.setStorageSync('phone_active',res.data.phone_active)//
uni.setStorageSync('is_active',res.data.is_active)//
if(uni.getStorageSync('page-path-options')) {
uni.reLaunch({ //
url:uni.getStorageSync('page-path-options')
})
} else {
uni.reLaunch({
url:'/pages/pagehome/pagehome'
})
}
}
},error => {})
} }
},error => {}) }
} }
} }
} }

View File

@ -10,7 +10,7 @@
<text>{{currentDate}}</text> <text>{{currentDate}}</text>
<text>{{currentWeek}}</text> <text>{{currentWeek}}</text>
</view> </view>
<view class="sign-btn" :class="finish?'finish':''" @tap="signEv"> <view class="sign-btn" :class="finish?'finish':''" @tap="showRadioEv">
<text class="font56">{{finish?'已打卡':'打卡'}}</text> <text class="font56">{{finish?'已打卡':'打卡'}}</text>
<text>{{currenTime}}</text> <text>{{currenTime}}</text>
</view> </view>
@ -27,7 +27,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="sign-type bg-yellow font26" @tap="changeSignType" :style="{'top':statusHeight+50+'px'}">{{signType=='in'?'上班':'下班'}}</view>
</view> </view>
<!-- 打卡记录 --> <!-- 打卡记录 -->
<view class="sign-record bg-white"> <view class="sign-record bg-white">
@ -44,6 +43,25 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 打卡类型选择 -->
<view class="pop-up-bg" v-if="showRadio">
<view class="sign-cate bg-white">
<view class="title font34">请确认打卡类型</view>
<view class="txt font28">
<view class="radio-item" @tap="changeSignType(index)" v-for="(item,index) in radioList" :key="index">
<view :class="radioIndex==index?'checked':''"></view>
<view>{{item.title}}</view>
</view>
</view>
<!-- 审核按钮 -->
<view class="sign-cate-btns color-white font30">
<view class="btn" @tap="showRadio=false,radioIndex=0"></view>
<view class="btn" @tap="signEv"></view>
</view>
</view>
</view>
<!-- 安全公告 --> <!-- 安全公告 -->
<view class="pop-up-bg" v-if="!isRead && safetyBulletin!==''"> <view class="pop-up-bg" v-if="!isRead && safetyBulletin!==''">
<view class="safety-bulletin bg-white"> <view class="safety-bulletin bg-white">
@ -122,7 +140,12 @@
frontColor:'#ffffff', // frontColor:'#ffffff', //
backgroudColor:'none', // backgroudColor:'none', //
titleColor:'#ffffff', // titleColor:'#ffffff', //
signType:'in', // in: out: radioList:[
{title:'上班',type:'in'},
{title:'下班',type:'out'}
],//
radioIndex:0, //
showRadio:false, //
currentDate:'', // currentDate:'', //
currentWeek:'', // currentWeek:'', //
currenTime:'', // currenTime:'', //
@ -152,6 +175,7 @@
finish:false, // finish:false, //
flag:true, // flag:true, //
isLoding:false, // isLoding:false, //
timer:false, //
} }
}, },
onPageScroll(object){ onPageScroll(object){
@ -173,13 +197,14 @@
onLoad() { onLoad() {
// //
this.changeStatusNav(); this.changeStatusNav();
// //
this.getLocationEv(0); this.getLocationEv(0);
}, },
onShow() { onShow() {
// //
this.getSignInfo(); this.getSignInfo();
//
this.getSignList();
}, },
methods: { methods: {
// //
@ -325,48 +350,76 @@
this.currentWeek = res.data.info.week; this.currentWeek = res.data.info.week;
// //
this.currenTime = res.data.info.now; this.currenTime = res.data.info.now;
//
this.signList = res.data.list;
// //
setInterval(()=>{ this.setIntervalEv();
let nowArr = this.currenTime.split(':'); }
let hour = parseInt(nowArr[0]); })
let minute = parseInt(nowArr[1]); },
let second = parseInt(nowArr[2]);
if(second<59){ //
second++; setIntervalEv(){
//
this.timer = true;
if(this.timer){
setInterval(()=>{
let nowArr = this.currenTime.split(':');
let hour = parseInt(nowArr[0]);
let minute = parseInt(nowArr[1]);
let second = parseInt(nowArr[2]);
if(second<59){
second++;
}else{
second = 0;
if(minute<59){
minute++;
}else{ }else{
second = 0; minute = 0;
if(minute<59){ if(hour<23){
minute++; hour++;
}else{ }else{
minute = 0; hour = 0;
if(hour<23){
hour++;
}else{
hour = 0;
}
} }
} }
this.currenTime = `${hour<10?'0'+hour:hour}:${minute<10?'0'+minute:minute}:${second<10?'0'+second:second}`; }
},1000) this.currenTime = `${hour<10?'0'+hour:hour}:${minute<10?'0'+minute:minute}:${second<10?'0'+second:second}`;
},1000)
}
},
//
getSignList(){
this.$requst.get('/api/v1/user/sign-today').then(res=>{
if(res.code == 0){
console.log(res,'打卡记录');
// //
this.signList = res.data.list; this.signList = res.data.list;
} }
}) })
}, },
// //
changeSignType(){ showRadioEv(){
if(this.signType == 'in'){ if(!this.finish){
this.signType = 'out'; this.showRadio = true;
this.radioIndex = 0;
}else{ }else{
this.signType = 'in'; this.$toolAll.tools.showToast('您已打卡');
}
},
//
changeSignType(index){
if(this.radioIndex !== index){
this.radioIndex = index;
} }
}, },
// //
signEv(){ signEv(){
let params = { let params = {
type:this.signType, type:this.radioList[this.radioIndex].type,
lat:this.siteInfo.lat, lat:this.siteInfo.lat,
lng:this.siteInfo.lng, lng:this.siteInfo.lng,
worksite_id:this.siteInfo.id worksite_id:this.siteInfo.id
@ -374,12 +427,13 @@
this.$requst.post('/api/v1/worker/sign',params).then(res=>{ this.$requst.post('/api/v1/worker/sign',params).then(res=>{
if(res.code==0){ if(res.code==0){
this.finish = true; this.finish = true;
// this.showRadio = false;
this.getSignInfo(); //
this.getSignList();
// //
setTimeout(()=>{ setTimeout(()=>{
this.finish = false; this.finish = false;
},10000) },60000)
}else{ }else{
this.$toolAll.tools.showToast(res.msg); this.$toolAll.tools.showToast(res.msg);
} }

View File

@ -7,43 +7,43 @@
<view class="enter-detail font26"> <view class="enter-detail font26">
<view class="item"> <view class="item">
<view class="title">姓名</view> <view class="title">姓名</view>
<view class="msg font24"><text v-if="centerDetail.status==0 && centerDetail.real_name!==centerDetail.account.real_name">{{centerDetail.account.real_name}}-</text>{{centerDetail.real_name}}</view> <view class="msg font24"><text v-if="centerDetail.status==1 && centerDetail.real_name!==centerDetail.account.real_name">{{centerDetail.account.real_name}}-</text>{{centerDetail.real_name}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="title">电话</view> <view class="title">电话</view>
<view class="msg font24"><text v-if="centerDetail.status==0 && centerDetail.mobile!==centerDetail.account.mobile">{{centerDetail.account.mobile}}-</text>{{centerDetail.mobile}}</view> <view class="msg font24"><text v-if="centerDetail.status==1 && centerDetail.mobile!==centerDetail.account.mobile">{{centerDetail.account.mobile}}-</text>{{centerDetail.mobile}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="title">身份证</view> <view class="title">身份证</view>
<view class="msg font24"><text v-if="centerDetail.status==0 && centerDetail.card_number!==centerDetail.account.card_number">{{centerDetail.account.card_number}}-</text>{{centerDetail.card_number}}</view> <view class="msg font24"><text v-if="centerDetail.status==1 && centerDetail.card_number!==centerDetail.account.card_number">{{centerDetail.account.card_number}}-</text>{{centerDetail.card_number}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="title">紧急联系人</view> <view class="title">紧急联系人</view>
<view class="msg font24"><text v-if="centerDetail.status==0 && centerDetail.emergency_contact!==centerDetail.account.emergency_contact">{{centerDetail.account.emergency_contact}}-</text>{{centerDetail.emergency_contact}}</view> <view class="msg font24"><text v-if="centerDetail.status==1 && centerDetail.emergency_contact!==centerDetail.account.emergency_contact">{{centerDetail.account.emergency_contact}}-</text>{{centerDetail.emergency_contact}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="title">联系人电话</view> <view class="title">联系人电话</view>
<view class="msg font24"><text v-if="centerDetail.status==0 && centerDetail.emergency_phone!==centerDetail.account.emergency_phone">{{centerDetail.account.emergency_phone}}-</text>{{centerDetail.emergency_phone}}</view> <view class="msg font24"><text v-if="centerDetail.status==1 && centerDetail.emergency_phone!==centerDetail.account.emergency_phone">{{centerDetail.account.emergency_phone}}-</text>{{centerDetail.emergency_phone}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="title">银行卡户名</view> <view class="title">银行卡户名</view>
<view class="msg font24"><text v-if="centerDetail.status==0 && centerDetail.bank_card_name!==centerDetail.account.bank_card_name">{{centerDetail.account.bank_card_name}}-</text>{{centerDetail.bank_card_name}}</view> <view class="msg font24"><text v-if="centerDetail.status==1 && centerDetail.bank_card_name!==centerDetail.account.bank_card_name">{{centerDetail.account.bank_card_name}}-</text>{{centerDetail.bank_card_name}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="title">银行卡号</view> <view class="title">银行卡号</view>
<view class="msg font24"><text v-if="centerDetail.status==0 && centerDetail.bank_card_number!==centerDetail.account.bank_card_number">{{centerDetail.account.bank_card_number}}-</text>{{centerDetail.bank_card_number}}</view> <view class="msg font24"><text v-if="centerDetail.status==1 && centerDetail.bank_card_number!==centerDetail.account.bank_card_number">{{centerDetail.account.bank_card_number}}-</text>{{centerDetail.bank_card_number}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="title">开户行</view> <view class="title">开户行</view>
<view class="msg font24"><text v-if="centerDetail.status==0 && centerDetail.bank_name!==centerDetail.account.bank_name">{{centerDetail.account.bank_name}}-</text>{{centerDetail.bank_name}}</view> <view class="msg font24"><text v-if="centerDetail.status==1 && centerDetail.bank_name!==centerDetail.account.bank_name">{{centerDetail.account.bank_name}}-</text>{{centerDetail.bank_name}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="title">技术岗位</view> <view class="title">技术岗位</view>
<view class="msg font24"><text v-if="centerDetail.status==0 && centerDetail.position_name!==centerDetail.account.position_name">{{centerDetail.account.position_name}}-</text>{{centerDetail.position_name}}</view> <view class="msg font24"><text v-if="centerDetail.status==1 && centerDetail.position_name!==centerDetail.account.position_name">{{centerDetail.account.position_name}}-</text>{{centerDetail.position_name}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="title">工资</view> <view class="title">工资</view>
<view class="msg font24"><text v-if="centerDetail.status==0 && centerDetail.pay!==centerDetail.account.pay">{{centerDetail.account.pay}}-</text>{{centerDetail.pay}}</view> <view class="msg font24"><text v-if="centerDetail.status==1 && centerDetail.pay!==centerDetail.account.pay">{{centerDetail.account.pay}}-</text>{{centerDetail.pay}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="title">加入时间</view> <view class="title">加入时间</view>

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

@ -365,6 +365,69 @@ page{
top: 0; top: 0;
z-index: 999; z-index: 999;
} }
/* 打卡类型 */
.sign-cate{
box-sizing: border-box;
width: calc(100% - 150rpx);
border-radius: 10rpx;
padding: 40rpx 60rpx;
}
.sign-cate .title{
font-weight: bold;
text-align: center;
}
.sign-cate .txt{
display: flex;
align-items: center;
justify-content: space-around;
}
.sign-cate .radio-item{
display: flex;
align-items: center;
height: 60rpx;
margin: 30rpx 0 40rpx;
}
.sign-cate .radio-item>view:first-child{
box-sizing: border-box;
width: 30rpx;
height: 30rpx;
border: 2rpx solid #bdbdbd;
border-radius: 100%;
margin-right: 6rpx;
position: relative;
}
.sign-cate .radio-item>view.checked{
border: 2rpx solid #0788ff;
}
.sign-cate .radio-item>view.checked::after{
content: "";
display: block;
width: 18rpx;
height: 18rpx;
border-radius: 100%;
background-color: #0788ff;
position: absolute;
left: 5rpx;
top: 5rpx;
z-index: 1;
}
.sign-cate-btns{
display: flex;
justify-content: space-around;
align-items: center;
}
.sign-cate-btns .btn{
width: calc(50% - 30rpx);
line-height: 70rpx;
border-radius: 5rpx;
text-align: center;
}
.sign-cate-btns .btn:first-child{
background-color: #b5b5b5;
}
.sign-cate-btns .btn:last-child{
background-image: linear-gradient(to right,#028bfd,#02b4fe);
}
/* 安全公告 */ /* 安全公告 */
.safety-bulletin{ .safety-bulletin{
box-sizing: border-box; box-sizing: border-box;

View File

@ -766,8 +766,8 @@ function populateParameters(result) {var _result$brand =
appVersion: "1.0.0", appVersion: "1.0.0",
appVersionCode: "100", appVersionCode: "100",
appLanguage: getAppLanguage(hostLanguage), appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: "3.6.4", uniCompileVersion: "3.6.5",
uniRuntimeVersion: "3.6.4", uniRuntimeVersion: "3.6.5",
uniPlatform: undefined || "mp-weixin", uniPlatform: undefined || "mp-weixin",
deviceBrand: deviceBrand, deviceBrand: deviceBrand,
deviceModel: model, deviceModel: model,
@ -2370,7 +2370,9 @@ function parseBasePage(vuePageOptions, _ref6)
this.$vm.$mp.query = query; // 兼容 mpvue this.$vm.$mp.query = query; // 兼容 mpvue
this.$vm.__call_hook('onLoad', query); this.$vm.__call_hook('onLoad', query);
}; };
initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']); {
initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
}
return pageOptions; return pageOptions;
} }

View File

@ -206,6 +206,7 @@ __webpack_require__.r(__webpack_exports__);
{ {
@ -346,6 +347,7 @@ __webpack_require__.r(__webpack_exports__);
create_time: item.create_time, create_time: item.create_time,
status: item.status, status: item.status,
status_text: item.status_text, status_text: item.status_text,
remarks: item.remarks,
ifcheck: false }; ifcheck: false };
overtimeArr.push(obj); overtimeArr.push(obj);

View File

@ -1 +1 @@
<view class="pad-x120 data-v-2d4463c5"><status-nav vue-id="7b4895e1-1" ifReturn="{{false}}" navBarTitle="工地加班" class="data-v-2d4463c5" bind:__l="__l"></status-nav><view class="content data-v-2d4463c5" style="{{'padding-top:'+(statusHeight+50+'px')+';'}}"><view class="pull-nav data-v-2d4463c5" style="{{'top:'+(statusHeight+50+'px')+';'}}"><sub-nav bind:changeEv="__e" vue-id="7b4895e1-2" data-event-opts="{{[['^changeEv',[['changeEv']]]]}}" class="data-v-2d4463c5" bind:__l="__l"></sub-nav></view><view class="choose-all-bg data-v-2d4463c5"><block wx:if="{{status==0&&overtimeList.length>0}}"><view class="choose-all font26 data-v-2d4463c5"><view data-event-opts="{{[['tap',[['chooseAll',['$event']]]]]}}" class="{{['radio','data-v-2d4463c5',isAll?'checked':'']}}" bindtap="__e"></view><view class="title data-v-2d4463c5">全选</view><view class="choose-all-btns font24 data-v-2d4463c5"><view data-event-opts="{{[['tap',[['submitAll',[1]]]]]}}" class="btn color-blue data-v-2d4463c5" bindtap="__e">一键确认</view><view data-event-opts="{{[['tap',[['submitAll',[0]]]]]}}" class="btn color-99 btn-no data-v-2d4463c5" bindtap="__e">退回</view></view></view></block></view><view class="sign-record sign-record-other bg-white data-v-2d4463c5"><block wx:for="{{overtimeList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="item font26 data-v-2d4463c5"><block wx:if="{{status==0}}"><view data-event-opts="{{[['tap',[['chooseEv',[index]]]]]}}" class="{{['radio','data-v-2d4463c5',item.ifcheck?'checked':'']}}" bindtap="__e"></view></block><view class="{{['info','data-v-2d4463c5',status==0?'hide':'']}}"><text class="data-v-2d4463c5">{{"工地:"+item.worksite_name}}</text><text class="data-v-2d4463c5">{{"姓名:"+item.worker_name}}</text><text class="data-v-2d4463c5">{{"加班时长:"+item.time+"小时"}}</text><text class="data-v-2d4463c5">{{"提交时间:"+item.create_time}}</text></view><block wx:if="{{item.status==0}}"><view class="examine-btns font24 data-v-2d4463c5"><view data-event-opts="{{[['tap',[['submitEv',['$0',1],[[['overtimeList','',index,'id']]]]]]]}}" class="btn color-blue data-v-2d4463c5" bindtap="__e">确认</view><view data-event-opts="{{[['tap',[['submitEv',['$0',0],[[['overtimeList','',index,'id']]]]]]]}}" class="btn color-99 data-v-2d4463c5" bindtap="__e">退回</view></view></block><block wx:if="{{item.status==1||item.status==-1}}"><view class="{{['state','data-v-2d4463c5',item.status==-1?'color-red':'']}}">{{item.status_text}}</view></block></view></block></view><view class="more-tips font24 data-v-2d4463c5">{{overtimeList.length==total?'没有更多数据了':'下滑获取更多'}}</view></view><tabbar vue-id="7b4895e1-3" userType="{{userType}}" current="3" class="data-v-2d4463c5" bind:__l="__l"></tabbar></view> <view class="pad-x120 data-v-2d4463c5"><status-nav vue-id="7b4895e1-1" ifReturn="{{false}}" navBarTitle="工地加班" class="data-v-2d4463c5" bind:__l="__l"></status-nav><view class="content data-v-2d4463c5" style="{{'padding-top:'+(statusHeight+50+'px')+';'}}"><view class="pull-nav data-v-2d4463c5" style="{{'top:'+(statusHeight+50+'px')+';'}}"><sub-nav bind:changeEv="__e" vue-id="7b4895e1-2" data-event-opts="{{[['^changeEv',[['changeEv']]]]}}" class="data-v-2d4463c5" bind:__l="__l"></sub-nav></view><view class="choose-all-bg data-v-2d4463c5"><block wx:if="{{status==0&&overtimeList.length>0}}"><view class="choose-all font26 data-v-2d4463c5"><view data-event-opts="{{[['tap',[['chooseAll',['$event']]]]]}}" class="{{['radio','data-v-2d4463c5',isAll?'checked':'']}}" bindtap="__e"></view><view class="title data-v-2d4463c5">全选</view><view class="choose-all-btns font24 data-v-2d4463c5"><view data-event-opts="{{[['tap',[['submitAll',[1]]]]]}}" class="btn color-blue data-v-2d4463c5" bindtap="__e">一键确认</view><view data-event-opts="{{[['tap',[['submitAll',[0]]]]]}}" class="btn color-99 btn-no data-v-2d4463c5" bindtap="__e">退回</view></view></view></block></view><view class="sign-record sign-record-other bg-white data-v-2d4463c5"><block wx:for="{{overtimeList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="item font26 data-v-2d4463c5"><block wx:if="{{status==0}}"><view data-event-opts="{{[['tap',[['chooseEv',[index]]]]]}}" class="{{['radio','data-v-2d4463c5',item.ifcheck?'checked':'']}}" bindtap="__e"></view></block><view class="{{['info','data-v-2d4463c5',status==0?'hide':'']}}"><text class="data-v-2d4463c5">{{"工地:"+item.worksite_name}}</text><text class="data-v-2d4463c5">{{"姓名:"+item.worker_name}}</text><text class="data-v-2d4463c5">{{"加班时长:"+item.time+"小时"}}</text><text class="data-v-2d4463c5">{{"提交时间:"+item.create_time}}</text><text class="data-v-2d4463c5">{{"备注:"+item.remarks}}</text></view><block wx:if="{{item.status==0}}"><view class="examine-btns font24 data-v-2d4463c5"><view data-event-opts="{{[['tap',[['submitEv',['$0',1],[[['overtimeList','',index,'id']]]]]]]}}" class="btn color-blue data-v-2d4463c5" bindtap="__e">确认</view><view data-event-opts="{{[['tap',[['submitEv',['$0',0],[[['overtimeList','',index,'id']]]]]]]}}" class="btn color-99 data-v-2d4463c5" bindtap="__e">退回</view></view></block><block wx:if="{{item.status==1||item.status==-1}}"><view class="{{['state','data-v-2d4463c5',item.status==-1?'color-red':'']}}">{{item.status_text}}</view></block></view></block></view><view class="more-tips font24 data-v-2d4463c5">{{overtimeList.length==total?'没有更多数据了':'下滑获取更多'}}</view></view><tabbar vue-id="7b4895e1-3" userType="{{userType}}" current="3" class="data-v-2d4463c5" bind:__l="__l"></tabbar></view>

View File

@ -197,36 +197,18 @@ var _default =
}; };
}, },
onLoad: function onLoad() { onLoad: function onLoad() {
if (uni.getUserProfile) {
this.canIGetUserProfile = true;
}
}, },
onShow: function onShow() { onShow: function onShow() {
if (uni.getStorageSync('token')) { // 进入登录
// 获取用户信息 this.getUserProfileEv('enter');
this.getUserInfo();
}
}, },
methods: { methods: {
// 获取用户信息
getUserInfo: function getUserInfo() {var _this = this;
this.$requst.post('/api/v1/user/info').then(function (res) {
if (res.code == 0) {
console.log(res, '用户信息');
if (res.data.is_active == 1) {
_this.isActive = true;
_this.userInfo.nickName = res.data.nickname;
_this.userInfo.avatarUrl = res.data.headimgurl;
}
}
});
},
// 设置logo图 // 设置logo图
setLogo: function setLogo() {var _this2 = this; setLogo: function setLogo() {var _this = this;
this.$requst.get('/api/v1/index/base-config').then(function (res) { this.$requst.get('/api/v1/index/base-config').then(function (res) {
_this2.imgSrc = _this2.$http + res.data.logo; _this.imgSrc = _this.$http + res.data.logo;
_this2.appletName = res.data.appletName; _this.appletName = res.data.appletName;
}); });
}, },
@ -238,18 +220,18 @@ var _default =
}, },
// 授权绑定手机号 // 授权绑定手机号
getphonenumber: function getphonenumber(e) {var _this3 = this; getphonenumber: function getphonenumber(e) {var _this2 = this;
var ya = this; var ya = this;
wx.login({ wx.login({
success: function success(res) { success: function success(res) {
_this3.$requst.post('/api/v1/user/login', { code: res.code }).then(function (result) { _this2.$requst.post('/api/v1/user/login', { code: res.code }).then(function (result) {
if (e.detail.errMsg == "getPhoneNumber:ok") { if (e.detail.errMsg == "getPhoneNumber:ok") {
_this3.$requst.post('/api/v1/user/bind-phone', { openid: result.data.openid, session_key: result.data.session_key, iv: e.detail.iv, encryptedData: e.detail.encryptedData }).then(function (res) { _this2.$requst.post('/api/v1/user/bind-phone', { openid: result.data.openid, session_key: result.data.session_key, iv: e.detail.iv, encryptedData: e.detail.encryptedData }).then(function (res) {
console.log('手机号信息:', res); console.log('手机号信息:', res);
if (res.code == 0) { if (res.code == 0) {
_this3.$toolAll.tools.showToast('手机号绑定成功'); _this2.$toolAll.tools.showToast('手机号绑定成功');
_this3.isBindPhone = true; _this2.isBindPhone = true;
} else _this3.$toolAll.tools.showToast(res.msg); } else _this2.$toolAll.tools.showToast(res.msg);
}, function (error) {}); }, function (error) {});
} else { } else {
// console.log('取消授权手机号') // console.log('取消授权手机号')
@ -284,74 +266,89 @@ var _default =
this.empowerShow = false; this.empowerShow = false;
}, },
// 允许登录 // 验证登录信息
getUserProfileEv: function getUserProfileEv(e) {var _this4 = this; checkForm: function checkForm() {
if (!this.isActive) { if (!this.isActive) {
if (this.userInfo.avatarUrl == '') { if (this.userInfo.avatarUrl == '') {
this.$toolAll.tools.showToast('请选择您的头像!'); this.$toolAll.tools.showToast('请选择头像!');
return false; return false;
} } else if (this.userInfo.nickName == '') {
if (this.userInfo.nickName == '') { this.$toolAll.tools.showToast('请输入昵称!');
this.$toolAll.tools.showToast('请输入您的昵称!');
return false; return false;
} else {
return true;
} }
} else {
return true;
} }
},
// 允许登录
getUserProfileEv: function getUserProfileEv(status) {var _this3 = this;
//新版登录方式 //新版登录方式
uni.getUserProfile({ uni.login({
desc: '登录', provider: 'weixin',
lang: 'zh_CN',
success: function success(res) { success: function success(res) {
uni.login({ if (res.code) {
provider: 'weixin', _this3.updateUserInfo(res.code, status);
success: function success(res) { } else {
if (res.code) { uni.showToast({
_this4.updateUserInfo(res.code); title: '登录失败!',
} else { duration: 2000 });
uni.showToast({
title: '登录失败!',
duration: 2000 });
} }
} }); } });
},
fail: function fail(res) {} });
}, },
//调用登录接口 //调用登录接口
updateUserInfo: function updateUserInfo(code) { updateUserInfo: function updateUserInfo(code, status) {var _this4 = this;
uni.showToast({ if (status == 'enter') {
title: '登录中...', this.$requst.post('/api/v1/user/login', { code: code }).then(function (res) {
icon: 'loading', if (res.code == 0) {
duration: 10000 }); console.log(res, '进入登录信息');
if (res.data.is_active == 1) {
var params = { _this4.isActive = true;
code: code, }
nickname: this.userInfo.nickName, //用户昵称
headimgurl: this.userInfo.avatarUrl, //用户头像
is_active: 1 };
this.$requst.post('/api/v1/user/login', params).then(function (res) {
if (res.code == 0) {
uni.setStorageSync('userId', res.data.account_id);
uni.setStorageSync('token', res.data.token); //缓存token
uni.setStorageSync('openid', res.data.openid); //缓存openid
uni.setStorageSync('expire', res.data.expire); //缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active', res.data.phone_active); //是否授权手机号
uni.setStorageSync('is_active', res.data.is_active); //是否授权头像和昵称
if (uni.getStorageSync('page-path-options')) {
uni.reLaunch({ // 重新进入当前页面
url: uni.getStorageSync('page-path-options') });
} else {
uni.reLaunch({
url: '/pages/pagehome/pagehome' });
} }
}, function (error) {
});
}
if (status == 'other') {
if (this.checkForm()) {
uni.showToast({
title: '登录中...',
icon: 'loading',
duration: 10000 });
var params = {
code: code,
nickname: this.userInfo.nickName, //用户昵称
headimgurl: this.userInfo.avatarUrl, //用户头像
is_active: 1 };
this.$requst.post('/api/v1/user/login', params).then(function (res) {
if (res.code == 0) {
uni.setStorageSync('userId', res.data.account_id);
uni.setStorageSync('token', res.data.token); //缓存token
uni.setStorageSync('openid', res.data.openid); //缓存openid
uni.setStorageSync('expire', res.data.expire); //缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active', res.data.phone_active); //是否授权手机号
uni.setStorageSync('is_active', res.data.is_active); //是否授权头像和昵称
if (uni.getStorageSync('page-path-options')) {
uni.reLaunch({ // 重新进入当前页面
url: uni.getStorageSync('page-path-options') });
} else {
uni.reLaunch({
url: '/pages/pagehome/pagehome' });
}
}
}, function (error) {});
} }
}, function (error) {}); }
} } };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"]))

View File

@ -1 +1 @@
<view class="data-v-b237504c"><view class="login-header data-v-b237504c"><image class="infoImg data-v-b237504c" mode="aspectFill" src="{{userInfo.avatarUrl||imgSrc}}"></image><view class="logo-name font34 color-00 data-v-b237504c">{{appletName}}</view></view><view class="login-footer data-v-b237504c"><block wx:if="{{!isActive}}"><view class="login-btn color-white font34 bg-blue data-v-b237504c" type="primary" data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" bindtap="__e">微信授权</view></block><block wx:else><view class="login-btn color-white font34 bg-blue data-v-b237504c" type="primary" data-event-opts="{{[['tap',[['getUserProfileEv',['$event']]]]]}}" bindtap="__e">微信授权</view></block><view class="agreement-box color-33 font28 data-v-b237504c">点击授权登录,表示您已阅读<text data-event-opts="{{[['tap',[['toAgreement',['$event']]]]]}}" class="agreement color-blue data-v-b237504c" bindtap="__e">《免责声明》</text></view></view><block wx:if="{{empowerShow}}"><view class="pop-up-bg data-v-b237504c"><view class="user-info-box bg-white data-v-b237504c"><view class="info data-v-b237504c"><view class="cover data-v-b237504c"><image src="{{imgSrc}}" mode="aspectFit" class="data-v-b237504c"></image></view><view class="name color-99 font24 data-v-b237504c">{{appletName}}</view><view class="tips data-v-b237504c"><view class="font26 data-v-b237504c">邀请您补全个人信息</view><view class="font24 color-blue data-v-b237504c">(昵称、头像)</view></view></view><view class="msg data-v-b237504c"><view class="item font26 data-v-b237504c"><text class="data-v-b237504c">头像</text><button class="avatar data-v-b237504c" open-type="chooseAvatar" data-event-opts="{{[['chooseavatar',[['chooseAvatar',['$event']]]]]}}" bindchooseavatar="__e"><image src="{{userInfo.avatarUrl||logoAvatar}}" mode="aspectFit" class="data-v-b237504c"></image></button></view><view class="item font26 data-v-b237504c"><text class="data-v-b237504c">昵称</text><input class="nick-name data-v-b237504c" type="nickname" placeholder="请输入昵称" placeholder-style="color:#999" data-event-opts="{{[['blur',[['nickNameInput',['$event']]]],['input',[['__set_model',['$0','nickName','$event',[]],['userInfo']]]]]}}" value="{{userInfo.nickName}}" bindblur="__e" bindinput="__e"/></view></view><view class="empower-btns font30 data-v-b237504c"><view data-event-opts="{{[['tap',[['refuseEv',['$event']]]]]}}" class="btn color-99 data-v-b237504c" bindtap="__e">拒绝</view><view data-event-opts="{{[['tap',[['getUserProfileEv',['$event']]]]]}}" class="btn color-blue data-v-b237504c" bindtap="__e">允许</view></view></view></view></block></view> <view class="data-v-b237504c"><view class="login-header data-v-b237504c"><image class="infoImg data-v-b237504c" mode="aspectFill" src="{{imgSrc}}"></image><view class="logo-name font34 color-00 data-v-b237504c">{{appletName}}</view></view><view class="login-footer data-v-b237504c"><block wx:if="{{!isActive}}"><view class="login-btn color-white font34 bg-blue data-v-b237504c" type="primary" data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" bindtap="__e">微信授权</view></block><block wx:else><view class="login-btn color-white font34 bg-blue data-v-b237504c" type="primary" data-event-opts="{{[['tap',[['getUserProfileEv',['other']]]]]}}" bindtap="__e">微信授权</view></block><view class="agreement-box color-33 font28 data-v-b237504c">点击授权登录,表示您已阅读<text data-event-opts="{{[['tap',[['toAgreement',['$event']]]]]}}" class="agreement color-blue data-v-b237504c" bindtap="__e">《免责声明》</text></view></view><block wx:if="{{empowerShow}}"><view class="pop-up-bg data-v-b237504c"><view class="user-info-box bg-white data-v-b237504c"><view class="info data-v-b237504c"><view class="cover data-v-b237504c"><image src="{{imgSrc}}" mode="aspectFit" class="data-v-b237504c"></image></view><view class="name color-99 font24 data-v-b237504c">{{appletName}}</view><view class="tips data-v-b237504c"><view class="font26 data-v-b237504c">邀请您补全个人信息</view><view class="font24 color-blue data-v-b237504c">(昵称、头像)</view></view></view><view class="msg data-v-b237504c"><view class="item font26 data-v-b237504c"><text class="data-v-b237504c">头像</text><button class="avatar data-v-b237504c" open-type="chooseAvatar" data-event-opts="{{[['chooseavatar',[['chooseAvatar',['$event']]]]]}}" bindchooseavatar="__e"><image src="{{userInfo.avatarUrl||logoAvatar}}" mode="aspectFit" class="data-v-b237504c"></image></button></view><view class="item font26 data-v-b237504c"><text class="data-v-b237504c">昵称</text><input class="nick-name data-v-b237504c" type="nickname" placeholder="请输入昵称" placeholder-style="color:#999" data-event-opts="{{[['blur',[['nickNameInput',['$event']]]],['input',[['__set_model',['$0','nickName','$event',[]],['userInfo']]]]]}}" value="{{userInfo.nickName}}" bindblur="__e" bindinput="__e"/></view></view><view class="empower-btns font30 data-v-b237504c"><view data-event-opts="{{[['tap',[['refuseEv',['$event']]]]]}}" class="btn color-99 data-v-b237504c" bindtap="__e">拒绝</view><view data-event-opts="{{[['tap',[['getUserProfileEv',['other']]]]]}}" class="btn color-blue data-v-b237504c" bindtap="__e">允许</view></view></view></view></block></view>

View File

@ -133,6 +133,12 @@ var render = function() {
} }
}) })
if (!_vm._isMounted) {
_vm.e0 = function($event) {
;(_vm.showRadio = false), (_vm.radioIndex = 0)
}
}
_vm.$mp.data = Object.assign( _vm.$mp.data = Object.assign(
{}, {},
{ {
@ -268,6 +274,24 @@ __webpack_require__.r(__webpack_exports__);
@ -298,7 +322,12 @@ __webpack_require__.r(__webpack_exports__);
frontColor: '#ffffff', //状态栏文字颜色 frontColor: '#ffffff', //状态栏文字颜色
backgroudColor: 'none', //导航栏背景 backgroudColor: 'none', //导航栏背景
titleColor: '#ffffff', //导航栏颜色 titleColor: '#ffffff', //导航栏颜色
signType: 'in', //打卡分类 in:上班 out:下班 radioList: [
{ title: '上班', type: 'in' },
{ title: '下班', type: 'out' }],
//打卡类型
radioIndex: 0, //当前选择
showRadio: false, //是否显示上班类型
currentDate: '', //当前日期 currentDate: '', //当前日期
currentWeek: '', //当前星期几 currentWeek: '', //当前星期几
currenTime: '', //实时时间 currenTime: '', //实时时间
@ -327,7 +356,8 @@ __webpack_require__.r(__webpack_exports__);
positionIndex: 0, //当前技术岗位 positionIndex: 0, //当前技术岗位
finish: false, //是否完成打卡 finish: false, //是否完成打卡
flag: true, //是否能提交 flag: true, //是否能提交
isLoding: false //是否加载完成 isLoding: false, //是否加载完成
timer: false //计时器状态
}; };
}, },
onPageScroll: function onPageScroll(object) { onPageScroll: function onPageScroll(object) {
@ -349,13 +379,14 @@ __webpack_require__.r(__webpack_exports__);
onLoad: function onLoad() { onLoad: function onLoad() {
// 改变状态栏 // 改变状态栏
this.changeStatusNav(); this.changeStatusNav();
// 获取位置信息 // 获取位置信息
this.getLocationEv(0); this.getLocationEv(0);
}, },
onShow: function onShow() { onShow: function onShow() {
// 获取打卡信息 // 获取打卡信息
this.getSignInfo(); this.getSignInfo();
// 获取打卡记录
this.getSignList();
}, },
methods: { methods: {
// 改变状态栏 // 改变状态栏
@ -501,63 +532,92 @@ __webpack_require__.r(__webpack_exports__);
_this7.currentWeek = res.data.info.week; _this7.currentWeek = res.data.info.week;
// 获取当前时间 // 获取当前时间
_this7.currenTime = res.data.info.now; _this7.currenTime = res.data.info.now;
// 服务端时间处理
setInterval(function () {
var nowArr = _this7.currenTime.split(':');
var hour = parseInt(nowArr[0]);
var minute = parseInt(nowArr[1]);
var second = parseInt(nowArr[2]);
if (second < 59) {
second++;
} else {
second = 0;
if (minute < 59) {
minute++;
} else {
minute = 0;
if (hour < 23) {
hour++;
} else {
hour = 0;
}
}
}
_this7.currenTime = "".concat(hour < 10 ? '0' + hour : hour, ":").concat(minute < 10 ? '0' + minute : minute, ":").concat(second < 10 ? '0' + second : second);
}, 1000);
// 获取打卡记录列表 // 获取打卡记录列表
_this7.signList = res.data.list; _this7.signList = res.data.list;
// 服务端时间处理
_this7.setIntervalEv();
} }
}); });
}, },
// 改变上下班打卡 // 服务端时间处理
changeSignType: function changeSignType() { setIntervalEv: function setIntervalEv() {var _this8 = this;
if (this.signType == 'in') { // 改变计时器状态
this.signType = 'out'; this.timer = true;
if (this.timer) {
setInterval(function () {
var nowArr = _this8.currenTime.split(':');
var hour = parseInt(nowArr[0]);
var minute = parseInt(nowArr[1]);
var second = parseInt(nowArr[2]);
if (second < 59) {
second++;
} else {
second = 0;
if (minute < 59) {
minute++;
} else {
minute = 0;
if (hour < 23) {
hour++;
} else {
hour = 0;
}
}
}
_this8.currenTime = "".concat(hour < 10 ? '0' + hour : hour, ":").concat(minute < 10 ? '0' + minute : minute, ":").concat(second < 10 ? '0' + second : second);
}, 1000);
}
},
// 获取打卡记录
getSignList: function getSignList() {var _this9 = this;
this.$requst.get('/api/v1/user/sign-today').then(function (res) {
if (res.code == 0) {
console.log(res, '打卡记录');
// 获取打卡记录列表
_this9.signList = res.data.list;
}
});
},
// 唤起打卡弹窗
showRadioEv: function showRadioEv() {
if (!this.finish) {
this.showRadio = true;
this.radioIndex = 0;
} else { } else {
this.signType = 'in'; this.$toolAll.tools.showToast('您已打卡');
}
},
// 改变上下班打卡
changeSignType: function changeSignType(index) {
if (this.radioIndex !== index) {
this.radioIndex = index;
} }
}, },
// 打卡 // 打卡
signEv: function signEv() {var _this8 = this; signEv: function signEv() {var _this10 = this;
var params = { var params = {
type: this.signType, type: this.radioList[this.radioIndex].type,
lat: this.siteInfo.lat, lat: this.siteInfo.lat,
lng: this.siteInfo.lng, lng: this.siteInfo.lng,
worksite_id: this.siteInfo.id }; worksite_id: this.siteInfo.id };
this.$requst.post('/api/v1/worker/sign', params).then(function (res) { this.$requst.post('/api/v1/worker/sign', params).then(function (res) {
if (res.code == 0) { if (res.code == 0) {
_this8.finish = true; _this10.finish = true;
// 获取打卡信息 _this10.showRadio = false;
_this8.getSignInfo(); // 获取打卡记录
_this10.getSignList();
// 延时改变打卡状态 // 延时改变打卡状态
setTimeout(function () { setTimeout(function () {
_this8.finish = false; _this10.finish = false;
}, 10000); }, 60000);
} else { } else {
_this8.$toolAll.tools.showToast(res.msg); _this10.$toolAll.tools.showToast(res.msg);
} }
}); });
} } };exports.default = _default; } } };exports.default = _default;

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<view class="pad-x120 data-v-3e617202"><status-nav vue-id="391a19e7-1" navBarTitle="工人信息" class="data-v-3e617202" bind:__l="__l"></status-nav><view class="content data-v-3e617202" style="{{'padding-top:'+(statusHeight+50+'px')+';'}}"><view class="enter-detail font26 data-v-3e617202"><view class="item data-v-3e617202"><view class="title data-v-3e617202">姓名</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==0&&centerDetail.real_name!==centerDetail.account.real_name}}"><text class="data-v-3e617202">{{centerDetail.account.real_name+"-"}}</text></block>{{centerDetail.real_name}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">电话</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==0&&centerDetail.mobile!==centerDetail.account.mobile}}"><text class="data-v-3e617202">{{centerDetail.account.mobile+"-"}}</text></block>{{centerDetail.mobile}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">身份证</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==0&&centerDetail.card_number!==centerDetail.account.card_number}}"><text class="data-v-3e617202">{{centerDetail.account.card_number+"-"}}</text></block>{{centerDetail.card_number}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">紧急联系人</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==0&&centerDetail.emergency_contact!==centerDetail.account.emergency_contact}}"><text class="data-v-3e617202">{{centerDetail.account.emergency_contact+"-"}}</text></block>{{centerDetail.emergency_contact}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">联系人电话</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==0&&centerDetail.emergency_phone!==centerDetail.account.emergency_phone}}"><text class="data-v-3e617202">{{centerDetail.account.emergency_phone+"-"}}</text></block>{{centerDetail.emergency_phone}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">银行卡户名</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==0&&centerDetail.bank_card_name!==centerDetail.account.bank_card_name}}"><text class="data-v-3e617202">{{centerDetail.account.bank_card_name+"-"}}</text></block>{{centerDetail.bank_card_name}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">银行卡号</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==0&&centerDetail.bank_card_number!==centerDetail.account.bank_card_number}}"><text class="data-v-3e617202">{{centerDetail.account.bank_card_number+"-"}}</text></block>{{centerDetail.bank_card_number}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">开户行</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==0&&centerDetail.bank_name!==centerDetail.account.bank_name}}"><text class="data-v-3e617202">{{centerDetail.account.bank_name+"-"}}</text></block>{{centerDetail.bank_name}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">技术岗位</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==0&&centerDetail.position_name!==centerDetail.account.position_name}}"><text class="data-v-3e617202">{{centerDetail.account.position_name+"-"}}</text></block>{{centerDetail.position_name}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">工资</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==0&&centerDetail.pay!==centerDetail.account.pay}}"><text class="data-v-3e617202">{{centerDetail.account.pay+"-"}}</text></block>{{centerDetail.pay+"元"}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">加入时间</view><view class="msg font24 data-v-3e617202">{{centerDetail.check_at}}</view></view></view><block wx:if="{{centerDetail.status==0}}"><view class="enter-detail-btns color-white font30 data-v-3e617202"><view data-event-opts="{{[['tap',[['submitEv',[1]]]]]}}" class="btn data-v-3e617202" bindtap="__e">确认</view><view data-event-opts="{{[['tap',[['submitEv',[0]]]]]}}" class="btn data-v-3e617202" bindtap="__e">退回</view></view></block></view><tabbar vue-id="391a19e7-2" userType="{{userType}}" current="2" class="data-v-3e617202" bind:__l="__l"></tabbar></view> <view class="pad-x120 data-v-3e617202"><status-nav vue-id="391a19e7-1" navBarTitle="工人信息" class="data-v-3e617202" bind:__l="__l"></status-nav><view class="content data-v-3e617202" style="{{'padding-top:'+(statusHeight+50+'px')+';'}}"><view class="enter-detail font26 data-v-3e617202"><view class="item data-v-3e617202"><view class="title data-v-3e617202">姓名</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==1&&centerDetail.real_name!==centerDetail.account.real_name}}"><text class="data-v-3e617202">{{centerDetail.account.real_name+"-"}}</text></block>{{centerDetail.real_name}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">电话</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==1&&centerDetail.mobile!==centerDetail.account.mobile}}"><text class="data-v-3e617202">{{centerDetail.account.mobile+"-"}}</text></block>{{centerDetail.mobile}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">身份证</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==1&&centerDetail.card_number!==centerDetail.account.card_number}}"><text class="data-v-3e617202">{{centerDetail.account.card_number+"-"}}</text></block>{{centerDetail.card_number}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">紧急联系人</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==1&&centerDetail.emergency_contact!==centerDetail.account.emergency_contact}}"><text class="data-v-3e617202">{{centerDetail.account.emergency_contact+"-"}}</text></block>{{centerDetail.emergency_contact}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">联系人电话</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==1&&centerDetail.emergency_phone!==centerDetail.account.emergency_phone}}"><text class="data-v-3e617202">{{centerDetail.account.emergency_phone+"-"}}</text></block>{{centerDetail.emergency_phone}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">银行卡户名</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==1&&centerDetail.bank_card_name!==centerDetail.account.bank_card_name}}"><text class="data-v-3e617202">{{centerDetail.account.bank_card_name+"-"}}</text></block>{{centerDetail.bank_card_name}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">银行卡号</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==1&&centerDetail.bank_card_number!==centerDetail.account.bank_card_number}}"><text class="data-v-3e617202">{{centerDetail.account.bank_card_number+"-"}}</text></block>{{centerDetail.bank_card_number}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">开户行</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==1&&centerDetail.bank_name!==centerDetail.account.bank_name}}"><text class="data-v-3e617202">{{centerDetail.account.bank_name+"-"}}</text></block>{{centerDetail.bank_name}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">技术岗位</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==1&&centerDetail.position_name!==centerDetail.account.position_name}}"><text class="data-v-3e617202">{{centerDetail.account.position_name+"-"}}</text></block>{{centerDetail.position_name}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">工资</view><view class="msg font24 data-v-3e617202"><block wx:if="{{centerDetail.status==1&&centerDetail.pay!==centerDetail.account.pay}}"><text class="data-v-3e617202">{{centerDetail.account.pay+"-"}}</text></block>{{centerDetail.pay+"元"}}</view></view><view class="item data-v-3e617202"><view class="title data-v-3e617202">加入时间</view><view class="msg font24 data-v-3e617202">{{centerDetail.check_at}}</view></view></view><block wx:if="{{centerDetail.status==0}}"><view class="enter-detail-btns color-white font30 data-v-3e617202"><view data-event-opts="{{[['tap',[['submitEv',[1]]]]]}}" class="btn data-v-3e617202" bindtap="__e">确认</view><view data-event-opts="{{[['tap',[['submitEv',[0]]]]]}}" class="btn data-v-3e617202" bindtap="__e">退回</view></view></block></view><tabbar vue-id="391a19e7-2" userType="{{userType}}" current="2" class="data-v-3e617202" bind:__l="__l"></tabbar></view>