Parcourir la source

校园打卡项目合并

MS-CIAZDCOIXVRW\Administrator il y a 3 ans
Parent
commit
f971a89249
100 fichiers modifiés avec 12078 ajouts et 62 suppressions
  1. 10 0
      main.js
  2. 2 1
      manifest.json
  3. 211 61
      pages.json
  4. 4 0
      pages/index/index.vue
  5. 46 0
      pagesClockIn/404/404.vue
  6. 310 0
      pagesClockIn/addLocation/addLocation.vue
  7. 417 0
      pagesClockIn/addRules/addRules.vue
  8. 327 0
      pagesClockIn/authentication/authentication.vue
  9. BIN
      pagesClockIn/authentication/imgs/photo.png
  10. BIN
      pagesClockIn/authentication/imgs/success.png
  11. 499 0
      pagesClockIn/cardRecord/cardRecord.vue
  12. BIN
      pagesClockIn/components/.DS_Store
  13. BIN
      pagesClockIn/components/chocolate-progress-bar/.DS_Store
  14. 114 0
      pagesClockIn/components/chocolate-progress-bar/chocolate-progress-bar.vue
  15. BIN
      pagesClockIn/components/kx-time-picker.zip
  16. 107 0
      pagesClockIn/components/kx-time-picker/kx-time-picker.vue
  17. 151 0
      pagesClockIn/components/tki-tree/style.css
  18. 302 0
      pagesClockIn/components/tki-tree/tki-tree.vue
  19. 501 0
      pagesClockIn/editRules/editRules.vue
  20. 630 0
      pagesClockIn/group/group.vue
  21. BIN
      pagesClockIn/group/imgs/bottom.png
  22. BIN
      pagesClockIn/group/imgs/people.png
  23. 627 0
      pagesClockIn/home/home.vue
  24. BIN
      pagesClockIn/home/imgs/success.png
  25. 126 0
      pagesClockIn/index/index.vue
  26. BIN
      pagesClockIn/location/imgs/photo.png
  27. BIN
      pagesClockIn/location/imgs/refresh.png
  28. 262 0
      pagesClockIn/location/location.vue
  29. 203 0
      pagesClockIn/my/my.vue
  30. BIN
      pagesClockIn/particulars/imgs/finished.png
  31. BIN
      pagesClockIn/particulars/imgs/rule.png
  32. BIN
      pagesClockIn/particulars/imgs/unfinished.png
  33. 225 0
      pagesClockIn/particulars/particulars.vue
  34. 298 0
      pagesClockIn/powerSet/powerSet.vue
  35. 241 0
      pagesClockIn/punchLocation/punchLocation.vue
  36. 244 0
      pagesClockIn/punchTime/punchTime.vue
  37. 71 0
      pagesClockIn/ruleName/ruleName.vue
  38. 219 0
      pagesClockIn/ruleSet/ruleSet.vue
  39. 234 0
      pagesClockIn/rulesDetail/rulesDetail.vue
  40. 390 0
      pagesClockIn/setPunchTime/setPunchTime.vue
  41. 957 0
      pagesClockIn/stat/stat.vue
  42. 502 0
      pagesClockIn/statDetail/statDetail.vue
  43. BIN
      pagesClockIn/static/imgs/404.png
  44. BIN
      pagesClockIn/static/imgs/add.png
  45. BIN
      pagesClockIn/static/imgs/ceshi.jpg
  46. BIN
      pagesClockIn/static/imgs/close.png
  47. 20 0
      pagesClockIn/static/imgs/customicons.css
  48. BIN
      pagesClockIn/static/imgs/customicons.ttf
  49. BIN
      pagesClockIn/static/imgs/double_left.png
  50. BIN
      pagesClockIn/static/imgs/double_right.png
  51. BIN
      pagesClockIn/static/imgs/headImage.png
  52. BIN
      pagesClockIn/static/imgs/home.png
  53. BIN
      pagesClockIn/static/imgs/home_active.png
  54. BIN
      pagesClockIn/static/imgs/left.png
  55. BIN
      pagesClockIn/static/imgs/location.png
  56. BIN
      pagesClockIn/static/imgs/location2.png
  57. BIN
      pagesClockIn/static/imgs/my.png
  58. BIN
      pagesClockIn/static/imgs/my1.png
  59. BIN
      pagesClockIn/static/imgs/my2.png
  60. BIN
      pagesClockIn/static/imgs/my3.png
  61. BIN
      pagesClockIn/static/imgs/my4.png
  62. BIN
      pagesClockIn/static/imgs/my_active.png
  63. BIN
      pagesClockIn/static/imgs/noPower.png
  64. BIN
      pagesClockIn/static/imgs/nodata.png
  65. BIN
      pagesClockIn/static/imgs/notice.png
  66. BIN
      pagesClockIn/static/imgs/right.png
  67. BIN
      pagesClockIn/static/imgs/right2.png
  68. BIN
      pagesClockIn/static/imgs/stat.png
  69. BIN
      pagesClockIn/static/imgs/stat_active.png
  70. BIN
      pagesClockIn/static/imgs/time.png
  71. 88 0
      pagesClockIn/util/api.js
  72. 741 0
      pagesClockIn/util/qqmap-wx-jssdk1.1/qqmap-wx-jssdk.js
  73. 3 0
      pagesClockIn/util/qqmap-wx-jssdk1.1/qqmap-wx-jssdk.min.js
  74. BIN
      static/images/clockIn.png
  75. 11 0
      uni_modules/jlk-week/changelog.md
  76. 2 0
      uni_modules/jlk-week/components/jlk-icon/changelog.md
  77. 43 0
      uni_modules/jlk-week/components/jlk-icon/components/jlk-icon/jlk-icon.vue
  78. 81 0
      uni_modules/jlk-week/components/jlk-icon/package.json
  79. 4 0
      uni_modules/jlk-week/components/jlk-icon/readme.md
  80. 20 0
      uni_modules/jlk-week/components/jlk-week/i18n/en.json
  81. 6 0
      uni_modules/jlk-week/components/jlk-week/i18n/index.js
  82. 20 0
      uni_modules/jlk-week/components/jlk-week/i18n/zh.json
  83. 239 0
      uni_modules/jlk-week/components/jlk-week/jlk-week.vue
  84. 81 0
      uni_modules/jlk-week/package.json
  85. 4 0
      uni_modules/jlk-week/readme.md
  86. 20 0
      uni_modules/uni-calendar/changelog.md
  87. 546 0
      uni_modules/uni-calendar/components/uni-calendar/calendar.js
  88. 12 0
      uni_modules/uni-calendar/components/uni-calendar/i18n/en.json
  89. 8 0
      uni_modules/uni-calendar/components/uni-calendar/i18n/index.js
  90. 12 0
      uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hans.json
  91. 12 0
      uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hant.json
  92. 188 0
      uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue
  93. 563 0
      uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue
  94. 350 0
      uni_modules/uni-calendar/components/uni-calendar/util.js
  95. 85 0
      uni_modules/uni-calendar/package.json
  96. 103 0
      uni_modules/uni-calendar/readme.md
  97. 36 0
      uni_modules/uni-collapse/changelog.md
  98. 403 0
      uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue
  99. 147 0
      uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue
  100. 0 0
      uni_modules/uni-collapse/package.json

+ 10 - 0
main.js

@@ -8,12 +8,22 @@ import {
 	getOrderId
 } from './static/api.js'
 
+import {
+	myRequest_clockIn
+} from "./pagesClockIn/util/api"
+
+import dropDown from '@/uni_modules/zwx-dropDown/components/zwx-dropDown/zwx-dropDown'
+
+Vue.component("dropDown", dropDown)
+
 Vue.prototype.$myRequest = myRequest
 Vue.prototype.$code_base_url = CODE_BASE_URL
 Vue.prototype.$getDate = getDate
 Vue.prototype.$getOrderId = getOrderId
 Vue.prototype.$store = store
 
+Vue.prototype.$myRequest_clockIn = myRequest_clockIn
+
 Vue.config.productionTip = false
 
 App.mpType = 'app'

+ 2 - 1
manifest.json

@@ -81,7 +81,8 @@
 				"desc": "您的位置信息将用于连接热水表蓝牙"
 			}
 		},
