ss hai 1 ano
pai
achega
d86dc30c33
Modificáronse 64 ficheiros con 6918 adicións e 0 borrados
  1. 2 0
      .gitignore
  2. 541 0
      App.vue
  3. 1 0
      common/util/jweixin.js
  4. 131 0
      components/cmodel/cmodel.vue
  5. 170 0
      components/cpicker/cpicker.vue
  6. 1 0
      components/w-picker/areadata/areadata.js
  7. 742 0
      components/w-picker/date-picker.vue
  8. 345 0
      components/w-picker/half-picker.vue
  9. 274 0
      components/w-picker/linkage-picker.vue
  10. 344 0
      components/w-picker/range-picker.vue
  11. 183 0
      components/w-picker/region-picker.vue
  12. 129 0
      components/w-picker/selector-picker.vue
  13. 250 0
      components/w-picker/shortterm-picker.vue
  14. 218 0
      components/w-picker/time-picker.vue
  15. 26 0
      components/w-picker/w-picker.css
  16. 340 0
      components/w-picker/w-picker.vue
  17. BIN=BIN
      images/address.png
  18. BIN=BIN
      images/avatar.png
  19. BIN=BIN
      images/banner.png
  20. BIN=BIN
      images/duihao-bg.png
  21. BIN=BIN
      images/duihao-red.png
  22. BIN=BIN
      images/duihao.png
  23. BIN=BIN
      images/jiantouyou.png
  24. BIN=BIN
      images/kapianbeijing@2x.png
  25. BIN=BIN
      images/login-pass.png
  26. BIN=BIN
      images/login-phone.png
  27. BIN=BIN
      images/loginbg.png
  28. BIN=BIN
      images/money.png
  29. BIN=BIN
      images/no_data.png
  30. BIN=BIN
      images/on-line-bg.png
  31. BIN=BIN
      images/on-line-ico.png
  32. BIN=BIN
      images/phbg.png
  33. BIN=BIN
      images/phone-book-bg.png
  34. BIN=BIN
      images/phone-book-ico.png
  35. BIN=BIN
      images/qrcode.png
  36. BIN=BIN
      images/select-worker.png
  37. BIN=BIN
      images/tongxingma.png
  38. BIN=BIN
      images/userbg.png
  39. BIN=BIN
      images/xiangyou-xiao.png
  40. BIN=BIN
      images/xiangyou.png
  41. BIN=BIN
      images/yishiyong.png
  42. BIN=BIN
      images/yiyuyue.png
  43. BIN=BIN
      images/youjiantou-hui@2x.png
  44. BIN=BIN
      images/yuyuebtn.png
  45. 16 0
      main.js
  46. 98 0
      manifest.json
  47. 112 0
      pages.json
  48. 308 0
      pages/index/add.vue
  49. 348 0
      pages/index/index.vue
  50. 79 0
      pages/index/success.vue
  51. 112 0
      pages/index/wechat.vue
  52. 175 0
      pages/index/worker.vue
  53. 382 0
      pages/order/add.vue
  54. 499 0
      pages/order/detail.vue
  55. 443 0
      pages/order/index.vue
  56. 254 0
      pages/order/send.vue
  57. 163 0
      pages/order/worker.vue
  58. 153 0
      pages/user/index.vue
  59. BIN=BIN
      static/home1.png
  60. BIN=BIN
      static/home2.png
  61. BIN=BIN
      static/logo.png
  62. BIN=BIN
      static/user1.png
  63. BIN=BIN
      static/user2.png
  64. 79 0
      uni.scss

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+unpackage
+.hbuilderx

+ 541 - 0
App.vue

