hmp 5 سال پیش
والد
کامیت
26516f84c2
10فایلهای تغییر یافته به همراه219 افزوده شده و 160 حذف شده
  1. 2 2
      main.js
  2. 33 2
      pages.json
  3. 2 0
      pages/device/device.vue
  4. 9 9
      pages/index/index.vue
  5. 52 135
      pages/test/test1.vue
  6. 74 11
      punch/comps/punch-out/punch-out.vue
  7. BIN
      punch/static/icon/rest.png
  8. BIN
      punch/static/icon/rest5.png
  9. 46 0
      utils/mpi.js
  10. 1 1
      utils/util.js

+ 2 - 2
main.js

@@ -60,7 +60,7 @@ Vue.prototype.$loginType={
 	ENTERPRISE:'enterprise',
 	AGENCY:'agency'
 }
-Vue.prototype.ColorList=['red','orange','yellow','olive','green','cyan','blue','purple','mauve', 'pink','brown','black']
+Vue.prototype.ColorList=['red','orange','yellow','olive','green','cyan','blue','purple','mauve', 'pink','brown']
 
 //设备类型【通过前缀查找】
 Vue.prototype.$device_prefix={
@@ -165,7 +165,7 @@ Vue.prototype.$createDateTime=()=>{
 }
 
 //封装判空函数
-Vue.prototype.$isEmpty=function(value){
+Vue.prototype.$isEmpty=function(value){ 
 	switch (typeof value) {
 		case 'undefined':
 			return true;

+ 33 - 2
pages.json

@@ -84,8 +84,10 @@
         ,{
             "path" : "pages/test/test1",
             "style" :                                                                                    
-            {
-                "navigationStyle":"custom",
+            {
+				"navigationBarTitleText": "企业管理",
+				"navigationBarTextStyle":"white",
+				"navigationBarBackgroundColor":"#5064eb",
                 "enablePullDownRefresh": false
             }
             
@@ -492,6 +494,35 @@
             }
             
         }
+        ,{
+            "path" : "pages/enterprise /enterprise ",
+            "style" :                                                                                    
+            {
+				"navigationBarTextStyle":"white",
+				"navigationBarBackgroundColor":"#5064eb",
+                "navigationBarTitleText": "企业管理",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/test/test2",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/test/demo",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"subPackages": [{
 		"root": "party",

+ 2 - 0
pages/device/device.vue

@@ -182,6 +182,8 @@ export default {
 						this.isopen=true
 						that.$showModel('开门成功',false)
 					}else{
+						that.$showModel(res.msg,false)
+						this.isloading=false
 						that.isopen=false
 					}
 				}).catch(err=>{

+ 9 - 9
pages/index/index.vue

@@ -471,15 +471,6 @@ export default {
 			]
 			
 			this.elements=[
-				{
-					title: '公告管理',
-					name: 'Notice managerment',
-					color: '#eaebf9',
-					icon:'../../static/icon/tongzhi.png',
-					url:'/pages/index/notice/list',
-					count:0,
-					show:this.loginType==this.$loginType.AGENCY
-				},
 				{
 					title: '我的企业',
 					name: 'My business',
@@ -595,6 +586,15 @@ export default {
 					count:0,
 					show:this.loginType==this.$loginType.STAFF
 				}, 
+				{
+					title: '公告管理',
+					name: 'Notice managerment',
+					color: '#eaebf9',
+					icon:'../../static/icon/tongzhi.png',
+					url:'/pages/index/notice/list',
+					count:0,
+					show:this.loginType==this.$loginType.AGENCY
+				},
 			]
 			this.fireList=[
 				{

+ 52 - 135
pages/test/test1.vue

@@ -1,42 +1,18 @@
 <template>
-	<view class="content">
-		<u-navbar :background="background" back-icon-color="#fff" titleColor="#fff" :title="vuex_now_date"></u-navbar>
-		<calendar ref='ren' :markDays='markDays' :open="true" :disabledAfter='true'  @onDayClick='onDayClick'></calendar>
-		
-		<view class="rule">
-			<view class="left">
-				<view class="title">上下班打卡</view>
-				<view class="desc">
-					<text>打卡规则:</text>
-					<text>早9晚6点半</text>
-					<text style="padding: 0 15rpx;">|</text>
-					<text>工作时长:</text>
-					<text>10小时30分钟</text>
-				</view>
-			</view>
-			<view class="right desc">
-				<text class="cuIcon-right"></text>
-			</view>
-		</view>
-		
-		<view class="history">
-			<view class="left">
-				<text class="time">09:00</text>
-				<view class="bar">
-					<text></text>
+	<view class="safe-area-inset-bottom">
+		<view  class="card" v-for="(item,index) in 8" :key="index">
+			<view class="item">
+				<view class="left">
+					<view class="tag bg-red">
+						<text>麦</text>
+					</view>
+					<view class="content">
+						<text class="text-cut-1">麦草方格(宁夏)文化传媒有限公司</text>
+						<text class="text-cut-1">德锐斯园区A区</text>
+					</view>
 				</view>
-				<text class="time">18:30</text>
-			</view>
-			
-			<view class="right">
-				<view class="working" style="padding-bottom: 40rpx;">
-					<text class="padding-bottom-10">上班 · 自动</text>
-					<text class="desc">正常打卡(08:57)</text>
-				</view>
-				
-				<view class="working" style="padding-top: 10rpx;">
-					<text class="padding-bottom-10">下班 · 自动</text>
-					<text class="desc">正常打卡(18:30)</text>
+				<view class="right">
+					<image  src="../../static/index/call.png" mode=""></image>
 				</view>
 			</view>
 		</view>
@@ -44,131 +20,72 @@
 </template>
 
 <script>
-    import calendar from '@/components/calendar/calendar.vue'
 	export default {
-        components:{
-            calendar
-        },
 		data() {
 			return {
-				background: {
-					backgroundColor: '#5064eb',
-				},
-				isfuture:false,
-                markDays:[
-					'2021-04-16',
-					'2021-04-17',
-					'2021-04-18',
-					'2021-04-19',
-					'2021-04-20'
-				]
+				
 			}
 		},
-		onReady() {
-            let today = this.$refs.ren.getToday().date;
-			this.$u.vuex("vuex_now_date",this.$dateTime.format(new Date(today),"YYYY年mm月dd日"))
-		},
 		methods: {
-            onDayClick(data){
-				if (!data) {
-					this.isfuture=true
-					return
-				}
-				this.isfuture=false
-				this.$u.vuex("vuex_now_date",this.$dateTime.format(new Date(data.date),"YYYY年mm月dd日"))
-            }
+           
 		}
 	}
 </script>
 
 <style lang="scss">
-    page{
-        background-color: #f2f2f2;
-    }
+  .card{
+  	position: relative;
+  	background-color: #FFFFFF;
+  	padding: 35rpx;
+  	margin: 20rpx;
 	
-	.flex-center{
+	.item{
 		display: flex;
-		justify-content: center;
-		align-items: center;
-	}
-	
-	.desc{
-		font-size: 28rpx;
-		color: #8f8f8f;
-	}
-	
-	.content {
-		.change{
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            margin: 0 auto;
-            margin-top: 100rpx;
-            height: 100rpx;
-            color: #b89249;
-            background-color: #21191b;
-        }
+		justify-content: space-between;
 	}
 	
-	.rule{
-		padding: 20rpx 30rpx;
+	.left{
 		display: flex;
-		justify-content: space-between;
-		border-bottom: 1rpx solid $dt-border-color-sm;
+		width: 88%;
 		
-		.left{
-			.title{
-				font-size: 30rpx;
-				font-weight: 800;
-				padding-bottom: 10rpx;
-			}
-		}
-		.right{
+		.tag{
+			border-radius: 50%;
 			display: flex;
 			justify-content: center;
 			align-items: center;
+			height: 80rpx;
+			width: 80rpx;
+			font-size: 32rpx;
 		}
-	}
-	
-	.history{
-		display: flex;
-		padding: 40rpx;
-		.left{
+		
+		.content{
+			padding-left: 30rpx;
 			display: flex;
 			flex-direction: column;
-			justify-content: center;
 			
-			.time{
-				font-weight: 550;
-				font-size: 36rpx;
+			text:first-child{
+				font-size: 32rpx;
 			}
-			.bar{
-				padding: 10rpx 0;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				
-				text{
-					width: 8rpx;
-					height: 80rpx;
-					background-color: #dedede;
-				}
+			
+			text:last-child{
+				font-size: 28rpx;
+				color: #9f9f9f;
+				padding-top: 15rpx;
 			}
 		}
-		.right{
-			display: flex;
-			flex-direction: column;
-			justify-content: space-between;
-			padding-left: 50rpx;
-			.working{
-				display: flex;
-				flex-direction: column;
-				
-				text:first-child{
-					font-weight: 550;
-					font-size: 32rpx;
-				}
-			}
+	}
+	
+	.right{
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		
+		image{
+			width: 50rpx;
+			height: 50rpx;
 		}
 	}
+
+  	
+  }
 </style>

+ 74 - 11
punch/comps/punch-out/punch-out.vue

@@ -1,6 +1,10 @@
 <template>
 	<view class="">
-		<view class="card" v-if="!$isEmpty(faceImg)">
+		<!-- 休息日 -->
+		<u-empty  v-if="status==0" margin-top="300" icon-size="300" text="今天不上班,要好好休息哟~" src="/punch/static/icon/rest.png" ></u-empty>
+		
+		<!-- 工作日-未打卡 -->
+		<view class="card" v-else-if="status==1">
 			<view class="location" @click="chooseLocation">
 				 <map :enable-scroll="false" class="map" :enable-zoom="false"></map>
 				 <view class="label" style="position: relative;">
@@ -13,13 +17,10 @@
 						<view class="content text-cut-1">
 							<text class="text-cut-1">{{remark}}</text>
 						</view>
-						<image   :src="imgList[0]" mode=""></image>
+						<image  :src="imgList[0]" mode=""></image>
 					</view>
-					
 				 </view>
-				 
 			</view>
-			<image v-if="faceImg" :src="faceImg" mode=""></image>
 			<view class="" style="position: fixed;bottom: 20%;left: 50%;margin-left: -130rpx;">
 				<view @click="punch" class="btn-open">
 					<text>{{time}}</text>
@@ -56,12 +57,9 @@
 				</view>
 			</u-popup>
 		</view>
-		
-		<!-- <view class="empty" v-else>
-			<u-empty icon-size="300" text="今天不上班,要好好休息哟~" src="/punch/static/icon/rest5.png" ></u-empty>
-		</view> -->
-		
-		<view class="form" >
+
+		<!-- 工作日-去打卡 -->
+		<view class="form" v-else-if="status==2">
 			<view class="face">
 				<image src="http://n.sinaimg.cn/front/724/w1078h1246/20190406/YVxr-hvhrcxm4045228.jpg" mode="scaleToFill"></image>
 				<view >
@@ -95,6 +93,28 @@
 			</view>
 		</view>
 		
+		<view class="result" v-else-if="status==3">
+			<image  src="../../static/icon/success.png" mode=""></image>
+			<text class="tips">外出打卡成功</text>
+			
+			<view class="desc">
+				<view class="item">
+					<text>时间</text>
+					<text>16:03</text>
+				</view>
+				
+				<view class="item">
+					<text>位置</text>
+					<text>保利世界贸易中心</text>
+				</view>
+				
+				<view class="item">
+					<text>备注</text>
+					<text>我是备注</text>
+				</view>
+			</view>
+		</view>
+		
 		
 	</view>
 </template>
@@ -119,6 +139,14 @@
 		created() {
 			this.getNowTime()
 		},
+		computed:{
+			status:{
+				get(){
+					//0休息日,1工作日-未打卡 2工作日-去打卡 3工作日-打卡成功
+					return 3
+				}
+			}
+		},
 		methods:{
 			getNowTime(){
 				let that=this
@@ -314,4 +342,39 @@
 		
 	}
 	
+	.result{
+		display: flex; 
+		flex-direction: column;
+		align-items: center;
+		padding-top: 180rpx;
+		
+		image{
+			width: 180rpx;
+			height: 180rpx;
+		}
+		
+		.tips{
+			padding-top: 50rpx;
+			font-size: 36rpx;
+			color: #18b566;
+			font-weight: 800;
+		}
+		
+		.desc{
+			border-top: 1rpx solid $dt-border-color-sm;
+			margin-top: 100rpx;
+			padding: 10rpx;
+			width: 70%;
+			.item{
+				display: flex;
+				justify-content: space-between;
+				padding: 30rpx 0;
+				
+				text:first-child{
+					color: #8c8d8d;
+				}
+			}
+		}
+	}
+	
 </style>

BIN
punch/static/icon/rest.png


BIN
punch/static/icon/rest5.png


+ 46 - 0
utils/mpi.js

@@ -101,4 +101,50 @@ mpi.wxGetUserInfo = () => {
   })
 }
 
+let compareVersion=(v1, v2)=> {
+  v1 = v1.split('.')
+  v2 = v2.split('.')
+  const len = Math.max(v1.length, v2.length)
+
+  while (v1.length < len) {
+    v1.push('0')
+  }
+  while (v2.length < len) {
+    v2.push('0')
+  }
+
+  for (let i = 0; i < len; i++) {
+    const num1 = parseInt(v1[i])
+    const num2 = parseInt(v2[i])
+
+    if (num1 > num2) {
+      return 1
+    } else if (num1 < num2) {
+      return -1
+    }
+  }
+  return 0
+}
+
+mpi.versioning=(minVersion)=>{
+	const version = wx.getSystemInfoSync().SDKVersion
+	return new Promise((resolve, reject)=>{
+	  if (compareVersion(version, minVersion) >= 0) {
+		   resolve()
+	  }else{
+		  uni.showModal({
+		  	content:"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
+		  })
+	  }
+    })
+}
+
+
+
+
+
+
+
+
+
 export default mpi

+ 1 - 1
utils/util.js

@@ -48,7 +48,7 @@ util.showModal=(content,title='提示')=>{
 }
 
 //拨打电话
-util.callPhone=phone=>{
+util.callPhone=(phone)=>{
 	uni.showModal({
 	    title: '提示',
 	    content: `确定要拨打电话:${phone}吗?`,