-		"lazyCodeLoading": "requiredComponents"
+		"lazyCodeLoading": "requiredComponents",
+		"requiredPrivateInfos" : [ "getLocation", "chooseLocation" ]
 	},
 	"mp-alipay": {
 		"usingComponents": true

+ 211 - 61
pages.json

@@ -35,96 +35,246 @@
 		}
 	],
 	"subPackages": [{
-		"root": "pagesElectric",
-		"pages": [{
-				"path": "dfxq/dfxq",
+			"root": "pagesElectric",
+			"pages": [{
+					"path": "dfxq/dfxq",
+					"style": {
+						"navigationBarTitleText": "电费详情",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "sfxq/sfxq",
+					"style": {
+						"navigationBarTitleText": "水费详情",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "jiaofei/jiaofei",
+					"style": {
+						"navigationBarTitleText": "水电充值",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "jiaofei/ad_dianfei",
+					"style": {
+						"navigationBarTitleText": "",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "show/show",
+					"style": {
+						"navigationBarTitleText": "台账管理",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "select/select",
+					"style": {
+						"navigationBarTitleText": "缴水电费_选宿舍号",
+						"enablePullDownRefresh": false
+					}
+				}
+			]
+		}, {
+			"root": "pagesWater",
+			"pages": [{
+				"path": "reshuiDetails/reshuiDetails",
+				"style": {
+					"navigationBarTitleText": "热水充值详情",
+					"enablePullDownRefresh": false
+				}
+			}]
+		}, {
+			"root": "pagesAir",
+			"pages": [{
+				"path": "shareAir/shareAir",
+				"style": {
+					"navigationBarTitleText": "共享空调",
+					"enablePullDownRefresh": false
+				}
+			}, {
+				"path": "addAir/addAir",
+				"style": {
+					"navigationBarTitleText": "添加空调",
+					"enablePullDownRefresh": false
+				}
+			}, {
+				"path": "stdBookMgr/stdBookMgr",
+				"style": {
+					"navigationBarTitleText": "台账管理",
+					"enablePullDownRefresh": false
+				}
+
+			}, {
+				"path": "accountBalance/accountBalance",
+				"style": {
+					"navigationBarTitleText": "账户余额",
+					"enablePullDownRefresh": false
+				}
+
+			}, {
+				"path": "rechargeRecord/rechargeRecord",
+				"style": {
+					"navigationBarTitleText": "充值记录",
+					"enablePullDownRefresh": false
+				}
+
+			}]
+		},
+		{
+			"root": "pagesClockIn",
+			"pages": [
+				{
+				"path": "home/home",
+				"style": {
+					"navigationBarTitleText": "智慧校园打卡",
+					"enablePullDownRefresh": false
+				}
+			}, 
+			{
+				"path": "stat/stat",
 				"style": {
-					"navigationBarTitleText": "电费详情",
+					"navigationBarTitleText": "统计",
+					"enablePullDownRefresh": false
+				}
+			}, 
+			{
+				"path": "my/my",
+				"style": {
+					"navigationBarTitleText": "我的",
 					"enablePullDownRefresh": false
 				}
 			},
 			{
-				"path": "sfxq/sfxq",
+				"path": "ruleSet/ruleSet",
 				"style": {
-					"navigationBarTitleText": "水费详情",
+					"navigationBarTitleText": "规则设置",
+					"enablePullDownRefresh": false
+				}
+			},{
+				"path": "powerSet/powerSet",
+				"style": {
+					"navigationBarTitleText": "权限设置",
+					"enablePullDownRefresh": false
+				}
+			},{
+				"path": "cardRecord/cardRecord",
+				"style": {
+					"navigationBarTitleText": "打卡记录",
+					"enablePullDownRefresh": false
+				}
+			},{
+				"path": "group/group",
+				"style": {
+					"navigationBarTitleText": "考勤组",
 					"enablePullDownRefresh": false
 				}
 			},
 			{
-				"path": "jiaofei/jiaofei",
+				"path": "addRules/addRules",
 				"style": {
-					"navigationBarTitleText": "水电充值",
+					"navigationBarTitleText": "新增规则",
 					"enablePullDownRefresh": false
 				}
 			},
 			{
-				"path": "jiaofei/ad_dianfei",
+				"path": "ruleName/ruleName",
 				"style": {
-					"navigationBarTitleText": "",
+					"navigationBarTitleText": "规则名称",
 					"enablePullDownRefresh": false
 				}
 			},
 			{
-				"path": "show/show",
+				"path": "punchTime/punchTime",
 				"style": {
-					"navigationBarTitleText": "台账管理",
+					"navigationBarTitleText": "打卡时间",
 					"enablePullDownRefresh": false
 				}
 			},
 			{
-				"path": "select/select",
+				"path": "punchLocation/punchLocation",
 				"style": {
-					"navigationBarTitleText": "缴水电费_选宿舍号",
+					"navigationBarTitleText": "打卡位置",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "setPunchTime/setPunchTime",
+				"style": {
+					"navigationBarTitleText": "添加打卡时间",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "addLocation/addLocation",
+				"style": {
+					"navigationBarTitleText": "添加位置",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "editRules/editRules",
+				"style": {
+					"navigationBarTitleText": "编辑规则",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "statDetail/statDetail",
+				"style": {
+					"navigationBarTitleText": "统计",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "particulars/particulars",
+				"style": {
+					"navigationBarTitleText": "汇总明细",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "404/404",
+				"style": {
+					"navigationBarTitleText": "404",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "location/location",
+				"style": {
+					"navigationBarTitleText": "打卡位置",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "authentication/authentication",
+				"style": {
+					"navigationBarTitleText": "身份认证",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "rulesDetail/rulesDetail",
+				"style": {
+					"navigationBarTitleText": "规则明细",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "index/index",
+				"style": {
+					"navigationBarTitleText": "授权中",
 					"enablePullDownRefresh": false
 				}
 			}
-		]
-	}, {
-		"root": "pagesWater",
-		"pages": [{
-			"path": "reshuiDetails/reshuiDetails",
-			"style": {
-				"navigationBarTitleText": "热水充值详情",
-				"enablePullDownRefresh": false
-			}
-		}]
-	}, {
-		"root": "pagesAir",
-		"pages": [{
-			"path": "shareAir/shareAir",
-			"style": {
-				"navigationBarTitleText": "共享空调",
-				"enablePullDownRefresh": false
-			}
-		}, {
-			"path": "addAir/addAir",
-			"style": {
-				"navigationBarTitleText": "添加空调",
-				"enablePullDownRefresh": false
-			}
-		}, {
-			"path": "stdBookMgr/stdBookMgr",
-			"style": {
-				"navigationBarTitleText": "台账管理",
-				"enablePullDownRefresh": false
-			}
-
-		}, {
-			"path": "accountBalance/accountBalance",
-			"style": {
-				"navigationBarTitleText": "账户余额",
-				"enablePullDownRefresh": false
-			}
-
-		}, {
-			"path": "rechargeRecord/rechargeRecord",
-			"style": {
-				"navigationBarTitleText": "充值记录",
-				"enablePullDownRefresh": false
-			}
-
-		}]
-	}],
+			]
+		}
+	],
 	// "preloadRule": {
 	// 	"pagesA/list/list": {
 	// 		"network": "all",

+ 4 - 0
pages/index/index.vue

@@ -17,6 +17,10 @@
 					<image src="../../static/images/air.png" mode=""></image>
 					<text>共享空调</text>
 				</navigator>
+				<navigator :url="'/pagesClockIn/index/index'" open-type="navigate" class="menu_item">
+					<image src="../../static/images/clockIn.png" mode=""></image>
+					<text>校园打卡</text>
+				</navigator>
 			</view>
 		</view>
 		<view class="qr_code" v-if="showQR_code">

+ 46 - 0
pagesClockIn/404/404.vue

@@ -0,0 +1,46 @@
+<template>
+	<view class="container">
+		<view class="img">
+			<img src="../static/imgs/404.png">
+		</view>
+
+		<view class="msg">
+			暂无权限
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		padding-top: 218rpx;
+		width: 100vw;
+		height: 100vh;
+		background-color: #fff;
+
+		.img {
+			margin: 0 auto;
+			width: 480rpx;
+			height: 508rpx;
+
+			img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+
+		.msg {
+			text-align: center;
+			color: #5792F0;
+		}
+	}
+</style>

+ 310 - 0
pagesClockIn/addLocation/addLocation.vue

@@ -0,0 +1,310 @@
+<template>
+	<view class="container">
+		<!-- 地图区域 -->
+		<view class="map">
+			<map style="width: 100%; height: 100%;" :latitude="latitude" :longitude="longitude" :scale="16"
+				:markers="covers" @tap="handleClick">
+			</map>
+		</view>
+
+		<!-- 顶部搜索框区域 -->
+		<view class="search">
+			<uni-search-bar bgColor="#fff" placeholder="请输入搜索地点" cancelButton="none" v-model="searchValue"
+				@clear="clear" @input="handleSearch">
+			</uni-search-bar>
+		</view>
+
+		<!-- 位置列表区域 -->
+		<view class="list" v-if="placeList.length">
+			<!-- 每一个位置区域 -->
+			<view class="box" v-for="item in placeList" :key="item.id" @click="handleChoose(item)">
+				<view class="icon">
+					<img src="../static/imgs/location2.png">
+				</view>
+				<view class="place">
+					<view class="top">
+						{{item.title}}
+					</view>
+					<view class="bottom">
+						地点:{{item.address}}
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 打卡范围区域 -->
+		<view class="range" v-if="placeList.length">
+			<view class="key">
+				打卡范围:
+			</view>
+			<view class="value" @click="changeRange">
+				<text>{{rangeValue}}米</text>
+				<img src="../static/imgs/right.png">
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	var QQMapWX = require('../util/qqmap-wx-jssdk1.1/qqmap-wx-jssdk');
+	var qqmapsdk;
+	export default {
+		data() {
+			return {
+				// 当前位置的经纬度
+				latitude: null,
+				longitude: null,
+				// 标记点的配置
+				covers: [{
+					id: 1,
+					latitude: null,
+					longitude: null,
+					iconPath: '../static/imgs/location.png',
+					width: 20,
+					height: 20,
+					callout: {
+						content: "",
+						display: "ALWAYS"
+					}
+				}],
+				// 搜索框绑定的值
+				searchValue: "",
+				// 范围选择数组
+				rangeList: ['100', '300', '500'],
+				// 搜索地点数组
+				placeList: [],
+				// 范围数值
+				rangeValue: 100,
+				// 选中的地点数组
+				chooseList: [],
+			}
+		},
+		onLoad() {
+			// 实例化API核心类
+			qqmapsdk = new QQMapWX({
+				// 申请的key
+				key: 'R43BZ-2XROX-L7T45-T5OQI-IBDFT-GNBOI'
+			});
+			this.getLocationData()
+		},
+		methods: {
+			// 获取当前位置信息
+			getLocationData() {
+				qqmapsdk.reverseGeocoder({
+					success: (res) => {
+						// console.log(res);
+						if (res.status == 0) {
+							// 获取地址经纬度
+							this.latitude = res.result.location.lat
+							this.longitude = res.result.location.lng
+							// 获取标记点地址经纬度
+							this.covers[0].latitude = res.result.location.lat
+							this.covers[0].longitude = res.result.location.lng
+							// 获取详细地址信息
+							this.covers[0].callout.content = res.result.address
+						} else {
+							uni.showToast({
+								title: "请求定位失败",
+								icon: 'none'
+							})
+						}
+					}
+				})
+			},
+			// 点击地图回调事件
+			handleClick(res) {
+				this.placeList = []
+				let {
+					latitude
+				} = res.detail
+				let {
+					longitude
+				} = res.detail
+				this.covers[0].latitude = latitude
+				this.covers[0].longitude = longitude
+				qqmapsdk.reverseGeocoder({
+					location: {
+						latitude,
+						longitude
+					},
+					get_poi: 1,
+					poi_options: "policy=2",
+					success: (res) => {
+						console.log(res);
+						if (res.status == 0) {
+							this.placeList = res.result.pois
+							this.covers[0].callout.content = res.result.address
+						} else {
+							uni.showToast({
+								title: "请求定位失败",
+								icon: 'none'
+							})
+						}
+					}
+				})
+			},
+			// 选择单个地址时的回调
+			handleChoose(item) {
+				let arr = uni.getStorageSync("chooseList")
+				if (arr.length) {
+					this.chooseList = arr
+				}
+				this.chooseList.push({
+					name: item.title,
+					address: item.address,
+					radius: this.rangeValue,
+					lat: item.location.lat,
+					lng: item.location.lng,
+				})
+				uni.setStorageSync("chooseList", this.chooseList)
+
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			// 点击选择打卡范围回调
+			changeRange() {
+				uni.showActionSheet({
+					itemList: this.rangeList,
+					success: (res) => {
+						this.rangeValue = this.rangeList[res.tapIndex]
+					}
+				});
+			},
+			// 搜索框失焦回调
+			handleSearch(res) {
+				this.placeList = []
+				qqmapsdk.search({
+					keyword: res,
+					auto_extend: "0",
+					success: (res) => {
+						if (res.status == 0) {
+							this.placeList = res.data
+						} else {
+							uni.showToast({
+								title: "搜索位置失败",
+								icon: 'none'
+							})
+						}
+					},
+				});
+			},
+			// 清除搜索框内容时的回调
+			clear(res) {
+				this.placeList = []
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		.map {
+			position: relative;
+			width: 100vw;
+			height: 100vh;
+		}
+
+		.search {
+			position: fixed;
+			top: 30rpx;
+			left: 30rpx;
+			width: 690rpx;
+			height: 80rpx;
+			border-radius: 152rpx;
+			background-color: #fff;
+		}
+
+		.list {
+			position: fixed;
+			left: 30rpx;
+			bottom: 100rpx;
+			padding: 0 30rpx;
+			box-sizing: border-box;
+			width: 690rpx;
+			height: 435rpx;
+			border-radius: 18rpx 18rpx 0 0;
+			background-color: #fff;
+			overflow-y: auto;
+
+			.box {
+				display: flex;
+				align-items: center;
+				width: 630rpx;
+				height: 104rpx;
+				border-bottom: 1rpx solid #E6E6E6;
+
+				.icon {
+					margin-top: 10rpx;
+					width: 80rpx;
+					text-align: center;
+
+					img {
+						width: 40rpx;
+						height: 40rpx;
+					}
+				}
+
+				.place {
+					width: 550rpx;
+
+					.top {
+						font-size: 32rpx;
+						overflow: hidden;
+						white-space: nowrap;
+						text-overflow: ellipsis;
+					}
+
+					.bottom {
+						font-size: 24rpx;
+						color: #999999;
+						overflow: hidden;
+						white-space: nowrap;
+						text-overflow: ellipsis;
+					}
+				}
+			}
+		}
+
+		.range {
+			position: fixed;
+			left: 0;
+			bottom: 0;
+			display: flex;
+			// flex-direction: column;
+			align-items: center;
+			width: 750rpx;
+			height: 100rpx;
+			box-shadow: 1px -4px 10px 0px rgba(0, 0, 0, 0.2);
+			background-color: #fff;
+
+			.key {
+				flex: 4;
+				margin-left: 30rpx;
+				font-size: 28rpx;
+			}
+
+			.value {
+				flex: 1;
+				font-size: 28rpx;
+				color: #A6A6A6;
+
+				img {
+					margin-left: 15rpx;
+					width: 20rpx;
+					height: 25rpx;
+				}
+			}
+		}
+	}
+
+	// 解决输入框不居中问题
+	::v-deep .uni-searchbar {
+		padding: 10rpx;
+	}
+
+	::v-deep .uni-searchbar__box {
+		padding: 0;
+		height: 60rpx;
+	}
+</style>

+ 417 - 0
pagesClockIn/addRules/addRules.vue

@@ -0,0 +1,417 @@
+<template>
+	<view class="container">
+		<!-- 每一个选项区域 -->
+		<view class="box">
+			<view class="name">
+				规则名称:
+			</view>
+			<view class="val" @click="goPageRuleName">
+				<view class="ele" v-if="ruleName=='未设置'">
+					{{ruleName}}
+				</view>
+				<view class="ele black" v-else>
+					{{ruleName}}
+				</view>
+				<view class="right">
+					<img src="../static/imgs/right.png">
+				</view>
+			</view>
+		</view>
+
+		<view class="box">
+			<view class="name">
+				考 勤 组:
+			</view>
+			<view class="val" @click="goPageGroup">
+				<view class="ele" v-if="group=='未设置'">
+					{{group}}
+				</view>
+				<view class="ele black" v-else>
+					{{group}}
+				</view>
+				<view class="right">
+					<img src="../static/imgs/right.png">
+				</view>
+			</view>
+		</view>
+
+		<view class="box">
+			<view class="name">
+				打卡时间:
+			</view>
+			<view class="val" @click="goPagePunchTime">
+				<view class="ele" v-if="time=='未设置'">
+					{{time}}
+				</view>
+				<view class="ele black" v-else>
+					<span v-for="(item,index) in time" :key="index">
+						<span v-for="(item_week,index_week) in item.dayOfWeeks" :key="index_week">
+							{{arr[item_week]}}
+						</span>
+						<span v-for="(item_time,index_time) in item.periods" :key="index_time">
+							{{format_time(item_time.beginTime)}}-{{format_time(item_time.endTime)}}
+						</span>
+					</span>
+				</view>
+				<view class="right">
+					<img src="../static/imgs/right.png">
+				</view>
+			</view>
+		</view>
+
+		<view class="box">
+			<view class="name">
+				打卡地点:
+			</view>
+			<view class="val" @click="goPagePunchLocation">
+				<view class="ele" v-if="place=='未设置'">
+					{{place}}
+				</view>
+				<view class="ele black" v-else>
+					{{place}}
+				</view>
+				<view class="right">
+					<img src="../static/imgs/right.png">
+				</view>
+			</view>
+		</view>
+
+		<view class="box">
+			<view class="name">
+				提前通知:
+			</view>
+			<picker :value="index" :range="array" @change="changeSelect">
+				<view class="val">
+					<view class="ele" v-if="value=='未设置'">
+						{{value}}
+					</view>
+					<view class="ele black" v-else>
+						{{value}}分钟
+					</view>
+					<view class="right">
+						<img src="../static/imgs/right.png">
+					</view>
+				</view>
+			</picker>
+		</view>
+
+		<view class="box">
+			<view class="name">
+				除去法定节假:
+			</view>
+			<view class="val2">
+				<switch style="transform:scale(0.8)" color="#3396FB" :checked="holiday" @change="switchChange" />
+			</view>
+		</view>
+
+		<!-- 确认按钮区域 -->
+		<view class="button" @click="handleConfirm">
+			确认
+		</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 规则名称
+				ruleName: "未设置",
+				// 考勤组
+				group: "未设置",
+				// 打卡时间
+				time: "未设置",
+				// 打卡地点
+				place: "未设置",
+				// 提前通知时间
+				value: "未设置",
+				// 提前通知时间选择数组
+				array: ['5分钟', '10分钟', '15分钟', '20分钟'],
+				// 提前通知时间选择数组默认选择的索引
+				index: 0,
+				// 考勤组id数组
+				groupIds: [],
+				// 打卡地点数组
+				locations: [],
+				// 是否同步节假日
+				holiday: false,
+				// 星期映射数组
+				arr: ["", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"]
+			};
+		},
+		onLoad() {
+			// 监听updateRuleName事件修改规则名称
+			uni.$on('updateRuleName', (data) => {
+				this.ruleName = data
+			})
+
+			// 监听updateRuleGroup事件修改考勤组
+			uni.$on('updateRuleGroup', (data) => {
+				let temList = []
+				this.groupIds = []
+				data.forEach((ele) => {
+					temList.push(ele.name)
+					this.groupIds.push(ele.id)
+				})
+				this.group = temList.join(",")
+			})
+		},
+		onShow() {
+			// 从缓存获取打卡时间数据
+			let ruleTime = uni.getStorageSync("ruleTime")
+			// 从缓存获取打卡时间数据是否为空的标识 true为空数组 false不为空
+			let flag = uni.getStorageSync("flag")
+
+			// 如果打卡时间数组不为空,将数组赋值给time
+			if (ruleTime) {
+				this.time = ruleTime
+			}
+			// 如果打卡时间数组为空,修改time的值
+			if (ruleTime.length == 0 && flag) {
+				this.time = "未设置"
+			}
+
+			// 从缓存获取打卡地点数据
+			let temPlace = uni.getStorageSync("chooseList")
+			// 从缓存获取打卡地点数据是否为空的标识 true为空数组 false不为空
+			let flag_place = uni.getStorageSync("flag_place")
+			// 如果打卡地点数组不为空,将数组赋值给locations
+			if (temPlace) {
+				this.locations = temPlace
+				let temList = []
+				temPlace.forEach((ele) => {
+					temList.push(ele.name)
+				})
+				this.place = temList.join(",")
+			}
+			// 如果打卡地点数组为空,修改place的值
+			if (temPlace.length == 0 && flag_place) {
+				this.place = "未设置"
+			}
+		},
+		methods: {
+			// 点击确认按钮回调
+			handleConfirm() {
+				if (this.ruleName == '未设置') {
+					uni.showToast({
+						title: "请设置规则名称",
+						icon: 'none'
+					})
+					return
+				}
+
+				if (this.group == '未设置') {
+					uni.showToast({
+						title: "请设置考勤组",
+						icon: 'none'
+					})
+					return
+				}
+
+				if (this.time == '未设置') {
+					uni.showToast({
+						title: "请设置打卡时间",
+						icon: 'none'
+					})
+					return
+				}
+
+				if (this.place == '未设置') {
+					uni.showToast({
+						title: "请设置打卡地点",
+						icon: 'none'
+					})
+					return
+				}
+
+				if (this.value == '未设置') {
+					uni.showToast({
+						title: "请设置提前通知时间",
+						icon: 'none'
+					})
+					return
+				}
+
+				uni.showModal({
+					title: '提示',
+					content: '确定新增吗?',
+					success: async (res) => {
+						if (res.confirm) {
+							let res = await this.$myRequest_clockIn({
+								url: "/attendance/api/settings/rule/add",
+								method: "post",
+								header: {
+									'Authorization': uni.getStorageSync("token")
+								},
+								data: {
+									// 是否需要人脸识别
+									faceRecognition: true,
+									// 考勤组ID列表
+									groupIds: this.groupIds,
+									// 是否同步节假日
+									holiday: this.holiday,
+									// 是否可选择本地图片
+									localPicture: false,
+									// 规则名称
+									name: this.ruleName,
+									// 提前通知时间
+									noticeTime: this.value,
+									// 是否需要场景拍照
+									takePicture: true,
+									// 打卡地点列表
+									locations: this.locations,
+									// 打卡时间列表
+									timeGroups: this.time
+								},
+							})
+							// console.log(res)
+							if (res.code == 200) {
+								uni.showToast({
+									title: "添加成功",
+									icon: 'success'
+								})
+								setTimeout(() => {
+									uni.navigateBack({
+										delta: 1
+									})
+								}, 1500)
+							}
+						}
+					}
+				});
+			},
+			// 提前通知选择框点击回调
+			changeSelect(e) {
+				let index = e.detail.value
+				this.value = this.array[index]
+				let index2 = this.value.indexOf("分", 0)
+				this.value = this.value.substring(0, index2);
+			},
+			// switch的值改变回调
+			switchChange(e) {
+				this.holiday = e.detail.value
+				// console.log(this.holiday);
+			},
+			// 点击规则名称跳转回调
+			goPageRuleName() {
+				uni.navigateTo({
+					url: `/pagesClockIn/ruleName/ruleName`
+				})
+			},
+			// 点击考勤组跳转回调
+			goPageGroup() {
+				uni.navigateTo({
+					url: `/pagesClockIn/group/group?flag=2`
+				})
+			},
+			// 点击打卡时间跳转回调
+			goPagePunchTime() {
+				uni.navigateTo({
+					url: "/pagesClockIn/punchTime/punchTime"
+				})
+			},
+			// 点击打卡地点跳转回调
+			goPagePunchLocation() {
+				uni.navigateTo({
+					url: "/pagesClockIn/punchLocation/punchLocation"
+				})
+			},
+			// 格式化时间
+			formatTime(val) {
+				let tem = '2021-11-22 ' + val + ':00'
+				// console.log(tem);
+				let date = new Date(tem);
+				let time = date.getTime();
+				return time
+			},
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				let strDate = h + m;
+				return strDate;
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		height: 100vh;
+		background-color: #fff;
+
+		.box {
+			display: flex;
+			align-items: center;
+			margin: 0 30rpx;
+			width: 690rpx;
+			height: 90rpx;
+			font-size: 30rpx;
+			border-bottom: 1rpx solid #CCCCCC;
+
+			.name {
+				flex: 1;
+			}
+
+			.val {
+				flex: 3;
+				display: flex;
+				align-items: center;
+
+				.ele {
+					margin-right: 20rpx;
+					display: inline-block;
+					width: 460rpx;
+					text-align: end;
+					color: #A6A6A6;
+					overflow: hidden;
+					white-space: nowrap;
+					text-overflow: ellipsis;
+
+					span {
+						margin-right: 10rpx;
+					}
+				}
+
+				.black {
+					color: #000;
+				}
+
+				.right {
+					width: 40rpx;
+					display: inline-flex;
+					justify-content: center;
+					align-items: center;
+
+					img {
+						width: 16rpx;
+						height: 25rpx;
+					}
+				}
+			}
+
+			.val2 {
+				flex: 1;
+				margin-right: 20rpx;
+				text-align: end;
+			}
+		}
+
+		.button {
+			margin: auto;
+			margin-top: 52rpx;
+			width: 690rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			font-size: 32rpx;
+			font-weight: 500;
+			color: #fff;
+			border-radius: 16rpx;
+			background-color: #3396FB;
+		}
+	}
+</style>

+ 327 - 0
pagesClockIn/authentication/authentication.vue

@@ -0,0 +1,327 @@
+<template>
+	<view class="container">
+		<view class="notes">
+			拍摄您本人人脸,确保对准手机,光线充足
+		</view>
+		<view class="msg">
+			{{name}} {{cardNumber}}
+		</view>
+		<view class="info">
+			<span v-if="tipsText">{{tipsText}}</span>
+		</view>
+		<view class="photo">
+			<camera class="img" v-if='isAuthCamera' device-position="front" flash="off" resolution='high' />
+			<img v-else :src="tempImg">
+		</view>
+		<view class="button" @click="handleTakePhotoClick">
+			开启身份认证
+		</view>
+
+		<!-- 认证结果弹窗 -->
+		<uni-popup ref="popup" :is-mask-click="false">
+			<view class="popup-content">
+				<view class="title">
+					<view class="icon">
+						<img src="./imgs/success.png">
+					</view>
+					<view class="title_info">
+						打卡成功
+					</view>
+				</view>
+				<view class="time">
+					{{nowTime}}
+				</view>
+				<view class="popup_button" @click="handleGoHome">
+					我知道了
+				</view>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 错误文案提示
+				tipsText: '',
+				// 当前时间
+				nowTime: "",
+				// 本地图片路径 被匹对照片
+				tempImg: '',
+				// 场景照片
+				sceneImage: "",
+				// 经纬度
+				lat: "",
+				lng: "",
+				// 地址
+				location: "",
+				// 规则id
+				id: "",
+				// 相机引擎
+				cameraEngine: null,
+				// 是否拥有相机权限
+				isAuthCamera: true,
+				// 姓名
+				name: "",
+				// 身份证号
+				cardNumber: ""
+			};
+		},
+		onLoad(options) {
+			this.id = options.id
+			this.lat = options.latitude
+			this.lng = options.longitude
+			this.location = options.address
+			this.sceneImage = options.imgUrl
+			this.initData()
+			let userInfo = uni.getStorageSync("userInfo")
+			if (userInfo) {
+				this.name = userInfo.name
+				this.cardNumber = userInfo.cardNumber
+			}
+		},
+		methods: {
+			// 初始化相机引擎
+			initData() {
+				// #ifdef MP-WEIXIN
+				// 1、初始化人脸识别
+				wx.initFaceDetect()
+				// 2、创建 camera 上下文 CameraContext 对象
+				this.cameraEngine = wx.createCameraContext()
+				// 3、获取 Camera 实时帧数据
+				const listener = this.cameraEngine.onCameraFrame((frame) => {
+					if (this.tempImg) {
+						return;
+					}
+					// 4、人脸识别,使用前需要通过 wx.initFaceDetect 进行一次初始化,推荐使用相机接口返回的帧数据
+					wx.faceDetect({
+						frameBuffer: frame.data,
+						width: frame.width,
+						height: frame.height,
+						enablePoint: true,
+						enableConf: true,
+						enableAngle: true,
+						enableMultiFace: true,
+						success: (faceData) => {
+							let face = faceData.faceInfo[0]
+							if (faceData.x == -1 || faceData.y == -1) {
+								this.tipsText = '检测不到人'
+							}
+							if (faceData.faceInfo.length > 1) {
+								this.tipsText = '请保证只有一个人'
+							} else {
+								const {
+									pitch,
+									roll,
+									yaw
+								} = face.angleArray;
+								const standard = 0.5
+								if (Math.abs(pitch) >= standard || Math.abs(roll) >= standard ||
+									Math.abs(yaw) >= standard) {
+									this.tipsText = '请平视摄像头'
+								} else if (face.confArray.global <= 0.8 || face.confArray.leftEye <=
+									0.8 || face.confArray.mouth <= 0.8 || face.confArray.nose <= 0.8 ||
+									face.confArray.rightEye <= 0.8) {
+									this.tipsText = '请勿遮挡五官'
+								} else {
+									this.tipsText = '请点击下方按钮开始认证'
+									// 这里可以写自己的逻辑了
+								}
+							}
+						},
+						fail: (err) => {
+							if (err.x == -1 || err.y == -1) {
+								this.tipsText = '检测不到人'
+							} else {
+								this.tipsText = err.errMsg || '网络错误,请退出页面重试'
+							}
+						},
+					})
+				})
+				// 5、开始监听帧数据
+				listener.start()
+				// #endif
+			},
+
+			// 拍照点击
+			handleTakePhotoClick() {
+				if (this.tipsText != "" && this.tipsText != "请点击下方按钮开始认证") {
+					return;
+				}
+				uni.getSetting({
+					success: (res) => {
+						if (!res.authSetting['scope.camera']) {
+							this.isAuthCamera = true
+							uni.openSetting({
+								success: (res) => {
+									if (res.authSetting['scope.camera']) {
+										this.isAuthCamera = true;
+									}
+								}
+							})
+						}
+					}
+				})
+				this.cameraEngine.takePhoto({
+					quality: "high",
+					success: ({
+						tempImagePath
+					}) => {
+						this.tempImg = tempImagePath
+						this.isAuthCamera = false
+						this.tipsText = ""
+						this.handleOkClick()
+					}
+				})
+			},
+			// 上传
+			handleOkClick() {
+				//  这里的 this.tempImg 是经过人脸检测后  拍照拿到的路径  
+				this.upLoadOne()
+			},
+			upLoadOne() {
+				uni.showLoading({
+					title: "检测中,请稍后...",
+				});
+				setTimeout(async () => {
+					let res = await this.$myRequest_clockIn({
+						url: "/attendance/api/sign/check/in/update",
+						method: "put",
+						header: {
+							'Authorization': uni.getStorageSync("token")
+						},
+						data: {
+							id: this.id,
+							lat: this.lat,
+							lng: this.lng,
+							location: this.location,
+							matchFaceImage: this.tempImg,
+							sceneImage: this.sceneImage,
+						}
+					})
+					// console.log(res);
+					if (res.code == 200) {
+						this.getNowTime()
+						this.$refs.popup.open()
+					}
+				}, 2000)
+			},
+			// 点击 我知道了按钮 跳回首页
+			handleGoHome() {
+				this.$refs.popup.close()
+				uni.reLaunch({
+					url: "/pagesClockIn/home/home"
+				})
+			},
+			// 获取当前时间
+			getNowTime() {
+				let date = new Date()
+				let hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
+				let minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
+				let seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
+				this.nowTime = hours + ':' + minutes + ':' + seconds
+			}
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		.notes {
+			margin-top: 110rpx;
+			text-align: center;
+			font-size: 28rpx;
+		}
+
+		.msg {
+			margin-top: 10rpx;
+			text-align: center;
+			font-size: 28rpx;
+		}
+
+		.info {
+			margin-top: 100rpx;
+			height: 40rpx;
+			text-align: center;
+		}
+
+		.photo {
+			margin: 0 auto;
+			margin-top: 40rpx;
+			width: 375rpx;
+			height: 375rpx;
+			border-radius: 188rpx;
+			overflow: hidden;
+
+			.img {
+				width: 100%;
+				height: 100%;
+				border-radius: 50%;
+			}
+
+			img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+
+		.button {
+			margin: 0 auto;
+			margin-top: 127rpx;
+			width: 430rpx;
+			height: 100rpx;
+			line-height: 100rpx;
+			text-align: center;
+			color: #fff;
+			border-radius: 21rpx;
+			font-size: 32rpx;
+			background: linear-gradient(180deg, rgba(0, 172, 252, 1) 0%, rgba(0, 130, 252, 1) 100%);
+		}
+
+		.popup-content {
+			display: flex;
+			flex-direction: column;
+			justify-content: space-around;
+			align-items: center;
+			width: 630rpx;
+			height: 376rpx;
+			border-radius: 33rpx;
+			background-color: #fff;
+
+			.title {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+
+				.icon {
+					width: 40rpx;
+					height: 40rpx;
+
+					img {
+						width: 100%;
+						height: 100%;
+					}
+				}
+
+				.title_info {
+					margin-left: 8rpx;
+					font-size: 36rpx;
+					font-weight: 800;
+					color: #0082FC;
+				}
+			}
+
+			.time {
+				font-size: 32rpx;
+			}
+
+			.popup_button {
+				width: 50%;
+				text-align: center;
+				font-size: 32rpx;
+				color: #0082FC;
+			}
+		}
+	}
+</style>

BIN
pagesClockIn/authentication/imgs/photo.png


BIN
pagesClockIn/authentication/imgs/success.png


+ 499 - 0
pagesClockIn/cardRecord/cardRecord.vue

@@ -0,0 +1,499 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 头部区域 -->
+		<view class="header">
+			<!-- 时间区域 -->
+			<view class="calendar">
+				<!-- 双左箭头区域 -->
+				<view class="double" @click="handleDoubleLeft">
+					<img src="../static/imgs/double_left.png">
+				</view>
+				<!-- 左箭头区域区域 -->
+				<view class="single" @click="handleLeft">
+					<img src="../static/imgs/left.png">
+				</view>
+				<!-- 时间区域 -->
+				<view class="time">
+					{{year}}-{{format_month}}
+				</view>
+				<!-- 双右箭头区域 -->
+				<view class="single2" @click="handleRight">
+					<img src="../static/imgs/right2.png">
+				</view>
+				<!-- 右箭头区域 -->
+				<view class="double" @click="handleDoubleRight">
+					<img src="../static/imgs/double_right.png">
+				</view>
+
+			</view>
+
+			<!-- 打卡状态切换区域 -->
+			<view class="state">
+				<uni-segmented-control :current="current" :values="items" styleType="text" @clickItem="onClickItem"
+					activeColor="#0082FC"></uni-segmented-control>
+			</view>
+		</view>
+
+		<!-- 打卡记录区域 -->
+		<view class="list" v-if="list.length">
+			<!-- 每一条记录区域 -->
+			<view class="box" v-for="(item,index) in list" :key="index">
+				<!-- 人物信息区域 -->
+				<view class="person">
+					<view class="img">
+						<img :src="item.headImage||'../static/imgs/headImage.png'">
+					</view>
+					<view class="info">
+						<view class="name">
+							{{item.name}}
+						</view>
+						<view class="college">
+							{{item.college?item.college:"南昌交通学院"}}
+						</view>
+					</view>
+				</view>
+				<!-- 图片区域 -->
+				<view class="imgs" v-if="item.status==4">
+					<view class="imgs_item">
+						<view class="image">
+							<img :src="item.faceImage||'../static/imgs/headImage.png'">
+						</view>
+						<view class="title">
+							匹对照片
+						</view>
+					</view>
+
+					<view class="imgs_item">
+						<view class="image">
+							<img :src="item.matchFaceImage||'../static/imgs/headImage.png'">
+						</view>
+						<view class="title">
+							被匹对照片
+						</view>
+					</view>
+
+					<view class="imgs_item">
+						<view class="image">
+							<img :src="item.sceneImage||'../static/imgs/headImage.png'">
+						</view>
+						<view class="title">
+							场景照片
+						</view>
+					</view>
+				</view>
+				<!-- 打卡信息区域 -->
+				<view class="msg">
+					<view class="msg_item">
+						<view class="key">
+							打卡状态:
+						</view>
+						<view class="value">
+							{{item.status==4?"打卡成功":"打卡失败"}}
+						</view>
+					</view>
+					<view class="msg_item">
+						<view class="key">
+							打卡规则:
+						</view>
+						<view class="value">
+							{{item.ruleName}}
+						</view>
+					</view>
+					<view class="msg_item" v-if="item.status==4">
+						<view class="key">
+							打卡时间:
+						</view>
+						<view class="value">
+							{{format_time(item.updateTime)}}
+						</view>
+					</view>
+					<view class="msg_item" v-if="item.status==4">
+						<view class="key">
+							打卡地址:
+						</view>
+						<view class="value">
+							{{item.location}}
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 暂无数据显示区域 -->
+		<view class="no_data" v-if="list.length==0">
+			<img src="../static/imgs/nodata.png">
+			<view class="info">
+				暂无数据
+			</view>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 第几页
+				page: 1,
+				// 每页条数
+				size: 10,
+				// 数据总条数
+				total: 0,
+				// 打卡状态参数
+				status: "",
+				// 打卡时间参数
+				time: null,
+				// 当前年份
+				year: null,
+				// 当前月份
+				month: null,
+				// 分段器选项
+				items: ['全部', '打卡成功', '打卡失败'],
+				// 当前所在分段器索引
+				current: 0,
+				// 列表数组
+				list: [],
+			};
+		},
+		onLoad() {
+			this.getTime()
+			this.getListData()
+		},
+		// 页面滑动到底部触发的回调
+		onReachBottom() {
+			if (this.list.length < this.total) {
+				this.page++
+				this.getListData()
+			} else {
+				uni.showToast({
+					title: "没有更多数据了",
+					icon: 'none'
+				})
+			}
+		},
+		computed: {
+			// 格式化月份
+			format_month() {
+				let temTime = this.month < 10 ? '0' + this.month : this.month
+				return temTime
+			}
+		},
+		methods: {
+			// 获取当前年份,月份
+			getTime() {
+				let date = new Date()
+				let year = date.getFullYear()
+				let month = date.getMonth() + 1
+				this.month = month
+				this.year = year
+			},
+
+			// 获取打卡记录列表数组
+			async getListData() {
+				this.time = this.year + "-" + this.format_month + "-01 00:00:00"
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/sign/check/in/list/month",
+					data: {
+						page: this.page,
+						size: this.size,
+						status: this.status,
+						time: this.time
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.total = res.data.total
+					this.list = [...this.list, ...res.data.list]
+				}
+			},
+
+			// 点击分段器回调
+			onClickItem(e) {
+				this.list = []
+				if (e.currentIndex == 0) {
+					this.status = ""
+				} else if (e.currentIndex == 1) {
+					this.status = 4
+				} else if (e.currentIndex == 2) {
+					this.status = 3
+				}
+				this.page = 1
+				this.getListData()
+			},
+
+			// 往后选择年份回调
+			handleDoubleLeft() {
+				if (this.year <= 2000) {
+					uni.showToast({
+						title: "不能选择2000年之前",
+						icon: 'none'
+					})
+				} else {
+					this.list = []
+					this.year -= 1
+					this.page = 1
+					this.getListData()
+				}
+			},
+
+			// 往前选择年份回调
+			handleDoubleRight() {
+				if (this.year >= 2025) {
+					uni.showToast({
+						title: "不能选择2025年之后",
+						icon: 'none'
+					})
+				} else {
+					this.list = []
+					this.year += 1
+					this.page = 1
+					this.getListData()
+				}
+			},
+
+			// 往后选择月份回调
+			handleLeft() {
+				if (this.month <= 1) {
+					if (this.year <= 2000) {
+						uni.showToast({
+							title: "不能选择2000年之前",
+							icon: 'none'
+						})
+					} else {
+						this.list = []
+						this.year -= 1
+						this.month = 12
+						this.page = 1
+						this.getListData()
+					}
+				} else {
+					this.list = []
+					this.month -= 1
+					this.page = 1
+					this.getListData()
+				}
+
+			},
+			// 往前选择月份回调
+			handleRight() {
+				if (this.month >= 12) {
+					if (this.year >= 2025) {
+						uni.showToast({
+							title: "不能选择2025年之后",
+							icon: 'none'
+						})
+					} else {
+						this.list = []
+						this.year += 1
+						this.month = 1
+						this.page = 1
+						this.getListData()
+					}
+				} else {
+					this.list = []
+					this.month += 1
+					this.page = 1
+					this.getListData()
+				}
+			},
+
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var y = date.getFullYear();
+				var m = date.getMonth() + 1;
+				var d = date.getDate();
+				m = m < 10 ? "0" + m : m;
+				d = d < 10 ? "0" + d : d;
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
+				var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				var s = date.getSeconds()
+				s = s < 10 ? "0" + s : s;
+				let strDate = y + "-" + m + "-" + d + " " + h + ":" + mm + ":" + s;
+				return strDate;
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+
+		.placeholder {
+			height: 20rpx;
+		}
+
+		.header {
+			display: flex;
+			flex-direction: column;
+			justify-content: space-evenly;
+			margin: 0 auto;
+			width: 690rpx;
+			height: 192rpx;
+			background-color: #fff;
+
+			.calendar {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				flex: 1;
+
+				.double {
+					width: 40rpx;
+					height: 40rpx;
+
+					img {
+						width: 100%;
+						height: 100%;
+					}
+				}
+
+				.single {
+					margin-left: 30rpx;
+					width: 40rpx;
+					height: 40rpx;
+
+					img {
+						width: 80%;
+						height: 70%;
+					}
+				}
+
+				.single2 {
+					margin-right: 30rpx;
+					width: 40rpx;
+					height: 40rpx;
+
+					img {
+						width: 100%;
+						height: 70%;
+					}
+				}
+
+				.time {
+					width: 180rpx;
+					height: 44rpx;
+					font-size: 32rpx;
+					text-align: center;
+				}
+			}
+
+			.state {
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				flex: 1;
+			}
+		}
+
+		.list {
+			padding-bottom: 50rpx;
+
+			.box {
+				margin: 0 auto;
+				margin-top: 20rpx;
+				width: 690rpx;
+				background-color: #fff;
+
+				.person {
+					display: flex;
+					align-items: center;
+					height: 134rpx;
+
+					.img {
+						margin: 0 20rpx 0 30rpx;
+						width: 70rpx;
+						height: 70rpx;
+
+						img {
+							width: 100%;
+							height: 100%;
+						}
+					}
+
+					.info {
+						width: 620rpx;
+						height: 70rpx;
+
+						.name {
+							font-size: 32rpx;
+						}
+
+						.college {
+							font-size: 24rpx;
+							color: #A6A6A6;
+						}
+					}
+				}
+
+				.imgs {
+					display: flex;
+					justify-content: space-evenly;
+					height: 201rpx;
+
+					.imgs_item {
+						display: flex;
+						flex-direction: column;
+						align-items: center;
+						flex: 1;
+
+						.image {
+							width: 120rpx;
+							height: 120rpx;
+
+							img {
+								width: 100%;
+								height: 100%;
+							}
+						}
+
+						.title {
+							margin-top: 10rpx;
+							font-size: 28rpx;
+						}
+					}
+				}
+
+				.msg {
+					margin-left: 30rpx;
+
+					.msg_item {
+						display: flex;
+						align-items: center;
+						height: 63rpx;
+						font-size: 28rpx;
+
+						.key {
+							color: #808080;
+						}
+
+						.value {}
+					}
+				}
+			}
+		}
+
+		.no_data {
+			margin: 0 auto;
+			margin-top: 230rpx;
+			width: 480rpx;
+			height: 508rpx;
+			text-align: center;
+
+			img {
+				width: 100%;
+				height: 100%;
+			}
+
+			.info {
+				color: #5792F0;
+			}
+		}
+	}
+</style>

BIN
pagesClockIn/components/.DS_Store


BIN
pagesClockIn/components/chocolate-progress-bar/.DS_Store


+ 114 - 0
pagesClockIn/components/chocolate-progress-bar/chocolate-progress-bar.vue

@@ -0,0 +1,114 @@
+<template>
+	<view class="progress_box">
+		<canvas class="progress_bg" canvas-id="cpbg"></canvas>
+		<canvas class="progress_bar" canvas-id="cpbar"></canvas>
+		<view class="progress_txt">
+			<!-- <view class="progress_info">{{ progress_txt }}%</view> -->
+			<view class="progress_info">{{progress_txt}}/{{progress_total}}</view>
+			<text>每日完成占比</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			progress_txt: {
+				type: Number,
+				default: 0
+			},
+			progress_total: {
+				type: Number,
+				default: 0
+			}
+		},
+		onReady() {
+			this.drawProgressbg();
+			this.drawCircle(this.progress_txt / this.progress_total * 100); //参数为1-100
+		},
+		methods: {
+			drawProgressbg() {
+				// 自定义组件实例 this ,表示在这个自定义组件下查找拥有 canvas-id 的 <canvas/>
+				var ctx = uni.createCanvasContext('cpbg', this);
+				ctx.setLineWidth(8); // 设置圆环的宽度
+				ctx.setStrokeStyle('#CCCCCC'); // 设置圆环的颜色
+				ctx.setLineCap('round'); // 设置圆环端点的形状
+				ctx.beginPath(); //开始一个新的路径
+				ctx.arc(80, 60, 55, 0.85 * Math.PI, 0.15 * Math.PI, false);
+				//设置一个原点(110,110),半径为100的圆的路径到当前路径
+				ctx.stroke(); //对当前路径进行描边
+				ctx.draw();
+			},
+			drawCircle(step) {
+				if (step == 0 || Object.is(step, NaN)) {
+					return
+				} else {
+					var ctx = uni.createCanvasContext('cpbar', this);
+					// 进度条的渐变(中心x坐标-半径-边宽,中心Y坐标,中心x坐标+半径+边宽,中心Y坐标)
+					var gradient = ctx.createLinearGradient(28, 55, 192, 55);
+					gradient.addColorStop('0', '#2A82E4');
+					gradient.addColorStop('1.0', '#2A82E4');
+					ctx.setLineWidth(8);
+					ctx.setStrokeStyle(gradient);
+					ctx.setLineCap('round');
+					ctx.beginPath();
+					// 参数step 为绘制的百分比
+					step = 0.015 * step + 0.75;
+					if (step >= 2.25) {
+						step = 0.15
+					}
+					ctx.arc(80, 60, 55, 0.85 * Math.PI, step * Math.PI, false);
+					ctx.stroke();
+					ctx.draw();
+				}
+
+			}
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	.progress_box {
+		position: relative;
+		width: 100%;
+		height: 100%;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		text-align: center;
+
+		.progress_bg {
+			position: absolute;
+			width: 100%;
+			height: 100%;
+		}
+
+		.progress_bar {
+			position: absolute;
+			width: 100%;
+			height: 100%;
+		}
+
+		.progress_txt {
+			position: absolute;
+			padding-right: 20rpx;
+
+			.progress_info {
+				letter-spacing: 2rpx;
+				font-size: 36rpx;
+			}
+
+			text {
+				font-size: 22rpx;
+				color: #A6A6A6;
+			}
+		}
+	}
+
+	/* .progress_dot {
+		width: 16upx;
+		height: 16upx;
+		border-radius: 50%;
+		background-color: #fb9126;
+	} */
+</style>

BIN
pagesClockIn/components/kx-time-picker.zip


+ 107 - 0
pagesClockIn/components/kx-time-picker/kx-time-picker.vue

@@ -0,0 +1,107 @@
+<template>
+	<view>
+		<picker mode="multiSelector" @columnchange="bindMultiPickerColumnChange" @change="bindMultiChange" @cancel="bindMultiCancel" :value="multiIndex"
+			:range="multiArray">
+			<view class="uni-input">
+				<text v-if="kxTimeValue.value">{{kxTimeValue.value}}</text>
+				<text v-else class="default">请选择时间段</text>
+			</view>
+		</picker>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "kx-time-picker",
+		data() {
+			//根据传输时间段判断展示内容
+			let [multiIndex,mIndex] = this.multiFunt();
+			return {
+				multiIndex: multiIndex, //当前区间选中值
+				mIndex: mIndex, //选择范围区间
+			};
+		},
+		//接受参数
+		props: ['kxTimeValue'],
+		computed: {
+			//选择时间段
+			multiArray() {
+				let multiArray = [];
+				let startArray = this.hourArray(this.mIndex[0]);
+				let endArray = this.hourArray(this.mIndex[1]);
+				multiArray = [startArray, endArray];
+				console.log(multiArray)
+				return multiArray
+			},
+			//展示时间段
+			startTime() {
+				return this.multiArray[0][this.multiIndex[0]]
+			},
+			endTime() {
+				return this.multiArray[1][this.multiIndex[1]]
+			},
+			showTime() {
+				return this.startTime + '--' + this.endTime
+			},
+		},
+		methods: {
+			//数据整理
+			multiFunt(){
+				let multiIndex = [0, 0],
+					mIndex = [0, 1]
+				if (this.kxTimeValue.value) {
+					let multiA = this.kxTimeValue.value.split('--');
+					multiA = multiA.map((v) => {
+						return Number(v.split(':')[0])
+					});
+					multiIndex[0]=multiA[0];
+					mIndex[1]=multiIndex[0]+1;
+					multiIndex[1]=multiA[1]-mIndex[1];
+				}
+				return [multiIndex,mIndex]
+			},
+			//时间段数组
+			hourArray(start = 0, end = 24) {
+				let array = [];
+				if (start == 0) {
+					end = 23
+				}
+				for (let i = start; i <= end; i++) {
+					array.push(i + ':00')
+				}
+				return array
+			},
+			//修改列
+			bindMultiPickerColumnChange: function(e) {
+				this.multiIndex[e.detail.column] = e.detail.value
+				switch (e.detail.column) {
+					case 0: //拖动第1列
+						this.mIndex[1] = e.detail.value + 1
+						if (this.multiIndex[1]) this.multiIndex[1]--;
+						break
+				}
+				this.mIndex.splice(0, 0)
+			},
+			//点击确定
+			bindMultiChange(e){
+				this.$emit('kxTimeFunt',{
+					value:this.showTime,
+					start:this.startTime,
+					end:this.endTime
+				})
+			},
+			//点击取消
+			bindMultiCancel(){
+				let [multiIndex,mIndex] = this.multiFunt();
+				this.multiIndex=multiIndex;
+				this.mIndex=mIndex;
+			}
+		}
+	}
+</script>
+
+<style scoped>
+	.default{
+		color: #8f8f94;
+	}
+</style>

+ 151 - 0
pagesClockIn/components/tki-tree/style.css

@@ -0,0 +1,151 @@
+.tki-tree-mask {
+  position: fixed;
+  top: 0rpx;
+  right: 0rpx;
+  bottom: 0rpx;
+  left: 0rpx;
+  z-index: 9998;
+  background-color: rgba(0, 0, 0, 0.6);
+  opacity: 0;
+  transition: all 0.3s ease;
+  visibility: hidden;
+}
+.tki-tree-mask.show {
+  visibility: visible;
+  opacity: 1;
+}
+.tki-tree-cnt {
+  position: fixed;
+  top: 0rpx;
+  right: 0rpx;
+  bottom: 0rpx;
+  left: 0rpx;
+  z-index: 9999;
+  top: 160rpx;
+  transition: all 0.3s ease;
+  transform: translateY(100%);
+}
+.tki-tree-cnt.show {
+  transform: translateY(0);
+}
+.tki-tree-bar {
+  background-color: #fff;
+  height: 72rpx;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  box-sizing: border-box;
+  border-bottom-width: 1rpx !important;
+  border-bottom-style: solid;
+  border-bottom-color: #f5f5f5;
+  font-size: 32rpx;
+  color: #757575;
+  line-height: 1;
+}
+.tki-tree-bar-confirm {
+  color: #07bb07;
+}
+.tki-tree-view {
+  position: absolute;
+  top: 0rpx;
+  right: 0rpx;
+  bottom: 0rpx;
+  left: 0rpx;
+  top: 72rpx;
+  background-color: #fff;
+  padding-top: 20rpx;
+  padding-right: 20rpx;
+  padding-bottom: 20rpx;
+  padding-left: 20rpx;
+}
+.tki-tree-view-sc {
+  height: 100%;
+  overflow: hidden;
+}
+.tki-tree-item {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  font-size: 26rpx;
+  color: #757575;
+  line-height: 1;
+  height: 0;
+  opacity: 0;
+  transition: 0.2s;
+  position: relative;
+  overflow: hidden;
+}
+.tki-tree-item.show {
+  height: 80rpx;
+  opacity: 1;
+}
+.tki-tree-item.showchild:before {
+  transform: rotate(90deg);
+}
+.tki-tree-item.last:before {
+  opacity: 0;
+}
+.tki-tree-icon {
+  width: 26rpx;
+  height: 26rpx;
+  margin-right: 8rpx;
+}
+.tki-tree-label {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  height: 100%;
+  line-height: 1.2;
+}
+.tki-tree-check {
+  width: 40px;
+  height: 40px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.tki-tree-check-yes,
+.tki-tree-check-no {
+  width: 20px;
+  height: 20px;
+  border-top-left-radius: 20%;
+  border-top-right-radius: 20%;
+  border-bottom-right-radius: 20%;
+  border-bottom-left-radius: 20%;
+  border-top-width: 1rpx;
+  border-left-width: 1rpx;
+  border-bottom-width: 1rpx;
+  border-right-width: 1rpx;
+  border-style: solid;
+  border-color: #07bb07;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  box-sizing: border-box;
+}
+.tki-tree-check-yes-b {
+  width: 12px;
+  height: 12px;
+  border-top-left-radius: 20%;
+  border-top-right-radius: 20%;
+  border-bottom-right-radius: 20%;
+  border-bottom-left-radius: 20%;
+  background-color: #07bb07;
+}
+.tki-tree-check .radio {
+  border-top-left-radius: 50%;
+  border-top-right-radius: 50%;
+  border-bottom-right-radius: 50%;
+  border-bottom-left-radius: 50%;
+}
+.tki-tree-check .radio .tki-tree-check-yes-b {
+  border-top-left-radius: 50%;
+  border-top-right-radius: 50%;
+  border-bottom-right-radius: 50%;
+  border-bottom-left-radius: 50%;
+}
+.hover-c {
+  opacity: 0.6;
+}

Fichier diff supprimé car celui-ci est trop grand
+ 302 - 0
pagesClockIn/components/tki-tree/tki-tree.vue


+ 501 - 0
pagesClockIn/editRules/editRules.vue

@@ -0,0 +1,501 @@
+<template>
+	<view class="container">
+		<!-- 每一个选项区域 -->
+		<view class="box">
+			<view class="name">
+				规则名称:
+			</view>
+			<view class="val" @click="goPageRuleName">
+				<view class="ele" v-if="ruleName=='未设置'">
+					{{ruleName}}
+				</view>
+				<view class="ele black" v-else>
+					{{ruleName}}
+				</view>
+				<view class="right">
+					<img src="../static/imgs/right.png">
+				</view>
+			</view>
+		</view>
+
+		<view class="box">
+			<view class="name">
+				考 勤 组:
+			</view>
+			<view class="val" @click="goPageGroup">
+				<view class="ele" v-if="group=='未设置'">
+					{{group}}
+				</view>
+				<view class="ele black" v-else>
+					{{group}}
+				</view>
+				<view class="right">
+					<img src="../static/imgs/right.png">
+				</view>
+			</view>
+
+		</view>
+
+		<view class="box">
+			<view class="name">
+				打卡时间:
+			</view>
+			<view class="val" @click="goPagePunchTime">
+				<view class="ele" v-if="time=='未设置'">
+					{{time}}
+				</view>
+				<view class="ele black" v-else>
+					<span v-for="(item,index) in time" :key="index">
+						<span v-for="(item_week,index_week) in item.dayOfWeeks" :key="index_week">
+							{{arr[item_week]}}
+						</span>
+						<span v-for="(item_time,index_time) in item.periods" :key="index_time">
+							{{format_time(item_time.beginTime)}}-{{format_time(item_time.endTime)}}
+						</span>
+					</span>
+				</view>
+				<view class="right">
+					<img src="../static/imgs/right.png">
+				</view>
+			</view>
+		</view>
+
+		<view class="box">
+			<view class="name">
+				打卡地点:
+			</view>
+			<view class="val" @click="goPagePunchLocation">
+				<view class="ele" v-if="place=='未设置'">
+					{{place}}
+				</view>
+				<view class="ele black" v-else>
+					{{place}}
+				</view>
+				<view class="right">
+					<img src="../static/imgs/right.png">
+				</view>
+			</view>
+		</view>
+
+		<view class="box">
+			<view class="name">
+				提前通知:
+			</view>
+			<picker :value="index" :range="array" @change="changeSelect">
+				<view class="val">
+					<view class="ele" v-if="value=='未设置'">
+						{{value}}
+					</view>
+					<view class="ele black" v-else>
+						{{value}}分钟
+					</view>
+					<view class="right">
+						<img src="../static/imgs/right.png">
+					</view>
+				</view>
+			</picker>
+		</view>
+
+		<view class="box">
+			<view class="name">
+				除去法定节假:
+			</view>
+			<view class="val2">
+				<switch style="transform:scale(0.8)" color="#3396FB" :checked="holiday" @change="switchChange" />
+			</view>
+		</view>
+
+		<!-- 确认按钮区域 -->
+		<view class="button" @click="handleConfirm">
+			确认
+		</view>
+
+		<!-- 删除按钮区域 -->
+		<view class="button2" @click="handleDelete">
+			删除
+		</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 规则名称
+				ruleName: "未设置",
+				// 考勤组
+				group: "未设置",
+				// 打卡时间
+				time: "未设置",
+				// 打卡地点
+				place: "未设置",
+				// 提前通知
+				value: "未设置",
+				// 提前通知选项
+				array: ['5分钟', '10分钟', '15分钟', '20分钟'],
+				// 提前通知时间选择数组默认选择的索引
+				index: 0,
+				// 当前规则ID
+				id: "",
+				// 考勤组id数组
+				groupIds: [],
+				// 打卡地点数组
+				locations: [],
+				// 是否同步节假日
+				holiday: false,
+				// 星期映射数组
+				arr: ["", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"]
+			};
+		},
+		onLoad(option) {
+			uni.$on('updateRuleName', (data) => {
+				this.ruleName = data
+			})
+
+			uni.$on('updateRuleGroup', (data) => {
+				let temList = []
+				this.groupIds = []
+				data.forEach((ele) => {
+					temList.push(ele.name)
+					this.groupIds.push(ele.id)
+				})
+				this.group = temList.join(",")
+			})
+
+			this.id = option.id
+			this.getData()
+		},
+		onShow() {
+			let rulePlace = uni.getStorageSync("chooseList")
+			let flag_place = uni.getStorageSync("flag_place")
+
+			if (rulePlace) {
+				this.locations = rulePlace
+				let temList = []
+				rulePlace.forEach((ele) => {
+					temList.push(ele.name)
+				})
+				this.place = temList.join(",")
+			}
+			if (rulePlace.length == 0 && flag_place) {
+				this.place = "未设置"
+			}
+
+			let ruleTime = uni.getStorageSync("ruleTime")
+			let flag = uni.getStorageSync("flag")
+
+			if (ruleTime.length == 0 && flag) {
+				this.time = "未设置"
+			}
+			if (ruleTime.length > 0) {
+				this.time = ruleTime
+			}
+		},
+		methods: {
+			// 获取规则详细信息
+			async getData() {
+				let res = await this.$myRequest_clockIn({
+					url: `/attendance/api/settings/rule/detail/${this.id}`
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					// 规则名称
+					this.ruleName = res.data.name
+
+					// 考勤组
+					let temList = []
+					this.groupIds = []
+					res.data.groups.forEach((ele) => {
+						temList.push(ele.name)
+						this.groupIds.push(ele.id)
+					})
+					this.group = temList.join(",")
+
+					// 打卡时间
+					this.time = res.data.timeGroups
+
+					// 打卡地点
+					let temList2 = []
+					this.locations = res.data.locations
+					res.data.locations.forEach((ele) => {
+						temList2.push(ele.name)
+					})
+					this.place = temList2.join(",")
+
+					// 提前通知
+					this.value = res.data.noticeTime
+
+					// 法定节假日
+					this.holiday = res.data.holiday
+				}
+			},
+			// 点击确认按钮回调
+			handleConfirm() {
+				if (this.ruleName == '未设置') {
+					uni.showToast({
+						title: "请设置规则名称",
+						icon: 'none'
+					})
+					return
+				}
+
+				if (this.group == '未设置') {
+					uni.showToast({
+						title: "请设置考勤组",
+						icon: 'none'
+					})
+					return
+				}
+
+				if (this.time == '未设置') {
+					uni.showToast({
+						title: "请设置打卡时间",
+						icon: 'none'
+					})
+					return
+				}
+
+				if (this.place == '未设置' || this.place == "") {
+					uni.showToast({
+						title: "请设置打卡地点",
+						icon: 'none'
+					})
+					return
+				}
+
+				if (this.value == '未设置') {
+					uni.showToast({
+						title: "请设置提前通知时间",
+						icon: 'none'
+					})
+					return
+				}
+				uni.showModal({
+					title: '提示',
+					content: '确定修改吗?',
+					success: async (res) => {
+						if (res.confirm) {
+							let res = await this.$myRequest_clockIn({
+								url: "/attendance/api/settings/rule/update",
+								method: "put",
+								header: {
+									'Authorization': uni.getStorageSync("token")
+								},
+								data: {
+									// 编辑的规则id
+									id: this.id,
+									// 是否需要人脸识别
+									faceRecognition: true,
+									// 考勤组ID列表
+									groupIds: this.groupIds,
+									// 是否同步节假日
+									holiday: this.holiday,
+									// 是否可选择本地图片
+									localPicture: false,
+									// 规则名称
+									name: this.ruleName,
+									// 提前通知时间
+									noticeTime: this.value,
+									// 是否需要场景拍照
+									takePicture: true,
+									// 打卡地点列表
+									locations: this.locations,
+									// 打卡时间列表
+									timeGroups: this.time
+								}
+							})
+							// console.log(res);
+							if (res.code == 200) {
+								uni.showToast({
+									title: "编辑成功"
+								})
+								setTimeout(() => {
+									uni.navigateBack({
+										delta: 1
+									})
+								}, 1500)
+							}
+						}
+					}
+				});
+			},
+			// 点击删除按钮回调
+			handleDelete() {
+				uni.showModal({
+					title: '提示',
+					content: '确定删除吗?',
+					success: async (res) => {
+						if (res.confirm) {
+							let res = await this.$myRequest_clockIn({
+								url: "/attendance/api/settings/rule/delete",
+								method: "delete",
+								data: {
+									ids: [this.id]
+								}
+							})
+							// console.log(res);
+							if (res.code == 200) {
+								uni.showToast({
+									title: "删除成功"
+								})
+								setTimeout(() => {
+									uni.navigateBack({
+										delta: 1
+									})
+								}, 1500)
+							}
+						}
+					}
+				});
+			},
+			// 提前通知选择框点击回调
+			changeSelect(e) {
+				let index = e.detail.value
+				this.value = this.array[index]
+				let index2 = this.value.indexOf("分", 0)
+				this.value = this.value.substring(0, index2);
+			},
+			// switch的值改变回调
+			switchChange(e) {
+				this.holiday = e.detail.value
+				// console.log(this.holiday);
+			},
+			// 点击规则名称跳转回调
+			goPageRuleName() {
+				uni.navigateTo({
+					url: `/pagesClockIn/ruleName/ruleName`
+				})
+			},
+			// 点击考勤组跳转回调
+			goPageGroup() {
+				uni.navigateTo({
+					url: `/pagesClockIn/group/group?flag=2`
+				})
+			},
+			// 点击打卡时间跳转回调
+			goPagePunchTime() {
+				let time = JSON.stringify(this.time)
+				uni.navigateTo({
+					url: `/pagesClockIn/punchTime/punchTime?time=${time}`
+				})
+			},
+			// 点击打卡地点跳转回调
+			goPagePunchLocation() {
+				let locations = JSON.stringify(this.locations)
+				uni.navigateTo({
+					url: `/pagesClockIn/punchLocation/punchLocation?locations=${locations}`
+				})
+			},
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				let strDate = h + m;
+				return strDate;
+			},
+			// 格式化时间
+			formatTime(val) {
+				let tem = '2021-11-22 ' + val + ':00'
+				// console.log(tem);
+				let date = new Date(tem);
+				let time = date.getTime();
+				return time
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		height: 100vh;
+		background-color: #F2F2F2;
+
+		.box {
+			display: flex;
+			align-items: center;
+			padding: 0 30rpx;
+			height: 90rpx;
+			font-size: 30rpx;
+			border-bottom: 1rpx solid #CCCCCC;
+			background-color: #fff;
+
+			.name {
+				flex: 1;
+			}
+
+			.val {
+				flex: 3;
+				display: flex;
+				align-items: center;
+
+				.ele {
+					display: inline-block;
+					width: 460rpx;
+					text-align: end;
+					color: #A6A6A6;
+					overflow: hidden;
+					white-space: nowrap;
+					text-overflow: ellipsis;
+
+					span {
+						margin-right: 10rpx;
+					}
+				}
+
+				.black {
+					color: #000;
+				}
+
+				.right {
+					margin-left: 20rpx;
+					width: 40rpx;
+					display: inline-flex;
+					justify-content: center;
+					align-items: center;
+
+					img {
+						width: 16rpx;
+						height: 25rpx;
+					}
+				}
+			}
+
+			.val2 {
+				flex: 1;
+				margin-right: 20rpx;
+				text-align: end;
+			}
+		}
+
+		.button {
+			margin: auto;
+			margin-top: 52rpx;
+			width: 690rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			font-size: 32rpx;
+			font-weight: 500;
+			color: #fff;
+			border-radius: 16rpx;
+			background-color: #3396FB;
+		}
+
+		.button2 {
+			margin: auto;
+			margin-top: 30rpx;
+			width: 690rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			font-size: 32rpx;
+			font-weight: 500;
+			color: #FF5733;
+			border-radius: 16rpx;
+			background-color: #fff;
+		}
+	}
+</style>

+ 630 - 0
pagesClockIn/group/group.vue

@@ -0,0 +1,630 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 头部搜索栏区域 -->
+		<view class="search">
+			<uni-search-bar bgColor="#fff" placeholder="请输入搜索内容" cancelButton="none" v-model="searchValue"
+				@clear="clear" @input="getGroupData">
+			</uni-search-bar>
+		</view>
+
+		<!-- 新增考勤组区域 -->
+		<view class="add">
+			<view v-if="flag==1" class="icon" @click="handleAdd">
+				<img src="../static/imgs/add.png">
+			</view>
+			<view v-if="flag==1" class="title" @click="handleAdd">
+				新增考勤组
+			</view>
+			<view v-if="flag==2" class="icon" @click="handleRelevancy">
+				<img src="../static/imgs/add.png">
+			</view>
+			<view v-if="flag==2" class="title" @click="handleRelevancy">
+				关联考勤组
+			</view>
+		</view>
+
+		<!--考勤组列表区域 -->
+		<view class="group">
+			<uni-swipe-action>
+				<!-- 每一个考勤组区域 -->
+				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(item.id)"
+					v-for="item in list" :key="item.id">
+
+					<view class="group_item">
+						<uni-collapse :ref="item.id+'collapse'">
+							<uni-collapse-item open>
+								<!-- 自定义标题区域 -->
+								<template v-slot:title>
+									<view class="collapse_title">
+										<checkbox class="collapse_check" :disabled="checkStatus" color="#0082FC"
+											:checked="item.checked" @click.stop="handleChange(item)" />
+										<view class="collapse_info">
+											{{item.name}}
+										</view>
+									</view>
+								</template>
+								<!-- 折叠内容区域 -->
+								<view class="content">
+									<view class="num">
+										随机人数:{{item.peopleCount}}人
+									</view>
+									<!-- 树状结构区域 -->
+									<view class="tree">
+										<dropDown :node="item.textArr" @nodechange="nodechange(item.id+'collapse')">
+										</dropDown>
+									</view>
+								</view>
+							</uni-collapse-item>
+						</uni-collapse>
+					</view>
+
+				</uni-swipe-action-item>
+
+			</uni-swipe-action>
+		</view>
+
+		<!-- 新增考勤组弹窗区域 -->
+		<uni-popup ref="popup" :is-mask-click="false">
+			<view class="popup_box">
+				<view class="header">
+					新增考勤组
+				</view>
+				<view class="body">
+					<view class="name">
+						<input type="text" placeholder="请输入考勤组名称" v-model="group_name">
+					</view>
+
+					<view class="scope" @click="handleChoose">
+						<view class="notes" v-if="!group_scope">
+							请选择考勤组范围
+						</view>
+						<view class="notes2" v-else>
+							{{group_scope}}
+						</view>
+						<view class="icon">
+							<img src="./imgs/bottom.png">
+						</view>
+					</view>
+
+					<view class="num">
+						<view class="count">
+							<view class="icon">
+								<img src="./imgs/people.png">
+							</view>
+							<view class="info">
+								{{group_total}}人
+							</view>
+						</view>
+						<view class="input">
+							<input type="number" placeholder="请输入打卡人数" v-model="group_num">
+						</view>
+					</view>
+				</view>
+				<view class="foot">
+					<view class="left" @click="handleCancel">
+						取消
+					</view>
+					<view class="right" @click="handleSave">
+						保存
+					</view>
+				</view>
+			</view>
+		</uni-popup>
+
+		<!-- 选择考勤组范围区域 -->
+		<tki-tree ref="tkitree" multiple :range="range" rangeKey="name" confirmColor="#3396FB" @confirm="treeConfirm"
+			@cancel="treeCancel" />
+
+	</view>
+</template>
+
+<script>
+	import tkiTree from "../components/tki-tree/tki-tree.vue"
+	export default {
+		components: {
+			tkiTree
+		},
+		data() {
+			return {
+				// 新增考勤组名称
+				group_name: "",
+				// 新增考勤组范围
+				group_scope: "",
+				// 新增考勤组需要打卡人数
+				group_num: null,
+				// 新增考勤组总人数
+				group_total: 0,
+				// 新增考勤组ID数组
+				userOrgList: [],
+				// 判断是新增考勤组还是关联考勤组标识
+				flag: null,
+				// 考勤组勾选框禁用标识
+				checkStatus: false,
+				// 搜索框绑定的值
+				searchValue: "",
+				// 左滑选项配置
+				options: [{
+					text: '删除',
+					style: {
+						backgroundColor: '#D43030'
+					}
+				}],
+				// 考勤组列表数据
+				list: [],
+				// 考勤组范围数组
+				range: [],
+			};
+		},
+		onLoad(options) {
+			this.flag = options.flag
+			if (this.flag == 1) {
+				this.checkStatus = true
+			}
+			this.getGroupData()
+		},
+		methods: {
+			// 获取考勤组列表数据
+			async getGroupData() {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/settings/group/list",
+					data: {
+						name: this.searchValue,
+						size: 999
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					res.data.list.forEach((ele) => {
+						ele.checked = false
+						ele.textArr = []
+						ele.names.forEach((element) => {
+							ele.textArr.push({
+								name: element
+							})
+						})
+					})
+					this.list = res.data.list
+				}
+			},
+			// 考勤组选择框确定回调事件
+			treeConfirm(e) {
+				// console.log(e)
+				let count = 0
+				let temList = []
+				let userOrgList = []
+				e.forEach((ele) => {
+					temList.push(ele.name)
+					userOrgList.push({
+						orgId: ele.id,
+						type: 2
+					})
+					count += ele.number
+				})
+				this.group_scope = temList.join(",")
+				this.group_total = count
+				this.userOrgList = userOrgList
+			},
+			// 考勤组选择框取消回调事件
+			treeCancel(e) {
+				// this.$refs.tkitree._hide()
+			},
+			// 点击选择考勤组选择框回调
+			async handleChoose() {
+				this.range = []
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/settings/org/tree"
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.range = res.data
+					this.$refs.tkitree._show()
+				}
+			},
+			handleChange(item) {
+				// console.log(item);
+				item.checked = !item.checked
+			},
+			// 点击弹窗保存按钮回调
+			async handleSave() {
+				if (!this.group_name) {
+					uni.showToast({
+						title: "请输入考勤组名称",
+						icon: "none"
+					})
+					return
+				}
+				if (!this.group_scope) {
+					uni.showToast({
+						title: "请选择考勤组范围",
+						icon: "none"
+					})
+					return
+				}
+				if (this.group_total == 0) {
+					uni.showToast({
+						title: "该考勤组范围中人数为0,请重新选择",
+						icon: "none"
+					})
+					return
+				}
+				if (!this.group_num) {
+					uni.showToast({
+						title: "请输入打卡人数",
+						icon: "none"
+					})
+					return
+				}
+				if (this.group_num - 0 > this.group_total - 0) {
+					uni.showToast({
+						title: "打卡人数不能超过总人数",
+						icon: "none"
+					})
+					return
+				}
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/settings/group/add",
+					method: "post",
+					header: {
+						'Authorization': uni.getStorageSync("token")
+					},
+					data: {
+						name: this.group_name,
+						peopleCount: this.group_num,
+						peopleTotal: this.group_total,
+						userOrgList: this.userOrgList
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.$refs.popup.close()
+					uni.showToast({
+						title: "添加成功",
+						icon: "none"
+					})
+					setTimeout(() => {
+						this.getGroupData()
+					}, 1500)
+				} else {
+					uni.showToast({
+						title: res.message,
+						icon: "none"
+					})
+				}
+			},
+			// 点击弹窗取消按钮回调
+			handleCancel() {
+				this.$refs.popup.close()
+			},
+			// 点击新增考勤组按钮回调
+			handleAdd() {
+				this.group_name = ""
+				this.group_num = null
+				this.group_total = 0
+				this.group_scope = ""
+				this.userOrgList = []
+				this.$nextTick(() => {
+					this.$refs.popup.open()
+				})
+			},
+			// 点击关联考勤组按钮回调
+			handleRelevancy() {
+				let temList = []
+				this.list.forEach((ele) => {
+					if (ele.checked == true) {
+						temList.push({
+							name: ele.name,
+							id: ele.id
+						})
+					}
+				})
+				if (temList.length == 0) {
+					uni.showToast({
+						title: "请先勾选考勤组",
+						icon: "none"
+					})
+				} else {
+					uni.$emit('updateRuleGroup', temList)
+					uni.navigateBack({
+						delta: 1
+					})
+				}
+			},
+			// 点击树状节点回调
+			nodechange(ref) {
+				console.log(ref);
+				this.$nextTick(() => {
+					setTimeout(() => {
+						this.$refs[ref][0].resize()
+					}, 200)
+				})
+			},
+			// 点击右侧删除按钮回调
+			onClick(id) {
+				// console.log(id);
+				uni.showModal({
+					title: '提示',
+					content: '确定删除该考勤组吗?',
+					success: async (res) => {
+						if (res.confirm) {
+							let res = await this.$myRequest_clockIn({
+								url: "/attendance/api/settings/group/delete",
+								method: "delete",
+								data: {
+									ids: [id]
+								}
+							})
+							// console.log(res);
+							if (res.code == 200 && res.data) {
+								uni.showToast({
+									title: "删除成功",
+									icon: 'success'
+								})
+								setTimeout(() => {
+									this.getGroupData()
+								}, 1500)
+							} else {
+								uni.showToast({
+									title: res.message,
+									icon: 'none',
+									duration: 3000
+								})
+							}
+						} else if (res.cancel) {}
+					}
+				});
+			},
+			// 清除搜索框内容时的回调
+			clear() {
+				this.searchValue = ""
+				this.getGroupData()
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+
+		.placeholder {
+			height: 20rpx;
+		}
+
+		.search {
+			box-sizing: border-box;
+			padding: 0 30rpx;
+			width: 750rpx;
+			height: 90rpx;
+			border-radius: 170rpx;
+			background-color: #fff;
+		}
+
+		.add {
+			margin-top: 20rpx;
+			display: flex;
+			align-items: center;
+			width: 750rpx;
+			height: 110rpx;
+			background-color: #fff;
+
+			.icon {
+				margin: 0 20rpx 0 30rpx;
+				width: 36rpx;
+				height: 36rpx;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+
+			.title {
+				font-size: 30rpx;
+				color: #0082FC;
+			}
+		}
+
+		.group {
+			margin-top: 20rpx;
+			background-color: #F2F2F2;
+
+			.group_item {
+				margin-bottom: 20rpx;
+				width: 750rpx;
+				background-color: #fff;
+
+				.collapse_title {
+					display: flex;
+					align-items: center;
+					height: 79rpx;
+
+					.collapse_check {
+						margin-left: 30rpx;
+					}
+
+					.collapse_info {
+						margin-left: 10rpx;
+						font-size: 28rpx;
+						font-weight: 600;
+					}
+				}
+
+				.content {
+					padding-bottom: 50rpx;
+
+					.num {
+						margin-left: 30rpx;
+						height: 50rpx;
+						font-size: 24rpx;
+						color: #808080;
+					}
+
+					.tree {}
+				}
+			}
+		}
+
+		.popup_box {
+			width: 630rpx;
+			height: 610rpx;
+			border-radius: 33rpx;
+			background-color: #fff;
+
+			.header {
+				width: 630rpx;
+				height: 97rpx;
+				line-height: 97rpx;
+				text-align: center;
+				font-size: 32rpx;
+				font-weight: 500;
+				border-bottom: 1rpx solid #E6E6E6;
+			}
+
+			.body {
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				width: 630rpx;
+				height: 414rpx;
+				border-bottom: 1rpx solid #E6E6E6;
+
+				.name {
+					margin-top: 42rpx;
+					width: 570rpx;
+					height: 80rpx;
+					border-radius: 10rpx;
+					border: 1rpx solid #ccc;
+
+					input {
+						padding: 0 24rpx;
+						width: 90%;
+						height: 100%;
+						font-size: 28rpx;
+					}
+				}
+
+				.scope {
+					display: flex;
+					align-items: center;
+					margin-top: 32rpx;
+					width: 570rpx;
+					height: 80rpx;
+					border-radius: 10rpx;
+					border: 1rpx solid #ccc;
+
+					.notes {
+						padding-left: 24rpx;
+						flex: 5;
+						font-size: 28rpx;
+						color: #808080;
+					}
+
+					.notes2 {
+						padding-left: 24rpx;
+						flex: 5;
+						font-size: 28rpx;
+						overflow: hidden;
+						white-space: nowrap;
+						text-overflow: ellipsis;
+					}
+
+					.icon {
+						flex: 1;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+
+						img {
+							width: 25rpx;
+							height: 20rpx;
+						}
+					}
+				}
+
+				.num {
+					display: flex;
+					align-items: center;
+					margin-top: 32rpx;
+					width: 570rpx;
+					height: 80rpx;
+					border-radius: 10rpx;
+					border: 1rpx solid #ccc;
+
+					.count {
+						flex: 2;
+						display: flex;
+						align-items: center;
+						height: 50rpx;
+						border-right: 1rpx solid #A6A6A6;
+
+						.icon {
+							flex: 1;
+							display: flex;
+							justify-content: center;
+							align-items: center;
+
+							img {
+								width: 30rpx;
+								height: 30rpx;
+							}
+						}
+
+						.info {
+							flex: 2;
+							font-size: 28rpx;
+						}
+					}
+
+					.input {
+						flex: 4;
+
+						input {
+							padding: 0 45rpx;
+							width: 80%;
+							font-size: 28rpx;
+						}
+					}
+				}
+			}
+
+			.foot {
+				display: flex;
+				justify-content: space-evenly;
+				width: 630rpx;
+				height: 99rpx;
+				line-height: 99rpx;
+				font-size: 28rpx;
+
+				.left {
+					flex: 1;
+					text-align: center;
+					border-right: 1rpx solid #CCC;
+				}
+
+				.right {
+					flex: 1;
+					text-align: center;
+					color: #2A82E4;
+				}
+			}
+		}
+	}
+
+	// 解决输入框不居中问题
+	::v-deep .uni-searchbar {
+		padding: 10rpx;
+	}
+
+	// 解决左滑区域突出问题
+	::v-deep .uni-swipe_button-group {
+		margin-bottom: 20rpx;
+	}
+
+	// 清除树状组件下边框
+	::v-deep .uni-collapse-item__wrap-content.uni-collapse-item--border {
+		border-bottom: none;
+	}
+</style>

BIN
pagesClockIn/group/imgs/bottom.png


BIN
pagesClockIn/group/imgs/people.png


+ 627 - 0
pagesClockIn/home/home.vue

@@ -0,0 +1,627 @@
+<template>
+	<view class="container">
+		<!-- 头部学生信息区域 -->
+		<view class="header">
+			<view class="img">
+				<img :src="userInfo.headImage||'../static/imgs/headImage.png'">
+			</view>
+			<view class="msg">
+				<view class="name">
+					{{userInfo.name||"用户"}}
+				</view>
+				<view class="major">
+					{{userInfo.college||"南昌交通学院"}}
+				</view>
+			</view>
+		</view>
+
+		<!-- 主体打卡区域 -->
+		<view class="body">
+			<!-- 卡片区域 -->
+			<view class="card" v-if="list.length">
+				<!-- 每一个卡片区域 -->
+				<view :class="activeid ==item.id?'active_box':'item'" v-for="item in list" :key="item.id"
+					@click="handleClick(item)">
+					<view class="item_box">
+						<view class="title">
+							{{item.ruleName}}
+						</view>
+						<view class="time">
+							{{item.timeRange}}
+						</view>
+						<view class="type">
+							<img v-if="item.status==4" src="./imgs/success.png">
+							<span v-if="item.status==4">
+								{{format_time(item.updateTime)}}
+							</span>
+							<span v-if="item.status==4"> 已打卡</span>
+							<span v-if="item.status==3">已超时</span>
+							<span v-if="item.status==1||item.status==2">未打卡</span>
+						</view>
+					</view>
+				</view>
+
+			</view>
+			<!-- list数组为空时的占位盒子 -->
+			<view class="card" v-else></view>
+
+			<!-- 打卡区域 -->
+			<view :class="{clock:flags,active:!flags}" @click="handlePunch(contrastObj)">
+				<view class="info" v-if="flags">
+					打卡
+				</view>
+				<view class="info" v-else>
+					无法打卡
+				</view>
+				<view class="time">
+					{{nowTime}}
+				</view>
+			</view>
+
+			<!-- 提示信息位置 -->
+			<view class="address" v-if="flags">
+				{{address}}
+			</view>
+
+			<view class="address" v-else>
+				{{notes}}
+			</view>
+		</view>
+
+		<!-- 底部导航栏区域 -->
+		<view class="tab_bar">
+			<navigator open-type="redirect" url="/pagesClockIn/home/home" class="tab_box">
+				<img v-if="pageUrl=='pagesClockIn/home/home'" src="../static/imgs/home_active.png">
+				<img v-else src="../static/imgs/home.png">
+				<view v-if="pageUrl=='pagesClockIn/home/home'" class="tab_title_active">
+					首页
+				</view>
+				<view v-else class="tab_title">
+					首页
+				</view>
+			</navigator>
+			<navigator open-type="redirect" url="/pagesClockIn/stat/stat" class="tab_box">
+				<img v-if="pageUrl=='pagesClockIn/stat/stat'" src="../static/imgs/stat_active.png">
+				<img v-else src="../static/imgs/stat.png">
+				<view v-if="pageUrl=='pagesClockIn/stat/stat'" class="tab_title_active">
+					统计
+				</view>
+				<view v-else class="tab_title">
+					统计
+				</view>
+			</navigator>
+			<navigator open-type="redirect" v-if="showTab" url="/pagesClockIn/my/my" class="tab_box">
+				<img v-if="pageUrl=='pagesClockIn/my/my'" src="../static/imgs/my_active.png">
+				<img v-else src="../static/imgs/my.png">
+				<view v-if="pageUrl=='pagesClockIn/my/my'" class="tab_title_active">
+					我的
+				</view>
+				<view v-else class="tab_title">
+					我的
+				</view>
+			</navigator>
+		</view>
+	</view>
+</template>
+
+<script>
+	var QQMapWX = require('../util/qqmap-wx-jssdk1.1/qqmap-wx-jssdk');
+	var qqmapsdk;
+	export default {
+		data() {
+			return {
+				// 用户信息
+				userInfo: {},
+				// 打卡规则列表
+				list: [],
+				// 当前时间
+				nowTime: "",
+				// 当前定位位置信息
+				address: "",
+				// 定时器标识
+				timer: null,
+				// 提示信息
+				notes: "",
+				// 当前显示的是哪个规则id
+				activeid: null,
+				// 当前时间的时间戳
+				timestamp: null,
+				// 当前显示的规则具体信息
+				contrastObj: {},
+				// 当前用户定位经度
+				myLng: 0,
+				// 当前用户定位纬度
+				myLat: 0,
+				// 签到点中心经度
+				centerLng: 0,
+				// 签到点中心纬度
+				centerLat: 0,
+				// 签到半径
+				radius: 0,
+				// 距离签到点的距离
+				distance: 0,
+				// 是否可以打卡的标识
+				flags: true,
+				// 当前页面的路由地址
+				pageUrl: "",
+				// 是否显示底部 我的 导航栏
+				showTab: true
+			};
+		},
+		onLoad() {
+			// 获取用户的个人信息数据
+			this.getUserInfo()
+			setTimeout(() => {
+				let flag = uni.getStorageSync("manager")
+				let flag2 = uni.getStorageSync("sub-administrator")
+				if (flag || flag2) {
+					this.showTab = true
+				} else {
+					this.showTab = false
+				}
+			}, 300)
+			// 实例化API核心类
+			qqmapsdk = new QQMapWX({
+				// 申请的key
+				key: 'R43BZ-2XROX-L7T45-T5OQI-IBDFT-GNBOI'
+			});
+			// 获取当前系统时间
+			this.getNowTime()
+		},
+		onShow() {
+			this.getPageUrl()
+			// 获取当前位置的详细信息
+			this.getLocationData()
+			// 获取当天的打卡列表数组
+			this.getRulesList()
+			// 获取当前时间的时间戳
+			this.getTimestamp()
+		},
+		onUnload() {
+			if (this.timer) {
+				clearInterval(this.timer)
+			}
+		},
+		// 下拉刷新
+		onPullDownRefresh() {
+			uni.removeStorageSync("manager")
+			uni.removeStorageSync("sub-administrator")
+			qqmapsdk = new QQMapWX({
+				// 申请的key
+				key: 'R43BZ-2XROX-L7T45-T5OQI-IBDFT-GNBOI'
+			});
+			this.getNowTime()
+			this.getTimestamp()
+			this.getUserInfo()
+			this.getLocationData()
+			this.getRulesList()
+			setTimeout(() => {
+				uni.stopPullDownRefresh()
+			}, 1500)
+		},
+		methods: {
+			getPageUrl() {
+				// 获取当前打开过的页面路由数组
+				let routes = getCurrentPages();
+				// 获取当前页面路由,也就是最后一个打开的页面路由
+				let curRoute = routes[routes.length - 1].route
+				this.pageUrl = curRoute
+			},
+			// 获取当前时间
+			getNowTime() {
+				if (this.timer) {
+					clearInterval(this.timer)
+				}
+				this.timer = setInterval(() => {
+					let date = new Date()
+					let hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
+					let minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
+					let seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
+					this.nowTime = hours + ':' + minutes + ':' + seconds
+				}, 1000)
+			},
+			// 获取当前时间的时间戳
+			getTimestamp() {
+				let dates = new Date()
+				let times = dates.getTime()
+				this.timestamp = times
+			},
+			// 获取用户详细信息
+			async getUserInfo() {
+				uni.removeStorageSync("manager")
+				uni.removeStorageSync("sub-administrator")
+				let userId = uni.getStorageSync("userInfo").id
+				let res = await this.$myRequest_clockIn({
+					url: `/attendance/api/system/user/detail/${userId}`,
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.userInfo = res.data
+					uni.setStorageSync("userInfo", this.userInfo)
+					if (this.userInfo.roles) {
+						let temList = []
+						this.userInfo.roles.forEach((ele) => {
+							temList.push(ele.id)
+						})
+						let flag = temList.includes(2)
+						let flag2 = temList.includes(3)
+						if (flag) {
+							uni.setStorageSync("manager", flag)
+						}
+						if (flag2) {
+							uni.setStorageSync("sub-administrator", flag2)
+						}
+					}
+				}
+			},
+			// 获取当前定位位置信息
+			getLocationData() {
+				qqmapsdk.reverseGeocoder({
+					success: (res) => {
+						// console.log(res);
+						if (res.status == 0) {
+							// 获取详细地址信息 经纬度
+							this.address = res.result.address
+							this.myLat = res.result.location.lat
+							this.myLng = res.result.location.lng
+						} else {
+							uni.showToast({
+								title: "请求定位失败",
+								icon: 'none'
+							})
+						}
+					}
+				})
+			},
+			// 获取打卡规则列表
+			async getRulesList() {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/sign/check/in/list/today",
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					if (res.data.length == 0) {
+						this.flags = false
+						this.notes = "无打卡任务无需打卡"
+					} else {
+						this.list = res.data.reverse()
+						this.activeid = this.list[0].id
+						this.contrastObj = this.list[0]
+						this.changeType()
+						// console.log(this.contrastObj);
+					}
+				}
+			},
+			// 对比信息改变打卡的状态显示
+			changeType() {
+				if (this.contrastObj.status == 4) {
+					this.flags = false
+					this.notes = "已打卡,无需再次打卡"
+				} else {
+					// 没有到打卡时间 或者 超过打卡时间 的状态
+					if (this.timestamp < this.contrastObj.beginTime || this.timestamp > this.contrastObj.endTime) {
+						this.flags = false
+						this.notes = "未到打卡时间无法打卡"
+					}
+					// 到了打卡时间,判断是否在打卡范围内
+					else {
+						if (this.contrastObj.locations.length) {
+							let temList = []
+							temList = this.contrastObj.locations.map((ele) => {
+								this.centerLat = ele.lat
+								this.centerLng = ele.lng
+								this.radius = ele.radius
+
+								let red1 = this.myLat * Math.PI / 180.0;
+								let red2 = this.centerLat * Math.PI / 180.0;
+								let a = red1 - red2;
+								let b = this.myLng * Math.PI / 180.0 - this.centerLng * Math.PI / 180.0;
+								let R = 6378137;
+								let distance = R * 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(
+										red1) *
+									Math.cos(red2) *
+									Math.pow(Math.sin(b / 2), 2)));
+								this.distance = distance.toFixed(2) * 1;
+								console.log(this.distance);
+								console.log(this.radius);
+								if (this.distance <= this.radius) {
+									return 1
+								} else {
+									return 2
+								}
+							})
+							let temFlag = temList.indexOf(1)
+							if (temFlag == -1) {
+								this.flags = false
+								this.notes = "不在管理员设定范围内,无法打卡"
+							} else {
+								this.flags = true
+							}
+						}
+					}
+				}
+			},
+			// 点击每一个打卡规则回调
+			handleClick(item) {
+				// console.log(item);
+				this.getTimestamp()
+				this.contrastObj = item
+				this.activeid = item.id
+				this.changeType()
+			},
+			// 点击打卡按钮回调
+			handlePunch(info) {
+				if (this.flags) {
+					let obj = JSON.stringify(info)
+
+					// 获取用户位置权限
+					uni.authorize({
+						scope: 'scope.userLocation',
+						success() {
+							uni.navigateTo({
+								url: `/pagesClockIn/location/location?obj=${obj}`
+							})
+						},
+						fail() {
+							uni.showModal({
+								title: '提示',
+								content: '请先开启定位权限,否则将无法使用定位功能',
+								cancelText: '不授权',
+								confirmText: '授权',
+								success: function(res) {
+									if (res.confirm) {
+										uni.openSetting({
+											success(res) {}
+										})
+									}
+								}
+							});
+						}
+					})
+				}
+			},
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				let strDate = h + m;
+				return strDate;
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		padding-top: 20rpx;
+		background-color: #F2F2F2;
+
+		.header {
+			display: flex;
+			margin: 0 30rpx 30rpx 30rpx;
+			width: 690rpx;
+			height: 130rpx;
+			background-color: #fff;
+
+			.img {
+				margin: 30rpx;
+				width: 70rpx;
+				height: 70rpx;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+
+			.msg {
+				margin: 30rpx 0;
+				height: 70rpx;
+				line-height: 36rpx;
+
+				.name {
+					font-size: 32rpx;
+					font-weight: 400;
+				}
+
+				.major {
+					font-size: 24rpx;
+					font-weight: 400;
+					color: #A6A6A6;
+				}
+			}
+		}
+
+		.body {
+			margin: 0 30rpx;
+			width: 690rpx;
+			height: 919rpx;
+			background-color: #fff;
+
+			.card {
+				padding-top: 30rpx;
+				white-space: nowrap;
+				height: 160rpx;
+				overflow-x: auto;
+
+				.active_box {
+					display: inline-block;
+					margin: 0 15rpx;
+					width: 300rpx;
+					height: 130rpx;
+					line-height: 12rpx;
+					border-radius: 8rpx;
+					font-weight: 400;
+					background-color: #E6E6E6;
+					border: 1rpx solid #0094FC;
+
+					.item_box {
+						display: flex;
+						flex-direction: column;
+						justify-content: space-evenly;
+						height: 130rpx;
+						padding-left: 30rpx;
+
+						.title {
+							font-size: 28rpx;
+						}
+
+						.time {
+							font-size: 24rpx;
+						}
+
+						.type {
+							font-size: 24rpx;
+							color: #808080;
+
+							img {
+								margin-right: 10rpx;
+								width: 20rpx;
+								height: 20rpx;
+							}
+						}
+					}
+				}
+
+				.item {
+					display: inline-block;
+					margin: 0 15rpx;
+					width: 300rpx;
+					height: 130rpx;
+					line-height: 12rpx;
+					border-radius: 8rpx;
+					font-weight: 400;
+					background-color: #E6E6E6;
+
+
+					.item_box {
+						display: flex;
+						flex-direction: column;
+						justify-content: space-evenly;
+						height: 130rpx;
+						padding-left: 30rpx;
+
+						.title {
+							font-size: 28rpx;
+						}
+
+						.time {
+							font-size: 24rpx;
+						}
+
+						.type {
+							font-size: 24rpx;
+							color: #808080;
+
+							img {
+								margin-right: 10rpx;
+								width: 20rpx;
+								height: 20rpx;
+							}
+						}
+					}
+				}
+			}
+
+			.clock {
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+				margin: auto;
+				margin-top: 145rpx;
+				width: 300rpx;
+				height: 300rpx;
+				border-radius: 150rpx;
+				text-align: center;
+				color: #fff;
+				background: linear-gradient(180deg, #00ACFC 0%, #0082FC 100%);
+
+				.info {
+					height: 58rpx;
+					font-size: 40rpx;
+					font-weight: 700;
+				}
+
+				.time {
+					height: 41rpx;
+					font-size: 28rpx;
+					font-weight: 400;
+				}
+			}
+
+			.active {
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+				margin: auto;
+				margin-top: 145rpx;
+				width: 300rpx;
+				height: 300rpx;
+				border-radius: 150rpx;
+				text-align: center;
+				color: #fff;
+				background: linear-gradient(180deg, #CCCCCC 0%, #B3B3B3 100%);
+
+				.info {
+					height: 58rpx;
+					font-size: 40rpx;
+					font-weight: 700;
+				}
+
+				.time {
+					height: 41rpx;
+					font-size: 28rpx;
+					font-weight: 400;
+				}
+			}
+
+			.address {
+				margin-top: 34rpx;
+				height: 35rpx;
+				line-height: 35rpx;
+				text-align: center;
+				font-size: 24rpx;
+				font-weight: 400;
+				color: #808080;
+			}
+		}
+
+		.tab_bar {
+			position: fixed;
+			left: 0;
+			bottom: 0;
+			display: flex;
+			width: 750rpx;
+			height: 128rpx;
+			border-top: 1rpx solid #CCC;
+			background-color: #fff;
+
+			.tab_box {
+				flex: 1;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+
+				img {
+					margin-bottom: 10rpx;
+					width: 54rpx;
+					height: 48rpx;
+				}
+
+				.tab_title {
+					font-size: 20rpx;
+				}
+
+				.tab_title_active {
+					font-size: 20rpx;
+					color: #0082FC;
+				}
+			}
+		}
+	}
+</style>

BIN
pagesClockIn/home/imgs/success.png


+ 126 - 0
pagesClockIn/index/index.vue

@@ -0,0 +1,126 @@
+<template>
+	<view>
+		<view v-if="showLogin">
+			<login :ocode="ocode" :appkey="appkey" scope="snsapi_userinfo" :visible="visible" @success="loginSuccess"
+				@fail="loginFail" @cancel="loginCancel" />
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 获取用户信息
+				ocode: '1015730314',
+				// 商户appkey
+				appkey: '9D6ACFE8CF9AFD07',
+				// 是否授权可见
+				visible: false,
+				// 是否启动授权
+				showLogin: false,
+				// 获取用户信息
+				appid: 'wxd6f090391d410534',
+			}
+		},
+		onLoad() {
+			this.hasUserInfo()
+		},
+		methods: {
+			// 检查是否存在用户信息
+			hasUserInfo() {
+				let userInfo = uni.getStorageSync('userInfo');
+				// console.log(userInfo);
+				if (userInfo) {
+					uni.reLaunch({
+						url: "/pagesClockIn/home/home"
+					})
+				} else {
+					// console.log("重新授权");
+					this.showLogin = true
+					this.visible = true
+				}
+			},
+
+			// 授权成功回调
+			loginSuccess(res) {
+				// console.log("成功");
+				let wxcode = res.detail.wxcode
+				// 获取wxcode后请求登录
+				this.login(wxcode)
+			},
+			// 授权失败回调
+			loginFail() {
+				// console.log("授权失败");
+				uni.showModal({
+					title: '提示',
+					content: '授权:请先领取校园卡、并激活!',
+					confirmText: '领取',
+					success: (res) => {
+						if (res.confirm) {
+							uni.reLaunch({
+								url: "/pages/qr_code/qr_code"
+							});
+						} else if (res.cancel) {
+							uni.reLaunch({
+								url: "/pagesClockIn/404/404"
+							})
+						}
+					}
+				});
+			},
+			// 授权取消回调
+			loginCancel() {
+				// console.log("取消");
+				uni.showModal({
+					title: '提示',
+					content: '请先授权,否则无法使用该功能',
+					confirmText: '授权',
+					success: (res) => {
+						if (res.confirm) {
+							uni.reLaunch({
+								url: "/pagesClockIn/index/index"
+							})
+						} else if (res.cancel) {
+							uni.reLaunch({
+								url: "/pagesClockIn/404/404"
+							})
+						}
+					}
+				});
+			},
+
+			// 用户登陆获取个人信息和token
+			async login(wxcode) {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/system/user/login/app",
+					method: "post",
+					header:{
+						'content-type': 'application/json',
+					},
+					data: {
+						redirect_uri: `mnp://${this.appid}`,
+						wxcode,
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					uni.setStorageSync("userInfo", res.data)
+					uni.setStorageSync("token", res.data.token)
+					uni.reLaunch({
+						url: "/pagesClockIn/home/home"
+					})
+				} else {
+					uni.showToast({
+						title: res.message,
+						icon: 'none'
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

BIN
pagesClockIn/location/imgs/photo.png


BIN
pagesClockIn/location/imgs/refresh.png


+ 262 - 0
pagesClockIn/location/location.vue

@@ -0,0 +1,262 @@
+<template>
+	<view class="container">
+		<!-- 地图区域 -->
+		<view class="map">
+			<map style="width: 100%; height: 100%;" :latitude="latitude" :longitude="longitude" :scale="16"
+				:markers="covers">
+			</map>
+		</view>
+		<!-- 盒子区域 -->
+		<view class="box">
+			<!-- 定位区域 -->
+			<view class="top">
+				<view class="left">
+					<view class="left_title">
+						我的位置
+					</view>
+					<view class="left_place">
+						{{address}}
+					</view>
+				</view>
+				<view class="right" @click="handleRefresh">
+					<img src="./imgs/refresh.png">
+				</view>
+			</view>
+			<!-- 拍照区域 -->
+			<view class="center">
+				<view class="center_left">
+					场景照片(必填)
+				</view>
+				<view class="center_right" @click="handlePhoto">
+					<img src="./imgs/photo.png">
+				</view>
+			</view>
+			<!-- 提示倒计时区域 -->
+			<view class="bottom">
+				<view class="button">
+					请在{{timeRange}}时间段之内提交打卡
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	var QQMapWX = require('../util/qqmap-wx-jssdk1.1/qqmap-wx-jssdk');
+	var qqmapsdk;
+	export default {
+		data() {
+			return {
+				// 定位经纬度
+				latitude: null,
+				longitude: null,
+				// 地图标记点属性
+				covers: [{
+					id: 1,
+					latitude: null,
+					longitude: null,
+					iconPath: '../static/imgs/location.png',
+					width: 20,
+					height: 20
+				}],
+				// 照片信息
+				imgUrl: "",
+				// 定位位置信息
+				address: "",
+				// 时间段信息
+				timeRange: "",
+				// 规则id
+				id: ""
+			};
+		},
+		onLoad(options) {
+			let obj = JSON.parse(options.obj)
+			this.timeRange = obj.timeRange
+			this.id = obj.id
+			// 实例化API核心类
+			qqmapsdk = new QQMapWX({
+				// 申请的key
+				key: 'R43BZ-2XROX-L7T45-T5OQI-IBDFT-GNBOI'
+			});
+			this.getLocationData()
+		},
+		methods: {
+			// 获取定位具体信息
+			getLocationData() {
+				qqmapsdk.reverseGeocoder({
+					success: (res) => {
+						// console.log(res);
+						if (res.status == 0) {
+							// 获取详细地址信息
+							this.address = res.result.address
+							// 获取地址经纬度
+							this.latitude = res.result.location.lat
+							this.longitude = res.result.location.lng
+							// 获取标记点地址经纬度
+							this.covers[0].latitude = res.result.location.lat
+							this.covers[0].longitude = res.result.location.lng
+						} else {
+							uni.showToast({
+								title: "请求定位失败",
+								icon: 'none'
+							})
+						}
+					}
+				})
+			},
+			// 点击刷新按钮回调
+			handleRefresh() {
+				uni.showLoading({
+					title: '刷新中',
+					mask: true
+				});
+				this.getLocationData()
+				setTimeout(() => {
+					uni.hideLoading();
+				}, 1500)
+			},
+			// 点击拍照图标回调
+			handlePhoto() {
+				// 获取用户摄像头权限
+				uni.authorize({
+					scope: 'scope.camera',
+					success: () => {
+						uni.chooseImage({
+							count: 1,
+							sourceType: ['camera'],
+							success: (res) => {
+								// console.log(res);
+								let imgUrl = res.tempFilePaths[0]
+								uni.navigateTo({
+									url: `/pagesClockIn/authentication/authentication?imgUrl=${imgUrl}&id=${this.id}&address=${this.address}&latitude=${this.latitude}&longitude=${this.longitude}`
+								})
+							}
+						});
+					},
+					fail() {
+						uni.showModal({
+							title: '提示',
+							content: '请先开启摄像头权限,否则将无法使用打卡功能',
+							cancelText: '不授权',
+							confirmText: '授权',
+							success: function(res) {
+								if (res.confirm) {
+									uni.openSetting({
+										success(res) {}
+									})
+								}
+							}
+						});
+					}
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		.map {
+			position: relative;
+			width: 100vw;
+			height: 100vh;
+		}
+
+		.box {
+			position: absolute;
+			left: 30rpx;
+			bottom: 30rpx;
+			width: 690rpx;
+			height: 387rpx;
+
+			.top {
+				display: flex;
+				box-sizing: border-box;
+				padding: 0 30rpx;
+				width: 690rpx;
+				height: 123rpx;
+				border-radius: 14rpx 14rpx 0 0;
+				background-color: #fff;
+
+				.left {
+					display: flex;
+					flex-direction: column;
+					justify-content: space-evenly;
+					flex: 6;
+
+					.left_title {
+						font-size: 32rpx;
+					}
+
+					.left_place {
+						font-size: 24rpx;
+						font-weight: 200;
+						color: #808080;
+					}
+				}
+
+				.right {
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					flex: 1;
+
+					img {
+						width: 42rpx;
+						height: 42rpx;
+					}
+				}
+			}
+
+			.center {
+				display: flex;
+				box-sizing: border-box;
+				padding: 0 30rpx;
+				width: 690rpx;
+				height: 122rpx;
+				line-height: 122rpx;
+				background-color: #fff;
+
+				.center_left {
+					flex: 6;
+					font-size: 32rpx;
+				}
+
+				.center_right {
+					flex: 1;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+
+					img {
+						width: 49rpx;
+						height: 39rpx;
+					}
+				}
+			}
+
+			.bottom {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				box-sizing: border-box;
+				padding: 0 30rpx;
+				width: 690rpx;
+				height: 140rpx;
+				border-radius: 0 0 14rpx 14rpx;
+				background-color: #fff;
+
+				.button {
+					width: 630rpx;
+					height: 80rpx;
+					line-height: 80rpx;
+					border-radius: 16rpx;
+					text-align: center;
+					font-size: 32rpx;
+					color: #fff;
+					background: linear-gradient(180deg, #00ACFC 0%, #0082FC 100%);
+				}
+			}
+		}
+	}
+</style>

+ 203 - 0
pagesClockIn/my/my.vue

@@ -0,0 +1,203 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 每一个选项 -->
+		<view class="box" v-for="item in list" :key="item.id" @click="handleClick(item)">
+			<view class="icon">
+				<img :src="item.icon">
+			</view>
+			<view class="title">
+				{{item.title}}
+			</view>
+			<view class="right">
+				<img src="../static/imgs/right.png">
+			</view>
+		</view>
+
+		<!-- 底部导航栏区域 -->
+		<view class="tab_bar">
+			<navigator open-type="redirect" url="/pagesClockIn/home/home" class="tab_box">
+				<img v-if="pageUrl=='pagesClockIn/home/home'" src="../static/imgs/home_active.png">
+				<img v-else src="../static/imgs/home.png">
+				<view v-if="pageUrl=='pagesClockIn/home/home'" class="tab_title_active">
+					首页
+				</view>
+				<view v-else class="tab_title">
+					首页
+				</view>
+			</navigator>
+			<navigator open-type="redirect" url="/pagesClockIn/stat/stat" class="tab_box">
+				<img v-if="pageUrl=='pagesClockIn/stat/stat'" src="../static/imgs/stat_active.png">
+				<img v-else src="../static/imgs/stat.png">
+				<view v-if="pageUrl=='pagesClockIn/stat/stat'" class="tab_title_active">
+					统计
+				</view>
+				<view v-else class="tab_title">
+					统计
+				</view>
+			</navigator>
+			<navigator open-type="redirect" v-if="flag" url="/pagesClockIn/my/my" class="tab_box">
+				<img v-if="pageUrl=='pagesClockIn/my/my'" src="../static/imgs/my_active.png">
+				<img v-else src="../static/imgs/my.png">
+				<view v-if="pageUrl=='pagesClockIn/my/my'" class="tab_title_active">
+					我的
+				</view>
+				<view v-else class="tab_title">
+					我的
+				</view>
+			</navigator>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 是否为管理员标识
+				flag: false,
+				// 页面选项数组
+				list: [{
+						id: 1,
+						icon: "../static/imgs/my1.png",
+						title: "规则设置",
+						url: "/pagesClockIn/ruleSet/ruleSet"
+					},
+					{
+						id: 2,
+						icon: "../static/imgs/my2.png",
+						title: "权限设置",
+						url: "/pagesClockIn/powerSet/powerSet"
+					},
+					{
+						id: 3,
+						icon: "../static/imgs/my3.png",
+						title: "打卡记录",
+						url: "/pagesClockIn/cardRecord/cardRecord"
+					},
+					{
+						id: 4,
+						icon: "../static/imgs/my4.png",
+						title: "考勤组",
+						url: "/pagesClockIn/group/group?flag=1"
+					},
+				],
+				// 当前页面的路由地址
+				pageUrl: ""
+			};
+		},
+		onLoad() {
+
+		},
+		onShow() {
+			this.getPageUrl()
+			let flag = uni.getStorageSync("manager")
+			let flag2 = uni.getStorageSync("sub-administrator")
+			if (flag || flag2) {
+				this.flag = true
+			} else {
+				this.flag = false
+				uni.redirectTo({
+					url:"/pagesClockIn/404/404"
+				})
+			}
+		},
+		methods: {
+			handleClick(item) {
+				// console.log(item.url);
+				uni.navigateTo({
+					url: item.url
+				})
+			},
+			getPageUrl() {
+				// 获取当前打开过的页面路由数组
+				let routes = getCurrentPages();
+				// 获取当前页面路由,也就是最后一个打开的页面路由
+				let curRoute = routes[routes.length - 1].route
+				this.pageUrl = curRoute
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+
+		.placeholder {
+			height: 30rpx;
+		}
+
+		.box {
+			display: flex;
+			width: 750rpx;
+			height: 110rpx;
+			line-height: 110rpx;
+			border-bottom: 1rpx solid #DDDDDD;
+			background-color: #fff;
+
+			.icon {
+				flex: 1;
+				text-align: center;
+
+				img {
+					margin-top: 36rpx;
+					width: 42rpx;
+					height: 38rpx;
+				}
+			}
+
+			.title {
+				flex: 5;
+				font-size: 30rpx;
+				font-weight: 400;
+			}
+
+			.right {
+				flex: 1;
+				text-align: center;
+
+				img {
+					width: 24rpx;
+					height: 32rpx;
+				}
+			}
+		}
+
+		.tab_bar {
+			position: fixed;
+			left: 0;
+			bottom: 0;
+			display: flex;
+			width: 750rpx;
+			height: 128rpx;
+			border-top: 1rpx solid #CCC;
+			background-color: #fff;
+
+			.tab_box {
+				flex: 1;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+
+				img {
+					margin-bottom: 10rpx;
+					width: 54rpx;
+					height: 48rpx;
+				}
+
+				.tab_title {
+					font-size: 20rpx;
+				}
+
+				.tab_title_active {
+					font-size: 20rpx;
+					color: #0082FC;
+				}
+			}
+		}
+	}
+</style>

BIN
pagesClockIn/particulars/imgs/finished.png


BIN
pagesClockIn/particulars/imgs/rule.png


BIN
pagesClockIn/particulars/imgs/unfinished.png


+ 225 - 0
pagesClockIn/particulars/particulars.vue

@@ -0,0 +1,225 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 顶部搜索框区域 -->
+		<view class="search">
+			<uni-search-bar bgColor="#fff" placeholder="请输入打卡规则名称" cancelButton="none" v-model="searchValue"
+				@input="input">
+			</uni-search-bar>
+		</view>
+
+		<!-- 规则列表区域 -->
+		<view class="list" v-if="list.length">
+			<!-- 每一个规则区域 -->
+			<view class="box" v-for="(item,index) in list" :key="index" @click="handleLook(item)">
+				<view class="icon">
+					<img src="./imgs/rule.png">
+				</view>
+				<view class="info">
+					<view class="title">
+						{{item.name}}
+					</view>
+					<view class="status">
+						<span class="right">全勤:{{item.peopleTotal}}人</span>
+						<span>异常:{{item.failCount}}人</span>
+					</view>
+				</view>
+				<!-- 右上角图标区域 -->
+				<view class="image">
+					<img v-if="item.failCount==0" src="./imgs/finished.png">
+					<img v-else src="./imgs/unfinished.png">
+				</view>
+			</view>
+		</view>
+
+		<view class="list2" v-else>
+			<img src="../static/imgs/nodata.png">
+			<view class="info">
+				暂无数据
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 当前页
+				page: 1,
+				// 总条数
+				total: 0,
+				// 当前时间
+				nowTime: "",
+				// 当前时间-每一天
+				nowTime_day: "",
+				// 搜索框绑定数值
+				searchValue: "",
+				// 列表数组
+				list: [],
+				type: ""
+			}
+		},
+		onLoad(options) {
+			if (options.nowTime_day) {
+				this.nowTime_day = options.nowTime_day
+			}
+			this.type = options.type
+			this.getTime()
+			this.getData()
+		},
+		onReachBottom() {
+			if (this.list.length < this.total) {
+				this.page++
+				this.getData()
+			} else {
+				uni.showToast({
+					title: "没有更多数据了",
+					icon: 'none'
+				})
+			}
+		},
+		methods: {
+			// 获取当前年 月 日
+			getTime() {
+				let date = new Date()
+				let year = date.getFullYear()
+				let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
+				let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
+				this.nowTime = year + "-" + month + "-" + day + " " + "00:00:00"
+			},
+			// 获取列表数据
+			async getData() {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/sign/check/in/summary",
+					data: {
+						name: this.searchValue,
+						page: this.page,
+						time: this.type == 1 ? this.nowTime_day : this.nowTime,
+						type: 1
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.list = [...this.list, ...res.data.list]
+					this.total = res.data.total
+				}
+			},
+
+			// 点击每一个规则回调
+			handleLook(item) {
+				// console.log(item);
+				let info = JSON.stringify(item)
+				uni.navigateTo({
+					url: `/pagesClockIn/rulesDetail/rulesDetail?info=${info}`
+				})
+			},
+			// 搜索框输入时的回调
+			input(res) {
+				this.list = []
+				this.page = 1
+				this.getData()
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+		
+		.placeholder {
+			height: 20rpx;
+		}
+
+		.search {
+			margin: 0 auto;
+			width: 690rpx;
+			height: 90rpx;
+			border-radius: 171rpx;
+			background-color: #fff;
+		}
+
+		.list {
+			margin-top: 20rpx;
+			padding-bottom: 30rpx;
+
+			.box {
+				display: flex;
+				margin: 0 auto;
+				margin-bottom: 20rpx;
+				width: 690rpx;
+				height: 130rpx;
+				background-color: #fff;
+
+				.icon {
+					flex: 1;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+
+					img {
+						width: 60rpx;
+						height: 60rpx;
+					}
+
+				}
+
+				.info {
+					flex: 6;
+					display: flex;
+					flex-direction: column;
+					justify-content: space-evenly;
+
+					.title {
+						font-size: 30rpx;
+					}
+
+					.status {
+						font-size: 24rpx;
+						font-weight: 500;
+						color: #A6A6A6;
+
+						.right {
+							margin-right: 20rpx;
+						}
+					}
+				}
+
+				.image {
+					margin-top: -5rpx;
+					margin-right: -5rpx;
+					width: 83rpx;
+					height: 83rpx;
+
+					img {
+						width: 100%;
+						height: 100%;
+					}
+				}
+			}
+		}
+
+		.list2 {
+			margin-top: 260rpx;
+			text-align: center;
+
+			img {
+				width: 480rpx;
+				height: 508rpx;
+			}
+
+			.info {
+				color: #5792F0;
+			}
+
+		}
+	}
+
+	// 解决输入框不居中问题
+	::v-deep .uni-searchbar {
+		padding: 10rpx;
+	}
+</style>

+ 298 - 0
pagesClockIn/powerSet/powerSet.vue

@@ -0,0 +1,298 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 头部分段选择器区域 -->
+		<view class="control">
+			<uni-segmented-control :current="current" :values="items" styleType="text" @clickItem="onClickItem"
+				activeColor="#0082FC"></uni-segmented-control>
+		</view>
+
+		<!-- 搜索栏区域 -->
+		<view class="search">
+			<uni-search-bar bgColor="#fff" placeholder="请输入姓名" cancelButton="none" v-model="searchValue" @clear="clear"
+				@input="getSearchData">
+			</uni-search-bar>
+		</view>
+
+		<!-- 权限人物区域 -->
+		<view class="choose" v-if="chooseList.length">
+
+			<view class="box" v-for="item in chooseList" :key="item.id">
+				<view class="name">
+					{{item.name}}
+				</view>
+				<view class="icon" @click="handleDelete(item)">
+					<img src="../static/imgs/close.png">
+				</view>
+			</view>
+		</view>
+
+		<!-- 搜索人员展示区域 -->
+		<view class="list" v-if="list.length">
+			<!-- 每一个人员区域 -->
+			<view class="item" v-for="item in list" :key="item.id" @click="handleAdd(item)">
+				{{item.name}} -- {{item.identityType}} -- {{item.idCard}}
+			</view>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				items: ['管理员', '子管理员'],
+				current: 0,
+				searchValue: "",
+				roleId: 2,
+				list: [],
+				chooseList: [],
+				typeValue: "管理员"
+			};
+		},
+		onLoad() {
+			this.getData()
+		},
+		methods: {
+			// 获取权限列表数据
+			async getData() {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/system/user/list",
+					data: {
+						roleId: this.roleId,
+						size: 9999
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.chooseList = res.data.list
+				}
+			},
+			// 获取搜索列表的数据
+			async getSearchData() {
+				if (this.searchValue) {
+					let res = await this.$myRequest_clockIn({
+						url: "/attendance/api/system/user/list",
+						data: {
+							name: this.searchValue,
+							size: 9999
+						}
+					})
+					// console.log(res);
+					if (res.code == 200) {
+						this.list = res.data.list
+						this.list.forEach((ele) => {
+							if (ele.identityType == 0) {
+								ele.identityType = "其他"
+							} else if (ele.identityType == 1) {
+								ele.identityType = "学生"
+							} else if (ele.identityType == 4) {
+								ele.identityType = "教职工"
+							} else if (ele.identityType == 5) {
+								ele.identityType = "校友"
+							} else if (ele.identityType == 6) {
+								ele.identityType = "访客"
+							} else if (ele.identityType == 7) {
+								ele.identityType = "临时人员"
+							}
+						})
+					}
+				}
+			},
+			// 清空搜索框回调
+			clear() {
+				this.list = []
+			},
+			// 分段器点击回调
+			onClickItem(e) {
+				this.list = []
+				this.searchValue = ""
+				// console.log(e.currentIndex);
+				if (e.currentIndex == 0) {
+					this.roleId = 2
+					this.typeValue = "管理员"
+				} else {
+					this.roleId = 3
+					this.typeValue = "子管理员"
+				}
+				this.getData()
+			},
+			// × 图标点击回调
+			handleDelete(item) {
+				uni.showModal({
+					title: '提示',
+					content: `确定将 ${item.name} 从${this.typeValue}列表中删除吗?`,
+					success: async (res) => {
+						if (res.confirm) {
+							let res = await this.$myRequest_clockIn({
+								url: "/attendance/api/system/role/update/user",
+								method: "put",
+								header: {
+									'Authorization': uni.getStorageSync("token")
+								},
+								data: {
+									id: this.roleId,
+									addIds: [],
+									removeIds: [item.id]
+								}
+							})
+							// console.log(res);
+							if (res.code == 200 && res.data) {
+								uni.showToast({
+									title: "删除成功",
+									icon: 'success'
+								})
+								setTimeout(() => {
+									this.searchValue = ""
+									this.list = []
+									this.getData()
+								}, 1500)
+							}
+						} else if (res.cancel) {}
+					}
+				});
+			},
+			// 点击添加回调
+			handleAdd(item) {
+				// 判断当前用户是否已经拥有该权限
+				let temList = []
+				this.chooseList.forEach((ele) => {
+					temList.push(ele.id)
+				})
+				let flag = temList.includes(item.id)
+
+				if (flag) {
+					uni.showModal({
+						title: '提示',
+						content: `当前用户已经是${this.typeValue},请勿重复设置`,
+						showCancel: false
+					});
+				} else {
+					uni.showModal({
+						title: '提示',
+						content: `确定将 ${item.name} 设置成${this.typeValue}吗?`,
+						success: async (res) => {
+							if (res.confirm) {
+								let res = await this.$myRequest_clockIn({
+									url: "/attendance/api/system/role/update/user",
+									method: "put",
+									header: {
+										'Authorization': uni.getStorageSync("token")
+									},
+									data: {
+										id: this.roleId,
+										addIds: [item.id],
+										removeIds: []
+									}
+								})
+								// console.log(res);
+								if (res.code == 200 && res.data) {
+									uni.showToast({
+										title: "添加成功",
+										icon: 'success'
+									})
+									setTimeout(() => {
+										this.searchValue = ""
+										this.list = []
+										this.getData()
+									}, 1500)
+								}
+							} else if (res.cancel) {}
+						}
+					});
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+
+		.placeholder {
+			height: 20rpx;
+		}
+
+		.control {
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			width: 750rpx;
+			height: 86rpx;
+			background-color: #fff;
+		}
+
+		.search {
+			box-sizing: border-box;
+			margin-top: 20rpx;
+			padding: 0 30rpx;
+			width: 750rpx;
+			height: 90rpx;
+			border-radius: 170rpx;
+			background-color: #fff;
+		}
+
+		.choose {
+			display: flex;
+			flex-wrap: wrap;
+			justify-content: space-evenly;
+			align-items: center;
+			margin-top: 20rpx;
+			padding: 30rpx;
+			width: 690rpx;
+			border-bottom: 1rpx solid #E5E5E5;
+			background-color: #fff;
+
+			.box {
+				display: flex;
+				align-items: center;
+				width: 150rpx;
+				height: 60rpx;
+
+				.name {
+					flex: 2;
+					text-align: center;
+					font-size: 28rpx;
+				}
+
+				.icon {
+					flex: 1;
+					display: flex;
+					align-items: center;
+					height: 50rpx;
+
+					img {
+						width: 30rpx;
+						height: 30rpx;
+					}
+				}
+			}
+		}
+
+		.list {
+			display: flex;
+			flex-direction: column;
+			justify-content: space-evenly;
+			padding-top: 22rpx;
+			width: 750rpx;
+			border-bottom: 1rpx solid #E5E5E5;
+			background-color: #fff;
+
+			.item {
+				margin-bottom: 30rpx;
+				margin-left: 65rpx;
+				height: 41rpx;
+				font-size: 28rpx;
+			}
+		}
+	}
+
+	// 解决输入框不居中问题
+	::v-deep .uni-searchbar {
+		padding: 10rpx;
+	}
+</style>

+ 241 - 0
pagesClockIn/punchLocation/punchLocation.vue

@@ -0,0 +1,241 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 头部添加打卡时间区域 -->
+		<view class="add">
+			<view class="icon" @click="handleAdd">
+				<img src="../static/imgs/add.png">
+			</view>
+			<view class="title" @click="handleAdd">
+				添加打卡位置
+			</view>
+			<view class="none"></view>
+		</view>
+
+		<!-- 打卡时间列表 -->
+		<view class="list">
+			<uni-swipe-action>
+				<!-- 每一个时间段区域 -->
+				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(index)"
+					v-for="(item,index) in list" :key="index">
+
+					<view class="box">
+						<view class="icon">
+							<img src="../static/imgs/location2.png">
+						</view>
+						<view class="place">
+							<view class="top">
+								{{item.name}}
+							</view>
+							<view class="center">
+								地址:{{item.name}}
+							</view>
+							<view class="bottom">
+								范围:{{item.radius}}米
+							</view>
+						</view>
+						<view class="right">
+							<img src="../static/imgs/right.png">
+						</view>
+					</view>
+				</uni-swipe-action-item>
+			</uni-swipe-action>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 地点数组
+				list: [],
+				// 左滑选项配置
+				options: [{
+					text: '删除',
+					style: {
+						backgroundColor: '#D43030'
+					}
+				}],
+			}
+		},
+		onLoad(options) {
+			if (options.locations) {
+				this.list = JSON.parse(options.locations)
+				uni.setStorageSync("chooseList", this.list)
+			}
+		},
+		onShow() {
+			uni.removeStorageSync("flag_place")
+			let arr = uni.getStorageSync("chooseList")
+			if (arr) {
+				this.list = arr
+			}
+			if (arr.lenght == 0) {
+				uni.setStorageSync("flag_place", true)
+			}
+		},
+		methods: {
+			// 点击添加打卡位置回调
+			handleAdd() {
+				// 获取用户位置权限
+				uni.authorize({
+					scope: 'scope.userLocation',
+					success: () => {
+						uni.navigateTo({
+							url: `/pagesClockIn/addLocation/addLocation`
+						})
+					},
+					fail() {
+						uni.showModal({
+							title: '提示',
+							content: '请先开启定位权限,否则将无法使用定位功能',
+							cancelText: '不授权',
+							confirmText: '授权',
+							success: function(res) {
+								if (res.confirm) {
+									uni.openSetting({
+										success(res) {}
+									})
+								}
+							}
+						});
+					}
+				})
+			},
+			// 点击右侧删除按钮回调
+			onClick(index) {
+				uni.showModal({
+					title: '提示',
+					content: '确定删除该打卡位置吗?',
+					success: (res) => {
+						if (res.confirm) {
+							uni.showToast({
+								title: "删除成功",
+								icon: 'success'
+							})
+							this.list.splice(index, 1)
+							if (this.list.length == 0) {
+								uni.setStorageSync("flag_place", true)
+							}
+							uni.setStorageSync("chooseList", this.list)
+						}
+					}
+				});
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+
+		.placeholder {
+			height: 20rpx;
+		}
+
+		.add {
+			display: flex;
+			margin: 0 auto;
+			width: 690rpx;
+			height: 87rpx;
+			line-height: 87rpx;
+			border-radius: 14rpx;
+			background-color: #fff;
+
+			.icon {
+				flex: 1;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+
+				img {
+					width: 36rpx;
+					height: 36rpx;
+				}
+			}
+
+			.title {
+				flex: 3;
+				font-size: 30rpx;
+				color: #0082FC;
+			}
+
+			.none {
+				flex: 5;
+			}
+		}
+
+		.list {
+			margin-top: 20rpx;
+			padding-bottom: 30rpx;
+
+			.box {
+				display: flex;
+				align-items: center;
+				margin: 0 auto;
+				margin-bottom: 20rpx;
+				width: 690rpx;
+				height: 137rpx;
+				border-radius: 14rpx;
+				background-color: #fff;
+
+				.icon {
+					margin-top: 10rpx;
+					width: 75rpx;
+					text-align: center;
+
+					img {
+						width: 40rpx;
+						height: 40rpx;
+					}
+				}
+
+				.place {
+					width: 540rpx;
+
+					.top {
+						font-size: 32rpx;
+						overflow: hidden;
+						white-space: nowrap;
+						text-overflow: ellipsis;
+					}
+
+					.center {
+						font-size: 24rpx;
+						color: #999999;
+						overflow: hidden;
+						white-space: nowrap;
+						text-overflow: ellipsis;
+					}
+
+					.bottom {
+						font-size: 24rpx;
+						color: #999999;
+						overflow: hidden;
+						white-space: nowrap;
+						text-overflow: ellipsis;
+					}
+				}
+
+				.right {
+					width: 75rpx;
+					text-align: center;
+
+					img {
+						width: 15rpx;
+						height: 28rpx;
+					}
+				}
+			}
+		}
+	}
+
+	// 解决左滑区域突出问题
+	::v-deep .uni-swipe_button-group {
+		margin-bottom: 20rpx;
+	}
+</style>

+ 244 - 0
pagesClockIn/punchTime/punchTime.vue

@@ -0,0 +1,244 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 头部添加打卡时间区域 -->
+		<view class="add">
+			<view class="icon" @click="handleAdd">
+				<img src="../static/imgs/add.png">
+			</view>
+			<view class="title" @click="handleAdd">
+				添加打卡时间
+			</view>
+			<view class="none"></view>
+		</view>
+
+		<!-- 打卡时间列表 -->
+		<view class="list">
+			<uni-swipe-action>
+				<!-- 每一个时间段区域 -->
+				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(index)"
+					v-for="(item,index) in list" :key="index">
+					<view class="box" @click="handleEdit(item,index)">
+						<view class="left">
+							<view class="week">
+								<view class="key">
+									星期
+								</view>
+								<view class="value">
+									<span v-for="(item_week,index_week) in item.dayOfWeeks" :key="index_week">
+										{{arr[item_week]}}
+									</span>
+								</view>
+							</view>
+							<view class="week">
+								<view class="key">
+									时段
+								</view>
+								<view class="value">
+									<span v-for="(item_time,index_time) in item.periods" :key="index_time">
+										{{format_time(item_time.beginTime)}}-{{format_time(item_time.endTime)}}
+									</span>
+								</view>
+							</view>
+						</view>
+						<view class="right">
+							<img src="../static/imgs/right.png">
+						</view>
+					</view>
+				</uni-swipe-action-item>
+			</uni-swipe-action>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 时间数组
+				list: [],
+				// 左滑选项配置
+				options: [{
+					text: '删除',
+					style: {
+						backgroundColor: '#D43030'
+					}
+				}],
+				// 星期映射数组
+				arr: ["", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"]
+			}
+		},
+		onLoad(options) {
+			if (options.time) {
+				if (JSON.parse(options.time) != '未设置') {
+					this.list = JSON.parse(options.time)
+					uni.setStorageSync("ruleTime", this.list)
+				}
+			}
+		},
+		onShow() {
+			uni.removeStorageSync("flag")
+			let ruleTime = uni.getStorageSync("ruleTime")
+			if (ruleTime) {
+				this.list = ruleTime
+			}
+			if (ruleTime.lenght == 0) {
+				uni.setStorageSync("flag", true)
+			}
+		},
+		methods: {
+			// 点击添加打卡时间回调 跳转到添加页面
+			handleAdd() {
+				uni.navigateTo({
+					url: `/pagesClockIn/setPunchTime/setPunchTime?flag=1`
+				})
+			},
+			// 点击每一个时间段回调 跳转到编辑页面
+			handleEdit(item, index) {
+				let info = JSON.stringify(item)
+				uni.navigateTo({
+					url: `/pagesClockIn/setPunchTime/setPunchTime?flag=2&info=${info}&index=${index}`
+				})
+			},
+			// 点击右侧删除按钮回调
+			onClick(index) {
+				// console.log(index);
+				uni.showModal({
+					title: '提示',
+					content: '确定删除该打卡时间吗?',
+					success: (res) => {
+						if (res.confirm) {
+							uni.showToast({
+								title: "删除成功",
+								icon: 'success'
+							})
+							this.list.splice(index, 1)
+							if (this.list.length == 0) {
+								uni.setStorageSync("flag", true)
+							}
+							uni.setStorageSync("ruleTime", this.list)
+						} else if (res.cancel) {}
+					}
+				});
+			},
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				let strDate = h + m;
+				return strDate;
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+		
+		.placeholder{
+			height: 20rpx;
+		}
+
+		.add {
+			display: flex;
+			margin: 0 auto;
+			width: 690rpx;
+			height: 87rpx;
+			line-height: 87rpx;
+			border-radius: 14rpx;
+			background-color: #fff;
+
+			.icon {
+				flex: 1;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+
+				img {
+					width: 36rpx;
+					height: 36rpx;
+				}
+			}
+
+			.title {
+				flex: 3;
+				font-size: 30rpx;
+				color: #0082FC;
+			}
+
+			.none {
+				flex: 5;
+			}
+		}
+
+		.list {
+			margin-top: 20rpx;
+			padding-bottom: 30rpx;
+
+			.box {
+				display: flex;
+				margin: 0 auto;
+				margin-bottom: 20rpx;
+				width: 690rpx;
+				height: 132rpx;
+				border-radius: 14rpx;
+				background-color: #fff;
+				overflow: hidden;
+
+				.left {
+					display: flex;
+					flex-direction: column;
+					margin-left: 17rpx;
+					width: 492rpx;
+
+					.week {
+						flex: 1;
+						display: flex;
+						align-items: center;
+						font-size: 24rpx;
+
+						.key {
+							flex: 1;
+							margin-left: 8rpx;
+							color: #A6A6A6;
+						}
+
+						.value {
+							flex: 5;
+							overflow: hidden;
+							white-space: nowrap;
+							text-overflow: ellipsis;
+
+							span {
+								margin-right: 10rpx;
+							}
+						}
+					}
+				}
+
+				.right {
+					display: flex;
+					justify-content: flex-end;
+					align-items: center;
+					width: 198rpx;
+
+					img {
+						margin-right: 20rpx;
+						width: 20rpx;
+						height: 30rpx;
+					}
+				}
+			}
+		}
+	}
+
+	// 解决左滑区域突出问题
+	::v-deep .uni-swipe_button-group {
+		margin-bottom: 20rpx;
+	}
+</style>

+ 71 - 0
pagesClockIn/ruleName/ruleName.vue

@@ -0,0 +1,71 @@
+<template>
+	<view class="container">
+		<!-- 规则名称输入区域 -->
+		<view class="input">
+			<uni-easyinput :inputBorder="false" focus v-model="name" placeholder="请输入规则名称"></uni-easyinput>
+		</view>
+
+		<!-- 确认按钮区域 -->
+		<view class="button" @click="handleConfirm">
+			确认
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 输入框绑定数值
+				name: "",
+			};
+		},
+		methods: {
+			// 点击确认按钮回调
+			handleConfirm() {
+				if (!this.name) {
+					uni.showToast({
+						title: "请输入规则名称",
+						icon: 'none'
+					})
+				} else {
+					uni.$emit('updateRuleName', this.name)
+					uni.navigateBack({
+						delta: 1
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		padding-top: 22rpx;
+		background-color: #F2F2F2;
+
+		.input {
+			display: flex;
+			align-items: center;
+			margin: 0 auto;
+			width: 690rpx;
+			height: 87rpx;
+			border-radius: 14rpx;
+			background-color: #fff;
+		}
+
+		.button {
+			margin: 0 auto;
+			margin-top: 118rpx;
+			width: 690rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			color: #fff;
+			font-size: 32rpx;
+			font-weight: 500;
+			border-radius: 16rpx;
+			background-color: #3396FB;
+		}
+	}
+</style>

+ 219 - 0
pagesClockIn/ruleSet/ruleSet.vue

@@ -0,0 +1,219 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 头部新增规则区域 -->
+		<view class="add" @click="toPageAddRules">
+			<view class="icon">
+				<img src="../static/imgs/add.png">
+			</view>
+			<view class="title">
+				新增规则
+			</view>
+		</view>
+
+		<!-- 具体规则区域 -->
+		<view class="rules">
+			<!-- 每一个规则区域 -->
+			<view class="box" v-for="item in list" :key="item.id" @click="toPageEditRules(item.id)">
+				<view class="box_title">
+					<view class="icon">
+						<img src="../static/imgs/my1.png">
+					</view>
+					<view class="msg">
+						{{item.name}}
+					</view>
+					<view class="right">
+						<img src="../static/imgs/right.png">
+					</view>
+				</view>
+
+				<view class="box_info">
+					考勤组:{{item.groups}}
+				</view>
+
+				<view class="box_info">
+					<span>时 间:{{(item.temList).join(",")}}</span>
+					<span v-for="(time_item,index) in item.periods" :key="index">
+						{{format_time(time_item.beginTime)}}-{{format_time(time_item.endTime)}}
+					</span>
+				</view>
+
+				<view class="box_info">
+					打卡地点:{{item.locations}}
+				</view>
+
+				<view class="box_info">
+					提前通知:提前{{item.noticeTime}}分钟通知
+				</view>
+			</view>
+
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 规则列表数组
+				list: []
+			};
+		},
+		onShow() {
+			// 清空缓存
+			uni.removeStorageSync("flag_place")
+			uni.removeStorageSync("flag")
+			uni.removeStorageSync("chooseList")
+			uni.removeStorageSync('ruleTime');
+			// 获取最新打卡规则列表数据
+			this.getRuleList()
+		},
+		methods: {
+			// 获取打卡规则列表数据
+			async getRuleList() {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/settings/rule/list"
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.list = res.data.list
+					this.list.forEach((ele) => {
+						ele.groups = ele.groups.join(",")
+						ele.locations = ele.locations.join(",")
+						ele.dayOfWeeks.sort((a, b) => {
+							return a - b
+						})
+						let arr = ["", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"]
+						ele.temList = ele.dayOfWeeks.map((item) => {
+							return item = arr[item]
+						})
+					})
+				}
+			},
+			// 点击每一项跳转编辑规则页面
+			toPageEditRules(id) {
+				// console.log(id);
+				uni.navigateTo({
+					url: `/pagesClockIn/editRules/editRules?id=${id}`
+				})
+			},
+			// 新增规则跳转页面回调
+			toPageAddRules() {
+				uni.navigateTo({
+					url: "/pagesClockIn/addRules/addRules"
+				})
+			},
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				let strDate = h + m;
+				return strDate;
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+
+		.placeholder {
+			height: 30rpx;
+		}
+
+		.add {
+			margin-bottom: 30rpx;
+			display: flex;
+			width: 750rpx;
+			height: 110rpx;
+			background-color: #fff;
+
+			.icon {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				width: 88rpx;
+
+				img {
+					width: 50rpx;
+					height: 50rpx;
+				}
+			}
+
+			.title {
+				line-height: 110rpx;
+				font-size: 30rpx;
+				font-weight: 400;
+				color: #0082FC;
+			}
+		}
+
+		.rules {
+			width: 750rpx;
+
+			.box {
+				padding: 0 30rpx;
+				margin-bottom: 20rpx;
+				height: 348rpx;
+				background-color: #fff;
+
+				.box_title {
+					display: flex;
+					height: 90rpx;
+
+					.icon {
+						flex: 1;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+
+						img {
+							width: 35rpx;
+							height: 35rpx;
+						}
+					}
+
+					.msg {
+						flex: 10;
+						line-height: 90rpx;
+						font-size: 30rpx;
+						font-weight: 400;
+					}
+
+					.right {
+						flex: 1;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+
+						img {
+							width: 16rpx;
+							height: 25rpx;
+						}
+					}
+				}
+
+				.box_info {
+					display: flex;
+					margin: 15rpx 0;
+					height: 44rpx;
+					font-size: 30rpx;
+					font-weight: 400;
+					color: #808080;
+					overflow: hidden;
+					white-space: nowrap;
+					text-overflow: ellipsis;
+
+					span {
+						margin-right: 10rpx;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 234 - 0
pagesClockIn/rulesDetail/rulesDetail.vue

@@ -0,0 +1,234 @@
+<template>
+	<view class="container">
+		<!-- 顶部搜索框区域 -->
+		<view class="search">
+			<uni-search-bar bgColor="#fff" placeholder="请输入名字或院系" cancelButton="none" v-model="searchValue"
+				@input="input">
+			</uni-search-bar>
+		</view>
+
+		<view class="list">
+			<!-- 分段器区域 -->
+			<view class="control">
+				<uni-segmented-control :current="current" :values="items" styleType="text" @clickItem="onClickItem"
+					activeColor="#0082FC"></uni-segmented-control>
+			</view>
+			<!-- 列表区域 -->
+			<view class="listbox" v-if="list.length">
+				<!-- 每一个盒子区域 -->
+				<view class="item" v-for="item in list" :key="item.id">
+					<view class="left">
+						<img :src="item.headImage||'../static/imgs/headImage.png'">
+					</view>
+					<view class="center">
+						<view class="name">
+							{{item.name}}
+						</view>
+						<view class="college">
+							{{item.college?item.college:"南昌交通学院"}}
+						</view>
+					</view>
+					<view class="right">
+						{{item.status==4?"正常":"缺卡"}}
+					</view>
+				</view>
+			</view>
+
+			<view class="listbox2" v-else>
+				<img src="../static/imgs/nodata.png">
+				<view class="info">
+					暂无数据
+				</view>
+			</view>
+
+		</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 总人数
+				peopleTotal: 0,
+				// 打卡失败人数
+				failCount: 0,
+				// 打卡成功人数
+				successCount: 0,
+				// 搜索框绑定值
+				searchValue: "",
+				// 分段器绑定数组
+				items: ['打卡成功', '打卡失败'],
+				// 当前分段器所在的索引
+				current: 0,
+				// 列表数组
+				list: [],
+				// 规则ID
+				taskId: "",
+				// 打卡状态 3代表失败 4代表成功
+				status: 4,
+				// 当前页
+				page: 1,
+				// 列表总条数
+				total: 0
+			}
+		},
+		onLoad(options) {
+			let info = JSON.parse(options.info)
+			// console.log(info);
+			this.peopleTotal = info.peopleTotal
+			this.failCount = info.failCount
+			this.successCount = info.peopleTotal - info.failCount
+			this.items[0] = `打卡成功(${this.successCount}/${this.peopleTotal}人)`
+			this.items[1] = `打卡失败(${this.failCount}/${this.peopleTotal}人)`
+			this.taskId = info.taskId
+			this.getData()
+		},
+		onReachBottom() {
+			if (this.list.length < this.total) {
+				this.page++
+				this.getData()
+			} else {
+				uni.showToast({
+					title: "没有更多数据了",
+					icon: 'none'
+				})
+			}
+		},
+		methods: {
+			// 获取列表数据
+			async getData() {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/sign/check/in/rule",
+					data: {
+						name: this.searchValue,
+						page: this.page,
+						status: this.status,
+						taskId: this.taskId
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.total = res.data.total
+					this.list = [...this.list, ...res.data.list]
+				}
+			},
+			// 点击分段器回调
+			onClickItem(e) {
+				// console.log(e.currentIndex);
+				this.list = []
+				this.page = 1
+				if (e.currentIndex == 0) {
+					this.status = 4
+				} else {
+					this.status = 3
+				}
+				this.getData()
+			},
+			// 搜索框输入时的回调
+			input() {
+				this.list = []
+				this.page = 1
+				this.getData()
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		padding-top: 20rpx;
+
+		.search {
+			width: 750rpx;
+			height: 90rpx;
+			border-radius: 171rpx;
+			background-color: #fff;
+		}
+
+		.list {
+			margin-top: 20rpx;
+			width: 750rpx;
+			min-height: 85vh;
+			background-color: #fff;
+
+			.control {
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				width: 750rpx;
+				height: 102rpx;
+			}
+
+			.listbox {
+				.item {
+					display: flex;
+					align-items: center;
+					margin: 0 30rpx;
+					height: 114rpx;
+					border-bottom: 1rpx solid #E5E5E5;
+					background-color: #fff;
+
+					.left {
+						flex: 1;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+
+						img {
+							width: 70rpx;
+							height: 70rpx;
+							border-radius: 35rpx;
+						}
+					}
+
+					.center {
+						flex: 5;
+						display: flex;
+						flex-direction: column;
+						justify-content: space-evenly;
+						margin-left: 10rpx;
+						height: 90rpx;
+
+						.name {
+							font-size: 28rpx;
+						}
+
+						.college {
+							font-size: 24rpx;
+							color: #808080;
+						}
+					}
+
+					.right {
+						flex: 1;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+						font-size: 28rpx;
+					}
+				}
+			}
+
+			.listbox2 {
+				margin-top: 230rpx;
+				text-align: center;
+
+				img {
+					width: 480rpx;
+					height: 508rpx;
+				}
+
+				.info {
+					color: #5792F0;
+				}
+			}
+		}
+	}
+
+	// 解决输入框不居中问题
+	::v-deep .uni-searchbar {
+		padding: 10rpx;
+	}
+</style>

+ 390 - 0
pagesClockIn/setPunchTime/setPunchTime.vue

@@ -0,0 +1,390 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 选择星期区域 -->
+		<view class="week_title">
+			选择星期
+		</view>
+		<view class="week">
+			<jlk-week :value="selectedWeeks" @change="changeWeek"></jlk-week>
+		</view>
+
+		<!-- 选择打卡时间段区域 -->
+		<view class="time_list">
+			<view class="title">
+				选择打卡时间段
+			</view>
+			<view class="add" @click="handleAddTime">
+				添加时段
+			</view>
+		</view>
+
+		<view class="list">
+
+			<uni-swipe-action>
+				<!-- 每一个时间段区域 -->
+				<uni-swipe-action-item :auto-close="true" :right-options="options" @click="onClick(index)"
+					v-for="(item,index) in list" :key="index">
+
+					<view class="item">
+						<view class="item_box">
+							<picker mode="time" :value="item.beginTime" @change="bindTimeChange($event,1,item)">
+								<view class="uni-input">
+									<view class="input_time">
+										{{item.beginTime}}
+									</view>
+									<view class="input_icon">
+										<img src="../static/imgs/time.png">
+									</view>
+								</view>
+							</picker>
+						</view>
+						--
+						<view class="item_box">
+							<picker mode="time" :value="item.endTime" @change="bindTimeChange($event,2,item)">
+								<view class="uni-input">
+									<view class="input_time">
+										{{item.endTime}}
+									</view>
+									<view class="input_icon">
+										<img src="../static/imgs/time.png">
+									</view>
+								</view>
+							</picker>
+						</view>
+					</view>
+
+				</uni-swipe-action-item>
+			</uni-swipe-action>
+
+		</view>
+
+		<view class="button" @click="handleSave">
+			保存
+		</view>
+
+	</view>
+</template>
+
+<script>
+	import JlkWeek from '@/uni_modules/jlk-week/components/jlk-week/jlk-week.vue';
+	export default {
+		components: {
+			JlkWeek
+		},
+		data() {
+			return {
+				// 选中的星期
+				selectedWeeks: [],
+				// 打卡时间段列表
+				list: [{
+					beginTime: "00:00",
+					endTime: "00:00",
+				}],
+				// 编辑打卡时间页面带过来的对象
+				info: {},
+				// 左滑配置
+				options: [{
+					text: '删除',
+					style: {
+						backgroundColor: '#D43030'
+					}
+				}],
+				// 添加时间 编辑时间 标识
+				flag: null,
+				// 时间列表索引
+				index: null,
+			}
+		},
+		onLoad(options) {
+			this.flag = options.flag
+			if (this.flag == 1) {
+				uni.setNavigationBarTitle({
+					title: '添加打卡时间'
+				});
+			} else {
+				uni.setNavigationBarTitle({
+					title: '编辑打卡时间'
+				});
+				this.index = options.index
+				this.info = JSON.parse(options.info)
+				// console.log(this.info);
+				this.list = this.info.periods
+				this.list.forEach((ele) => {
+					ele.beginTime = this.format_time(ele.beginTime)
+					ele.endTime = this.format_time(ele.endTime)
+				})
+				this.selectedWeeks = this.info.dayOfWeeks.map((ele) => {
+					if (ele == 7) {
+						return ele = 0
+					} else {
+						return ele
+					}
+				})
+			}
+		},
+		methods: {
+			// 保存按钮回调
+			handleSave() {
+				if (!this.selectedWeeks.length) {
+					uni.showToast({
+						title: "请选择需要打卡的星期",
+						icon: 'none'
+					})
+					return
+				}
+				if (!this.list.length) {
+					uni.showToast({
+						title: "请添加需要打卡的时间段",
+						icon: 'none'
+					})
+					return
+				}
+				uni.showModal({
+					title: '提示',
+					content: '确定保存吗?',
+					success: (res) => {
+						if (res.confirm) {
+							uni.showToast({
+								title: "保存成功",
+								icon: 'success'
+							})
+							setTimeout(() => {
+								let temArr = []
+								temArr = this.list
+								temArr.forEach((ele) => {
+									ele.beginTime = this.formatTime(ele.beginTime)
+									ele.endTime = this.formatTime(ele.endTime)
+								})
+
+								let temArr_week = []
+								temArr_week = this.selectedWeeks.map((ele) => {
+									if (ele == 0) {
+										return ele = 7
+									} else {
+										return ele
+									}
+								})
+								let temList = uni.getStorageSync("ruleTime") || []
+								// 编辑时间
+								if (this.flag == 2) {
+									temList.splice(this.index, 1, {
+										dayOfWeeks: temArr_week,
+										periods: temArr,
+									})
+								} else {
+									// 添加时间
+									temList.push({
+										dayOfWeeks: temArr_week,
+										periods: temArr
+									})
+								}
+								uni.setStorageSync("ruleTime", temList)
+								uni.navigateBack({
+									delta: 1
+								})
+							}, 1500)
+						}
+					}
+				});
+			},
+			// 选择星期回调
+			changeWeek(value) {
+				// 把0变成7
+				value = value.map((ele) => {
+					if (ele == 0) {
+						return ele = 7
+					} else {
+						return ele
+					}
+				})
+				// 从小到大排序
+				value.sort((a, b) => {
+					return a - b
+				})
+				this.selectedWeeks = value
+			},
+			// 选择时间段回调
+			bindTimeChange(e, val, item) {
+				if (val == 1) {
+					item.beginTime = e.detail.value
+				} else {
+					item.endTime = e.detail.value
+				}
+			},
+			// 添加时段回调
+			handleAddTime() {
+				this.list.push({
+					beginTime: "00:00",
+					endTime: "00:00",
+				})
+			},
+			// 点击右侧删除按钮回调
+			onClick(index) {
+				uni.showModal({
+					title: '提示',
+					content: '确定删除该打卡时间段吗?',
+					success: (res) => {
+						if (res.confirm) {
+							this.list.splice(index, 1)
+							uni.showToast({
+								title: "删除成功",
+								icon: 'success'
+							})
+						}
+					}
+				});
+			},
+			// 格式化时间
+			formatTime(val) {
+				let tem = '2021-11-22 ' + val + ':00'
+				// console.log(tem);
+				let date = new Date(tem);
+				let time = date.getTime();
+				return time
+			},
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				let strDate = h + m;
+				return strDate;
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+		
+		.placeholder{
+			height: 33rpx;
+		}
+
+		.week_title {
+			margin-left: 35rpx;
+			font-size: 34rpx;
+			font-weight: 500;
+		}
+
+		.week {
+			margin: 0 auto;
+			margin-top: 12rpx;
+			width: 690rpx;
+			height: 107rpx;
+			border-radius: 10rpx;
+			background-color: #fff;
+		}
+
+		.time_list {
+			display: flex;
+			align-items: center;
+			margin: 0 auto;
+			margin-top: 32rpx;
+			width: 690rpx;
+			height: 60rpx;
+			font-weight: 500;
+
+			.title {
+				flex: 4;
+				font-size: 34rpx;
+			}
+
+			.add {
+				flex: 1;
+				text-align: end;
+				font-size: 24rpx;
+				color: #3396FB;
+			}
+		}
+
+		.list {
+			margin: 0 auto;
+			margin-top: 13rpx;
+			padding-top: 20rpx;
+			padding-bottom: 20rpx;
+			width: 690rpx;
+			border-radius: 10rpx;
+			background-color: #fff;
+
+			.item {
+				display: flex;
+				justify-content: space-between;
+				margin: 0 20rpx 20rpx 20rpx;
+				width: 650rpx;
+				height: 60rpx;
+
+				.item_box {
+					width: 291rpx;
+					height: 60rpx;
+					border-radius: 8rpx;
+					border: 1rpx solid #CCCCCC;
+
+					.uni-input {
+						display: flex;
+						align-items: center;
+						width: 291rpx;
+						height: 60rpx;
+
+						.input_time {
+							flex: 2;
+							margin-left: 34rpx;
+							font-size: 28rpx;
+							color: #707070;
+						}
+
+						.input_icon {
+							flex: 1;
+							display: flex;
+							justify-content: center;
+							align-items: center;
+
+							img {
+								width: 26rpx;
+								height: 26rpx;
+							}
+						}
+					}
+				}
+			}
+
+			// .edit {
+			// 	margin-left: 20rpx;
+			// 	padding-top: 10rpx;
+			// 	width: 70rpx;
+			// 	height: 60rpx;
+			// 	color: #3396FB;
+			// 	font-size: 24rpx;
+			// 	font-weight: 500;
+			// }
+		}
+
+		.button {
+			margin: 0 auto;
+			margin-top: 50rpx;
+			width: 690rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			color: #fff;
+			font-size: 32rpx;
+			border-radius: 16rpx;
+			background-color: #3396FB;
+		}
+	}
+
+	// 选择星期区域圆角效果
+	::v-deep .weeks-outer {
+		border-radius: 10rpx;
+	}
+
+	// 解决左滑区域突出问题
+	::v-deep .uni-swipe_button-group {
+		margin-bottom: 20rpx;
+	}
+</style>

+ 957 - 0
pagesClockIn/stat/stat.vue

@@ -0,0 +1,957 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 顶部分段器区域 -->
+		<view class="control" v-if="flag">
+			<uni-segmented-control :current="current" :values="items" styleType="text" @clickItem="onClickItem"
+				activeColor="#0082FC"></uni-segmented-control>
+		</view>
+		<!-- 头部月份区域 -->
+		<view class="header">
+			<view class="title">
+				<view class="month">
+					{{month}}月汇总
+				</view>
+				<view class="right" @click="goToDetail">
+					<img src="../static/imgs/right.png" alt="">
+				</view>
+			</view>
+			<view class="state">
+				<view class="err">
+					<view class="number">
+						{{fail_count}}
+					</view>
+					<view class="mes">
+						异常次数(次)
+					</view>
+				</view>
+				<view class="success">
+					<view class="number">
+						{{success_count}}
+					</view>
+					<view class="mes">
+						打卡成功(次)
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 日历区域 -->
+		<view class="calendar">
+			<view class="calendar_title">
+				每日记录
+				<span>({{month}}月)</span>
+			</view>
+
+			<view class="calendar_body">
+				<uni-calendar :showMonth="false" @change="change" :selected="selectList" />
+			</view>
+
+			<view class="calendar_foot" v-if="current==1">
+
+				<!-- 每一条记录区域 -->
+				<view class="foot_item" v-for="item in list2" :key="item.id">
+					<view>
+						规则:{{item.ruleName}} {{item.timeRange}}
+					</view>
+					<view class="box">
+						<view class="circular" v-if="item.finish"></view>
+						<view class="circular color" v-else></view>
+						{{item.finish?"已打卡":"未打卡"}}
+						<span v-if="item.finish">{{format_time(item.updateTime)}}</span>
+					</view>
+				</view>
+			</view>
+
+			<!-- 环形图区域 -->
+			<view class="progress" v-if="current==0">
+				<view class="chart">
+					<progressBar v-if="showBar" :progress_txt="progress_txt" :progress_total="progress_total" />
+				</view>
+
+				<view class="look" @click="handleLookDetail">
+					<view class="info">
+						查看明细
+					</view>
+					<img src="../static/imgs/right.png">
+				</view>
+			</view>
+		</view>
+
+		<!-- 异常人员名单区域 -->
+		<view class="errPeople" v-if="current==0">
+			<!-- 标题区域 -->
+			<view class="e_header">
+				<view class="left">
+					异常人员名单
+				</view>
+				<view class="right">
+					<view class="icon" @click="handleInform">
+						<img src="../static/imgs/notice.png">
+					</view>
+					<view class="info" @click="handleInform">
+						通知
+					</view>
+				</view>
+			</view>
+
+			<!-- 选择时间区域 -->
+			<view class="e_calendar">
+				<!-- 双左箭头区域 -->
+				<view class="double" @click="handleDoubleLeft">
+					<img src="../static/imgs/double_left.png">
+				</view>
+				<!-- 左箭头区域区域 -->
+				<view class="single" @click="handleLeft">
+					<img src="../static/imgs/left.png">
+				</view>
+				<!-- 时间区域 -->
+				<view class="time">
+					{{year}}-{{comMonth}}
+				</view>
+				<!-- 双右箭头区域 -->
+				<view class="single2" @click="handleRight">
+					<img src="../static/imgs/right2.png">
+				</view>
+				<!-- 右箭头区域 -->
+				<view class="double" @click="handleDoubleRight">
+					<img src="../static/imgs/double_right.png">
+				</view>
+			</view>
+
+			<view class="e_list" v-if="errList.length">
+				<view class="e_box" v-for="item in errList" :key="item.userId">
+					<view class="e_img">
+						<img
+							:src="item.headImage||'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0'">
+					</view>
+					<view class="e_name">
+						{{item.name}}
+					</view>
+					<view class="e_msg">
+						未打卡{{item.times}}次
+					</view>
+				</view>
+			</view>
+
+			<view class="e_list2" v-else>
+				<img src="../static/imgs/nodata.png">
+				<view class="info">
+					暂无数据
+				</view>
+			</view>
+		</view>
+
+		<!-- 底部导航栏区域 -->
+		<cover-view class="tab_bar">
+			<cover-view class="tab_box" @click="handleGoPage('/pagesClockIn/home/home')">
+				<cover-image class="tab_img" v-if="pageUrl=='pagesClockIn/home/home'"
+					src="../static/imgs/home_active.png">
+				</cover-image>
+				<cover-image class="tab_img" v-else src="../static/imgs/home.png"></cover-image>
+				<cover-view v-if="pageUrl=='pagesClockIn/home/home'" class="tab_title_active">
+					首页
+				</cover-view>
+				<cover-view v-else class="tab_title">
+					首页
+				</cover-view>
+			</cover-view>
+			<cover-view class="tab_box" @click="handleGoPage('/pagesClockIn/stat/stat')">
+				<cover-image class="tab_img" v-if="pageUrl=='pagesClockIn/stat/stat'"
+					src="../static/imgs/stat_active.png">
+				</cover-image>
+				<cover-image class="tab_img" v-else src="../static/imgs/stat.png"></cover-image>
+				<cover-view v-if="pageUrl=='pagesClockIn/stat/stat'" class="tab_title_active">
+					统计
+				</cover-view>
+				<cover-view v-else class="tab_title">
+					统计
+				</cover-view>
+			</cover-view>
+			<cover-view v-if="flag" class="tab_box" @click="handleGoPage('/pagesClockIn/my/my')">
+				<cover-image class="tab_img" v-if="pageUrl=='pagesClockIn/my/my'" src="../static/imgs/my_active.png">
+				</cover-image>
+				<cover-image class="tab_img" v-else src="../static/imgs/my.png"></cover-image>
+				<cover-view v-if="pageUrl=='pagesClockIn/my/my'" class="tab_title_active">
+					我的
+				</cover-view>
+				<cover-view v-else class="tab_title">
+					我的
+				</cover-view>
+			</cover-view>
+		</cover-view>
+
+	</view>
+</template>
+
+<script>
+	import progressBar from '../components/chocolate-progress-bar/chocolate-progress-bar.vue'
+	export default {
+		components: {
+			progressBar
+		},
+		data() {
+			return {
+				// 是否为管理员或子管理员标识
+				flag: false,
+				// 有标记点的数组日期
+				selectList: [
+					// {
+					// 	date: "2022-12-20",
+					// 	info: '打卡'
+					// },
+					// {
+					// 	date: "2022-12-21",
+					// 	info: '未打卡',
+					// 	data: {
+					// 		custom: '自定义信息',
+					// 		name: '自定义消息头'
+					// 	}
+					// }
+				],
+				// 个人考勤规则列表
+				list2: [],
+				// 分段器数组
+				items: ['团队统计', '我的统计'],
+				// 分段器默认索引
+				current: 1,
+				// 当前年份
+				year: null,
+				// 当前月份
+				month: null,
+				// 当前天数
+				day: null,
+				// 异常人员名单数组
+				errList: [],
+				// 环形图完成数量
+				progress_txt: null,
+				// 环形图总数
+				progress_total: null,
+				// 当前时间
+				nowTime: "",
+				// 打卡异常次数
+				fail_count: 0,
+				// 打卡成功次数
+				success_count: 0,
+				// 异常人员名单当前页
+				page: 1,
+				// 异常人员名单总条数
+				total: 0,
+				// 个人考勤规则列表当前页
+				page_my: 1,
+				// 个人考勤规则列表总条数
+				total_my: 0,
+				// 环形图显示隐藏控制
+				showBar: false,
+				// 当前页面的路由地址
+				pageUrl: ""
+			};
+		},
+		onLoad() {
+			this.getTime()
+		},
+		onShow() {
+			this.getPageUrl()
+			let flag = uni.getStorageSync("manager")
+			let flag2 = uni.getStorageSync("sub-administrator")
+			if (flag || flag2) {
+				this.flag = true
+			} else {
+				this.flag = false
+			}
+			if (this.flag) {
+				this.current = 0
+				this.getMonthTimes_team()
+				this.getProportion()
+				this.getErrList()
+			} else {
+				this.current = 1
+				this.getMonthTimes()
+				this.getRulesList()
+			}
+		},
+		computed: {
+			comMonth() {
+				if (this.month) {
+					let month = this.month < 10 ? '0' + this.month : this.month
+					return month
+				}
+			},
+		},
+		watch: {
+			progress_txt() {
+				this.showBar = false
+				setTimeout(() => {
+					this.showBar = true
+				}, 10)
+			},
+			progress_total() {
+				this.showBar = false
+				setTimeout(() => {
+					this.showBar = true
+				}, 10)
+			},
+		},
+		onReachBottom() {
+			if (this.current == 0) {
+				if (this.errList.length < this.total) {
+					this.page++
+					this.getErrList()
+				} else {
+					uni.showToast({
+						title: "没有更多数据了",
+						icon: 'none'
+					})
+				}
+			} else {
+				if (this.list2.length < this.total_my) {
+					this.page_my++
+					this.getRulesList()
+				} else {
+					uni.showToast({
+						title: "没有更多数据了",
+						icon: 'none'
+					})
+				}
+			}
+		},
+		methods: {
+			getPageUrl() {
+				// 获取当前打开过的页面路由数组
+				let routes = getCurrentPages();
+				// 获取当前页面路由,也就是最后一个打开的页面路由
+				let curRoute = routes[routes.length - 1].route
+				this.pageUrl = curRoute
+			},
+			handleGoPage(url) {
+				// console.log(url);
+				uni.redirectTo({
+					url
+				})
+			},
+			// 获取当前年 月 日
+			getTime() {
+				let date = new Date()
+				let year = date.getFullYear()
+				let month = date.getMonth() + 1
+				let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
+				this.year = year
+				this.month = month
+				this.day = day
+				this.nowTime = year + "-" + this.comMonth + "-" + day + " " + "00:00:00"
+			},
+
+			// 获取我的月打卡次数
+			async getMonthTimes() {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/sign/check/in/month/times",
+					data: {
+						time: this.nowTime
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.fail_count = res.data.fail
+					this.success_count = res.data.success
+				}
+			},
+
+			// 获取我的团队月打卡次数
+			async getMonthTimes_team() {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/sign/check/in/month/times/team",
+					data: {
+						time: this.nowTime
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.fail_count = res.data.fail
+					this.success_count = res.data.success
+				}
+			},
+			// 获取团队打卡每日完成占比
+			async getProportion() {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/sign/check/in/proportion",
+					data: {
+						time: this.nowTime
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.progress_txt = res.data.complete
+					this.progress_total = res.data.total
+				}
+			},
+
+			// 获取打卡异常人员名单
+			async getErrList() {
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/sign/check/in/abnormal",
+					data: {
+						time: this.nowTime,
+						page: this.page,
+						size: 9
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.total = res.data.total
+					this.errList = [...this.errList, ...res.data.list]
+				}
+			},
+
+			// 获取打卡规则列表
+			async getRulesList() {
+				let name = uni.getStorageSync("userInfo").username
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/sign/check/in/list",
+					data: {
+						name,
+						page: this.page_my,
+						updateTimeBegin: this.nowTime
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.list2 = [...this.list2, ...res.data.list]
+					this.total_my = res.data.total
+				}
+			},
+
+			// 点击日历日期回调
+			change(e) {
+				// console.log('change 返回:', e.fulldate)
+				this.nowTime = e.fulldate + " " + "00:00:00"
+				if (this.current == 0) {
+					this.getProportion()
+				} else {
+					this.list2 = []
+					this.page_my = 1
+					this.getRulesList()
+				}
+			},
+			// 分段器点击回调
+			onClickItem(e) {
+				this.fail_count = ""
+				this.success_count = ""
+				this.list2 = []
+				this.errList = []
+				// console.log(e.currentIndex);
+				this.current = e.currentIndex
+				if (e.currentIndex == 0) {
+					this.getMonthTimes_team()
+					this.getProportion()
+					this.getErrList()
+				} else {
+					this.getMonthTimes()
+					this.getRulesList()
+				}
+			},
+			// 点击通知回调
+			handleInform() {
+				uni.showModal({
+					title: '提示',
+					content: `当前列表中有 ${this.total} 位异常人员,确定需要全部通知吗?`,
+					success: (res) => {
+						if (res.confirm) {
+
+						} else if (res.cancel) {
+
+						}
+					}
+				});
+			},
+			// 点击查看明细回调
+			handleLookDetail() {
+				// console.log(this.nowTime);
+				uni.navigateTo({
+					url: `/pagesClockIn/particulars/particulars?nowTime_day=${this.nowTime}&type=1`
+				})
+			},
+
+			// 跳转统计详情页面
+			goToDetail() {
+				if (this.current == 1) {
+					uni.navigateTo({
+						url: `/pagesClockIn/statDetail/statDetail?month=${this.month}`
+					})
+				} else {
+					uni.navigateTo({
+						url: "/pagesClockIn/particulars/particulars?type=2"
+					})
+				}
+			},
+
+			// 往后选择年份回调
+			handleDoubleLeft() {
+				if (this.year <= 2000) {
+					uni.showToast({
+						title: "不能选择2000年之前",
+						icon: 'none'
+					})
+				} else {
+					this.year -= 1
+					this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
+					this.page = 1
+					this.errList = []
+					this.getErrList()
+				}
+			},
+			// 往前选择年份回调
+			handleDoubleRight() {
+				if (this.year >= 2025) {
+					uni.showToast({
+						title: "不能选择2025年之后",
+						icon: 'none'
+					})
+				} else {
+					this.year += 1
+					this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
+					this.page = 1
+					this.errList = []
+					this.getErrList()
+				}
+			},
+			// 往后选择月份回调
+			handleLeft() {
+				if (this.month <= 1) {
+					if (this.year <= 2000) {
+						uni.showToast({
+							title: "不能选择2000年之前",
+							icon: 'none'
+						})
+					} else {
+						this.year -= 1
+						this.month = 12
+						this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
+						this.page = 1
+						this.errList = []
+						this.getErrList()
+					}
+				} else {
+					this.month -= 1
+					this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
+					this.page = 1
+					this.errList = []
+					this.getErrList()
+				}
+			},
+			// 往前选择月份回调
+			handleRight() {
+				if (this.month >= 12) {
+					if (this.year >= 2025) {
+						uni.showToast({
+							title: "不能选择2025年之后",
+							icon: 'none'
+						})
+					} else {
+						this.year += 1
+						this.month = 1
+						this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
+						this.page = 1
+						this.errList = []
+						this.getErrList()
+					}
+				} else {
+					this.month += 1
+					this.nowTime = this.year + "-" + this.comMonth + "-" + this.day + " " + "00:00:00"
+					this.page = 1
+					this.errList = []
+					this.getErrList()
+				}
+			},
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				let strDate = h + m;
+				return strDate;
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+
+		.placeholder {
+			height: 20rpx;
+		}
+
+		.control {
+			margin-bottom: 20rpx;
+			width: 750rpx;
+			height: 90rpx;
+			background-color: #fff;
+		}
+
+		.header {
+			margin: 0 auto;
+			width: 710rpx;
+			height: 236rpx;
+			background-color: #fff;
+
+			.title {
+				display: flex;
+				height: 92rpx;
+
+				.month {
+					flex: 8;
+					margin: 30rpx 0 0 30rpx;
+					font-size: 32rpx;
+					font-weight: 500
+				}
+
+				.right {
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					flex: 1;
+
+					img {
+						width: 15rpx;
+						height: 30rpx
+					}
+				}
+			}
+
+			.state {
+				display: flex;
+				height: 144rpx;
+
+				.err {
+					flex: 1;
+					display: flex;
+					flex-direction: column;
+					justify-content: center;
+					align-items: center;
+
+					.number {
+						font-size: 46rpx;
+						font-weight: 700;
+					}
+
+					.mes {
+						font-size: 28rpx;
+						color: #999999;
+					}
+				}
+
+				.success {
+					flex: 1;
+					display: flex;
+					flex-direction: column;
+					justify-content: center;
+					align-items: center;
+
+					.number {
+						font-size: 46rpx;
+						font-weight: 700;
+					}
+
+					.mes {
+						font-size: 28rpx;
+						color: #999999;
+					}
+				}
+			}
+		}
+
+		.calendar {
+			margin: 0 auto;
+			margin-top: 30rpx;
+			width: 710rpx;
+			background-color: #fff;
+
+			.calendar_title {
+				padding-left: 30rpx;
+				height: 100rpx;
+				line-height: 100rpx;
+				font-size: 32rpx;
+				font-weight: 500;
+
+				span {
+					font-size: 26rpx;
+					color: #999999
+				}
+			}
+
+			.calendar_body {
+				height: 690rpx;
+			}
+
+			.calendar_foot {
+				padding: 0 30rpx;
+				padding-bottom: 180rpx;
+
+				.foot_item {
+					box-sizing: border-box;
+					padding: 30rpx;
+					display: flex;
+					flex-direction: column;
+					justify-content: space-evenly;
+					height: 130rpx;
+					font-size: 24rpx;
+					color: #808080;
+
+					.box {
+						display: flex;
+						align-items: center;
+
+						.circular {
+							margin-right: 18rpx;
+							width: 12rpx;
+							height: 12rpx;
+							border-radius: 6rpx;
+							background-color: #31C20E;
+						}
+
+						.color {
+							background-color: #999999;
+						}
+
+						span {
+							margin-left: 18rpx;
+						}
+					}
+				}
+			}
+
+			.progress {
+				position: relative;
+				display: flex;
+				justify-content: center;
+				padding: 0 30rpx;
+				height: 121px;
+
+				.chart {
+					margin-top: 20rpx;
+					width: 170px;
+					height: 100%;
+				}
+
+				.look {
+					position: absolute;
+					top: 40rpx;
+					right: 36rpx;
+					display: flex;
+					align-items: center;
+					width: 150rpx;
+					height: 42rpx;
+
+					.info {
+						margin-right: 15rpx;
+						font-size: 28rpx;
+						color: #A6A6A6;
+					}
+
+					img {
+						width: 16rpx;
+						height: 24rpx;
+					}
+				}
+			}
+		}
+
+		.errPeople {
+			margin: 0 auto;
+			margin-top: 32rpx;
+			padding-bottom: 180rpx;
+			width: 710rpx;
+			border-radius: 7rpx;
+			background-color: #fff;
+
+			.e_header {
+				display: flex;
+				align-items: center;
+				width: 690rpx;
+				height: 121rpx;
+
+				.left {
+					flex: 1;
+					margin-left: 30rpx;
+					font-size: 32rpx;
+					font-weight: 500;
+				}
+
+				.right {
+					flex: 1;
+					display: flex;
+					justify-content: flex-end;
+					align-items: center;
+					margin-right: 32rpx;
+
+					.icon {
+						margin-right: 10rpx;
+						width: 26rpx;
+						height: 26rpx;
+						line-height: 26rpx;
+
+						img {
+							width: 100%;
+							height: 100%;
+						}
+					}
+
+					.info {
+						width: 56rpx;
+						height: 41rpx;
+						font-size: 28rpx;
+						color: #2A82E4;
+					}
+				}
+			}
+
+			.e_calendar {
+				display: flex;
+				justify-content: flex-end;
+				align-items: center;
+
+				.double {
+					margin-right: 30rpx;
+					width: 40rpx;
+					height: 40rpx;
+
+					img {
+						width: 100%;
+						height: 100%;
+					}
+				}
+
+				.single {
+					width: 40rpx;
+					height: 40rpx;
+
+					img {
+						width: 80%;
+						height: 70%;
+					}
+				}
+
+				.single2 {
+					margin-right: 30rpx;
+					width: 40rpx;
+					height: 40rpx;
+
+					img {
+						width: 100%;
+						height: 70%;
+					}
+				}
+
+				.time {
+					width: 180rpx;
+					height: 44rpx;
+					font-size: 32rpx;
+					text-align: center;
+				}
+			}
+
+			.e_list {
+				display: flex;
+				flex-wrap: wrap;
+				justify-content: space-evenly;
+				align-items: center;
+				margin-top: 20rpx;
+				padding: 30rpx;
+				width: 630rpx;
+
+				.e_box {
+					display: flex;
+					flex-direction: column;
+					justify-content: space-evenly;
+					align-items: center;
+					margin-bottom: 20rpx;
+					width: 180rpx;
+					height: 190rpx;
+
+					.e_img {
+						width: 100rpx;
+						height: 100rpx;
+
+						img {
+							width: 100%;
+							height: 100%;
+							border-radius: 50%;
+						}
+					}
+
+					.e_name {
+						font-size: 28rpx;
+					}
+
+					.e_msg {
+						font-size: 24rpx;
+						color: #808080;
+					}
+				}
+			}
+
+			.e_list2 {
+				margin: 0 auto;
+				padding: 180rpx 0;
+				text-align: center;
+
+				img {
+					width: 480rpx;
+					height: 508rpx;
+				}
+
+				.info {
+					padding-bottom: 50rpx;
+					color: #5792F0;
+				}
+			}
+		}
+
+		.tab_bar {
+			position: fixed;
+			left: 0;
+			bottom: 0;
+			display: flex;
+			width: 750rpx;
+			height: 128rpx;
+			border-top: 1rpx solid #CCC;
+			background-color: #fff;
+
+			.tab_box {
+				flex: 1;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+
+				.tab_img {
+					width: 54rpx;
+					height: 48rpx;
+					margin-bottom: 10rpx;
+				}
+
+				.tab_title {
+					font-size: 20rpx;
+				}
+
+				.tab_title_active {
+					font-size: 20rpx;
+					color: #0082FC;
+				}
+			}
+		}
+	}
+
+	// 修改选中日期盒子圆角
+	::v-deep .uni-calendar-item--isDay {
+		border-radius: 50rpx;
+	}
+
+	::v-deep .uni-calendar-item--checked {
+		border-radius: 50rpx;
+	}
+</style>

+ 502 - 0
pagesClockIn/statDetail/statDetail.vue

@@ -0,0 +1,502 @@
+<template>
+	<view class="container">
+		<view class="placeholder"></view>
+		<!-- 头部区域 -->
+		<view class="header">
+			<!-- 时间区域 -->
+			<view class="calendar">
+				<!-- 双左箭头区域 -->
+				<view class="double" @click="handleDoubleLeft">
+					<img src="../static/imgs/double_left.png">
+				</view>
+				<!-- 左箭头区域区域 -->
+				<view class="single" @click="handleLeft">
+					<img src="../static/imgs/left.png">
+				</view>
+				<!-- 时间区域 -->
+				<view class="time">
+					{{year}}-{{format_month}}
+				</view>
+				<!-- 双右箭头区域 -->
+				<view class="single2" @click="handleRight">
+					<img src="../static/imgs/right2.png">
+				</view>
+				<!-- 右箭头区域 -->
+				<view class="double" @click="handleDoubleRight">
+					<img src="../static/imgs/double_right.png">
+				</view>
+
+			</view>
+
+			<!-- 打卡状态切换区域 -->
+			<view class="state">
+				<uni-segmented-control :current="current" :values="items" styleType="text" @clickItem="onClickItem"
+					activeColor="#0082FC"></uni-segmented-control>
+			</view>
+		</view>
+
+		<!-- 打卡记录区域 -->
+		<view class="list" v-if="list.length">
+			<!-- 每一条记录区域 -->
+			<view class="box" v-for="(item,index) in list" :key="index">
+				<!-- 人物信息区域 -->
+				<view class="person">
+					<view class="img">
+						<img :src="item.headImage||'../static/imgs/headImage.png'">
+					</view>
+					<view class="info">
+						<view class="name">
+							{{item.name}}
+						</view>
+						<view class="college">
+							{{item.college?item.college:"南昌交通学院"}}
+						</view>
+					</view>
+				</view>
+				<!-- 图片区域 -->
+				<view class="imgs" v-if="item.status==4">
+					<view class="imgs_item">
+						<view class="image">
+							<img :src="item.faceImage||'../static/imgs/headImage.png'">
+						</view>
+						<view class="title">
+							匹对照片
+						</view>
+					</view>
+
+					<view class="imgs_item">
+						<view class="image">
+							<img :src="item.matchFaceImage||'../static/imgs/headImage.png'">
+						</view>
+						<view class="title">
+							被匹对照片
+						</view>
+					</view>
+					<view class="imgs_item">
+						<view class="image">
+							<img :src="item.sceneImage||'../static/imgs/headImage.png'">
+						</view>
+						<view class="title">
+							场景照片
+						</view>
+					</view>
+
+				</view>
+				<!-- 打卡信息区域 -->
+				<view class="msg">
+					<view class="msg_item">
+						<view class="key">
+							打卡状态:
+						</view>
+						<view class="value">
+							{{item.status==4?"打卡成功":"打卡失败"}}
+						</view>
+					</view>
+					<view class="msg_item">
+						<view class="key">
+							打卡规则:
+						</view>
+						<view class="value">
+							{{item.ruleName}}
+						</view>
+					</view>
+					<view class="msg_item" v-if="item.status==4">
+						<view class="key">
+							打卡时间:
+						</view>
+						<view class="value">
+							{{format_time(item.updateTime)}}
+						</view>
+					</view>
+					<view class="msg_item" v-if="item.status==4">
+						<view class="key">
+							打卡地址:
+						</view>
+						<view class="value">
+							{{item.location}}
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 暂无数据显示区域 -->
+		<view class="no_data" v-if="list.length==0">
+			<img src="../static/imgs/nodata.png">
+			<view class="info">
+				暂无数据
+			</view>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 当前年份
+				year: null,
+				// 当前月份
+				month: null,
+				// 分段器选项
+				items: ['打卡成功', '打卡失败'],
+				// 当前所在分段器索引
+				current: 0,
+				// 第几页
+				page: 1,
+				// 数据总条数
+				total: 0,
+				// 打卡状态参数
+				status: 4,
+				// 打卡时间参数
+				time: null,
+				// 列表数组
+				list: [],
+			};
+		},
+		onLoad() {
+			this.getTime()
+			this.getListData()
+		},
+		// 页面滑动到底部触发的回调
+		onReachBottom() {
+			if (this.list.length < this.total) {
+				this.page++
+				this.getListData()
+			} else {
+				uni.showToast({
+					title: "没有更多数据了",
+					icon: 'none'
+				})
+			}
+		},
+		computed: {
+			format_month() {
+				if (this.month) {
+					let month = this.month < 10 ? '0' + this.month : this.month
+					return month
+				}
+			}
+		},
+		methods: {
+			// 获取当前年份
+			getTime() {
+				let date = new Date()
+				let year = date.getFullYear()
+				let month = date.getMonth() + 1
+				this.month = month
+				this.year = year
+			},
+
+			// 获取打卡记录列表数组
+			async getListData() {
+				this.time = this.year + "-" + this.format_month + "-01 00:00:00"
+				let res = await this.$myRequest_clockIn({
+					url: "/attendance/api/sign/check/in/list/month",
+					data: {
+						page: this.page,
+						status: this.status,
+						time: this.time
+					}
+				})
+				// console.log(res);
+				if (res.code == 200) {
+					this.total = res.data.total
+					this.list = [...this.list, ...res.data.list]
+					if (this.status == 4) {
+						this.items[0] = `打卡成功(${this.total}次)`
+						this.items[1] = `打卡失败`
+					} else {
+						this.items[0] = `打卡成功`
+						this.items[1] = `打卡失败(${this.total}次)`
+					}
+				}
+			},
+
+			// 点击分段器回调
+			onClickItem(e) {
+				this.list = []
+				// console.log(e.currentIndex);
+				if (e.currentIndex == 0) {
+					this.status = 4
+				} else {
+					this.status = 3
+				}
+				this.page = 1
+				this.getListData()
+			},
+
+			// 往后选择年份回调
+			handleDoubleLeft() {
+				if (this.year <= 2000) {
+					uni.showToast({
+						title: "不能选择2000年之前",
+						icon: 'none'
+					})
+				} else {
+					this.list = []
+					this.year -= 1
+					this.page = 1
+					this.getListData()
+				}
+			},
+			// 往前选择年份回调
+			handleDoubleRight() {
+				if (this.year >= 2025) {
+					uni.showToast({
+						title: "不能选择2025年之后",
+						icon: 'none'
+					})
+				} else {
+					this.list = []
+					this.year += 1
+					this.page = 1
+					this.getListData()
+				}
+			},
+			// 往后选择月份回调
+			handleLeft() {
+				if (this.month <= 1) {
+					if (this.year <= 2000) {
+						uni.showToast({
+							title: "不能选择2000年之前",
+							icon: 'none'
+						})
+					} else {
+						this.list = []
+						this.year -= 1
+						this.month = 12
+						this.page = 1
+						this.getListData()
+					}
+				} else {
+					this.list = []
+					this.month -= 1
+					this.page = 1
+					this.getListData()
+				}
+			},
+
+			// 往前选择月份回调
+			handleRight() {
+				if (this.month >= 12) {
+					if (this.year >= 2025) {
+						uni.showToast({
+							title: "不能选择2025年之后",
+							icon: 'none'
+						})
+					} else {
+						this.list = []
+						this.year += 1
+						this.month = 1
+						this.page = 1
+						this.getListData()
+					}
+				} else {
+					this.list = []
+					this.month += 1
+					this.page = 1
+					this.getListData()
+				}
+			},
+
+
+			// 格式化时间
+			format_time(timestamp) {
+				//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+				var date = new Date(timestamp);
+				var y = date.getFullYear();
+				var m = date.getMonth() + 1;
+				var d = date.getDate();
+				m = m < 10 ? "0" + m : m;
+				d = d < 10 ? "0" + d : d;
+				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
+				var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+				var s = date.getSeconds()
+				s = s < 10 ? "0" + s : s;
+				let strDate = y + "-" + m + "-" + d + " " + h + ":" + mm + ":" + s;
+				return strDate;
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		min-width: 100vw;
+		min-height: 100vh;
+		background-color: #F2F2F2;
+
+		.placeholder {
+			height: 20rpx;
+		}
+
+		.header {
+			display: flex;
+			flex-direction: column;
+			justify-content: space-evenly;
+			margin: 0 auto;
+			width: 690rpx;
+			height: 192rpx;
+			background-color: #fff;
+
+			.calendar {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				flex: 1;
+
+				.double {
+					width: 40rpx;
+					height: 40rpx;
+
+					img {
+						width: 100%;
+						height: 100%;
+					}
+				}
+
+				.single {
+					margin-left: 30rpx;
+					width: 40rpx;
+					height: 40rpx;
+
+					img {
+						width: 80%;
+						height: 70%;
+					}
+				}
+
+				.single2 {
+					margin-right: 30rpx;
+					width: 40rpx;
+					height: 40rpx;
+
+					img {
+						width: 100%;
+						height: 70%;
+					}
+				}
+
+				.time {
+					width: 180rpx;
+					height: 44rpx;
+					font-size: 32rpx;
+					text-align: center;
+				}
+			}
+
+			.state {
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				flex: 1;
+			}
+		}
+
+		.list {
+			padding-bottom: 50rpx;
+
+			.box {
+				margin: 0 auto;
+				margin-top: 20rpx;
+				width: 690rpx;
+				background-color: #fff;
+
+				.person {
+					display: flex;
+					align-items: center;
+					height: 134rpx;
+
+					.img {
+						margin: 0 20rpx 0 30rpx;
+						width: 70rpx;
+						height: 70rpx;
+
+						img {
+							width: 100%;
+							height: 100%;
+						}
+					}
+
+					.info {
+						width: 620rpx;
+						height: 70rpx;
+
+						.name {
+							font-size: 32rpx;
+						}
+
+						.college {
+							font-size: 24rpx;
+							color: #A6A6A6;
+						}
+					}
+				}
+
+				.imgs {
+					display: flex;
+					justify-content: space-evenly;
+					height: 201rpx;
+
+					.imgs_item {
+						display: flex;
+						flex-direction: column;
+						align-items: center;
+						flex: 1;
+
+						.image {
+							width: 120rpx;
+							height: 120rpx;
+
+							img {
+								width: 100%;
+								height: 100%;
+							}
+						}
+
+						.title {
+							margin-top: 10rpx;
+							font-size: 28rpx;
+						}
+					}
+				}
+
+				.msg {
+					margin-left: 30rpx;
+
+					.msg_item {
+						display: flex;
+						align-items: center;
+						height: 63rpx;
+						font-size: 28rpx;
+
+						.key {
+							color: #808080;
+						}
+
+						.value {}
+					}
+				}
+			}
+		}
+
+		.no_data {
+			margin: 0 auto;
+			margin-top: 230rpx;
+			width: 480rpx;
+			height: 508rpx;
+			text-align: center;
+
+			img {
+				width: 100%;
+				height: 100%;
+			}
+
+			.info {
+				color: #5792F0;
+			}
+		}
+	}
+</style>

BIN
pagesClockIn/static/imgs/404.png


BIN
pagesClockIn/static/imgs/add.png


BIN
pagesClockIn/static/imgs/ceshi.jpg


BIN
pagesClockIn/static/imgs/close.png


+ 20 - 0
pagesClockIn/static/imgs/customicons.css

@@ -0,0 +1,20 @@
+@font-face {
+  font-family: "customicons"; /* Project id 2878519 */
+  src:url('/static/customicons.ttf') format('truetype');
+}
+
+.customicons {
+  font-family: "customicons" !important;
+}
+
+.youxi:before {
+  content: "\e60e";
+}
+
+.wenjian:before {
+  content: "\e60f";
+}
+
+.zhuanfa:before {
+  content: "\e610";
+}

BIN
pagesClockIn/static/imgs/customicons.ttf


BIN
pagesClockIn/static/imgs/double_left.png


BIN
pagesClockIn/static/imgs/double_right.png


BIN
pagesClockIn/static/imgs/headImage.png


BIN
pagesClockIn/static/imgs/home.png


BIN
pagesClockIn/static/imgs/home_active.png


BIN
pagesClockIn/static/imgs/left.png


BIN
pagesClockIn/static/imgs/location.png


BIN
pagesClockIn/static/imgs/location2.png


BIN
pagesClockIn/static/imgs/my.png


BIN
pagesClockIn/static/imgs/my1.png


BIN
pagesClockIn/static/imgs/my2.png


BIN
pagesClockIn/static/imgs/my3.png


BIN
pagesClockIn/static/imgs/my4.png


BIN
pagesClockIn/static/imgs/my_active.png


BIN
pagesClockIn/static/imgs/noPower.png


BIN
pagesClockIn/static/imgs/nodata.png


BIN
pagesClockIn/static/imgs/notice.png


BIN
pagesClockIn/static/imgs/right.png


BIN
pagesClockIn/static/imgs/right2.png


BIN
pagesClockIn/static/imgs/stat.png


BIN
pagesClockIn/static/imgs/stat_active.png


BIN
pagesClockIn/static/imgs/time.png


+ 88 - 0
pagesClockIn/util/api.js

@@ -0,0 +1,88 @@
+// 线上地址
+// const BASE_URL = "https://chtech.ncjti.edu.cn/jiaofei/jiaofei-api/tuitionpayment"
+// 本地地址
+const BASE_URL = "https://www.web-server.top"
+export const myRequest_clockIn = (options) => {
+	uni.showLoading({
+		title: "加载中",
+		mask: true,
+	});
+	return new Promise((resolve, reject) => {
+		uni.request({
+			url: BASE_URL + options.url,
+			method: options.method || "GET",
+			data: options.data || {},
+			header: options.header || {
+				'content-type': 'application/x-www-form-urlencoded',
+				'Authorization': uni.getStorageSync("token")
+			},
+			success: (res) => {
+				uni.hideLoading();
+				resolve(res.data)
+				if (res.data.code != 200) {
+					if (res.data.code == 498) {
+						uni.request({
+							url: 'https://www.web-server.top/attendance/api/home/permissions',
+							header: {
+								'content-type': 'application/x-www-form-urlencoded',
+								'Authorization': uni.getStorageSync("token")
+							},
+							success: (res) => {
+								if (res.data.code == 200) {
+									uni.removeStorageSync("manager")
+									uni.removeStorageSync("sub-administrator")
+									uni.showModal({
+										title: "提示",
+										content: "用户权限变更,请重新授权",
+										showCancel: false,
+										success: function(res) {
+											if (res.confirm) {
+												uni.reLaunch({
+													url: "/pagesClockIn/home/home",
+												});
+											}
+										},
+									});
+								} else {
+									uni.showToast({
+										title: res.data.message,
+										icon: "error",
+										mask: true,
+									});
+								}
+							}
+						});
+					} else if (res.data.code == 401 || res.data.code == 499) {
+						uni.showModal({
+							title: "提示",
+							content: res.data.message,
+							showCancel: false,
+							success: function(res) {
+								if (res.confirm) {
+									uni.reLaunch({
+										url: "/pagesClockIn/index/index",
+									});
+								}
+							},
+						});
+					} else {
+						uni.showToast({
+							title: res.data.message,
+							icon: "error",
+							mask: true,
+						});
+					}
+				}
+			},
+			fail: (err) => {
+				uni.hideLoading();
+				uni.showToast({
+					title: "请求数据失败",
+					icon: "none",
+					mask: true
+				})
+				reject(err)
+			}
+		})
+	})
+}

+ 741 - 0
pagesClockIn/util/qqmap-wx-jssdk1.1/qqmap-wx-jssdk.js

@@ -0,0 +1,741 @@
+/**
+ * 微信小程序JavaScriptSDK
+ * 
+ * @version 1.1
+ * @date 2019-01-20
+ */
+
+var ERROR_CONF = {
+    KEY_ERR: 311,
+    KEY_ERR_MSG: 'key格式错误',
+    PARAM_ERR: 310,
+    PARAM_ERR_MSG: '请求参数信息有误',
+    SYSTEM_ERR: 600,
+    SYSTEM_ERR_MSG: '系统错误',
+    WX_ERR_CODE: 1000,
+    WX_OK_CODE: 200
+};
+var BASE_URL = 'https://apis.map.qq.com/ws/';
+var URL_SEARCH = BASE_URL + 'place/v1/search';
+var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion';
+var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/';
+var URL_CITY_LIST = BASE_URL + 'district/v1/list';
+var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren';
+var URL_DISTANCE = BASE_URL + 'distance/v1/';
+var EARTH_RADIUS = 6378136.49;
+var Utils = {
+    /**
+     * 得到终点query字符串
+     * @param {Array|String} 检索数据
+     */
+    location2query(data) {
+        if (typeof data == 'string') {
+            return data;
+        }
+        var query = '';
+        for (var i = 0; i < data.length; i++) {
+            var d = data[i];
+            if (!!query) {
+                query += ';';
+            }
+            if (d.location) {
+                query = query + d.location.lat + ',' + d.location.lng;
+            }
+            if (d.latitude && d.longitude) {
+                query = query + d.latitude + ',' + d.longitude;
+            }
+        }
+        return query;
+    },
+
+    /**
+     * 计算角度
+     */
+    rad(d) {
+      return d * Math.PI / 180.0;
+    },  
+    /**
+     * 处理终点location数组
+     * @return 返回终点数组
+     */
+    getEndLocation(location){
+      var to = location.split(';');
+      var endLocation = [];
+      for (var i = 0; i < to.length; i++) {
+        endLocation.push({
+          lat: parseFloat(to[i].split(',')[0]),
+          lng: parseFloat(to[i].split(',')[1])
+        })
+      }
+      return endLocation;
+    },
+
+    /**
+     * 计算两点间直线距离
+     * @param a 表示纬度差
+     * @param b 表示经度差
+     * @return 返回的是距离,单位m
+     */
+    getDistance(latFrom, lngFrom, latTo, lngTo) {
+      var radLatFrom = this.rad(latFrom);
+      var radLatTo = this.rad(latTo);
+      var a = radLatFrom - radLatTo;
+      var b = this.rad(lngFrom) - this.rad(lngTo);
+      var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2)));
+      distance = distance * EARTH_RADIUS;
+      distance = Math.round(distance * 10000) / 10000;
+      return parseFloat(distance.toFixed(0));
+    },
+    /**
+     * 使用微信接口进行定位
+     */
+    getWXLocation(success, fail, complete) {
+        wx.getLocation({
+            type: 'gcj02',
+            success: success,
+            fail: fail,
+            complete: complete
+        });
+    },
+
+    /**
+     * 获取location参数
+     */
+    getLocationParam(location) {
+        if (typeof location == 'string') {
+            var locationArr = location.split(',');
+            if (locationArr.length === 2) {
+                location = {
+                    latitude: location.split(',')[0],
+                    longitude: location.split(',')[1]
+                };
+            } else {
+                location = {};
+            }
+        }
+        return location;
+    },
+
+    /**
+     * 回调函数默认处理
+     */
+    polyfillParam(param) {
+        param.success = param.success || function () { };
+        param.fail = param.fail || function () { };
+        param.complete = param.complete || function () { };
+    },
+
+    /**
+     * 验证param对应的key值是否为空
+     * 
+     * @param {Object} param 接口参数
+     * @param {String} key 对应参数的key
+     */
+    checkParamKeyEmpty(param, key) {
+        if (!param[key]) {
+            var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误');
+            param.fail(errconf);
+            param.complete(errconf);
+            return true;
+        }
+        return false;
+    },
+
+    /**
+     * 验证参数中是否存在检索词keyword
+     * 
+     * @param {Object} param 接口参数
+     */
+    checkKeyword(param){
+        return !this.checkParamKeyEmpty(param, 'keyword');
+    },
+
+    /**
+     * 验证location值
+     * 
+     * @param {Object} param 接口参数
+     */
+    checkLocation(param) {
+        var location = this.getLocationParam(param.location);
+        if (!location || !location.latitude || !location.longitude) {
+            var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误');
+            param.fail(errconf);
+            param.complete(errconf);
+            return false;
+        }
+        return true;
+    },
+
+    /**
+     * 构造错误数据结构
+     * @param {Number} errCode 错误码
+     * @param {Number} errMsg 错误描述
+     */
+    buildErrorConfig(errCode, errMsg) {
+        return {
+            status: errCode,
+            message: errMsg
+        };
+    },
+
+    /**
+     * 
+     * 数据处理函数
+     * 根据传入参数不同处理不同数据
+     * @param {String} feature 功能名称
+     * search 地点搜索
+     * suggest关键词提示
+     * reverseGeocoder逆地址解析
+     * geocoder地址解析
+     * getCityList获取城市列表:父集
+     * getDistrictByCityId获取区县列表:子集
+     * calculateDistance距离计算
+     * @param {Object} param 接口参数
+     * @param {Object} data 数据
+     */
+    handleData(param,data,feature){
+      if (feature === 'search') {
+        var searchResult = data.data;
+        var searchSimplify = [];
+        for (var i = 0; i < searchResult.length; i++) {
+          searchSimplify.push({
+            id: searchResult[i].id || null,
+            title: searchResult[i].title || null,
+            latitude: searchResult[i].location && searchResult[i].location.lat || null,
+            longitude: searchResult[i].location && searchResult[i].location.lng || null,
+            address: searchResult[i].address || null,
+            category: searchResult[i].category || null,
+            tel: searchResult[i].tel || null,
+            adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null,
+            city: searchResult[i].ad_info && searchResult[i].ad_info.city || null,
+            district: searchResult[i].ad_info && searchResult[i].ad_info.district || null,
+            province: searchResult[i].ad_info && searchResult[i].ad_info.province || null
+          })
+        }
+        param.success(data, {
+          searchResult: searchResult,
+          searchSimplify: searchSimplify
+        })
+      } else if (feature === 'suggest') {
+        var suggestResult = data.data;
+        var suggestSimplify = [];
+        for (var i = 0; i < suggestResult.length; i++) {
+          suggestSimplify.push({
+            adcode: suggestResult[i].adcode || null,
+            address: suggestResult[i].address || null,
+            category: suggestResult[i].category || null,
+            city: suggestResult[i].city || null,
+            district: suggestResult[i].district || null,
+            id: suggestResult[i].id || null,
+            latitude: suggestResult[i].location && suggestResult[i].location.lat || null,
+            longitude: suggestResult[i].location && suggestResult[i].location.lng || null,
+            province: suggestResult[i].province || null,
+            title: suggestResult[i].title || null,
+            type: suggestResult[i].type || null
+          })
+        }
+        param.success(data, {
+          suggestResult: suggestResult,
+          suggestSimplify: suggestSimplify
+          })
+      } else if (feature === 'reverseGeocoder') {
+        var reverseGeocoderResult = data.result;
+        var reverseGeocoderSimplify = {
+          address: reverseGeocoderResult.address || null,
+          latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null,
+          longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null,
+          adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null,
+          city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null,
+          district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null,
+          nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null,
+          province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null,
+          street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null,
+          street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null,
+          recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null,
+          rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null
+        };
+        if (reverseGeocoderResult.pois) {//判断是否返回周边poi
+          var pois = reverseGeocoderResult.pois;
+          var poisSimplify = [];
+          for (var i = 0;i < pois.length;i++) {
+            poisSimplify.push({
+              id: pois[i].id || null,
+              title: pois[i].title || null,
+              latitude: pois[i].location && pois[i].location.lat || null,
+              longitude: pois[i].location && pois[i].location.lng || null,
+              address: pois[i].address || null,
+              category: pois[i].category || null,
+              adcode: pois[i].ad_info && pois[i].ad_info.adcode || null,
+              city: pois[i].ad_info && pois[i].ad_info.city || null,
+              district: pois[i].ad_info && pois[i].ad_info.district || null,
+              province: pois[i].ad_info && pois[i].ad_info.province || null
+            })
+          }
+          param.success(data,{
+            reverseGeocoderResult: reverseGeocoderResult,
+            reverseGeocoderSimplify: reverseGeocoderSimplify,
+            pois: pois,
+            poisSimplify: poisSimplify
+          })
+        } else {
+          param.success(data, {
+            reverseGeocoderResult: reverseGeocoderResult,
+            reverseGeocoderSimplify: reverseGeocoderSimplify
+          })
+        }
+      } else if (feature === 'geocoder') {
+        var geocoderResult = data.result;
+        var geocoderSimplify = {
+          title: geocoderResult.title || null,
+          latitude: geocoderResult.location && geocoderResult.location.lat || null,
+          longitude: geocoderResult.location && geocoderResult.location.lng || null,
+          adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null,
+          province: geocoderResult.address_components && geocoderResult.address_components.province || null,
+          city: geocoderResult.address_components && geocoderResult.address_components.city || null,
+          district: geocoderResult.address_components && geocoderResult.address_components.district || null,
+          street: geocoderResult.address_components && geocoderResult.address_components.street || null,
+          street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null,
+          level: geocoderResult.level || null
+        };
+        param.success(data,{
+          geocoderResult: geocoderResult,
+          geocoderSimplify: geocoderSimplify
+        });
+      } else if (feature === 'getCityList') {
+        var provinceResult = data.result[0];
+        var cityResult = data.result[1];
+        var districtResult = data.result[2];
+        param.success(data,{
+          provinceResult: provinceResult,
+          cityResult: cityResult,
+          districtResult: districtResult
+        });
+      } else if (feature === 'getDistrictByCityId') {
+        var districtByCity = data.result[0];
+        param.success(data, districtByCity);
+      } else if (feature === 'calculateDistance') {
+        var calculateDistanceResult = data.result.elements;  
+        var distance = [];
+        for (var i = 0; i < calculateDistanceResult.length; i++){
+          distance.push(calculateDistanceResult[i].distance);
+        }   
+        param.success(data, {
+          calculateDistanceResult: calculateDistanceResult,
+          distance: distance
+          });
+      } else {
+        param.success(data);
+      }
+    },
+
+    /**
+     * 构造微信请求参数,公共属性处理
+     * 
+     * @param {Object} param 接口参数
+     * @param {Object} param 配置项
+     * @param {String} feature 方法名
+     */
+    buildWxRequestConfig(param, options, feature) {
+        var that = this;
+        options.header = { "content-type": "application/json" };
+        options.method = 'GET';
+        options.success = function (res) {
+            var data = res.data;
+            if (data.status === 0) {
+              that.handleData(param, data, feature);
+            } else {
+                param.fail(data);
+            }
+        };
+        options.fail = function (res) {
+            res.statusCode = ERROR_CONF.WX_ERR_CODE;
+            param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+        };
+        options.complete = function (res) {
+            var statusCode = +res.statusCode;
+            switch(statusCode) {
+                case ERROR_CONF.WX_ERR_CODE: {
+                    param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+                    break;
+                }
+                case ERROR_CONF.WX_OK_CODE: {
+                    var data = res.data;
+                    if (data.status === 0) {
+                        param.complete(data);
+                    } else {
+                        param.complete(that.buildErrorConfig(data.status, data.message));
+                    }
+                    break;
+                }
+                default:{
+                    param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG));
+                }
+
+            }
+        };
+        return options;
+    },
+
+    /**
+     * 处理用户参数是否传入坐标进行不同的处理
+     */
+    locationProcess(param, locationsuccess, locationfail, locationcomplete) {
+        var that = this;
+        locationfail = locationfail || function (res) {
+            res.statusCode = ERROR_CONF.WX_ERR_CODE;
+            param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+        };
+        locationcomplete = locationcomplete || function (res) {
+            if (res.statusCode == ERROR_CONF.WX_ERR_CODE) {
+                param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+            }
+        };
+        if (!param.location) {
+            that.getWXLocation(locationsuccess, locationfail, locationcomplete);
+        } else if (that.checkLocation(param)) {
+            var location = Utils.getLocationParam(param.location);
+            locationsuccess(location);
+        }
+    }
+};
+
+
+class QQMapWX {
+
+    /**
+     * 构造函数
+     * 
+     * @param {Object} options 接口参数,key 为必选参数
+     */
+    constructor(options) {
+        if (!options.key) {
+            throw Error('key值不能为空');
+        }
+        this.key = options.key;
+    };
+
+    /**
+     * POI周边检索
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 参数对象结构可以参考
+     * @see http://lbs.qq.com/webservice_v1/guide-search.html
+     */
+    search(options) {
+        var that = this;
+        options = options || {};
+
+        Utils.polyfillParam(options);
+
+        if (!Utils.checkKeyword(options)) {
+            return;
+        }
+
+        var requestParam = {
+            keyword: options.keyword,
+            orderby: options.orderby || '_distance',
+            page_size: options.page_size || 10,
+            page_index: options.page_index || 1,
+            output: 'json',
+            key: that.key
+        };
+
+        if (options.address_format) {
+            requestParam.address_format = options.address_format;
+        }
+
+        if (options.filter) {
+            requestParam.filter = options.filter;
+        }
+
+        var distance = options.distance || "1000";
+        var auto_extend = options.auto_extend || 1;
+        var region = null;
+        var rectangle = null;
+
+        //判断城市限定参数
+        if (options.region) {
+          region = options.region;
+        }
+
+        //矩形限定坐标(暂时只支持字符串格式)
+        if (options.rectangle) {
+          rectangle = options.rectangle;
+        }
+
+        var locationsuccess = function (result) {        
+          if (region && !rectangle) {
+            //城市限定参数拼接
+            requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")";
+          } else if (rectangle && !region) {
+            //矩形搜索
+            requestParam.boundary = "rectangle(" + rectangle + ")";
+            } else {
+              requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")";
+            }            
+            wx.request(Utils.buildWxRequestConfig(options, {
+                url: URL_SEARCH,
+                data: requestParam
+            }, 'search'));
+        };
+        Utils.locationProcess(options, locationsuccess);
+    };
+
+    /**
+     * sug模糊检索
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 参数对象结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-suggestion.html
+     */
+    getSuggestion(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (!Utils.checkKeyword(options)) {
+            return;
+        }
+
+        var requestParam = {
+            keyword: options.keyword,
+            region: options.region || '全国',
+            region_fix: options.region_fix || 0,
+            policy: options.policy || 0,
+            page_size: options.page_size || 10,//控制显示条数
+            page_index: options.page_index || 1,//控制页数
+            get_subpois : options.get_subpois || 0,//返回子地点
+            output: 'json',
+            key: that.key
+        };
+        //长地址
+        if (options.address_format) {
+          requestParam.address_format = options.address_format;
+        }
+        //过滤
+        if (options.filter) {
+          requestParam.filter = options.filter;
+        }
+        //排序
+        if (options.location) {
+          var locationsuccess = function (result) {
+            requestParam.location = result.latitude + ',' + result.longitude;
+            wx.request(Utils.buildWxRequestConfig(options, {
+              url: URL_SUGGESTION,
+              data: requestParam
+            }, "suggest"));      
+          };
+          Utils.locationProcess(options, locationsuccess);
+        } else {
+          wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_SUGGESTION,
+            data: requestParam
+          }, "suggest"));      
+        } 
+    };
+
+    /**
+     * 逆地址解析
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-gcoder.html
+     */
+    reverseGeocoder(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+        var requestParam = {
+            coord_type: options.coord_type || 5,
+            get_poi: options.get_poi || 0,
+            output: 'json',
+            key: that.key
+        };
+        if (options.poi_options) {
+            requestParam.poi_options = options.poi_options
+        }
+
+        var locationsuccess = function (result) {
+            requestParam.location = result.latitude + ',' + result.longitude;
+            wx.request(Utils.buildWxRequestConfig(options, {
+                url: URL_GET_GEOCODER,
+                data: requestParam
+            }, 'reverseGeocoder'));
+        };
+        Utils.locationProcess(options, locationsuccess);
+    };
+
+    /**
+     * 地址解析
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-geocoder.html
+     */
+    geocoder(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (Utils.checkParamKeyEmpty(options, 'address')) {
+            return;
+        }
+
+        var requestParam = {
+            address: options.address,
+            output: 'json',
+            key: that.key
+        };
+
+        //城市限定
+        if (options.region) {
+          requestParam.region = options.region;
+        }
+
+        wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_GET_GEOCODER,
+            data: requestParam
+        },'geocoder'));
+    };
+
+
+    /**
+     * 获取城市列表
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-region.html
+     */
+    getCityList(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+        var requestParam = {
+            output: 'json',
+            key: that.key
+        };
+
+        wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_CITY_LIST,
+            data: requestParam
+        },'getCityList'));
+    };
+
+    /**
+     * 获取对应城市ID的区县列表
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-region.html
+     */
+    getDistrictByCityId(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (Utils.checkParamKeyEmpty(options, 'id')) {
+            return;
+        }
+
+        var requestParam = {
+            id: options.id || '',
+            output: 'json',
+            key: that.key
+        };
+
+        wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_AREA_LIST,
+            data: requestParam
+        },'getDistrictByCityId'));
+    };
+
+    /**
+     * 用于单起点到多终点的路线距离(非直线距离)计算:
+     * 支持两种距离计算方式:步行和驾车。
+     * 起点到终点最大限制直线距离10公里。
+     *
+     * 新增直线距离计算。
+     * 
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-distance.html
+     */
+    calculateDistance(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (Utils.checkParamKeyEmpty(options, 'to')) {
+            return;
+        }
+
+        var requestParam = {
+            mode: options.mode || 'walking',
+            to: Utils.location2query(options.to),
+            output: 'json',
+            key: that.key
+        };
+
+        if (options.from) {
+          options.location = options.from;
+        }
+
+        //计算直线距离
+        if(requestParam.mode == 'straight'){        
+          var locationsuccess = function (result) {
+            var locationTo = Utils.getEndLocation(requestParam.to);//处理终点坐标
+            var data = {
+              message:"query ok",
+              result:{
+                elements:[]
+              },
+              status:0
+            };
+            for (var i = 0; i < locationTo.length; i++) {
+              data.result.elements.push({//将坐标存入
+                distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng),
+                duration:0,
+                from:{
+                  lat: result.latitude,
+                  lng:result.longitude
+                },
+                to:{
+                  lat: locationTo[i].lat,
+                  lng: locationTo[i].lng
+                }
+              });            
+            }
+            var calculateResult = data.result.elements;
+            var distanceResult = [];
+            for (var i = 0; i < calculateResult.length; i++) {
+              distanceResult.push(calculateResult[i].distance);
+            }  
+            return options.success(data,{
+              calculateResult: calculateResult,
+              distanceResult: distanceResult
+            });
+          };
+          
+          Utils.locationProcess(options, locationsuccess);
+        } else {
+          var locationsuccess = function (result) {
+            requestParam.from = result.latitude + ',' + result.longitude;
+            wx.request(Utils.buildWxRequestConfig(options, {
+              url: URL_DISTANCE,
+              data: requestParam
+            },'calculateDistance'));
+          };
+
+          Utils.locationProcess(options, locationsuccess);
+        }      
+    }
+};
+
+module.exports = QQMapWX;

Fichier diff supprimé car celui-ci est trop grand
+ 3 - 0
pagesClockIn/util/qqmap-wx-jssdk1.1/qqmap-wx-jssdk.min.js


BIN
static/images/clockIn.png


+ 11 - 0
uni_modules/jlk-week/changelog.md

@@ -0,0 +1,11 @@
+## 1.0.4(2022-08-08)
+增加国际化
+## 1.0.3(2022-08-08)
+修改样式名称,防止与其他样式冲突;
+增加标题及自定义标题样式;
+## 1.0.2(2022-08-05)
+自定义圆角,大小,颜色 ,背景色;禁用功能;禁选某个选项功能;垂直排列;
+## 1.0.1(2022-08-05)
+使用HBuildX工具创建uni_modules插件,init
+## 1.0.0(2022-08-04)
+- init

+ 2 - 0
uni_modules/jlk-week/components/jlk-icon/changelog.md

@@ -0,0 +1,2 @@
+## 1.0.0(2022-08-04)
+- init

+ 43 - 0
uni_modules/jlk-week/components/jlk-icon/components/jlk-icon/jlk-icon.vue

@@ -0,0 +1,43 @@
+<template>
+	<view 
+		:class="`iconfont icon-${name}`" 
+		:style="{
+			color:`${color}`,
+			fontSize:`${size}rpx`,
+			fontWeight:`${bold ? 'bold' : 'normal'}`
+		}"
+	></view>
+</template>
+<script>
+	export default {
+		props:{
+			name:{
+				type:String,
+				default:''
+			},
+			color:{
+				type:String,
+				default:''
+			},
+			size:{
+				type:[String,Number],
+				default:32
+			},
+			bold:{
+				type:Boolean,
+				default:false
+			}
+		},
+		data(){
+			return {
+				
+			}
+		},
+		methods:{
+
+		}
+	}
+</script>
+<style>
+	@import url(http://at.alicdn.com/t/c/font_3171548_6ckfwk10cbu.css);
+</style>

+ 81 - 0
uni_modules/jlk-week/components/jlk-icon/package.json

@@ -0,0 +1,81 @@
+{
+  "id": "jlk-icon",
+  "displayName": "jlk-icon",
+  "version": "1.0.0",
+  "description": "jlk-icon",
+  "keywords": [
+    "jlk-icon"
+],
+  "repository": "",
+  "engines": {
+    "HBuilderX": "^3.1.0"
+  },
+  "dcloudext": {
+    "type": "component-vue",
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "",
+      "data": "",
+      "permissions": ""
+    },
+    "npmurl": ""
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "u",
+        "aliyun": "u"
+      },
+      "client": {
+        "Vue": {
+          "vue2": "u",
+          "vue3": "u"
+        },
+        "App": {
+          "app-vue": "u",
+          "app-nvue": "u"
+        },
+        "H5-mobile": {
+          "Safari": "u",
+          "Android Browser": "u",
+          "微信浏览器(Android)": "u",
+          "QQ浏览器(Android)": "u"
+        },
+        "H5-pc": {
+          "Chrome": "u",
+          "IE": "u",
+          "Edge": "u",
+          "Firefox": "u",
+          "Safari": "u"
+        },
+        "小程序": {
+          "微信": "u",
+          "阿里": "u",
+          "百度": "u",
+          "字节跳动": "u",
+          "QQ": "u",
+          "钉钉": "u",
+          "快手": "u",
+          "飞书": "u",
+          "京东": "u"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 4 - 0
uni_modules/jlk-week/components/jlk-icon/readme.md

@@ -0,0 +1,4 @@
+# jlk-icon
+> 组件名:jlk-week
+
+图标

+ 20 - 0
uni_modules/jlk-week/components/jlk-week/i18n/en.json

@@ -0,0 +1,20 @@
+{
+	"Week":{
+		"Value":"Week",
+		"Chou":"Week",
+		"Monday":"Monday",
+		"Tuesday":"Tuesday",
+		"Wednesday":"Wednesday",
+		"Thursday":"Thursday",
+		"Friday":"Friday",
+		"Saturday":"Saturday",
+		"Sunday":"Sunday",
+		"Mon":"Mon",
+		"Tue":"Tue",
+		"Wed":"Wed",
+		"Thu":"Thu",
+		"Fri":"Fri",
+		"Sat":"Sat",
+		"Sun":"Sun"
+	}
+}

+ 6 - 0
uni_modules/jlk-week/components/jlk-week/i18n/index.js

@@ -0,0 +1,6 @@
+import en from './en.json'
+import zh from './zh.json'
+export default {
+	en,
+	zh
+}

+ 20 - 0
uni_modules/jlk-week/components/jlk-week/i18n/zh.json

@@ -0,0 +1,20 @@
+{
+	"Week":{
+		"Value":"星期",
+		"Chou":"周",
+		"Monday":"周一",
+		"Tuesday":"周二",
+		"Wednesday":"周三",
+		"Thursday":"周四",
+		"Friday":"周五",
+		"Saturday":"周六",
+		"Sunday":"周日",
+		"Mon":"周一",
+		"Tue":"周二",
+		"Wed":"周三",
+		"Thu":"周四",
+		"Fri":"周五",
+		"Sat":"周六",
+		"Sun":"周日"
+	}
+}

+ 239 - 0
uni_modules/jlk-week/components/jlk-week/jlk-week.vue

@@ -0,0 +1,239 @@
+<template>
+	<view class="weeks-outer" :style="{backgroundColor:bgcolor}">
+		<view class="weeks-title" v-if="!!title" :style="titleStyles">
+			{{title}}
+		</view>
+		<view class="weeks" :class="{'weeks-vertical':vertical}">
+			<template v-for="item in weeks">
+				<view :key="item.value" class="weeks-item" :style="{
+						background: item.checked ? selectedColor : defaultColor,
+						width: `${size}rpx`,
+						height: `${size}rpx`,
+						lineHeight: `${size}rpx`,
+						fontSize: `${fontSize}rpx`,
+						color:`${color}`,
+						borderRadius: `${radius.indexOf('%') > 0 ? radius : (radius+'rpx')}`
+					}" @tap="tapWeek(item)">
+					{{item.text}}
+					<jlk-icon name="jinzhi" color="red" size="48" class="icon-position" v-if="item.disabled"></jlk-icon>
+				</view>
+			</template>
+		</view>
+	</view>
+</template>
+
+<script>
+	import messages from './i18n/index.js'
+	import Vue from 'vue'
+	import VueI18n from 'vue-i18n'
+	Vue.use(VueI18n)
+	// let lang = navigator.language.toLowerCase().includes('en')?'en':'zh'
+	let lang = 'zh'
+	const i18n = new VueI18n({
+		locale: lang === 'zh' ? 'zh-CN' : 'en-US',
+		messages: messages
+	})
+	export default {
+		props: {
+			title: {
+				type: String,
+				default: ''
+			},
+			titleStyles: {
+				type: String,
+				default: ''
+			},
+			value: {
+				type: Array,
+				default: () => {
+					return []
+				}
+			},
+			forbidden: {
+				type: Array,
+				default: () => {
+					return []
+				}
+			},
+			color: {
+				type: String,
+				default: '#FFFFFF'
+			},
+			bgcolor: {
+				type: String,
+				default: '#FFFFFF'
+			},
+			defaultColor: {
+				type: String,
+				default: '#BBBBBB'
+			},
+			selectedColor: {
+				type: String,
+				default: '#2A82E4'
+			},
+			size: {
+				type: [String, Number],
+				default: 72
+			},
+			fontSize: {
+				type: [String, Number],
+				default: 24
+			},
+			disabled: {
+				type: Boolean,
+				default: false
+			},
+			radius: {
+				type: [String, Number],
+				default: '100%'
+			},
+			vertical: {
+				type: Boolean,
+				default: false
+			}
+		},
+		data() {
+			return {
+				weeks: [],
+				selectedWeeks: [],
+			}
+		},
+		mounted() {
+			this.weeks = [{
+					text: i18n.t('Week.Mon'),
+					value: 1,
+					checked: false,
+					disabled: false
+				},
+				{
+					text: i18n.t('Week.Tue'),
+					value: 2,
+					checked: false,
+					disabled: false
+				},
+				{
+					text: i18n.t('Week.Wed'),
+					value: 3,
+					checked: false,
+					disabled: false
+				},
+				{
+					text: i18n.t('Week.Thu'),
+					value: 4,
+					checked: false,
+					disabled: false
+				},
+				{
+					text: i18n.t('Week.Fri'),
+					value: 5,
+					checked: false,
+					disabled: false
+				},
+				{
+					text: i18n.t('Week.Sat'),
+					value: 6,
+					checked: false,
+					disabled: false
+				},
+				{
+					text: i18n.t('Week.Sun'),
+					value: 0,
+					checked: false,
+					disabled: false
+				}
+			]
+
+			for (let i = 0; i < this.forbidden.length; i++) {
+				for (let j = 0; j < this.weeks.length; j++) {
+					if (this.forbidden[i] === this.weeks[j].value) {
+						this.weeks[j].disabled = true
+					}
+				}
+			}
+
+			this.selectedWeeks = this.value
+			this.initWeek()
+		},
+		methods: {
+			// 初始化week
+			initWeek() {
+				this.weeks.forEach(item => {
+					this.selectedWeeks.forEach(pro => {
+						if (item.value === pro) {
+							item.checked = true
+						}
+					})
+				})
+			},
+			//修改week样式
+			tapWeek(item) {
+				// 禁用插件
+				if (this.disabled) return
+
+				// 禁用某几个
+				for (let i = 0; i < this.forbidden.length; i++) {
+					if (this.forbidden[i] === item.value) {
+						item.disabled = true
+						return
+					}
+				}
+
+				item.checked = !item.checked
+				if (item.checked) {
+					if (this.selectedWeeks.indexOf(item.value) === -1) {
+						this.selectedWeeks.push(item.value)
+					}
+				} else {
+					let index = this.selectedWeeks.indexOf(item.value)
+					if (index !== -1) {
+						this.selectedWeeks.splice(index, 1)
+					}
+				}
+				this.$emit('change', this.selectedWeeks)
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.weeks-outer {
+		width: 100%;
+		padding: 20rpx 0;
+	}
+
+	.weeks-title {
+		text-align: center;
+		padding: 40rpx 32rpx;
+		color: #666666;
+	}
+
+	.weeks {
+		display: flex;
+		flex-direction: row;
+		justify-content: space-evenly;
+		align-items: center;
+	}
+
+	.weeks .weeks-item {
+		position: relative;
+		text-align: center;
+	}
+
+	.weeks-vertical {
+		flex-direction: column;
+	}
+
+	.weeks-vertical .weeks-item {
+		margin: 10rpx 0;
+	}
+
+	.icon-position {
+		position: absolute;
+		top: 0;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		margin: auto;
+		opacity: 0.5;
+	}
+</style>

+ 81 - 0
uni_modules/jlk-week/package.json

@@ -0,0 +1,81 @@
+{
+  "id": "jlk-week",
+  "displayName": "jlk-week",
+  "version": "1.0.4",
+  "description": "星期选择器",
+  "keywords": [
+    "jlk-week"
+],
+  "repository": "",
+  "engines": {
+    "HBuilderX": "^3.1.0"
+  },
+  "dcloudext": {
+    "type": "component-vue",
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": ""
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "Vue": {
+          "vue2": "y",
+          "vue3": "u"
+        },
+        "App": {
+          "app-vue": "u",
+          "app-nvue": "u"
+        },
+        "H5-mobile": {
+          "Safari": "u",
+          "Android Browser": "u",
+          "微信浏览器(Android)": "u",
+          "QQ浏览器(Android)": "u"
+        },
+        "H5-pc": {
+          "Chrome": "u",
+          "IE": "u",
+          "Edge": "u",
+          "Firefox": "u",
+          "Safari": "u"
+        },
+        "小程序": {
+          "微信": "u",
+          "阿里": "u",
+          "百度": "u",
+          "字节跳动": "u",
+          "QQ": "u",
+          "钉钉": "u",
+          "快手": "u",
+          "飞书": "u",
+          "京东": "u"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 4 - 0
uni_modules/jlk-week/readme.md

@@ -0,0 +1,4 @@
+# jlk-week
+> 组件名:jlk-week
+
+星期选择器

+ 20 - 0
uni_modules/uni-calendar/changelog.md

@@ -0,0 +1,20 @@
+## 1.4.7(2022-09-16)
+- 可以使用 uni-scss 控制主题色
+## 1.4.6(2022-09-08)
+- fix: 表头年月切换,导致改变当前日期为选择月1号,且未触发change事件
+## 1.4.5(2022-02-25)
+- 修复 条件编译 nvue 不支持的 css 样式
+## 1.4.4(2022-02-25)
+- 修复 条件编译 nvue 不支持的 css 样式
+## 1.4.3(2021-09-22)
+- 修复 startDate、 endDate 属性失效的 bug
+## 1.4.2(2021-08-24)
+- 新增 支持国际化
+## 1.4.1(2021-08-05)
+- 修复 弹出层被 tabbar 遮盖 bug
+## 1.4.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.3.16(2021-05-12)
+- 新增 组件示例地址
+## 1.3.15(2021-02-04)
+- 调整为uni_modules目录规范 

+ 546 - 0
uni_modules/uni-calendar/components/uni-calendar/calendar.js

@@ -0,0 +1,546 @@
+/**
+* @1900-2100区间内的公历、农历互转
+* @charset UTF-8
+* @github  https://github.com/jjonline/calendar.js
+* @Author  Jea杨(JJonline@JJonline.Cn)
+* @Time    2014-7-21
+* @Time    2016-8-13 Fixed 2033hex、Attribution Annals
+* @Time    2016-9-25 Fixed lunar LeapMonth Param Bug
+* @Time    2017-7-24 Fixed use getTerm Func Param Error.use solar year,NOT lunar year
+* @Version 1.0.3
+* @公历转农历:calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
+* @农历转公历:calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0]
+*/
+/* eslint-disable */
+var calendar = {
+
+  /**
+      * 农历1900-2100的润大小信息表
+      * @Array Of Property
+      * @return Hex
+      */
+  lunarInfo: [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, // 1900-1909
+    0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, // 1910-1919
+    0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, // 1920-1929
+    0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, // 1930-1939
+    0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, // 1940-1949
+    0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, // 1950-1959
+    0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, // 1960-1969
+    0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, // 1970-1979
+    0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, // 1980-1989
+    0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, // 1990-1999
+    0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, // 2000-2009
+    0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, // 2010-2019
+    0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, // 2020-2029
+    0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, // 2030-2039
+    0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, // 2040-2049
+    /** Add By JJonline@JJonline.Cn**/
+    0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, // 2050-2059
+    0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, // 2060-2069
+    0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, // 2070-2079
+    0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, // 2080-2089
+    0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, // 2090-2099
+    0x0d520], // 2100
+
+  /**
+      * 公历每个月份的天数普通表
+      * @Array Of Property
+      * @return Number
+      */
+  solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
+
+  /**
+      * 天干地支之天干速查表
+      * @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
+      * @return Cn string
+      */
+  Gan: ['\u7532', '\u4e59', '\u4e19', '\u4e01', '\u620a', '\u5df1', '\u5e9a', '\u8f9b', '\u58ec', '\u7678'],
+
+  /**
+      * 天干地支之地支速查表
+      * @Array Of Property
+      * @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
+      * @return Cn string
+      */
+  Zhi: ['\u5b50', '\u4e11', '\u5bc5', '\u536f', '\u8fb0', '\u5df3', '\u5348', '\u672a', '\u7533', '\u9149', '\u620c', '\u4ea5'],
+
+  /**
+      * 天干地支之地支速查表<=>生肖
+      * @Array Of Property
+      * @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
+      * @return Cn string
+      */
+  Animals: ['\u9f20', '\u725b', '\u864e', '\u5154', '\u9f99', '\u86c7', '\u9a6c', '\u7f8a', '\u7334', '\u9e21', '\u72d7', '\u732a'],
+
+  /**
+      * 24节气速查表
+      * @Array Of Property
+      * @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
+      * @return Cn string
+      */
+  solarTerm: ['\u5c0f\u5bd2', '\u5927\u5bd2', '\u7acb\u6625', '\u96e8\u6c34', '\u60ca\u86f0', '\u6625\u5206', '\u6e05\u660e', '\u8c37\u96e8', '\u7acb\u590f', '\u5c0f\u6ee1', '\u8292\u79cd', '\u590f\u81f3', '\u5c0f\u6691', '\u5927\u6691', '\u7acb\u79cb', '\u5904\u6691', '\u767d\u9732', '\u79cb\u5206', '\u5bd2\u9732', '\u971c\u964d', '\u7acb\u51ac', '\u5c0f\u96ea', '\u5927\u96ea', '\u51ac\u81f3'],
+
+  /**
+      * 1900-2100各年的24节气日期速查表
+      * @Array Of Property
+      * @return 0x string For splice
+      */
+  sTermInfo: ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f',
+    '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+    '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa',
+    '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f',
+    'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f',
+    '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa',
+    '97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2',
+    '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f',
+    '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+    '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+    '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722',
+    '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f',
+    '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+    '97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+    '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722',
+    '9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f',
+    '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
+    '97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
+    '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722',
+    '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+    '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+    '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
+    '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722',
+    '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+    '97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+    '97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
+    '9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722',
+    '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
+    '97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
+    '9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
+    '7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
+    '7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+    '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
+    '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
+    '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
+    '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+    '97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
+    '9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
+    '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721',
+    '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2',
+    '977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
+    '7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
+    '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd',
+    '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
+    '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
+    '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
+    '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd',
+    '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
+    '977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
+    '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721',
+    '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5',
+    '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722',
+    '7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
+    '7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
+    '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35',
+    '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
+    '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721',
+    '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd',
+    '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35',
+    '7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
+    '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721',
+    '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5',
+    '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35',
+    '665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
+    '7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
+    '7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35',
+    '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722'],
+
+  /**
+      * 数字转中文速查表
+      * @Array Of Property
+      * @trans ['日','一','二','三','四','五','六','七','八','九','十']
+      * @return Cn string
+      */
+  nStr1: ['\u65e5', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341'],
+
+  /**
+      * 日期转农历称呼速查表
+      * @Array Of Property
+      * @trans ['初','十','廿','卅']
+      * @return Cn string
+      */
+  nStr2: ['\u521d', '\u5341', '\u5eff', '\u5345'],
+
+  /**
+      * 月份转农历称呼速查表
+      * @Array Of Property
+      * @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
+      * @return Cn string
+      */
+  nStr3: ['\u6b63', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341', '\u51ac', '\u814a'],
+
+  /**
+      * 返回农历y年一整年的总天数
+      * @param lunar Year
+      * @return Number
+      * @eg:var count = calendar.lYearDays(1987) ;//count=387
+      */
+  lYearDays: function (y) {
+    var i; var sum = 348
+    for (i = 0x8000; i > 0x8; i >>= 1) { sum += (this.lunarInfo[y - 1900] & i) ? 1 : 0 }
+    return (sum + this.leapDays(y))
+  },
+
+  /**
+      * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
+      * @param lunar Year
+      * @return Number (0-12)
+      * @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
+      */
+  leapMonth: function (y) { // 闰字编码 \u95f0
+    return (this.lunarInfo[y - 1900] & 0xf)
+  },
+
+  /**
+      * 返回农历y年闰月的天数 若该年没有闰月则返回0
+      * @param lunar Year
+      * @return Number (0、29、30)
+      * @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
+      */
+  leapDays: function (y) {
+    if (this.leapMonth(y)) {
+      return ((this.lunarInfo[y - 1900] & 0x10000) ? 30 : 29)
+    }
+    return (0)
+  },
+
+  /**
+      * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
+      * @param lunar Year
+      * @return Number (-1、29、30)
+      * @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
+      */
+  monthDays: function (y, m) {
+    if (m > 12 || m < 1) { return -1 }// 月份参数从1至12,参数错误返回-1
+    return ((this.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29)
+  },
+
+  /**
+      * 返回公历(!)y年m月的天数
+      * @param solar Year
+      * @return Number (-1、28、29、30、31)
+      * @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
+      */
+  solarDays: function (y, m) {
+    if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1
+    var ms = m - 1
+    if (ms == 1) { // 2月份的闰平规律测算后确认返回28或29
+      return (((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) ? 29 : 28)
+    } else {
+      return (this.solarMonth[ms])
+    }
+  },
+
+  /**
+     * 农历年份转换为干支纪年
+     * @param  lYear 农历年的年份数
+     * @return Cn string
+     */
+  toGanZhiYear: function (lYear) {
+    var ganKey = (lYear - 3) % 10
+    var zhiKey = (lYear - 3) % 12
+    if (ganKey == 0) ganKey = 10// 如果余数为0则为最后一个天干
+    if (zhiKey == 0) zhiKey = 12// 如果余数为0则为最后一个地支
+    return this.Gan[ganKey - 1] + this.Zhi[zhiKey - 1]
+  },
+
+  /**
+     * 公历月、日判断所属星座
+     * @param  cMonth [description]
+     * @param  cDay [description]
+     * @return Cn string
+     */
+  toAstro: function (cMonth, cDay) {
+    var s = '\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf'
+    var arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22]
+    return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + '\u5ea7'// 座
+  },
+
+  /**
+      * 传入offset偏移量返回干支
+      * @param offset 相对甲子的偏移量
+      * @return Cn string
+      */
+  toGanZhi: function (offset) {
+    return this.Gan[offset % 10] + this.Zhi[offset % 12]
+  },
+
+  /**
+      * 传入公历(!)y年获得该年第n个节气的公历日期
+      * @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
+      * @return day Number
+      * @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
+      */
+  getTerm: function (y, n) {
+    if (y < 1900 || y > 2100) { return -1 }
+    if (n < 1 || n > 24) { return -1 }
+    var _table = this.sTermInfo[y - 1900]
+    var _info = [
+      parseInt('0x' + _table.substr(0, 5)).toString(),
+      parseInt('0x' + _table.substr(5, 5)).toString(),
+      parseInt('0x' + _table.substr(10, 5)).toString(),
+      parseInt('0x' + _table.substr(15, 5)).toString(),
+      parseInt('0x' + _table.substr(20, 5)).toString(),
+      parseInt('0x' + _table.substr(25, 5)).toString()
+    ]
+    var _calday = [
+      _info[0].substr(0, 1),
+      _info[0].substr(1, 2),
+      _info[0].substr(3, 1),
+      _info[0].substr(4, 2),
+
+      _info[1].substr(0, 1),
+      _info[1].substr(1, 2),
+      _info[1].substr(3, 1),
+      _info[1].substr(4, 2),
+
+      _info[2].substr(0, 1),
+      _info[2].substr(1, 2),
+      _info[2].substr(3, 1),
+      _info[2].substr(4, 2),
+
+      _info[3].substr(0, 1),
+      _info[3].substr(1, 2),
+      _info[3].substr(3, 1),
+      _info[3].substr(4, 2),
+
+      _info[4].substr(0, 1),
+      _info[4].substr(1, 2),
+      _info[4].substr(3, 1),
+      _info[4].substr(4, 2),
+
+      _info[5].substr(0, 1),
+      _info[5].substr(1, 2),
+      _info[5].substr(3, 1),
+      _info[5].substr(4, 2)
+    ]
+    return parseInt(_calday[n - 1])
+  },
+
+  /**
+      * 传入农历数字月份返回汉语通俗表示法
+      * @param lunar month
+      * @return Cn string
+      * @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
+      */
+  toChinaMonth: function (m) { // 月 => \u6708
+    if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1
+    var s = this.nStr3[m - 1]
+    s += '\u6708'// 加上月字
+    return s
+  },
+
+  /**
+      * 传入农历日期数字返回汉字表示法
+      * @param lunar day
+      * @return Cn string
+      * @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
+      */
+  toChinaDay: function (d) { // 日 => \u65e5
+    var s
+    switch (d) {
+      case 10:
+        s = '\u521d\u5341'; break
+      case 20:
+        s = '\u4e8c\u5341'; break
+        break
+      case 30:
+        s = '\u4e09\u5341'; break
+        break
+      default :
+        s = this.nStr2[Math.floor(d / 10)]
+        s += this.nStr1[d % 10]
+    }
+    return (s)
+  },
+
+  /**
+      * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
+      * @param y year
+      * @return Cn string
+      * @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
+      */
+  getAnimal: function (y) {
+    return this.Animals[(y - 4) % 12]
+  },
+
+  /**
+      * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
+      * @param y  solar year
+      * @param m  solar month
+      * @param d  solar day
+      * @return JSON object
+      * @eg:console.log(calendar.solar2lunar(1987,11,01));
+      */
+  solar2lunar: function (y, m, d) { // 参数区间1900.1.31~2100.12.31
+    // 年份限定、上限
+    if (y < 1900 || y > 2100) {
+      return -1// undefined转换为数字变为NaN
+    }
+    // 公历传参最下限
+    if (y == 1900 && m == 1 && d < 31) {
+      return -1
+    }
+    // 未传参  获得当天
+    if (!y) {
+      var objDate = new Date()
+    } else {
+      var objDate = new Date(y, parseInt(m) - 1, d)
+    }
+    var i; var leap = 0; var temp = 0
+    // 修正ymd参数
+    var y = objDate.getFullYear()
+    var m = objDate.getMonth() + 1
+    var d = objDate.getDate()
+    var offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 86400000
+    for (i = 1900; i < 2101 && offset > 0; i++) {
+      temp = this.lYearDays(i)
+      offset -= temp
+    }
+    if (offset < 0) {
+      offset += temp; i--
+    }
+
+    // 是否今天
+    var isTodayObj = new Date()
+    var isToday = false
+    if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) {
+      isToday = true
+    }
+    // 星期几
+    var nWeek = objDate.getDay()
+    var cWeek = this.nStr1[nWeek]
+    // 数字表示周几顺应天朝周一开始的惯例
+    if (nWeek == 0) {
+      nWeek = 7
+    }
+    // 农历年
+    var year = i
+    var leap = this.leapMonth(i) // 闰哪个月
+    var isLeap = false
+
+    // 效验闰月
+    for (i = 1; i < 13 && offset > 0; i++) {
+      // 闰月
+      if (leap > 0 && i == (leap + 1) && isLeap == false) {
+        --i
+        isLeap = true; temp = this.leapDays(year) // 计算农历闰月天数
+      } else {
+        temp = this.monthDays(year, i)// 计算农历普通月天数
+      }
+      // 解除闰月
+      if (isLeap == true && i == (leap + 1)) { isLeap = false }
+      offset -= temp
+    }
+    // 闰月导致数组下标重叠取反
+    if (offset == 0 && leap > 0 && i == leap + 1) {
+      if (isLeap) {
+        isLeap = false
+      } else {
+        isLeap = true; --i
+      }
+    }
+    if (offset < 0) {
+      offset += temp; --i
+    }
+    // 农历月
+    var month = i
+    // 农历日
+    var day = offset + 1
+    // 天干地支处理
+    var sm = m - 1
+    var gzY = this.toGanZhiYear(year)
+
+    // 当月的两个节气
+    // bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year`
+    var firstNode = this.getTerm(y, (m * 2 - 1))// 返回当月「节」为几日开始
+    var secondNode = this.getTerm(y, (m * 2))// 返回当月「节」为几日开始
+
+    // 依据12节气修正干支月
+    var gzM = this.toGanZhi((y - 1900) * 12 + m + 11)
+    if (d >= firstNode) {
+      gzM = this.toGanZhi((y - 1900) * 12 + m + 12)
+    }
+
+    // 传入的日期的节气与否
+    var isTerm = false
+    var Term = null
+    if (firstNode == d) {
+      isTerm = true
+      Term = this.solarTerm[m * 2 - 2]
+    }
+    if (secondNode == d) {
+      isTerm = true
+      Term = this.solarTerm[m * 2 - 1]
+    }
+    // 日柱 当月一日与 1900/1/1 相差天数
+    var dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10
+    var gzD = this.toGanZhi(dayCyclical + d - 1)
+    // 该日期所属的星座
+    var astro = this.toAstro(m, d)
+
+    return { 'lYear': year, 'lMonth': month, 'lDay': day, 'Animal': this.getAnimal(year), 'IMonthCn': (isLeap ? '\u95f0' : '') + this.toChinaMonth(month), 'IDayCn': this.toChinaDay(day), 'cYear': y, 'cMonth': m, 'cDay': d, 'gzYear': gzY, 'gzMonth': gzM, 'gzDay': gzD, 'isToday': isToday, 'isLeap': isLeap, 'nWeek': nWeek, 'ncWeek': '\u661f\u671f' + cWeek, 'isTerm': isTerm, 'Term': Term, 'astro': astro }
+  },
+
+  /**
+      * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
+      * @param y  lunar year
+      * @param m  lunar month
+      * @param d  lunar day
+      * @param isLeapMonth  lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
+      * @return JSON object
+      * @eg:console.log(calendar.lunar2solar(1987,9,10));
+      */
+  lunar2solar: function (y, m, d, isLeapMonth) { // 参数区间1900.1.31~2100.12.1
+    var isLeapMonth = !!isLeapMonth
+    var leapOffset = 0
+    var leapMonth = this.leapMonth(y)
+    var leapDay = this.leapDays(y)
+    if (isLeapMonth && (leapMonth != m)) { return -1 }// 传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
+    if (y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31) { return -1 }// 超出了最大极限值
+    var day = this.monthDays(y, m)
+    var _day = day
+    // bugFix 2016-9-25
+    // if month is leap, _day use leapDays method
+    if (isLeapMonth) {
+      _day = this.leapDays(y, m)
+    }
+    if (y < 1900 || y > 2100 || d > _day) { return -1 }// 参数合法性效验
+
+    // 计算农历的时间差
+    var offset = 0
+    for (var i = 1900; i < y; i++) {
+      offset += this.lYearDays(i)
+    }
+    var leap = 0; var isAdd = false
+    for (var i = 1; i < m; i++) {
+      leap = this.leapMonth(y)
+      if (!isAdd) { // 处理闰月
+        if (leap <= i && leap > 0) {
+          offset += this.leapDays(y); isAdd = true
+        }
+      }
+      offset += this.monthDays(y, i)
+    }
+    // 转换闰月农历 需补充该年闰月的前一个月的时差
+    if (isLeapMonth) { offset += day }
+    // 1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
+    var stmap = Date.UTC(1900, 1, 30, 0, 0, 0)
+    var calObj = new Date((offset + d - 31) * 86400000 + stmap)
+    var cY = calObj.getUTCFullYear()
+    var cM = calObj.getUTCMonth() + 1
+    var cD = calObj.getUTCDate()
+
+    return this.solar2lunar(cY, cM, cD)
+  }
+}
+
+export default calendar

+ 12 - 0
uni_modules/uni-calendar/components/uni-calendar/i18n/en.json

@@ -0,0 +1,12 @@
+{
+	"uni-calender.ok": "ok",
+	"uni-calender.cancel": "cancel",
+	"uni-calender.today": "today",
+	"uni-calender.MON": "MON",
+	"uni-calender.TUE": "TUE",
+	"uni-calender.WED": "WED",
+	"uni-calender.THU": "THU",
+	"uni-calender.FRI": "FRI",
+	"uni-calender.SAT": "SAT",
+	"uni-calender.SUN": "SUN"
+}

+ 8 - 0
uni_modules/uni-calendar/components/uni-calendar/i18n/index.js

@@ -0,0 +1,8 @@
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+	en,
+	'zh-Hans': zhHans,
+	'zh-Hant': zhHant
+}

+ 12 - 0
uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hans.json

@@ -0,0 +1,12 @@
+{
+	"uni-calender.ok": "确定",
+	"uni-calender.cancel": "取消",
+	"uni-calender.today": "今日",
+	"uni-calender.SUN": "日",
+	"uni-calender.MON": "一",
+	"uni-calender.TUE": "二",
+	"uni-calender.WED": "三",
+	"uni-calender.THU": "四",
+	"uni-calender.FRI": "五",
+	"uni-calender.SAT": "六"
+}

+ 12 - 0
uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hant.json

@@ -0,0 +1,12 @@
+{
+	"uni-calender.ok": "確定",
+	"uni-calender.cancel": "取消",
+	"uni-calender.today": "今日",
+	"uni-calender.SUN": "日",
+	"uni-calender.MON": "一",
+	"uni-calender.TUE": "二",
+	"uni-calender.WED": "三",
+	"uni-calender.THU": "四",
+	"uni-calender.FRI": "五",
+	"uni-calender.SAT": "六"
+}

+ 188 - 0
uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue

@@ -0,0 +1,188 @@
+<template>
+	<view class="uni-calendar-item__weeks-box" :class="{
+		'uni-calendar-item--disable':weeks.disable,
+		'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+		'uni-calendar-item--checked':(calendar.fullDate === weeks.fullDate && !weeks.isDay) ,
+		'uni-calendar-item--before-checked':weeks.beforeMultiple,
+		'uni-calendar-item--multiple': weeks.multiple,
+		'uni-calendar-item--after-checked':weeks.afterMultiple,
+		}"
+	 @click="choiceDate(weeks)">
+		<view class="uni-calendar-item__weeks-box-item">
+			<text v-if="selected&&weeks.extraInfo" class="uni-calendar-item__weeks-box-circle"></text>
+			<text class="uni-calendar-item__weeks-box-text" :class="{
+				'uni-calendar-item--isDay-text': weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				'uni-calendar-item--disable':weeks.disable,
+				}">{{weeks.date}}</text>
+			<text v-if="!lunar&&!weeks.extraInfo && weeks.isDay" class="uni-calendar-item__weeks-lunar-text" :class="{
+				'uni-calendar-item--isDay-text':weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				}">{{todayText}}</text>
+			<text v-if="lunar&&!weeks.extraInfo" class="uni-calendar-item__weeks-lunar-text" :class="{
+				'uni-calendar-item--isDay-text':weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				'uni-calendar-item--disable':weeks.disable,
+				}">{{weeks.isDay ? todayText : (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text>
+			<text v-if="weeks.extraInfo&&weeks.extraInfo.info" class="uni-calendar-item__weeks-lunar-text" :class="{
+				'uni-calendar-item--extra':weeks.extraInfo.info,
+				'uni-calendar-item--isDay-text':weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				'uni-calendar-item--disable':weeks.disable,
+				}">{{weeks.extraInfo.info}}</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+	initVueI18n
+	} from '@dcloudio/uni-i18n'
+	import messages from './i18n/index.js'
+	const {	t	} = initVueI18n(messages)
+	export default {
+		emits:['change'],
+		props: {
+			weeks: {
+				type: Object,
+				default () {
+					return {}
+				}
+			},
+			calendar: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			},
+			selected: {
+				type: Array,
+				default: () => {
+					return []
+				}
+			},
+			lunar: {
+				type: Boolean,
+				default: false
+			}
+		},
+		computed: {
+			todayText() {
+				return t("uni-calender.today")
+			},
+		},
+		methods: {
+			choiceDate(weeks) {
+				this.$emit('change', weeks)
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	$uni-font-size-base:14px;
+	$uni-text-color:#333;
+	$uni-font-size-sm:12px;
+	$uni-color-error: #31C20E;
+	$uni-opacity-disabled: 0.3;
+	$uni-text-color-disable:#c0c0c0;
+	$uni-primary: #2979ff !default;
+	.uni-calendar-item__weeks-box {
+		flex: 1;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.uni-calendar-item__weeks-box-text {
+		font-size: $uni-font-size-base;
+		color: $uni-text-color;
+	}
+
+	.uni-calendar-item__weeks-lunar-text {
+		font-size: $uni-font-size-sm;
+		color: $uni-text-color;
+	}
+
+	.uni-calendar-item__weeks-box-item {
+		position: relative;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		width: 100rpx;
+		height: 100rpx;
+	}
+
+	.uni-calendar-item__weeks-box-circle {
+		position: absolute;
+		top: 40px;
+		right: 22px;
+		width: 8px;
+		height: 8px;
+		border-radius: 8px;
+		background-color: $uni-color-error;
+
+	}
+
+	.uni-calendar-item--disable {
+		background-color: rgba(249, 249, 249, $uni-opacity-disabled);
+		color: $uni-text-color-disable;
+	}
+
+	.uni-calendar-item--isDay-text {
+		color: $uni-primary;
+	}
+
+	.uni-calendar-item--isDay {
+		background-color: $uni-primary;
+		opacity: 0.8;
+		color: #fff;
+	}
+
+	.uni-calendar-item--extra {
+		color: $uni-color-error;
+		opacity: 0.8;
+	}
+
+	.uni-calendar-item--checked {
+		background-color: $uni-primary;
+		color: #fff;
+		opacity: 0.8;
+	}
+
+	.uni-calendar-item--multiple {
+		background-color: $uni-primary;
+		color: #fff;
+		opacity: 0.8;
+	}
+	.uni-calendar-item--before-checked {
+		background-color: #ff5a5f;
+		color: #fff;
+	}
+	.uni-calendar-item--after-checked {
+		background-color: #ff5a5f;
+		color: #fff;
+	}
+</style>

+ 563 - 0
uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue

@@ -0,0 +1,563 @@
+<template>
+	<view class="uni-calendar">
+		<view v-if="!insert&&show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}" @click="clean"></view>
+		<view v-if="insert || show" class="uni-calendar__content" :class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow}">
+			<view v-if="!insert" class="uni-calendar__header uni-calendar--fixed-top">
+				<view class="uni-calendar__header-btn-box" @click="close">
+					<text class="uni-calendar__header-text uni-calendar--fixed-width">{{cancelText}}</text>
+				</view>
+				<view class="uni-calendar__header-btn-box" @click="confirm">
+					<text class="uni-calendar__header-text uni-calendar--fixed-width">{{okText}}</text>
+				</view>
+			</view>
+			<view class="uni-calendar__header">
+				<view class="uni-calendar__header-btn-box" @click.stop="pre">
+					<view class="uni-calendar__header-btn uni-calendar--left"></view>
+				</view>
+				<picker mode="date" :value="date" fields="month" @change="bindDateChange">
+					<text class="uni-calendar__header-text">{{ (nowDate.year||'') +' / '+( nowDate.month||'')}}</text>
+				</picker>
+				<view class="uni-calendar__header-btn-box" @click.stop="next">
+					<view class="uni-calendar__header-btn uni-calendar--right"></view>
+				</view>
+				<text class="uni-calendar__backtoday" @click="backtoday">{{todayText}}</text>
+
+			</view>
+			<view class="uni-calendar__box">
+				<view v-if="showMonth" class="uni-calendar__box-bg">
+					<text class="uni-calendar__box-bg-text">{{nowDate.month}}</text>
+				</view>
+				<view class="uni-calendar__weeks">
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{SUNText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{monText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{TUEText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{WEDText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{THUText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{FRIText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{SATText}}</text>
+					</view>
+				</view>
+				<view class="uni-calendar__weeks" v-for="(item,weekIndex) in weeks" :key="weekIndex">
+					<view class="uni-calendar__weeks-item" v-for="(weeks,weeksIndex) in item" :key="weeksIndex">
+						<calendar-item class="uni-calendar-item--hook" :weeks="weeks" :calendar="calendar" :selected="selected" :lunar="lunar" @change="choiceDate"></calendar-item>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import Calendar from './util.js';
+	import calendarItem from './uni-calendar-item.vue'
+	import {
+	initVueI18n
+	} from '@dcloudio/uni-i18n'
+	import messages from './i18n/index.js'
+	const {	t	} = initVueI18n(messages)
+	/**
+	 * Calendar 日历
+	 * @description 日历组件可以查看日期,选择任意范围内的日期,打点操作。常用场景如:酒店日期预订、火车机票选择购买日期、上下班打卡等
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=56
+	 * @property {String} date 自定义当前时间,默认为今天
+	 * @property {Boolean} lunar 显示农历
+	 * @property {String} startDate 日期选择范围-开始日期
+	 * @property {String} endDate 日期选择范围-结束日期
+	 * @property {Boolean} range 范围选择
+	 * @property {Boolean} insert = [true|false] 插入模式,默认为false
+	 * 	@value true 弹窗模式
+	 * 	@value false 插入模式
+	 * @property {Boolean} clearDate = [true|false] 弹窗模式是否清空上次选择内容
+	 * @property {Array} selected 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}]
+	 * @property {Boolean} showMonth 是否选择月份为背景
+	 * @event {Function} change 日期改变,`insert :ture` 时生效
+	 * @event {Function} confirm 确认选择`insert :false` 时生效
+	 * @event {Function} monthSwitch 切换月份时触发
+	 * @example <uni-calendar :insert="true":lunar="true" :start-date="'2019-3-2'":end-date="'2019-5-20'"@change="change" />
+	 */
+	export default {
+		components: {
+			calendarItem
+		},
+		emits:['close','confirm','change','monthSwitch'],
+		props: {
+			date: {
+				type: String,
+				default: ''
+			},
+			selected: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			lunar: {
+				type: Boolean,
+				default: false
+			},
+			startDate: {
+				type: String,
+				default: ''
+			},
+			endDate: {
+				type: String,
+				default: ''
+			},
+			range: {
+				type: Boolean,
+				default: false
+			},
+			insert: {
+				type: Boolean,
+				default: true
+			},
+			showMonth: {
+				type: Boolean,
+				default: true
+			},
+			clearDate: {
+				type: Boolean,
+				default: true
+			}
+		},
+		data() {
+			return {
+				show: false,
+				weeks: [],
+				calendar: {},
+				nowDate: '',
+				aniMaskShow: false
+			}
+		},
+		computed:{
+			/**
+			 * for i18n
+			 */
+
+			okText() {
+				return t("uni-calender.ok")
+			},
+			cancelText() {
+				return t("uni-calender.cancel")
+			},
+			todayText() {
+				return t("uni-calender.today")
+			},
+			monText() {
+				return t("uni-calender.MON")
+			},
+			TUEText() {
+				return t("uni-calender.TUE")
+			},
+			WEDText() {
+				return t("uni-calender.WED")
+			},
+			THUText() {
+				return t("uni-calender.THU")
+			},
+			FRIText() {
+				return t("uni-calender.FRI")
+			},
+			SATText() {
+				return t("uni-calender.SAT")
+			},
+			SUNText() {
+				return t("uni-calender.SUN")
+			},
+		},
+		watch: {
+			date(newVal) {
+				// this.cale.setDate(newVal)
+				this.init(newVal)
+			},
+			startDate(val){
+				this.cale.resetSatrtDate(val)
+				this.cale.setDate(this.nowDate.fullDate)
+				this.weeks = this.cale.weeks
+			},
+			endDate(val){
+				this.cale.resetEndDate(val)
+				this.cale.setDate(this.nowDate.fullDate)
+				this.weeks = this.cale.weeks
+			},
+			selected(newVal) {
+				this.cale.setSelectInfo(this.nowDate.fullDate, newVal)
+				this.weeks = this.cale.weeks
+			}
+		},
+		created() {
+			// 获取日历方法实例
+			this.cale = new Calendar({
+				// date: new Date(),
+				selected: this.selected,
+				startDate: this.startDate,
+				endDate: this.endDate,
+				range: this.range,
+			})
+			// 选中某一天
+			// this.cale.setDate(this.date)
+			this.init(this.date)
+			// this.setDay
+		},
+		methods: {
+			// 取消穿透
+			clean() {},
+			bindDateChange(e) {
+				const value = e.detail.value + '-1'
+				console.log(this.cale.getDate(value));
+				this.setDate(value)
+			},
+			/**
+			 * 初始化日期显示
+			 * @param {Object} date
+			 */
+			init(date) {
+				this.cale.setDate(date)
+				this.weeks = this.cale.weeks
+				this.nowDate = this.calendar = this.cale.getInfo(date)
+			},
+			/**
+			 * 打开日历弹窗
+			 */
+			open() {
+				// 弹窗模式并且清理数据
+				if (this.clearDate && !this.insert) {
+					this.cale.cleanMultipleStatus()
+					// this.cale.setDate(this.date)
+					this.init(this.date)
+				}
+				this.show = true
+				this.$nextTick(() => {
+					setTimeout(() => {
+						this.aniMaskShow = true
+					}, 50)
+				})
+			},
+			/**
+			 * 关闭日历弹窗
+			 */
+			close() {
+				this.aniMaskShow = false
+				this.$nextTick(() => {
+					setTimeout(() => {
+						this.show = false
+						this.$emit('close')
+					}, 300)
+				})
+			},
+			/**
+			 * 确认按钮
+			 */
+			confirm() {
+				this.setEmit('confirm')
+				this.close()
+			},
+			/**
+			 * 变化触发
+			 */
+			change() {
+				if (!this.insert) return
+				this.setEmit('change')
+			},
+			/**
+			 * 选择月份触发
+			 */
+			monthSwitch() {
+				let {
+					year,
+					month
+				} = this.nowDate
+				this.$emit('monthSwitch', {
+					year,
+					month: Number(month)
+				})
+			},
+			/**
+			 * 派发事件
+			 * @param {Object} name
+			 */
+			setEmit(name) {
+				let {
+					year,
+					month,
+					date,
+					fullDate,
+					lunar,
+					extraInfo
+				} = this.calendar
+				this.$emit(name, {
+					range: this.cale.multipleStatus,
+					year,
+					month,
+					date,
+					fulldate: fullDate,
+					lunar,
+					extraInfo: extraInfo || {}
+				})
+			},
+			/**
+			 * 选择天触发
+			 * @param {Object} weeks
+			 */
+			choiceDate(weeks) {
+				if (weeks.disable) return
+				this.calendar = weeks
+				// 设置多选
+				this.cale.setMultiple(this.calendar.fullDate)
+				this.weeks = this.cale.weeks
+				this.change()
+			},
+			/**
+			 * 回到今天
+			 */
+			backtoday() {
+				console.log(this.cale.getDate(new Date()).fullDate);
+				let date = this.cale.getDate(new Date()).fullDate
+				// this.cale.setDate(date)
+				this.init(date)
+				this.change()
+			},
+			/**
+			 * 上个月
+			 */
+			pre() {
+				const preDate = this.cale.getDate(this.nowDate.fullDate, -1, 'month').fullDate
+				this.setDate(preDate)
+				this.monthSwitch()
+
+			},
+			/**
+			 * 下个月
+			 */
+			next() {
+				const nextDate = this.cale.getDate(this.nowDate.fullDate, +1, 'month').fullDate
+				this.setDate(nextDate)
+				this.monthSwitch()
+			},
+			/**
+			 * 设置日期
+			 * @param {Object} date
+			 */
+			setDate(date) {
+				this.cale.setDate(date)
+				this.weeks = this.cale.weeks
+				this.nowDate = this.cale.getInfo(date)
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	$uni-bg-color-mask: rgba($color: #000000, $alpha: 0.4);
+	$uni-border-color: #EDEDED;
+	$uni-text-color: #333;
+	$uni-bg-color-hover:#f1f1f1;
+	$uni-font-size-base:14px;
+	$uni-text-color-placeholder: #808080;
+	$uni-color-subtitle: #555555;
+	$uni-text-color-grey:#999;
+	.uni-calendar {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+	}
+
+	.uni-calendar__mask {
+		position: fixed;
+		bottom: 0;
+		top: 0;
+		left: 0;
+		right: 0;
+		background-color: $uni-bg-color-mask;
+		transition-property: opacity;
+		transition-duration: 0.3s;
+		opacity: 0;
+		/* #ifndef APP-NVUE */
+		z-index: 99;
+		/* #endif */
+	}
+
+	.uni-calendar--mask-show {
+		opacity: 1
+	}
+
+	.uni-calendar--fixed {
+		position: fixed;
+		/* #ifdef APP-NVUE */
+		bottom: 0;
+		/* #endif */
+		left: 0;
+		right: 0;
+		transition-property: transform;
+		transition-duration: 0.3s;
+		transform: translateY(460px);
+		/* #ifndef APP-NVUE */
+		bottom: calc(var(--window-bottom));
+		z-index: 99;
+		/* #endif */
+	}
+
+	.uni-calendar--ani-show {
+		transform: translateY(0);
+	}
+
+	.uni-calendar__content {
+		background-color: #fff;
+	}
+
+	.uni-calendar__header {
+		display: none;
+		position: relative;
+		/* #ifndef APP-NVUE */
+		// display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		height: 50px;
+		border-bottom-color: $uni-border-color;
+		border-bottom-style: solid;
+		border-bottom-width: 1px;
+	}
+
+	.uni-calendar--fixed-top {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: space-between;
+		border-top-color: $uni-border-color;
+		border-top-style: solid;
+		border-top-width: 1px;
+	}
+
+	.uni-calendar--fixed-width {
+		width: 50px;
+		// padding: 0 15px;
+	}
+
+	.uni-calendar__backtoday {
+		position: absolute;
+		right: 0;
+		top: 25rpx;
+		padding: 0 5px;
+		padding-left: 10px;
+		height: 25px;
+		line-height: 25px;
+		font-size: 12px;
+		border-top-left-radius: 25px;
+		border-bottom-left-radius: 25px;
+		color: $uni-text-color;
+		background-color: $uni-bg-color-hover;
+	}
+
+	.uni-calendar__header-text {
+		text-align: center;
+		width: 100px;
+		font-size: $uni-font-size-base;
+		color: $uni-text-color;
+	}
+
+	.uni-calendar__header-btn-box {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+		width: 50px;
+		height: 50px;
+	}
+
+	.uni-calendar__header-btn {
+		width: 10px;
+		height: 10px;
+		border-left-color: $uni-text-color-placeholder;
+		border-left-style: solid;
+		border-left-width: 2px;
+		border-top-color: $uni-color-subtitle;
+		border-top-style: solid;
+		border-top-width: 2px;
+	}
+
+	.uni-calendar--left {
+		transform: rotate(-45deg);
+	}
+
+	.uni-calendar--right {
+		transform: rotate(135deg);
+	}
+
+
+	.uni-calendar__weeks {
+		position: relative;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+	}
+
+	.uni-calendar__weeks-item {
+		flex: 1;
+	}
+
+	.uni-calendar__weeks-day {
+		flex: 1;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		height: 45px;
+		border-bottom-color: #F5F5F5;
+		border-bottom-style: solid;
+		border-bottom-width: 1px;
+	}
+
+	.uni-calendar__weeks-day-text {
+		font-size: 14px;
+	}
+
+	.uni-calendar__box {
+		position: relative;
+	}
+
+	.uni-calendar__box-bg {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		justify-content: center;
+		align-items: center;
+		position: absolute;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+	}
+
+	.uni-calendar__box-bg-text {
+		font-size: 200px;
+		font-weight: bold;
+		color: $uni-text-color-grey;
+		opacity: 0.1;
+		text-align: center;
+		/* #ifndef APP-NVUE */
+		line-height: 1;
+		/* #endif */
+	}
+</style>

+ 350 - 0
uni_modules/uni-calendar/components/uni-calendar/util.js

@@ -0,0 +1,350 @@
+import CALENDAR from './calendar.js'
+
+class Calendar {
+	constructor({
+		date,
+		selected,
+		startDate,
+		endDate,
+		range
+	} = {}) {
+		// 当前日期
+		this.date = this.getDate(new Date()) // 当前初入日期
+		// 打点信息
+		this.selected = selected || [];
+		// 范围开始
+		this.startDate = startDate
+		// 范围结束
+		this.endDate = endDate
+		this.range = range
+		// 多选状态
+		this.cleanMultipleStatus()
+		// 每周日期
+		this.weeks = {}
+		// this._getWeek(this.date.fullDate)
+	}
+	/**
+	 * 设置日期
+	 * @param {Object} date
+	 */
+	setDate(date) {
+		this.selectDate = this.getDate(date)
+		this._getWeek(this.selectDate.fullDate)
+	}
+
+	/**
+	 * 清理多选状态
+	 */
+	cleanMultipleStatus() {
+		this.multipleStatus = {
+			before: '',
+			after: '',
+			data: []
+		}
+	}
+
+	/**
+	 * 重置开始日期
+	 */
+	resetSatrtDate(startDate) {
+		// 范围开始
+		this.startDate = startDate
+
+	}
+
+	/**
+	 * 重置结束日期
+	 */
+	resetEndDate(endDate) {
+		// 范围结束
+		this.endDate = endDate
+	}
+
+	/**
+	 * 获取任意时间
+	 */
+	getDate(date, AddDayCount = 0, str = 'day') {
+		if (!date) {
+			date = new Date()
+		}
+		if (typeof date !== 'object') {
+			date = date.replace(/-/g, '/')
+		}
+		const dd = new Date(date)
+		switch (str) {
+			case 'day':
+				dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
+				break
+			case 'month':
+				if (dd.getDate() === 31) {
+					dd.setDate(dd.getDate() + AddDayCount)
+				} else {
+					dd.setMonth(dd.getMonth() + AddDayCount) // 获取AddDayCount天后的日期
+				}
+				break
+			case 'year':
+				dd.setFullYear(dd.getFullYear() + AddDayCount) // 获取AddDayCount天后的日期
+				break
+		}
+		const y = dd.getFullYear()
+		const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
+		const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
+		return {
+			fullDate: y + '-' + m + '-' + d,
+			year: y,
+			month: m,
+			date: d,
+			day: dd.getDay()
+		}
+	}
+
+
+	/**
+	 * 获取上月剩余天数
+	 */
+	_getLastMonthDays(firstDay, full) {
+		let dateArr = []
+		for (let i = firstDay; i > 0; i--) {
+			const beforeDate = new Date(full.year, full.month - 1, -i + 1).getDate()
+			dateArr.push({
+				date: beforeDate,
+				month: full.month - 1,
+				lunar: this.getlunar(full.year, full.month - 1, beforeDate),
+				disable: true
+			})
+		}
+		return dateArr
+	}
+	/**
+	 * 获取本月天数
+	 */
+	_currentMonthDys(dateData, full) {
+		let dateArr = []
+		let fullDate = this.date.fullDate
+		for (let i = 1; i <= dateData; i++) {
+			let nowDate = full.year + '-' + (full.month < 10 ?
+				full.month : full.month) + '-' + (i < 10 ?
+				'0' + i : i)
+			// 是否今天
+			let isDay = fullDate === nowDate
+			// 获取打点信息
+			let info = this.selected && this.selected.find((item) => {
+				if (this.dateEqual(nowDate, item.date)) {
+					return item
+				}
+			})
+
+			// 日期禁用
+			let disableBefore = true
+			let disableAfter = true
+			if (this.startDate) {
+				// let dateCompBefore = this.dateCompare(this.startDate, fullDate)
+				// disableBefore = this.dateCompare(dateCompBefore ? this.startDate : fullDate, nowDate)
+				disableBefore = this.dateCompare(this.startDate, nowDate)
+			}
+
+			if (this.endDate) {
+				// let dateCompAfter = this.dateCompare(fullDate, this.endDate)
+				// disableAfter = this.dateCompare(nowDate, dateCompAfter ? this.endDate : fullDate)
+				disableAfter = this.dateCompare(nowDate, this.endDate)
+			}
+			let multiples = this.multipleStatus.data
+			let checked = false
+			let multiplesStatus = -1
+			if (this.range) {
+				if (multiples) {
+					multiplesStatus = multiples.findIndex((item) => {
+						return this.dateEqual(item, nowDate)
+					})
+				}
+				if (multiplesStatus !== -1) {
+					checked = true
+				}
+			}
+			let data = {
+				fullDate: nowDate,
+				year: full.year,
+				date: i,
+				multiple: this.range ? checked : false,
+				beforeMultiple: this.dateEqual(this.multipleStatus.before, nowDate),
+				afterMultiple: this.dateEqual(this.multipleStatus.after, nowDate),
+				month: full.month,
+				lunar: this.getlunar(full.year, full.month, i),
+				disable: !(disableBefore && disableAfter),
+				isDay
+			}
+			if (info) {
+				data.extraInfo = info
+			}
+
+			dateArr.push(data)
+		}
+		return dateArr
+	}
+	/**
+	 * 获取下月天数
+	 */
+	_getNextMonthDays(surplus, full) {
+		let dateArr = []
+		for (let i = 1; i < surplus + 1; i++) {
+			dateArr.push({
+				date: i,
+				month: Number(full.month) + 1,
+				lunar: this.getlunar(full.year, Number(full.month) + 1, i),
+				disable: true
+			})
+		}
+		return dateArr
+	}
+
+	/**
+	 * 获取当前日期详情
+	 * @param {Object} date
+	 */
+	getInfo(date) {
+		if (!date) {
+			date = new Date()
+		}
+		const dateInfo = this.canlender.find(item => item.fullDate === this.getDate(date).fullDate)
+		return dateInfo
+	}
+
+	/**
+	 * 比较时间大小
+	 */
+	dateCompare(startDate, endDate) {
+		// 计算截止时间
+		startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
+		// 计算详细项的截止时间
+		endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
+		if (startDate <= endDate) {
+			return true
+		} else {
+			return false
+		}
+	}
+
+	/**
+	 * 比较时间是否相等
+	 */
+	dateEqual(before, after) {
+		// 计算截止时间
+		before = new Date(before.replace('-', '/').replace('-', '/'))
+		// 计算详细项的截止时间
+		after = new Date(after.replace('-', '/').replace('-', '/'))
+		if (before.getTime() - after.getTime() === 0) {
+			return true
+		} else {
+			return false
+		}
+	}
+
+
+	/**
+	 * 获取日期范围内所有日期
+	 * @param {Object} begin
+	 * @param {Object} end
+	 */
+	geDateAll(begin, end) {
+		var arr = []
+		var ab = begin.split('-')
+		var ae = end.split('-')
+		var db = new Date()
+		db.setFullYear(ab[0], ab[1] - 1, ab[2])
+		var de = new Date()
+		de.setFullYear(ae[0], ae[1] - 1, ae[2])
+		var unixDb = db.getTime() - 24 * 60 * 60 * 1000
+		var unixDe = de.getTime() - 24 * 60 * 60 * 1000
+		for (var k = unixDb; k <= unixDe;) {
+			k = k + 24 * 60 * 60 * 1000
+			arr.push(this.getDate(new Date(parseInt(k))).fullDate)
+		}
+		return arr
+	}
+	/**
+	 * 计算阴历日期显示
+	 */
+	getlunar(year, month, date) {
+		return CALENDAR.solar2lunar(year, month, date)
+	}
+	/**
+	 * 设置打点
+	 */
+	setSelectInfo(data, value) {
+		this.selected = value
+		this._getWeek(data)
+	}
+
+	/**
+	 *  获取多选状态
+	 */
+	setMultiple(fullDate) {
+		let {
+			before,
+			after
+		} = this.multipleStatus
+
+		if (!this.range) return
+		if (before && after) {
+			this.multipleStatus.before = ''
+			this.multipleStatus.after = ''
+			this.multipleStatus.data = []
+		} else {
+			if (!before) {
+				this.multipleStatus.before = fullDate
+			} else {
+				this.multipleStatus.after = fullDate
+				if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
+					this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
+				} else {
+					this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
+				}
+			}
+		}
+		this._getWeek(fullDate)
+	}
+
+	/**
+	 * 获取每周数据
+	 * @param {Object} dateData
+	 */
+	_getWeek(dateData) {
+		const {
+			year,
+			month
+		} = this.getDate(dateData)
+		let firstDay = new Date(year, month - 1, 1).getDay()
+		let currentDay = new Date(year, month, 0).getDate()
+		let dates = {
+			lastMonthDays: this._getLastMonthDays(firstDay, this.getDate(dateData)), // 上个月末尾几天
+			currentMonthDys: this._currentMonthDys(currentDay, this.getDate(dateData)), // 本月天数
+			nextMonthDays: [], // 下个月开始几天
+			weeks: []
+		}
+		let canlender = []
+		const surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length)
+		dates.nextMonthDays = this._getNextMonthDays(surplus, this.getDate(dateData))
+		canlender = canlender.concat(dates.lastMonthDays, dates.currentMonthDys, dates.nextMonthDays)
+		let weeks = {}
+		// 拼接数组  上个月开始几天 + 本月天数+ 下个月开始几天
+		for (let i = 0; i < canlender.length; i++) {
+			if (i % 7 === 0) {
+				weeks[parseInt(i / 7)] = new Array(7)
+			}
+			weeks[parseInt(i / 7)][i % 7] = canlender[i]
+		}
+		this.canlender = canlender
+		this.weeks = weeks
+	}
+
+	//静态方法
+	// static init(date) {
+	// 	if (!this.instance) {
+	// 		this.instance = new Calendar(date);
+	// 	}
+	// 	return this.instance;
+	// }
+}
+
+
+export default Calendar

+ 85 - 0
uni_modules/uni-calendar/package.json

@@ -0,0 +1,85 @@
+{
+  "id": "uni-calendar",
+  "displayName": "uni-calendar 日历",
+  "version": "1.4.7",
+  "description": "日历组件",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "日历",
+    "",
+    "打卡",
+    "日历选择"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+"dcloudext": {
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+    "type": "component-vue"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

+ 103 - 0
uni_modules/uni-calendar/readme.md

@@ -0,0 +1,103 @@
+
+
+## Calendar 日历
+> **组件名:uni-calendar**
+> 代码块: `uCalendar`
+
+
+日历组件
+
+> **注意事项**
+> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
+> - 本组件农历转换使用的js是 [@1900-2100区间内的公历、农历互转](https://github.com/jjonline/calendar.js)  
+> - 仅支持自定义组件模式
+> - `date`属性传入的应该是一个 String ,如: 2019-06-27 ,而不是 new Date()
+> - 通过 `insert` 属性来确定当前的事件是 @change 还是 @confirm 。理应合并为一个事件,但是为了区分模式,现使用两个事件,这里需要注意
+> - 弹窗模式下无法阻止后面的元素滚动,如有需要阻止,请在弹窗弹出后,手动设置滚动元素为不可滚动
+
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+### 基本用法
+
+在 ``template`` 中使用组件
+
+```html
+<view>
+	<uni-calendar 
+	:insert="true"
+	:lunar="true" 
+	:start-date="'2019-3-2'"
+	:end-date="'2019-5-20'"
+	@change="change"
+	 />
+</view>
+```
+
+### 通过方法打开日历
+
+需要设置 `insert` 为 `false`
+
+```html
+<view>
+	<uni-calendar 
+	ref="calendar"
+	:insert="false"
+	@confirm="confirm"
+	 />
+	 <button @click="open">打开日历</button>
+</view>
+```
+
+```javascript
+
+export default {
+	data() {
+		return {};
+	},
+	methods: {
+		open(){
+			this.$refs.calendar.open();
+		},
+		confirm(e) {
+			console.log(e);
+		}
+	}
+};
+
+```
+
+
+## API
+
+### Calendar Props
+
+|  属性名	|    类型	| 默认值| 说明																													|
+| 		| 																													|
+| date		| String	|-		| 自定义当前时间,默认为今天																							|
+| lunar		| Boolean	| false	| 显示农历																												|
+| startDate	| String	|-		| 日期选择范围-开始日期																									|
+| endDate	| String	|-		| 日期选择范围-结束日期																									|
+| range		| Boolean	| false	| 范围选择																												|
+| insert	| Boolean	| false	| 插入模式,可选值,ture:插入模式;false:弹窗模式;默认为插入模式														|
+|clearDate	|Boolean	|true	|弹窗模式是否清空上次选择内容	|
+| selected	| Array		|-		| 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}]	|
+|showMonth	| Boolean	| true	| 是否显示月份为背景																									|
+
+### Calendar Events
+
+|  事件名		| 说明								|返回值|
+| 								|		| 									|
+| open	| 弹出日历组件,`insert :false` 时生效|- 	|
+
+
+
+
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar](https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar)

+ 36 - 0
uni_modules/uni-collapse/changelog.md

@@ -0,0 +1,36 @@
+## 1.4.3(2022-01-25)
+- 修复 初始化的时候 ,open 属性失效的bug
+## 1.4.2(2022-01-21)
+- 修复 微信小程序resize后组件收起的bug
+## 1.4.1(2021-11-22)
+- 修复 vue3中个别scss变量无法找到的问题
+## 1.4.0(2021-11-19)
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-collapse](https://uniapp.dcloud.io/component/uniui/uni-collapse)
+## 1.3.3(2021-08-17)
+- 优化 show-arrow 属性默认为true
+## 1.3.2(2021-08-17)
+- 新增 show-arrow 属性,控制是否显示右侧箭头
+## 1.3.1(2021-07-30)
+- 优化 vue3下小程序事件警告的问题
+## 1.3.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.2.2(2021-07-21)
+- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug
+## 1.2.1(2021-07-21)
+- 优化 组件示例
+## 1.2.0(2021-07-21)
+- 新增 组件折叠动画
+- 新增 value\v-model 属性 ,动态修改面板折叠状态
+- 新增 title 插槽 ,可定义面板标题
+- 新增 border 属性 ,显示隐藏面板内容分隔线
+- 新增 title-border 属性 ,显示隐藏面板标题分隔线
+- 修复 resize 方法失效的Bug
+- 修复 change 事件返回参数不正确的Bug
+- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法
+## 1.1.7(2021-05-12)
+- 新增 组件示例地址
+## 1.1.6(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+## 1.1.5(2021-02-05)
+- 调整为uni_modules目录规范

+ 403 - 0
uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue

@@ -0,0 +1,403 @@
+<template>
+	<view class="uni-collapse-item">
+		<!-- onClick(!isOpen) -->
+		<view @click="onClick(!isOpen)" class="uni-collapse-item__title"
+			:class="{'is-open':isOpen &&titleBorder === 'auto' ,'uni-collapse-item-border':titleBorder !== 'none'}">
+			<view class="uni-collapse-item__title-wrap">
+				<slot name="title">
+					<view class="uni-collapse-item__title-box" :class="{'is-disabled':disabled}">
+						<image v-if="thumb" :src="thumb" class="uni-collapse-item__title-img" />
+						<text class="uni-collapse-item__title-text">{{ title }}</text>
+					</view>
+				</slot>
+			</view>
+			<view v-if="showArrow"
+				:class="{ 'uni-collapse-item__title-arrow-active': isOpen, 'uni-collapse-item--animation': showAnimation === true }"
+				class="uni-collapse-item__title-arrow">
+				<uni-icons :color="disabled?'#ddd':'#bbb'" size="14" type="bottom" />
+			</view>
+		</view>
+		<view class="uni-collapse-item__wrap" :class="{'is--transition':showAnimation}"
+			:style="{height: (isOpen?height:0) +'px'}">
+			<view :id="elId" ref="collapse--hook" class="uni-collapse-item__wrap-content"
+				:class="{open:isheight,'uni-collapse-item--border':border&&isOpen}">
+				<slot></slot>
+			</view>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	// #ifdef APP-NVUE
+	const dom = weex.requireModule('dom')
+	// #endif
+	/**
+	 * CollapseItem 折叠面板子组件
+	 * @description 折叠面板子组件
+	 * @property {String} title 标题文字
+	 * @property {String} thumb 标题左侧缩略图
+	 * @property {String} name 唯一标志符
+	 * @property {Boolean} open = [true|false] 是否展开组件
+	 * @property {Boolean} titleBorder = [true|false] 是否显示标题分隔线
+	 * @property {Boolean} border = [true|false] 是否显示分隔线
+	 * @property {Boolean} disabled = [true|false] 是否展开面板
+	 * @property {Boolean} showAnimation = [true|false] 开启动画
+	 * @property {Boolean} showArrow = [true|false] 是否显示右侧箭头
+	 */
+	export default {
+		name: 'uniCollapseItem',
+		props: {
+			// 列表标题
+			title: {
+				type: String,
+				default: ''
+			},
+			name: {
+				type: [Number, String],
+				default: ''
+			},
+			// 是否禁用
+			disabled: {
+				type: Boolean,
+				default: false
+			},
+			// #ifdef APP-PLUS
+			// 是否显示动画,app 端默认不开启动画,卡顿严重
+			showAnimation: {
+				type: Boolean,
+				default: false
+			},
+			// #endif
+			// #ifndef APP-PLUS
+			// 是否显示动画
+			showAnimation: {
+				type: Boolean,
+				default: true
+			},
+			// #endif
+			// 是否展开
+			open: {
+				type: Boolean,
+				default: false
+			},
+			// 缩略图
+			thumb: {
+				type: String,
+				default: ''
+			},
+			// 标题分隔线显示类型
+			titleBorder: {
+				type: String,
+				default: 'auto'
+			},
+			border: {
+				type: Boolean,
+				default: true
+			},
+			showArrow: {
+				type: Boolean,
+				default: true
+			}
+		},
+		data() {
+			// TODO 随机生生元素ID,解决百度小程序获取同一个元素位置信息的bug
+			const elId = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
+			return {
+				isOpen: false,
+				isheight: null,
+				height: 0,
+				elId,
+				nameSync: 0
+			}
+		},
+		watch: {
+			open(val) {
+				this.isOpen = val
+				this.onClick(val, 'init')
+			}
+		},
+		updated(e) {
+			this.$nextTick(() => {
+				this.init(true)
+			})
+		},
+		created() {
+			this.collapse = this.getCollapse()
+			this.oldHeight = 0
+			this.onClick(this.open, 'init')
+		},
+		// #ifndef VUE3
+		// TODO vue2
+		destroyed() {
+			if (this.__isUnmounted) return
+			this.uninstall()
+		},
+		// #endif
+		// #ifdef VUE3
+		// TODO vue3
+		unmounted() {
+			this.__isUnmounted = true
+			this.uninstall()
+		},
+		// #endif
+		mounted() {
+			if (!this.collapse) return
+			if (this.name !== '') {
+				this.nameSync = this.name
+			} else {
+				this.nameSync = this.collapse.childrens.length + ''
+			}
+			if (this.collapse.names.indexOf(this.nameSync) === -1) {
+				this.collapse.names.push(this.nameSync)
+			} else {
+				console.warn(`name 值 ${this.nameSync} 重复`);
+			}
+			if (this.collapse.childrens.indexOf(this) === -1) {
+				this.collapse.childrens.push(this)
+			}
+			this.init()
+		},
+		methods: {
+			init(type) {
+				// #ifndef APP-NVUE
+				this.getCollapseHeight(type)
+				// #endif
+				// #ifdef APP-NVUE
+				this.getNvueHwight(type)
+				// #endif
+			},
+			uninstall() {
+				if (this.collapse) {
+					this.collapse.childrens.forEach((item, index) => {
+						if (item === this) {
+							this.collapse.childrens.splice(index, 1)
+						}
+					})
+					this.collapse.names.forEach((item, index) => {
+						if (item === this.nameSync) {
+							this.collapse.names.splice(index, 1)
+						}
+					})
+				}
+			},
+			onClick(isOpen, type) {
+				if (this.disabled) return
+				this.isOpen = isOpen
+				if (this.isOpen && this.collapse) {
+					this.collapse.setAccordion(this)
+				}
+				if (type !== 'init') {
+					this.collapse.onChange(isOpen, this)
+				}
+			},
+			getCollapseHeight(type, index = 0) {
+				const views = uni.createSelectorQuery().in(this)
+				views
+					.select(`#${this.elId}`)
+					.fields({
+						size: true
+					}, data => {
+						// TODO 百度中可能获取不到节点信息 ,需要循环获取
+						if (index >= 10) return
+						if (!data) {
+							index++
+							this.getCollapseHeight(false, index)
+							return
+						}
+						// #ifdef APP-NVUE
+						this.height = data.height + 1
+						// #endif
+						// #ifndef APP-NVUE
+						this.height = data.height
+						// #endif
+						this.isheight = true
+						if (type) return
+						this.onClick(this.isOpen, 'init')
+					})
+					.exec()
+			},
+			getNvueHwight(type) {
+				const result = dom.getComponentRect(this.$refs['collapse--hook'], option => {
+					if (option && option.result && option.size) {
+						// #ifdef APP-NVUE
+						this.height = option.size.height + 1
+						// #endif
+						// #ifndef APP-NVUE
+						this.height = option.size.height
+						// #endif
+						this.isheight = true
+						if (type) return
+						this.onClick(this.open, 'init')
+					}
+				})
+			},
+			/**
+			 * 获取父元素实例
+			 */
+			getCollapse(name = 'uniCollapse') {
+				let parent = this.$parent;
+				let parentName = parent.$options.name;
+				while (parentName !== name) {
+					parent = parent.$parent;
+					if (!parent) return false;
+					parentName = parent.$options.name;
+				}
+				return parent;
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.uni-collapse-item {
+		/* #ifndef APP-NVUE */
+		box-sizing: border-box;
+
+		/* #endif */
+		&__title {
+			/* #ifndef APP-NVUE */
+			display: flex;
+			width: 100%;
+			box-sizing: border-box;
+			/* #endif */
+			flex-direction: row;
+			align-items: center;
+			transition: border-bottom-color .3s;
+
+			// transition-property: border-bottom-color;
+			// transition-duration: 5s;
+			&-wrap {
+				width: 100%;
+				flex: 1;
+
+			}
+
+			&-box {
+				padding: 0 15px;
+				/* #ifndef APP-NVUE */
+				display: flex;
+				width: 100%;
+				box-sizing: border-box;
+				/* #endif */
+				flex-direction: row;
+				justify-content: space-between;
+				align-items: center;
+				height: 48px;
+				line-height: 48px;
+				background-color: #fff;
+				color: #303133;
+				font-size: 13px;
+				font-weight: 500;
+				/* #ifdef H5 */
+				cursor: pointer;
+				outline: none;
+
+				/* #endif */
+				&.is-disabled {
+					.uni-collapse-item__title-text {
+						color: #999;
+					}
+				}
+
+			}
+
+			&.uni-collapse-item-border {
+				border-bottom: 1px solid #ebeef5;
+			}
+
+			&.is-open {
+				border-bottom-color: transparent;
+			}
+
+			&-img {
+				height: 22px;
+				width: 22px;
+				margin-right: 10px;
+			}
+
+			&-text {
+				flex: 1;
+				font-size: 18px;
+				font-weight: 600;
+				/* #ifndef APP-NVUE */
+				white-space: nowrap;
+				color: inherit;
+				/* #endif */
+				/* #ifdef APP-NVUE */
+				lines: 1;
+				/* #endif */
+				overflow: hidden;
+				text-overflow: ellipsis;
+			}
+
+			&-arrow {
+				/* #ifndef APP-NVUE */
+				display: flex;
+				box-sizing: border-box;
+				/* #endif */
+				align-items: center;
+				justify-content: center;
+				width: 20px;
+				height: 20px;
+				margin-right: 10px;
+				transform: rotate(0deg);
+
+				&-active {
+					transform: rotate(-180deg);
+				}
+			}
+
+
+		}
+
+		&__wrap {
+			/* #ifndef APP-NVUE */
+			will-change: height;
+			box-sizing: border-box;
+			/* #endif */
+			background-color: #fff;
+			overflow: hidden;
+			position: relative;
+			height: 0;
+
+			&.is--transition {
+				// transition: all 0.3s;
+				transition-property: height, border-bottom-width;
+				transition-duration: 0.3s;
+				/* #ifndef APP-NVUE */
+				will-change: height;
+				/* #endif */
+			}
+
+
+
+			&-content {
+				position: absolute;
+				font-size: 13px;
+				color: #303133;
+				// transition: height 0.3s;
+				border-bottom-color: transparent;
+				border-bottom-style: solid;
+				border-bottom-width: 0;
+
+				&.uni-collapse-item--border {
+					border-bottom-width: 1px;
+					border-bottom-color: red;
+					border-bottom-color: #ebeef5;
+				}
+
+				&.open {
+					position: relative;
+				}
+			}
+		}
+
+		&--animation {
+			transition-property: transform;
+			transition-duration: 0.3s;
+			transition-timing-function: ease;
+		}
+
+	}
+</style>

+ 147 - 0
uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue

@@ -0,0 +1,147 @@
+<template>
+	<view class="uni-collapse">
+		<slot />
+	</view>
+</template>
+<script>
+	/**
+	 * Collapse 折叠面板
+	 * @description 展示可以折叠 / 展开的内容区域
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=23
+	 * @property {String|Array} value 当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array)
+	 * @property {Boolean} accordion = [true|false] 是否开启手风琴效果是否开启手风琴效果
+	 * @event {Function} change 切换面板时触发,如果是手风琴模式,返回类型为string,否则为array
+	 */
+	export default {
+		name: 'uniCollapse',
+		emits:['change','activeItem','input','update:modelValue'],
+		props: {
+			value: {
+				type: [String, Array],
+				default: ''
+			},
+			modelValue: {
+				type: [String, Array],
+				default: ''
+			},
+			accordion: {
+				// 是否开启手风琴效果
+				type: [Boolean, String],
+				default: false
+			},
+		},
+		data() {
+			return {}
+		},
+		computed: {
+			// TODO 兼容 vue2 和 vue3
+			dataValue() {
+				let value = (typeof this.value === 'string' && this.value === '') ||
+					(Array.isArray(this.value) && this.value.length === 0)
+				let modelValue = (typeof this.modelValue === 'string' && this.modelValue === '') ||
+					(Array.isArray(this.modelValue) && this.modelValue.length === 0)
+				if (value) {
+					return this.modelValue
+				}
+				if (modelValue) {
+					return this.value
+				}
+
+				return this.value
+			}
+		},
+		watch: {
+			dataValue(val) {
+				this.setOpen(val)
+			}
+		},
+		created() {
+			this.childrens = []
+			this.names = []
+		},
+		mounted() {
+			this.$nextTick(()=>{
+				this.setOpen(this.dataValue)
+			})
+		},
+		methods: {
+			setOpen(val) {
+				let str = typeof val === 'string'
+				let arr = Array.isArray(val)
+				this.childrens.forEach((vm, index) => {
+					if (str) {
+						if (val === vm.nameSync) {
+							if (!this.accordion) {
+								console.warn('accordion 属性为 false ,v-model 类型应该为 array')
+								return
+							}
+							vm.isOpen = true
+						}
+					}
+					if (arr) {
+						val.forEach(v => {
+							if (v === vm.nameSync) {
+								if (this.accordion) {
+									console.warn('accordion 属性为 true ,v-model 类型应该为 string')
+									return
+								}
+								vm.isOpen = true
+							}
+						})
+					}
+				})
+				this.emit(val)
+			},
+			setAccordion(self) {
+				if (!this.accordion) return
+				this.childrens.forEach((vm, index) => {
+					if (self !== vm) {
+						vm.isOpen = false
+					}
+				})
+			},
+			resize() {
+				this.childrens.forEach((vm, index) => {
+					// #ifndef APP-NVUE
+					vm.getCollapseHeight()
+					// #endif
+					// #ifdef APP-NVUE
+					vm.getNvueHwight()
+					// #endif
+				})
+			},
+			onChange(isOpen, self) {
+				let activeItem = []
+
+				if (this.accordion) {
+					activeItem = isOpen ? self.nameSync : ''
+				} else {
+					this.childrens.forEach((vm, index) => {
+						if (vm.isOpen) {
+							activeItem.push(vm.nameSync)
+						}
+					})
+				}
+				this.$emit('change', activeItem)
+				this.emit(activeItem)
+			},
+			emit(val){
+				this.$emit('input', val)
+				this.$emit('update:modelValue', val)
+			}
+		}
+	}
+</script>
+<style lang="scss" >
+	.uni-collapse {
+		/* #ifndef APP-NVUE */
+		width: 100%;
+		display: flex;
+		/* #endif */
+		/* #ifdef APP-NVUE */
+		flex: 1;
+		/* #endif */
+		flex-direction: column;
+		background-color: #fff;
+	}
+</style>

+ 0 - 0
uni_modules/uni-collapse/package.json


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff