前端代码完成-1122
parent
ab54159785
commit
d80f36ce12
|
@ -176,6 +176,74 @@ page{
|
|||
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{
|
||||
box-sizing: border-box;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<text>姓名:{{item.worker_name}}</text>
|
||||
<text>加班时长:{{item.time}}小时</text>
|
||||
<text>提交时间:{{item.create_time}}</text>
|
||||
<text>备注:{{item.remarks}}</text>
|
||||
</view>
|
||||
<!-- 待确认 -->
|
||||
<view class="examine-btns font24" v-if="item.status==0">
|
||||
|
@ -185,6 +186,7 @@
|
|||
create_time: item.create_time,
|
||||
status:item.status,
|
||||
status_text:item.status_text,
|
||||
remarks:item.remarks,
|
||||
ifcheck:false,
|
||||
}
|
||||
overtimeArr.push(obj);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<view>
|
||||
<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>
|
||||
<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="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>
|
||||
<!-- 获取头像&昵称 -->
|
||||
|
@ -36,7 +36,7 @@
|
|||
</view>
|
||||
<view class="empower-btns font30">
|
||||
<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>
|
||||
|
@ -60,31 +60,13 @@
|
|||
};
|
||||
},
|
||||
onLoad() {
|
||||
if (uni.getUserProfile) {
|
||||
this.canIGetUserProfile = true;
|
||||
}
|
||||
|
||||
},
|
||||
onShow() {
|
||||
if(uni.getStorageSync('token')){
|
||||
// 获取用户信息
|
||||
this.getUserInfo();
|
||||
}
|
||||
// 进入登录
|
||||
this.getUserProfileEv('enter');
|
||||
},
|
||||
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图
|
||||
setLogo(){
|
||||
this.$requst.get('/api/v1/index/base-config').then(res=>{
|
||||
|
@ -147,74 +129,89 @@
|
|||
this.empowerShow = false;
|
||||
},
|
||||
|
||||
// 允许登录
|
||||
getUserProfileEv(e) {
|
||||
// 验证登录信息
|
||||
checkForm(){
|
||||
if(!this.isActive){
|
||||
if(this.userInfo.avatarUrl==''){
|
||||
this.$toolAll.tools.showToast('请选择您的头像!')
|
||||
this.$toolAll.tools.showToast('请选择头像!')
|
||||
return false;
|
||||
}
|
||||
if(this.userInfo.nickName==''){
|
||||
this.$toolAll.tools.showToast('请输入您的昵称!')
|
||||
}else if(this.userInfo.nickName==''){
|
||||
this.$toolAll.tools.showToast('请输入昵称!')
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 允许登录
|
||||
getUserProfileEv(status) {
|
||||
//新版登录方式
|
||||
uni.getUserProfile({
|
||||
desc: '登录',
|
||||
lang: 'zh_CN',
|
||||
success: (res) => {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
this.updateUserInfo(res.code);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '登录失败!',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
this.updateUserInfo(res.code,status);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '登录失败!',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (res) => {}
|
||||
});
|
||||
},
|
||||
|
||||
//调用登录接口
|
||||
updateUserInfo(code) {
|
||||
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'
|
||||
})
|
||||
updateUserInfo(code,status) {
|
||||
if(status=='enter'){
|
||||
this.$requst.post('/api/v1/user/login',{code:code}).then(res => {
|
||||
if(res.code == 0){
|
||||
console.log(res,'进入登录信息');
|
||||
if(res.data.is_active==1){
|
||||
this.isActive = true;
|
||||
}
|
||||
}
|
||||
},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 => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<text>{{currentDate}}</text>
|
||||
<text>{{currentWeek}}</text>
|
||||
</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>{{currenTime}}</text>
|
||||
</view>
|
||||
|
@ -27,7 +27,6 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sign-type bg-yellow font26" @tap="changeSignType" :style="{'top':statusHeight+50+'px'}">{{signType=='in'?'上班':'下班'}}</view>
|
||||
</view>
|
||||
<!-- 打卡记录 -->
|
||||
<view class="sign-record bg-white">
|
||||
|
@ -44,6 +43,25 @@
|
|||
</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="safety-bulletin bg-white">
|
||||
|
@ -122,7 +140,12 @@
|
|||
frontColor:'#ffffff', //状态栏文字颜色
|
||||
backgroudColor:'none', //导航栏背景
|
||||
titleColor:'#ffffff', //导航栏颜色
|
||||
signType:'in', //打卡分类 in:上班 out:下班
|
||||
radioList:[
|
||||
{title:'上班',type:'in'},
|
||||
{title:'下班',type:'out'}
|
||||
],//打卡类型
|
||||
radioIndex:0, //当前选择
|
||||
showRadio:false, //是否显示上班类型
|
||||
currentDate:'', //当前日期
|
||||
currentWeek:'', //当前星期几
|
||||
currenTime:'', //实时时间
|
||||
|
@ -152,6 +175,7 @@
|
|||
finish:false, //是否完成打卡
|
||||
flag:true, //是否能提交
|
||||
isLoding:false, //是否加载完成
|
||||
timer:false, //计时器状态
|
||||
}
|
||||
},
|
||||
onPageScroll(object){
|
||||
|
@ -173,13 +197,14 @@
|
|||
onLoad() {
|
||||
// 改变状态栏
|
||||
this.changeStatusNav();
|
||||
|
||||
// 获取位置信息
|
||||
this.getLocationEv(0);
|
||||
},
|
||||
onShow() {
|
||||
// 获取打卡信息
|
||||
this.getSignInfo();
|
||||
// 获取打卡记录
|
||||
this.getSignList();
|
||||
},
|
||||
methods: {
|
||||
// 改变状态栏
|
||||
|
@ -325,48 +350,76 @@
|
|||
this.currentWeek = res.data.info.week;
|
||||
// 获取当前时间
|
||||
this.currenTime = res.data.info.now;
|
||||
// 获取打卡记录列表
|
||||
this.signList = res.data.list;
|
||||
// 服务端时间处理
|
||||
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++;
|
||||
this.setIntervalEv();
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 服务端时间处理
|
||||
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{
|
||||
second = 0;
|
||||
if(minute<59){
|
||||
minute++;
|
||||
minute = 0;
|
||||
if(hour<23){
|
||||
hour++;
|
||||
}else{
|
||||
minute = 0;
|
||||
if(hour<23){
|
||||
hour++;
|
||||
}else{
|
||||
hour = 0;
|
||||
}
|
||||
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;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 改变上下班打卡
|
||||
changeSignType(){
|
||||
if(this.signType == 'in'){
|
||||
this.signType = 'out';
|
||||
// 唤起打卡弹窗
|
||||
showRadioEv(){
|
||||
if(!this.finish){
|
||||
this.showRadio = true;
|
||||
this.radioIndex = 0;
|
||||
}else{
|
||||
this.signType = 'in';
|
||||
this.$toolAll.tools.showToast('您已打卡');
|
||||
}
|
||||
},
|
||||
|
||||
// 改变上下班打卡
|
||||
changeSignType(index){
|
||||
if(this.radioIndex !== index){
|
||||
this.radioIndex = index;
|
||||
}
|
||||
},
|
||||
|
||||
// 打卡
|
||||
signEv(){
|
||||
let params = {
|
||||
type:this.signType,
|
||||
type:this.radioList[this.radioIndex].type,
|
||||
lat:this.siteInfo.lat,
|
||||
lng:this.siteInfo.lng,
|
||||
worksite_id:this.siteInfo.id
|
||||
|
@ -374,12 +427,13 @@
|
|||
this.$requst.post('/api/v1/worker/sign',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.finish = true;
|
||||
// 获取打卡信息
|
||||
this.getSignInfo();
|
||||
this.showRadio = false;
|
||||
// 获取打卡记录
|
||||
this.getSignList();
|
||||
// 延时改变打卡状态
|
||||
setTimeout(()=>{
|
||||
this.finish = false;
|
||||
},10000)
|
||||
},60000)
|
||||
}else{
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
|
|
|
@ -7,43 +7,43 @@
|
|||
<view class="enter-detail font26">
|
||||
<view class="item">
|
||||
<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 class="item">
|
||||
<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 class="item">
|
||||
<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 class="item">
|
||||
<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 class="item">
|
||||
<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 class="item">
|
||||
<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 class="item">
|
||||
<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 class="item">
|
||||
<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 class="item">
|
||||
<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 class="item">
|
||||
<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 class="item">
|
||||
<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
|
@ -365,6 +365,69 @@ page{
|
|||
top: 0;
|
||||
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{
|
||||
box-sizing: border-box;
|
||||
|
|
|
@ -766,8 +766,8 @@ function populateParameters(result) {var _result$brand =
|
|||
appVersion: "1.0.0",
|
||||
appVersionCode: "100",
|
||||
appLanguage: getAppLanguage(hostLanguage),
|
||||
uniCompileVersion: "3.6.4",
|
||||
uniRuntimeVersion: "3.6.4",
|
||||
uniCompileVersion: "3.6.5",
|
||||
uniRuntimeVersion: "3.6.5",
|
||||
uniPlatform: undefined || "mp-weixin",
|
||||
deviceBrand: deviceBrand,
|
||||
deviceModel: model,
|
||||
|
@ -2370,7 +2370,9 @@ function parseBasePage(vuePageOptions, _ref6)
|
|||
this.$vm.$mp.query = query; // 兼容 mpvue
|
||||
this.$vm.__call_hook('onLoad', query);
|
||||
};
|
||||
initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
|
||||
{
|
||||
initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
|
||||
}
|
||||
|
||||
return pageOptions;
|
||||
}
|
||||
|
|
|
@ -206,6 +206,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
|
@ -346,6 +347,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
create_time: item.create_time,
|
||||
status: item.status,
|
||||
status_text: item.status_text,
|
||||
remarks: item.remarks,
|
||||
ifcheck: false };
|
||||
|
||||
overtimeArr.push(obj);
|
||||
|
|
|
@ -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>
|
|
@ -197,36 +197,18 @@ var _default =
|
|||
};
|
||||
},
|
||||
onLoad: function onLoad() {
|
||||
if (uni.getUserProfile) {
|
||||
this.canIGetUserProfile = true;
|
||||
}
|
||||
|
||||
},
|
||||
onShow: function onShow() {
|
||||
if (uni.getStorageSync('token')) {
|
||||
// 获取用户信息
|
||||
this.getUserInfo();
|
||||
}
|
||||
// 进入登录
|
||||
this.getUserProfileEv('enter');
|
||||
},
|
||||
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图
|
||||
setLogo: function setLogo() {var _this2 = this;
|
||||
setLogo: function setLogo() {var _this = this;
|
||||
this.$requst.get('/api/v1/index/base-config').then(function (res) {
|
||||
_this2.imgSrc = _this2.$http + res.data.logo;
|
||||
_this2.appletName = res.data.appletName;
|
||||
_this.imgSrc = _this.$http + res.data.logo;
|
||||
_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;
|
||||
wx.login({
|
||||
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") {
|
||||
_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);
|
||||
if (res.code == 0) {
|
||||
_this3.$toolAll.tools.showToast('手机号绑定成功');
|
||||
_this3.isBindPhone = true;
|
||||
} else _this3.$toolAll.tools.showToast(res.msg);
|
||||
_this2.$toolAll.tools.showToast('手机号绑定成功');
|
||||
_this2.isBindPhone = true;
|
||||
} else _this2.$toolAll.tools.showToast(res.msg);
|
||||
}, function (error) {});
|
||||
} else {
|
||||
// console.log('取消授权手机号')
|
||||
|
@ -284,74 +266,89 @@ var _default =
|
|||
this.empowerShow = false;
|
||||
},
|
||||
|
||||
// 允许登录
|
||||
getUserProfileEv: function getUserProfileEv(e) {var _this4 = this;
|
||||
// 验证登录信息
|
||||
checkForm: function checkForm() {
|
||||
if (!this.isActive) {
|
||||
if (this.userInfo.avatarUrl == '') {
|
||||
this.$toolAll.tools.showToast('请选择您的头像!');
|
||||
this.$toolAll.tools.showToast('请选择头像!');
|
||||
return false;
|
||||
}
|
||||
if (this.userInfo.nickName == '') {
|
||||
this.$toolAll.tools.showToast('请输入您的昵称!');
|
||||
} else if (this.userInfo.nickName == '') {
|
||||
this.$toolAll.tools.showToast('请输入昵称!');
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
// 允许登录
|
||||
getUserProfileEv: function getUserProfileEv(status) {var _this3 = this;
|
||||
//新版登录方式
|
||||
uni.getUserProfile({
|
||||
desc: '登录',
|
||||
lang: 'zh_CN',
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function success(res) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function success(res) {
|
||||
if (res.code) {
|
||||
_this4.updateUserInfo(res.code);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '登录失败!',
|
||||
duration: 2000 });
|
||||
if (res.code) {
|
||||
_this3.updateUserInfo(res.code, status);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '登录失败!',
|
||||
duration: 2000 });
|
||||
|
||||
}
|
||||
} });
|
||||
|
||||
},
|
||||
fail: function fail(res) {} });
|
||||
}
|
||||
} });
|
||||
|
||||
},
|
||||
|
||||
//调用登录接口
|
||||
updateUserInfo: function updateUserInfo(code) {
|
||||
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' });
|
||||
|
||||
updateUserInfo: function updateUserInfo(code, status) {var _this4 = this;
|
||||
if (status == 'enter') {
|
||||
this.$requst.post('/api/v1/user/login', { code: code }).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
console.log(res, '进入登录信息');
|
||||
if (res.data.is_active == 1) {
|
||||
_this4.isActive = true;
|
||||
}
|
||||
}
|
||||
}, 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;
|
||||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -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(
|
||||
{},
|
||||
{
|
||||
|
@ -268,6 +274,24 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -298,7 +322,12 @@ __webpack_require__.r(__webpack_exports__);
|
|||
frontColor: '#ffffff', //状态栏文字颜色
|
||||
backgroudColor: 'none', //导航栏背景
|
||||
titleColor: '#ffffff', //导航栏颜色
|
||||
signType: 'in', //打卡分类 in:上班 out:下班
|
||||
radioList: [
|
||||
{ title: '上班', type: 'in' },
|
||||
{ title: '下班', type: 'out' }],
|
||||
//打卡类型
|
||||
radioIndex: 0, //当前选择
|
||||
showRadio: false, //是否显示上班类型
|
||||
currentDate: '', //当前日期
|
||||
currentWeek: '', //当前星期几
|
||||
currenTime: '', //实时时间
|
||||
|
@ -327,7 +356,8 @@ __webpack_require__.r(__webpack_exports__);
|
|||
positionIndex: 0, //当前技术岗位
|
||||
finish: false, //是否完成打卡
|
||||
flag: true, //是否能提交
|
||||
isLoding: false //是否加载完成
|
||||
isLoding: false, //是否加载完成
|
||||
timer: false //计时器状态
|
||||
};
|
||||
},
|
||||
onPageScroll: function onPageScroll(object) {
|
||||
|
@ -349,13 +379,14 @@ __webpack_require__.r(__webpack_exports__);
|
|||
onLoad: function onLoad() {
|
||||
// 改变状态栏
|
||||
this.changeStatusNav();
|
||||
|
||||
// 获取位置信息
|
||||
this.getLocationEv(0);
|
||||
},
|
||||
onShow: function onShow() {
|
||||
// 获取打卡信息
|
||||
this.getSignInfo();
|
||||
// 获取打卡记录
|
||||
this.getSignList();
|
||||
},
|
||||
methods: {
|
||||
// 改变状态栏
|
||||
|
@ -501,63 +532,92 @@ __webpack_require__.r(__webpack_exports__);
|
|||
_this7.currentWeek = res.data.info.week;
|
||||
// 获取当前时间
|
||||
_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.setIntervalEv();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 改变上下班打卡
|
||||
changeSignType: function changeSignType() {
|
||||
if (this.signType == 'in') {
|
||||
this.signType = 'out';
|
||||
// 服务端时间处理
|
||||
setIntervalEv: function setIntervalEv() {var _this8 = this;
|
||||
// 改变计时器状态
|
||||
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 {
|
||||
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 = {
|
||||
type: this.signType,
|
||||
type: this.radioList[this.radioIndex].type,
|
||||
lat: this.siteInfo.lat,
|
||||
lng: this.siteInfo.lng,
|
||||
worksite_id: this.siteInfo.id };
|
||||
|
||||
this.$requst.post('/api/v1/worker/sign', params).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
_this8.finish = true;
|
||||
// 获取打卡信息
|
||||
_this8.getSignInfo();
|
||||
_this10.finish = true;
|
||||
_this10.showRadio = false;
|
||||
// 获取打卡记录
|
||||
_this10.getSignList();
|
||||
// 延时改变打卡状态
|
||||
setTimeout(function () {
|
||||
_this8.finish = false;
|
||||
}, 10000);
|
||||
_this10.finish = false;
|
||||
}, 60000);
|
||||
} else {
|
||||
_this8.$toolAll.tools.showToast(res.msg);
|
||||
_this10.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
});
|
||||
} } };exports.default = _default;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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&¢erDetail.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>
|
Loading…
Reference in New Issue