@@ -0,0 +1,541 @@
+<script>
+	export default {
+		globalData: {  
+			host: 'http://wy2.jiliyilian.com/wap',
+			serverUrl: 'http://wy2.jiliyilian.com/api/h5/',
+			uploadServerUrl: 'http://wy2.jiliyilian.com/api/h5/',
+			appId: 'wx98c5fd5111be3125',
+			redirectUri: 'http://wy2.jiliyilian.com/wap/ph/#/pages/index/wechat',
+			storagePre: 'ph_',
+			userinfo:{}
+		},
+		onLaunch: function() {
+            var app = getApp();
+            var orgId = this.getUrlCode('orgId');
+			 // var orgId = 3;
+            //alert('当前url:'+window.location.href+'参数:'+orgId);
+			if(orgId){
+				uni.setStorageSync(app.globalData.storagePre+'orgId',orgId);
+				app.globalData.userinfo.orgId = orgId;
+			}else{
+				orgId = uni.getStorageSync(app.globalData.storagePre+'orgId');
+				if(orgId){
+					app.globalData.userinfo.orgId = orgId;
+				}else{
+					uni.showToast({
+						title: '参数错误',
+						icon: 'none',
+						duration: 2000
+					})
+				}
+			}
+			
+			let token = uni.getStorageSync(app.globalData.storagePre+'token');
+			if(token){
+				app.globalData.userinfo.token = token;
+				app.globalData.userinfo.userId = uni.getStorageSync(app.globalData.storagePre+'userId');
+			}
+			if(orgId){
+				app.globalData.userinfo.orgId = orgId;
+			}else{
+				app.globalData.userinfo.orgId = 0;
+			}
+		// app.globalData.userinfo.orgId = 3;
+		// app.globalData.userinfo.token = '4914243105615';
+		// app.globalData.userinfo.userId = 4;
+			this.checkLogin();
+		},
+		onShow: function() {
+			console.log('App Show')
+		},
+		onHide: function() {
+			console.log('App Hide')
+		},
+		methods: {
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+			checkLogin: function(){ // 陪护调度端
+				var app = getApp();
+				var token = app.globalData.userinfo.token;
+				if(!token){
+					uni.reLaunch({ //关闭所有页面,跳转到闪屏页
+						url: '/pages/index/wechat'
+					})
+				}
+			},
+			checkCode:function(code){
+			    if(code == -100){
+					uni.showToast({
+						title: '登录超时,请重新登录',
+						icon: 'none',
+						duration: 2000
+					})
+					var app = getApp();
+					uni.removeStorageSync(app.globalData.storagePre+'token');
+					uni.removeStorageSync(app.globalData.storagePre+'userId');
+					setTimeout(function(){
+						uni.reLaunch({ //关闭所有页面,打开到应用内的某个页面
+							url: '/pages/index/wechat'
+						})
+					},2000);
+					return false;
+			    }
+			    return true;
+			},
+			ajax: function(params){
+			    if (!params.type) {
+					var type = 'POST';
+			    }else{
+					var type = params.type;
+			    }
+			    if (!params.apiname) {
+					var apiname = '1';
+			    } else {
+					var apiname = params.apiname;
+			    }
+			    if (!params.data) {
+					var data = [];
+			    }else{
+					var data = params.data;
+			    }
+			    var app = getApp();
+			    var token = app.globalData.userinfo.token;
+				var userId = app.globalData.userinfo.userId;
+			    if (!token || token == undefined) { //未登录
+					uni.showToast({
+						title: '未登录',
+						icon: 'none',
+						duration: 2000
+					});
+					uni.removeStorageSync(app.globalData.storagePre+'token');
+					uni.removeStorageSync(app.globalData.storagePre+'userId');
+					setTimeout(function () {
+						uni.reLaunch({ //关闭所有页面,跳转到闪屏页
+							url: '/pages/index/wechat'
+						})
+					}, 2000);
+			      return false;
+			    }
+			    data['token'] = token;
+				data['userId'] = userId;
+				
+				var orgId = app.globalData.userinfo.orgId;
+				if(orgId){
+					data['orgId'] = orgId;
+				}
+				
+			  //   uni.showLoading({
+					// title: '加载中',
+					// mask: true
+			  //   });
+			    
+			    uni.request({
+					url: params.url,
+					data: data,
+					method: type,
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					success: function (res) {
+						uni.hideLoading();
+						uni.stopPullDownRefresh();
+						var ret = app.checkCode(res.data.code); //检查token是否失效
+						if(ret == false){
+							return false;
+						}
+			
+						if (res.data.code == 0) {
+							if (app.ajaxReadyCallback) { //在onShow中调用数据的,添加在onShow方法内,防止不同页面覆盖
+								res.data['apiname'] = apiname;
+								app.ajaxReadyCallback(res)
+							}
+						} else {
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					},
+					fail: function (err) {
+						uni.hideLoading();
+						uni.showToast({
+							title: '请求失败',
+							icon: 'none',
+							duration: 2000
+						})
+					}
+			    })
+			},
+			ajaxUnlogin: function(params){
+			    if (!params.type) {
+					var type = 'POST';
+			    }else{
+					var type = params.type;
+			    }
+			    if (!params.apiname) {
+					var apiname = '1';
+			    } else {
+					var apiname = params.apiname;
+			    }
+			    if (!params.data) {
+					var data = [];
+			    }else{
+					var data = params.data;
+			    }
+			    var app = getApp();	
+				var orgId = app.globalData.userinfo.orgId;
+				if(orgId){
+					data['orgId'] = orgId;
+				}
+				
+			  //   uni.showLoading({
+					// title: '加载中',
+					// mask: true
+			  //   });
+			    
+			    uni.request({
+					url: params.url,
+					data: data,
+					method: type,
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					success: function (res) {
+						uni.hideLoading();
+						uni.stopPullDownRefresh();
+						var ret = app.checkCode(res.data.code); //检查token是否失效
+						if(ret == false){
+							return false;
+						}
+			
+						if (res.data.code == 0) {
+							if (app.ajaxReadyCallback) { //在onShow中调用数据的,添加在onShow方法内,防止不同页面覆盖
+								res.data['apiname'] = apiname;
+								app.ajaxReadyCallback(res)
+							}
+						} else {
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					},
+					fail: function (err) {
+						uni.hideLoading();
+						uni.showToast({
+							title: '请求失败',
+							icon: 'none',
+							duration: 2000
+						})
+					}
+			    })
+			}
+		}
+		
+		
+	}
+</script>
+
+<style>
+	/*每个页面公共css */
+	page{
+		background-color: #F3F3F3;
+		--themeColor:#023894;
+	}
+	.no-data{
+		width: 100%;
+		height: auto;
+		margin: 0 auto;
+		margin-top: 20%;
+		text-align: center;
+	}
+	.no-data image{
+		width: 430rpx;
+		height: 316rpx;
+	}
+	.no-data .no-data-text{
+		color: #C5C8D9;
+		font-size: 25rpx;
+	}
+	
+	.pull-right{
+		float: right!important;
+	}
+	.text-red{
+		color: var(--themeColor);
+	}
+	
+	.container{
+		padding: 20rpx;
+	}
+	.worker-box{
+	  position: relative;
+	  width: 670rpx;
+	  height: auto;
+	  margin-bottom: 20rpx;
+	  /* overflow: hidden; */
+	  padding: 0 20rpx;
+	  background-color: #ffffff;
+	  border-radius: 10rpx;
+	}
+	.worker-box.cur{
+	  border: 4rpx solid var(--themeColor);
+	}
+	.worker-box .worker-box-select{
+	  display: none;
+	}
+	.worker-box.cur .worker-box-select{
+	  display: inline-block;
+	  width: 66rpx;
+	  height: 68rpx;
+	  position: absolute;
+	  z-index: 5;
+	  top: -2rpx;
+	  right: -2rpx;
+	}
+	.worker-box .worker-box-header{
+	  height: 90rpx;
+	  line-height: 90rpx;
+	  font-size: 32rpx;
+	  font-weight: bold;
+	  color: #333333;
+	  margin-bottom: 20rpx;
+	}
+	.worker-box .worker-box-info{
+	  padding: 30rpx 0;
+	  width: 100%;
+	  height: 130rpx;
+	  overflow: hidden;
+	  
+	}
+	.worker-box .worker-box-info .worker-box-avator{
+	  position: relative;
+	  width: 130rpx;
+	  height: 130rpx;
+	  float: left;
+	}
+	.worker-box .worker-box-info .worker-box-avator image{
+	  width: 100%;
+	  height: 100%;
+	  border-radius: 50%;
+	}
+	.worker-box .worker-box-info .worker-box-avator .worker-box-status{
+	  position: absolute;
+	  z-index: 10;
+	  bottom: 0;
+	  left: 0;
+	  width: 100%;
+	  height: 36rpx;
+	  border-radius: 18rpx;
+	  color: #ffffff;
+	  background-color: var(--themeColor);
+	  text-align: center;
+	  font-size: 26rpx;
+	}
+	.worker-box .worker-box-info .worker-box-avator .worker-box-status.color2{
+	  background-color: #23C1CF;
+	}
+	.worker-box .worker-box-info .worker-box-body{
+	  width: 520rpx;
+	  height: 130rpx;
+	  float: right;
+	}
+	.worker-box .worker-box-info .worker-box-body .worker-box-title{
+	  color: #333333;
+	  font-size: 30rpx;
+	  font-weight: bold;
+	  line-height: 50rpx;
+	}
+	.worker-box .worker-box-info .worker-box-body .worker-box-star{
+	  display: inline-block;
+	  width: auto;
+	  float: right;
+	}
+	.worker-box .worker-box-info .worker-box-body .worker-box-desc{
+	  color: #999999;
+	  font-size: 26rpx;
+	  line-height: 40rpx;
+	  height: 40rpx;
+	  overflow: hidden; 
+	  text-overflow: ellipsis;
+	  white-space:nowrap; 
+	}
+	.worker-box .worker-box-footer{
+	  line-height: 99rpx;
+	  height: 99rpx;
+	  border-top: 1rpx solid #D9D9D9;
+	}
+	.worker-box .worker-box-footer image{
+	  width: 36rpx;
+	  height: 36rpx;
+	  vertical-align: middle;
+	}
+	.worker-box .worker-box-footer .worker-box-footer-money{
+	  vertical-align: middle;
+	  padding: 0 10rpx;
+	  font-size: 34rpx;
+	  color: #FF3F40;
+	}
+	.worker-box .worker-box-footer .worker-box-footer-btn{
+	  display: inline-block;
+	  width: 130rpx;
+	  height: 60rpx;
+	  line-height: 60rpx;
+	  color: #ffffff;
+	  background-color: var(--themeColor);
+	  border-radius: 30rpx;
+	  text-align: center;
+	  font-size: 30rpx;
+	  float: right;
+	  margin-top: 20rpx;
+	  margin-left: 10rpx;
+	}
+	.worker-box .worker-box-footer .worker-box-footer-btn-cancel{
+	  display: inline-block;
+	  width: 158rpx;
+	  height: 60rpx;
+	  line-height: 60rpx;
+	  color: #999999;
+	  border: 1rpx solid #B3B3B3;
+	  border-radius: 30rpx;
+	  text-align: center;
+	  font-size: 30rpx;
+	  float: right;
+	  margin-top: 20rpx;
+	  margin-left: 10rpx;
+	}
+	
+	
+	.form-box{
+	  width: 670rpx;
+	  height: 90rpx;
+	  line-height: 90rpx;
+	  background-color: #ffffff;
+	  border-radius: 10rpx;
+	  padding: 0 20rpx;
+	  margin-bottom: 20rpx;
+	  overflow: hidden;
+	}
+	.form-box2{
+	  min-height:200rpx;
+	  height: auto;
+	}
+	.form-box .form-box-label{
+	  display: inline-block;
+	  width: 250rpx;
+	  float: left;
+	  font-size: 34rpx;
+	  font-weight: bold;
+	  color: #333333;
+	}
+	.form-box .form-box-content{
+	  display: inline-block;
+	  width: 400rpx;
+	  float: right;
+	  text-align: right;
+	}
+	.form-box .form-box-content input{
+	  height: 70rpx;
+	  line-height: 70rpx;
+	  vertical-align: middle;
+	  margin-top: 10rpx;
+	}
+	.form-box .form-box-content image{
+	  width: 24rpx;
+	  height: 24rpx;
+	  vertical-align: middle;
+	}
+	.form-box .form-box-content .form-box-content-text{
+	  float: left;
+	  display: inline-block;
+	  width: 360rpx;
+	  overflow: hidden;
+	  font-size: 30rpx;
+	  height: 90rpx;
+	  text-overflow: ellipsis;
+	  white-space:nowrap; 
+	}
+	.form-box .form-box-textarea{
+	  width: 100%;
+	  float: left;
+	  padding-bottom: 20rpx;
+	  overflow: hidden;
+	}
+	.form-box .form-box-textarea textarea{
+	  width: 100%;
+	  padding: 20rpx;
+	  line-height: 40rpx;
+	  background-color: #F7F7F7;
+	}
+	
+	.form-box .form-box-sub{
+	  width: 670rpx;
+	  height: 90rpx;
+	  line-height: 90rpx;
+	  background-color: #ffffff;
+	  border-radius: 10rpx;
+	  padding: 0;
+	  overflow: hidden;
+	}
+
+	.form-box3{
+	  width: 100%;
+	  height: 90rpx;
+	  line-height: 90rpx;
+	  background-color: #ffffff;
+	  border-radius: 10rpx;
+	  padding: 0 20rpx;
+	  margin-bottom: 20rpx;
+	  overflow: hidden;
+	}
+	.form-box3 .form-box-label{
+	  display: inline-block;
+	  width: 40%;
+	  float: left;
+	  font-size: 34rpx;
+	  font-weight: bold;
+	  color: #333333;
+	}
+	.form-box3 .form-box-content{
+	  display: inline-block;
+	  width: 50%;
+	  float: left;
+	  text-align: right;
+	}
+	.form-box3 .form-box-content input{
+	  height: 70rpx;
+	  line-height: 70rpx;
+	  vertical-align: middle;
+	  margin-top: 10rpx;
+	}
+	.form-box3 .form-box-content image{
+	  width: 24rpx;
+	  height: 24rpx;
+	  vertical-align: middle;
+	}
+	.form-box3 .form-box-content .form-box-content-text{
+	  // float: left;
+	  display: inline-block;
+	  width: 85%;
+	  overflow: hidden;
+	  font-size: 30rpx;
+	  height: 90rpx;
+	  text-overflow: ellipsis;
+	  white-space:nowrap; 
+	}
+	.form-box3 .form-box-textarea{
+	  width: 100%;
+	  float: left;
+	  padding-bottom: 20rpx;
+	  overflow: hidden;
+	}
+	.form-box3 .form-box-textarea textarea{
+	  width: 100%;
+	  padding: 20rpx;
+	  line-height: 40rpx;
+	  background-color: #F7F7F7;
+	}
+</style>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 0
common/util/jweixin.js


+ 131 - 0
components/cmodel/cmodel.vue

@@ -0,0 +1,131 @@
+<template>
+	<view>
+		<view class='modal-mask' v-if='show' @click='clickMask'>
+		  <view class='modal-content'>
+		    <view class='modal-header'>
+		      {{title}}
+		    </view>
+		    <scroll-view scroll-y class='main-content'>
+		      <slot></slot>
+		    </scroll-view>
+		    <view class='modal-footer'>
+		      <view v-if='!single' class='cancel-btn' @click='cancel'>取消</view>
+		      <view class='confirm-btn' @click='confirm'>确定 </view>
+		    </view>
+		  </view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "cmodel",
+		components: {
+		
+		},
+		props: {
+			//是否显示modal弹窗
+			show: {
+				type: Boolean,
+				value: false
+			},
+			//控制底部是一个按钮还是两个按钮,默认两个
+			single: {
+				type: Boolean,
+				value: false 
+			},
+			title: {
+				type: String,
+				value: '提示' 
+			}
+		},
+		data() {
+			return {
+				
+			}
+		},
+        mounted() {
+			console.log(this.show);
+        },
+		methods: {
+			clickMask() {
+			  
+			},
+			// 点击取消按钮的回调函数
+			cancel() {
+				this.$emit('update:show', false);
+				this.$emit('cancel');
+			},
+			// 点击确定按钮的回调函数
+			confirm() {
+			  this.$emit('update:show', false);
+			  this.$emit('confirm');
+			}
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	/*遮罩层*/
+	.modal-mask{
+	    display: flex;
+	    justify-content: center;
+	    align-items: center;
+	    position: fixed;
+	    left: 0;
+	    right: 0;
+	    top: 0;
+	    bottom: 0;
+	    background-color: rgba(0,0,0,0.5);
+	    z-index: 999;
+	  }
+	  /*遮罩内容*/
+	  .modal-content{
+	    display: flex;
+	    flex-direction: column;
+	    width: 80%;
+	    background-color: #fff;
+	    border-radius: 10rpx;
+	    padding: 20rpx;
+	    text-align: left;
+	  }
+	  /*中间内容*/
+	  .main-content{
+	    flex: 1;
+	    height: 100%;
+	    min-height: 100rpx;
+	    max-height: 400rpx;
+	    overflow-y: hidden; 
+	  }
+	  .modal-header{
+	    height: 80rpx;
+	    line-height: 80rpx;
+	    text-align: center;
+	    margin-bottom: 30rpx;
+	    border-bottom: 1rpx solid #D2D3D5;
+	  }
+	  /*底部按钮*/
+	  .modal-footer{
+	    display: flex;
+	    flex-direction: row;
+	    height: 80rpx;
+	    line-height: 80rpx;
+	    border-top: 1rpx solid #D2D3D5;
+	    margin-top: 30rpx;
+	    text-align: center;
+	  }
+	  .cancel-btn, .confirm-btn{
+	    flex: 1;
+	    height: 100rpx;
+	    line-height: 100rpx;
+	    text-align: center;
+	    font-size: 32rpx;
+	  }
+	  .cancel-btn{
+	    color: #000;
+	    border-right: 1rpx solid #D2D3D5;
+	  }
+	  .confirm-btn {
+	    color: var(--themeColor)
+	  }
+</style>

+ 170 - 0
components/cpicker/cpicker.vue

@@ -0,0 +1,170 @@
+<template>
+	<view>
+		<view v-if="show" class="cpicker-mask">
+		  <view class="cpicker-box">
+		    <view class="cpicker-box-header">{{title}}</view>
+		    <scroll-view scroll-y class='main-content'>
+		      <view v-for="(item,index) in list" :key="index" class="cpicker-option" :data-id="item.id" @click="clickOption">
+		        {{item.title}}
+		        <image v-if="item.id == defaultId" class="cpicker-option-checked" src="../../images/duihao-red.png"></image>
+		      </view>
+		    </scroll-view>
+		    <view class='modal-footer'>
+		      <view class='cancel-btn' @click='cancel'>取消</view>
+		      <view class='confirm-btn' @click='confirm'>确定 </view>
+		    </view>
+		  </view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "cpicker",
+		components: {
+		
+		},
+		props: {
+			title: {
+				type: String,
+				default: "请选择"
+			},
+			show: {
+				type: Boolean,
+				default: false
+			},
+			list: {
+				type: Array,
+				value: [] //[{id:1,title:'五星花园'},{id:2,title:'陪护单类型选错了陪护单类型选错了'}]
+			},
+			did: { //默认值
+				type: Number,
+				value: 0,
+			}
+		},
+		data() {
+			return {
+				defaultId: 0
+			}
+		},
+        mounted() {
+			this.defaultId = this.did;
+          console.log(this.list,this.show);
+        },
+		methods: {
+			// 点击modal的回调函数
+			clickOption(e) {
+				this.defaultId = e.currentTarget.dataset.id;
+			},
+			// 点击取消按钮的回调函数
+			cancel() {
+				// this.show = false;
+				this.$emit('update:show', false);
+				// this.triggerEvent('cancel')  //triggerEvent触发事件
+				this.$emit('cancel');
+			},
+			// 点击确定按钮的回调函数
+			confirm() {
+				this.$emit('update:show', false);
+				let sinfo = null;
+				this.list.forEach((item) => {
+					if(item.id == this.defaultId){
+						sinfo = item;
+					}
+				});
+				// this.triggerEvent('confirm',sinfo);
+				this.$emit('confirm',sinfo);
+			}
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	/*遮罩层*/
+	.cpicker-mask{
+	  display: flex;
+	  justify-content: center;
+	  align-items: center;
+	  position: fixed;
+	  left: 0;
+	  right: 0;
+	  top: 0;
+	  bottom: 0;
+	  background-color: rgba(0,0,0,0.6);
+	  z-index: 999999999999;
+	}
+	  /*遮罩内容*/
+	.cpicker-box{
+	  display: flex;
+	  flex-direction: column;
+	  width: 600rpx;
+	  background-color: #fff;
+	  border-radius: 10rpx;
+	  /* padding: 20rpx; */
+	  text-align: center;
+	  font-size: 30rpx;
+	  color: #333333;
+	  /* font-weight: bold; */
+	}
+	.cpicker-box-header{
+	  height: 90rpx;
+	  line-height: 90rpx;
+	  border-bottom: 1rpx solid #e6e4e4;
+	}
+  /*中间内容*/
+  .main-content{
+	flex: 1;
+	/* height: 100%; */
+	min-height: 200rpx;
+	overflow-y: hidden; 
+	max-height:40vh;
+	padding-top: 20rpx;
+  }
+
+  .cpicker-option{
+	position: relative;
+	width: 460rpx;
+	height: 70rpx;
+	line-height: 70rpx;
+	/* text-align: left; */
+	padding: 0 70rpx;
+	padding-right: 70rpx;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space:nowrap; 
+  }
+  .cpicker-option-checked{
+	position: absolute;
+	z-index: 10;
+	right: 20rpx;
+	top: 20rpx;
+	width: 30rpx;
+	height: 30rpx;
+  }
+
+  /*底部按钮*/
+  .modal-footer{
+	display: flex;
+	flex-direction: row;
+	height: 90rpx;
+	line-height: 90rpx;
+	border-top: 1rpx solid #e6e4e4;
+	margin-top: 30rpx;
+  }
+  .cancel-btn, .confirm-btn{
+	flex: 1;
+	height: 90rpx;
+	line-height: 90rpx;
+	text-align: center;
+	font-size: 32rpx;
+  }
+  .cancel-btn{
+	color: #333333;
+	border-right: 1rpx solid #e6e4e4;
+  }
+  .confirm-btn {
+	color: var(--themeColor)
+  }
+	  
+	 
+</style>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 0
components/w-picker/areadata/areadata.js


+ 742 - 0
components/w-picker/date-picker.vue

@@ -0,0 +1,742 @@
+<template>
+	<view class="w-picker-view">
+		<picker-view v-if="fields=='year'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view>
+			</picker-view-column>
+		</picker-view>
+		<picker-view v-if="fields=='month'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view>
+			</picker-view-column>
+		</picker-view>
+		<picker-view v-if="fields=='day'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.days" :key="index">{{item}}日</view>
+			</picker-view-column>
+		</picker-view>
+		<picker-view v-if="fields=='hour'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.days" :key="index">{{item}}日</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.hours" :key="index">{{item}}时</view>
+			</picker-view-column>
+		</picker-view>
+		<picker-view v-if="fields=='minute'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.days" :key="index">{{item}}日</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.hours" :key="index">{{item}}时</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.minutes" :key="index">{{item}}分</view>
+			</picker-view-column>
+		</picker-view>
+		<picker-view v-if="fields=='second'" class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.days" :key="index">{{item}}日</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.hours" :key="index">{{item}}时</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.minutes" :key="index">{{item}}分</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.seconds" :key="index">{{item}}秒</view>
+			</picker-view-column>
+		</picker-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				pickVal:[],
+				range:{
+					years:[],
+					months:[],
+					days:[],
+					hours:[],
+					minutes:[],
+					seconds:[]
+				},
+				checkObj:{}
+			};
+		},
+		props:{
+			itemHeight:{
+				type:String,
+				default:"44px"
+			},
+			startYear:{
+				type:[String,Number],
+				default:""
+			},
+			endYear:{
+				type:[String,Number],
+				default:""
+			},
+			value:{
+				type:[String,Array,Number],
+				default:""
+			},
+			current:{//是否默认选中当前日期
+				type:Boolean,
+				default:false
+			},
+			disabledAfter:{//是否禁用当前之后的日期
+				type:Boolean,
+				default:false
+			},
+			fields:{
+				type:String,
+				default:"day"
+			}
+		},
+		watch:{
+			fields(val){
+				this.initData();
+			},
+			value(val){
+				this.initData();
+			}
+		},
+		created() {
+			this.initData();
+		},
+		methods:{
+			formatNum(n){
+				return (Number(n)<10?'0'+Number(n):Number(n)+'');
+			},
+			checkValue(value){
+				let strReg,example
+				switch(this.fields){
+					case "year":
+						strReg=/^\d{4}$/;
+						example="2019";
+						break;
+					case "month":
+						strReg=/^\d{4}-\d{2}$/;
+						example="2019-02";
+						break;
+					case "day":
+						strReg=/^\d{4}-\d{2}-\d{2}$/;
+						example="2019-02-01";
+						break;
+					case "hour":
+						strReg=/^\d{4}-\d{2}-\d{2} \d{2}(:\d{2}){1,2}?$/;
+						example="2019-02-01 18:00:00或2019-02-01 18";
+						break;
+					case "minute":
+						strReg=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(:\d{2}){0,1}?$/;
+						example="2019-02-01 18:06:00或2019-02-01 18:06";
+						break;
+					case "second":
+						strReg=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
+						example="2019-02-01 18:06:01";
+						break;
+				}
+				if(!strReg.test(value)){
+					console.log(new Error("请传入与mode、fields匹配的value值,例value="+example+""))
+				}
+				return strReg.test(value);
+			},
+			resetData(year,month,day,hour,minute){
+				let curDate=this.getCurrenDate();
+				let curFlag=this.current;
+				let curYear=curDate.curYear;
+				let curMonth=curDate.curMonth;
+				let curDay=curDate.curDay;
+				let curHour=curDate.curHour;
+				let curMinute=curDate.curMinute;
+				let curSecond=curDate.curSecond;
+				let months=[],days=[],hours=[],minutes=[],seconds=[];
+				let disabledAfter=this.disabledAfter;
+				let monthsLen=disabledAfter?(year*1<curYear?12:curMonth):12;
+				let totalDays=new Date(year,month,0).getDate();//计算当月有几天;
+				let daysLen=disabledAfter?((year*1<curYear||month*1<curMonth)?totalDays:curDay):totalDays;
+				let hoursLen=disabledAfter?((year*1<curYear||month*1<curMonth||day*1<curDay)?24:curHour+1):24;
+				let minutesLen=disabledAfter?((year*1<curYear||month*1<curMonth||day*1<curDay||hour*1<curHour)?60:curMinute+1):60;
+				let secondsLen=disabledAfter?((year*1<curYear||month*1<curMonth||day*1<curDay||hour*1<curHour||minute*1<curMinute)?60:curSecond+1):60;
+				for(let month=1;month<=monthsLen;month++){
+					months.push(this.formatNum(month));
+				};
+				for(let day=1;day<=daysLen;day++){
+					days.push(this.formatNum(day));
+				}
+				for(let hour=0;hour<hoursLen;hour++){
+					hours.push(this.formatNum(hour));
+				}
+				for(let minute=0;minute<minutesLen;minute++){
+					minutes.push(this.formatNum(minute));
+				}
+				for(let second=0;second<secondsLen;second++){
+					seconds.push(this.formatNum(second));
+				}
+				return{
+					months,
+					days,
+					hours,
+					minutes,
+					seconds
+				}
+			},
+			isLeapYear (Year) {
+				if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0)) {
+					return true;
+				} else { 
+					return false; 
+				}
+			},
+			getData(dVal){
+				//用来处理初始化数据
+				let curFlag=this.current;
+				let disabledAfter=this.disabledAfter;
+				let fields=this.fields;
+				let curDate=this.getCurrenDate();
+				let curYear=curDate.curYear;
+				let curMonthdays=curDate.curMonthdays;
+				let curMonth=curDate.curMonth;
+				let curDay=curDate.curDay;
+				let curHour=curDate.curHour;
+				let curMinute=curDate.curMinute;
+				let curSecond=curDate.curSecond;
+				let defaultDate=this.getDefaultDate();
+				let startYear=this.getStartDate().getFullYear();
+				let endYear=this.getEndDate().getFullYear();
+				//颗粒度,禁用当前之后日期仅对year,month,day,hour生效;分钟秒禁用没有意义,
+				let years=[],months=[],days=[],hours=[],minutes=[],seconds=[];
+				let year=dVal[0]*1;
+				let month=dVal[1]*1;
+				let day=dVal[2]*1;
+				let hour=dVal[3]*1;
+				let minute=dVal[4]*1;
+				let monthsLen=disabledAfter?(year<curYear?12:curDate.curMonth):12;
+				let daysLen=disabledAfter?((year<curYear||month<curMonth)?defaultDate.defaultDays:curDay):(curFlag?curMonthdays:defaultDate.defaultDays);
+				let hoursLen=disabledAfter?((year<curYear||month<curMonth||day<curDay)?24:curHour+1):24;
+				let minutesLen=disabledAfter?((year<curYear||month<curMonth||day<curDay||hour<curHour)?60:curMinute+1):60;
+				let secondsLen=disabledAfter?((year<curYear||month<curMonth||day<curDay||hour<curHour||minute<curMinute)?60:curSecond+1):60;
+				for(let year=startYear;year<=(disabledAfter?curYear:endYear);year++){
+					years.push(year.toString())
+				}
+				for(let month=1;month<=monthsLen;month++){
+					months.push(this.formatNum(month));
+				}
+				for(let day=1;day<=daysLen;day++){
+					days.push(this.formatNum(day));
+				}
+				for(let hour=0;hour<hoursLen;hour++){
+					hours.push(this.formatNum(hour));
+				}
+				for(let minute=0;minute<minutesLen;minute++){
+					minutes.push(this.formatNum(minute));
+				}
+				// for(let second=0;second<(disabledAfter?curDate.curSecond+1:60);second++){
+				// 	seconds.push(this.formatNum(second));
+				// }
+				for(let second=0;second<60;second++){
+					seconds.push(this.formatNum(second));
+				}
+				return {
+					years,
+					months,
+					days,
+					hours,
+					minutes,
+					seconds
+				}
+			},
+			getCurrenDate(){
+				let curDate=new Date();
+				let curYear=curDate.getFullYear();
+				let curMonth=curDate.getMonth()+1;
+				let curMonthdays=new Date(curYear,curMonth,0).getDate();
+				let curDay=curDate.getDate();
+				let curHour=curDate.getHours();
+				let curMinute=curDate.getMinutes();
+				let curSecond=curDate.getSeconds();
+				return{
+					curDate,
+					curYear,
+					curMonth,
+					curMonthdays,
+					curDay,
+					curHour,
+					curMinute,
+					curSecond
+				}
+			},
+			getDefaultDate(){
+				let value=this.value;
+				let reg=/-/g;
+				let defaultDate=value?new Date(value.replace(reg,"/")):new Date();
+				let defaultYear=defaultDate.getFullYear();
+				let defaultMonth=defaultDate.getMonth()+1;
+				let defaultDay=defaultDate.getDate();
+				let defaultDays=new Date(defaultYear,defaultMonth,0).getDate()*1;
+				return{
+					defaultDate,
+					defaultYear,
+					defaultMonth,
+					defaultDay,
+					defaultDays
+				}
+			},
+			getStartDate(){
+				let start=this.startYear;
+				let startDate="";
+				let reg=/-/g;
+				if(start){
+					startDate=new Date(start+"/01/01");
+				}else{
+					startDate=new Date("1970/01/01");
+				}
+				return startDate;
+			},
+			getEndDate(){
+				let end=this.endYear;
+				let reg=/-/g;
+				let endDate="";
+				if(end){
+					endDate=new Date(end+"/12/01");
+				}else{
+					endDate=new Date();
+				}
+				return endDate;
+			},
+			getDval(){
+				let value=this.value;
+				let fields=this.fields;
+				let dVal=null;
+				let aDate=new Date();
+				let year=this.formatNum(aDate.getFullYear());
+				let month=this.formatNum(aDate.getMonth()+1);
+				let day=this.formatNum(aDate.getDate());
+				let hour=this.formatNum(aDate.getHours());
+				let minute=this.formatNum(aDate.getMinutes());
+				let second=this.formatNum(aDate.getSeconds());
+				if(value){
+					let flag=this.checkValue(value);
+					if(!flag){
+						dVal=[year,month,day,hour,minute,second]
+					}else{
+						switch(this.fields){
+							case "year":
+								dVal=value?[value]:[];	
+								break;
+							case "month":
+								dVal=value?value.split("-"):[];
+								break;
+							case "day":
+								dVal=value?value.split("-"):[];
+								break;
+							case "hour":
+								dVal=[...value.split(" ")[0].split("-"),...value.split(" ")[1].split(":")];
+								break;
+							case "minute":
+								dVal=value?[...value.split(" ")[0].split("-"),...value.split(" ")[1].split(":")]:[];
+								break;
+							case "second":
+								dVal=[...value.split(" ")[0].split("-"),...value.split(" ")[1].split(":")];
+								break;
+						}
+					}
+				}else{
+					dVal=[year,month,day,hour,minute,second]
+				}
+				return dVal;
+			},
+			initData(){
+				let startDate,endDate,startYear,endYear,startMonth,endMonth,startDay,endDay;
+				let years=[],months=[],days=[],hours=[],minutes=[],seconds=[];
+				let dVal=[],pickVal=[];
+				let value=this.value;
+				let reg=/-/g;
+				let range={};
+				let result="",full="",year,month,day,hour,minute,second,obj={};
+				let defaultDate=this.getDefaultDate();
+				let defaultYear=defaultDate.defaultYear;
+				let defaultMonth=defaultDate.defaultMonth;
+				let defaultDay=defaultDate.defaultDay;
+				let defaultDays=defaultDate.defaultDays;
+				let curFlag=this.current;
+				let disabledAfter=this.disabledAfter;
+				let curDate=this.getCurrenDate();
+				let curYear=curDate.curYear;
+				let curMonth=curDate.curMonth;
+				let curMonthdays=curDate.curMonthdays;
+				let curDay=curDate.curDay;
+				let curHour=curDate.curHour;
+				let curMinute=curDate.curMinute;
+				let curSecond=curDate.curSecond;
+				let dateData=[];
+				dVal=this.getDval();
+				
+				startDate=this.getStartDate();
+				endDate=this.getEndDate();
+				startYear=startDate.getFullYear();
+				startMonth=startDate.getMonth();
+				startDay=startDate.getDate();
+				endYear=endDate.getFullYear();
+				endMonth=endDate.getMonth();
+				endDay=endDate.getDate();
+				dateData=this.getData(dVal);
+				years=dateData.years;
+				months=dateData.months;
+				days=dateData.days;
+				hours=dateData.hours;
+				minutes=dateData.minutes;
+				seconds=dateData.seconds;
+				switch(this.fields){
+					case "year":
+						pickVal=disabledAfter?[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0
+						]:(curFlag?[
+							years.indexOf(curYear+'')
+						]:[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0
+						]);
+						range={years};
+						year=dVal[0]?dVal[0]:years[0];
+						result=full=`${year}`;
+						obj={
+							year
+						}
+						break;
+					case "month":
+						pickVal=disabledAfter?[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+							dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0
+						]:(curFlag?[
+							years.indexOf(curYear+''),
+							months.indexOf(this.formatNum(curMonth))
+						]:[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+							dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0
+						]);
+						range={years,months};
+						year=dVal[0]?dVal[0]:years[0];
+						month=dVal[1]?dVal[1]:months[0];
+						result=full=`${year+'-'+month}`;
+						obj={
+							year,
+							month
+						}
+						break;
+					case "day":
+						pickVal=disabledAfter?[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+							dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0,
+							dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0
+						]:(curFlag?[
+							years.indexOf(curYear+''),
+							months.indexOf(this.formatNum(curMonth)),
+							days.indexOf(this.formatNum(curDay)),
+						]:[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+							dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0,
+							dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0
+						]);
+						range={years,months,days};
+						year=dVal[0]?dVal[0]:years[0];
+						month=dVal[1]?dVal[1]:months[0];
+						day=dVal[2]?dVal[2]:days[0];
+						result=full=`${year+'-'+month+'-'+day}`;
+						obj={
+							year,
+							month,
+							day
+						}
+						break;
+					case "hour":
+						pickVal=disabledAfter?[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+							dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0,
+							dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0,
+							dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0
+						]:(curFlag?[
+							years.indexOf(curYear+''),
+							months.indexOf(this.formatNum(curMonth)),
+							days.indexOf(this.formatNum(curDay)),
+							hours.indexOf(this.formatNum(curHour)),
+						]:[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+							dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0,
+							dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0,
+							dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0
+						]);
+						range={years,months,days,hours};
+						year=dVal[0]?dVal[0]:years[0];
+						month=dVal[1]?dVal[1]:months[0];
+						day=dVal[2]?dVal[2]:days[0];
+						hour=dVal[3]?dVal[3]:hours[0];
+						result=`${year+'-'+month+'-'+day+' '+hour}`;
+						full=`${year+'-'+month+'-'+day+' '+hour+':00:00'}`;
+						obj={
+							year,
+							month,
+							day,
+							hour
+						}
+						break;
+					case "minute":
+						pickVal=disabledAfter?[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+							dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0,
+							dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0,
+							dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0,
+							dVal[4]&&minutes.indexOf(dVal[4])!=-1?minutes.indexOf(dVal[4]):0
+						]:(curFlag?[
+							years.indexOf(curYear+''),
+							months.indexOf(this.formatNum(curMonth)),
+							days.indexOf(this.formatNum(curDay)),
+							hours.indexOf(this.formatNum(curHour)),
+							minutes.indexOf(this.formatNum(curMinute)),
+						]:[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+							dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0,
+							dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0,
+							dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0,
+							dVal[4]&&minutes.indexOf(dVal[4])!=-1?minutes.indexOf(dVal[4]):0
+						]);
+						range={years,months,days,hours,minutes};
+						year=dVal[0]?dVal[0]:years[0];
+						month=dVal[1]?dVal[1]:months[0];
+						day=dVal[2]?dVal[2]:days[0];
+						hour=dVal[3]?dVal[3]:hours[0];
+						minute=dVal[4]?dVal[4]:minutes[0];
+						full=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':00'}`;
+						result=`${year+'-'+month+'-'+day+' '+hour+':'+minute}`;
+						obj={
+							year,
+							month,
+							day,
+							hour,
+							minute
+						}
+						break;
+					case "second":
+						pickVal=disabledAfter?[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+							dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0,
+							dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0,
+							dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0,
+							dVal[4]&&minutes.indexOf(dVal[4])!=-1?minutes.indexOf(dVal[4]):0,
+							dVal[5]&&seconds.indexOf(dVal[5])!=-1?seconds.indexOf(dVal[5]):0
+						]:(curFlag?[
+							years.indexOf(curYear+''),
+							months.indexOf(this.formatNum(curMonth)),
+							days.indexOf(this.formatNum(curDay)),
+							hours.indexOf(this.formatNum(curHour)),
+							minutes.indexOf(this.formatNum(curMinute)),
+							seconds.indexOf(this.formatNum(curSecond)),
+						]:[
+							dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+							dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0,
+							dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0,
+							dVal[3]&&hours.indexOf(dVal[3])!=-1?hours.indexOf(dVal[3]):0,
+							dVal[4]&&minutes.indexOf(dVal[4])!=-1?minutes.indexOf(dVal[4]):0,
+							dVal[5]&&seconds.indexOf(dVal[5])!=-1?seconds.indexOf(dVal[5]):0
+						]);
+						range={years,months,days,hours,minutes,seconds};
+						year=dVal[0]?dVal[0]:years[0];
+						month=dVal[1]?dVal[1]:months[0];
+						day=dVal[2]?dVal[2]:days[0];
+						hour=dVal[3]?dVal[3]:hours[0];
+						minute=dVal[4]?dVal[4]:minutes[0];
+						second=dVal[5]?dVal[5]:seconds[0];
+						result=full=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second}`;
+						obj={
+							year,
+							month,
+							day,
+							hour,
+							minute,
+							second
+						}
+						break;
+					default:
+						range={years,months,days};
+						break;
+				}
+				this.range=range;
+				this.checkObj=obj;
+				this.$emit("change",{
+					result:result,
+					value:full,
+					obj:obj
+				});
+				this.$nextTick(()=>{
+					this.pickVal=pickVal;
+				})
+			},
+			handlerChange(e){
+				let arr=[...e.detail.value];
+				let data=this.range;
+				let year="",month="",day="",hour="",minute="",second="";
+				let result="",full="",obj={};
+				let months=null,days=null,hours=null,minutes=null,seconds=null;
+				let disabledAfter=this.disabledAfter;
+				let leapYear=false,resetData={};
+				year=(arr[0]||arr[0]==0)?data.years[arr[0]]||data.years[data.years.length-1]:"";
+				month=(arr[1]||arr[1]==0)?data.months[arr[1]]||data.months[data.months.length-1]:"";
+				day=(arr[2]||arr[2]==0)?data.days[arr[2]]||data.days[data.days.length-1]:"";
+				hour=(arr[3]||arr[3]==0)?data.hours[arr[3]]||data.hours[data.hours.length-1]:"";
+				minute=(arr[4]||arr[4]==0)?data.minutes[arr[4]]||data.minutes[data.minutes.length-1]:"";
+				second=(arr[5]||arr[5]==0)?data.seconds[arr[5]]||data.seconds[data.seconds.length-1]:"";
+				resetData=this.resetData(year,month,day,hour,minute);//重新拉取当前日期数据;
+				leapYear=this.isLeapYear(year);//判断是否为闰年;
+				switch(this.fields){
+					case "year":
+						result=full=`${year}`;
+						obj={
+							year
+						};
+						break;
+					case "month":
+						result=full=`${year+'-'+month}`;
+						if(this.disabledAfter)months=resetData.months;
+						if(months)this.range.months=months;
+						obj={
+							year,
+							month
+						}
+						break;
+					case "day":
+						result=full=`${year+'-'+month+'-'+day}`;
+						if(this.disabledAfter){
+							months=resetData.months;
+							days=resetData.days;
+						}else{
+							if(leapYear||(month!=this.checkObj.month)||month==2){
+								days=resetData.days;
+							}
+						}
+						if(months)this.range.months=months;
+						if(days)this.range.days=days;
+						obj={
+							year,
+							month,
+							day
+						}
+						break;
+					case "hour":
+						result=`${year+'-'+month+'-'+day+' '+hour}`;
+						full=`${year+'-'+month+'-'+day+' '+hour+':00:00'}`;
+						if(this.disabledAfter){
+							months=resetData.months;
+							days=resetData.days;
+							hours=resetData.hours;
+						}else{
+							if(leapYear||(month!=this.checkObj.month)||month==2){
+								days=resetData.days;
+							}
+						}
+						if(months)this.range.months=months;
+						if(days)this.range.days=days;
+						if(hours)this.range.hours=hours;
+						obj={
+							year,
+							month,
+							day,
+							hour
+						}
+						break;
+					case "minute":
+						full=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':00'}`;
+						result=`${year+'-'+month+'-'+day+' '+hour+':'+minute}`;
+						if(this.disabledAfter){
+							months=resetData.months;
+							days=resetData.days;
+							hours=resetData.hours;
+							minutes=resetData.minutes;
+						}else{
+							if(leapYear||(month!=this.checkObj.month)||month==2){
+								days=resetData.days;
+							}
+						}
+						if(months)this.range.months=months;
+						if(days)this.range.days=days;
+						if(hours)this.range.hours=hours;
+						if(minutes)this.range.minutes=minutes;
+						obj={
+							year,
+							month,
+							day,
+							hour,
+							minute
+						};
+						break;
+					case "second":
+						result=full=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second}`;
+						if(this.disabledAfter){
+							months=resetData.months;
+							days=resetData.days;
+							hours=resetData.hours;
+							minutes=resetData.minutes;
+							//seconds=resetData.seconds;
+						}else{
+							if(leapYear||(month!=this.checkObj.month)||month==2){
+								days=resetData.days;
+							}
+						}
+						if(months)this.range.months=months;
+						if(days)this.range.days=days;
+						if(hours)this.range.hours=hours;
+						if(minutes)this.range.minutes=minutes;
+						//if(seconds)this.range.seconds=seconds;
+						obj={
+							year,
+							month,
+							day,
+							hour,
+							minute,
+							second
+						}
+						break;
+				}
+				this.checkObj=obj;
+				this.$emit("change",{
+					result:result,
+					value:full,
+					obj:obj
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import "./w-picker.css";
+</style>

+ 345 - 0
components/w-picker/half-picker.vue

@@ -0,0 +1,345 @@
+<template>
+	<view class="w-picker-view">
+		<picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.years" :key="index">{{item}}年</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.months" :key="index">{{item}}月</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.days" :key="index">{{item}}日</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.sections" :key="index">{{item}}</view>
+			</picker-view-column>
+		</picker-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				pickVal:[],
+				range:{},
+				checkObj:{}
+			};
+		},
+		props:{
+			itemHeight:{
+				type:String,
+				default:"44px"
+			},
+			startYear:{
+				type:String,
+				default:""
+			},
+			endYear:{
+				type:String,
+				default:""
+			},
+			value:{
+				type:[String,Array,Number],
+				default:""
+			},
+			current:{//是否默认选中当前日期
+				type:Boolean,
+				default:false
+			},
+			disabledAfter:{//是否禁用当前之后的日期
+				type:Boolean,
+				default:false
+			}
+		},
+		watch:{
+			value(val){
+				this.initData();
+			}
+		},
+		created() {
+			this.initData();
+		},
+		methods:{
+			formatNum(n){
+				return (Number(n)<10?'0'+Number(n):Number(n)+'');
+			},
+			checkValue(value){
+				let strReg=/^\d{4}-\d{2}-\d{2} [\u4e00-\u9fa5]{2}$/,example;
+				if(!strReg.test(value)){
+					console.log(new Error("请传入与mode、fields匹配的value值,例value="+example+""))
+				}
+				return strReg.test(value);
+			},
+			resetData(year,month,day){
+				let curDate=this.getCurrenDate();
+				let curFlag=this.current;
+				let curYear=curDate.curYear;
+				let curMonth=curDate.curMonth;
+				let curDay=curDate.curDay;
+				let curHour=curDate.curHour;
+				let months=[],days=[],sections=[];
+				let disabledAfter=this.disabledAfter;
+				let monthsLen=disabledAfter?(year*1<curYear?12:curMonth):12;
+				let totalDays=new Date(year,month,0).getDate();//计算当月有几天;
+				let daysLen=disabledAfter?((year*1<curYear||month*1<curMonth)?totalDays:curDay):totalDays;
+				let sectionFlag=disabledAfter?((year*1<curYear||month*1<curMonth||day*1<curDay)==true?false:true):(curHour>12==true?true:false);
+				sections=["上午","下午"];
+				for(let month=1;month<=monthsLen;month++){
+					months.push(this.formatNum(month));
+				};
+				for(let day=1;day<=daysLen;day++){
+					days.push(this.formatNum(day));
+				}
+				if(sectionFlag){
+					sections=["上午"];
+				}
+				return{
+					months,
+					days,
+					sections
+				}
+			},
+			getData(dVal){
+				//用来处理初始化数据
+				let curFlag=this.current;
+				let disabledAfter=this.disabledAfter;
+				let curDate=this.getCurrenDate();
+				let curYear=curDate.curYear;
+				let curMonthdays=curDate.curMonthdays;
+				let curMonth=curDate.curMonth;
+				let curDay=curDate.curDay;
+				let curHour=curDate.curHour;
+				let defaultDate=this.getDefaultDate();
+				let startYear=this.getStartDate().getFullYear();
+				let endYear=this.getEndDate().getFullYear();
+				let years=[],months=[],days=[],sections=[];
+				let year=dVal[0]*1;
+				let month=dVal[1]*1;
+				let day=dVal[2]*1;
+				let monthsLen=disabledAfter?(year<curYear?12:curDate.curMonth):12;
+				let daysLen=disabledAfter?((year<curYear||month<curMonth)?defaultDate.defaultDays:curDay):(curFlag?curMonthdays:defaultDate.defaultDays);
+				let sectionFlag=disabledAfter?((year*1<curYear||month*1<curMonth||day*1<curDay)==true?false:true):(curHour>12==true?true:false);
+				for(let year=startYear;year<=(disabledAfter?curYear:endYear);year++){
+					years.push(year.toString())
+				}
+				for(let month=1;month<=monthsLen;month++){
+					months.push(this.formatNum(month));
+				}
+				for(let day=1;day<=daysLen;day++){
+					days.push(this.formatNum(day));
+				}
+				if(sectionFlag){
+					sections=["下午"];
+				}else{
+					sections=["上午","下午"];
+				}
+				return {
+					years,
+					months,
+					days,
+					sections
+				}
+			},
+			getCurrenDate(){
+				let curDate=new Date();
+				let curYear=curDate.getFullYear();
+				let curMonth=curDate.getMonth()+1;
+				let curMonthdays=new Date(curYear,curMonth,0).getDate();
+				let curDay=curDate.getDate();
+				let curHour=curDate.getHours();
+				let curSection="上午";
+				if(curHour>=12){
+					curSection="下午";
+				}
+				return{
+					curDate,
+					curYear,
+					curMonth,
+					curMonthdays,
+					curDay,
+					curHour,
+					curSection
+				}
+			},
+			getDefaultDate(){
+				let value=this.value;
+				let reg=/-/g;
+				let defaultDate=value?new Date(value.split(" ")[0].replace(reg,"/")):new Date();
+				let defaultYear=defaultDate.getFullYear();
+				let defaultMonth=defaultDate.getMonth()+1;
+				let defaultDay=defaultDate.getDate();
+				let defaultDays=new Date(defaultYear,defaultMonth,0).getDate()*1;
+				return{
+					defaultDate,
+					defaultYear,
+					defaultMonth,
+					defaultDay,
+					defaultDays
+				}
+			},
+			getStartDate(){
+				let start=this.startYear;
+				let startDate="";
+				let reg=/-/g;
+				if(start){
+					startDate=new Date(start+"/01/01");
+				}else{
+					startDate=new Date("1970/01/01");
+				}
+				return startDate;
+			},
+			getEndDate(){
+				let end=this.endYear;
+				let reg=/-/g;
+				let endDate="";
+				if(end){
+					endDate=new Date(end+"/12/31");
+				}else{
+					endDate=new Date();
+				}
+				return endDate;
+			},
+			getDval(){
+				let value=this.value;
+				let dVal=null;
+				let aDate=new Date();
+				let year=this.formatNum(aDate.getFullYear());
+				let month=this.formatNum(aDate.getMonth()+1);
+				let day=this.formatNum(aDate.getDate());
+				let hour=aDate.getHours();
+				let section="上午";
+				if(hour>=12)section="下午";
+				if(value){
+					let flag=this.checkValue(value);
+					if(!flag){
+						dVal=[year,month,day,section]
+					}else{
+						let v=value.split(" ");
+						dVal=[...v[0].split("-"),v[1]];
+					}
+				}else{
+					dVal=[year,month,day,section]
+				}
+				return dVal;
+			},
+			initData(){
+				let startDate,endDate,startYear,endYear,startMonth,endMonth,startDay,endDay;
+				let years=[],months=[],days=[],sections=[];
+				let dVal=[],pickVal=[];
+				let value=this.value;
+				let reg=/-/g;
+				let range={};
+				let result="",full="",year,month,day,section,obj={};
+				let defaultDate=this.getDefaultDate();
+				let defaultYear=defaultDate.defaultYear;
+				let defaultMonth=defaultDate.defaultMonth;
+				let defaultDay=defaultDate.defaultDay;
+				let defaultDays=defaultDate.defaultDays;
+				let curFlag=this.current;
+				let disabledAfter=this.disabledAfter;
+				let curDate=this.getCurrenDate();
+				let curYear=curDate.curYear;
+				let curMonth=curDate.curMonth;
+				let curMonthdays=curDate.curMonthdays;
+				let curDay=curDate.curDay;
+				let curSection=curDate.curSection;
+				let dateData=[];
+				dVal=this.getDval();
+				startDate=this.getStartDate();
+				endDate=this.getEndDate();
+				startYear=startDate.getFullYear();
+				startMonth=startDate.getMonth();
+				startDay=startDate.getDate();
+				endYear=endDate.getFullYear();
+				endMonth=endDate.getMonth();
+				endDay=endDate.getDate();
+				dateData=this.getData(dVal);
+				years=dateData.years;
+				months=dateData.months;
+				days=dateData.days;
+				sections=dateData.sections;
+				pickVal=disabledAfter?[
+					dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+					dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0,
+					dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0,
+					dVal[3]&&sections.indexOf(dVal[3])!=-1?sections.indexOf(dVal[3]):0
+				]:(curFlag?[
+					years.indexOf(curYear+''),
+					months.indexOf(this.formatNum(curMonth)),
+					days.indexOf(this.formatNum(curDay)),
+					sections.indexOf(curSection),
+				]:[
+					dVal[0]&&years.indexOf(dVal[0])!=-1?years.indexOf(dVal[0]):0,
+					dVal[1]&&months.indexOf(dVal[1])!=-1?months.indexOf(dVal[1]):0,
+					dVal[2]&&days.indexOf(dVal[2])!=-1?days.indexOf(dVal[2]):0,
+					dVal[3]&&sections.indexOf(dVal[3])!=-1?sections.indexOf(dVal[3]):0
+				]);
+				range={years,months,days,sections};
+				year=dVal[0]?dVal[0]:years[0];
+				month=dVal[1]?dVal[1]:months[0];
+				day=dVal[2]?dVal[2]:days[0];
+				section=dVal[3]?dVal[3]:sections[0];
+				result=full=`${year+'-'+month+'-'+day+' '+section}`;
+				obj={
+					year,
+					month,
+					day,
+					section
+				}
+				this.range=range;
+				this.checkObj=obj;
+				this.$nextTick(()=>{
+					this.pickVal=pickVal;
+				});
+				this.$emit("change",{
+					result:result,
+					value:full,
+					obj:obj
+				})
+			},
+			handlerChange(e){
+				let arr=[...e.detail.value];
+				let data=this.range;
+				let year="",month="",day="",section="";
+				let result="",full="",obj={};
+				let months=null,days=null,sections=null;
+				let disabledAfter=this.disabledAfter;
+				year=(arr[0]||arr[0]==0)?data.years[arr[0]]||data.years[data.years.length-1]:"";
+				month=(arr[1]||arr[1]==0)?data.months[arr[1]]||data.months[data.months.length-1]:"";
+				day=(arr[2]||arr[2]==0)?data.days[arr[2]]||data.days[data.days.length-1]:"";
+				section=(arr[3]||arr[3]==0)?data.sections[arr[3]]||data.sections[data.sections.length-1]:"";
+				result=full=`${year+'-'+month+'-'+day+' '+section}`;
+				let resetData=this.resetData(year,month,day);
+				if(this.disabledAfter){
+					months=resetData.months;
+					days=resetData.days;
+					sections=resetData.sections;
+				}else{
+					if(year%4==0||(month!=this.checkObj.month)){
+						days=resetData.days;
+					}
+				}
+				if(months)this.range.months=months;
+				if(days)this.range.days=days;
+				if(sections)this.range.sections=sections;
+				obj={
+					year,
+					month,
+					day,
+					section
+				}
+				this.checkObj=obj;
+				this.$emit("change",{
+					result:result,
+					value:full,
+					obj:obj
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import "./w-picker.css";
+</style>

+ 274 - 0
components/w-picker/linkage-picker.vue

@@ -0,0 +1,274 @@
+<template>
+	<view class="w-picker-view">
+		<picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column v-for="(group,gIndex) in range" :key="gIndex">
+				<view class="w-picker-item" v-for="(item,index) in group" :key="index">{{item[nodeKey]}}</view>
+			</picker-view-column>
+		</picker-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				pickVal:[],
+				range:[],
+				checkObj:{}
+			};
+		},
+		props:{
+			itemHeight:{
+				type:String,
+				default:"44px"
+			},
+			value:{
+				type:[Array,String],
+				default:""
+			},
+			defaultType:{
+				type:String,
+				default:"label"
+			},
+			options:{
+				type:Array,
+				default(){
+					return []
+				}
+			},
+			defaultProps:{
+				type:Object,
+				default(){
+					return{
+						lable:"label",
+						value:"value",
+						children:"children"
+					}
+				}
+			},
+			level:{
+				//多级联动层级,表示几级联动
+				type:[Number,String],
+				default:2
+			}
+		},
+		computed:{
+			nodeKey(){
+				return this.defaultProps.label;
+			},
+			nodeVal(){
+				return this.defaultProps.value;
+			},
+			nodeChild(){
+				return this.defaultProps.children;
+			}
+		},
+		watch:{
+			value(val){
+				if(this.options.length!=0){
+					this.initData();
+				}
+			},
+			options(val){
+				this.initData();
+			}
+		},
+		created() {
+			if(this.options.length!=0){
+				this.initData();
+			}
+		},
+		methods:{
+			getData(){
+				//用来处理初始化数据
+				let options=this.options;
+				let col1={},col2={},col3={},col4={};
+				let arr1=options,arr2=[],arr3=[],arr4=[];
+				let col1Index=0,col2Index=0,col3Index=0,col4Index=0;
+				let a1="",a2="",a3="",a4="";
+				let dVal=[],obj={};
+				let value=this.value;
+				let data=[];
+				a1=value[0];
+				a2=value[1];
+				if(this.level>2){
+					a3=value[2];
+				}
+				if(this.level>3){
+					a4=value[3];
+				};
+				/*第1列*/
+				col1Index=arr1.findIndex((v)=>{
+					return v[this.defaultType]==a1
+				});
+				col1Index=value?(col1Index!=-1?col1Index:0):0;
+				col1=arr1[col1Index];
+				
+				/*第2列*/
+				arr2=arr1[col1Index][this.nodeChild];
+				col2Index=arr2.findIndex((v)=>{
+					return v[this.defaultType]==a2
+				});
+				col2Index=value?(col2Index!=-1?col2Index:0):0;
+				col2=arr2[col2Index];
+				
+				/*第3列*/
+				if(this.level>2){
+					arr3=arr2[col2Index][this.nodeChild];
+					col3Index=arr3.findIndex((v)=>{
+						return v[this.defaultType]==a3;
+					});
+					col3Index=value?(col3Index!=-1?col3Index:0):0;
+					col3=arr3[col3Index];
+				};
+				
+				
+				/*第4列*/
+				if(this.level>3){
+					arr4=arr3[col4Index][this.nodeChild];
+					col4Index=arr4.findIndex((v)=>{
+						return v[this.defaultType]==a4;
+					});
+					col4Index=value?(col4Index!=-1?col4Index:0):0;
+					col4=arr4[col4Index];
+				};
+				switch(this.level*1){
+					case 2:
+						dVal=[col1Index,col2Index];
+						obj={
+							col1,
+							col2
+						}
+						data=[arr1,arr2];
+						break;
+					case 3:
+						dVal=[col1Index,col2Index,col3Index];
+						obj={
+							col1,
+							col2,
+							col3
+						}
+						data=[arr1,arr2,arr3];
+						break;
+					case 4:
+						dVal=[col1Index,col2Index,col3Index,col4Index];
+						obj={
+							col1,
+							col2,
+							col3,
+							col4
+						}
+						data=[arr1,arr2,arr3,arr4];
+						break
+				}
+				return {
+					data,
+					dVal,
+					obj
+				}
+			},
+			initData(){
+				let dataData=this.getData();
+				let data=dataData.data;
+				let arr1=data[0];
+				let arr2=data[1];
+				let arr3=data[2]||[];
+				let arr4=data[3]||[];
+				let obj=dataData.obj;
+				let col1=obj.col1,col2=obj.col2,col3=obj.col3||{},col4=obj.col4||{};
+				let result="",value=[];
+				let range=[];
+				switch(this.level){
+					case 2:
+						value=[col1[this.nodeVal],col2[this.nodeVal]];
+						result=`${col1[this.nodeKey]+col2[this.nodeKey]}`;
+						range=[arr1,arr2];
+						break;
+					case 3:
+						value=[col1[this.nodeVal],col2[this.nodeVal],col3[this.nodeVal]];
+						result=`${col1[this.nodeKey]+col2[this.nodeKey]+col3[this.nodeKey]}`;
+						range=[arr1,arr2,arr3];
+						break;
+					case 4:
+						value=[col1[this.nodeVal],col2[this.nodeVal],col3[this.nodeVal],col4[this.nodeVal]];
+						result=`${col1[this.nodeKey]+col2[this.nodeKey]+col3[this.nodeKey]+col4[this.nodeKey]}`;
+						range=[arr1,arr2,arr3,arr4];
+						break;
+				}
+				this.range=range;
+				this.checkObj=obj;
+				this.$nextTick(()=>{
+					this.pickVal=dataData.dVal;
+				});
+				this.$emit("change",{
+					result:result,
+					value:value,
+					obj:obj
+				})
+			},
+			handlerChange(e){
+				let arr=[...e.detail.value];
+				let col1Index=arr[0],col2Index=arr[1],col3Index=arr[2]||0,col4Index=arr[3]||0;
+				let arr1=[],arr2=[],arr3=[],arr4=[];
+				let col1,col2,col3,col4,obj={};
+				let result="",value=[];
+				arr1=this.options;
+				arr2=(arr1[col1Index]&&arr1[col1Index][this.nodeChild])||arr1[arr1.length-1][this.nodeChild]||[];
+				col1=arr1[col1Index]||arr1[arr1.length-1]||{};
+				col2=arr2[col2Index]||arr2[arr2.length-1]||{};
+				if(this.level>2){
+					arr3=(arr2[col2Index]&&arr2[col2Index][this.nodeChild])||arr2[arr2.length-1][this.nodeChild];
+					col3=arr3[col3Index]||arr3[arr3.length-1]||{};
+				}
+				if(this.level>3){
+					arr4=(arr3[col3Index]&&arr3[col3Index][this.nodeChild])||arr3[arr3.length-1][this.nodeChild]||[];
+					col4=arr4[col4Index]||arr4[arr4.length-1]||{};
+				}
+				switch(this.level){
+					case 2:
+						obj={
+							col1,
+							col2
+						}
+						this.range=[arr1,arr2];
+						result=`${(col1[this.nodeKey]||'')+(col2[this.nodeKey]||'')}`;
+						value=[col1[this.nodeVal]||'',col2[this.nodeVal]||''];
+						break;
+					case 3:
+						obj={
+							col1,
+							col2,
+							col3
+						}
+						this.range=[arr1,arr2,arr3];
+						result=`${(col1[this.nodeKey]||'')+(col2[this.nodeKey]||'')+(col3[this.nodeKey]||'')}`;
+						value=[col1[this.nodeVal]||'',col2[this.nodeVal]||'',col3[this.nodeVal]||''];
+						break;
+					case 4:
+						obj={
+							col1,
+							col2,
+							col3,
+							col4
+						}
+						this.range=[arr1,arr2,arr3,arr4];
+						result=`${(col1[this.nodeKey]||'')+(col2[this.nodeKey]||'')+(col3[this.nodeKey]||'')+(col4[this.nodeKey]||'')}`;
+						value=[col1[this.nodeVal]||'',col2[this.nodeVal]||'',col3[this.nodeVal]||'',col4[this.nodeVal]||''];
+						break;
+				}
+				this.checkObj=obj;
+				this.pickVal=arr;
+				this.$emit("change",{
+					result:result,
+					value:value,
+					obj:obj
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import "./w-picker.css";	
+</style>
+

+ 344 - 0
components/w-picker/range-picker.vue

@@ -0,0 +1,344 @@
+<template>
+	<view class="w-picker-view">
+		<picker-view  class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column class="w-picker-flex2">
+				<view class="w-picker-item" v-for="(item,index) in range.fyears" :key="index">{{item}}年</view>
+			</picker-view-column>
+			<picker-view-column class="w-picker-flex2">
+				<view class="w-picker-item" v-for="(item,index) in range.fmonths" :key="index">{{item}}月</view>
+			</picker-view-column>
+			<picker-view-column class="w-picker-flex2">
+				<view class="w-picker-item" v-for="(item,index) in range.fdays" :key="index">{{item}}日</view>
+			</picker-view-column>
+			<picker-view-column class="w-picker-flex1">
+				<view class="w-picker-item">-</view>
+			</picker-view-column>
+			<picker-view-column class="w-picker-flex2">
+				<view class="w-picker-item" v-for="(item,index) in range.tyears" :key="index">{{item}}年</view>
+			</picker-view-column>
+			<picker-view-column class="w-picker-flex2">
+				<view class="w-picker-item" v-for="(item,index) in range.tmonths" :key="index">{{item}}月</view>
+			</picker-view-column>
+			<picker-view-column class="w-picker-flex2">
+				<view class="w-picker-item" v-for="(item,index) in range.tdays" :key="index">{{item}}日</view>
+			</picker-view-column>
+		</picker-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				pickVal:[],
+				range:{},
+				checkObj:{}
+			};
+		},
+		props:{
+			itemHeight:{
+				type:String,
+				default:"44px"
+			},
+			value:{
+				type:[String,Array],
+				default(){
+					return []
+				}
+			},
+			current:{//是否默认选中当前日期
+				type:Boolean,
+				default:false
+			},
+			startYear:{
+				type:[String,Number],
+				default:1970
+			},
+			endYear:{
+				type:[String,Number],
+				default:new Date().getFullYear()
+			}
+		},
+		watch:{
+			value(val){
+				this.initData();
+			}
+		},
+		created() {
+			this.initData();
+		},
+		methods:{
+			formatNum(n){
+				return (Number(n)<10?'0'+Number(n):Number(n)+'');
+			},
+			checkValue(value){
+				let strReg=/^\d{4}-\d{2}-\d{2}$/,example="2020-04-03";
+				if(!strReg.test(value[0])||!strReg.test(value[1])){
+					console.log(new Error("请传入与mode匹配的value值,例["+example+","+example+"]"))
+				}
+				return strReg.test(value[0])&&strReg.test(value[1]);
+			},
+			resetToData(fmonth,fday,tyear,tmonth){
+				let range=this.range;
+				let tmonths=[],tdays=[];
+				let yearFlag=tyear!=range.tyears[0];
+				let monthFlag=tyear!=range.tyears[0]||tmonth!=range.tmonths[0];
+				let ttotal=new Date(tyear,tmonth,0).getDate();
+				for(let i=yearFlag?1:fmonth*1;i<=12;i++){
+					tmonths.push(this.formatNum(i))
+				}
+				for(let i=monthFlag?1:fday*1;i<=ttotal;i++){
+					tdays.push(this.formatNum(i))
+				}
+				return{
+					tmonths,
+					tdays
+				}
+			},
+			resetData(fyear,fmonth,fday,tyear,tmonth){
+				let fyears=[],fmonths=[],fdays=[],tyears=[],tmonths=[],tdays=[];
+				let startYear=this.startYear;
+				let endYear=this.endYear;
+				let ftotal=new Date(fyear,fmonth,0).getDate();
+				let ttotal=new Date(tyear,tmonth,0).getDate();
+				for(let i=startYear*1;i<=endYear;i++){
+					fyears.push(this.formatNum(i))
+				}
+				for(let i=1;i<=12;i++){
+					fmonths.push(this.formatNum(i))
+				}
+				for(let i=1;i<=ftotal;i++){
+					fdays.push(this.formatNum(i))
+				}
+				for(let i=fyear*1;i<=endYear;i++){
+					tyears.push(this.formatNum(i))
+				}
+				for(let i=fmonth*1;i<=12;i++){
+					tmonths.push(this.formatNum(i))
+				}
+				for(let i=fday*1;i<=ttotal;i++){
+					tdays.push(this.formatNum(i))
+				}
+				return {
+					fyears,
+					fmonths,
+					fdays,
+					tyears,
+					tmonths,
+					tdays
+				}
+			},
+			getData(dVal){
+				let start=this.startYear*1;
+				let end=this.endYear*1;
+				let value=dVal;
+				let flag=this.current;
+				let aToday=new Date();
+				let tYear,tMonth,tDay,tHours,tMinutes,tSeconds,pickVal=[];
+				let initstartDate=new Date(start.toString());
+				let endDate=new Date(end.toString());
+				if(start>end){
+					initstartDate=new Date(end.toString());
+					endDate=new Date(start.toString());
+				};
+				let startYear=initstartDate.getFullYear();
+				let startMonth=initstartDate.getMonth()+1;
+				let endYear=endDate.getFullYear();
+				let fyears=[],fmonths=[],fdays=[],tyears=[],tmonths=[],tdays=[],returnArr=[],startDVal=[],endDVal=[];
+				let curMonth=flag?value[1]*1:(startDVal[1]*1+1);
+				let curMonth1=flag?value[5][1]*1:(value[5]*1+1);
+				let totalDays=new Date(value[0],value[1],0).getDate();
+				let totalDays1=new Date(value[4],value[5],0).getDate();
+				for(let s=startYear;s<=endYear;s++){
+					fyears.push(this.formatNum(s));
+				};
+				for(let m=1;m<=12;m++){
+					fmonths.push(this.formatNum(m));
+				};
+				for(let d=1;d<=totalDays;d++){
+					fdays.push(this.formatNum(d));
+				};
+				for(let s=value[0]*1;s<=endYear;s++){
+					tyears.push(this.formatNum(s));
+				};
+				
+				if(value[4]*1>value[0]*1){
+					for(let m=1;m<=12;m++){
+						tmonths.push(this.formatNum(m));
+					};
+					for(let d=1;d<=totalDays1;d++){
+						tdays.push(this.formatNum(d));
+					};
+				}else{
+					for(let m=value[1]*1;m<=12;m++){
+						tmonths.push(this.formatNum(m));
+					};
+					for(let d=value[2]*1;d<=totalDays1;d++){
+						tdays.push(this.formatNum(d));
+					};
+				};
+				
+				pickVal=[
+					fyears.indexOf(value[0])==-1?0:fyears.indexOf(value[0]),
+					fmonths.indexOf(value[1])==-1?0:fmonths.indexOf(value[1]),
+					fdays.indexOf(value[2])==-1?0:fdays.indexOf(value[2]),
+					0,
+					tyears.indexOf(value[4])==-1?0:tyears.indexOf(value[4]),
+					tmonths.indexOf(value[5])==-1?0:tmonths.indexOf(value[5]),
+					tdays.indexOf(value[6])==-1?0:tdays.indexOf(value[6])
+				];
+				return {
+					fyears,
+					fmonths,
+					fdays,
+					tyears,
+					tmonths,
+					tdays,
+					pickVal
+				}
+			},
+			getDval(){
+				let value=this.value;
+				let fields=this.fields;
+				let dVal=null;
+				let aDate=new Date();
+				let fyear=this.formatNum(aDate.getFullYear());
+				let fmonth=this.formatNum(aDate.getMonth()+1);
+				let fday=this.formatNum(aDate.getDate());
+				let tyear=this.formatNum(aDate.getFullYear());
+				let tmonth=this.formatNum(aDate.getMonth()+1);
+				let tday=this.formatNum(aDate.getDate());
+				if(value&&value.length>0){
+					let flag=this.checkValue(value);
+					if(!flag){
+						dVal=[fyear,fmonth,fday,"-",tyear,tmonth,tday]
+					}else{
+						dVal=[...value[0].split("-"),"-",...value[1].split("-")];
+					}
+				}else{
+					dVal=[fyear,fmonth,fday,"-",tyear,tmonth,tday]
+				}
+				return dVal;
+			},
+			initData(){
+				let range=[],pickVal=[];
+				let result="",full="",obj={};
+				let dVal=this.getDval();
+				let dateData=this.getData(dVal);
+				let fyears=[],fmonths=[],fdays=[],tyears=[],tmonths=[],tdays=[];
+				let fyear,fmonth,fday,tyear,tmonth,tday;
+				pickVal=dateData.pickVal;
+				fyears=dateData.fyears;
+				fmonths=dateData.fmonths;
+				fdays=dateData.fdays;
+				tyears=dateData.tyears;
+				tmonths=dateData.tmonths;
+				tdays=dateData.tdays;
+				range={
+					fyears,
+					fmonths,
+					fdays,
+					tyears,
+					tmonths,
+					tdays,
+				}
+				fyear=range.fyears[pickVal[0]];
+				fmonth=range.fmonths[pickVal[1]];
+				fday=range.fdays[pickVal[2]];
+				tyear=range.tyears[pickVal[4]];
+				tmonth=range.tmonths[pickVal[5]];
+				tday=range.tdays[pickVal[6]];
+				obj={
+					fyear,
+					fmonth,
+					fday,
+					tyear,
+					tmonth,
+					tday
+				}
+				result=`${fyear+'-'+fmonth+'-'+fday+'至'+tyear+'-'+tmonth+'-'+tday}`;
+				this.range=range;
+				this.checkObj=obj;
+				this.$nextTick(()=>{
+					this.pickVal=pickVal;
+				});
+				this.$emit("change",{
+					result:result,
+					value:result.split("至"),
+					obj:obj
+				})
+			},
+			handlerChange(e){
+				let arr=[...e.detail.value];
+				let result="",full="",obj={};
+				let year="",month="",day="",hour="",minute="",second="",note=[],province,city,area;
+				let checkObj=this.checkObj;
+				let days=[],months=[],endYears=[],endMonths=[],endDays=[],startDays=[];
+				let mode=this.mode;
+				let col1,col2,col3,d,a,h,m;
+				let xDate=new Date().getTime();
+				let range=this.range;
+				let fyear=range.fyears[arr[0]]||range.fyears[range.fyears.length-1];
+				let fmonth=range.fmonths[arr[1]]||range.fmonths[range.fmonths.length-1];
+				let fday=range.fdays[arr[2]]||range.fdays[range.fdays.length-1];
+				let tyear=range.tyears[arr[4]]||range.tyears[range.tyears.length-1];
+				let tmonth=range.tmonths[arr[5]]||range.tmonths[range.tmonths.length-1];
+				let tday=range.tdays[arr[6]]||range.tdays[range.tdays.length-1];
+				let resetData=this.resetData(fyear,fmonth,fday,tyear,tmonth);
+				if(fyear!=checkObj.fyear||fmonth!=checkObj.fmonth||fday!=checkObj.fday){
+					arr[4]=0;
+					arr[5]=0;
+					arr[6]=0;
+					range.tyears=resetData.tyears;
+					range.tmonths=resetData.tmonths;
+					range.tdays=resetData.tdays;
+					tyear=range.tyears[0];
+					checkObj.tyears=range.tyears[0];
+					tmonth=range.tmonths[0];
+					checkObj.tmonths=range.tmonths[0];
+					tday=range.tdays[0];
+					checkObj.tdays=range.tdays[0];
+				}
+				if(fyear!=checkObj.fyear||fmonth!=checkObj.fmonth){
+					range.fdays=resetData.fdays;
+				};
+				if(tyear!=checkObj.tyear){
+					arr[5]=0;
+					arr[6]=0;
+					let toData=this.resetToData(fmonth,fday,tyear,tmonth);
+					range.tmonths=toData.tmonths;
+					range.tdays=toData.tdays;
+					tmonth=range.tmonths[0];
+					checkObj.tmonths=range.tmonths[0];
+					tday=range.tdays[0];
+					checkObj.tdays=range.tdays[0];
+				};
+				if(tmonth!=checkObj.tmonth){
+					arr[6]=0;
+					let toData=this.resetToData(fmonth,fday,tyear,tmonth);
+					range.tdays=toData.tdays;
+					tday=range.tdays[0];
+					checkObj.tdays=range.tdays[0];
+				};
+				result=`${fyear+'-'+fmonth+'-'+fday+'至'+tyear+'-'+tmonth+'-'+tday}`;
+				obj={
+					fyear,fmonth,fday,tyear,tmonth,tday
+				}
+				this.checkObj=obj;
+				this.$nextTick(()=>{
+					this.pickVal=arr;
+				})
+				this.$emit("change",{
+					result:result,
+					value:result.split("至"),
+					obj:obj
+				})
+				
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import "./w-picker.css";
+</style>

+ 183 - 0
components/w-picker/region-picker.vue

@@ -0,0 +1,183 @@
+<template>
+	<view class="w-picker-view">
+		<picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.provinces" :key="index">{{item.label}}</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.citys" :key="index">{{item.label}}</view>
+			</picker-view-column>
+			<picker-view-column v-if="!hideArea">
+				<view class="w-picker-item" v-for="(item,index) in range.areas" :key="index">{{item.label}}</view>
+			</picker-view-column>
+		</picker-view>
+	</view>
+</template>
+
+<script>
+	import areaData from "./areadata/areadata.js"
+	export default {
+		data() {
+			return {
+				pickVal:[],
+				range:{
+					provinces:[],
+					citys:[],
+					areas:[]
+				},
+				checkObj:{}
+			};
+		},
+		props:{
+			itemHeight:{
+				type:String,
+				default:"44px"
+			},
+			value:{
+				type:[Array,String],
+				default:""
+			},
+			defaultType:{
+				type:String,
+				default:"label"
+			},
+			hideArea:{
+				type:Boolean,
+				default:false
+			}
+		},
+		watch:{
+			value(val){
+				this.initData();
+			}
+		},
+		created() {
+			this.initData();
+		},
+		methods:{
+			getData(){
+				//用来处理初始化数据
+				let provinces=areaData;
+				let dVal=[];
+				let value=this.value;
+				let a1=value[0];//默认值省
+				let a2=value[1];//默认值市
+				let a3=value[2];//默认值区、县
+				let province,city,area;
+				let provinceIndex=provinces.findIndex((v)=>{
+					return v[this.defaultType]==a1
+				});
+				provinceIndex=value?(provinceIndex!=-1?provinceIndex:0):0;
+				let citys=provinces[provinceIndex].children;
+				let cityIndex=citys.findIndex((v)=>{
+					return v[this.defaultType]==a2
+				});
+				cityIndex=value?(cityIndex!=-1?cityIndex:0):0;
+				let areas=citys[cityIndex].children;
+				let areaIndex=areas.findIndex((v)=>{
+					return v[this.defaultType]==a3;
+				});
+				areaIndex=value?(areaIndex!=-1?areaIndex:0):0;
+				dVal=this.hideArea?[provinceIndex,cityIndex]:[provinceIndex,cityIndex,areaIndex];
+				province=provinces[provinceIndex];
+				city=citys[cityIndex];
+				area=areas[areaIndex];
+				let obj=this.hideArea?{
+					province,
+					city
+				}:{
+					province,
+					city,
+					area
+				}
+				return this.hideArea?{
+					provinces,
+					citys,
+					dVal,
+					obj
+				}:{
+					provinces,
+					citys,
+					areas,
+					dVal,
+					obj
+				}
+			},
+			initData(){
+				let dataData=this.getData();
+				let provinces=dataData.provinces;
+				let citys=dataData.citys;
+				let areas=this.hideArea?[]:dataData.areas;
+				let obj=dataData.obj;
+				let province=obj.province,city=obj.city,area=this.hideArea?{}:obj.area;
+				let value=this.hideArea?[province.value,city.value]:[province.value,city.value,area.value];
+				let result=this.hideArea?`${province.label+city.label}`:`${province.label+city.label+area.label}`;
+				this.range=this.hideArea?{
+					provinces,
+					citys,
+				}:{
+					provinces,
+					citys,
+					areas
+				};
+				this.checkObj=obj;
+				this.$nextTick(()=>{
+					this.pickVal=dataData.dVal;
+				});
+				this.$emit("change",{
+					result:result,
+					value:value,
+					obj:obj
+				})
+			},
+			handlerChange(e){
+				let arr=[...e.detail.value];
+				let provinceIndex=arr[0],cityIndex=arr[1],areaIndex=this.hideArea?0:arr[2];
+				let provinces=areaData;
+				let citys=(provinces[provinceIndex]&&provinces[provinceIndex].children)||provinces[provinces.length-1].children||[];
+				let areas=this.hideArea?[]:((citys[cityIndex]&&citys[cityIndex].children)||citys[citys.length-1].children||[]);
+				let province=provinces[provinceIndex]||provinces[provinces.length-1],
+				city=citys[cityIndex]||[citys.length-1],
+				area=this.hideArea?{}:(areas[areaIndex]||[areas.length-1]);
+				let obj=this.hideArea?{
+					province,
+					city
+				}:{
+					province,
+					city,
+					area
+				}
+				if(this.checkObj.province.label!=province.label){
+					//当省更新的时候需要刷新市、区县的数据;
+					this.range.citys=citys;
+					if(!this.hideArea){
+						this.range.areas=areas;
+					}
+					
+				}
+				if(this.checkObj.city.label!=city.label){
+					//当市更新的时候需要刷新区县的数据;
+					if(!this.hideArea){
+						this.range.areas=areas;
+					}
+				}
+				this.checkObj=obj;
+				this.$nextTick(()=>{
+					this.pickVal=arr;
+				})
+				let result=this.hideArea?`${province.label+city.label}`:`${province.label+city.label+area.label}`;
+				let value=this.hideArea?[province.value,city.value]:[province.value,city.value,area.value];
+				this.$emit("change",{
+					result:result,
+					value:value,
+					obj:obj
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import "./w-picker.css";	
+</style>
+

+ 129 - 0
components/w-picker/selector-picker.vue

@@ -0,0 +1,129 @@
+<template>
+	<view class="w-picker-view">
+		<picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range" :key="index">{{item[nodeKey]}}</view>
+			</picker-view-column>
+		</picker-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props:{
+			itemHeight:{
+				type:String,
+				default:"44px"
+			},
+			options:{
+				type:[Array,Object],
+				default(){
+					return []
+				}
+			},
+			value:{
+				type:String,
+				default:""
+			},
+			defaultType:{
+				type:String,
+				default:"label"
+			},
+			defaultProps:{
+				type:Object,
+				default(){
+					return{
+						label:"label",
+						value:"value"
+					}
+				}
+			}
+		},
+		data() {
+			return {
+				pickVal:[]
+			};
+		},
+		computed:{
+			nodeKey(){
+				return this.defaultProps.label;
+			},
+			nodeValue(){
+				return this.defaultProps.value;
+			},
+			range(){
+				return this.options
+			}
+		},
+		watch:{
+			value(val){
+				if(this.options.length!=0){
+					this.initData();
+				}
+			},
+			options(val){
+				this.initData();
+			}
+		},
+		created() {
+			if(this.options.length!=0){
+				this.initData();
+			}
+		},
+		methods:{
+			initData(){
+				let dVal=this.value||"";
+				let data=this.range;
+				let pickVal=[0];
+				let cur=null;
+				let label="";
+				let value,idx;
+				if(this.defaultType==this.nodeValue){
+					value=data.find((v)=>v[this.nodeValue]==dVal);
+					idx=data.findIndex((v)=>v[this.nodeValue]==dVal);
+				}else{
+					value=data.find((v)=>v[this.nodeKey]==dVal);
+					idx=data.findIndex((v)=>v[this.nodeKey]==dVal);
+				}
+				pickVal=[idx!=-1?idx:0];
+				this.$nextTick(()=>{
+					this.pickVal=pickVal;
+				});
+				if(this.defaultType==this.nodeValue){
+					this.$emit("change",{
+						result:value?value[this.nodeKey]:data[0][this.nodeKey],
+						value:dVal||data[0][this.nodeKey],
+						obj:value?value:data[0]
+					})
+				}else{
+					this.$emit("change",{
+						result:dVal||data[0][this.nodeKey],
+						value:value?value[this.nodeValue]:data[0][this.nodeValue],
+						obj:value?value:data[0]
+					})
+				}
+				
+			},
+			handlerChange(e){
+				let arr=[...e.detail.value];
+				let pickVal=[arr[0]||0];
+				let data=this.range;
+				let cur=data[arr[0]];
+				let label="";
+				let value="";
+				this.$nextTick(()=>{
+					this.pickVal=pickVal;
+				});
+				this.$emit("change",{
+					result:cur[this.nodeKey],
+					value:cur[this.nodeValue],
+					obj:cur
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import "./w-picker.css";
+</style>

+ 250 - 0
components/w-picker/shortterm-picker.vue

@@ -0,0 +1,250 @@
+<template>
+	<view class="w-picker-view">
+		<picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.dates" :key="index">{{item.label}}</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.hours" :key="index">{{item.label}}时</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.minutes" :key="index">{{item.label}}分</view>
+			</picker-view-column>
+		</picker-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				pickVal:[],
+				range:{},
+				checkObj:{}
+			};
+		},
+		props:{
+			itemHeight:{
+				type:String,
+				default:"44px"
+			},
+			value:{
+				type:[String,Array,Number],
+				default:""
+			},
+			current:{//是否默认选中当前日期
+				type:Boolean,
+				default:false
+			},
+			expand:{
+				type:[Number,String],
+				default:30
+			}
+		},
+		watch:{
+			value(val){
+				this.initData();
+			}
+		},
+		created() {
+			this.initData();
+		},
+		methods:{
+			formatNum(n){
+				return (Number(n)<10?'0'+Number(n):Number(n)+'');
+			},
+			checkValue(value){
+				let strReg=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(:\d{2})?$/,example="2019-12-12 18:05:00或者2019-12-12 18:05";
+				if(!strReg.test(value)){
+					console.log(new Error("请传入与mode、fields匹配的value值,例value="+example+""))
+				}
+				return strReg.test(value);
+			},
+			resetData(year,month,day){
+				let curDate=this.getCurrenDate();
+				let curFlag=this.current;
+				let curYear=curDate.curYear;
+				let curMonth=curDate.curMonth;
+				let curDay=curDate.curDay;
+				let curHour=curDate.curHour;
+				let months=[],days=[],sections=[];
+				let disabledAfter=this.disabledAfter;
+				let monthsLen=disabledAfter?(year*1<curYear?12:curMonth):12;
+				let totalDays=new Date(year,month,0).getDate();//计算当月有几天;
+				for(let month=1;month<=monthsLen;month++){
+					months.push(this.formatNum(month));
+				};
+				for(let day=1;day<=daysLen;day++){
+					days.push(this.formatNum(day));
+				}
+				return{
+					months,
+					days,
+					sections
+				}
+			},
+			getData(dVal){
+				//用来处理初始化数据
+				let curFlag=this.current;
+				let disabledAfter=this.disabledAfter;
+				let dates=[],hours=[],minutes=[];
+				let curDate=new Date();
+				let curYear=curDate.getFullYear();
+				let curMonth=curDate.getMonth();
+				let curDay=curDate.getDate();
+				let aDate=new Date(curYear,curMonth,curDay);
+				for(let i=0;i<this.expand*1;i++){
+					aDate=new Date(curYear,curMonth,curDay+i);
+					let year=aDate.getFullYear();
+					let month=aDate.getMonth()+1;
+					let day=aDate.getDate();
+					let label=year+"-"+this.formatNum(month)+"-"+this.formatNum(day);
+					switch(i){
+						case 0:
+							label="今天";
+							break;
+						case 1:
+							label="明天";
+							break;
+						case 2:
+							label="后天";
+							break
+					}
+					dates.push({
+						label:label,
+						value:year+"-"+this.formatNum(month)+"-"+this.formatNum(day)
+					})
+				};
+				for(let i=0;i<24;i++){
+					hours.push({
+						label:this.formatNum(i),
+						value:this.formatNum(i)
+					})
+				}
+				for(let i=0;i<60;i++){
+					minutes.push({
+						label:this.formatNum(i),
+						value:this.formatNum(i)
+					})
+				}
+				return {
+					dates,
+					hours,
+					minutes
+				}
+			},
+			getDefaultDate(){
+				let value=this.value;
+				let reg=/-/g;
+				let defaultDate=value?new Date(value.replace(reg,"/")):new Date();
+				let defaultYear=defaultDate.getFullYear();
+				let defaultMonth=defaultDate.getMonth()+1;
+				let defaultDay=defaultDate.getDate();
+				let defaultDays=new Date(defaultYear,defaultMonth,0).getDate()*1;
+				return{
+					defaultDate,
+					defaultYear,
+					defaultMonth,
+					defaultDay,
+					defaultDays
+				}
+			},
+			getDval(){
+				let value=this.value;
+				let dVal=null;
+				let aDate=new Date();
+				let year=this.formatNum(aDate.getFullYear());
+				let month=this.formatNum(aDate.getMonth()+1);
+				let day=this.formatNum(aDate.getDate());
+				let date=this.formatNum(year)+"-"+this.formatNum(month)+"-"+this.formatNum(day);
+				let hour=aDate.getHours();
+				let minute=aDate.getMinutes();
+				if(value){
+					let flag=this.checkValue(value);
+					if(!flag){
+						dVal=[date,hour,minute]
+					}else{
+						let v=value.split(" ");
+						dVal=[v[0],...v[1].split(":")];
+					}
+				}else{
+					dVal=[date,hour,minute]
+				}
+				return dVal;
+			},
+			initData(){
+				let startDate,endDate,startYear,endYear,startMonth,endMonth,startDay,endDay;
+				let dates=[],hours=[],minutes=[];
+				let dVal=[],pickVal=[];
+				let value=this.value;
+				let reg=/-/g;
+				let range={};
+				let result="",full="",date,hour,minute,obj={};
+				let defaultDate=this.getDefaultDate();
+				let defaultYear=defaultDate.defaultYear;
+				let defaultMonth=defaultDate.defaultMonth;
+				let defaultDay=defaultDate.defaultDay;
+				let defaultDays=defaultDate.defaultDays;
+				let curFlag=this.current;
+				let disabledAfter=this.disabledAfter;
+				let dateData=[];
+				dVal=this.getDval();
+				dateData=this.getData(dVal);
+				dates=dateData.dates;
+				hours=dateData.hours;
+				minutes=dateData.minutes;
+				pickVal=[
+					dates.findIndex(n => n.value == dVal[0])!=-1?dates.findIndex(n => n.value == dVal[0]):0,
+					hours.findIndex(n => n.value == dVal[1])!=-1?hours.findIndex(n => n.value == dVal[1]):0,
+					minutes.findIndex(n => n.value == dVal[2])!=-1?minutes.findIndex(n => n.value == dVal[2]):0,
+				];
+				range={dates,hours,minutes};
+				date=dVal[0]?dVal[0]:dates[0].label;
+				hour=dVal[1]?dVal[1]:hours[0].label;
+				minute=dVal[2]?dVal[2]:minutes[0].label;
+				result=full=`${date+' '+hour+':'+minute}`;
+				obj={
+					date,
+					hour,
+					minute
+				}
+				this.range=range;
+				this.checkObj=obj;
+				this.$nextTick(()=>{
+					this.pickVal=pickVal;
+				});
+				this.$emit("change",{
+					result:result,
+					value:full,
+					obj:obj
+				})
+			},
+			handlerChange(e){
+				let arr=[...e.detail.value];
+				let data=this.range;
+				let date="",hour="",minute="";
+				let result="",full="",obj={};
+				let disabledAfter=this.disabledAfter;
+				date=(arr[0]||arr[0]==0)?data.dates[arr[0]]||data.dates[data.dates.length-1]:"";
+				hour=(arr[1]||arr[1]==0)?data.hours[arr[1]]||data.hours[data.hours.length-1]:"";
+				minute=(arr[2]||arr[2]==0)?data.minutes[arr[2]]||data.minutes[data.minutes.length-1]:"";
+				result=full=`${date.label+' '+hour.label+':'+minute.label+':00'}`;
+				obj={
+					date,
+					hour,
+					minute
+				}
+				this.checkObj=obj;
+				this.$emit("change",{
+					result:result,
+					value:full,
+					obj:obj
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import "./w-picker.css";
+</style>

+ 218 - 0
components/w-picker/time-picker.vue

@@ -0,0 +1,218 @@
+<template>
+	<view class="w-picker-view">
+		<picker-view class="d-picker-view" :indicator-style="itemHeight" :value="pickVal" @change="handlerChange">
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.hours" :key="index">{{item}}时</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="w-picker-item" v-for="(item,index) in range.minutes" :key="index">{{item}}分</view>
+			</picker-view-column>
+			<picker-view-column v-if="second">
+				<view class="w-picker-item" v-for="(item,index) in range.seconds" :key="index">{{item}}秒</view>
+			</picker-view-column>
+		</picker-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				pickVal:[],
+				range:{},
+				checkObj:{}
+			};
+		},
+		props:{
+			itemHeight:{
+				type:String,
+				default:"44px"
+			},
+			value:{
+				type:[String,Array,Number],
+				default:""
+			},
+			current:{//是否默认选中当前日期
+				type:Boolean,
+				default:false
+			},
+			second:{
+				type:Boolean,
+				default:true
+			}
+		},
+		watch:{
+			value(val){
+				this.initData();
+			}
+		},
+		created() {
+			this.initData();
+		},
+		methods:{
+			formatNum(n){
+				return (Number(n)<10?'0'+Number(n):Number(n)+'');
+			},
+			checkValue(value){
+				let strReg=/^\d{2}:\d{2}:\d{2}$/,example="18:00:05";
+				if(!strReg.test(value)){
+					console.log(new Error("请传入与mode、fields匹配的value值,例value="+example+""))
+				}
+				return strReg.test(value);
+			},
+			resetData(year,month,day,hour,minute){
+				let curDate=this.getCurrenDate();
+				let curFlag=this.current;
+				let curHour=curDate.curHour;
+				let curMinute=curDate.curMinute;
+				let curSecond=curDate.curSecond;
+				for(let hour=0;hour<24;hour++){
+					hours.push(this.formatNum(hour));
+				}
+				for(let minute=0;minute<60;minute++){
+					minutes.push(this.formatNum(minute));
+				}
+				for(let second=0;second<60;second++){
+					seconds.push(this.formatNum(second));
+				}
+				return{
+					hours,
+					minutes,
+					seconds
+				}
+			},
+			getData(curDate){
+				//用来处理初始化数据
+				let hours=[],minutes=[],seconds=[];
+				let curFlag=this.current;
+				let disabledAfter=this.disabledAfter;
+				let fields=this.fields;
+				let curHour=curDate.curHour;
+				let curMinute=curDate.curMinute;
+				let curSecond=curDate.curSecond;
+				for(let hour=0;hour<24;hour++){
+					hours.push(this.formatNum(hour));
+				}
+				for(let minute=0;minute<60;minute++){
+					minutes.push(this.formatNum(minute));
+				}
+				for(let second=0;second<60;second++){
+					seconds.push(this.formatNum(second));
+				}
+				return this.second?{
+					hours,
+					minutes,
+					seconds
+				}:{
+					hours,
+					minutes
+				}
+			},
+			getCurrenDate(){
+				let curDate=new Date();
+				let curHour=curDate.getHours();
+				let curMinute=curDate.getMinutes();
+				let curSecond=curDate.getSeconds();
+				return this.second?{
+					curHour,
+					curMinute,
+					curSecond
+				}:{
+					curHour,
+					curMinute,
+				}
+			},
+			getDval(){
+				let value=this.value;
+				let fields=this.fields;
+				let dVal=null;
+				let aDate=new Date();
+				let hour=this.formatNum(aDate.getHours());
+				let minute=this.formatNum(aDate.getMinutes());
+				let second=this.formatNum(aDate.getSeconds());
+				if(value){
+					let flag=this.checkValue(value);
+					if(!flag){
+						dVal=[hour,minute,second]
+					}else{
+						dVal=value?value.split(":"):[];
+					}
+				}else{
+					dVal=this.second?[hour,minute,second]:[hour,minute]
+				}
+				return dVal;
+			},
+			initData(){
+				let curDate=this.getCurrenDate();
+				let dateData=this.getData(curDate);
+				let pickVal=[],obj={},full="",result="",hour="",minute="",second="";
+				let dVal=this.getDval();
+				let curFlag=this.current;
+				let disabledAfter=this.disabledAfter;
+				let hours=dateData.hours;
+				let minutes=dateData.minutes;
+				let seconds=dateData.seconds;
+				let defaultArr=this.second?[
+					dVal[0]&&hours.indexOf(dVal[0])!=-1?hours.indexOf(dVal[0]):0,
+					dVal[1]&&minutes.indexOf(dVal[1])!=-1?minutes.indexOf(dVal[1]):0,
+					dVal[2]&&seconds.indexOf(dVal[2])!=-1?seconds.indexOf(dVal[2]):0
+				]:[
+					dVal[0]&&hours.indexOf(dVal[0])!=-1?hours.indexOf(dVal[0]):0,
+					dVal[1]&&minutes.indexOf(dVal[1])!=-1?minutes.indexOf(dVal[1]):0
+				];
+				pickVal=disabledAfter?defaultArr:(curFlag?(this.second?[
+					hours.indexOf(this.formatNum(curDate.curHour)),
+					minutes.indexOf(this.formatNum(curDate.curMinute)),
+					seconds.indexOf(this.formatNum(curDate.curSecond)),
+				]:[
+					hours.indexOf(this.formatNum(curDate.curHour)),
+					minutes.indexOf(this.formatNum(curDate.curMinute))
+				]):defaultArr);
+				this.range=dateData;
+				this.checkObj=obj;
+				hour=dVal[0]?dVal[0]:hours[0];
+				minute=dVal[1]?dVal[1]:minutes[0];
+				if(this.second)second=dVal[2]?dVal[0]:seconds[0];
+				result=this.second?`${hour+':'+minute+':'+second}`:`${hour+':'+minute}`;
+				full=this.second?`${hour+':'+minute+':'+second}`:`${hour+':'+minute+':00'}`;
+				this.$nextTick(()=>{
+					this.pickVal=pickVal;
+				});
+				this.$emit("change",{
+					result:result,
+					value:full,
+					obj:obj
+				})
+			},
+			handlerChange(e){
+				let arr=[...e.detail.value];
+				let data=this.range;
+				let hour="",minute="",second="",result="",full="",obj={};
+				hour=(arr[0]||arr[0]==0)?data.hours[arr[0]]||data.hours[data.hours.length-1]:"";
+				minute=(arr[1]||arr[1]==0)?data.minutes[arr[1]]||data.minutes[data.minutes.length-1]:"";
+				if(this.second)second=(arr[2]||arr[2]==0)?data.seconds[arr[2]]||data.seconds[data.seconds.length-1]:"";
+				obj=this.second?{
+					hour,
+					minute,
+					second
+				}:{
+					hour,
+					minute
+				};
+				this.checkObj=obj;
+				result=this.second?`${hour+':'+minute+':'+second}`:`${hour+':'+minute}`;
+				full=this.second?`${hour+':'+minute+':'+second}`:`${hour+':'+minute+':00'}`;
+				this.$emit("change",{
+					result:result,
+					value:full,
+					obj:obj
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import "./w-picker.css";	
+</style>
+

+ 26 - 0
components/w-picker/w-picker.css

@@ -0,0 +1,26 @@
+.w-picker-flex2{
+	flex:2;
+}
+.w-picker-flex1{
+	flex:1;
+}
+.w-picker-view {
+	width: 100%;
+	height: 476upx;
+	overflow: hidden;
+	background-color: rgba(255, 255, 255, 1);
+	z-index: 666;
+}
+.d-picker-view{
+	height: 100%;
+}
+
+.w-picker-item {
+  text-align: center;
+  width: 100%;
+  height: 88upx;
+  line-height: 88upx;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  font-size: 30upx;
+}

+ 340 - 0
components/w-picker/w-picker.vue

@@ -0,0 +1,340 @@
+<template name="w-picker">
+	<view class="w-picker" :key="createKey" :data-key="createKey">
+		<view class="mask" :class="{'visible':visible}" @tap="onCancel" @touchmove.stop.prevent catchtouchmove="true"></view>
+		<view class="w-picker-cnt" :class="{'visible':visible}">
+			<view class="w-picker-header"  @touchmove.stop.prevent catchtouchmove="true">
+				<text @tap.stop.prevent="onCancel">取消</text>
+				<slot></slot>
+				<text :style="{'color':themeColor}" @tap.stop.prevent="pickerConfirm">确定</text>
+			</view>
+			<date-picker 
+				v-if="mode=='date'" 
+				class="w-picker-wrapper"
+				:startYear="startYear"
+				:endYear="endYear"
+				:value="value"
+				:fields="fields"
+				:item-height="itemHeight"
+				:current="current"
+				:disabled-after="disabledAfter"
+				@change="handlerChange"
+				@touchstart="touchStart" 
+				@touchend="touchEnd">
+			</date-picker>
+			
+			<range-picker
+				v-if="mode=='range'" 
+				class="w-picker-wrapper"
+				:startYear="startYear"
+				:endYear="endYear"
+				:value="value"
+				:item-height="itemHeight"
+				:current="current"
+				@change="handlerChange"
+				@touchstart="touchStart" 
+				@touchend="touchEnd">
+			</range-picker>
+			
+			<half-picker
+				v-if="mode=='half'" 
+				class="w-picker-wrapper"
+				:startYear="startYear"
+				:endYear="endYear"
+				:value="value"
+				:item-height="itemHeight"
+				:current="current"
+				:disabled-after="disabledAfter"
+				@change="handlerChange"
+				@touchstart="touchStart" 
+				@touchend="touchEnd">
+			</half-picker>
+			
+			<shortterm-picker
+				v-if="mode=='shortTerm'" 
+				class="w-picker-wrapper"
+				:startYear="startYear"
+				:endYear="endYear"
+				:value="value"
+				:item-height="itemHeight"
+				:current="current"
+				expand="60"
+				:disabled-after="disabledAfter"
+				@change="handlerChange"
+				@touchstart="touchStart" 
+				@touchend="touchEnd">
+			</shortterm-picker>
+			
+			<time-picker
+				v-if="mode=='time'"
+				class="w-picker-wrapper"
+				:value="value"
+				:item-height="itemHeight"
+				:current="current"
+				:disabled-after="disabledAfter"
+				:second="second"
+				@change="handlerChange"
+				@touchstart="touchStart" 
+				@touchend="touchEnd">
+			</time-picker>
+			
+			<selector-picker
+				v-if="mode=='selector'"
+				class="w-picker-wrapper"
+				:value="value"
+				:item-height="itemHeight"
+				:options="options"
+				:default-type="defaultType"
+				:default-props="defaultProps"
+				@change="handlerChange"
+				@touchstart="touchStart" 
+				@touchend="touchEnd">
+			</selector-picker>
+			
+			<region-picker
+				v-if="mode=='region'"
+				class="w-picker-wrapper"
+				:value="value"
+				:hide-area="hideArea"
+				:default-type="defaultType"
+				:item-height="itemHeight"
+				@change="handlerChange"
+				@touchstart="touchStart" 
+				@touchend="touchEnd">
+			</region-picker>
+			
+			<linkage-picker
+				v-if="mode=='linkage'"
+				class="w-picker-wrapper"
+				:value="value"
+				:options="options"
+				:level="level"
+				:default-type="defaultType"
+				:default-props="defaultProps"
+				:item-height="itemHeight"
+				@change="handlerChange"
+				@touchstart="touchStart" 
+				@touchend="touchEnd">
+			</linkage-picker>
+		</view>
+	</view>
+</template>
+
+<script>
+	import datePicker from "./date-picker.vue"
+	import rangePicker from "./range-picker.vue"
+	import halfPicker from "./half-picker.vue"
+	import shorttermPicker from "./shortterm-picker.vue"
+	import timePicker from "./time-picker.vue"
+	import selectorPicker from "./selector-picker.vue"
+	import regionPicker from "./region-picker.vue"
+	import linkagePicker from "./linkage-picker.vue"
+	export default {
+		name:"w-picker",
+		components:{
+			datePicker,
+			rangePicker,
+			halfPicker,
+			timePicker,
+			selectorPicker,
+			shorttermPicker,
+			regionPicker,
+			linkagePicker
+		},
+		props:{
+			mode:{
+				type:String,
+				default:"date"
+			},
+			value:{//默认值
+				type:[String,Array,Number],
+				default:""
+			},
+			current:{//是否默认显示当前时间,如果是,传的默认值将失效
+				type:Boolean,
+				default:false
+			},
+			themeColor:{//确认按钮主题颜色
+				type:String,
+				default:"#f5a200"
+			},
+			fields:{//日期颗粒度:year、month、day、hour、minute、second
+				type:String,
+				default:"date"
+			},
+			disabledAfter:{//是否禁用当前之后的日期
+				type:Boolean,
+				default:false
+			},
+			second:{//time-picker是否显示秒
+				type:Boolean,
+				default:true
+			},
+			options:{//selector,region数据源
+				type:[Array,Object],
+				default(){
+					return []
+				}
+			},
+			defaultProps:{//selector,linkagle字段转换配置
+				type:Object,
+				default(){
+					return{
+						label:"label",
+						value:"value",
+						children:"children"
+					}
+				}
+			},
+			defaultType:{
+				type:String,
+				default:"label"
+			},
+			hideArea:{//mode=region时,是否隐藏区县列
+				type:Boolean,
+				default:false
+			},
+			level:{
+				//多级联动层级,表示几级联动,区间2-4;
+				type:[Number,String],
+				default:2
+			},
+			timeout:{//是否开启点击延迟,当快速滚动 还没有滚动完毕点击关闭时得到的值是不准确的
+				type:Boolean,
+				default:false
+			},
+			expand:{//mode=shortterm 默认往后拓展天数
+				type:[Number,String],
+				default:30
+			},
+			startYear:{
+				type:[String,Number],
+				default:1970
+			},
+			endYear:{
+				type:[String,Number],
+				default:new Date().getFullYear()
+			},
+			visible:{
+				type:Boolean,
+				default:false
+			}
+		},
+		created() {
+			this.createKey=Math.random()*1000;
+		},
+		data() {
+			return {
+				itemHeight:`height: ${uni.upx2px(88)}px;`,
+				result:{},
+				confirmFlag:true
+			};
+		},
+		methods:{
+			touchStart(){
+				if(this.timeout){
+					this.confirmFlag=false;
+				}
+			},
+			touchEnd(){
+				if(this.timeout){
+					setTimeout(()=>{
+						this.confirmFlag=true;
+					},500)
+				}
+			},
+			handlerChange(res){
+				let _this=this;
+				this.result={...res};
+			},
+			show(){
+				this.$emit("update:visible",true);
+			},
+			hide(){
+				this.$emit("update:visible",false);
+			},
+			onCancel(res){
+				this.$emit("update:visible",false);
+				this.$emit("cancel");
+			},
+			pickerConfirm(){
+				if(!this.confirmFlag){
+					return;
+				};
+				this.$emit("confirm",this.result);
+				this.$emit("update:visible",false);
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.w-picker-item {
+	  text-align: center;
+	  width: 100%;
+	  height: 88upx;
+	  line-height: 88upx;
+	  text-overflow: ellipsis;
+	  white-space: nowrap;
+	  font-size: 30upx;
+	}
+	.w-picker{
+		z-index: 888;
+		.mask {
+		  position: fixed;
+		  z-index: 1000;
+		  top: 0;
+		  right: 0;
+		  left: 0;
+		  bottom: 0;
+		  background: rgba(0, 0, 0, 0.6);
+		  visibility: hidden;
+		  opacity: 0;
+		  transition: all 0.3s ease;
+		}
+		.mask.visible{
+			visibility: visible;
+			opacity: 1;
+		}
+		.w-picker-cnt {
+		  position: fixed;
+		  bottom: 0;
+		  left: 0;
+		  width: 100%;
+		  transition: all 0.3s ease;
+		  transform: translateY(100%);
+		  z-index: 3000;
+		  background-color: #fff;
+		}
+		.w-picker-cnt.visible {
+		  transform: translateY(0);
+		}
+		.w-picker-header{
+		  display: flex;
+		  align-items: center;
+		  padding: 0 30upx;
+		  height: 88upx;
+		  background-color: #fff;
+		  position: relative;
+		  text-align: center;
+		  font-size: 32upx;
+		  justify-content: space-between;
+		  border-bottom: solid 1px #eee;
+		  .w-picker-btn{
+		  	font-size: 30upx;
+		  }
+		}
+		
+		.w-picker-hd:after {
+		  content: ' ';
+		  position: absolute;
+		  left: 0;
+		  bottom: 0;
+		  right: 0;
+		  height: 1px;
+		  border-bottom: 1px solid #e5e5e5;
+		  color: #e5e5e5;
+		  transform-origin: 0 100%;
+		  transform: scaleY(0.5);
+		}
+	}
+</style>

BIN=BIN
images/address.png


BIN=BIN
images/avatar.png


BIN=BIN
images/banner.png


BIN=BIN
images/duihao-bg.png


BIN=BIN
images/duihao-red.png


BIN=BIN
images/duihao.png


BIN=BIN
images/jiantouyou.png


BIN=BIN
images/kapianbeijing@2x.png


BIN=BIN
images/login-pass.png


BIN=BIN
images/login-phone.png


BIN=BIN
images/loginbg.png


BIN=BIN
images/money.png


BIN=BIN
images/no_data.png


BIN=BIN
images/on-line-bg.png


BIN=BIN
images/on-line-ico.png


BIN=BIN
images/phbg.png


BIN=BIN
images/phone-book-bg.png


BIN=BIN
images/phone-book-ico.png


BIN=BIN
images/qrcode.png


BIN=BIN
images/select-worker.png


BIN=BIN
images/tongxingma.png


BIN=BIN
images/userbg.png


BIN=BIN
images/xiangyou-xiao.png


BIN=BIN
images/xiangyou.png


BIN=BIN
images/yishiyong.png


BIN=BIN
images/yiyuyue.png


BIN=BIN
images/youjiantou-hui@2x.png


BIN=BIN
images/yuyuebtn.png


+ 16 - 0
main.js

@@ -0,0 +1,16 @@
+import Vue from 'vue'
+import App from './App'
+
+import wechat from './common/util/wechat'
+if(wechat.isWechat()){
+    Vue.prototype.$wechat = wechat;
+}
+
+Vue.config.productionTip = false
+
+App.mpType = 'app'
+
+const app = new Vue({
+    ...App
+})
+app.$mount()

+ 98 - 0
manifest.json

@@ -0,0 +1,98 @@
+{
+    "name" : "吉利2",
+    "appid" : "__UNI__F050372",
+    "description" : "",
+    "versionName" : "1.0.0",
+    "versionCode" : "100",
+    "transformPx" : false,
+    /* 5+App特有相关 */
+    "app-plus" : {
+        "usingComponents" : true,
+        "nvueCompiler" : "uni-app",
+        "compilerVersion" : 3,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
+        },
+        /* 模块配置 */
+        "modules" : {},
+        /* 应用发布信息 */
+        "distribute" : {
+            /* android打包配置 */
+            "android" : {
+                "permissions" : [
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            /* ios打包配置 */
+            "ios" : {},
+            /* SDK配置 */
+            "sdkConfigs" : {}
+        }
+    },
+    /* 快应用特有相关 */
+    "quickapp" : {},
+    /* 小程序特有相关 */
+    "mp-weixin" : {
+        "appid" : "",
+        "setting" : {
+            "urlCheck" : false
+        },
+        "usingComponents" : true
+    },
+    "mp-alipay" : {
+        "usingComponents" : true
+    },
+    "mp-baidu" : {
+        "usingComponents" : true
+    },
+    "mp-toutiao" : {
+        "usingComponents" : true
+    },
+    "uniStatistics" : {
+        "enable" : false
+    },
+    "h5" : {
+        "title" : "后勤陪护",
+        "router" : {
+            "mode" : "hash",
+            "base" : "/wap/ph/"
+        },
+        "devServer" : {
+            "https" : true,
+            "port" : 80
+        },
+        "optimization" : {
+            "treeShaking" : {
+                "enable" : false
+            }
+        },
+        "sdkConfigs" : {
+            "maps" : {}
+        },
+        "domain" : "http://h5.bosenzhihui.com"
+    }
+}

+ 112 - 0
pages.json

@@ -0,0 +1,112 @@
+{
+	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+		{
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "首页",
+				"enablePullDownRefresh": false,
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/index/wechat",
+			"style": {
+				"navigationBarTitleText": "登录",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/index/worker",
+			"style": {
+				"navigationBarTitleText": "护工列表"
+			}
+		},
+		{
+			"path": "pages/index/success",
+			"style": {
+				"navigationBarTitleText": "下单成功",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/order/index",
+			"style": {
+				"navigationBarTitleText": "我的订单",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/index/add",
+			"style": {
+				"navigationBarTitleText": "预约信息"
+			}
+		},
+		{
+			"path": "pages/order/add",
+			"style": {
+				"navigationBarTitleText": "新增订单"
+			}
+		},
+		{
+			"path": "pages/user/index",
+			"style": {
+				"navigationBarTitleText": "个人中心",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/order/worker",
+			"style": {
+				"navigationBarTitleText": "选择护工",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		},
+		{
+			"path": "pages/order/detail",
+			"style": {
+				"navigationBarTitleText": "订单详情",
+				"app-plus": {
+					"titleNView": false
+				}
+			}
+		}
+	],
+	"globalStyle": {
+		"navigationBarTextStyle": "black",
+		"navigationBarTitleText": "陪护",
+		"navigationBarBackgroundColor": "#FFFFFF",
+		"backgroundColor": "#333333"
+	},
+	"tabBar": {
+		"color": "#C0C4CC", //未选中的菜单文字颜色
+		"selectedColor": "#004db5", //选中时的菜单文字颜色
+		"borderStyle": "black",
+		"backgroundColor": "#ffffff", //背景
+		"list": [{
+				"pagePath": "pages/index/index", //页面地址
+				"iconPath": "static/home1.png", //未选中时的图片
+				"selectedIconPath": "static/home2.png", //选中时的图片
+				"text": "首页" //菜单文字
+			},
+			{
+				"pagePath": "pages/user/index",
+				"iconPath": "static/user1.png",
+				"selectedIconPath": "static/user2.png",
+				"text": "我的"
+			}
+		]
+	}
+
+}

+ 308 - 0
pages/index/add.vue

@@ -0,0 +1,308 @@
+<template>
+	<view>
+		  <view class="container book-main">
+		    <view class="form-box">
+		      <view class="form-box-label">选择科室</view>
+		      <view class="form-box-content" @click="selectDep">
+		        <view class="form-box-content-text" v-if="!dep.title">请选择</view>
+				<view class="form-box-content-text" v-if="dep.title">{{dep.title}}</view>
+		        <image src="../../images/xiangyou-xiao.png"></image>
+		      </view>
+		    </view>
+		    <view class="form-box">
+		      <view class="form-box-label">联系人 <text class="text-red">*</text></view>
+		      <view class="form-box-content">
+		        <input type="text" v-model="contact" placeholder="请填写" />
+		      </view>
+		    </view>
+			<view class="form-box">
+			  <view class="form-box-label">联系手机号 <text class="text-red">*</text></view>
+			  <view class="form-box-content">
+			    <input type="tel" v-model="phone" placeholder="请填写" />
+			  </view>
+			</view>
+		    
+		    <view class="form-box form-box2">
+		      <view class="form-box-label">被陪护人信息</view>
+			  <view class="form-box-sub">
+			    <view class="form-box-label">姓名<text class="text-red">*</text></view>
+			    <view class="form-box-content">
+			      <input type="text" placeholder="请填写" v-model="name" />
+			    </view>
+			  </view>
+			  <view class="form-box-sub">
+			    <view class="form-box-label">性别<text class="text-red">*</text></view>
+			    <view class="form-box-content" @click="selectGender">
+			      <view class="form-box-content-text">{{gender.title}}</view>
+				  <image src="../../images/xiangyou-xiao.png"></image>
+			    </view>
+			  </view>
+			  <view class="form-box-sub">
+			    <view class="form-box-label">年龄<text class="text-red">*</text></view>
+			    <view class="form-box-content">
+			      <input type="number" placeholder="请填写"  v-model="age" />
+			    </view>
+			  </view>
+			  <view class="form-box-sub">
+			    <view class="form-box-label">床号<text class="text-red">*</text></view>
+			    <view class="form-box-content">
+			      <input type="text" placeholder="请填写" v-model="bed" />
+			    </view>
+			  </view>
+		      <view class="form-box-sub">
+		        <view class="form-box-label">所患疾病<text class="text-red">*</text></view>
+		        <view class="form-box-content">
+		          <input type="text" placeholder="请填写" v-model="ill" />
+		        </view>
+		      </view>
+		    </view>
+			
+			<view class="form-box">
+			  <view class="form-box-label">预约时间<text class="text-red">*</text></view>
+			  <view class="form-box-content">
+				<view class="form-box-content" @click="selectStart">
+				  <view class="form-box-content-text" v-if="!start">请选择</view>
+				  <view class="form-box-content-text" v-if="start">{{start}}</view>
+				  <image src="../../images/xiangyou-xiao.png"></image>
+				</view>
+			  </view>
+			</view>
+			
+			<view class="form-box form-box2">
+			  <view class="form-box-label">备注</view>
+			  <view class="form-box-textarea">
+			    <textarea style="height:120rpx;" v-model="remark" placeholder="请填写" />
+			  </view>
+			</view>
+		
+		    <view class="book-btn" @click="saveBtn()">提交</view>
+		  </view>
+		  <cpicker v-if="genders.length > 0" :list="genders" :show.sync="genderShow" :did="gender.id" @confirm="selectedGenderVal"></cpicker>
+		  <cpicker v-if="deps.length > 0" :list="deps" :show.sync="depShow" :did="dep.id" @confirm="selectedDepVal"></cpicker>
+			<w-picker
+				:visible.sync="startVisible"
+				mode="date" 
+				startYear="2021" 
+				endYear="5000"
+				themeColor="#006489"
+				:value="start"
+				:current="true"
+				fields="minute"
+				@confirm="onConfirm($event,'date')"
+				:disabled-after="false"
+				ref="date" 
+			></w-picker>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	import cpicker from "../../components/cpicker/cpicker.vue";
+	import wpicker from "../../components/w-picker/w-picker.vue";
+	export default {
+		components: {
+			cpicker,
+			wpicker
+		},
+		data() {
+			return {
+				flag: false,
+				start:'',
+				startVisible:false,
+				contact: '',
+				name: '',
+				phone: '',
+				ill: '',
+				age: '',
+				bed: '',
+				gender: {
+					id: 1,
+					title: '男'
+				},
+				genderShow: false,
+				genders:[{"id":1,"title":"男"},{"id":2,"title":"女"}],
+				dep: {
+					id: 0,
+					title: ''
+				},
+				depShow: false,
+				deps:[],
+				remark: ''
+			}
+		},
+		onLoad(option) {
+			var orgId = this.getUrlCode('orgId');
+			if(orgId){
+				uni.setStorageSync(app.globalData.storagePre+'orgId',orgId);
+				app.globalData.userinfo.orgId = orgId;
+			}else{
+				orgId = uni.getStorageSync(app.globalData.storagePre+'orgId');
+				if(orgId){
+					app.globalData.userinfo.orgId = orgId;
+				}else{
+					uni.showToast({
+						title: '参数错误',
+						icon: 'none',
+						duration: 2000
+					})
+				}
+			}
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'dep'){
+					that.deps = res.data.data;
+				} else if(apiname == 'order'){
+					uni.navigateTo({
+					    url: '/pages/index/success'
+					});
+				}
+			}
+			
+			this.getDep();
+		},
+		methods: {
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+			selectGender(){
+				this.genderShow = true;
+			},
+			selectedGenderVal(obj){
+				console.log(obj)
+				this.gender = obj;
+			},
+			selectDep(){
+				this.depShow = true;
+			},
+			selectedDepVal(obj){
+				console.log(obj)
+				this.dep = obj;
+			},
+			getDep(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'common/dep',
+					type: 'POST',
+					apiname: 'dep',
+				});
+			},
+			onConfirm(e,type){
+				this.start = e.result;
+			},
+			selectStart(){
+				this.startVisible = true;
+			},
+			
+			saveBtn(){
+				if(!this.contact){
+					uni.showToast({
+						title: '请输入联系人',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.phone){
+					uni.showToast({
+						title: '请输入手机号',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.name){
+					uni.showToast({
+						title: '请输入姓名',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.age){
+					uni.showToast({
+						title: '请输入年龄',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.bed){
+					uni.showToast({
+						title: '请输入床号',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.ill){
+					uni.showToast({
+						title: '请输入所患疾病',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.start){
+					uni.showToast({
+						title: '请选择预约时间',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				let param = {
+					contact: this.contact,
+					phone: this.phone,
+					name: this.name,
+					gender: this.gender.id,
+					age: this.age,
+					bed: this.bed,
+					ill: this.ill,
+					start: this.start,
+					remark: this.remark,
+					depId: this.dep.id
+				}
+				app.ajax({
+					url: app.globalData.serverUrl + 'worker/order',
+					type: 'POST',
+					apiname: 'order',
+					data: param
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.navbg{
+	    width: 100%;
+	    height: 300rpx;
+	}
+	.book-main{
+	    width: 710rpx;
+	    // position: absolute;
+	    // z-index: 10;
+	    // top: 300rpx;
+	    // left: 0;
+	    // bottom: 0;
+	    // overflow: auto;
+		overflow-y: auto;
+		overflow-x: hidden;
+	}
+	
+	
+	.book-btn{
+	    width: 710rpx;
+	    height: 90rpx;
+	    line-height: 90rpx;
+	    background-color: var(--themeColor);
+	    color: #ffffff;
+	    font-size: 34rpx;
+	    font-weight: bold;
+	    text-align: center;
+	    border-radius: 10rpx;
+	}
+</style>

+ 348 - 0
pages/index/index.vue

@@ -0,0 +1,348 @@
+<template>
+	<view>
+		<view v-if="orgName" class="org-title">
+			{{orgName}}
+		</view>
+		<swiper 
+			v-if="banner.length > 0"
+			class="swiper" 
+			:indicator-dots="true" 
+			indicator-color="#FF7576" 
+			:autoplay="true" 
+			:interval="3000" 
+			:duration="200"
+		>
+			<swiper-item v-for="(item,index) in banner" :key="index">
+				<image class="slide-image" mode="scaleToFill" :src="item.path"></image>
+			</swiper-item>
+		</swiper>
+		<view class="container">
+			<view class="book-box">
+				<view class="left-box"  @click="goAdd">
+					<view class="left-title">
+						<img src="../../images/on-line-ico.png" alt="">
+						<text class="name">线上预约</text>
+					</view>
+					<view class="left-title2">高效率响应</view>	
+				</view>
+				<view class="right-box" @click="callPhone">
+					<view class="left-title">
+						<img src="../../images/phone-book-ico.png" alt="">
+						<text class="name">电话预约</text>
+					</view>
+					<view class="left-title2">一键快捷操作</view>	
+				</view>
+				
+			</view>
+		<!-- 	<image class="book-btn" @click="goAdd" src="../../images/book.png"></image>
+			
+			<view class="book-phone" @click="callPhone">
+				<image src="../../images/dianhua@2x.png"></image>
+				直接电话下单
+			</view> -->
+			
+			<view> 
+			    <view class="worker-title">
+					护工推荐
+					<span class="pull-right worker-title-more" @click="goWorker()">查看更多<image src="../../images/youjiantou-hui@2x.png"></image></span>
+				</view>
+			    <view class="worker-box" v-for="(item,index) in list" :key="index">
+			      <view class="worker-box-info">
+			        <view class="worker-box-avator">
+			          <image :src="item.img" mode="aspectFit"></image>
+			        </view>
+			        <view class="worker-box-body">
+			          <view class="worker-box-title">
+			            <text>{{item.name}}</text>
+			          </view>
+			          <view class="worker-box-desc">
+			            <text v-if="item.gender == 1">男</text>
+						<text v-if="item.gender == 2">女</text>
+			            | {{item.age}}岁 | {{item.worker}}年护理经验
+			          </view>
+			          <view class="worker-box-desc">
+						  <rich-text :nodes="item.content"></rich-text>
+					  </view>
+			        </view>
+			      </view>
+			    </view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				list: [],
+				banner: [],
+				phone: '',
+				orgName: '',
+			}
+		},
+		onLoad() {
+			var orgId = this.getUrlCode('orgId');
+			if(orgId){
+				uni.setStorageSync(app.globalData.storagePre+'orgId',orgId);
+				app.globalData.userinfo.orgId = orgId;
+			}else{
+				orgId = uni.getStorageSync(app.globalData.storagePre+'orgId');
+				if(orgId){
+					app.globalData.userinfo.orgId = orgId;
+				}else{
+					uni.showToast({
+						title: '参数错误,未获取到orgId',
+						icon: 'none',
+						duration: 2000
+					})
+				}
+			}
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'banner'){
+					that.banner = res.data.data;
+				}else if(apiname == 'config'){
+					that.phone = res.data.data.val;
+				}else if(apiname == 'worker'){
+					that.list = res.data.data;
+				}else if(apiname == 'org'){
+					that.orgName = res.data.data.name;
+				}
+			}
+			
+			if(app.globalData.userinfo.orgId){
+				this.getOrg();
+				this.getConfig();
+				this.getBanner();
+				this.getWorkerHot();
+			}
+		},
+		onPullDownRefresh() {
+			
+		},
+		onReachBottom() { //上拉加载
+		   
+		},
+		methods: {
+			callPhone(){
+				if(this.phone){
+					uni.makePhoneCall({
+					    phoneNumber: this.phone //仅为示例
+					});
+				}else{
+					uni.showToast({
+						title: '未设置联系电话',
+						icon: 'none',
+						duration: 2000
+					})
+				}
+			},
+			goAdd(){
+				uni.navigateTo({
+				    url: '/pages/index/add'
+				});
+			},
+			goWorker(){
+				uni.navigateTo({
+				    url: '/pages/index/worker'
+				});
+			},
+			getOrg(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'common/getOrg',
+					type: 'POST',
+					apiname: 'org',
+				});
+			},
+			getConfig(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'common/getConfig',
+					type: 'POST',
+					apiname: 'config',
+					data: {
+						name: 'org_phone'
+					}
+				});
+			},
+			getBanner(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'common/banner',
+					type: 'POST',
+					apiname: 'banner',
+				});
+			},
+			getWorkerHot(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'worker/hot',
+					type: 'POST',
+					apiname: 'worker',
+				});
+			},
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	page{
+		// background-color: #FFFFFF;
+	}
+	.org-title{
+		position: fixed;
+		z-index: 1000;
+		left: 0;
+		top: 0;
+		width: 100%;
+		height: 90rpx;
+		line-height: 90rpx;
+		padding: 20rpx;
+		font-size: 34rpx;
+		font-weight: 500;
+		color: #FFFFFF;
+	}
+	.swiper{
+		width: 100%;
+		height: 510rpx;
+	}
+	.slide-image{
+	    width: 750rpx;
+	    height: 510rpx;
+	}
+	
+	.book-btn{
+	    width: 100%;
+	    height: 180rpx;
+	    margin-bottom: 20rpx;
+	}
+	.book-phone{
+		width: 100%;
+		height: 90rpx;
+		line-height: 90rpx;
+		border-radius: 45rpx;
+		color: #FF7576;
+		font-size: 34rpx;
+		border: 1rpx solid #FF7576;
+		text-align: center;
+		font-weight: bold;
+	}
+	.book-phone image{
+		width: 30rpx;
+		height: 30rpx;
+		margin-right: 20rpx;
+	}
+	
+	.worker-title{
+		width: 100%;
+	    // height: 90rpx;
+	    line-height: 90rpx;
+	    color: #333333;
+	    font-size: 32rpx;
+	    font-weight: bold;
+	}
+	.worker-title-more{
+		color: #999999;
+		font-size: 28rpx;
+		 font-weight: 400;
+	}
+	.worker-title-more image{
+		width: 26rpx;
+		height: 26rpx;
+	}
+	.book-box{
+		width: 100%;
+		height: 228rpx;
+		// position: absolute;
+		// top:490rpx;
+		// left:0;
+		// right:0;
+		// bottom:0;
+	}
+	.book-box .left-box{
+		width: 334rpx;
+		height: 228rpx;
+		background-image: url(../../images/on-line-bg.png);
+		background-size: 100% 100%;
+		background-repeat: no-repeat;
+		padding-top: 57rpx;
+		display: inline-block;
+		float: left;
+	}
+	.book-box .left-box .left-title{
+		width: 100%;
+		height: 60rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+	.book-box .left-box .left-title img{
+		width: 44rpx;
+		height: 44rpx;
+	}
+	.book-box .left-box .left-title .name{	
+		margin-left: 24rpx;
+		color: #fff;				
+		font-size: 38rpx;
+		font-weight: bold;
+	 }
+	 .book-box .left-box .left-title2{
+		width: 224rpx;
+		height: 35rpx;
+		font-size: 26rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #FFFFFF;
+		padding-left: 110rpx;
+	 }
+	 
+	 .book-box .right-box{
+	 	width: 334rpx;
+	 	height: 228rpx;
+	 	background-image: url(../../images/phone-book-bg.png);
+	 	background-size: 100% 100%;
+	 	background-repeat: no-repeat;
+	 	padding-top: 57rpx;
+		margin-left: 22rpx;
+		display: inline-block;
+		float: right;
+	 }
+	 
+	 .book-box .right-box .left-title{
+	 	width: 100%;
+	 	height: 60rpx;
+	 	display: flex;
+	 	justify-content: center;
+	 	align-items: center;
+	 }
+	 .book-box .right-box .left-title img{
+	 	width: 44rpx;
+	 	height: 44rpx;
+	 }
+	 .book-box .right-box .left-title .name{	
+	 	margin-left: 24rpx;
+	 	color: #fff;				
+	 	font-size: 38rpx;
+	 	font-weight: bold;
+	  }
+	  .book-box .right-box .left-title2{
+	 	width: 224rpx;
+	 	height: 35rpx;
+	 	font-size: 26rpx;
+	 	font-family: PingFang SC;
+	 	font-weight: 500;
+	 	color: #FFFFFF;
+	 	padding-left: 110rpx;
+	  }
+	  
+	  .container{
+		  position: absolute;
+		  top:460rpx;
+	  }
+</style>

+ 79 - 0
pages/index/success.vue

@@ -0,0 +1,79 @@
+<template>
+	<view>
+		<image class="navbg" src="../../images/duihao-bg.png"></image>
+		<view class="nav-box">
+			<image class="nav-box-duihao" src="../../images/duihao.png"></image>
+			<view class="nav-box-title">下单成功</view>
+			<view class="nav-box-desc">请保持电话畅通,我们将尽快联系您</view>
+		</view>
+		<view class="order-btn" @click="goIndex">返回首页</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		onLoad() {
+			
+		},
+		onShow() {
+			
+		},
+		methods: {
+			goIndex(){
+				uni.reLaunch({ //关闭所有页面,跳转到闪屏页
+					url: '/pages/index/index'
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.navbg{
+	    width: 100%;
+	    height: 374rpx;
+	}
+	.nav-box{
+	    text-align: center;
+	    position: absolute;
+	    z-index: 10;
+	    width: 100%;
+	    height: 240rpx;
+	    top: 130rpx;
+	    left: 0;
+	    color: #333333;
+	}
+	.nav-box-duihao{
+	    width: 100rpx;
+	    height: 100rpx;
+	}
+	.nav-box-title{
+	    line-height: 75rpx;
+	    font-size: 36rpx;
+	    font-weight: 500;
+	}
+	.nav-box-desc{
+	    font-size: 24rpx;
+	    font-weight: 400;
+	}
+	
+	.order-btn{
+	    width: 238rpx;
+	    height: 70rpx;
+	    line-height: 70rpx;
+	    border-radius: 35rpx;
+	    border: 1rpx solid #B3B3B3;
+	    text-align: center;
+	    color: #808080;
+	    font-size: 30rpx;
+	    margin: 0 auto;
+	    margin-top: 20rpx;
+	}
+	
+</style>

+ 112 - 0
pages/index/wechat.vue

@@ -0,0 +1,112 @@
+<template>
+	<view>
+		<view v-if="msg" class="error-box">
+			{{msg}}
+		</view>
+		<view v-if="msg" class="order-btn" @click="goBack">返回</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				state: 0
+			}
+		},
+		onLoad(option) {
+			this.state = this.getUrlCode('state');
+			let code = this.getUrlCode('code')
+			if(code) {
+				this.getOpenidAndUserinfo(code)
+			}else{
+				this.getCode ();
+			}
+		
+		},
+		methods: {
+			getCode () {
+				if(this.isWechat()) {
+					// 截取地址中的code,如果没有code就去微信授权,如果已经获取到code了就直接把code传给后台获取openId
+					let code = this.getUrlCode('code')
+					if (code === null || code === '') {
+						window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+app.globalData.appId+'&redirect_uri=' + encodeURIComponent(app.globalData.redirectUri) + '&response_type=code&scope=snsapi_userinfo&state='+this.state+'#wechat_redirect'
+						// redirect_uri是授权成功后,跳转的url地址,微信会帮我们跳转到该链接,并且通过?的形式拼接code,这里需要用encodeURIComponent对链接进行处理。
+						// 如果配置参数一一对应,那么此时已经通过回调地址刷新页面后,你就会再地址栏中看到code了。
+						// http://127.0.0.1/pages/views/profile/login/login?code=001BWV4J1lRzz00H4J1J1vRE4J1BWV4q&state=1
+					}
+				}
+			},
+			
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+			
+			isWechat() {
+				return String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger";
+			},
+			
+			getOpenidAndUserinfo(code) {
+				let that = this;
+			    uni.request({
+			        url: app.globalData.serverUrl + 'Oauth/checkCode',
+					data: {code: code},
+					method: 'GET',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+			        success: function (res) {
+			            console.log('通过code获取openid和accessToken', res)
+			            if(res.data.code == 0) {
+			            	var app = getApp();
+			                uni.setStorageSync(app.globalData.storagePre+'token', res.data.data.token);
+			            	uni.setStorageSync(app.globalData.storagePre+'userId', res.data.data.userId);
+			            	app.globalData.userinfo.token = res.data.data.token;
+			            	app.globalData.userinfo.userId = res.data.data.userId;
+			            	// uni.reLaunch({ //关闭所有页面,跳转到闪屏页
+			            	// 	url: '/pages/index/index'
+			            	// })
+							window.location.href = app.globalData.host+'/ph/#/pages/index/index';
+			            }else{
+			            	that.msg = res.data.message;
+			            }
+			        },
+					fail: function (err) {
+						console.log(err);
+						that.msg = '登录失败';
+					}
+			    })
+			},
+			
+			goBack(){
+				uni.reLaunch({ //关闭所有页面,跳转到闪屏页
+					url: '/pages/index/wechat'
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.error-box{
+		font-size: 40rpx;
+		color: #333333;
+		text-align: center;
+		margin-top: 180rpx;
+		margin-bottom: 80rpx;
+	}
+	
+	.order-btn{
+		width: 673rpx;
+		height: 72rpx;
+		border-radius: 10rpx;
+		color: #FFFFFF;
+		background-color: $theme-color;
+		line-height: 72rpx;
+		font-size: 38rpx;
+		text-align: center;
+		margin: 0 auto;
+		margin-top: 40rpx;
+	}
+</style>

+ 175 - 0
pages/index/worker.vue

@@ -0,0 +1,175 @@
+<template>
+	<view>
+		<view class="container">
+			<view> 
+			    <view class="worker-box" v-for="(item,index) in list" :key="index">
+			      <view class="worker-box-info">
+			        <view class="worker-box-avator">
+			          <image :src="item.headImage" mode="aspectFit"></image>
+			        </view>
+			        <view class="worker-box-body">
+			          <view class="worker-box-title">
+			            <text>{{item.realName}}</text>
+			          </view>
+			          <view class="worker-box-desc">
+			            <text v-if="item.gender == 1">男</text>
+						<text v-if="item.gender == 2">女</text>
+			            | {{item.age}}岁 | {{item.work}}年护理经验
+			          </view>
+			          <view class="worker-box-desc">
+						  <rich-text :nodes="item.content"></rich-text>
+					  </view>
+			        </view>
+			      </view>
+			    </view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				list: [],
+				page: 1,
+				size: 10,
+				flag: 0
+			}
+		},
+		onLoad() {
+			var orgId = this.getUrlCode('orgId');
+			if(orgId){
+				uni.setStorageSync(app.globalData.storagePre+'orgId',orgId);
+				app.globalData.userinfo.orgId = orgId;
+			}else{
+				orgId = uni.getStorageSync(app.globalData.storagePre+'orgId');
+				if(orgId){
+					app.globalData.userinfo.orgId = orgId;
+				}else{
+					uni.showToast({
+						title: '参数错误',
+						icon: 'none',
+						duration: 2000
+					})
+				}
+			}
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'worker'){
+					that.list = res.data.data;
+					if (that.list.length < that.size) {
+						that.flag = 1;
+					} else {
+						that.page++;
+					}
+				}
+			}
+			
+			if(app.globalData.userinfo.orgId){
+				this.flag = 0;
+				this.page = 1;
+				this.getWorkerList();
+			}
+		},
+		onPullDownRefresh() {
+			this.flag = 0;
+			this.page = 1;
+			this.getWorkerList();
+		},
+		onReachBottom() { //上拉加载
+		    this.getWorkerList();
+		},
+		methods: {
+			getWorkerList(){
+				if(this.flag == 1){
+					return;
+				}
+				app.ajax({
+					url: app.globalData.serverUrl + 'worker/lists',
+					type: 'POST',
+					apiname: 'worker',
+					data: {
+						page: this.page,
+						size: this.size
+					}
+				});
+			},
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	page{
+		// background-color: #FFFFFF;
+	}
+	.org-title{
+		position: fixed;
+		z-index: 1000;
+		left: 0;
+		top: 0;
+		width: 100%;
+		height: 90rpx;
+		line-height: 90rpx;
+		padding: 20rpx;
+		font-size: 34rpx;
+		font-weight: 500;
+		color: #FFFFFF;
+	}
+	.swiper{
+		width: 100%;
+		height: 579rpx;
+	}
+	.slide-image{
+	    width: 750rpx;
+	    height: 579rpx;
+	}
+	
+	.book-btn{
+	    width: 100%;
+	    height: 180rpx;
+	    margin-bottom: 20rpx;
+	}
+	.book-phone{
+		width: 100%;
+		height: 90rpx;
+		line-height: 90rpx;
+		border-radius: 45rpx;
+		color: #FF7576;
+		font-size: 34rpx;
+		border: 1rpx solid #FF7576;
+		text-align: center;
+		font-weight: bold;
+	}
+	.book-phone image{
+		width: 30rpx;
+		height: 30rpx;
+		margin-right: 20rpx;
+	}
+	
+	.worker-title{
+	    height: 90rpx;
+	    line-height: 90rpx;
+	    color: #333333;
+	    font-size: 32rpx;
+	    font-weight: bold;
+	}
+	.worker-title-more{
+		color: #999999;
+		font-size: 28rpx;
+		 font-weight: 400;
+	}
+	.worker-title-more image{
+		width: 26rpx;
+		height: 26rpx;
+	}
+	
+</style>

+ 382 - 0
pages/order/add.vue

@@ -0,0 +1,382 @@
+<template>
+	<view>
+		  <view class="container book-main">
+		    <view class="form-box">
+		      <view class="form-box-label">选择科室</view>
+		      <view class="form-box-content" @click="selectDep">
+		        <view class="form-box-content-text" v-if="!dep.title">请选择</view>
+				<view class="form-box-content-text" v-if="dep.title">{{dep.title}}</view>
+		        <image src="../../images/xiangyou-xiao.png"></image>
+		      </view>
+		    </view>
+		    <view class="form-box">
+		      <view class="form-box-label">联系人 <text class="text-red">*</text></view>
+		      <view class="form-box-content">
+		        <input type="text" v-model="contact" placeholder="请填写" />
+		      </view>
+		    </view>
+			<view class="form-box">
+			  <view class="form-box-label">联系手机号 <text class="text-red">*</text></view>
+			  <view class="form-box-content">
+			    <input type="tel" v-model="phone" placeholder="请填写" />
+			  </view>
+			</view>
+		    
+		    <view class="form-box form-box2">
+		      <view class="form-box-label">被陪护人信息</view>
+			  <view class="form-box-sub">
+			    <view class="form-box-label">姓名<text class="text-red">*</text></view>
+			    <view class="form-box-content">
+			      <input type="text" placeholder="请填写" v-model="name" />
+			    </view>
+			  </view>
+			  <view class="form-box-sub">
+			    <view class="form-box-label">性别<text class="text-red">*</text></view>
+			    <view class="form-box-content" @click="selectGender">
+			      <view class="form-box-content-text">{{gender.title}}</view>
+				  <image src="../../images/xiangyou-xiao.png"></image>
+			    </view>
+			  </view>
+			  <view class="form-box-sub">
+			    <view class="form-box-label">年龄<text class="text-red">*</text></view>
+			    <view class="form-box-content">
+			      <input type="number" placeholder="请填写"  v-model="age" />
+			    </view>
+			  </view>
+			  <view class="form-box-sub">
+			    <view class="form-box-label">床号<text class="text-red">*</text></view>
+			    <view class="form-box-content">
+			      <input type="text" placeholder="请填写" v-model="bed" />
+			    </view>
+			  </view>
+		      <view class="form-box-sub">
+		        <view class="form-box-label">所患疾病<text class="text-red">*</text></view>
+		        <view class="form-box-content">
+		          <input type="text" placeholder="请填写" v-model="ill" />
+		        </view>
+		      </view>
+		    </view>
+			
+			<view class="form-box">
+			  <view class="form-box-label">服务开始时间<text class="text-red">*</text></view>
+			  <view class="form-box-content">
+				<view class="form-box-content" @click="selectStart">
+				  <view class="form-box-content-text" v-if="!start">请选择</view>
+				  <view class="form-box-content-text" v-if="start">{{start}}</view>
+				  <image src="../../images/xiangyou-xiao.png"></image>
+				</view>
+			  </view>
+			</view>
+			
+			<view class="form-box">
+			  <view class="form-box-label">选择服务</view>
+			  <view class="form-box-content" @click="selectCate">
+			    <view class="form-box-content-text" v-if="!cate.title">请选择</view>
+				<view class="form-box-content-text" v-if="cate.title">{{cate.title}}</view>
+			    <image src="../../images/xiangyou-xiao.png"></image>
+			  </view>
+			</view>
+			
+			<view class="form-box">
+			  <view class="form-box-label">价格(/人/天)<text class="text-red">*</text></view>
+			  <view class="form-box-content">
+			    <input type="number" placeholder="请填写"  v-model="price" />
+			  </view>
+			</view>
+			
+			<view class="form-box">
+			  <view class="form-box-label">预收金</view>
+			  <view class="form-box-content">
+			    <input type="number" placeholder="请填写"  v-model="pre_money" />
+			  </view>
+			</view>
+			
+			<view class="form-box">
+			  <view class="form-box-label">选择护工</view>
+			  <view class="form-box-content" @click="goSelectWorker">
+			    <view class="form-box-content-text" v-if="!unames">请选择</view>
+				<view class="form-box-content-text" v-if="unames">{{unames}}</view>
+			    <image src="../../images/xiangyou-xiao.png"></image>
+			  </view>
+			</view>
+			
+			<view class="form-box form-box2">
+			  <view class="form-box-label">备注</view>
+			  <view class="form-box-textarea">
+			    <textarea style="height:120rpx;" v-model="remark" placeholder="请填写" />
+			  </view>
+			</view>
+		
+		    <view class="book-btn" @click="saveBtn()">提交</view>
+		  </view>
+		  <cpicker v-if="genders.length > 0" :list="genders" :show.sync="genderShow" :did="gender.id" @confirm="selectedGenderVal"></cpicker>
+		  <cpicker v-if="deps.length > 0" :list="deps" :show.sync="depShow" :did="dep.id" @confirm="selectedDepVal"></cpicker>
+		  <cpicker v-if="cates.length > 0" :list="cates" :show.sync="cateShow" :did="cate.id" @confirm="selectedCateVal"></cpicker>
+			<w-picker
+				:visible.sync="startVisible"
+				mode="date" 
+				startYear="2021" 
+				endYear="5000"
+				themeColor="#FF7576"
+				:value="start"
+				:current="true"
+				fields="minute"
+				@confirm="onConfirm($event,'date')"
+				:disabled-after="false"
+				ref="date" 
+			></w-picker>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	import cpicker from "../../components/cpicker/cpicker.vue";
+	import wpicker from "../../components/w-picker/w-picker.vue";
+	export default {
+		components: {
+			cpicker,
+			wpicker
+		},
+		data() {
+			return {
+				flag: false,
+				start:'',
+				startVisible:false,
+				contact: '',
+				name: '',
+				phone: '',
+				ill: '',
+				age: '',
+				bed: '',
+				gender: {
+					id: 1,
+					title: '男'
+				},
+				genderShow: false,
+				genders:[{"id":1,"title":"男"},{"id":2,"title":"女"}],
+				dep: {
+					id: 0,
+					title: ''
+				},
+				depShow: false,
+				deps:[],
+				cate: {
+					id: 0,
+					title: '',
+					price: 0,
+				},
+				cateShow: false,
+				cates:[],
+				remark: '',
+				price: '',
+				unames: '',
+				workers: [],
+				pre_money: '',
+			}
+		},
+		onLoad(option) {
+			
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'dep'){
+					that.deps = res.data.data;
+				}else if(apiname == 'cate'){
+					that.cates = res.data.data;
+				} else if(apiname == 'order'){
+					uni.navigateTo({
+					    url: '/pages/order/index'
+					});
+				}
+			}
+			
+			this.getDep();
+			this.getCate();
+		},
+		methods: {
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+			selectGender(){
+				this.genderShow = true;
+			},
+			selectedGenderVal(obj){
+				console.log(obj)
+				this.gender = obj;
+			},
+			selectDep(){
+				this.depShow = true;
+			},
+			selectedDepVal(obj){
+				console.log(obj)
+				this.dep = obj;
+			},
+			getDep(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'common/dep',
+					type: 'POST',
+					apiname: 'dep',
+				});
+			},
+			selectCate(){
+				this.cateShow = true;
+			},
+			selectedCateVal(obj){
+				console.log(obj)
+				this.cate = obj;
+				this.price = obj.price;
+			},
+			getCate(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'cate/cateList',
+					type: 'POST',
+					apiname: 'cate',
+				});
+			},
+			onConfirm(e,type){
+				this.start = e.result;
+			},
+			selectStart(){
+				this.startVisible = true;
+			},
+			
+			goSelectWorker(){
+				var that = this;
+				uni.navigateTo({
+					url: '/pages/order/worker',
+					events: {
+						// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
+						acceptDataFromOpenedPage: function(data) {
+							console.log('jieshou:',data)
+							that.workers = data;
+							let names = [];
+							that.workers.forEach((item,index) => {
+								if(index < 2){
+									names.push(item.name)
+								}
+							});
+							if(that.workers.length > 2){
+								that.unames = names.join(',') + '...';
+							}else{
+								that.unames = names.join(',');
+							}
+						}
+					},
+					success: function(res) {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit('acceptDataFromOpenerPage', { workers: that.workers })
+					}
+				})
+			},
+			
+			saveBtn(){
+				if(!this.contact){
+					uni.showToast({
+						title: '请输入联系人',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.phone){
+					uni.showToast({
+						title: '请输入手机号',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.name){
+					uni.showToast({
+						title: '请输入姓名',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.age){
+					uni.showToast({
+						title: '请输入年龄',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.bed){
+					uni.showToast({
+						title: '请输入床号',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.ill){
+					uni.showToast({
+						title: '请输入所患疾病',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.start){
+					uni.showToast({
+						title: '请选择预约时间',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				let param = {
+					contact: this.contact,
+					phone: this.phone,
+					name: this.name,
+					gender: this.gender.id,
+					age: this.age,
+					bed: this.bed,
+					ill: this.ill,
+					start: this.start,
+					remark: this.remark,
+					dep_id: this.dep.id,
+				}
+				app.ajax({
+					url: app.globalData.serverUrl + 'Worker/order',
+					type: 'POST',
+					apiname: 'order',
+					data: param
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.navbg{
+	    width: 100%;
+	    height: 300rpx;
+	}
+	.book-main{
+	    width: 710rpx;
+	    // position: absolute;
+	    // z-index: 10;
+	    // top: 300rpx;
+	    // left: 0;
+	    // bottom: 0;
+	    overflow: auto;
+	}
+	
+	
+	.book-btn{
+	    width: 710rpx;
+	    height: 90rpx;
+	    line-height: 90rpx;
+	    background-color: var(--themeColor);
+	    color: #ffffff;
+	    font-size: 34rpx;
+	    font-weight: bold;
+	    text-align: center;
+	    border-radius: 10rpx;
+	}
+</style>

+ 499 - 0
pages/order/detail.vue

@@ -0,0 +1,499 @@
+<template>
+	<view v-if="info">
+		<view class="order-header">
+			<view class="order-header-body">
+				<view class="order-header-left">
+					<image src="../../images/address.png" mode="aspectFit"></image>
+				</view>
+				<view class="order-header-main">
+					<view>所属科室:{{info.depName}}</view>
+					<view>联系人:{{info.contact}}</view>
+					<view>联系电话:{{info.phone}}</view>
+				</view>
+				<view class="order-header-right">
+					<span class="status" v-if="info.status == 0">待分配</span>
+					<span class="status"  v-if="info.status == 1">进行中</span>
+					<span class="status"  v-if="info.status == 2">已完成</span>
+					<span class="status"  v-if="info.status == 3">已作废</span>
+					<span class="status2" v-if="info.status == 4"><span class="yjs">(已结算)</span></span>
+				
+				</view>
+			</view>
+		</view>
+		<view class="container">
+			<view class="order-box">
+				<view class="order-box-title">订单基础信息</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">病人姓名</view>
+					<view class="order-box-list-val">{{info.name}}</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">病人性别</view>
+					<view class="order-box-list-val">
+						<span v-if="info.gender == 1">男</span>
+						<span v-if="info.gender == 2">女</span>
+					</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">病人年龄</view>
+					<view class="order-box-list-val">{{info.age}}</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">病人床号</view>
+					<view class="order-box-list-val">{{info.bed}}</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">所患疾病</view>
+					<view class="order-box-list-val">{{info.ill}}</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">服务类型</view>
+					<view class="order-box-list-val">{{info.cateName}}</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">单价(/人/天)</view>
+					<view class="order-box-list-val">{{info.price}}</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">开始时间</view>
+					<view class="order-box-list-val">{{info.start}}</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">结束时间</view>
+					<view class="order-box-list-val">{{info.end}}</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">结束时间</view>
+					<view class="order-box-list-val">{{info.end}}</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">预收金</view>
+					<view class="order-box-list-val">{{info.preMoney}}</view>
+				</view>
+				<view class="order-box-list">
+					<view class="order-box-list-title">订单金额</view>
+					<view class="order-box-list-val">{{info.amount}}</view>
+				</view>
+				<view class="order-box-list2">
+					<view class="order-box-list-title">备注</view>
+					<view class="order-box-list-val">{{info.remark?info.remark:'无'}}</view>
+				</view>
+			</view>
+			<view class="order-box2">
+				<view>订单号:{{info.sn}}</view>
+				<view>下单日期:{{info.createTime}}</view>
+				<view v-if="info.finishTime">完成日期:{{info.finishTime}}</view>
+				<view v-if="info.canceTime">作废日期:{{info.canceTime}}</view>
+				<view v-if="info.cancelUserName">作废人:{{info.cancelUserName}}</view>
+				<view v-if="info.cancelReason">作废原因:{{info.cancelReason}}</view>
+			</view>
+			
+			<view v-if="info.todo.length > 0">
+				<view>工单信息</view>
+				<view v-for="(item,index) in info.todo" class="order-box2">
+					<view>调度:{{item.userName}}</view>
+					<view>护工:{{item.workerName}}</view>
+					<view>开始时间:{{item.start}}</view>
+					<view>结束时间:{{item.end}}</view>
+					<view>备注:{{item.remark}}</view>
+					<view>状态:
+					<span v-if="item.status == 0">已作废</span>
+					<span v-if="item.status == 1">服务中</span>
+					<span v-if="item.status == 2">已结束</span>
+					</view>
+					<view>派发日期:{{item.createTime}}</view>
+					
+				</view>
+			</view>
+			
+			<view v-if="info.pays.length > 0">
+				<view>预收金信息</view>
+				<view v-for="(item,index) in info.pays" class="order-box3">
+					<view>金额:¥{{item.money}}</view>
+					<view>退款金额:¥{{item.money2}}</view>
+					<view>支付方式:
+					<span v-if="item.type === 2">线上</span>
+					<span v-if="item.type === 1">线下</span>
+					</view>
+					<view>日期:{{item.payTime}}</view>
+				</view>
+			</view>
+			
+
+			<view v-if="info.status == 0||info.status == 1" class="btn" @click="finishBtn()">预收金</view>
+			<!-- <view v-if="info.status == 1" class="btn btn-success" @click="finishBtn()">完成</view>
+			<view v-if="info.status != 3&&info.status != 4" class="btn btn-danger" @click="cancelBtn()">作废</view> -->
+		</view>
+		
+		<cmodal :show.sync="cancelShow" title="作废订单" @confirm="cancelConfirm">
+		    <textarea v-model="cancelReason" style="height: 150rpx;" placeholder="请输入作废原因"></textarea>
+		</cmodal>
+		<cmodal :show.sync="finishShow" title="预收金" @confirm="finishConfirm"  @cancel="cancelFinishConfirm">
+			<view class="form-box3">
+			  <view class="form-box-label">金额 <text class="text-red">*</text></view>
+			  <view class="form-box-content">
+			    <input type="number" v-model="amount" placeholder="请填写金额" />
+			  </view>
+			</view>
+		</cmodal>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	import cpicker from "../../components/cpicker/cpicker.vue";
+	import wpicker from "../../components/w-picker/w-picker.vue";
+	import cmodal from "../../components/cmodel/cmodel.vue";
+	export default {
+		components: {
+			cpicker,
+			wpicker,
+			cmodal
+		},
+		data() {
+			return {
+				info: null,
+				flag: 0,
+				id: 0,
+				cancelReason: '',
+				cancelShow: false,
+				end: '',
+				finishShow: false,
+				endShow: false,
+				amount: '',
+				wx: null,
+			}
+		},
+		onLoad(option) {
+			this.id = option.id;
+			let that = this;
+			if (this.$wechat && this.$wechat.isWechat()) {//获取定位经纬度
+				this.$wechat.getWx(function (res) {
+					console.log(res)
+					that.wx = res;
+				});
+			}
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'order'){
+					that.info = res.data.data;
+				}else if(apiname == 'payOrder'){
+					that.getPayParam(res.data.data.payId);
+				}else if(apiname == 'pay'){
+					if(that.wx){
+						that.wx.chooseWXPay({
+							timestamp: res.data.data.timestamp,
+							nonceStr: res.data.data.nonceStr,
+							package: res.data.data.package,
+							signType: res.data.data.signType,
+							paySign: res.data.data.paySign,
+							success: function (r) {
+								// 支付成功后的回调函数
+								if (r.errMsg == "chooseWXPay:ok") {
+									window.location.reload();
+								} else {
+									uni.showToast({
+										title: '支付失败',
+										icon: 'none',
+										duration: 2000
+									})
+								}
+							},
+							cancel: function(r) {},
+							fail:function(r){
+								uni.showToast({
+									title: '支付失败',
+									icon: 'none',
+									duration: 2000
+								})
+							}
+						});
+					}else{
+						uni.showToast({
+							title: '支付调用失败,请刷新重试',
+							icon: 'none',
+							duration: 2000
+						})
+					}
+				}
+			}
+			
+			this.getOrderDetail();
+		},
+		methods: {
+			getOrderDetail(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'PhOrders/detail',
+					type: 'POST',
+					apiname: 'order',
+					data:{
+						id: this.id
+					}
+				});
+			},
+			sendOrder(id){
+				uni.navigateTo({
+				    url: '/pages/order/send?orderId='+id
+				});
+			},
+			cancelBtn(){
+				this.cancelShow = true;
+				console.log(orderId,this.cancelShow);
+			},
+			cancelConfirm(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'Order/cancel',
+					type: 'POST',
+					apiname: 'cancel',
+					data: {
+						cancelReason: this.cancelReason,
+						id: this.id
+					}
+				});
+			},
+			selectEnd(){
+				this.endShow = true;
+			},
+			onConfirm(e,type){
+				this.end = e.result;
+			},
+			finishBtn(){
+				this.finishShow = true;
+				this.endShow = false;
+				this.amount = '';
+			},
+			finishConfirm(){
+				if(!this.amount || this.amount <= 0){
+					uni.showToast({
+						title: '未输入金额',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				app.ajax({
+					url: app.globalData.serverUrl + 'PhOrders/payOrder',
+					type: 'POST',
+					apiname: 'payOrder',
+					data: {
+						orderId: this.id,
+						money: this.amount
+					}
+				});
+			},
+			
+			getPayParam(payId){
+				app.ajax({
+					url: app.globalData.serverUrl + 'PhOrders/pay',
+					type: 'POST',
+					apiname: 'pay',
+					data: {
+						payId: payId
+					}
+				});
+			},
+			
+			cancelFinishConfirm(){
+				this.end = '';
+			},
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	page{
+		overflow-x: hidden;
+	}
+	.container{
+		overflow: hidden;
+	}
+	.btn{
+		// width: 100%;
+		height: 90rpx;
+		line-height: 90rpx;
+		text-align: center;
+		font-size: 34rpx;
+		font-weight: bold;
+		border-radius: 10rpx;
+		background-color: #FFFFFF;
+		color: var(--themeColor);
+		// margin: 10rpx;
+	}
+	.btn.btn-success{
+		background-color: #5cb85c;
+		color: #FFFFFF;
+	}
+	.btn.btn-danger{
+		background-color: #FF7576;
+		color: #FFFFFF;
+	}
+	.order-box2{
+		width: 670rpx;
+		height: auto;
+		border-radius: 10rpx;
+		background-color: #FFFFFF;
+		overflow: hidden;
+		padding: 30rpx 20rpx;
+		margin: 20rpx 0;
+		color: #666666;
+		font-size: 28rpx;
+	}
+	.order-box{
+		width: 100%;
+		height: auto;
+		border-radius: 10rpx;
+		background-color: #FFFFFF;
+		overflow: hidden;
+	}
+	.order-box-title{
+		position: relative;
+		width: 680rpx;
+		height: 90rpx;
+		line-height: 90rpx;
+		padding-left: 30rpx;
+		color: #333333;
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+	.order-box-title::before{
+		content: '';
+		width: 5rpx;
+		height: 28rpx;
+		position: absolute;
+		left: 16rpx;
+		top: 32rpx;
+		background-color: var(--themeColor);
+	}
+	.order-box-list{
+		width: 670rpx;
+		min-height: 90rpx;
+		height: auto;
+		padding: 0 20rpx;
+		overflow: hidden;
+	}
+	.order-box-list .order-box-list-title{
+		width: 270rpx;
+		height: 90rpx;
+		line-height: 90rpx;
+		float: left;
+		color: #333333;
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+	.order-box-list .order-box-list-val{
+		width: 380rpx;
+		min-height: 62rpx;
+		float: right;
+		color: #333333;
+		font-size: 30rpx;
+		font-weight: bold;
+		padding-top: 28rpx;
+		text-align: right;
+	}
+	.order-box-list2{
+		width: 670rpx;
+		min-height: 90rpx;
+		height: auto;
+		padding: 0 20rpx;
+		overflow: hidden;
+	}
+	.order-box-list2 .order-box-list-title{
+		width: 100%;
+		height: 90rpx;
+		line-height: 90rpx;
+		color: #333333;
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+	.order-box-list2 .order-box-list-val{
+		width: 630rpx;
+		min-height: 50rpx;
+		height: auto;
+		color: #333333;
+		font-size: 30rpx;
+		font-weight: bold;
+		background-color: #F7F7F7;
+		border-radius: 10rpx;
+		padding: 20rpx;
+		margin-bottom: 20rpx;
+	}
+	
+	.order-header{
+		background-color: var(--themeColor);
+		width: 100%;
+		height: auto;
+		padding: 20rpx;
+	}
+	.order-header .order-header-body{
+		width: 650rpx;
+		height: 124rpx;
+		padding: 30rpx;
+		background-color: #FFFFFF;
+		border-radius: 10rpx;
+	}
+	.order-header-left{
+		width: 100rpx;
+		height: 124rpx;
+		float: left;
+	}
+	.order-header-left image{
+		width: 70rpx;
+		height: 70rpx;
+		margin-top: 30rpx;
+	}
+	.order-header-main{
+		width: 400rpx;
+		height: 124rpx;
+		float: left;
+		color: #333333;
+		font-size: 26rpx;
+	}
+	.order-header-main view{
+		padding: 5rpx 0;
+	}
+	.order-header-right{
+		width: 150rpx;
+		height: 124rpx;
+		// line-height: 124rpx;
+		float: right;
+		color: var(--themeColor);
+		font-size: 34rpx;
+		text-align: right;
+		// overflow: hidden;
+	}
+	.order-header-right .status{
+		display: inline-block;
+		margin-top: 35rpx;
+	}
+	.order-header-right .status2{
+		display: inline-block;
+		margin-top: 15rpx;
+	}
+
+	.order-header-right .yjs{
+		display: inline-block;
+		margin-top: 5rpx;
+		text-align: right;
+		font-size: 29rpx;
+	}
+	
+	.order-box3{
+		width: 670rpx;
+		height: auto;
+		border-radius: 10rpx;
+		background-color: #FFFFFF;
+		overflow: hidden;
+		padding: 30rpx 20rpx;
+		margin: 20rpx 0;
+		color: #666666;
+		font-size: 28rpx;
+		border-left: 5px solid var(--themeColor);
+	}
+</style>

+ 443 - 0
pages/order/index.vue

@@ -0,0 +1,443 @@
+<template>
+	<view>
+		 <view class="search-tab">
+		    <view v-if="status == 0" data-status="0" @click="selectStatus" class="search-tab-list cur">
+				<text>待分配</text>
+		    </view>
+			<view v-if="status != 0" data-status="0" @click="selectStatus" class="search-tab-list">
+				<text>待分配</text>
+			</view>
+		    <view v-if="status == 1" data-status="1" @click="selectStatus" class="search-tab-list cur">
+				<text>进行中</text>
+		    </view>
+			<view v-if="status != 1" data-status="1" @click="selectStatus" class="search-tab-list">
+				<text>进行中</text>
+			</view>
+		    <view v-if="status == 2" data-status="2" @click="selectStatus" class="search-tab-list cur">
+				<text>已完成</text>
+		    </view>
+			<view v-if="status != 2" data-status="2" @click="selectStatus" class="search-tab-list">
+				<text>已完成</text>
+			</view>
+			 <view v-if="status == 3" data-status="2" @click="selectStatus" class="search-tab-list cur">
+				 <text>已作废</text>
+			 </view>
+			 <view v-if="status != 3" data-status="2" @click="selectStatus" class="search-tab-list">
+				 <text>已作废</text>
+			 </view>
+		</view>
+		
+		  <view class="container" style="padding-top: 110rpx;">
+		      <view class="order-info" v-for="(item,index) in list" :key="index">
+		          <view class="order-content" @click="goDetail(item.id)">
+		            <view class="info-left">
+		               <image src="../../images/address.png" />
+		            </view>
+		            <view class="info-right">
+					  <view class="time">下单日期:{{item.createTime}} </view>
+		              <view class="time">服务日期:{{item.start}} </view>
+					  <view class="time">联系人:{{item.contact}} </view>
+					  <view class="time">联系电话:{{item.phone}} </view>
+		            </view>
+		          </view>
+
+		      </view>
+		      <view v-if="list.length == 0" class="zanwushuju">暂无数据</view>
+		  </view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	import cpicker from "../../components/cpicker/cpicker.vue";
+	import wpicker from "../../components/w-picker/w-picker.vue";
+	import cmodal from "../../components/cmodel/cmodel.vue";
+	export default {
+		components: {
+			cpicker,
+			wpicker,
+			cmodal
+		},
+		data() {
+			return {
+				list: [],
+				page: 1,
+				size: 10,
+				flag: 0,
+				status: 0,
+				cancelReason: '',
+				cancelShow: false,
+				curOrderId: 0,
+				end: '',
+				finishShow: false,
+				endShow: false,
+				amount: '',
+				preMoney: '',
+			}
+		},
+		onLoad() {
+			
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'order'){
+					that.list = res.data.data;
+					if (that.list.length < that.size) {
+						that.flag = 1;
+					} else {
+						that.page++;
+					}
+				}else if(apiname == 'user'){
+					uni.setStorageSync('orgId',res.data.data.orgs.orgId);
+					uni.setStorageSync('orgName',res.data.data.orgs.orgName);
+					app.globalData.userinfo.orgId = res.data.data.orgs.orgId;
+					app.globalData.userinfo.orgName = res.data.data.orgs.orgName;
+					this.flag = 0;
+					this.page = 1;
+					this.getOrder();
+				}else if(apiname == 'cancel'){
+					this.flag = 0;
+					this.getOrder();
+				}else if(apiname == 'finish'){
+					this.flag = 0;
+					this.getOrder();
+				}else if(apiname == 'send'){
+					this.flag = 0;
+					this.getOrder();
+				}
+			}
+			this.getOrder();
+		},
+		onPullDownRefresh() {
+			this.flag = 0;
+			this.page = 1;
+			this.getOrder();
+		},
+		onReachBottom() { //上拉加载
+		    this.getOrder();
+		},
+		methods: {
+			addOrder(){
+				uni.navigateTo({
+				    url: '/pages/order/add'
+				});
+			},
+			sendOrder(id){
+				uni.navigateTo({
+				    url: '/pages/order/send?orderId='+id
+				});
+			},
+			goDetail(id){
+				// uni.navigateTo({
+				//     url: '/pages/order/detail?id='+id
+				// });
+				window.location.href = app.globalData.host+'/ph/#/pages/order/detail?id='+id;
+			},
+			selectStatus(e){
+				this.status = e.currentTarget.dataset.status;
+				this.flag = 0;
+				this.page = 1;
+				this.getOrder();
+			},
+			getUserInfo(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'user/info',
+					type: 'POST',
+					apiname: 'user',
+				});
+			},
+			getOrder(){
+				if(this.flag == 1){
+					return;
+				}
+				app.ajax({
+					url: app.globalData.serverUrl + 'PhOrders/orderList',
+					type: 'POST',
+					apiname: 'order',
+					data: {
+						page: this.page,
+						size: this.size,
+						status: this.status
+					}
+				});
+			},
+			cancelBtn(orderId){
+				this.curOrderId = orderId;
+				this.cancelShow = true;
+				console.log(orderId,this.cancelShow);
+			},
+			cancelConfirm(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'Order/cancel',
+					type: 'POST',
+					apiname: 'cancel',
+					data: {
+						cancelReason: this.cancelReason,
+						id: this.curOrderId
+					}
+				});
+			},
+			finishBtn(obj){
+				this.curOrderId = obj.id;
+				this.finishShow = true;
+				this.endShow = false;
+				this.end = '';
+				this.preMoney = obj.preMoney;
+				console.log(obj.id,this.cancelShow);
+			},
+			finishConfirm(){
+				if(!this.end){
+					uni.showToast({
+						title: '未选择服务结束日期',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				app.ajax({
+					url: app.globalData.serverUrl + 'Order/finish',
+					type: 'POST',
+					apiname: 'finish',
+					data: {
+						id: this.curOrderId,
+						end: this.end,
+						amount: this.amount,
+					}
+				});
+			},
+			cancelFinishConfirm(){
+				this.end = '';
+			},
+			selectEnd(){
+				this.endShow = true;
+			},
+			onConfirm(e,type){
+				this.end = e.result;
+			},
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.select-date{
+		width: 100%;
+		height: 90rpx;
+		line-height: 90rpx;
+		overflow: hidden;
+		font-size: 30rpx;
+		text-align: center;
+	}
+	.addOrderBtn{
+		position: fixed;
+		width: 110rpx;
+		height: 90rpx;
+		padding-top: 20rpx;
+		border-radius: 50%;
+		text-align: center;
+		background-color: var(--themeColor);
+		color: #FFFFFF;
+		font-size: 28rpx;
+		right: 40rpx;
+		bottom: 100rpx;
+		z-index: 100;
+	}
+	.search-tab{
+	  position: absolute;
+	  z-index: 11;
+	  left: 0;
+	  top: 0;
+	  width: 100%;
+	  height: 90rpx;
+	  line-height: 90rpx;
+	  color: #FF706F;
+	  font-size: 32rpx;
+	  font-weight: bold;
+	  background-color: #ffffff;
+	  text-align: center;
+	  overflow: hidden;
+	}
+	.search-box{
+	  position: absolute;
+	  z-index: 9;
+	  left: 0;
+	  top: 90rpx;
+	  bottom: 0;
+	  right: 0;
+	  overflow: auto;
+	}
+	
+	.search-tab .search-tab-list{
+	  position: relative;
+	  display: inline-block;
+	  width: 33.3%;
+	  background-color: #ffffff;
+	  float: left;
+	  color: #333333;
+	  font-size: 28rpx;
+	  font-weight: 400;
+	}
+	.search-tab .search-tab-list.cur{
+	  color: var(--themeColor);
+	  font-size: 32rpx;
+	  font-weight: bold;
+	}
+	.search-tab .search-tab-list.cur::after{
+	  content: '';
+	  width: 44rpx;
+	  height: 6rpx;
+	  background-color: var(--themeColor);
+	  position: absolute;
+	  z-index: 5;
+	  bottom: 0;
+	  left: 50%;
+	  margin-left: -22rpx;
+	}
+	.order-info {
+	  width: 690rpx;
+	  background: #FFFFFF;
+	  border-radius: 10rpx;
+	  margin: 0 auto;
+	  margin-bottom: 20rpx;
+	  overflow: hidden;
+	}
+	.order-content{
+	  width: 710rpx;
+	  height: 197rpx;
+	  border-bottom: 1rpx solid #f1f1f1;
+	}
+	.info-left{
+	  width: 150rpx;
+	  height: 197rpx;
+	  line-height: 225rpx;
+	  float: left;
+	  display: inline-block;
+	  text-align: center;
+	}
+	.info-left image{
+	    width: 70rpx;
+	    height: 70rpx;
+	} 
+	.info-right {
+	  width: 550rpx;
+	  height: 157rpx;
+	  display: inline-block;
+	  float: left;
+	  padding-top: 40rpx;
+	}
+	.info-right .time{
+	  width: 550rpx;
+	  height: 40rpx;
+	  line-height: 1rpx;
+	  // margin-top: 50rpx;
+	  font-size: 26rpx;
+	  font-family: PingFang SC;
+	  font-weight: 500;
+	  color: #333333;
+	}
+	.info-right .address{  
+	  width: 550rpx;
+	  height: 100rpx;
+	  font-size: 26rpx;
+	  font-family: PingFang SC;
+	  font-weight: 500;
+	  color: #333333;
+	  margin-top: 10rpx;
+	  overflow: hidden;
+	}
+	.bottom{
+	  width: 710rpx;
+	  height: 130rpx;
+	}
+	.bottom .bottom-left{
+	  width: 300rpx;
+	  height: 130rpx;
+	  line-height: 130rpx;
+	  display: inline-block;
+	  float: left;
+	  text-align: left;
+	  padding-left: 20rpx;
+	}
+	// .bottom-left image{
+	//   width: 36rpx;
+	//   height: 36rpx;
+	// }
+	// .bottom-left text{
+	//   margin-left: 10rpx;
+	//   font-size: 34rpx;
+	//   font-family: PingFang SC;
+	//   font-weight: bold;
+	//   color: #FF3F40;
+	//   vertical-align: bottom;
+	// }
+	
+	.bottom-right{
+	  width: 360rpx;
+	  height: 130rpx;
+	  line-height: 130rpx;
+	  display: inline-block;
+	  float: left;
+	  text-align: right;
+	}
+	.bottom-btn-cancel{
+	  display: inline-block;
+	  width: 158rpx;
+	  height: 60rpx;
+	  line-height: 60rpx;
+	  font-size: 30rpx;
+	  border: 1px solid #B3B3B3;
+	  border-radius: 30rpx;
+	  text-align: center;
+	  color: #999999;
+	}
+	.bottom-btn-go{
+	  display: inline-block;
+	  width: 130rpx;
+	  height: 60rpx;
+	  line-height: 60rpx;
+	  background: #FF7576;
+	  border: 1px solid #FF7576;
+	  border-radius: 30px;
+	  font-size: 30rpx;
+	  font-family: PingFang SC;
+	  font-weight: 400;
+	  color: #FFFFFF;
+	  text-align: center;
+	  margin-left: 20rpx;
+	}
+	.bottom-btn-add{
+	  display: inline-block;
+	  width: 158rpx;
+	  height: 60rpx;
+	  line-height: 60rpx;
+	  background: #FF7576;
+	  border-radius: 30px;
+	  font-size: 30rpx;
+	  font-family: PingFang SC;
+	  font-weight: 400;
+	  color: #FFFFFF;
+	  text-align: center;
+	  margin-left: 20rpx;
+	}
+	
+	
+.zanwushuju{
+  width: 750rpx;
+  text-align: center;
+  padding-top: 20rpx;
+  color: #666666;
+  font-size: 32rpx;
+}
+.zanwushuju image{
+  width: 374rpx;
+  height: 288rpx;
+  margin: 0 auto;
+}
+
+	
+</style>

+ 254 - 0
pages/order/send.vue

@@ -0,0 +1,254 @@
+<template>
+	<view>
+		  <view class="container book-main">
+			<view class="form-box">
+			  <view class="form-box-label">服务开始时间<text class="text-red">*</text></view>
+			  <view class="form-box-content">
+				<view class="form-box-content" @click="selectStart">
+				  <view class="form-box-content-text" v-if="!start">请选择</view>
+				  <view class="form-box-content-text" v-if="start">{{start}}</view>
+				  <image src="../../images/xiangyou-xiao.png"></image>
+				</view>
+			  </view>
+			</view>
+			
+			<view class="form-box">
+			  <view class="form-box-label">选择服务</view>
+			  <view class="form-box-content" @click="selectCate">
+			    <view class="form-box-content-text" v-if="!cate.title">请选择</view>
+				<view class="form-box-content-text" v-if="cate.title">{{cate.title}}</view>
+			    <image src="../../images/xiangyou-xiao.png"></image>
+			  </view>
+			</view>
+			
+			<view class="form-box">
+			  <view class="form-box-label">价格(/人/天)<text class="text-red">*</text></view>
+			  <view class="form-box-content">
+			    <input type="text" placeholder="请填写"  v-model="price" />
+			  </view>
+			</view>
+			
+			<view class="form-box">
+			  <view class="form-box-label">选择护工</view>
+			  <view class="form-box-content" @click="goSelectWorker">
+			    <view class="form-box-content-text" v-if="!unames">请选择</view>
+				<view class="form-box-content-text" v-if="unames">{{unames}}</view>
+			    <image src="../../images/xiangyou-xiao.png"></image>
+			  </view>
+			</view>
+			
+			<view class="form-box form-box2">
+			  <view class="form-box-label">备注</view>
+			  <view class="form-box-textarea">
+			    <textarea style="height:120rpx;" v-model="remark" placeholder="请填写" />
+			  </view>
+			</view>
+		
+		    <view class="book-btn" @click="saveBtn()">提交</view>
+		  </view>
+		
+		  <cpicker v-if="cates.length > 0" :list="cates" :show.sync="cateShow" :did="cate.id" @confirm="selectedCateVal"></cpicker>
+			<w-picker
+				:visible.sync="startVisible"
+				mode="date" 
+				startYear="2021" 
+				endYear="5000"
+				themeColor="#FF7576"
+				:value="start"
+				:current="true"
+				fields="minute"
+				@confirm="onConfirm($event,'date')"
+				:disabled-after="false"
+				ref="date" 
+			></w-picker>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	import cpicker from "../../components/cpicker/cpicker.vue";
+	import wpicker from "../../components/w-picker/w-picker.vue";
+	export default {
+		components: {
+			cpicker,
+			wpicker
+		},
+		data() {
+			return {
+				flag: false,
+				start:'',
+				startVisible:false,
+				cate: {
+					id: 0,
+					title: '',
+					price: 0,
+				},
+				cateShow: false,
+				cates:[],
+				remark: '',
+				price: '',
+				unames: '',
+				workers: [],
+				orderId: 0
+			}
+		},
+		onLoad(option) {
+			this.orderId = option.orderId;
+			console.log(option);
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'cate'){
+					that.cates = res.data.data;
+				} else if(apiname == 'order'){
+					uni.navigateBack({
+					    delta: 1
+					});
+				}
+			}
+			
+			this.getCate();
+		},
+		methods: {
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+			selectCate(){
+				this.cateShow = true;
+			},
+			selectedCateVal(obj){
+				console.log(obj)
+				this.cate = obj;
+				this.price = obj.price;
+			},
+			getCate(){
+				app.ajaxUnlogin({
+					url: app.globalData.serverUrl + 'cate/cateList',
+					type: 'POST',
+					apiname: 'cate',
+				});
+			},
+			onConfirm(e,type){
+				this.start = e.result;
+			},
+			selectStart(){
+				this.startVisible = true;
+			},
+			
+			goSelectWorker(){
+				var that = this;
+				uni.navigateTo({
+					url: '/pages/order/worker',
+					events: {
+						// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
+						acceptDataFromOpenedPage: function(data) {
+							console.log('jieshou:',data)
+							that.workers = data;
+							let names = [];
+							that.workers.forEach((item,index) => {
+								if(index < 2){
+									names.push(item.name)
+								}
+							});
+							if(that.workers.length > 2){
+								that.unames = names.join(',') + '...';
+							}else{
+								that.unames = names.join(',');
+							}
+						}
+					},
+					success: function(res) {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit('acceptDataFromOpenerPage', { workers: that.workers })
+					}
+				})
+			},
+			
+			saveBtn(){
+				if(!this.start){
+					uni.showToast({
+						title: '请选择服务开始时间',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.cate.id){
+					uni.showToast({
+						title: '请选择服务',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				if(!this.cate.price){
+					uni.showToast({
+						title: '请输入价格',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				let uids = [];
+				this.workers.forEach((item) => {
+					uids.push(item.id);
+				})
+				if(uids.length <= 0){
+					uni.showToast({
+						title: '请选择护工',
+						icon: 'none',
+						duration: 2000
+					})
+					return;
+				}
+				let param = {
+					id: this.orderId,
+					start: this.start,
+					remark: this.remark,
+					cate_id: this.cate.id,
+					price: this.price,
+					uids: uids.join(',')
+				}
+				
+				app.ajax({
+					url: app.globalData.serverUrl + 'order/send',
+					type: 'POST',
+					apiname: 'order',
+					data: param
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.navbg{
+	    width: 100%;
+	    height: 300rpx;
+	}
+	.book-main{
+	    width: 710rpx;
+	    // position: absolute;
+	    // z-index: 10;
+	    // top: 300rpx;
+	    // left: 0;
+	    // bottom: 0;
+	    overflow: auto;
+	}
+	
+	
+	.book-btn{
+	    width: 710rpx;
+	    height: 90rpx;
+	    line-height: 90rpx;
+	    background-color: var(--themeColor);
+	    color: #ffffff;
+	    font-size: 34rpx;
+	    font-weight: bold;
+	    text-align: center;
+	    border-radius: 10rpx;
+	}
+</style>

+ 163 - 0
pages/order/worker.vue

@@ -0,0 +1,163 @@
+<template>
+	<view>
+		<view class="container" style="margin-bottom: 100rpx;">
+			<template v-for="(item,index) in list">
+				<view v-if="wids.includes(item.id)" :key="index" class="worker-box1 cur" @click="selectWorker(item)">
+					<image class="worker-box-img" :src="item.img" mode="aspectFit"></image>
+					<view class="worker-box-name">{{item.name}}</view>
+					<view v-if="item.count > 0" class="worker-box-desc">当前有{{item.count}}单</view>
+					<view v-if="item.count == 0" class="worker-box-desc">当前空闲</view>
+					<image class="worker-box-cur" src="../../images/select-worker.png" mode="aspectFit"></image>
+				</view>
+				<view v-if="!wids.includes(item.id)" class="worker-box1" @click="selectWorker(item)">
+					<image class="worker-box-img" :src="item.img" mode="aspectFit"></image>
+					<view class="worker-box-name">{{item.name}}</view>
+					<view v-if="item.count > 0" class="worker-box-desc">当前有{{item.count}}单</view>
+					<view v-if="item.count == 0" class="worker-box-desc">当前空闲</view>
+					<image class="worker-box-cur" src="../../images/select-worker.png" mode="aspectFit"></image>
+				</view>
+			</template>
+			
+		</view>
+		<view class="confirmBtn" @click="confirmBtn">确认选择</view>
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				list: [],
+				workers: [],
+				wids: []
+			}
+		},
+		onLoad() {
+			var that = this;
+			const eventChannel = this.getOpenerEventChannel()
+			// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
+			eventChannel.on('acceptDataFromOpenerPage', function(data) {
+				that.workers = data.workers;
+				that.wids = [];
+				that.workers.forEach((item) => {
+					that.wids.push(item.id);
+				});
+			})
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				console.log(res);
+				if(apiname == 'worker'){
+					that.list = res.data.data;
+				}
+			}
+			
+			this.getWorkerAll();
+		},
+		methods: {
+			selectWorker(obj){
+				if(this.wids.includes(obj.id)){ // 去除
+					this.wids = this.wids.filter((item) => {
+						return item != obj.id;
+					});
+					this.workers = this.workers.filter((item) => {
+						return item.id != obj.id;
+					})
+				}else{ // 添加
+					this.wids.push(obj.id);
+					this.workers.push(obj);
+				}
+			},
+			
+			confirmBtn(){
+				const eventChannel = this.getOpenerEventChannel()
+				eventChannel.emit('acceptDataFromOpenedPage', this.workers);
+				uni.navigateBack({
+				    delta: 1
+				});
+			},
+			
+			getWorkerAll(){
+				if(this.flag == 1){
+					return;
+				}
+				app.ajax({
+					url: app.globalData.serverUrl + 'order/getWorkerAll',
+					type: 'POST',
+					apiname: 'worker',
+				});
+			},
+			getUrlCode (name) {
+				return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.confirmBtn{
+		position: fixed;
+		z-index: 99;
+		bottom: 0;
+		left: 0;
+		width: 100%;
+		height: 90rpx;
+		line-height: 90rpx;
+		text-align: center;
+		color: #FFFFFF;
+		background-color: var(--themeColor);
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+	.worker-box1{
+		position: relative;
+		width: 218rpx;
+		height: 280rpx;
+		margin-right: 15rpx;
+		background-color: #FFFFFF;
+		border-radius: 10rpx;
+		text-align: center;
+		border: 2rpx solid #FFFFFF;
+		float: left;
+		margin-bottom: 15rpx;
+	}
+	.worker-box1.cur{
+		border: 2rpx solid #FF7576;
+	}
+	.worker-box1 .worker-box-cur{
+		display: none;
+		position: absolute;
+		width: 66rpx;
+		height: 68rpx;
+		z-index: 100;
+		top: -1rpx;
+		right: -1rpx;
+	}
+	.worker-box1.cur .worker-box-cur{
+		display: block;
+	}
+	.worker-box1 .worker-box-img{
+		width: 130rpx;
+		height: 130rpx;
+		border-radius: 50%;
+		margin-top: 25rpx;
+		margin-bottom: 10rpx;
+	}
+	.worker-box1 .worker-box-name{
+		width: 100%;
+		height: auto;
+		font-size: 30rpx;
+		font-weight: bold;
+		color: #333333;
+	}
+	.worker-box1 .worker-box-desc{
+		width: 100%;
+		height: auto;
+		font-size: 28rpx;
+		color: #808080;
+	}
+	
+</style>

+ 153 - 0
pages/user/index.vue

@@ -0,0 +1,153 @@
+<template>
+	<view>
+		<view class="user-bg">
+			<!--<image src="../../images/userbg.png"></image>-->
+		</view>
+		
+		<view class="user-top">
+			<view class="user-info">
+				<view class="user-info-avatar">
+					<image v-if="img" :src="img"></image>
+					<image v-if="!img" src="../../images/avatar.png"></image>
+				</view>
+				<view class="user-info-nick">{{nickName}}</view>
+			</view>
+			
+			<view class="menu-box">
+
+				<view class="menu-box-list" @click="goOrder">
+					<text class="menu-box-list-text">我的订单</text>
+					<image class="menu-box-list-right" src="../../images/jiantouyou.png"></image>
+				</view>
+				<view class="menu-box-list" @click="goIndex">
+					<text class="menu-box-list-text">去下单</text>
+					<image class="menu-box-list-right" src="../../images/jiantouyou.png"></image>
+				</view>
+			</view>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	var app = getApp();
+	export default {
+		data() {
+			return {
+				nickName: '',
+				img: '',
+				imgLoad: true
+			}
+		},
+		onLoad() {
+		},
+		onShow() {
+			var that = this;
+			app.ajaxReadyCallback = res => {  //各个接口统一回调方法
+                that.nickName = res.data.data.nickname;
+                that.img = res.data.data.img;
+			}
+            this.getUserInfo();
+
+        },
+		methods: {
+			goAddress(){
+				uni.navigateTo({
+				    url: '/pages/address/index'
+				});
+			},
+			goOrder(){
+				uni.navigateTo({
+				    url: '/pages/order/index'
+				});
+			},
+			goIndex(){
+				uni.switchTab({
+				    url: '/pages/index/index'
+				});
+			},
+			getUserInfo(){
+				app.ajax({
+					url: app.globalData.serverUrl + 'Worker/userInfo',
+					type: 'POST',
+					apiname: 'user'
+				});
+			},
+			onErrorImg(item){
+				this.imgLoad = false;
+				this.$forceUpdate();
+			},
+			onSuccessImg(item){
+				this.imgLoad = true;
+				this.$forceUpdate();
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.user-bg{
+		position: absolute;
+		width: 750rpx;
+		height: 475rpx;
+		top: 0;
+		left: 0;
+		z-index: 1;
+		background-color: var(--themeColor);
+	}
+	.user-bg image{
+		width: 100%;
+		height: 100%;
+	}
+	.user-top{
+		position: absolute;
+		width: 100%;
+		height: 100%;
+		top: 0;
+		left: 0;
+		z-index: 2;
+	}
+	.user-info{
+		overflow: hidden;
+		padding-top: 160rpx;
+		padding-bottom: 40rpx;
+		text-align: center;
+		color: #FFFFFF;
+	}
+	.user-info-avatar{
+		overflow: hidden;
+	}
+	.user-info-avatar image{
+		width: 128rpx;
+		height: 128rpx;
+		// border: 4rpx solid #FFFFFF;
+		border-radius: 66rpx;
+	}
+	.menu-box{
+		width: 687rpx;
+		height: auto;
+		border-radius: 10rpx;
+		background-color: #FFFFFF;
+		margin: 0 auto;
+		padding: 0 15rpx;
+	}
+	.menu-box .menu-box-list{
+		height: 108rpx;
+		line-height: 108rpx;
+		border-bottom: 1px solid #CCCCCC;
+	}
+	.menu-box .menu-box-list .menu-box-list-text{
+		display: inline-block;
+		width: 660rpx;
+		vertical-align: middle;
+	}
+	.menu-box .menu-box-list .menu-box-list-right{
+		width: 12rpx;
+		height: 22rpx;
+		vertical-align: middle;
+	}
+	.menu-box .menu-box-list:last-child{
+		border: 0;
+	}
+	
+</style>

BIN=BIN
static/home1.png


BIN=BIN
static/home2.png


BIN=BIN
static/logo.png


BIN=BIN
static/user1.png


BIN=BIN
static/user2.png


+ 79 - 0
uni.scss

@@ -0,0 +1,79 @@
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+
+/* 颜色变量 */
+
+/* 行为相关颜色 */
+$uni-color-primary: #007aff;
+$uni-color-success: #4cd964;
+$uni-color-warning: #f0ad4e;
+$uni-color-error: #dd524d;
+
+/* 文字基本颜色 */
+$uni-text-color:#333;//基本色
+$uni-text-color-inverse:#fff;//反色
+$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
+$uni-text-color-placeholder: #808080;
+$uni-text-color-disable:#c0c0c0;
+
+/* 背景颜色 */
+$uni-bg-color:#ffffff;
+$uni-bg-color-grey:#f8f8f8;
+$uni-bg-color-hover:#f1f1f1;//点击状态颜色
+$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
+
+/* 边框颜色 */
+$uni-border-color:#c8c7cc;
+
+/* 尺寸变量 */
+
+/* 文字尺寸 */
+$uni-font-size-sm:24rpx;
+$uni-font-size-base:28rpx;
+$uni-font-size-lg:32rpx;
+
+/* 图片尺寸 */
+$uni-img-size-sm:40rpx;
+$uni-img-size-base:52rpx;
+$uni-img-size-lg:80rpx;
+
+/* Border Radius */
+$uni-border-radius-sm: 4rpx;
+$uni-border-radius-base: 6rpx;
+$uni-border-radius-lg: 12rpx;
+$uni-border-radius-circle: 50%;
+
+/* 水平间距 */
+$uni-spacing-row-sm: 10px;
+$uni-spacing-row-base: 20rpx;
+$uni-spacing-row-lg: 30rpx;
+
+/* 垂直间距 */
+$uni-spacing-col-sm: 8rpx;
+$uni-spacing-col-base: 16rpx;
+$uni-spacing-col-lg: 24rpx;
+
+/* 透明度 */
+$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
+
+/* 文章场景相关 */
+$uni-color-title: #2C405A; // 文章标题颜色
+$uni-font-size-title:40rpx;
+$uni-color-subtitle: #555555; // 二级标题颜色
+$uni-font-size-subtitle:36rpx;
+$uni-color-paragraph: #3F536E; // 文章段落颜色
+$uni-font-size-paragraph:30rpx;
+
+
+$theme-color: #004db5; // 主题色