Browse Source

初始化

Joe 4 years ago
commit
ff7a77abc3
100 changed files with 12156 additions and 0 deletions
  1. 11 0
      .hbuilderx/launch.json
  2. 17 0
      App.vue
  3. 39 0
      README.md
  4. BIN
      components/.DS_Store
  5. BIN
      components/sn-swiper/.DS_Store
  6. 251 0
      components/sn-swiper/esc-swiper-item/index.vue
  7. 21 0
      components/sn-swiper/esc-swiper/helper.js
  8. 198 0
      components/sn-swiper/esc-swiper/index.vue
  9. 303 0
      components/sn-swiper/esc-swiper/mixins/base.mixin.js
  10. 91 0
      components/sn-swiper/esc-swiper/mixins/bindingx.js
  11. 143 0
      components/sn-swiper/esc-swiper/mixins/index.wxs
  12. 62 0
      components/sn-swiper/esc-swiper/mixins/mpother.js
  13. 7 0
      components/sn-swiper/esc-swiper/mixins/mpwxs.js
  14. 15 0
      components/utils/style.js
  15. 31 0
      main.js
  16. 84 0
      manifest.json
  17. 50 0
      pages.json
  18. 224 0
      pages/authen/identity.vue
  19. 202 0
      pages/authen/login.vue
  20. 1017 0
      pages/confirm/confirm.vue
  21. 603 0
      pages/index/index.vue
  22. 92 0
      pages/succeed/succeed.vue
  23. 58 0
      pages/test/test.vue
  24. 38 0
      settings.js
  25. BIN
      static/icon/6_d05_close.2x.png
  26. BIN
      static/icon/a01-zhuyi.2x.png
  27. BIN
      static/icon/cg.2x.png
  28. BIN
      static/icon/dingdan.2x.png
  29. BIN
      static/icon/forbid.png
  30. BIN
      static/icon/huiyuan-.2x.png
  31. BIN
      static/icon/left.png
  32. BIN
      static/icon/login.png
  33. BIN
      static/icon/right.png
  34. BIN
      static/icon/select.png
  35. BIN
      static/icon/selected.png
  36. BIN
      static/icon/sheng.2x.png
  37. BIN
      static/icon/tipicon1.png
  38. BIN
      static/icon/youhuiquan-2.2x.png
  39. BIN
      static/icon/youhuiquan1.2x.png
  40. BIN
      static/icon/youhuiquan2.2x.png
  41. BIN
      static/icon/youhuiquan3.2x.png
  42. BIN
      static/logo.png
  43. 66 0
      store/index.js
  44. 14 0
      store/modules/moduleA.js
  45. 27 0
      store/modules/moduleB.js
  46. 76 0
      uni.scss
  47. 2 0
      uni_modules/uni-badge/changelog.md
  48. 156 0
      uni_modules/uni-badge/components/uni-badge/uni-badge.vue
  49. 83 0
      uni_modules/uni-badge/package.json
  50. 43 0
      uni_modules/uni-badge/readme.md
  51. 2 0
      uni_modules/uni-calendar/changelog.md
  52. 546 0
      uni_modules/uni-calendar/components/uni-calendar/calendar.js
  53. 170 0
      uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue
  54. 505 0
      uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue
  55. 352 0
      uni_modules/uni-calendar/components/uni-calendar/util.js
  56. 81 0
      uni_modules/uni-calendar/package.json
  57. 96 0
      uni_modules/uni-calendar/readme.md
  58. 2 0
      uni_modules/uni-card/changelog.md
  59. 406 0
      uni_modules/uni-card/components/uni-card/uni-card.vue
  60. 81 0
      uni_modules/uni-card/package.json
  61. 97 0
      uni_modules/uni-card/readme.md
  62. 4 0
      uni_modules/uni-collapse/changelog.md
  63. 220 0
      uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue
  64. 59 0
      uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue
  65. 84 0
      uni_modules/uni-collapse/package.json
  66. 107 0
      uni_modules/uni-collapse/readme.md
  67. 4 0
      uni_modules/uni-combox/changelog.md
  68. 210 0
      uni_modules/uni-combox/components/uni-combox/uni-combox.vue
  69. 82 0
      uni_modules/uni-combox/package.json
  70. 46 0
      uni_modules/uni-combox/readme.md
  71. 2 0
      uni_modules/uni-countdown/changelog.md
  72. 211 0
      uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue
  73. 81 0
      uni_modules/uni-countdown/package.json
  74. 50 0
      uni_modules/uni-countdown/readme.md
  75. 8 0
      uni_modules/uni-data-checkbox/changelog.md
  76. 785 0
      uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
  77. 81 0
      uni_modules/uni-data-checkbox/package.json
  78. 291 0
      uni_modules/uni-data-checkbox/readme.md
  79. 8 0
      uni_modules/uni-data-picker/changelog.md
  80. 12 0
      uni_modules/uni-data-picker/components/uni-data-picker/config.json
  81. 45 0
      uni_modules/uni-data-picker/components/uni-data-picker/keypress.js
  82. 462 0
      uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
  83. 468 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
  84. 289 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
  85. 86 0
      uni_modules/uni-data-picker/package.json
  86. 253 0
      uni_modules/uni-data-picker/readme.md
  87. 3 0
      uni_modules/uni-dateformat/changelog.md
  88. 191 0
      uni_modules/uni-dateformat/components/uni-dateformat/date-format.js
  89. 90 0
      uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue
  90. 83 0
      uni_modules/uni-dateformat/package.json
  91. 71 0
      uni_modules/uni-dateformat/readme.md
  92. 6 0
      uni_modules/uni-datetime-picker/changelog.md
  93. 45 0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/keypress.js
  94. 903 0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
  95. 82 0
      uni_modules/uni-datetime-picker/package.json
  96. 61 0
      uni_modules/uni-datetime-picker/readme.md
  97. 2 0
      uni_modules/uni-drawer/changelog.md
  98. 45 0
      uni_modules/uni-drawer/components/uni-drawer/keypress.js
  99. 181 0
      uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue
  100. 83 0
      uni_modules/uni-drawer/package.json

+ 11 - 0
.hbuilderx/launch.json

@@ -0,0 +1,11 @@
+{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
+  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
+    "version": "0.0",
+    "configurations": [{
+            "type": "uniCloud",
+            "default": {
+                "launchtype": "remote"
+            }
+        }
+    ]
+}

+ 17 - 0
App.vue

@@ -0,0 +1,17 @@
+<script>
+  export default {
+    onLaunch: function() {
+      console.log('App Launch')
+    },
+    onShow: function() {
+      console.log('App Show')
+    },
+    onHide: function() {
+      console.log('App Hide')
+    }
+  }
+</script>
+
+<style>
+  /*每个页面公共css */
+</style>

+ 39 - 0
README.md

@@ -0,0 +1,39 @@
+# 小程序
+
+#### 介绍
+{**以下是 Gitee 平台说明,您可以替换此简介**
+Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
+无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
+
+#### 软件架构
+软件架构说明
+
+
+#### 安装教程
+
+1.  xxxx
+2.  xxxx
+3.  xxxx
+
+#### 使用说明
+
+1.  xxxx
+2.  xxxx
+3.  xxxx
+
+#### 参与贡献
+
+1.  Fork 本仓库
+2.  新建 Feat_xxx 分支
+3.  提交代码
+4.  新建 Pull Request
+
+
+#### 特技
+
+1.  使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
+2.  Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
+3.  你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
+4.  [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
+5.  Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
+6.  Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

BIN
components/.DS_Store


BIN
components/sn-swiper/.DS_Store


+ 251 - 0
components/sn-swiper/esc-swiper-item/index.vue

@@ -0,0 +1,251 @@
+<template>
+	<view class="swiper-item" ref="swiper_item" :style="itemStyle">
+		<view class="item-cntent" bubble="true" @click.stop="onClick"><slot></slot></view>
+	</view>
+</template>
+
+<script>
+import { getStyleStr } from '../../utils/style.js';
+// #ifdef APP-NVUE
+const animation = uni.requireNativePlugin('animation');
+// #endif
+/**
+ * esc-swiper-item
+ * @description esc-swiper-item (不支持使用class)
+ * @property {Number} index 索引(必填)
+ * @property {Boolean} clickAny 可以点击任意项
+ * @event {Function} click 点击事件
+ */
+export default {
+	name: 'esc-swiper-item',
+	inject: ['config'],
+	props: {
+		index: {
+			type: Number,
+			default: 0
+		},
+		clickAny: {
+			type: Boolean,
+			default: false
+		}
+	},
+	data() {
+		return {
+			isAnimated: false,
+			timingFunction: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
+			duration: 0,
+			current: 0,
+			position: 0,
+			mScale: 0,
+			canClick: true
+		};
+	},
+	created() {},
+	computed: {
+		size() {
+			return this.config.size;
+		},
+		width() {
+			return this.config.width;
+		},
+		height() {
+			return this.config.height;
+		},
+		itemWidth() {
+			return this.config.itemWidth;
+		},
+		itemHeight() {
+			return this.config.itemHeight;
+		},
+		space() {
+			return this.config.space;
+		},
+		itemStyle() {
+			if (this.index == this.size - 1) {
+				return this.rightSpaceStyle();
+			} else if (this.index == this.size - 2) {
+				return this.centerSpaceStyle();
+			} else {
+				return this.leftSpaceStyle();
+			}
+		},
+		scale() {
+			if (!this.config.is3D) {
+				return 1;
+			}
+			if (this.myCurrent == this.current) {
+				return this.mScale || this.config.scale;
+			} else {
+				return this.mScale || 1;
+			}
+		},
+		// 当前swiper-item所属current索引
+		myCurrent() {
+			if (!this.config.isCircular) {
+				return this.index;
+			}
+			const p = this.index;
+			const plus = this.config.plus;
+			const actSize = this.size - plus * 2;
+			let current = 0;
+			if (p < plus) {
+				current = p + (actSize - plus);
+			} else if (p >= this.size - plus) {
+				current = p - (actSize + plus);
+			} else {
+				current = p - plus;
+			}
+			return current;
+		}
+	},
+	methods: {
+		itemSize() {
+			let style = {
+				width: this.itemWidth + 'rpx',
+				height: (this.itemHeight || this.height) + 'rpx'
+			};
+
+			if (this.config.is3D) {
+				// #ifndef APP-NVUE
+				if (this.isAnimated) {
+					style.transition = 'transform ' + this.duration + 'ms ' + this.timingFunction;
+				} else {
+					style.transition = '';
+				}
+				style.transform = 'scale(' + this.scale + ')';
+				// #endif
+				// #ifdef APP-NVUE
+				const isIOS = uni.getSystemInfoSync().platform == 'ios';
+				if (isIOS) {
+					style.transform = 'scale(' + this.scale + ')';
+				} else {
+					if (!this.isAnimated) style.transform = 'scale(' + this.scale + ')';
+				}
+				// #endif
+			}
+
+			return style;
+		},
+		leftSpaceStyle() {
+			return getStyleStr({
+				...this.itemSize(),
+				marginLeft: this.space + 'rpx'
+			});
+		},
+		centerSpaceStyle() {
+			return getStyleStr({
+				...this.itemSize(),
+				marginLeft: this.space + 'rpx',
+				marginRight: this.space + 'rpx'
+			});
+		},
+		rightSpaceStyle() {
+			return getStyleStr({
+				...this.itemSize(),
+				marginRight: this.space + 'rpx'
+			});
+		},
+		onClick(e) {
+			if (!this.canClick) {
+				return;
+			}
+			// #ifdef APP-NVUE
+			e.stopPropagation();
+			// #endif
+			// 点击任意项
+			if (this.clickAny) {
+				this.$emit('click', e);
+				return;
+			}
+			// 只能点击当前项
+			if (this.myCurrent == this.current) {
+				this.$emit('click', e);
+			}
+		},
+		restoreScale(duration) {
+			if (!this.config.is3D) {
+				return;
+			}
+			// #ifndef APP-NVUE
+			this.duration = duration;
+			this.isAnimated = true;
+			this.mScale = 0;
+			setTimeout(() => {
+				this.duration = 0;
+				this.isAnimated = false;
+			}, duration);
+			// #endif
+			// #ifdef APP-NVUE
+			this.isAnimated = true;
+			this.mScale = 0;
+			animation.transition(
+				this.$refs['swiper_item'].ref,
+				{
+					styles: {
+						transform: 'scale(' + this.scale + ')'
+					},
+					duration, //ms
+					timingFunction: this.timingFunction,
+					needLayout: false,
+					delay: 0 //ms
+				},
+				() => {
+					this.isAnimated = false;
+				}
+			);
+			// #endif
+		},
+		restoreToScale(scale, duration) {
+			if (!this.config.is3D) {
+				return;
+			}
+			// #ifndef APP-NVUE
+			this.duration = duration;
+			this.isAnimated = true;
+			this.mScale = scale;
+			setTimeout(() => {
+				this.duration = 0;
+				this.isAnimated = false;
+				this.mScale = 0;
+			}, duration);
+			// #endif
+			// #ifdef APP-NVUE
+			this.isAnimated = true;
+			animation.transition(
+				this.$refs['swiper_item'].ref,
+				{
+					styles: {
+						transform: 'scale(' + scale + ')'
+					},
+					duration, //ms
+					timingFunction: this.timingFunction,
+					needLayout: false,
+					delay: 0 //ms
+				},
+				() => {
+					this.isAnimated = false;
+					this.mScale = 0;
+				}
+			);
+			// #endif
+		}
+	}
+};
+</script>
+
+<style scoped>
+.swiper-item {
+	position: relative;
+}
+
+.item-cntent {
+	position: absolute;
+	top: 0;
+	right: 0;
+	bottom: 0;
+	left: 0;
+	/* #ifndef APP-NVUE */
+	display: flex;
+	/* #endif */
+}
+</style>

+ 21 - 0
components/sn-swiper/esc-swiper/helper.js

@@ -0,0 +1,21 @@
+/**
+ * getSwiperList
+ * @description 获取Swiper数据
+ * @param {Array} list 原数据
+ * @param {Object} options 配置
+ * @param {Boolean} options.circular 是否循环
+ * @param {Number} options.plus 左右追加个数(开启循环必填,至少为2)
+ * @return {Array}
+ */
+export function getSwiperList(list, options = {
+	circular: true,
+	plus: 3
+}) {
+	if (!options.circular) {
+		return list
+	}
+	const plus = options.plus || 2
+	const leftPlusList = [...list].reverse().slice(0, plus).reverse();
+	const rightPlusList = [...list].slice(0, plus);
+	return [].concat(leftPlusList).concat(list).concat(rightPlusList);
+}

+ 198 - 0
components/sn-swiper/esc-swiper/index.vue

@@ -0,0 +1,198 @@
+<template>
+	<!-- #ifdef APP-VUE || H5 -->
+	<view class="box" :style="boxStyle">
+		<view
+			ref="container"
+			class="container"
+			:change:prop="swipe.changeData"
+			:prop="wxsData"
+			@touchstart.stop="swipe.touchstart"
+			@touchmove.stop="swipe.touchmove"
+			@touchend.stop="swipe.touchend"
+			:style="containerStyle"
+		>
+			<slot></slot>
+		</view>
+	</view>
+	<!-- #endif -->
+	<!-- #ifdef MP-WEIXIN -->
+	<view class="box" :style="boxStyle">
+		<view
+			ref="container"
+			class="container"
+			:change:prop="swipe.changeData"
+			:prop="wxsData"
+			@touchstart="swipe.touchstart"
+			@touchmove="swipe.touchmove"
+			@touchend="swipe.touchend"
+			:style="containerStyle"
+		>
+			<slot></slot>
+		</view>
+	</view>
+	<!-- #endif -->
+	<!-- #ifdef APP-NVUE -->
+	<view class="box" :style="boxStyle">
+		<view ref="container" class="container" @horizontalpan="touchstart" :style="containerStyle"><slot></slot></view>
+	</view>
+	<!-- #endif -->
+	<!-- 其他平台使用 js ,长列表性能可能会有影响-->
+	<!-- #ifndef APP-PLUS || MP-WEIXIN || H5 -->
+	<view class="box" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend" :style="boxStyle">
+		<view ref="container" class="container" :style="containerStyle"><slot></slot></view>
+	</view>
+	<!-- #endif -->
+</template>
+<script src="./mixins/index.wxs" module="swipe" lang="wxs"></script>
+<script>
+import SwiperMixin from './mixins/base.mixin.js';
+// #ifdef APP-VUE || MP-WEIXIN || H5
+import MpMixin from './mixins/mpwxs.js';
+// #endif
+// #ifdef APP-NVUE
+import BindingxMixin from './mixins/bindingx.js';
+// #endif
+// #ifndef APP-PLUS || MP-WEIXIN || H5
+import OtherMixin from './mixins/mpother.js';
+// #endif
+
+const mixins = [
+	// #ifdef APP-VUE || MP-WEIXIN || H5
+	MpMixin,
+	// #endif
+	// #ifdef APP-NVUE
+	BindingxMixin,
+	// #endif
+	// #ifndef APP-PLUS || MP-WEIXIN || H5
+	OtherMixin,
+	// #endif
+	SwiperMixin
+];
+
+/**
+ * esc-swiper
+ * @description 自定义swiper (不支持使用class)
+ * @property {String} mode = [normal|3d]  模式
+ * @property {Number} scale 3D模式选中项的scale
+ * @property {Number} width 宽
+ * @property {Number} height 高
+ * @property {Number} itemWidth 项宽
+ * @property {Number} itemHeight 项高
+ * @property {Number} space 间距
+ * @property {Number} plus 左右追加个数(开启循环必填,至少为2)
+ * @property {Number} current 选中项索引
+ * @property {Boolean} autoplay 自动轮播
+ * @property {Boolean} circular 是否循环,如果开启,至少需要3项
+ * @property {Boolean} bounce 阻尼效果 
+ * @event {Function} change 索引变化
+ */
+export default {
+	name: 'esc-swiper',
+	mixins,
+	props: {
+		mode: {
+			type: String,
+			default: 'normal'
+		},
+		scale: Number,
+		width: Number,
+		height: Number,
+		itemWidth: {
+			type: Number,
+			default: 0
+		},
+		itemHeight: {
+			type: Number,
+			default: 0
+		},
+		space: {
+			type: Number,
+			default: 0
+		},
+		plus: {
+			type: Number,
+			default: 0
+		},
+		autoplay: {
+			type: Boolean,
+			default: false
+		},
+		current: {
+			type: Number,
+			default: 0
+		},
+		interval: {
+			type: Number,
+			default: 5000
+		},
+		duration: {
+			type: Number,
+			default: 500
+		},
+		circular: {
+			type: Boolean,
+			default: false
+		},
+		bounce: {
+			type: Boolean,
+			default: true
+		},
+		size: {
+			type: Number,
+			default: 0
+		}
+	},
+	provide() {
+		return {
+			config: {
+				is3D: this.is3D,
+				isCircular: this.circular,
+				scale: this.scale,
+				size: this._size,
+				width: this.width,
+				height: this.height,
+				itemWidth: this.itemWidth,
+				itemHeight: this.itemHeight,
+				space: this.space,
+				plus: this.plus
+			}
+		};
+	},
+	mounted() {
+		if (this.autoplay) {
+			this.autoplayInterval = setInterval(() => {
+				this.next();
+			}, this.interval);
+		}
+	},
+	watch: {
+		autoplay(newV) {
+			if (!newV) {
+				clearInterval(this.autoplayInterval);
+			} else {
+				this.autoplayInterval = setInterval(() => {
+					this.next();
+				}, this.interval);
+			}
+		}
+	},
+	methods: {}
+};
+</script>
+
+<style scoped>
+.box {
+	position: relative;
+	overflow: hidden;
+}
+
+.container {
+	position: absolute;
+	top: 0;
+	/* #ifndef APP-NVUE */
+	display: flex;
+	/* #endif */
+	flex-direction: row;
+	align-items: center;
+}
+</style>

+ 303 - 0
components/sn-swiper/esc-swiper/mixins/base.mixin.js

@@ -0,0 +1,303 @@
+import {
+	getStyleStr
+} from '../../../utils/style.js';
+// #ifdef APP-NVUE
+const animation = uni.requireNativePlugin('animation')
+// #endif
+export default {
+	data() {
+		return {
+			timingFunction: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
+			isAnimated: false,
+			isScrolling: false,
+			customDuration: 0,
+			left: 0,
+			mCurrent: this.current
+		};
+	},
+	created() {},
+	mounted() {
+		// #ifdef MP
+		this.swiperViews = this.$children
+		// #endif
+		// #ifdef APP-PLUS || H5
+		this.swiperViews = this.$slots.default.map(it => it.child)
+		// #endif
+		this._setLeft();
+		this.mCurrent = this.current
+		this._notifyCurrentForItems(this.current, this.position)
+	},
+	watch: {
+		mCurrent() {
+			let current = this.mCurrent
+			if (this.circular) {
+				if (this.position == 1) {
+					current = this.actualSize - (this.plus - 1)
+					// console.log('最前了', current)
+				} else if (this.position == this._size - 2) {
+					current = this.plus - 2;
+					// console.log('最后了', current)
+				}
+				if (current < 0) {
+					current = this.position + 1
+				}
+				current %= this.actualSize
+			}
+			// console.log('position', this.position, current)
+			this.$emit('update:current', current)
+			this.$emit('change', current)
+			this._notifyCurrentForItems(current, this.position)
+		}
+	},
+	computed: {
+		is3D() {
+			return this.mode == '3d'
+		},
+		position() {
+			return this.circular ? (this.mCurrent + this.plus) : this.mCurrent
+		},
+		manualDuration() {
+			if (this.customDuration > 0)
+				return this.customDuration
+			return this.isAnimated ? this.duration : 0
+		},
+		boxStyle() {
+			return getStyleStr({
+				width: this.width + 'rpx',
+				height: this.height + 'rpx'
+			});
+		},
+		containerStyle() {
+			const style = {
+				height: this.height + 'rpx'
+			};
+			// #ifdef APP-NVUE
+			// FIXME: 理论isAnimated=false应该不设置transform,但是ios有个奇怪的问题,top不为0导致布局错位
+			const isIOS = uni.getSystemInfoSync().platform == 'ios'
+			if (isIOS) {
+				style.transform = 'translate(' + uni.upx2px(this.left) + 'px' + ',0px)'
+			} else {
+				if (this.isAnimated == false) {
+					style.transform = 'translate(' + uni.upx2px(this.left) + 'px' + ',0px)'
+				}
+			}
+			// #endif
+			// #ifndef APP-NVUE
+			style.left = this.left + 'rpx'
+			style.transition = 'left ' + this.manualDuration + 'ms ' + this.timingFunction
+			// #endif
+			return getStyleStr(style);
+		},
+		_size() {
+			return (this.$slots && this.$slots.default && this.$slots.default.length) || this.size;
+		},
+		// plus * 2
+		plusSize() {
+			return this.circular ? this.plus * 2 : 0;
+		},
+		// 真实长度
+		actualSize() {
+			return this._size - this.plusSize;
+		}
+	},
+	methods: {
+		prev() {
+			if (this.isAnimated) return;
+			if (this.isScrolling) return;
+			if (this.mCurrent == 0 && this.circular == false) return
+			this.mCurrent--;
+			this._run()
+		},
+		next() {
+			if (this.isAnimated) return;
+			if (this.isScrolling) return;
+			if (this.circular == true) {
+				this.mCurrent++;
+				if (this.mCurrent == this._size) {
+					this.mCurrent = 0;
+				}
+			} else {
+				if (this.mCurrent == this._size - 1) return
+				this.mCurrent++;
+			}
+			this._run()
+		},
+		moveTo(e) {
+			if (this.isAnimated) return
+			const {
+				deltaX,
+				left
+			} = e
+			this.isScrolling = true
+			if (!this.circular) {
+				if (
+					// 第一项,不能向右滑(上一项)
+					(deltaX > 0 && this.mCurrent == 0) ||
+					// 最后一项,不能向左滑(下一项)
+					(deltaX < 0 && this.mCurrent == this._size - 1)
+				) {
+					if (!this.bounce) return
+					// 添加阻尼滑动
+					const _left = this._left || this.wxsData.left
+					this.left = _left + (deltaX * (1 - Math.abs(deltaX) * 3 / (this.width * 5)))
+					this._set3DScale(deltaX)
+					return
+				}
+			}
+			this.left = left
+			this._set3DScale(deltaX)
+		},
+		moveEnd(e) {
+			const {
+				velocity,
+				deltaX,
+				deltaY
+			} = e
+			this.isScrolling = false
+
+			if (!this.circular) {
+				// 第一项,不能向右滑(上一项)
+				if (deltaX > 0 && this.mCurrent == 0) {
+					this._restoreStartTouch()
+					return
+				}
+				// 最后一项,不能向左滑(下一项)
+				if (deltaX < 0 && this.mCurrent == this._size - 1) {
+					this._restoreStartTouch()
+					return
+				}
+			}
+
+			const isTurnPage = Math.abs(deltaX) > this.itemWidth / 2
+			if (isTurnPage || velocity > 0.2) {
+				if (deltaX < 0) {
+					this.customDuration = 350
+					this.next()
+				} else if (deltaX > 0) {
+					this.customDuration = 350
+					this.prev()
+				}
+			} else {
+				this._restoreStartTouch()
+			}
+		},
+		_set3DScale(deltaX) {
+			if (this.is3D) {
+				const min = Math.min
+				const maxScale = Math.abs(this.scale - 1)
+				const mScale = deltaX * maxScale / this.width
+				const mRealScale = min(this.scale, this.scale - Math.abs(mScale))
+				this.swiperViews[this.position].mScale = mRealScale < 1 ? 1 : mRealScale
+				if (this.position - 1 > -1) {
+					this.swiperViews[this.position - 1].mScale = mScale > 0 ? min(this.scale, 1 + mScale) : min(1, 1 + mScale)
+				}
+				if (this.position + 1 < this._size) {
+					this.swiperViews[this.position + 1].mScale = mScale > 0 ? min(1, 1 - mScale) : min(this.scale, 1 - mScale)
+				}
+			}
+		},
+		_restoreStartTouch() {
+			const self = this
+			this.customDuration = 300
+			// #ifdef APP-VUE || MP-WEIXIN || H5
+			this.left = this.wxsData.left
+			// #endif
+			// #ifndef APP-PLUS || MP-WEIXIN || H5
+			this.left = this._left
+			// #endif
+			this._run(false)
+			if (this.is3D) {
+				this.swiperViews[this.position].restoreScale(this.manualDuration)
+				if (this.position - 1 > -1) {
+					this.swiperViews[this.position - 1].restoreScale(this.manualDuration)
+				}
+				if (this.position + 1 < this._size) {
+					this.swiperViews[this.position + 1].restoreScale(this.manualDuration)
+				}
+			}
+		},
+		_notifyCurrentForItems(current, position) {
+			this.swiperViews && this.swiperViews.forEach(it => {
+				it.current = current
+				it.position = position
+			})
+		},
+		_run(isSet = true) {
+			this.isAnimated = true;
+			if (isSet)
+				this._setLeft();
+			const self = this;
+			if (this.is3D) {
+				this.swiperViews[this.position].restoreToScale(this.scale, this.manualDuration)
+				if (this.position - 1 > -1) {
+					this.swiperViews[this.position - 1].restoreToScale(1, this.manualDuration)
+				}
+				if (this.position + 1 < this._size) {
+					this.swiperViews[this.position + 1].restoreToScale(1, this.manualDuration)
+				}
+			}
+			// #ifdef APP-NVUE
+			animation.transition(this.$refs.container, {
+				styles: {
+					transform: 'translate(' + uni.upx2px(this.left) + 'px' + ',0px)',
+				},
+				duration: this.manualDuration, //ms
+				timingFunction: this.timingFunction,
+				needLayout: false,
+				delay: 0 //ms
+			}, function() {
+				self._reset();
+			})
+			// #endif
+			// #ifndef APP-NVUE
+			setTimeout(() => {
+				this._reset();
+			}, this.manualDuration);
+			// #endif
+		},
+		_setLeft() {
+			if (this.circular == true) {
+				const s1 = (this.width - this.itemWidth - this.space * 2) / 2;
+				let left = (this.plus + this.mCurrent) * (this.space + this.itemWidth) - s1;
+				this.left = -left;
+			} else {
+				this.left = -(this.itemWidth + this.space) * this.mCurrent
+			}
+			// #ifdef APP-VUE || MP-WEIXIN || H5
+			this.wxsData = {
+				left: this.left,
+				bounce: this.bounce
+			}
+			// #endif
+		},
+		_reset() {
+			this.isScrolling = false
+			this.isAnimated = false
+			this.customDuration = 0
+			if (this.circular == true) {
+				if (this.position == 1) {
+					this.mCurrent = this.actualSize - (this.plus - 1);
+					this._setLeft();
+					this._restoreScale()
+				}
+				// -2:原数组索引-1 + plus数组索引-1
+				if (this.position == this._size - 2) {
+					this.mCurrent = this.plus - 2;
+					this._setLeft();
+					this._restoreScale()
+				}
+			}
+		},
+		_restoreScale() {
+			if (this.is3D) {
+				this.swiperViews[this.position].restoreToScale(this.scale, 0)
+				if (this.position - 1 > -1) {
+					this.swiperViews[this.position - 1].restoreToScale(1, 0)
+				}
+				if (this.position + 1 < this._size) {
+					this.swiperViews[this.position + 1].restoreToScale(1, 0)
+				}
+			}
+		}
+	}
+}

+ 91 - 0
components/sn-swiper/esc-swiper/mixins/bindingx.js

@@ -0,0 +1,91 @@
+const BindingX = uni.requireNativePlugin('bindingx');
+const animation = uni.requireNativePlugin('animation');
+export default {
+	mounted() {
+		this.container = this.getEl(this.$refs['container'])
+	},
+	methods: {
+		_notifyTouchChangeForItems(isTouchEnd) {
+			this.swiperViews && this.swiperViews.forEach(it => {
+				it.canClick = isTouchEnd
+			})
+		},
+		touchstart(e) {
+			if (this.isAnimated) return;
+			if (this.stop) return
+			this.isScrolling = true
+			this._notifyTouchChangeForItems(false)
+			this.stop = true
+			this.startTime = new Date().getTime()
+			const props = [{
+				element: this.container,
+				property: 'transform.translateX',
+				expression: uni.upx2px(this.left) + '+x'
+			}]
+			if (this.is3D) {
+				const deltaScale = `${this.scale}/${this.width}*x`
+				const currentScale = `${this.scale}-abs(x)/${this.width}*1`
+				const realScale = `min(${currentScale},${this.scale})`
+				const currentCardExp = `${realScale} < 1 ? 1 : ${realScale}`;
+				const leftCardExp = `${deltaScale} > 0 ? min(${this.scale},(1 + ${deltaScale})) : min(1,(1 + ${deltaScale}))`;
+				const rightCardExp = `${deltaScale} > 0 ? min(1,(1 - ${deltaScale})) : min(${this.scale},(1 - ${deltaScale}))`;
+				props.push({
+					element: this.getSwipteItemEl(this.position),
+					property: 'transform.scale',
+					expression: currentCardExp
+				})
+				if (this.position - 1 > -1) {
+					props.push({
+						element: this.getSwipteItemEl(this.position - 1),
+						property: 'transform.scale',
+						expression: leftCardExp
+					})
+				}
+				if (this.position + 1 > this._size) {
+					props.push({
+						element: this.getSwipteItemEl(this.position + 1),
+						property: 'transform.scale',
+						expression: rightCardExp
+					})
+				}
+			}
+			this.eventpan = BindingX.bind({
+				anchor: this.container,
+				eventType: 'pan',
+				props
+			}, (e) => {
+				if (e.state === 'end' ||
+					e.state === 'exit') {
+					setTimeout(() => {
+						this._notifyTouchChangeForItems(true)
+					}, 10)
+					const timing = new Date().getTime() - this.startTime
+					const velocity = Math.abs(e.deltaX / timing)
+					this.stop = false
+					this.isScrolling = false
+					if (this.eventpan && this.eventpan.token) {
+						BindingX.unbind({
+							token: this.eventpan.token,
+							eventType: 'pan'
+						})
+					}
+					this.moveEnd({
+						velocity,
+						deltaX: e.deltaX,
+						deltaY: e.deltaY
+					})
+				}
+			})
+		},
+		getSwipteItemEl(idx) {
+			return this.swiperViews[idx].$el.ref
+		},
+		/**
+		 * 获取ref
+		 * @param {Object} el
+		 */
+		getEl(el) {
+			return el.ref
+		}
+	}
+}

+ 143 - 0
components/sn-swiper/esc-swiper/mixins/index.wxs

@@ -0,0 +1,143 @@
+var MIN_DISTANCE = 10;
+
+function changeData(newValue, oldValue, ownerInstance, instance) {
+	var state = instance.getState();
+	if (newValue.left != undefined) {
+		state.left = newValue.left
+	}
+	if (newValue.bounce != undefined) {
+		state.bounce = newValue.bounce
+	}
+	// console.log('changeData', JSON.stringify(newValue))
+}
+
+/**
+ * 开始触摸操作
+ * @param {Object} e
+ * @param {Object} ins
+ */
+function touchstart(e, ins) {
+	var instance = e.instance;
+	// 计算滑动开始位置
+	stopTouchStart(e, ins)
+}
+
+/**
+ * 开始滑动操作
+ * @param {Object} e
+ * @param {Object} ownerInstance
+ */
+function touchmove(e, ownerInstance) {
+	var instance = e.instance;
+	// 是否可以滑动页面
+	stopTouchMove(e);
+	if (e.preventDefault) {
+		// 阻止页面滚动
+		e.preventDefault()
+	}
+	// var state = instance.getState();
+	 // && state.bounce
+	move(instance, ownerInstance)
+	return false
+}
+
+/**
+ * 结束触摸操作
+ * @param {Object} e
+ * @param {Object} ownerInstance
+ */
+function touchend(e, ownerInstance) {
+	var instance = e.instance;
+	var state = instance.getState()
+	ownerInstance.callMethod('moveEnd', {
+		velocity: Math.abs(state.deltaX / state.timing),
+		direction: state.direction,
+		deltaX: state.deltaX,
+		deltaY: state.deltaY
+	})
+}
+
+/**
+ * 设置移动距离
+ * @param {Object} instance
+ * @param {Object} ownerInstance
+ */
+function move(instance, ownerInstance) {
+	var state = instance.getState()
+	var value = state.deltaX || 0
+	var state = instance.getState()
+	if (state.direction == 'horizontal') {
+		// instance.requestAnimationFrame(function() {
+		// 	instance.setStyle({
+		// 		transform: 'translateX(' + value + 'px)',
+		// 		'-webkit-transform': 'translateX(' + value + 'px)'
+		// 	})
+		// })
+		ownerInstance.callMethod('moveTo', {
+			deltaX: value,
+			deltaY: state.deltaY || 0,
+			left: state.left + value
+		})
+	}
+
+}
+
+/**
+ * 滑动中,是否禁止打开
+ * @param {Object} event
+ */
+function stopTouchMove(event) {
+	var instance = event.instance;
+	var state = instance.getState();
+	var touch = event.touches[0];
+	state.timing = getDate().getTime() - state.startTime;
+	state.deltaX = touch.clientX - state.startX;
+	state.deltaY = touch.clientY - state.startY;
+	state.offsetX = Math.abs(state.deltaX);
+	state.offsetY = Math.abs(state.deltaY);
+	state.direction = state.direction || getDirection(state.offsetX, state.offsetY);
+}
+
+/**
+ * 设置滑动开始位置
+ * @param {Object} event
+ */
+function stopTouchStart(event) {
+	var instance = event.instance;
+	var state = instance.getState();
+	resetTouchStatus(instance);
+	var touch = event.touches[0];
+	state.startTime = getDate().getTime();
+	state.startX = touch.clientX;
+	state.startY = touch.clientY;
+}
+
+function getDirection(x, y) {
+	if (x > y && x > MIN_DISTANCE) {
+		return 'horizontal';
+	}
+	if (y > x && y > MIN_DISTANCE) {
+		return 'vertical';
+	}
+	return '';
+}
+
+/**
+ * 重置滑动状态
+ * @param {Object} event
+ */
+function resetTouchStatus(instance) {
+	var state = instance.getState();
+	state.direction = '';
+	state.deltaX = 0;
+	state.deltaY = 0;
+	state.offsetX = 0;
+	state.offsetY = 0;
+}
+
+module.exports = {
+	changeData: changeData,
+	touchstart: touchstart,
+	touchmove: touchmove,
+	touchend: touchend
+}

+ 62 - 0
components/sn-swiper/esc-swiper/mixins/mpother.js

@@ -0,0 +1,62 @@
+const MIN_DISTANCE = 10;
+export default {
+	methods: {
+		touchstart(e) {
+			this._left = this.left
+			this.stopTouchStart(e)
+		},
+		touchmove(e) {
+			// 是否可以滑动页面
+			this.stopTouchMove(e);
+			if (this.direction == 'horizontal') {
+				this.moveTo({
+					deltaX: this.deltaX,
+					deltaY: this.deltaY || 0,
+					left: this._left + this.deltaX
+				})
+			}
+			// FIXME: 冒泡
+			return false
+		},
+		touchend() {
+			this.moveEnd({
+				velocity: Math.abs(this.deltaX / this.timing),
+				direction: this.direction,
+				deltaX: this.deltaX,
+				deltaY: this.deltaY,
+			})
+		},
+		stopTouchStart(event) {
+			this.resetTouchStatus();
+			const touch = event.touches[0];
+			this.startTime = new Date().getTime();
+			this.startX = touch.clientX;
+			this.startY = touch.clientY;
+		},
+		stopTouchMove(event) {
+			const touch = event.touches[0];
+			this.timing = new Date().getTime() - this.startTime;
+			this.deltaX = touch.clientX - this.startX;
+			this.deltaY = touch.clientY - this.startY;
+			this.offsetX = Math.abs(this.deltaX);
+			this.offsetY = Math.abs(this.deltaY);
+			this.direction = this.direction || this.getDirection(this.offsetX, this.offsetY);
+		},
+		getDirection(x, y) {
+			if (x > y && x > MIN_DISTANCE) {
+				return 'horizontal';
+			}
+			if (y > x && y > MIN_DISTANCE) {
+				return 'vertical';
+			}
+			return '';
+		},
+		resetTouchStatus() {
+			this.direction = '';
+			this.deltaX = 0;
+			this.deltaY = 0;
+			this.offsetX = 0;
+			this.offsetY = 0;
+		}
+	}
+}

+ 7 - 0
components/sn-swiper/esc-swiper/mixins/mpwxs.js

@@ -0,0 +1,7 @@
+export default {
+	data() {
+		return {
+			wxsData: {}
+		}
+	}
+}

+ 15 - 0
components/utils/style.js

@@ -0,0 +1,15 @@
+const toLine = (name) => {
+	return name.replace(/([A-Z])/g, '-$1').toLowerCase();
+}
+/**
+ * style对象转化为style字符串
+ * @return {string}
+ */
+export const getStyleStr = (styleObject) => {
+	let transfrom = '';
+	for (let i in styleObject) {
+		let line = toLine(i);
+		transfrom += line + ':' + styleObject[i] + ';';
+	}
+	return transfrom
+}

+ 31 - 0
main.js

@@ -0,0 +1,31 @@
+import Vue from 'vue'
+import App from './App'
+import store from './store'
+
+import {
+  myRequest
+} from './util/api.js'
+
+Vue.prototype.$Request = myRequest
+
+
+Vue.config.productionTip = false
+
+App.mpType = 'app'
+
+// 解决支付宝小程序bug
+Vue.config.warnHandler = function(msg) {
+  if (!msg.includes(
+      'Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders.'
+      )) { 
+     // uniApp bug: https://ask.dcloud.net.cn/question/71966
+    return console.warn && console.warn(msg)
+  }
+}
+
+
+const app = new Vue({
+  store,
+  ...App
+})
+app.$mount()

+ 84 - 0
manifest.json

@@ -0,0 +1,84 @@
+{
+    "name" : "小程序",
+    "appid" : "__UNI__BAF74FD",
+    "description" : "",
+    "versionName" : "1.0.0",
+    "versionCode" : "100",
+    "transformPx" : false,
+    /* 5+App特有相关 */
+    "app-plus" : {
+        "usingComponents" : true,
+        "nvueStyleCompiler" : "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.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.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<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.FLASHLIGHT\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            /* ios打包配置 */
+            "ios" : {},
+            /* SDK配置 */
+            "sdkConfigs" : {}
+        }
+    },
+    /* 快应用特有相关 */
+    "quickapp" : {},
+    /* 小程序特有相关 */
+    "mp-weixin" : {
+        "appid" : "wxe1135cd390b38a54",
+        "setting" : {
+            "urlCheck" : false,
+            "postcss" : true,
+            "minified" : true,
+            "es6" : true
+        },
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        }
+    },
+    "mp-alipay" : {
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : true
+        },
+        "appid" : "2021002140684377"
+    },
+    "mp-baidu" : {
+        "usingComponents" : true
+    },
+    "mp-toutiao" : {
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : false
+        }
+    },
+    "uniStatistics" : {
+        "enable" : false
+    }
+}

+ 50 - 0
pages.json

@@ -0,0 +1,50 @@
+{
+  "easycom": {
+    "autoscan": true,
+    "custom": {
+      "^uni-(.*)": "@/uni_modules/uni-$1/components/uni-$1/uni-$1.vue"
+    }
+  },
+  "pages": [{
+    "path": "pages/index/index",
+    "style": {
+      "navigationBarTitleText": "一键加油"
+    }
+  },{
+    "path": "pages/test/test",
+    "style": {
+      "navigationBarTitleText": "测试页",
+      "enablePullDownRefresh": false
+    }
+  }, {
+    "path": "pages/succeed/succeed",
+    "style": {
+      "navigationBarTitleText": "支付成功",
+      "enablePullDownRefresh": false
+    }
+  }, {
+    "path": "pages/authen/identity",
+    "style": {
+      "navigationBarTitleText": "请求授权",
+      "enablePullDownRefresh": false
+    }
+  }, {
+    "path": "pages/authen/login",
+    "style": {
+      "navigationBarTitleText": "登录",
+      "enablePullDownRefresh": false
+    }
+  }, {
+    "path": "pages/confirm/confirm",
+    "style": {
+      "navigationBarTitleText": "订单确认",
+      "enablePullDownRefresh": false
+    }
+  }],
+  "globalStyle": {
+    "navigationBarTextStyle": "black",
+    "navigationBarTitleText": "uni-app",
+    "navigationBarBackgroundColor": "#F8F8F8",
+    "backgroundColor": "#F8F8F8"
+  }
+}

+ 224 - 0
pages/authen/identity.vue

@@ -0,0 +1,224 @@
+<template>
+  <view class="container">
+    <image src="../../static/icon/login.png" mode="scaleToFill" class="icon"></image>
+    <view class="hr"></view>
+    <view class="content">
+      <text>申请获取以下权限</text>
+      <text>获得你的公开信息(昵称、头像、地区等)</text>
+    </view>
+    <!--  #ifdef  MP-WEIXIN -->
+    <button :loading="getUserInfoLoading" :disabled="getUserInfoLoading" @click="getUserInfo">
+      授权获取
+    </button>
+    <!--  #endif -->
+
+    <!--  #ifdef  MP-ALIPAY -->
+    <button :loading="getUserInfoLoading" :disabled="getUserInfoLoading" open-type="getAuthorize" scope="userInfo"
+      @getAuthorize="getUserInfo" @onError="onAuthError">
+      支付宝授权获取
+    </button>
+    <button  @click="getCode">
+      code获取
+    </button>
+    <button  @click="getCode" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
+      code获取
+    </button>
+    
+    <!--  #endif -->
+    
+
+  </view>
+</template>
+<script>
+  import {
+    mapState,
+    mapMutations
+  } from "vuex";
+
+  export default {
+    data() {
+      return {
+        code: '',
+        getUserInfoLoading: false
+      }
+    },
+    created() {
+      if (store.state.userInfo.nickName !== undefined) {
+        uni.redirectTo({
+          url: "/pages/authen/login"
+        })
+        return
+      }
+    },
+    computed: {
+      ...mapState(["appId", "stationId", "phoneNumber", "countryCode", "purePhoneNumber", "openId", "unionId",
+        "userInfo"
+      ])
+    },
+    async created() {
+      let [err, loginData] = await uni.login();
+      this.code = loginData.code
+    },
+    methods: {
+      getPhoneNumber(){
+        my.getPhoneNumber({
+            success: (res) => {
+                let encryptedData = res.response;
+                  console.log(encryptedData)
+            },
+            fail: (res) => {
+                console.log(res);
+                console.log('getPhoneNumber_fail');
+            },
+        });
+
+      },
+      getCode(){
+        my.getAuthCode({
+          scopes: ['auth_user',"auth_base","auth_zhima"],
+         // 主动授权:auth_user,静默授权:auth_base。或者其它scope。如需同时获取用户多项授权,可在 scopes 中传入多个 scope 值。
+          success: (res) => {
+            console.log(res)
+          //   if (res.authCode) {
+          //     // 认证成功
+          //     // 调用自己的服务端接口,让服务端进行后端的授权认证,并且利用session,需要解决跨域问题
+          //     my.request({
+          //       url: 'https://isv.com/auth', // 该url是您自己的服务地址,实现的功能是服务端拿到authcode去开放平台进行token验证
+          //       data: {
+          //         authcode: res.authCode,
+          //       },
+          //       success: () => {
+          //         // 授权成功并且服务器端登录成功
+          //       },
+          //       fail: () => {
+          //         // 根据自己的业务场景来进行错误处理
+          //       },
+          //     });
+          //   }
+          },
+        });
+        
+      },
+      test(res) {
+        console.log("你好")
+        console.log(res)
+      },
+      ...mapMutations({
+        updateUserInfo: "updateUserInfo",
+      }),
+      async getUserInfo(res) {
+        let userInfo = undefined
+        //#ifdef MP-WEIXIN
+        try {
+          this.getUserInfoLoading = true;
+          uni.showLoading({
+            title: '获取中...',
+            mask: true
+          });
+          const profileData = await wx.getUserProfile({
+            lang: "zh_CN",
+            desc: "更好的推送体验"
+          })
+          userInfo = profileData.userInfo
+          this.updateUserInfo(userInfo)
+          this.getUserInfoLoading = false
+          uni.hideLoading();
+          const [redirectErr, redirectData] = await uni.redirectTo({
+            url: "/pages/authen/login"
+          })
+
+        } catch (e) {
+          this.getUserInfoLoading = false
+          uni.hideLoading();
+          uni.showToast({
+            title: '授权失败,请刷新小程序'
+          })
+        }
+        //#endif
+        //#ifdef MP-ALIPAY
+        my.getOpenUserInfo({
+          fail: (res) => {},
+          success: (res) => {
+            let userInfo = JSON.parse(res.response).response // 以下方的报文格式解析两层 response0
+            console.log(userInfo);
+          },
+        });
+        //#endif
+        
+        // //#ifndef 
+        // uni.showToast({
+        //   title: '暂时只支持微信和支付宝小程序'
+        // })
+        // //#endif
+      },
+
+    },
+    onLoad() { //默认加载
+    }
+  }
+</script>
+<style lang="scss">
+  page {
+    width: 750rpx;
+    background-color: #f0f2f5;
+    min-height: 100vh;
+
+    .container {
+      text-align: center;
+
+      .icon {
+        margin-top: 414rpx;
+        width: 508rpx;
+        height: 388rpx;
+        margin-top: 180rpx;
+        display: inline-block;
+      }
+
+      .hr {
+        margin-top: 120rpx;
+        display: inline-block;
+        width: 618rpx;
+        height: 2rpx;
+        box-sizing: border-box;
+        border: 1rpx solid rgba(0, 0, 0, 0.1);
+      }
+
+      .content {
+        margin-top: 90rpx;
+        display: inline-flex;
+        flex-direction: column;
+        justify-content: center;
+
+        width: 616rpx;
+
+        text:nth-child(1) {
+          height: 44rpx;
+          font-size: 32rpx;
+          color: #000000;
+          line-height: 44rpx;
+          text-align: left;
+        }
+
+        text:nth-child(2) {
+          height: 44rpx;
+          font-size: 28rpx;
+          text-align: left;
+          color: rgba(0, 0, 0, 0.25);
+          line-height: 44rpx;
+        }
+      }
+
+      button {
+        margin-top: 90rpx;
+        display: inline-block;
+        width: 616rpx;
+        height: 76rpx;
+        background: linear-gradient(123deg, #12A273 0%, #12A273 100%);
+        border-radius: 38rpx;
+        font-size: 32rpx;
+        color: #FFFFFF;
+        line-height: 76rpx;
+      }
+    }
+  }
+</style>

+ 202 - 0
pages/authen/login.vue

@@ -0,0 +1,202 @@
+<template>
+  <view class="container">
+    <image src="../../static/icon/login.png" mode="scaleToFill" class="icon"></image>
+    <view class="content">
+      <button 
+        open-type='getPhoneNumber' 
+        @getphonenumber="getPhoneNumber"
+        :loading="getPhoneNumberLoading"
+        :disabled="getPhoneNumberLoading"
+      >
+        授权登录
+      </button>
+      <button type="default">手机登录</button>
+      <text>登录即代表同意《隐私政策》和《用户服务协议》</text>
+    </view>
+  </view>
+</template>
+<script>
+  import {
+    mapState,
+    mapMutations
+  } from "vuex";
+
+  export default {
+    data() {
+      return {
+        code: '',
+        getPhoneNumberLoading:false
+      }
+    },
+    computed: {
+      ...mapState(["appId", "stationId", "phoneNumber", "countryCode", "purePhoneNumber", "openId", "unionId",
+        "userInfo"
+      ])
+    },
+    async created() {
+      if(this.phoneNumber !== '' && this.openId !== '' && this.unionId !== '' ){
+          uni.redirectTo({
+            url:"/pages/index/index"
+          })
+          return 
+      }
+      
+      let [err, loginData] = await uni.login();
+      this.code = loginData.code
+ 
+    },
+    methods: {
+      ...mapMutations({
+        updateOpenId: "updateOpenId",
+        updateUnionId: "updateUnionId",
+        updateUserInfo: "updateUserInfo",
+        updatePhoneNumber: "updatePhoneNumber",
+        updateCountryCode: "updateCountryCode",
+        updatePurePhoneNumber: "updatePurePhoneNumber"
+      }),
+      //#ifdef MP-WEIXIN
+      async getPhoneNumber(info) {
+        this.getPhoneNumberLoading  = true;
+        uni.showLoading({
+          title: '获取中...',
+          mask: true
+        });
+        
+        if (info.detail.errMsg === "getPhoneNumber:ok") {
+          try {
+            console.log(this.code)
+            let loginDataArr = await uni.login();
+            this.code = loginDataArr[1].code
+            const iv = info.detail.iv
+            const encryptedData = info.detail.encryptedData
+            const keyData = await this.$Request({
+              url: "/getSessionKeyAndOpenID",
+              method: "GET",
+              data: {
+                code: this.code,
+                stationId: this.stationId
+              }
+            })
+            console.log("keyData", keyData)
+            const openId = keyData.openId
+            this.updateOpenId(openId)
+            const unionId = keyData.unionId
+            this.updateUnionId(unionId)
+            const sessionKey = keyData.sessionKey
+            const decryptData = await this.$Request({
+              url: "/decryptEncryptedData",
+              method: "POST",
+              data: {
+                sessionKey,
+                encryptedData,
+                iv
+              }
+            })
+            console.log("decryptData", decryptData)
+            const phoneNumber = decryptData.phoneNumber // 全手机号
+            const countryCode = decryptData.countryCode // 区号
+            const purePhoneNumber = decryptData.purePhoneNumber // 不带区号的手机号
+            this.updatePhoneNumber(phoneNumber)
+            this.updateCountryCode(countryCode)
+            this.updatePhoneNumber(purePhoneNumber)
+            const AppUserInfoData = await this.$Request({
+              url: "/addAppUserInfo",
+              method: "POST",
+              data: {
+                "userType": "2",
+                "openId": this.openId,
+                "blogNickName": this.userInfo.nickName,
+                "sexFlag": this.userInfo.gender === 1 ? 'M' : 'F',
+                "blogProfilePhoto": this.userInfo.avatarUrl,
+                "mobilePhone": this.phoneNumber,
+                "stationId": this.stationId, //油站Id
+                "stationName": this.stationName, //油站名称
+                "unionId": this.unionId
+              }
+            })
+            if (AppUserInfoData.retCode !== 0) {
+              throw new Error("存入用户失败")
+            }
+            this.getPhoneNumberLoading = false
+            uni.hideLoading();
+            uni.navigateBack({
+              delta:1
+            })
+            // console.log(redirectData)
+          } catch (e) {
+            this.getPhoneNumberLoading = false
+            uni.hideLoading();
+            uni.showToast({
+              title: '授权失败,请再次尝试一下'
+            })
+          }
+        } else {
+          this.getPhoneNumberLoading = false
+          uni.hideLoading();
+          uni.showToast({
+            title: '授权拒绝,请登录后操作'
+          })
+        }
+      },
+      //#endif
+    },
+    onLoad() { //默认加载
+
+    }
+  }
+</script>
+<style lang="scss">
+  page {
+    width: 750rpx;
+    background-color: #f0f2f5;
+    min-height: 100vh;
+
+    .container {
+      text-align: center;
+
+      .icon {
+        margin-top: 414rpx;
+        width: 508rpx;
+        height: 388rpx;
+        margin-top: 180rpx;
+        display: inline-block;
+      }
+
+      .content {
+        display: inline-flex;
+        flex-direction: column;
+        justify-content: center;
+        margin-top: 210rpx;
+
+        button:nth-child(1) {
+          width: 616rpx;
+          height: 76rpx;
+          background: linear-gradient(123deg, #12A273 0%, #12A273 100%);
+          border-radius: 38rpx;
+          font-size: 32rpx;
+          color: #FFFFFF;
+          line-height: 76rpx;
+        }
+
+        button:nth-child(2) {
+          width: 616rpx;
+          height: 76rpx;
+          background-color: #f0f2f5;
+          border-radius: 38rpx;
+          font-size: 32rpx;
+          font-weight: 400;
+          color: rgba(0, 0, 0, 0.25);
+          line-height: 76rpx;
+        }
+
+        text {
+          margin-top: 42rpx;
+          height: 36rpx;
+          font-size: 26rpx;
+          color: rgba(0, 0, 0, 0.5);
+          line-height: 36rpx;
+        }
+      }
+    }
+  }
+</style>

+ 1017 - 0
pages/confirm/confirm.vue

@@ -0,0 +1,1017 @@
+<template>
+  <view class="confirm">
+    <view class="bg">
+    </view>
+    <view class="container">
+      <view class="station">
+        <image :src="orderInfo.stationPic" mode="scaleToFill"></image>
+        <view class="info">
+          <view class="name">
+            {{orderInfo.stationName}}
+          </view>
+          <view class="content">
+            <view>
+              <text>油枪号:</text><text>{{selectedGas.oilGunNo}}号</text>
+            </view>
+            <view>
+              <text>油品名:</text><text>{{selectedGas.oilName}}</text>
+            </view>
+            <view>
+              <text>油站价:</text><text>¥{{selectedGas.oilPrice}}/L</text>
+            </view>
+            <view>
+              <text>优惠价:</text><text>¥{{orderInfo.discountPrice}}/L</text>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view>
+        <view>
+          <view class="icon price"></view>订单金额
+        </view>
+        <text class="price">¥{{orderInfo.receivableAmt}}</text>
+      </view>
+      <view>
+        <view>
+          <view class="icon oil"></view>加油升数
+        </view>
+        <text>{{orderInfo.oilLiters}}L</text>
+      </view>
+      <view>
+        <view>
+          <view class="icon discount"></view>优惠金额
+        </view>
+        <text>¥{{(orderInfo.receivableAmt - orderInfo.amt).toFixed(2)}}</text>
+      </view>
+
+      <view class="dispose coupon">
+        <view class="title">
+          <text>优惠券</text>
+          <text>立减10元</text>
+        </view>
+        <view class="tip">
+          <text class="icon"></text>
+          <text>优惠券和电子卡不可叠加</text>
+        </view>
+        <view class="extra">
+          有可用的优惠券 >>
+        </view>
+      </view>
+      <view class="dispose dzk">
+        <view class="title">
+          <text>电子卡支付</text>
+          <text>立减50元</text>
+        </view>
+        <view class="tip">
+          <text class="icon"></text>
+          <text>优惠券和电子卡不可叠加</text>
+        </view>
+        <view class="extra icon" :class="[1 === 1 ? 'selected':'', availableCredit ? '':'forbid']"></view>
+      </view>
+<!--      <view>
+        <view>
+          <view class="icon vip"></view>油站会员
+        </view>
+        <text>立刻开通</text>
+      </view> -->
+    </view>
+    <view class="submit">
+      <view class="area">
+        <text>实付款</text>
+        <text>¥{{orderInfo.amt}}</text>
+        <button class="btn" @click="goSelectPayType" :loading="wxPayLoading" :disabled="wxPayLoading">
+          提交订单
+        </button>
+      </view>
+    </view>
+    <uni-popup ref="pay" class="pay" type="bottom" maskClick="false">
+      <view class="cont">
+        <view class="close" @click="backToSelectPayType">
+        </view>
+        <view class="amount">
+          <text>¥</text>
+          {{ orderInfo.amt }}
+        </view>
+        <view class="type">
+          <text>付款方式</text>
+          <text>电子卡支付</text>
+          <text></text>
+        </view>
+        <button type="default" class="pay" @click="creditPay" :loading="creditPayLoading">
+          立即付款
+        </button>
+      </view>
+    </uni-popup>
+    <uni-popup ref="selectPayType" class="selectPayType" type="bottom" maskClick="false">
+      <view class="cont">
+        <view class="close" @click="closeSelectPayType">
+        </view>
+        <view class="credit">
+          <view class="credit-con" @click="selectPayType(1)">
+            <text class="text">电子卡支付(剩余:{{ orderInfo.balance }})</text>
+            <text class="icon" :class="[payType === 1 ? 'selected':'', availableCredit ? '':'forbid']"></text>
+          </view>
+          <text class="tip">
+            {{tip}}
+          </text>
+        </view>
+        <view class="wx" @click="selectPayType(2)">
+          <text class="text">微信支付</text>
+          <text class="icon" :class="[payType === 2 ? 'selected':'']"></text>
+        </view>
+        <button type="default" :class="[payType !== '' ? 'available' : '']" @click="goPay"
+          :disabled="payType === '' ? true : false" :loading="wxPayLoading">
+          确认
+        </button>
+      </view>
+    </uni-popup>
+    <uni-popup ref="coupon" class="coupon" type="bottom" maskClick="false">
+      <view class="coupon-container">
+        <view class="close" @click="closeCoupon">
+        </view>
+        <view class="title">
+          优惠券
+        </view>
+        <scroll-view scroll-y="true" class="coupon-scroll">
+          <view class="item cash">
+            <view class="left">
+              <text class="amount">¥<text class="big">100</text></text>
+              <text>无门槛</text>
+            </view>
+            <view class="right">
+              <text class="title">立减劵</text>
+              <text class="scope">范围:限汽油</text>
+             <text class="valid">有效至 2021.03.01</text>
+              <text class="use"></text>
+            </view>
+          </view>
+          <view class="item discount">
+            <view class="left">
+              <text class="amount">¥<text class="big">100</text></text>
+              <text>无门槛</text>
+            </view>
+            <view class="right">
+              <text class="title">立减劵</text>
+              <text class="scope">范围:限汽油</text>
+             <text class="valid">有效至 2021.03.01</text>
+              <text class="use"></text>
+            </view>
+          </view>
+          <view class="item exchange">
+            <view class="left">
+              <text class="amount">¥<text class="big">100</text></text>
+              <text>无门槛</text>
+            </view>
+            <view class="right">
+              <text class="title">立减劵</text>
+              <text class="scope">范围:限汽油</text>
+             <text class="valid">有效至 2021.03.01</text>
+              <text class="use"></text>
+            </view>
+          </view>
+        </scroll-view>
+      </view>
+    </uni-popup>
+  </view>
+</template>
+
+<script>
+  import {
+    mapState,
+    mapMutations
+  } from "vuex";
+
+  export default {
+    data() {
+      return {
+        creditFlag: false,
+        payType: "", // 1电子卡 2微信
+        wxPayLoading: false,
+        creditPayLoading: false
+      };
+    },
+    computed: {
+      ...mapState(["orderInfo", "selectedGas", "openId", "stationId"]),
+      availableCredit() {
+        if (this.selectedGas.oilGunType == '2') {
+          return false
+        }
+        if ((+this.orderInfo.balance) < (+this.orderInfo.amt)) {
+          return false
+        }
+        return true
+      },
+      tip() {
+        if (this.selectedGas.oilGunType == '2') {
+          return "非油品不可用电子卡支付"
+        }
+        if ((+this.orderInfo.balance) < (+this.orderInfo.amt)) {
+          if (this.orderInfo.cardOilsType == "1") {
+            return "汽油卡余额不足,请在微信公众号充值"
+          }
+          if (this.orderInfo.cardOilsType == "2") {
+            return "柴油卡余额不足,请在微信公众号充值"
+          }
+        }
+        return "电子卡余额充足,可以使用电子卡支付"
+      }
+    },
+    created() {
+      this.getCreditFlag()
+    },
+    mounted() {
+      // this.$refs.pay.close()
+      // this.$refs.coupon.open();
+    },
+    methods: {
+      closeCoupon(){
+        this.$refs.coupon.close();
+      },
+      async goSelectPayType() {
+        if (!this.creditFlag) { //未启用电子卡
+          this.wxPay()
+          return
+        }
+        this.$refs.selectPayType.open()
+      },
+      async creditPay() {
+        this.creditPayLoading = true;
+        uni.showLoading({
+          title: '支付中...',
+          mask: true
+        });
+        try {
+          const creditPayData = await this.$Request({
+            url: "/dzkPaySet",
+            data: {
+              "ordNo": this.orderInfo.ordNo
+            },
+          })
+          console.log(creditPayData)
+          if (creditPayData.retCode !== 0) {
+            throw new Error(creditPayData.message)
+          }
+          this.creditPayLoading = false;
+          uni.hideLoading();
+          uni.navigateTo({
+            url: "/pages/succeed/succeed"
+          })
+        } catch (e) {
+          this.creditPayLoading = false;
+          uni.hideLoading();
+          this.showToastAndGoback(e.toString())
+        }
+      },
+      cancelCreditPay() {
+        this.showToastAndGoback("你取消了电子卡支付")
+      },
+      async wxPay() {
+        this.wxPayLoading = true;
+        uni.showLoading({
+          title: '拉取支付...',
+          mask: true
+        });
+        try {
+          // 因为后期要加入定时删除 所以此步骤来确认数据库里是否有此订单
+          // 如果没有定时删除任务,此步骤冗余
+          const PayOrderData = await this.$Request({
+            url: "/getPayOrderList",
+            data: {
+              "orderNo": this.orderInfo.ordNo,
+              "openId": this.openId,
+              "userType": 2
+            },
+          })
+          console.log(PayOrderData)
+          if (PayOrderData.retCode !== 0) {
+            throw new Error("获取order主键失败")
+          }
+          const orderId = PayOrderData.data[0].orderId
+          // 提供给服务端必要的信息,服务端生成随行付的支付信息,返回回来
+          const JhPayData = await this.$Request({
+            url: "/getJhPayInfo",
+            method: "POST",
+            data: {
+              "orderId": orderId,
+              "openId": this.openId,
+              "stationId": this.stationId,
+              "subject": this.orderInfo.stationName + "_" + this.selectedGas.oilName + this.selectedGas
+                .oilGunType == "1" ? "油品" : "非油品" + "支付订单",
+              "userType": "2"
+            },
+          })
+          console.log(JhPayData)
+          if (JhPayData.retCode !== 0) {
+            throw new Error("请求聚合支付下单接口失败")
+          }
+          if (JhPayData.data.code !== '0000') {
+            throw new Error(JhPayData.data.msg)
+          }
+
+          let timeStamp = JhPayData.data.respData.payTimeStamp;
+          let nonceStr = JhPayData.data.respData.paynonceStr;
+          let payPackage = JhPayData.data.respData.payPackage;
+          let signType = JhPayData.data.signType;
+          let paySign = JhPayData.data.respData.paySign;
+          // 填写随行付的信息,启动支付
+          const [payErr, payData] = await uni.requestPayment({
+            'timeStamp': timeStamp,
+            'nonceStr': nonceStr,
+            'package': payPackage,
+            'signType': signType,
+            'paySign': paySign,
+          })
+
+          if (!!payData && payData.errMsg === "requestPayment:ok") {
+            this.wxPayLoading = false;
+            uni.hideLoading();
+            uni.navigateTo({
+              url: "/pages/succeed/succeed"
+            })
+            return;
+          }
+          this.wxPayLoading = false;
+          uni.hideLoading();
+          if (payErr.errMsg === "requestPayment:fail cancel") {
+            this.showToastAndGoback("你取消了支付")
+            return;
+          }
+          this.showToastAndGoback("支付失败")
+        } catch (e) {
+          this.wxPayLoading = false;
+          uni.hideLoading();
+          this.showToastAndGoback(e.message)
+        }
+      },
+      showToastAndGoback(title) {
+        uni.showToast({
+          title,
+          mask: true
+        })
+        setTimeout(() => {
+          uni.navigateBack({
+            delta: 1
+          })
+        }, 1500)
+      },
+      async getCreditFlag() {
+        const PayOrderData = await this.$Request({
+          url: "/getStationCardEnabledFlag",
+          data: {
+            stationId: this.stationId
+          }
+        })
+        console.log(PayOrderData)
+        if (PayOrderData.retCode !== 0) {
+          this.showToastAndGoback("拉取电子卡启用状态失败")
+          return
+        }
+        this.creditFlag = PayOrderData.data == '1' ? true : false
+      },
+      selectPayType(type) {
+        if (!this.availableCredit && type == 1) {
+          return
+        }
+        if (type === this.payType) {
+          this.payType = ""
+          return
+        }
+        this.payType = type
+      },
+      goPay() {
+        if (this.payType === 2) {
+          this.wxPay()
+          return
+        }
+        if (this.payType === 1) {
+          this.$refs.selectPayType.close();
+          this.$refs.pay.open()
+        }
+      },
+      backToSelectPayType() {
+        this.$refs.pay.close()
+        this.$refs.selectPayType.open();
+      },
+      closeSelectPayType() {
+        this.$refs.selectPayType.close();
+      }
+
+    }
+  }
+</script>
+
+<style lang="scss">
+  page {
+    width: 750rpx;
+    background: #F2F2F2;
+
+    .confirm {
+      .bg {
+        width: 750rpx;
+        height: 352rpx;
+        background: #0EA374;
+      }
+
+      .container {
+        width: 690rpx;
+        margin: 0 auto;
+        margin-top: -239rpx;
+
+        .station {
+          width: 690rpx;
+          height: 340rpx;
+          background: #FFFFFF;
+          border-radius: 14rpx;
+          box-sizing: border-box;
+          padding: 21rpx;
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+
+          image {
+            width: 200rpx;
+            height: 240rpx;
+          }
+
+          .info {
+
+            width: 400rpx;
+            height: 240rpx;
+            display: flex;
+            flex-direction: column;
+            justify-content: space-between;
+            align-items: flex-start;
+
+            .content {
+              height: 180rpx;
+              display: flex;
+              flex-direction: column;
+              justify-content: space-between;
+              font-size: 28rpx;
+              font-weight: 400;
+              color: #666666;
+              line-height: 40rpx;
+
+              view {
+                display: flex;
+                justify-content: space-between;
+
+                text:nth-child(1) {
+                  width: 200rpx;
+                  display: inline-block;
+                }
+              }
+            }
+
+            .name {
+              height: 45rpx;
+              font-size: 32rpx;
+              font-weight: 600;
+              color: #111111;
+              line-height: 45rpx;
+            }
+          }
+        }
+
+
+        >view:not(.station) {
+          width: 690rpx;
+          height: 110rpx;
+          background: #FFFFFF;
+          box-shadow: 0px 2rpx 6rpx 5rpx rgba(237, 237, 237, 0.5);
+          border-radius: 10rpx;
+          margin-top: 20rpx;
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+          box-sizing: border-box;
+          padding: 20rpx;
+          font-size: 28rpx;
+          font-weight: 500;
+          color: #111111;
+          line-height: 40rpx;
+
+          >view {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+
+            .icon {
+              display: inline-block;
+              width: 35rpx;
+              height: 30rpx;
+              // border: 2rpx solid #666666;
+              margin-right: 14rpx;
+            }
+
+            .price {
+              background: url(../../static/icon/dingdan.2x.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+            }
+
+            .oil {
+              background: url(../../static/icon/sheng.2x.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+            }
+
+            .discount {
+              background: url(../../static/icon/youhuiquan-2.2x.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+            }
+
+            .vip {
+              background: url(../../static/icon/huiyuan-.2x.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+            }
+            
+          }
+
+          text.price {
+            font-size: 24rpx;
+            color: #F3B235;
+            line-height: 33rpx;
+          }
+
+          text.vip {
+            font-size: 24rpx;
+            color: #A76825;
+            line-height: 33rpx;
+          }
+
+        }
+        view.dispose{
+          width: 690rpx;
+          height: 138rpx;
+          position: relative;
+          display: inline-block;
+          .title{
+            position: absolute;
+            top: 36rpx;
+            left: 20rpx;
+            
+            text:nth-child(1){
+              height: 40rpx;
+              font-size: 28rpx;
+              font-weight: 400;
+              color: #000000;
+              line-height: 40rpx;
+              margin-right: 20rpx;
+            }
+            text:nth-child(2){
+              height: 28rpx;
+              font-size: 20rpx;
+              font-family: PingFangSC-Regular, PingFang SC;
+              font-weight: 400;
+              color: #F0B849;
+              line-height: 28rpx;
+              box-sizing: border-box;
+              border: 1px solid #F0B849;
+            }
+          }
+          .tip{
+            position: absolute;
+            top: 90rpx;
+            left: 20rpx;
+            
+            .icon{
+              width: 22rpx;
+              height: 22rpx;
+              background: url(../../static/icon/tipicon1.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+            }
+            text:nth-child(2){
+              width: 220rpx;
+              height: 28rpx;
+              font-size: 20rpx;
+              font-family: PingFangSC-Regular, PingFang SC;
+              font-weight: 400;
+              color: rgba(0, 0, 0, 0.4);
+              line-height: 28rpx;
+            }
+          }
+        }
+        view.coupon{
+          .extra{
+            position: absolute;
+            right: 20rpx;
+            top: 54rpx;
+            height: 34rpx;
+            font-size: 24rpx;
+            color: #6D6D6D;
+            line-height: 34rpx;
+          }
+        }
+        view.dzk{
+          .extra{
+            position: absolute;
+            right: 20rpx;
+            top: 54rpx;
+            background: url(../../static/icon/select.png) no-repeat 0px 0px;
+            background-size: 100% 100%;
+            width: 40rpx;
+            height: 40rpx;  
+            margin-right: 20rpx;
+          }
+          
+          .selected {
+            background: url(../../static/icon/selected.png) no-repeat 0px 0px;
+            background-size: 100% 100%;
+          }
+          
+          .forbid {
+            background: url(../../static/icon/forbid.png) no-repeat 0px 0px;
+            background-size: 100% 100%;
+          }
+        }
+      }
+
+      .submit {
+        width: 750rpx;
+        height: 180rpx;
+
+        // background: #FFFFFF;
+        // margin-top: 30rpx;
+        .area {
+          width: 750rpx;
+          height: 150rpx;
+          background: #FFFFFF;
+          position: fixed;
+          bottom: 0;
+          left: 0;
+          right: 0;
+          display: flex;
+          justify-content: flex-end;
+          align-items: center;
+
+          text:nth-child(1) {
+            font-size: 28rpx;
+            font-weight: 400;
+            color: #111111;
+            line-height: 40rpx;
+          }
+
+          text:nth-child(2) {
+            font-size: 30rpx;
+            font-weight: 600;
+            color: #f3b338;
+            line-height: 40rpx;
+          }
+
+          .btn {
+            margin-left: 20rpx;
+            margin-right: 30rpx;
+            background-color: #0ea374;
+            border-radius: 40rpx;
+            width: 250rpx;
+            height: 80rpx;
+            font-size: 28rpx;
+            font-family: PingFangSC-Regular, PingFang SC;
+            font-weight: 500;
+            color: #FFFFFF;
+            line-height: 80rpx;
+            text-align: center;
+          }
+        }
+      }
+
+      uni-popup.pay {
+        .cont {
+          width: 750rpx;
+          height: 682rpx;
+          background: #FFFFFF;
+          border-radius: 30rpx 30rpx 0 0;
+          position: relative;
+
+          .close {
+            background: url(../../static/icon/left.png) no-repeat 0px 0px;
+            background-size: 100% 100%;
+            width: 18rpx;
+            height: 30rpx;
+            position: absolute;
+            top: 46rpx;
+            left: 34rpx;
+          }
+
+          .amount {
+            width: 100%;
+            height: 100rpx;
+            font-size: 80rpx;
+            font-weight: 400;
+            color: #000000;
+            position: absolute;
+            top: 112rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+
+            text {
+              font-size: 40rpx;
+            }
+          }
+
+          .type {
+            width: 100%;
+            height: 34rpx;
+            position: absolute;
+            top: 310rpx;
+
+            text:nth-child(1) {
+              height: 34rpx;
+              font-size: 24rpx;
+              font-weight: 400;
+              color: #aaaaaa;
+              line-height: 34rpx;
+              position: absolute;
+              left: 58rpx;
+            }
+
+            text:nth-child(2) {
+              height: 34rpx;
+              font-size: 24rpx;
+              font-weight: 500;
+              color: #000000;
+              line-height: 34rpx;
+              position: absolute;
+              right: 144rpx;
+            }
+
+            text:nth-child(3) {
+              background: url(../../static/icon/right.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+              display: inline-block;
+              width: 12rpx;
+              height: 22rpx;
+              position: absolute;
+              right: 66rpx;
+              top: 7rpx;
+            }
+          }
+
+          .pay {
+            width: 590rpx;
+            height: 76rpx;
+            background: linear-gradient(103deg, #12A273 0%, #25AA7E 100%);
+            border-radius: 38rpx;
+            font-size: 28rpx;
+            font-family: PingFangSC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #FFFFFF;
+            line-height: 76rpx;
+            letter-spacing: 1rpx;
+            position: absolute;
+            bottom: 114rpx;
+            left: 80rpx;
+          }
+        }
+      }
+
+      uni-popup.selectPayType {
+        .cont {
+          width: 750rpx;
+          // width: 100%;
+          height: 680rpx;
+          background: #FFFFFF;
+          border-radius: 30rpx 30rpx 0 0;
+          position: relative;
+          padding: 0 25rpx;
+          box-sizing: border-box;
+
+          .close {
+            width: 38rpx;
+            height: 38rpx;
+            position: absolute;
+            top: 24rpx;
+            left: 24rpx;
+            background: url(../../static/icon/6_d05_close.2x.png) no-repeat 0px 0px;
+            background-size: 100% 100%;
+          }
+
+          .credit {
+            position: absolute;
+            width: 700rpx;
+            top: 138rpx;
+            height: 130rpx;
+            box-sizing: border-box;
+            border-bottom: 2rpx solid #D8D8D8;
+            color: #000 solid #D8D8D8;
+            padding: 0 30rpx;
+
+            .credit-con {
+              height: 60rpx;
+              display: flex;
+              justify-content: space-between;
+
+              .text {
+                font-size: 28rpx;
+                height: 40rpx;
+                line-height: 60rpx;
+                font-weight: 600;
+              }
+
+              .icon {
+                background: url(../../static/icon/select.png) no-repeat 0px 0px;
+                background-size: 100% 100%;
+                width: 40rpx;
+                height: 40rpx;
+              }
+
+              .selected {
+                background: url(../../static/icon/selected.png) no-repeat 0px 0px;
+                background-size: 100% 100%;
+              }
+
+              .forbid {
+                background: url(../../static/icon/forbid.png) no-repeat 0px 0px;
+                background-size: 100% 100%;
+              }
+            }
+
+            .tip {
+              margin-top: 16rpx;
+              height: 44rpx;
+              font-size: 24rpx;
+              font-weight: 400;
+              color: rgba(0, 0, 0, 0.29);
+              line-height: 44rpx;
+            }
+          }
+
+          .wx {
+            position: absolute;
+            width: 700rpx;
+            top: 305rpx;
+            padding: 0 30rpx;
+            height: 40rpx;
+            display: flex;
+            box-sizing: border-box;
+            justify-content: space-between;
+
+            .text {
+              font-size: 28rpx;
+              height: 40rpx;
+              line-height: 40rpx;
+              font-weight: 600;
+            }
+
+            .icon {
+              background: url(../../static/icon/select.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+              width: 40rpx;
+              height: 40rpx;
+            }
+
+            .selected {
+              background: url(../../static/icon/selected.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+            }
+          }
+
+          >button {
+            width: 590rpx;
+            height: 76rpx;
+            background-color: #cccccc;
+            border-radius: 38rpx;
+            font-size: 28rpx;
+            font-weight: 400;
+            color: #FFFFFF;
+            line-height: 76rpx;
+            letter-spacing: 1rpx;
+            position: absolute;
+            box-sizing: border-box;
+            bottom: 114rpx;
+            left: 80rpx;
+          }
+
+          >button.available {
+            background: linear-gradient(103deg, #12A273 0%, #25AA7E 100%);
+          }
+        }
+      }
+
+      uni-popup.coupon {
+        .coupon-container {
+          width: 100%;
+          border-radius: 42rpx 42rpx 0px 0px;
+          background: #F2F2F2;
+          padding: 0 30rpx;
+          box-sizing: border-box;
+          position: relative;
+          
+          .close{
+            width: 38rpx;
+            height: 38rpx;
+            position: absolute;
+            top: 24rpx;
+            right: 24rpx;
+            background: url(../../static/icon/6_d05_close.2x.png) no-repeat 0px 0px;
+            background-size: 100% 100%;
+          }
+          
+          >.title {
+            height: 105rpx;
+            font-size: 32rpx;
+            font-weight: 400;
+            color: #111111;
+            line-height: 105rpx;
+            font-weight: 600;
+            color: #111111;
+            text-align: center;
+          }
+
+          .coupon-scroll {
+            max-height: 500rpx;
+            overflow: scroll;
+            
+            .item {
+              width: 690rpx;
+              height: 160rpx;
+              font-size: 24rpx;
+              font-weight: 500;
+              color: #FFFFFF;
+              line-height: 40rpx;
+              display: flex;
+              justify-content: space-between;
+              margin-bottom: 20rpx;
+
+              .left {
+                width: 150rpx;
+                height: 160rpx;
+                display: flex;
+                flex-direction: column;
+                justify-content: center;
+                text-align: center;
+
+                .amount {
+                  font-size: 20rpx;
+
+                  .big {
+                    font-size: 33rpx;
+                  }
+                }
+              }
+
+              .right {
+                width: 540rpx;
+                height: 160rpx;
+                color: #111111;
+                position: relative;
+
+                .title {
+                  position: absolute;
+                  top: 22rpx;
+                  left: 20rpx;
+                  height: 40rpx;
+                  font-size: 28rpx;
+                  font-weight: 500;
+                  line-height: 40rpx;
+                }
+
+                .scope {
+                  position: absolute;
+                  top: 72rpx;
+                  left: 20rpx;
+                  height: 28rpx;
+                  font-size: 20rpx;
+                  color: #666666;
+                  line-height: 28rpx;
+                }
+
+                .valid {
+                  position: absolute;
+                  top: 110rpx;
+                  left: 20rpx;
+                  height: 28rpx;
+                  font-size: 20rpx;
+                  color: #666666;
+                  line-height: 28rpx;
+                }
+
+                .use {
+                  position: absolute;
+                  top: 54rpx;
+                  right: 20rpx;
+                  display: inline-block;
+                  width: 160rpx;
+                  height: 55rpx;
+                }
+              }
+            }
+
+            .cash{
+              background: url(../../static/icon/youhuiquan1.2x.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+            }
+            .discount{
+              background: url(../../static/icon/youhuiquan2.2x.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+            }
+            .exchange{
+              background: url(../../static/icon/youhuiquan3.2x.png) no-repeat 0px 0px;
+              background-size: 100% 100%;
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 603 - 0
pages/index/index.vue

@@ -0,0 +1,603 @@
+<template>
+  <view class="content">
+    <swiper :indicator-dots="true" indicator-color="rgba(255,255,255,0.5)" indicator-active-color="#ffffff"
+      :autoplay="true" :interval="4000" :duration="1000" circular>
+      <swiper-item v-for="item in stationPicList" :key="item.id">
+        <image :src="item.url" mode="scaleToFill"></image>
+      </swiper-item>
+    </swiper>
+    <view class="box">
+      <view class="title">
+        <view class="left">
+          选择油枪 |
+          <text v-if="!selectedGas.oilGunNo">请选择油枪</text>
+          <text class="selected" v-else>已选择{{selectedGas.oilGunNo}}号油枪</text>
+        </view>
+        <!-- <text class="right" @click="openMoreGun">更多 ></text> -->
+      </view>
+      <view class="notice-bar-container">
+        <uni-notice-bar class="notice-bar" scrollable="true" single="true" showIcon="true" :speed="50" :text="notice">
+        </uni-notice-bar>
+      </view>
+      <view class="gun">
+        <view v-for="item in cutGasList" @click="selectGas(item)"
+          :class="[item.oilGunId === selectedGas.oilGunId ? 'selected' : '']" :key="item.oilGunId">
+          <text>{{ item.oilGunNo + "号油枪"}}</text>
+          <text>{{item.oilName}}</text>
+        </view>
+        <view @click="openMoreGun" :class="[showMoreGasSelected? 'selected':'']" v-if="cutGasList.length >= 5">
+          <text class="more">更多>></text>
+        </view>
+      </view>
+      <view class="title">
+        <view class="left">
+          输入金额 |
+          <text>建议询问加油员后输入</text>
+        </view>
+      </view>
+      <view class="amount">
+        <view class="inp">
+          <input placeholder="点击输入金额" 
+            confirm-type="done" 
+            type="digit" 
+            step="0.01" 
+            min="0" 
+            @blur="inputAccount"
+            v-model="account"
+           />
+          <text>(元)</text>
+        </view>
+        <view class="btn">
+          <view :class="[item === account ? 'selected' : '']" v-for="item in accountList" :key="item"
+            @click="selectAccount(item)">
+            {{item}}
+          </view>
+        </view>
+      </view>
+      <view class="tip">
+        <image src="../../static/icon/a01-zhuyi.2x.png" mode="scaleToFill"></image>
+        <text>请勿在油机旁使用手机</text>
+      </view>
+      <view class="submit">
+        <button type="default" :class="[avalibleSettle ? 'avalible' : '']" @click="creatOrder" :loading="loading"
+          :disabled="!avalibleSettle || loading">
+          结算
+        </button>
+      </view>
+    </view>
+    <uni-popup ref="popup" type="bottom" :maskClick="true">
+      <view class="more-gun">
+        <view class="title">
+          <text>选择油枪号</text>
+          <view class="icon" @click="closeMoreGun"></view>
+        </view>
+        <view class="gun-list">
+          <scroll-view scroll-y="true">
+            <view v-for="item in gasList" @click="selectGasPopup(item)"
+              :class="[item.oilGunId === selectedGas.oilGunId ? 'selected' : '']" :key="item.oilGunId">
+              <text>{{ item.oilGunNo + "号油枪"}}</text>
+              <text>{{item.oilName}}</text>
+            </view>
+          </scroll-view>
+        </view>
+      </view>
+    </uni-popup>
+  </view>
+</template>
+
+<script>
+  import {
+    mapState,
+    mapMutations
+  } from "vuex";
+  import getPermission from "../../util/permission.js"
+  export default {
+    data() {
+      return {
+        stationPicList: [],
+        notice: '',
+        gasList: [],
+        selectedGas: undefined,
+        accountList: [100, 200, 300, 400],
+        account: "",
+        loading: false,
+      }
+    },
+    created() {
+      this.init()
+    },
+    computed: {
+      ...mapState(["appId", "stationId", "phoneNumber", "countryCode", "purePhoneNumber", "openId", "unionId",
+        "userInfo"
+      ]),
+      cutGasList() {
+        return this.gasList.slice(0, 5)
+      },
+      showMoreGasSelected() {
+        if (!this.selectedGas) {
+          return false
+        }
+        const len = this.cutGasList.filter((ele) => {
+          return ele.oilGunId == this.selectedGas.oilGunId
+        })
+        if (len.length === 0) {
+          return true
+        }
+        return false
+      },
+      avalibleSettle() {
+        return !!this.account && this.account > 0 && !!this.selectedGas
+      }
+    },
+    methods: {
+      ...mapMutations(["updateOrderInfo", "updateSelectedGas"]),
+      init() {
+        // 轮播图
+        this.$Request({
+          url: "/getStationPicList",
+          method: "GET",
+          data: {
+            stationId: this.stationId
+          }
+        }).then((res) => {
+          if (res.retCode === 0) {
+            this.stationPicList = res.data
+          }
+        })
+        // 通知消息
+        this.$Request({
+          url: "/getStationNoticeInfo",
+          method: "GET",
+          data: {
+            stationId: this.stationId
+          }
+        }).then((res) => {
+          if (res.retCode === 0) {
+            this.notice = res.data.notice.toString()
+          }
+        })
+
+        // 获得油枪列表
+        this.$Request({
+          url: "/stationOilGunList",
+          data: {
+            stationId: this.stationId
+          }
+        }).then((res) => {
+          if (res.retCode === 0) {
+            this.gasList = res.data
+          }
+        })
+      },
+      change(e) {
+        this.current = e.detail.current;
+      },
+      openMoreGun() {
+        this.$refs.popup.open()
+      },
+      closeMoreGun() {
+        this.$refs.popup.close()
+      },
+      selectGas(ele) {
+        this.selectedGas = ele
+        this.updateSelectedGas(ele)
+      },
+      selectGasPopup(ele) {
+        this.updateSelectedGas(ele)
+        this.selectedGas = ele
+        this.$refs.popup.close()
+      },
+      selectAccount(ele) {
+        this.account = ele
+      },
+      creatOrder() {
+        if (!getPermission()) {
+          return
+        }
+        this.loading = true
+        uni.showLoading({
+          title: '订单创建中...',
+          mask: true
+        });
+        this.$Request({
+          url: "/AddPayOrderInfoNew",
+          method: "POST",
+          data: {
+            "userType": "2",
+            "openId": this.openId,
+            "stationId": this.stationId,
+            "orderType": this.selectedGas.oilGunType, //油品是1 非油品2
+            "receivableAmt": this.account,
+            "oilName": this.selectedGas.oilName,
+            "payType": "wx", //wx 微信 dzk电子卡
+            "oilGun": this.selectedGas.oilGunNo
+          }
+        }).then((res) => {
+          if (res.retCode === 0) {
+            console.log(res.data)
+            this.updateOrderInfo(res.data)
+            this.loading = false
+            uni.hideLoading();
+            uni.navigateTo({
+              url: "/pages/confirm/confirm"
+            })
+          } else {
+            this.loading = false
+            uni.hideLoading();
+            uni.showToast({
+              title: '创建订单失败'
+            })
+          }
+        }).catch((err) => {
+          uni.showToast({
+            title: '创建订单失败'
+          })
+        }).finally((res) => {
+          this.loading = false
+        })
+      },
+      inputAccount(e) {
+        if(isNaN(+ e.detail.value)){
+          this.account = ''
+          return
+        }
+        this.account = (+ e.detail.value).toFixed(2).toString()
+        // // const reg = /^[1-9]{1,}(\.)?([0-9]{0,2})?/ // 最小数额1
+        // const reg = /^[0-9]{1,}(\.)?([0-9]{0,2})?/  // 不设置最小数额
+        // let res = e.detail.value.match(reg, "");
+        // console.log(this)
+        // console.log(res)
+        // if(res === null){
+        //   this.account = ""
+        //   return
+        // }
+        // res = res[0]
+        // const reg1 = /\.$/
+        // res = + res.replace(reg1, '')
+        // if (res == 0) {
+        //   this.account = ''
+        //   return
+        // }
+        // this.account = res.toString() 
+        // setTimeout(() => {  
+        //   this.account = res.toString() 
+        // }, 0)
+      }
+
+    }
+  }
+</script>
+
+<style lang="scss">
+  page {
+    width: 750rpx;
+
+    .content {
+      swiper {
+        height: 389rpx;
+
+        swiper-item {
+          image {
+            width: 100%;
+            height: 100%;
+            border-radius: 30rpx;
+          }
+        }
+      }
+
+      .box {
+        box-sizing: border-box;
+        width: 750rpx;
+        background: #FFFFFF;
+        border-radius: 36rpx 36rpx 0px 0px;
+        box-shadow: 0 -2rpx 2rpx rgba(0, 0, 0, 0.1);
+        padding: 40rpx;
+        display: flex;
+        flex-direction: column;
+
+        .title {
+          display: flex;
+          justify-content: space-between;
+
+          .left {
+            height: 42rpx;
+            font-size: 32rpx;
+            font-family: PingFangSC-Medium, PingFang SC;
+            font-weight: 600;
+            color: #111111;
+            line-height: 45rpx;
+
+            text {
+              font-weight: 500;
+              color: #b0b0b0;
+              font-size: 28rpx;
+              margin-left: 8rpx;
+            }
+
+            .selected {
+              color: #ff0000;
+              font-weight: 500;
+            }
+          }
+
+          .right {
+            height: 40rpx;
+            font-size: 28rpx;
+            color: #AAAAAA;
+            line-height: 40rpx;
+            margin-top: 4rpx;
+          }
+        }
+
+        .notice-bar-container {
+          margin-top: 20rpx;
+
+          .notice-bar,
+          .uni-noticebar {
+            margin: 0;
+            border-radius: 20rpx;
+            overflow: hidden;
+          }
+        }
+
+        .gun {
+          display: flex;
+          flex-wrap: wrap;
+          justify-content: space-around;
+          align-content: space-around;
+          margin-top: 30rpx;
+
+          view {
+            width: 200rpx;
+            height: 110rpx;
+            background: rgba(255, 255, 255, 0.08);
+            box-shadow: 0px 2rpx 9rpx 4rpx rgba(16, 178, 125, 0.1);
+            border-radius: 12rpx;
+            display: flex;
+            flex-direction: column;
+            justify-content: center;
+            text-align: center;
+            margin-bottom: 20rpx;
+
+            text {
+              font-size: 28rpx;
+              font-weight: 500;
+              color: #666666;
+              line-height: 40rpx;
+            }
+
+            text:nth-child(1) {
+              margin-top: 10rpx;
+              color: #7c7c7c;
+              font-size: 20rpx;
+              line-height: 40rpx;
+            }
+
+            text:nth-child(2) {
+              font-size: 25rpx;
+              line-height: 60rpx;
+              font-weight: 500;
+
+            }
+
+            text.more {
+              font-size: 28rpx;
+              font-weight: 500;
+              color: #000;
+              line-height: 100rpx;
+              margin-top: 0;
+            }
+          }
+
+          view.selected {
+            background-color: #0ea374;
+
+            text {
+              color: #FFFFFF;
+            }
+          }
+        }
+
+        .title:nth-of-type(4) {
+          margin-top: 10rpx;
+        }
+
+        .amount {
+          margin-top: 30rpx;
+
+          .inp {
+            width: 670rpx;
+            height: 100rpx;
+            background: rgba(255, 255, 255, 0.08);
+            box-shadow: 0px 2rpx 9rpx 4rpx rgba(16, 178, 125, 0.1);
+            border-radius: 13rpx;
+            position: relative;
+
+            input {
+              position: absolute;
+              top: 30rpx;
+              left: 30rpx;
+              color: #ff0000;
+              font-weight: 600;
+            }
+
+            text {
+              position: absolute;
+              top: 40rpx;
+              right: 30rpx;
+              width: 56rpx;
+              height: 33rpx;
+              font-size: 24rpx;
+              color: #AAAAAA;
+              line-height: 33rpx;
+            }
+          }
+
+          .btn {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            margin-top: 20rpx;
+
+            view {
+              width: 153rpx;
+              height: 80rpx;
+              background: rgba(255, 255, 255, 0.08);
+              box-shadow: 0px 2rpx 9rpx 4rpx rgba(16, 178, 125, 0.1);
+              border-radius: 13rpx;
+              text-align: center;
+              line-height: 80rpx;
+              font-size: 32rpx;
+              color: #AAAAAA;
+            }
+
+            .selected {
+              background-color: #0ea374;
+              color: #fff;
+            }
+          }
+        }
+
+        .tip {
+          display: flex;
+          justify-content: center;
+          align-items: center;
+          height: 60rpx;
+          margin-top: 20rpx;
+
+          image {
+            display: inline-block;
+            width: 25rpx;
+            height: 25rpx;
+            border-radius: 12.5rpx;
+          }
+
+          text {
+            font-size: 27rpx;
+            color: #DB9D28;
+            line-height: 60rpx;
+            padding: 0;
+            margin: 0;
+          }
+        }
+
+        .submit {
+          height: 80rpx;
+          margin-top: 20rpx;
+
+          button {
+            width: 670rpx;
+            height: 80rpx;
+            background: #CCCCCC;
+            border-radius: 45rpx;
+            font-size: 32rpx;
+            color: #FFFFFF;
+            line-height: 80rpx;
+            text-align: center;
+          }
+
+          button.avalible {
+            background: #0EA374;
+          }
+        }
+
+      }
+    }
+
+    .more-gun {
+      width: 750rpx;
+      max-height: 985rpx;
+      background: #F8F8F8;
+      border-radius: 42rpx 42rpx 0px 0px;
+
+      .title {
+        height: 80rpx;
+        text-align: center;
+        position: relative;
+
+        text {
+          width: 160rpx;
+          font-size: 32rpx;
+          font-weight: 600;
+          color: #111111;
+          line-height: 70rpx;
+        }
+
+        .icon {
+          width: 45rpx;
+          height: 45rpx;
+          background-color: red;
+          background: url(../../static/icon/6_d05_close.2x.png) no-repeat 0px 0px;
+          background-size: 100% 100%;
+          position: absolute;
+          top: 10rpx;
+          right: 40rpx;
+        }
+      }
+
+      .gun-list {
+        margin-top: 20rpx;
+
+        scroll-view {
+          padding: 0 30rpx;
+          max-height: 850rpx;
+
+          view {
+            width: 200rpx;
+            height: 110rpx;
+            background: rgba(255, 255, 255, 0.08);
+            box-shadow: 0px 2rpx 9rpx 4rpx rgba(16, 178, 125, 0.1);
+            border-radius: 12rpx;
+            display: inline-flex;
+            flex-direction: column;
+            justify-content: center;
+            text-align: center;
+            margin: 5rpx 15rpx 40rpx 15rpx;
+
+            text {
+              font-size: 28rpx;
+              font-weight: 500;
+              color: #666666;
+              line-height: 40rpx;
+            }
+
+            text:nth-child(1) {
+              margin-top: 10rpx;
+              color: #7c7c7c;
+              font-size: 20rpx;
+              line-height: 40rpx;
+            }
+
+            text:nth-child(2) {
+              font-size: 25rpx;
+              line-height: 60rpx;
+              font-weight: 500;
+
+            }
+
+            text.more {
+              font-size: 28rpx;
+              font-weight: 500;
+              color: #000;
+              line-height: 100rpx;
+              margin-top: 0;
+            }
+          }
+
+          .selected {
+            background-color: #0ea374;
+
+            text {
+              color: #fff;
+            }
+
+            color: #fff;
+          }
+
+        }
+      }
+
+    }
+
+  }
+</style>

+ 92 - 0
pages/succeed/succeed.vue

@@ -0,0 +1,92 @@
+<template>
+  <view class="succeed">
+    <view class="icon"></view>
+    <view class="text">订单支付成功</view>
+    <!-- #ifdef MP-WEIXIN -->
+    <view class="focus"> 更多优惠,请关注我们的公众号 </view>
+    <official-account class="official"></official-account>
+    <!-- #endif    -->
+    <!--    <view class="menu">
+      <navigator class="text1" url="/pages/index/index">回到首页</navigator>
+      <navigator class="text2" url="/pages/confirm/confirm">回到首页</navigator>
+    </view> -->
+  </view>
+</template>
+
+<script>
+  export default {
+    data() {
+      return {
+
+      }
+    },
+    methods: {
+
+    }
+  }
+</script>
+
+<style lang="scss">
+  page {
+    width: 100vw;
+    height: 100vh;
+
+    .succeed {
+      text-align: center;
+
+      .icon {
+        margin-top: 300rpx;
+        display: inline-block;
+        width: 181rpx;
+        height: 181rpx;
+        background: url(../../static/icon/cg.2x.png) no-repeat 0px 0px;
+        background-size: 100% 100%;
+      }
+
+      .text {
+        margin-top: 20rpx;
+        font-size: 34rpx;
+        font-weight: 600;
+      }
+
+      .focus {
+        margin-top: 100rpx;
+        display: inline-block;
+        font-weight: 500;
+        height: 40rpx;
+        font-size: 28rpx;
+        color: #c4c4c4;
+        line-height: 40rpx;
+      }
+
+      .official {
+        display: inline-block;
+        width: 700rpx;
+        text-align: left;
+      }
+
+      // .menu {
+      //   width: 600rpx;
+      //   height: 150rpx;
+      //   background: #ffffff;
+      //   box-shadow: 0px 2rpx 10rpx 5rpx rgba(227, 227, 227, 0.5);
+      //   border-radius: 20rpx;
+      //   display: flex;
+      //   flex-direction: row;
+      //   justify-content: space-around;
+      //   align-items: center;
+      //   position: absolute;
+      //   top: 50vh;
+      //   left: 10vw;
+
+      //   navigator {
+      //     height: 150rpx;
+      //     font-size: 30rpx;
+      //     font-weight: 500;
+      //     color: #111111;
+      //     line-height: 150rpx;
+      //   }
+      // }
+    }
+  }
+</style>

+ 58 - 0
pages/test/test.vue

@@ -0,0 +1,58 @@
+<template>
+  <view class="content">
+    <button @click="open">打开弹窗</button>
+
+  </view>
+</template>
+<script>
+  import {
+    mapState,
+    mapGetters
+  } from 'vuex'
+  export default {
+    name: "hah",
+    data() {
+      return {
+        code: ""
+      }
+    },
+    async created() {
+      this.$Request({
+        url: "/getStationNoticeInfo",
+        method: 'GET',
+        data: {
+          stationId: this.$store.state.stationId
+        }
+      }).then((res) => {})
+      let [err, loginData] = await uni.login();
+      this.code = loginData.code
+    },
+    computed: {
+      ...mapState({
+        text: state => state.moduleA.text,
+        timestamp: state => state.moduleB.timestamp,
+      }),
+      ...mapState(["appId", "stationId", "phoneNumber", "countryCode", "purePhoneNumber", "openId", "unionId",
+        "userInfo"
+      ]),
+      ...mapGetters([
+        'timeString'
+      ])
+    },
+    methods: {
+      open() {
+        // 通过组件定义的ref调用uni-popup方法
+        this.$refs.popup.open()
+      }
+    }
+  }
+</script>
+<style lang="scss">
+  uni-popup {
+    .pay-type {
+      width: 750rpx;
+      height: 750rpx;
+      background-color: #4CD964;
+    }
+  }
+</style>

+ 38 - 0
settings.js

@@ -0,0 +1,38 @@
+// 接口  定义接口前缀:demo-演示版  api-正式版
+
+
+
+// export const showIndex = false;
+// export const gasupList = true; 
+// 是否开始
+
+// appid
+// 站点Id
+
+// 智慧油驿站
+// 山东石化879站
+
+// export const isDemo = true;
+// export const prefix='demo';
+// export const appId = 'wxe1135cd390b38a54'
+// export const stationId = 1
+
+// export const isDemo = false;
+// export const prefix='api';
+// export const appId = 'wx5285c34adff1069d'
+// export const  stationId = 5;
+
+// export const isDemo = false;
+// export const prefix='demo';
+// export const appId = 'wxe1135cd390b38a54'
+// export const  stationId = 118;
+// const BASE_URL = 'http://localhost:8082'
+
+export default {
+  prefix:"/demo",
+  appId:"wxe1135cd390b38a54",
+  stationId:1,
+  base_url:"https://www.huijy.net"
+} 
+
+

BIN
static/icon/6_d05_close.2x.png


BIN
static/icon/a01-zhuyi.2x.png


BIN
static/icon/cg.2x.png


BIN
static/icon/dingdan.2x.png


BIN
static/icon/forbid.png


BIN
static/icon/huiyuan-.2x.png


BIN
static/icon/left.png


BIN
static/icon/login.png


BIN
static/icon/right.png


BIN
static/icon/select.png


BIN
static/icon/selected.png


BIN
static/icon/sheng.2x.png


BIN
static/icon/tipicon1.png


BIN
static/icon/youhuiquan-2.2x.png


BIN
static/icon/youhuiquan1.2x.png


BIN
static/icon/youhuiquan2.2x.png


BIN
static/icon/youhuiquan3.2x.png


BIN
static/logo.png


+ 66 - 0
store/index.js

@@ -0,0 +1,66 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+import settings from "@/settings.js"
+import moduleA from '@/store/modules/moduleA'
+import moduleB from '@/store/modules/moduleB'
+
+Vue.use(Vuex)
+export default new Vuex.Store({
+  state: {
+    text: "我是moduleA模块下state.text的值",
+    appId: settings.appId,
+    stationId: settings.stationId,
+    phoneNumber:uni.getStorageSync('phoneNumber') || "",
+    countryCode:uni.getStorageSync('countryCode') || "",
+    purePhoneNumber:uni.getStorageSync('purePhoneNumber') || "",
+    openId: uni.getStorageSync('openId') || "",
+    unionId: uni.getStorageSync('unionId') || "",
+    userInfo: !uni.getStorageSync('userInfo') ? {} : JSON.parse(uni.getStorageSync('userInfo')),
+    orderInfo:undefined,
+    selectedGas:undefined
+  },
+  getters: {
+
+  },
+  mutations: {
+    updatePhoneNumber(state, phoneNumber) {
+      uni.setStorageSync('phoneNumber', phoneNumber);
+      state.phoneNumber = phoneNumber
+    },
+    updateCountryCode(state, countryCode) {
+      uni.setStorageSync('countryCode', countryCode);
+      state.countryCode = countryCode
+    },
+    updatePurePhoneNumber(state, purePhoneNumber) {
+      uni.setStorageSync('phoneNumber', phoneNumber);
+      state.purePhoneNumber = purePhoneNumber
+    },
+    updateOpenId(state, openId) { 
+      uni.setStorageSync('openId', openId);
+      state.openId = openId
+    },
+    updateUnionId(state, unionId) { 
+      uni.setStorageSync('unionId', unionId);
+      state.unionId = unionId
+    },
+    updateUserInfo(state, userInfo) {      
+      uni.setStorageSync('userInfo', JSON.stringify(userInfo));
+      state.userInfo = userInfo
+    },
+    updateOrderInfo(state, orderInfo){
+      state.orderInfo = orderInfo
+    },
+    updateSelectedGas(state, selectedGas){
+      state.selectedGas = selectedGas
+    }
+    
+    
+  },
+  actions: {
+
+  },
+  modules: {
+    moduleA,
+    moduleB
+  }
+})

+ 14 - 0
store/modules/moduleA.js

@@ -0,0 +1,14 @@
+export default {
+    state: {
+        text:"我是moduleA模块下state.text的值"
+    },
+    getters: {
+
+    },
+    mutations: {
+
+    },
+    actions: { 
+
+    }
+}

+ 27 - 0
store/modules/moduleB.js

@@ -0,0 +1,27 @@
+export default {
+    state: {
+        timestamp: 1608820295//初始时间戳
+    },
+    getters: {
+        timeString(state) {//时间戳转换后的时间
+            var date = new Date(state.timestamp);
+            var year = date.getFullYear();
+            var mon  = date.getMonth()+1;
+            var day  = date.getDate();
+            var hours = date.getHours();
+            var minu = date.getMinutes();
+            var sec = date.getSeconds();
+            var trMon = mon<10 ? '0'+mon : mon
+            var trDay = day<10 ? '0'+day : day
+            return year+'-'+trMon+'-'+trDay+" "+hours+":"+minu+":"+sec;
+        }
+    },
+    mutations: {
+        updateTime(state){//更新当前时间戳
+            state.timestamp = Date.now()
+        }
+    },
+    actions: {
+
+    }
+}

+ 76 - 0
uni.scss

@@ -0,0 +1,76 @@
+/**
+ * 这里是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;

+ 2 - 0
uni_modules/uni-badge/changelog.md

@@ -0,0 +1,2 @@
+## 1.0.6(2021-02-04)
+- 调整为uni_modules目录规范

+ 156 - 0
uni_modules/uni-badge/components/uni-badge/uni-badge.vue

@@ -0,0 +1,156 @@
+<template>
+	<text v-if="text" :class="inverted ? 'uni-badge--' + type + ' uni-badge--' + size + ' uni-badge--' + type + '-inverted' : 'uni-badge--' + type + ' uni-badge--' + size"
+	 :style="badgeStyle" class="uni-badge" @click="onClick()">{{ text }}</text>
+</template>
+
+<script>
+	/**
+	 * Badge 数字角标
+	 * @description 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=21
+	 * @property {String} text 角标内容
+	 * @property {String} type = [default|primary|success|warning|error] 颜色类型
+	 * 	@value default 灰色
+	 * 	@value primary 蓝色
+	 * 	@value success 绿色
+	 * 	@value warning 黄色
+	 * 	@value error 红色
+	 * @property {String} size = [normal|small] Badge 大小
+	 * 	@value normal 一般尺寸
+	 * 	@value small 小尺寸
+	 * @property {String} inverted = [true|false] 是否无需背景颜色
+	 * @event {Function} click 点击 Badge 触发事件
+	 * @example <uni-badge text="1"></uni-badge>
+	 */
+	export default {
+		name: 'UniBadge',
+		props: {
+			type: {
+				type: String,
+				default: 'default'
+			},
+			inverted: {
+				type: Boolean,
+				default: false
+			},
+			text: {
+				type: [String, Number],
+				default: ''
+			},
+			size: {
+				type: String,
+				default: 'normal'
+			}
+		},
+		data() {
+			return {
+				badgeStyle: ''
+			};
+		},
+		watch: {
+			text() {
+				this.setStyle()
+			}
+		},
+		mounted() {
+			this.setStyle()
+		},
+		methods: {
+			setStyle() {
+				this.badgeStyle = `width: ${String(this.text).length * 8 + 12}px`
+			},
+			onClick() {
+				this.$emit('click');
+			}
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	$bage-size: 12px;
+	$bage-small: scale(0.8);
+	$bage-height: 20px;
+
+	.uni-badge {
+		/* #ifndef APP-PLUS */
+		display: flex;
+		box-sizing: border-box;
+		overflow: hidden;
+		/* #endif */
+		justify-content: center;
+		flex-direction: row;
+		height: $bage-height;
+		line-height: $bage-height;
+		color: $uni-text-color;
+		border-radius: 100px;
+		background-color: $uni-bg-color-hover;
+		background-color: transparent;
+		text-align: center;
+		font-family: 'Helvetica Neue', Helvetica, sans-serif;
+		font-size: $bage-size;
+		padding: 0px 6px;
+		/* #ifdef H5 */
+		cursor: pointer;
+		/* #endif */
+	}
+
+	.uni-badge--inverted {
+		padding: 0 5px 0 0;
+		color: $uni-bg-color-hover;
+	}
+
+	.uni-badge--default {
+		color: $uni-text-color;
+		background-color: $uni-bg-color-hover;
+	}
+
+	.uni-badge--default-inverted {
+		color: $uni-text-color-grey;
+		background-color: transparent;
+	}
+
+	.uni-badge--primary {
+		color: $uni-text-color-inverse;
+		background-color: $uni-color-primary;
+	}
+
+	.uni-badge--primary-inverted {
+		color: $uni-color-primary;
+		background-color: transparent;
+	}
+
+	.uni-badge--success {
+		color: $uni-text-color-inverse;
+		background-color: $uni-color-success;
+	}
+
+	.uni-badge--success-inverted {
+		color: $uni-color-success;
+		background-color: transparent;
+	}
+
+	.uni-badge--warning {
+		color: $uni-text-color-inverse;
+		background-color: $uni-color-warning;
+	}
+
+	.uni-badge--warning-inverted {
+		color: $uni-color-warning;
+		background-color: transparent;
+	}
+
+	.uni-badge--error {
+		color: $uni-text-color-inverse;
+		background-color: $uni-color-error;
+	}
+
+	.uni-badge--error-inverted {
+		color: $uni-color-error;
+		background-color: transparent;
+	}
+
+	.uni-badge--small {
+		transform: $bage-small;
+		transform-origin: center center;
+	}
+</style>

+ 83 - 0
uni_modules/uni-badge/package.json

@@ -0,0 +1,83 @@
+{
+  "id": "uni-badge",
+  "displayName": "Badge 数字角标",
+  "version": "1.0.6",
+  "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
+  "keywords": [
+    "",
+    "badge",
+    "uni-ui",
+    "数字角标",
+    "徽章"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "u",
+          "app-nvue": "u"
+        },
+        "H5-mobile": {
+          "Safari": "u",
+          "Android Browser": "u",
+          "微信浏览器(Android)": "u",
+          "QQ浏览器(Android)": "u"
+        },
+        "H5-pc": {
+          "Chrome": "u",
+          "IE": "u",
+          "Edge": "u",
+          "Firefox": "u",
+          "Safari": "u"
+        },
+        "小程序": {
+          "微信": "u",
+          "阿里": "u",
+          "百度": "u",
+          "字节跳动": "u",
+          "QQ": "u"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 43 - 0
uni_modules/uni-badge/readme.md

@@ -0,0 +1,43 @@
+
+
+## Badge 数字角标
+> 代码块: `uBadge`
+
+
+数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景,
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+### 基本用法
+
+在 ``template`` 中使用组件
+
+```html
+<uni-badge text="1"></uni-badge>
+<uni-badge text="2" type="purple" @click="bindClick"></uni-badge>
+<uni-badge text="3" type="primary" :inverted="true"></uni-badge>
+```
+
+
+## API
+
+### Badge Props
+
+|属性名		|类型		|默认值	|说明																											|
+|:-:		|:-:		|:-:	|:-:					 																						|
+|text		|String		|-		|角标内容																										|
+|type		|String		|default|颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)|
+|size		|String		|normal|Badge 大小,可取值:normal、small|
+|inverted	|Boolean	|false	|是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色														|
+
+### Badge Events
+
+|事件名	|事件说明			|返回参数	|
+|:-:	|:-:				|:-:		|
+|@click	|点击 Badge 触发事件| -			|
+
+

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

@@ -0,0 +1,2 @@
+## 1.3.15(2021-02-04)
+- 调整为uni_modules目录规范 

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

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

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

@@ -0,0 +1,170 @@
+<template>
+	<view class="uni-calendar-item__weeks-box" :class="{
+		'uni-calendar-item--disable':weeks.disable,
+		'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+		'uni-calendar-item--checked':(calendar.fullDate === weeks.fullDate && !weeks.isDay) ,
+		'uni-calendar-item--before-checked':weeks.beforeMultiple,
+		'uni-calendar-item--multiple': weeks.multiple,
+		'uni-calendar-item--after-checked':weeks.afterMultiple,
+		}"
+	 @click="choiceDate(weeks)">
+		<view class="uni-calendar-item__weeks-box-item">
+			<text v-if="selected&&weeks.extraInfo" class="uni-calendar-item__weeks-box-circle"></text>
+			<text class="uni-calendar-item__weeks-box-text" :class="{
+				'uni-calendar-item--isDay-text': weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				'uni-calendar-item--disable':weeks.disable,
+				}">{{weeks.date}}</text>
+			<text v-if="!lunar&&!weeks.extraInfo && weeks.isDay" class="uni-calendar-item__weeks-lunar-text" :class="{
+				'uni-calendar-item--isDay-text':weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				}">今天</text>
+			<text v-if="lunar&&!weeks.extraInfo" class="uni-calendar-item__weeks-lunar-text" :class="{
+				'uni-calendar-item--isDay-text':weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				'uni-calendar-item--disable':weeks.disable,
+				}">{{weeks.isDay?'今天': (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text>
+			<text v-if="weeks.extraInfo&&weeks.extraInfo.info" class="uni-calendar-item__weeks-lunar-text" :class="{
+				'uni-calendar-item--extra':weeks.extraInfo.info,
+				'uni-calendar-item--isDay-text':weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				'uni-calendar-item--disable':weeks.disable,
+				}">{{weeks.extraInfo.info}}</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			weeks: {
+				type: Object,
+				default () {
+					return {}
+				}
+			},
+			calendar: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			},
+			selected: {
+				type: Array,
+				default: () => {
+					return []
+				}
+			},
+			lunar: {
+				type: Boolean,
+				default: false
+			}
+		},
+		methods: {
+			choiceDate(weeks) {
+				this.$emit('change', weeks)
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.uni-calendar-item__weeks-box {
+		flex: 1;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.uni-calendar-item__weeks-box-text {
+		font-size: $uni-font-size-base;
+		color: $uni-text-color;
+	}
+
+	.uni-calendar-item__weeks-lunar-text {
+		font-size: $uni-font-size-sm;
+		color: $uni-text-color;
+	}
+
+	.uni-calendar-item__weeks-box-item {
+		position: relative;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		width: 100rpx;
+		height: 100rpx;
+	}
+
+	.uni-calendar-item__weeks-box-circle {
+		position: absolute;
+		top: 5px;
+		right: 5px;
+		width: 8px;
+		height: 8px;
+		border-radius: 8px;
+		background-color: $uni-color-error;
+
+	}
+
+	.uni-calendar-item--disable {
+		background-color: rgba(249, 249, 249, $uni-opacity-disabled);
+		color: $uni-text-color-disable;
+	}
+
+	.uni-calendar-item--isDay-text {
+		color: $uni-color-primary;
+	}
+
+	.uni-calendar-item--isDay {
+		background-color: $uni-color-primary;
+		opacity: 0.8;
+		color: #fff;
+	}
+
+	.uni-calendar-item--extra {
+		color: $uni-color-error;
+		opacity: 0.8;
+	}
+
+	.uni-calendar-item--checked {
+		background-color: $uni-color-primary;
+		color: #fff;
+		opacity: 0.8;
+	}
+
+	.uni-calendar-item--multiple {
+		background-color: $uni-color-primary;
+		color: #fff;
+		opacity: 0.8;
+	}
+	.uni-calendar-item--before-checked {
+		background-color: #ff5a5f;
+		color: #fff;
+	}
+	.uni-calendar-item--after-checked {
+		background-color: #ff5a5f;
+		color: #fff;
+	}
+</style>

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

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

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

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

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

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

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

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

+ 2 - 0
uni_modules/uni-card/changelog.md

@@ -0,0 +1,2 @@
+## 1.1.6(2021-02-04)
+- 调整为uni_modules目录规范

+ 406 - 0
uni_modules/uni-card/components/uni-card/uni-card.vue

@@ -0,0 +1,406 @@
+<template>
+	<view class="uni-card uni-border" :class="{ 'uni-card--full': isFull === true || isFull === 'true', 'uni-card--shadow': isShadow === true || isShadow === 'true'}">
+		<!-- 基础 -->
+		<view v-if="mode === 'basic' && title" class="uni-card__header uni-border-bottom" @click.stop="onClick">
+			<view v-if="thumbnail" class="uni-card__header-extra-img-view">
+				<image :src="thumbnail" class="uni-card__header-extra-img" />
+			</view>
+			<text class="uni-card__header-title-text">{{ title }}</text>
+			<text v-if="extra" class="uni-card__header-extra-text">{{ extra }}</text>
+		</view>
+		<!-- 标题 -->
+		<view v-if="mode === 'title'" class="uni-card__title uni-border-bottom" @click.stop="onClick">
+			<view class="uni-card__title-box">
+				<view class="uni-card__title-header">
+					<image class="uni-card__title-header-image" :src="thumbnail" mode="scaleToFill" />
+				</view>
+				<view class="uni-card__title-content">
+					<text class="uni-card__title-content-title uni-ellipsis">{{ title }}</text>
+					<text class="uni-card__title-content-extra uni-ellipsis">{{ subTitle }}</text>
+				</view>
+			</view>
+			<view v-if="extra">
+				<text class="uni-card__header-extra-text">{{ extra }}</text>
+			</view>
+		</view>
+		<!-- 图文 -->
+		<view v-if="mode === 'style'" class="uni-card__thumbnailimage" @click.stop="onClick">
+			<view class="uni-card__thumbnailimage-box">
+				<image class="uni-card__thumbnailimage-image" :src="thumbnail" mode="aspectFill" />
+			</view>
+			<view v-if="title" class="uni-card__thumbnailimage-title"><text class="uni-card__thumbnailimage-title-text">{{ title }}</text></view>
+		</view>
+		<!-- 内容 -->
+		<view class="uni-card__content uni-card__content--pd" @click.stop="onClick">
+			<view v-if="mode === 'style' && extra" class=""><text class="uni-card__content-extra">{{ extra }}</text></view>
+			<slot />
+		</view>
+		<!-- 底部 -->
+		<view v-if="note" class="uni-card__footer uni-border-top">
+			<slot name="footer">
+				<text class="uni-card__footer-text">{{ note }}</text>
+			</slot>
+		</view>
+	</view>
+</template>
+
+<script>
+	/**
+	 * Card 卡片
+	 * @description 卡片视图组件
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=22
+	 * @property {String} title 标题文字
+	 * @property {String} subTitle 副标题(仅仅mode=title下生效)
+	 * @property {String} extra 标题额外信息
+	 * @property {String} note 标题左侧缩略图
+	 * @property {String} thumbnail 底部信息
+	 * @property {String} mode = [basic|style|title] 卡片模式
+	 * 	@value basic 基础卡片
+	 * 	@value style 图文卡片
+	 * 	@value title 标题卡片
+	 * @property {Boolean} isFull = [true | false] 卡片内容是否通栏,为 true 时将去除padding值
+	 * @property {Boolean} isShadow = [true | false] 卡片内容是否开启阴影
+	 * @event {Function} click 点击 Card 触发事件
+	 * @example <uni-card title="标题文字" thumbnail="xxx.jpg" extra="额外信息" note="Tips">内容主体,可自定义内容及样式</uni-card>
+	 */
+	export default {
+		name: 'UniCard',
+		props: {
+			title: {
+				type: String,
+				default: ''
+			},
+			subTitle: {
+				type: String,
+				default: ''
+			},
+			extra: {
+				type: String,
+				default: ''
+			},
+			note: {
+				type: String,
+				default: ''
+			},
+			thumbnail: {
+				type: String,
+				default: ''
+			},
+			mode: {
+				type: String,
+				default: 'basic'
+			},
+			isFull: {
+				// 内容区域是否通栏
+				type: Boolean,
+				default: false
+			},
+			isShadow: {
+				// 是否开启阴影
+				type: [Boolean, String],
+				default: false
+			}
+		},
+		methods: {
+			onClick() {
+				this.$emit('click')
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.uni-card {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		flex: 1;
+		box-shadow: 0 0 0 rgba(0, 0, 0, 0);
+		/* #endif */
+		margin: $uni-spacing-col-lg $uni-spacing-row-lg;
+		background-color: $uni-bg-color;
+		position: relative;
+		flex-direction: column;
+		border-radius: 5px;
+		overflow: hidden;
+		/* #ifdef H5 */
+		cursor: pointer;
+		/* #endif */
+	}
+
+
+
+	.uni-border {
+		position: relative;
+		/* #ifdef APP-NVUE */
+		border-color: $uni-border-color;
+		border-style: solid;
+		border-width: 0.5px;
+		/* #endif */
+		z-index: 1;
+	}
+
+	/* #ifndef APP-NVUE */
+	.uni-border:after {
+		content: '';
+		position: absolute;
+		bottom: 0;
+		left: 0;
+		top: 0;
+		right: 0;
+		border: 1px solid $uni-border-color;
+		border-radius: 10px;
+		box-sizing: border-box;
+		width: 200%;
+		height: 200%;
+		transform: scale(0.5);
+		transform-origin: left top;
+		z-index: -1;
+	}
+
+	/* #endif */
+
+	.uni-border-bottom {
+		position: relative;
+		/* #ifdef APP-NVUE */
+		border-bottom-color: $uni-border-color;
+		border-bottom-style: solid;
+		border-bottom-width: 0.5px;
+		/* #endif */
+		z-index: 1;
+	}
+
+	/* #ifndef APP-NVUE */
+	.uni-border-bottom:after {
+		content: '';
+		position: absolute;
+		bottom: 0;
+		left: 0;
+		top: 0;
+		right: 0;
+		border-bottom: 1px solid $uni-border-color;
+		box-sizing: border-box;
+		width: 200%;
+		height: 200%;
+		transform: scale(0.5);
+		transform-origin: left top;
+		z-index: -1;
+	}
+
+	/* #endif */
+	.uni-border-top {
+		position: relative;
+		/* #ifdef APP-NVUE */
+		border-top-color: $uni-border-color;
+		border-top-style: solid;
+		border-top-width: 0.5px;
+		/* #endif */
+		z-index: 1;
+	}
+
+	/* #ifndef APP-NVUE */
+	.uni-border-top:after {
+		content: '';
+		position: absolute;
+		bottom: 0;
+		left: 0;
+		top: 0;
+		right: 0;
+		border-top: 1px solid $uni-border-color;
+		box-sizing: border-box;
+		width: 200%;
+		height: 200%;
+		transform: scale(0.5);
+		transform-origin: left top;
+		z-index: -1;
+	}
+
+	/* #endif */
+
+	.uni-card__thumbnailimage {
+		position: relative;
+		flex-direction: column;
+		justify-content: center;
+		height: 150px;
+		overflow: hidden;
+	}
+
+	.uni-card__thumbnailimage-box {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex: 1;
+		flex-direction: row;
+		overflow: hidden;
+	}
+
+	.uni-card__thumbnailimage-image {
+		flex: 1;
+	}
+
+	.uni-card__thumbnailimage-title {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		position: absolute;
+		bottom: 0;
+		left: 0;
+		right: 0;
+		flex-direction: row;
+		padding: $uni-spacing-col-base $uni-spacing-col-lg;
+		background-color: $uni-bg-color-mask;
+	}
+
+	.uni-card__thumbnailimage-title-text {
+		flex: 1;
+		font-size: $uni-font-size-base;
+		color: #fff;
+	}
+
+	.uni-card__title {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		align-items: center;
+		padding: 10px;
+
+	}
+
+	.uni-card__title-box {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex: 1;
+		flex-direction: row;
+		align-items: center;
+		overflow: hidden;
+	}
+
+	.uni-card__title-header {
+		width: 40px;
+		height: 40px;
+		overflow: hidden;
+		border-radius: 5px;
+	}
+
+	.uni-card__title-header-image {
+		width: 40px;
+		height: 40px;
+	}
+
+	.uni-card__title-content {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		justify-content: center;
+		flex: 1;
+		padding-left: 10px;
+		height: 40px;
+		overflow: hidden;
+	}
+
+	.uni-card__title-content-title {
+		font-size: $uni-font-size-base;
+		line-height: 22px;
+	}
+
+	.uni-card__title-content-extra {
+		font-size: $uni-font-size-sm;
+		line-height: 27px;
+		color: $uni-text-color-grey;
+	}
+
+	.uni-card__header {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		position: relative;
+		flex-direction: row;
+		padding: $uni-spacing-col-lg;
+		align-items: center;
+	}
+
+	.uni-card__header-title {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		margin-right: $uni-spacing-col-base;
+		justify-content: flex-start;
+		align-items: center;
+	}
+
+	.uni-card__header-title-text {
+		font-size: $uni-font-size-lg;
+		flex: 1;
+		color: #333;
+	}
+
+	.uni-card__header-extra-img {
+		height: $uni-img-size-sm;
+		width: $uni-img-size-sm;
+		margin-right: $uni-spacing-col-base;
+	}
+
+	.uni-card__header-extra-text {
+		flex: 1;
+		margin-left: $uni-spacing-col-base;
+		font-size: $uni-font-size-sm;
+		text-align: right;
+		color: $uni-text-color-grey;
+	}
+
+	.uni-card__content {
+		color: $uni-text-color;
+	}
+
+	.uni-card__content--pd {
+		padding: $uni-spacing-col-lg;
+	}
+
+	.uni-card__content-extra {
+		font-size: $uni-font-size-base;
+		padding-bottom: 10px;
+		color: $uni-text-color-grey;
+	}
+
+	.uni-card__footer {
+		justify-content: space-between;
+		padding: $uni-spacing-col-lg;
+	}
+
+	.uni-card__footer-text {
+		color: $uni-text-color-grey;
+		font-size: $uni-font-size-sm;
+	}
+
+	.uni-card--shadow {
+		position: relative;
+		/* #ifndef APP-NVUE */
+		box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.1);
+		/* #endif */
+	}
+
+	.uni-card--full {
+		margin: 0;
+		border-radius: 0;
+	}
+
+	/* #ifndef APP-NVUE */
+	.uni-card--full:after {
+		border-radius: 0;
+	}
+
+	/* #endif */
+	.uni-ellipsis {
+		/* #ifndef APP-NVUE */
+		overflow: hidden;
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		/* #endif */
+		/* #ifdef APP-NVUE */
+		lines: 1;
+		/* #endif */
+	}
+</style>

+ 81 - 0
uni_modules/uni-card/package.json

@@ -0,0 +1,81 @@
+{
+  "id": "uni-card",
+  "displayName": "Card 卡片",
+  "version": "1.1.6",
+  "description": "Card 组件,提供常见的卡片样式。",
+  "keywords": [
+    "card",
+    "uni-ui",
+    "卡片"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 97 - 0
uni_modules/uni-card/readme.md

@@ -0,0 +1,97 @@
+
+
+## Card 卡片
+> 代码块: `uCard`
+
+
+卡片视图组件。
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
+> - 因为平台兼容问题 , 目前 APP-NVUE 安卓平台下不支持阴影
+
+
+### 基本用法
+
+在 ``template`` 中使用组件
+
+```html
+<!-- 一般用法 -->
+<uni-card title="标题文字" thumbnail="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" extra="额外信息" note="Tips">
+    内容主体,可自定义内容及样式
+</uni-card>
+
+<!-- 内容通栏 -->
+<uni-card is-full="true" title="DCloud" thumbnail="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" extra="2018.12.12" >
+    <image src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" style="width: 100%;"></image>
+</uni-card>
+
+<!-- 图文卡片模式 -->
+<uni-card
+	title="标题文字"
+	mode="style"
+	:is-shadow="true"
+	thumbnail="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
+	extra="Dcloud 2019-05-20 12:32:19"
+	note="Tips"
+>
+		uni-app 是一个使用 Vue.js 开发所有前端应用的框架,开发者编写一套代码,可编译到iOS、Android、H5、以及各种小程序等多个平台。即使不跨端,uni-app同时也是更好的小程序开发框架。
+</uni-card>
+
+<!-- 标题卡片模式 -->
+<uni-card 
+	title="Dcloud" 
+	mode="title" 
+	:is-shadow="true" 
+	thumbnail="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" 
+	extra="技术没有上限" 
+	note="Tips"
+>
+	uni-app 是一个使用 Vue.js 开发所有前端应用的框架,开发者编写一套代码,可编译到iOS、Android、H5、以及各种小程序等多个平台。即使不跨端,uni-app同时也是更好的小程序开发框架。
+</uni-card>
+
+<!-- 自定义底部按钮 -->
+<uni-card title="Dcloud" note="true">
+	默认内容
+	<template v-slot:footer>
+		<view class="footer-box">
+			<view>喜欢</view>
+			<view>评论</view>
+			<view>分享</view>
+		</view>
+	</template>
+</uni-card>
+```
+
+## API
+
+### Card Props
+
+|属性名			|类型		|默认值	|说明																			|
+|:-:				|:-:		|:-:		|:-:																			|
+|title			|String	|-			|标题文字																			|
+|extra			|String	|-			|标题额外信息																		|
+|note				|String	|-			|底部信息																			|
+|thumbnail	|String	|-			|标题左侧缩略图,支持网络图片,本地图片,本图片需要传入一个绝对路径,如:`/static/xxx.png`	|
+|mode				|String	|basic	|卡片模式 ,可选值, basic:基础卡片 ;style :图文卡片 ; title :标题卡片				|
+|isFull			|Boolean|false	|卡片内容是否通栏,为true时将去除padding值											|
+|isShadow		|Boolean|false	|卡片内容是否开启阴影																|
+
+
+### Card Events
+
+|事件称名	|事件说明						|返回参数	|
+|:-:		|:-:							|:-:		|
+|@click	|点击 Card 触发事件	|-			|
+
+
+### Card Slots
+
+|插槽称名	|说明				|
+|:-:		|:-:				|
+|footer	|卡片底部插槽 |

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

@@ -0,0 +1,4 @@
+## 1.1.6(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+## 1.1.5(2021-02-05)
+- 调整为uni_modules目录规范

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

@@ -0,0 +1,220 @@
+<template>
+	<view :class="{ 'uni-collapse-cell--disabled': disabled,'uni-collapse-cell--notdisabled': !disabled, 'uni-collapse-cell--open': isOpen,'uni-collapse-cell--hide':!isOpen }"
+	 class="uni-collapse-cell">
+		<view :class="{ 'uni-collapse-cell--disabled': disabled}" class="uni-collapse-cell__title"  @click="onClick">
+			<image v-if="thumb" :src="thumb" class="uni-collapse-cell__title-img" />
+			<text class="uni-collapse-cell__title-text">{{ title }}</text>
+			<!-- #ifdef MP-ALIPAY -->
+			<view :class="{ 'uni-collapse-cell__title-arrow-active': isOpen, 'uni-collapse-cell--animation': showAnimation === true }"
+			 class="uni-collapse-cell__title-arrow">
+				<uni-icons color="#bbb" size="20" type="arrowdown" />
+			</view>
+			<!-- #endif -->
+			<!-- #ifndef MP-ALIPAY -->
+			<uni-icons :class="{ 'uni-collapse-cell__title-arrow-active': isOpen, 'uni-collapse-cell--animation': showAnimation === true }"
+			 class="uni-collapse-cell__title-arrow" color="#bbb" size="20" type="arrowdown" />
+			<!-- #endif -->
+		</view>
+		<view :class="{'uni-collapse-cell__content--hide':!isOpen}" class="uni-collapse-cell__content">
+			<view :class="{ 'uni-collapse-cell--animation': showAnimation === true }" class="uni-collapse-cell__wrapper" :style="{'transform':isOpen?'translateY(0)':'translateY(-50%)','-webkit-transform':isOpen?'translateY(0)':'translateY(-50%)'}">
+				<slot />
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	/**
+	 * CollapseItem 折叠面板子组件
+	 * @description 折叠面板子组件
+	 * @property {String} title 标题文字
+	 * @property {String} thumb 标题左侧缩略图
+	 * @property {Boolean} disabled = [true|false] 是否展开面板
+	 * @property {Boolean} showAnimation = [true|false] 开启动画
+	 */
+	export default {
+		name: 'UniCollapseItem',
+		props: {
+			title: {
+				// 列表标题
+				type: String,
+				default: ''
+			},
+			name: {
+				// 唯一标识符
+				type: [Number, String],
+				default: 0
+			},
+			disabled: {
+				// 是否禁用
+				type: Boolean,
+				default: false
+			},
+			showAnimation: {
+				// 是否显示动画
+				type: Boolean,
+				default: false
+			},
+			open: {
+				// 是否展开
+				type: Boolean,
+				default: false
+			},
+			thumb: {
+				// 缩略图
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				isOpen: false
+			}
+		},
+		watch: {
+			open(val) {
+				this.isOpen = val
+			}
+		},
+		inject: ['collapse'],
+		created() {
+			this.isOpen = this.open
+			this.nameSync = this.name ? this.name : this.collapse.childrens.length
+			this.collapse.childrens.push(this)
+			if (String(this.collapse.accordion) === 'true') {
+				if (this.isOpen) {
+					let lastEl = this.collapse.childrens[this.collapse.childrens.length - 2]
+					if (lastEl) {
+						this.collapse.childrens[this.collapse.childrens.length - 2].isOpen = false
+					}
+				}
+			}
+		},
+		methods: {
+			onClick() {
+				if (this.disabled) {
+					return
+				}
+				if (String(this.collapse.accordion) === 'true') {
+					this.collapse.childrens.forEach(vm => {
+						if (vm === this) {
+							return
+						}
+						vm.isOpen = false
+					})
+				}
+				this.isOpen = !this.isOpen
+				this.collapse.onChange && this.collapse.onChange()
+				this.$forceUpdate()
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.uni-collapse-cell {
+		flex-direction: column;
+		border-color: $uni-border-color;
+		border-bottom-width: 1px;
+		border-bottom-style: solid;
+	}
+
+
+	.uni-collapse-cell--hover {
+		background-color: $uni-bg-color-hover;
+	}
+
+	.uni-collapse-cell--open {
+		background-color: $uni-bg-color-hover;
+	}
+
+	.uni-collapse-cell--disabled {
+		background-color: $uni-bg-color-hover;
+		/* #ifdef H5 */
+		cursor: not-allowed !important;
+		/* #endif */
+		// opacity: 0.3;
+	}
+
+
+	.uni-collapse-cell--hide {
+		height: 48px;
+	}
+
+	.uni-collapse-cell--animation {
+		// transition: transform 0.3s ease;
+		transition-property: transform;
+		transition-duration: 0.3s;
+		transition-timing-function: ease;
+	}
+
+	.uni-collapse-cell__title {
+		padding: 12px 12px;
+		position: relative;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		width: 100%;
+		box-sizing: border-box;
+		/* #endif */
+		height: 48px;
+		line-height: 24px;
+		flex-direction: row;
+		justify-content: space-between;
+		align-items: center;
+		/* #ifdef H5 */
+		cursor: pointer;
+		/* #endif */
+	}
+
+	.uni-collapse-cell__title:active {
+		background-color: $uni-bg-color-hover;
+	}
+
+	.uni-collapse-cell__title-img {
+		height: $uni-img-size-base;
+		width: $uni-img-size-base;
+		margin-right: 10px;
+	}
+
+	.uni-collapse-cell__title-arrow {
+		width: 20px;
+		height: 20px;
+		transform: rotate(0deg);
+		transform-origin: center center;
+
+	}
+
+	.uni-collapse-cell__title-arrow-active {
+		transform: rotate(180deg);
+	}
+
+	.uni-collapse-cell__title-text {
+		flex: 1;
+		font-size: $uni-font-size-base;
+		/* #ifndef APP-NVUE */
+		white-space: nowrap;
+		color: inherit;
+		/* #endif */
+		/* #ifdef APP-NVUE */
+		lines: 1;
+		/* #endif */
+		overflow: hidden;
+		text-overflow: ellipsis;
+	}
+
+	.uni-collapse-cell__content {
+		overflow: hidden;
+	}
+
+	.uni-collapse-cell__wrapper {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+	}
+
+	.uni-collapse-cell__content--hide {
+		height: 0px;
+		line-height: 0px;
+	}
+</style>

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

@@ -0,0 +1,59 @@
+<template>
+	<view class="uni-collapse">
+		<slot />
+	</view>
+</template>
+<script>
+	/**
+	 * Collapse 折叠面板
+	 * @description 展示可以折叠 / 展开的内容区域
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=23
+	 * @property {Boolean} accordion = [true|false] 是否开启手风琴效果是否开启手风琴效果
+	 * @event {Function} change 切换面板时触发,activeNames(Array):展开状态的uniCollapseItem的 name 值
+	 */
+	export default {
+		name: 'UniCollapse',
+		props: {
+			accordion: {
+				// 是否开启手风琴效果
+				type: [Boolean, String],
+				default: false
+			}
+		},
+		data() {
+			return {}
+		},
+		provide() {
+			return {
+				collapse: this
+			}
+		},
+		created() {
+			this.childrens = []
+		},
+		methods: {
+			onChange() {
+				let activeItem = []
+				this.childrens.forEach((vm, index) => {
+					if (vm.isOpen) {
+						activeItem.push(vm.nameSync)
+					}
+				})
+				this.$emit('change', activeItem)
+			}
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	.uni-collapse {
+		/* #ifndef APP-NVUE */
+		width: 100%;
+		display: flex;
+		/* #endif */
+		/* #ifdef APP-NVUE */
+		flex: 1;
+		/* #endif */
+		flex-direction: column;
+		background-color: $uni-bg-color;
+	}
+</style>

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

@@ -0,0 +1,84 @@
+{
+  "id": "uni-collapse",
+  "displayName": "Collapse 折叠面板",
+  "version": "1.1.6",
+  "description": " collapse uni-ui 折叠面板 手风琴",
+  "keywords": [
+    "Collapse",
+    "组件,可以折叠",
+    "/",
+    "展开的内容区域。"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [
+      "uni-icons"
+    ],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 107 - 0
uni_modules/uni-collapse/readme.md

@@ -0,0 +1,107 @@
+
+
+## Collapse 折叠面板
+> 代码块: `uCollapse`
+> 关联组件:`uni-collapse-item`、`uni-icons`。
+
+
+展示可以折叠 / 展开的内容区域。
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+### 基本用法
+
+在 ``template`` 中引用组件 
+
+```html
+<!-- 一般用法 -->
+<uni-collapse @change="change">
+    <uni-collapse-item title="标题文字">
+        <uni-list>
+            <uni-list-item title="标题文字" thumb="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"></uni-list-item>
+            <uni-list-item title="标题文字" note="描述信息" thumb="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"></uni-list-item>
+            <uni-list-item title="标题文字" note="描述信息" show-extra-icon="true" :extra-icon="{color: '#4cd964',size: '22',type: 'spinner'}"></uni-list-item>
+        </uni-list>
+    </uni-collapse-item>
+    <uni-collapse-item title="默认开启" open="true">
+        <view style="padding: 30rpx;"> 折叠内容主体,可自定义内容及样式 </view>
+    </uni-collapse-item>
+    <uni-collapse-item title="禁用状态" disabled="true">
+        <view style="padding: 30rpx;"> 禁用状态 </view>
+    </uni-collapse-item>
+</uni-collapse>
+
+<!-- 手风琴效果 -->
+<uni-collapse accordion="true">
+    <uni-collapse-item title="标题文字">
+        <view style="padding: 30rpx;">
+            手风琴效果
+        </view>
+    </uni-collapse-item>
+    <uni-collapse-item title="标题文字">
+        <view style="padding: 30rpx;">
+            手风琴效果
+        </view>
+    </uni-collapse-item>
+    <uni-collapse-item title="标题文字">
+        <view style="padding: 30rpx;">
+            手风琴效果
+        </view>
+    </uni-collapse-item>
+</uni-collapse>
+
+<!-- 带图标 -->
+<uni-collapse>
+    <uni-collapse-item title="标题文字" thumb="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png">
+        <view style="padding: 30rpx;">
+            折叠内容主体,可自定义内容及样式
+        </view>
+    </uni-collapse-item>
+    <uni-collapse-item title="标题文字" thumb="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png">
+        <view style="padding: 30rpx;">
+            折叠内容主体,可自定义内容及样式
+        </view>
+    </uni-collapse-item>
+</uni-collapse>
+```
+
+## API
+
+### Collapse Props
+
+|属性名		|类型	|默认值	|说明				|
+|:-:		|:-:	|:-:	|:-:				|
+|accordion	|Boolean|false	|是否开启手风琴效果	|
+
+
+### Collapse Event
+
+|事件称名	|说明			|返回值												|
+|:-:		|:-:			:-:													|
+|@change	|切换面板时触发	|activeNames(Array):展开状态的uniCollapseItem的name值|
+
+
+### Collapse Methods
+
+|方法名称	|说明														|
+|:-:		|:-:														|
+|resize	|更新当前列表高度,只有 `animation:true` 下生效|
+
+
+> - resize 方法解决动态添加数据,带动画的折叠面板高度不更新的问题
+> - 需要在数据渲染完毕之后使用 `resize` 方法。推荐在 `this.nextTick()` 中使用
+
+
+### CollapseItem Props
+
+|属性名		|类型	|默认值	|说明			|
+|:-:		|:-:	|:-:	|:-:			|
+|title		|String	|-		|标题文字		|
+|thumb		|String	|-		|标题左侧缩略图	|
+|disabled	|Boolean|false	|是否禁用		|
+|open		|Boolean|false	|是否展开面板	|
+|showAnimation	|Boolean	|false	|开启动画		|

+ 4 - 0
uni_modules/uni-combox/changelog.md

@@ -0,0 +1,4 @@
+## 0.0.4(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+## 0.0.3(2021-02-04)
+- 调整为uni_modules目录规范

+ 210 - 0
uni_modules/uni-combox/components/uni-combox/uni-combox.vue

@@ -0,0 +1,210 @@
+<template>
+	<view class="uni-combox">
+		<view v-if="label" class="uni-combox__label" :style="labelStyle">
+			<text>{{label}}</text>
+		</view>
+		<view class="uni-combox__input-box">
+			<input class="uni-combox__input" type="text" :placeholder="placeholder" v-model="inputVal" @input="onInput"
+			 @focus="onFocus" @blur="onBlur" />
+			<uni-icons class="uni-combox__input-arrow" type="arrowdown" size="14" @click="toggleSelector"></uni-icons>
+			<view class="uni-combox__selector" v-if="showSelector">
+				<scroll-view scroll-y="true" class="uni-combox__selector-scroll">
+					<view class="uni-combox__selector-empty" v-if="filterCandidatesLength === 0">
+						<text>{{emptyTips}}</text>
+					</view>
+					<view class="uni-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index" @click="onSelectorClick(index)">
+						<text>{{item}}</text>
+					</view>
+				</scroll-view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	/**
+	 * Combox 组合输入框
+	 * @description 组合输入框一般用于既可以输入也可以选择的场景
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=1261
+	 * @property {String} label 左侧文字
+	 * @property {String} labelWidth 左侧内容宽度
+	 * @property {String} placeholder 输入框占位符
+	 * @property {Array} candidates 候选项列表
+	 * @property {String} emptyTips 筛选结果为空时显示的文字
+	 * @property {String} value 组合框的值
+	 */
+	export default {
+		name: 'uniCombox',
+		props: {
+			label: {
+				type: String,
+				default: ''
+			},
+			labelWidth: {
+				type: String,
+				default: 'auto'
+			},
+			placeholder: {
+				type: String,
+				default: ''
+			},
+			candidates: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			emptyTips: {
+				type: String,
+				default: '无匹配项'
+			},
+			value: {
+				type: [String, Number],
+				default: ''
+			}
+		},
+		data() {
+			return {
+				showSelector: false,
+				inputVal: ''
+			}
+		},
+		computed: {
+			labelStyle() {
+				if (this.labelWidth === 'auto') {
+					return {}
+				}
+				return {
+					width: this.labelWidth
+				}
+			},
+			filterCandidates() {
+				return this.candidates.filter((item) => {
+					return item.toString().indexOf(this.inputVal) > -1
+				})
+			},
+			filterCandidatesLength() {
+				return this.filterCandidates.length
+			}
+		},
+		watch: {
+			value: {
+				handler(newVal) {
+					this.inputVal = newVal
+				},
+				immediate: true
+			}
+		},
+		methods: {
+			toggleSelector() {
+				this.showSelector = !this.showSelector
+			},
+			onFocus() {
+				this.showSelector = true
+			},
+			onBlur() {
+				setTimeout(() => {
+					this.showSelector = false
+				}, 153)
+			},
+			onSelectorClick(index) {
+				this.inputVal = this.filterCandidates[index]
+				this.showSelector = false
+				this.$emit('input', this.inputVal)
+			},
+			onInput() {
+				setTimeout(() => {
+					this.$emit('input', this.inputVal)
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.uni-combox {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		height: 40px;
+		flex-direction: row;
+		align-items: center;
+		// border-bottom: solid 1px #DDDDDD;
+	}
+
+	.uni-combox__label {
+		font-size: 16px;
+		line-height: 22px;
+		padding-right: 10px;
+		color: #999999;
+	}
+
+	.uni-combox__input-box {
+		position: relative;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex: 1;
+		flex-direction: row;
+		align-items: center;
+	}
+
+	.uni-combox__input {
+		flex: 1;
+		font-size: 16px;
+		height: 22px;
+		line-height: 22px;
+	}
+
+	.uni-combox__input-arrow {
+		padding: 10px;
+	}
+
+	.uni-combox__selector {
+		box-sizing: border-box;
+		position: absolute;
+		top: 42px;
+		left: 0;
+		width: 100%;
+		background-color: #FFFFFF;
+		border-radius: 6px;
+		box-shadow: #DDDDDD 4px 4px 8px, #DDDDDD -4px -4px 8px;
+		z-index: 2;
+	}
+
+	.uni-combox__selector-scroll {
+		max-height: 200px;
+		box-sizing: border-box;
+	}
+
+	.uni-combox__selector::before {
+		content: '';
+		position: absolute;
+		width: 0;
+		height: 0;
+		border-bottom: solid 6px #FFFFFF;
+		border-right: solid 6px transparent;
+		border-left: solid 6px transparent;
+		left: 50%;
+		top: -6px;
+		margin-left: -6px;
+	}
+
+	.uni-combox__selector-empty,
+	.uni-combox__selector-item {
+		/* #ifdef APP-NVUE */
+		display: flex;
+		/* #endif */
+		line-height: 36px;
+		font-size: 14px;
+		text-align: center;
+		border-bottom: solid 1px #DDDDDD;
+		margin: 0px 10px;
+		cursor: pointer;
+	}
+
+	.uni-combox__selector-empty:last-child,
+	.uni-combox__selector-item:last-child {
+		border-bottom: none;
+	}
+</style>

+ 82 - 0
uni_modules/uni-combox/package.json

@@ -0,0 +1,82 @@
+{
+  "id": "uni-combox",
+  "displayName": "Combox 组合框",
+  "version": "0.0.4",
+  "description": "可以选择也可以输入的表单项 ",
+  "keywords": [
+    "combox",
+    "组合框",
+    "可下拉输入框",
+    "select"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "n"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 46 - 0
uni_modules/uni-combox/readme.md

@@ -0,0 +1,46 @@
+
+
+## Combox 组合框
+> 代码块: `uCombox`
+
+
+组合框组件。
+
+### 平台兼容性说明
+
+**暂不支持nvue**
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+### 基本用法
+
+在 ``template`` 中使用组件
+```html
+<uni-combox label="所在城市" :candidates="candidates" placeholder="请选择所在城市" v-model="city"></uni-combox>
+```
+
+## API
+
+### Combox Props
+
+|属性名		|类型			|默认值		|说明								|
+|:-:		|:-:			|:-:		|:-:								|
+|label		|String			|-			|标签文字							|
+|value		|String			|-			|combox的值							|
+|labelWidth	|String			|auto		|标签宽度,有单位字符串,如:'100px'	|
+|placeholder|String			|-			|输入框占位符						|
+|candidates	|Array/String	|[]			|候选字段							|
+|emptyTips	|String			|无匹配项	|无匹配项时的提示语					|
+
+### Combox Events
+
+|事件称名	|说明					|返回值												|
+|:-:		|:-:					|:-:													|
+|@input	|combox输入事件	|返回combox值|
+
+
+

+ 2 - 0
uni_modules/uni-countdown/changelog.md

@@ -0,0 +1,2 @@
+## 1.0.2(2021-02-04)
+- 调整为uni_modules目录规范

+ 211 - 0
uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue

@@ -0,0 +1,211 @@
+<template>
+	<view class="uni-countdown">
+		<text v-if="showDay" :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ d }}</text>
+		<text v-if="showDay" :style="{ color: splitorColor }" class="uni-countdown__splitor">天</text>
+		<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ h }}</text>
+		<text :style="{ color: splitorColor }" class="uni-countdown__splitor">{{ showColon ? ':' : '时' }}</text>
+		<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ i }}</text>
+		<text :style="{ color: splitorColor }" class="uni-countdown__splitor">{{ showColon ? ':' : '分' }}</text>
+		<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ s }}</text>
+		<text v-if="!showColon" :style="{ color: splitorColor }" class="uni-countdown__splitor">秒</text>
+	</view>
+</template>
+<script>
+	/**
+	 * Countdown 倒计时
+	 * @description 倒计时组件
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=25
+	 * @property {String} backgroundColor 背景色
+	 * @property {String} color 文字颜色
+	 * @property {Number} day 天数
+	 * @property {Number} hour 小时
+	 * @property {Number} minute 分钟
+	 * @property {Number} second 秒
+	 * @property {Number} timestamp 时间戳
+	 * @property {Boolean} showDay = [true|false] 是否显示天数
+	 * @property {Boolean} showColon = [true|false] 是否以冒号为分隔符
+	 * @property {String} splitorColor 分割符号颜色
+	 * @event {Function} timeup 倒计时时间到触发事件
+	 * @example <uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>
+	 */
+	export default {
+		name: 'UniCountdown',
+		props: {
+			showDay: {
+				type: Boolean,
+				default: true
+			},
+			showColon: {
+				type: Boolean,
+				default: true
+			},
+			backgroundColor: {
+				type: String,
+				default: '#FFFFFF'
+			},
+			borderColor: {
+				type: String,
+				default: '#000000'
+			},
+			color: {
+				type: String,
+				default: '#000000'
+			},
+			splitorColor: {
+				type: String,
+				default: '#000000'
+			},
+			day: {
+				type: Number,
+				default: 0
+			},
+			hour: {
+				type: Number,
+				default: 0
+			},
+			minute: {
+				type: Number,
+				default: 0
+			},
+			second: {
+				type: Number,
+				default: 0
+			},
+			timestamp: {
+				type: Number,
+				default: 0
+			}
+		},
+		data() {
+			return {
+				timer: null,
+				syncFlag: false,
+				d: '00',
+				h: '00',
+				i: '00',
+				s: '00',
+				leftTime: 0,
+				seconds: 0
+			}
+		},
+		watch: {
+			day(val) {
+				this.changeFlag()
+			},
+			hour(val) {
+				this.changeFlag()
+			},
+			minute(val) {
+				this.changeFlag()
+			},
+			second(val) {
+				this.changeFlag()
+			}
+		},
+		created: function(e) {
+			this.startData();
+		},
+		beforeDestroy() {
+			clearInterval(this.timer)
+		},
+		methods: {
+			toSeconds(timestamp, day, hours, minutes, seconds) {
+				if (timestamp) {
+					return timestamp - parseInt(new Date().getTime() / 1000, 10)
+				}
+				return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds
+			},
+			timeUp() {
+				clearInterval(this.timer)
+				this.$emit('timeup')
+			},
+			countDown() {
+				let seconds = this.seconds
+				let [day, hour, minute, second] = [0, 0, 0, 0]
+				if (seconds > 0) {
+					day = Math.floor(seconds / (60 * 60 * 24))
+					hour = Math.floor(seconds / (60 * 60)) - (day * 24)
+					minute = Math.floor(seconds / 60) - (day * 24 * 60) - (hour * 60)
+					second = Math.floor(seconds) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60)
+				} else {
+					this.timeUp()
+				}
+				if (day < 10) {
+					day = '0' + day
+				}
+				if (hour < 10) {
+					hour = '0' + hour
+				}
+				if (minute < 10) {
+					minute = '0' + minute
+				}
+				if (second < 10) {
+					second = '0' + second
+				}
+				this.d = day
+				this.h = hour
+				this.i = minute
+				this.s = second
+			},
+			startData() {
+				this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
+				if (this.seconds <= 0) {
+					return
+				}
+				this.countDown()
+				this.timer = setInterval(() => {
+					this.seconds--
+					if (this.seconds < 0) {
+						this.timeUp()
+						return
+					}
+					this.countDown()
+				}, 1000)
+			},
+			changeFlag() {
+				if (!this.syncFlag) {
+					this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
+					this.startData();
+					this.syncFlag = true;
+				}
+			}
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	$countdown-height: 48rpx;
+	$countdown-width: 52rpx;
+
+	.uni-countdown {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: flex-start;
+		padding: 2rpx 0;
+	}
+
+	.uni-countdown__splitor {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		justify-content: center;
+		line-height: $countdown-height;
+		padding: 5rpx;
+		font-size: $uni-font-size-sm;
+	}
+
+	.uni-countdown__number {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		justify-content: center;
+		align-items: center;
+		width: $countdown-width;
+		height: $countdown-height;
+		line-height: $countdown-height;
+		margin: 5rpx;
+		text-align: center;
+		font-size: $uni-font-size-sm;
+	}
+</style>

+ 81 - 0
uni_modules/uni-countdown/package.json

@@ -0,0 +1,81 @@
+{
+  "id": "uni-countdown",
+  "displayName": "Countdown 倒计时",
+  "version": "1.0.2",
+  "description": "CountDown 倒计时组件",
+  "keywords": [
+    "countdown",
+    "uni-ui",
+    "倒计时"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 50 - 0
uni_modules/uni-countdown/readme.md

@@ -0,0 +1,50 @@
+
+
+## CountDown 倒计时
+> 代码块: `uCountDown`
+
+
+倒计时组件。
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+### 基本用法
+
+在 ``template`` 中使用组件
+
+```html
+<!-- 一般用法 -->
+<uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>
+
+<!-- 不显示天数 -->
+<uni-countdown :show-day="false" :hour="12" :minute="12" :second="12"></uni-countdown>
+
+<!-- 修改颜色 -->
+<uni-countdown color="#FFFFFF" background-color="#00B26A" border-color="#00B26A" :day="1" :hour="2" :minute="30" :second="0"></uni-countdown>
+```
+
+## API
+
+### Countdown Props 
+
+|属性名				|类型	|默认值	|说明				|
+|:-:				|:-:	|:-:	|:-:				|
+|backgroundColor	|String	|#FFFFFF|背景色				|
+|color				|String	|#000000|文字颜色			|
+|splitorColor		|String	|#000000|分割符号颜色			|
+|day				|Number	|0		|天数				|
+|hour				|Number	|0		|小时				|
+|minute				|Number	|0		|分钟				|
+|second				|Number	|0		|秒					|
+|showDay			|Boolean|true	|是否显示天数		|
+|showColon			|Boolean|true	|是否以冒号为分隔符	|
+
+### Countdown Events
+
+|事件称名	|说明							|返回值	|
+|:-:		|:-:							|:-:		|
+|@timeup|倒计时时间到触发事件	|-			|

+ 8 - 0
uni_modules/uni-data-checkbox/changelog.md

@@ -0,0 +1,8 @@
+## 0.1.3(2021-03-22)
+- 新增 disabled属性
+## 0.1.2(2021-02-24)
+- 优化 默认颜色显示
+## 0.1.1(2021-02-24)
+- 新增 支持nvue
+## 0.1.0(2021-02-18)
+- “暂无数据”显示居中

+ 785 - 0
uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue

@@ -0,0 +1,785 @@
+<template>
+	<view class="uni-data-checklist">
+		<template v-if="!isLocal">
+			<view class="uni-data-loading">
+				<uni-load-more v-if="!mixinDatacomErrorMessage" status="loading" iconType="snow" :iconSize="18" :content-text="contentText"></uni-load-more>
+				<text v-else>{{mixinDatacomErrorMessage}}</text>
+			</view>
+		</template>
+		<template v-else>
+			<checkbox-group v-if="multiple" class="checklist-group" :class="{'is-list':mode==='list' || wrap}" @change="chagne">
+				<!-- :class="item.labelClass"  -->
+				<label class="checklist-box" :class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
+				 :style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
+					<checkbox class="hidden" hidden :disabled="disabled || !!item.disabled" :value="item.value+''" :checked="item.selected" />
+					<!-- :style="item.styleIcon" -->
+
+					<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="checkbox__inner"  :style="item.styleIcon">
+						<!-- :class="item.checkboxClass" -->
+						<view class="checkbox__inner-icon"></view>
+					</view>
+					<view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}">
+						<!-- :class="item.textClass" -->
+						<text class="checklist-text" :style="item.styleIconText">{{item.text}}</text>
+						<!-- :class="item.listClass"  -->
+						<view v-if="mode === 'list' && icon === 'right'" class="checkobx__list" :style="item.styleBackgroud"></view>
+					</view>
+				</label>
+			</checkbox-group>
+			<radio-group v-else class="checklist-group" :class="{'is-list':mode==='list','is-wrap':wrap}" @change="chagne">
+				<!-- -->
+				<label class="checklist-box" :class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
+				 :style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
+					<radio class="hidden" hidden :disabled="disabled || item.disabled" :value="item.value+''" :checked="item.selected" />
+					<!-- :class="item.checkboxBgClass"  -->
+					<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="radio__inner"
+					 :style="item.styleBackgroud">
+						<!-- :class="item.checkboxClass"  -->
+						<view class="radio__inner-icon" :style="item.styleIcon"></view>
+					</view>
+					<view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}">
+						<!-- :class="item.textClass" -->
+						<text class="checklist-text" :style="item.styleIconText">{{item.text}}</text>
+						<!-- :class="item.listClass" -->
+						<view v-if="mode === 'list' && icon === 'right'" :style="item.styleRightIcon" class="checkobx__list"></view>
+					</view>
+				</label>
+			</radio-group>
+		</template>
+	</view>
+</template>
+
+<script>
+	/**
+	 * DataChecklist 数据选择器
+	 * @description 通过数据渲染 checkbox 和 radio
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=xxx
+	 * @property {String} mode = [default| list | button | tag] 显示模式
+	 * @value default  	默认横排模式
+	 * @value list		列表模式
+	 * @value button	按钮模式
+	 * @value tag 		标签模式
+	 * @property {Boolean} multiple = [true|false] 是否多选
+	 * @property {Array|String|Number} value 默认值
+	 * @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
+	 * @property {Number|String} min 最小选择个数 ,multiple为true时生效
+	 * @property {Number|String} max 最大选择个数 ,multiple为true时生效
+	 * @property {Boolean} wrap 是否换行显示
+	 * @property {String} icon = [left|right]  list 列表模式下icon显示位置
+	 * @property {Boolean} selectedColor 选中颜色
+	 * @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
+	 * @property {Boolean} selectedTextColor 选中文本颜色,如不填写则自动显示
+	 * @value left 左侧显示
+	 * @value right 右侧显示
+	 * @event {Function} change  选中发生变化触发
+	 */
+
+	// import clientdb from './clientdb.js'
+	export default {
+		name: 'uniDataChecklist',
+		// mixins: [clientdb],
+		mixins: [uniCloud.mixinDatacom],
+		props: {
+			mode: {
+				type: String,
+				default: 'default'
+			},
+			multiple: {
+				type: Boolean,
+				default: false
+			},
+			value: {
+				type: [Array, String, Number],
+				default () {
+					return ''
+				}
+			},
+			localdata: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			min: {
+				type: [Number, String],
+				default: ''
+			},
+			max: {
+				type: [Number, String],
+				default: ''
+			},
+			wrap: {
+				type: Boolean,
+				default: false
+			},
+			icon: {
+				type: String,
+				default: 'left'
+			},
+			selectedColor: {
+				type: String,
+				default: '#007aff'
+			},
+			selectedTextColor: {
+				type: String,
+				default: '#333'
+			},
+			emptyText:{
+				type: String,
+				default: '暂无数据'
+			},
+			disabled:{
+				type: Boolean,
+				default: false
+			}
+		},
+		watch: {
+			localdata: {
+				handler(newVal) {
+					this.range = newVal
+					this.dataList = this.getDataList(this.getSelectedValue(newVal))
+				},
+				deep: true
+			},
+			mixinDatacomResData(newVal) {
+				this.range = newVal
+				this.dataList = this.getDataList(this.getSelectedValue(newVal))
+			},
+			value(newVal) {
+				this.dataList = this.getDataList(newVal)
+				this.formItem && this.formItem.setValue(newVal)
+			}
+		},
+		data() {
+			return {
+				dataList: [],
+				range: [],
+				contentText: {
+					contentdown: '查看更多',
+					contentrefresh: '加载中',
+					contentnomore: '没有更多'
+				},
+				isLocal:true,
+				styles: {
+					selectedColor: '#007aff',
+					selectedTextColor: '#333',
+				}
+			};
+		},
+		created() {
+			this.form = this.getForm('uniForms')
+			this.formItem = this.getForm('uniFormsItem')
+			this.formItem && this.formItem.setValue(this.value)
+
+			if (this.formItem) {
+				if (this.formItem.name) {
+					this.rename = this.formItem.name
+					this.form.inputChildrens.push(this)
+				}
+			}
+
+			if (this.localdata && this.localdata.length !== 0) {
+				this.isLocal = true
+				this.range = this.localdata
+				this.dataList = this.getDataList(this.getSelectedValue(this.range))
+			} else {
+				if (this.collection) {
+					this.isLocal = false
+					this.loadData()
+				}
+			}
+		},
+		methods: {
+			loadData() {
+				this.mixinDatacomGet().then(res=>{
+					this.mixinDatacomResData = res.result.data
+					if(this.mixinDatacomResData.length === 0){
+						this.isLocal = false
+						this.mixinDatacomErrorMessage = this.emptyText
+					}else{
+						this.isLocal = true
+					}
+				}).catch(err=>{
+					this.mixinDatacomErrorMessage = err.message
+				})
+			},
+			/**
+			 * 获取父元素实例
+			 */
+			getForm(name = 'uniForms') {
+				let parent = this.$parent;
+				let parentName = parent.$options.name;
+				while (parentName !== name) {
+					parent = parent.$parent;
+					if (!parent) return false
+					parentName = parent.$options.name;
+				}
+				return parent;
+			},
+			chagne(e) {
+				const values = e.detail.value
+
+				let detail = {
+					value: [],
+					data: []
+				}
+
+				if (this.multiple) {
+					this.range.forEach(item => {
+						if (values.includes(item.value + '')) {
+							detail.value.push(item.value)
+							detail.data.push(item)
+						}
+					})
+				} else {
+					const range = this.range.find(item => (item.value + '') === values)
+					if (range) {
+						detail = {
+							value: range.value,
+							data: range
+						}
+					}
+				}
+				this.formItem && this.formItem.setValue(detail.value)
+				this.$emit('input', detail.value)
+				this.$emit('change', {
+					detail
+				})
+				if (this.multiple) {
+					// 如果 v-model 没有绑定 ,则走内部逻辑
+					// if (this.value.length === 0) {
+					this.dataList = this.getDataList(detail.value, true)
+					// }
+				} else {
+					this.dataList = this.getDataList(detail.value)
+				}
+			},
+
+			/**
+			 * 获取渲染的新数组
+			 * @param {Object} value 选中内容
+			 */
+			getDataList(value) {
+				// 解除引用关系,破坏原引用关系,避免污染源数据
+				let dataList = JSON.parse(JSON.stringify(this.range))
+				let list = []
+				if (this.multiple) {
+					if (!Array.isArray(value)) {
+						value = []
+					}
+				}
+				dataList.forEach((item, index) => {
+					item.disabled = item.disable || item.disabled || false
+					if (this.multiple) {
+						if (value.length > 0) {
+							let have = value.find(val => val === item.value)
+							item.selected = have !== undefined
+						} else {
+							item.selected = false
+						}
+					} else {
+						item.selected = value === item.value
+					}
+
+					list.push(item)
+				})
+				return this.setRange(list)
+			},
+			/**
+			 * 处理最大最小值
+			 * @param {Object} list
+			 */
+			setRange(list) {
+				let selectList = list.filter(item => item.selected)
+				let min = Number(this.min) || 0
+				let max = Number(this.max) || ''
+				list.forEach((item, index) => {
+					if (this.multiple) {
+						if (selectList.length <= min) {
+							let have = selectList.find(val => val.value === item.value)
+							if (have !== undefined) {
+								item.disabled = true
+							}
+						}
+
+						if (selectList.length >= max && max !== '') {
+							let have = selectList.find(val => val.value === item.value)
+							if (have === undefined) {
+								item.disabled = true
+							}
+						}
+					}
+					this.setStyles(item, index)
+					list[index] = item
+				})
+				return list
+			},
+			/**
+			 * 设置 class
+			 * @param {Object} item
+			 * @param {Object} index
+			 */
+			setStyles(item, index) {
+				//  设置自定义样式
+				item.styleBackgroud = this.setStyleBackgroud(item)
+				item.styleIcon = this.setStyleIcon(item)
+				item.styleIconText = this.setStyleIconText(item)
+				item.styleRightIcon = this.setStyleRightIcon(item)
+
+			},
+
+			/**
+			 * 获取选中值
+			 * @param {Object} range
+			 */
+			getSelectedValue(range) {
+				if (!this.multiple) return this.value
+				let selectedArr = []
+				range.forEach((item) => {
+					if (item.selected) {
+						selectedArr.push(item.value)
+					}
+				})
+				return this.value.length > 0 ? this.value : selectedArr
+			},
+
+			/**
+			 * 设置背景样式
+			 */
+			setStyleBackgroud(item) {
+				let styles = {}
+				// if (item.selected) {
+					if (this.mode !== 'list') {
+						styles['border-color'] = item.selected?this.selectedColor:'#DCDFE6'
+					}
+					if (this.mode === 'tag') {
+						styles['background-color'] = item.selected? this.selectedColor:'#f5f5f5'
+					}
+				// }
+				let classles = ''
+				for (let i in styles) {
+					classles += `${i}:${styles[i]};`
+				}
+				return classles
+			},
+			setStyleIcon(item) {
+				let styles = {}
+				let classles = ''
+				// if (item.selected) {
+					styles['background-color'] = item.selected?this.selectedColor:'#fff'
+					styles['border-color'] = item.selected?this.selectedColor:'#DCDFE6'
+
+					if(!item.selected && item.disabled){
+						styles['background-color'] = '#F2F6FC'
+						styles['border-color'] = item.selected?this.selectedColor:'#DCDFE6'
+					}
+
+					for (let i in styles) {
+						classles += `${i}:${styles[i]};`
+					}
+				// }
+				return classles
+			},
+			setStyleIconText(item) {
+				let styles = {}
+				let classles = ''
+				// if (item.selected) {
+					// if (this.selectedTextColor) {
+					// 	styles.color = item.selected?this.selectedTextColor:'#999'
+					// } else {
+						if (this.mode === 'tag') {
+							styles.color = item.selected?'#fff':'#333'
+
+						} else {
+							styles.color = item.selected?this.selectedColor:'#333'
+						}
+						if(!item.selected && item.disabled){
+							styles.color = '#999'
+						}
+					// }
+					for (let i in styles) {
+						classles += `${i}:${styles[i]};`
+					}
+				// }
+
+				return classles
+			},
+			setStyleRightIcon(item) {
+				let styles = {}
+				let classles = ''
+				// if (item.selected) {
+					if (this.mode === 'list') {
+						styles['border-color'] = item.selected?this.styles.selectedColor:'#DCDFE6'
+					}
+					for (let i in styles) {
+						classles += `${i}:${styles[i]};`
+					}
+				// }
+
+				return classles
+			}
+			// setColor(){
+			// 	return
+			// }
+		}
+	}
+</script>
+
+<style lang="scss">
+	$checked-color: #007aff;
+	$border-color: #DCDFE6;
+	$disable:0.4;
+
+	@mixin flex {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+	}
+
+	.uni-data-loading {
+		@include flex;
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		height: 36px;
+		padding-left: 10px;
+		color: #999;
+	}
+
+	.uni-data-checklist {
+		position: relative;
+		z-index: 0;
+
+		// 多选样式
+		.checklist-group {
+			@include flex;
+			flex-direction: row;
+			flex-wrap: wrap;
+
+			&.is-list {
+				flex-direction: column;
+			}
+
+			.checklist-box {
+				@include flex;
+				flex-direction: row;
+				align-items: center;
+				position: relative;
+				margin: 5px 0;
+				margin-right: 25px;
+
+				.hidden {
+					position: absolute;
+					transform: scale(0);
+					opacity: 0;
+				}
+
+				// 文字样式
+				.checklist-content {
+					@include flex;
+					flex: 1;
+					flex-direction: row;
+					align-items: center;
+					justify-content: space-between;
+					.checklist-text {
+						font-size: 14px;
+						color: #333;
+						margin-left: 5px;
+						line-height: 14px;
+					}
+
+					// .list-content {
+					// 	margin-left: 15px;
+					// }
+					.checkobx__list {
+						border: 1px solid #fff;
+						border-left: 0;
+						border-top: 0;
+						height: 12px;
+						width: 6px;
+						transform-origin: center;
+						transform: rotate(45deg);
+						opacity: 0;
+					}
+				}
+
+				// 多选样式
+				.checkbox__inner {
+					/* #ifndef APP-NVUE */
+					flex-shrink: 0;
+					box-sizing: border-box;
+					/* #endif */
+					position: relative;
+					width: 16px;
+					height: 16px;
+					border: 1px solid $border-color;
+					border-radius: 2px;
+					background-color: #fff;
+					z-index: 1;
+					.checkbox__inner-icon {
+						position: absolute;
+						/* #ifdef APP-NVUE */
+						top: 2px;
+						/* #endif */
+						/* #ifndef APP-NVUE */
+						top: 1px;
+						/* #endif */
+						left: 5px;
+						height: 8px;
+						width: 4px;
+						border: 1px solid #fff;
+						border-left: 0;
+						border-top: 0;
+						opacity: 0;
+						transform-origin: center;
+						transform: rotate(40deg);
+					}
+				}
+
+				// 单选样式
+				.radio__inner {
+					@include flex;
+					/* #ifndef APP-NVUE */
+					flex-shrink: 0;
+					box-sizing: border-box;
+					/* #endif */
+					justify-content: center;
+					align-items: center;
+					position: relative;
+					width: 16px;
+					height: 16px;
+					border: 1px solid $border-color;
+					border-radius: 16px;
+					background-color: #fff;
+					z-index: 1;
+
+					.radio__inner-icon {
+						width: 8px;
+						height: 8px;
+						border-radius: 10px;
+						opacity: 0;
+					}
+				}
+
+				// 默认样式
+				&.is--default {
+
+					// 禁用
+					&.is-disable {
+						/* #ifdef H5 */
+						cursor: not-allowed;
+						/* #endif */
+						.checkbox__inner {
+							background-color: #F2F6FC;
+							border-color: $border-color;
+							/* #ifdef H5 */
+							cursor: not-allowed;
+							/* #endif */
+						}
+
+						.radio__inner {
+							background-color: #F2F6FC;
+							border-color: $border-color;
+						}
+						.checklist-text {
+							color: #999;
+						}
+					}
+
+					// 选中
+					&.is-checked {
+						.checkbox__inner {
+							border-color: $checked-color;
+							background-color: $checked-color;
+
+							.checkbox__inner-icon {
+								opacity: 1;
+								transform: rotate(45deg);
+							}
+						}
+						.radio__inner {
+							border-color: $checked-color;
+							.radio__inner-icon {
+								opacity: 1;
+								background-color: $checked-color;
+							}
+						}
+						.checklist-text {
+							color: $checked-color;
+						}
+						// 选中禁用
+						&.is-disable {
+							.checkbox__inner {
+								opacity: $disable;
+							}
+
+							.checklist-text {
+								opacity: $disable;
+							}
+						}
+					}
+				}
+
+				// 按钮样式
+				&.is--button {
+					margin-right: 10px;
+					padding: 5px 15px;
+					border: 1px $border-color solid;
+					border-radius: 3px;
+					transition: border-color 0.2s;
+
+					// 禁用
+					&.is-disable {
+						/* #ifdef H5 */
+						cursor: not-allowed;
+						/* #endif */
+						border: 1px #eee solid;
+						opacity: $disable;
+						.checkbox__inner {
+							background-color: #F2F6FC;
+							border-color: $border-color;
+							/* #ifdef H5 */
+							cursor: not-allowed;
+							/* #endif */
+						}
+						.radio__inner {
+							background-color: #F2F6FC;
+							border-color: $border-color;
+							/* #ifdef H5 */
+							cursor: not-allowed;
+							/* #endif */
+						}
+						.checklist-text {
+							color: #999;
+						}
+					}
+
+					&.is-checked {
+						border-color: $checked-color;
+						.checkbox__inner {
+							border-color: $checked-color;
+							background-color: $checked-color;
+							.checkbox__inner-icon {
+								opacity: 1;
+								transform: rotate(45deg);
+							}
+						}
+
+						.radio__inner {
+							border-color: $checked-color;
+
+							.radio__inner-icon {
+								opacity: 1;
+								background-color: $checked-color;
+							}
+						}
+
+						.checklist-text {
+							color: $checked-color;
+						}
+
+						// 选中禁用
+						&.is-disable {
+							opacity: $disable;
+						}
+					}
+				}
+
+				// 标签样式
+				&.is--tag {
+					margin-right: 10px;
+					padding: 5px 10px;
+					border: 1px $border-color solid;
+					border-radius: 3px;
+					background-color: #f5f5f5;
+
+					.checklist-text {
+						margin: 0;
+						color: #333;
+					}
+
+					// 禁用
+					&.is-disable {
+						/* #ifdef H5 */
+						cursor: not-allowed;
+						/* #endif */
+						opacity: $disable;
+					}
+
+					&.is-checked {
+						background-color: $checked-color;
+						border-color: $checked-color;
+
+						.checklist-text {
+							color: #fff;
+						}
+					}
+				}
+
+				&.is--list {
+					/* #ifndef APP-NVUE */
+					display: flex;
+					/* #endif */
+					padding: 10px 15px;
+					padding-left: 0;
+					margin: 0;
+
+					&.is-list-border {
+						border-top: 1px #eee solid;
+					}
+
+					// 禁用
+					&.is-disable {
+						/* #ifdef H5 */
+						cursor: not-allowed;
+						/* #endif */
+						.checkbox__inner {
+							background-color: #F2F6FC;
+							border-color: $border-color;
+							/* #ifdef H5 */
+							cursor: not-allowed;
+							/* #endif */
+						}
+						.checklist-text {
+							color: #999;
+						}
+					}
+
+					&.is-checked {
+						.checkbox__inner {
+							border-color: $checked-color;
+							background-color: $checked-color;
+
+							.checkbox__inner-icon {
+								opacity: 1;
+								transform: rotate(45deg);
+							}
+						}
+
+						.checklist-text {
+							color: $checked-color;
+						}
+
+						.checklist-content {
+							.checkobx__list {
+								opacity: 1;
+								border-color: $checked-color;
+							}
+						}
+
+						// 选中禁用
+						&.is-disable {
+							.checkbox__inner {
+								opacity: $disable;
+							}
+
+							.checklist-text {
+								opacity: $disable;
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+</style>

+ 81 - 0
uni_modules/uni-data-checkbox/package.json

@@ -0,0 +1,81 @@
+{
+  "id": "uni-data-checkbox",
+  "displayName": "DataCheckbox 数据选择器",
+  "version": "0.1.3",
+  "description": "通过数据驱动的单选框和复选框",
+  "keywords": [
+    "checkbox",
+    "uni-data-checkbox",
+    "单选多选"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": "^3.1.1"
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": ["uni-load-more"],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 291 - 0
uni_modules/uni-data-checkbox/readme.md

@@ -0,0 +1,291 @@
+
+
+## DataCheckbox 数据驱动的单选复选框
+> 代码块: `uDataCheckbox`
+
+
+本组件是基于uni-app基础组件checkbox的封装。本组件要解决问题包括:
+
+1. 数据绑定型组件:给本组件绑定一个data,会自动渲染一组候选内容。再以往,开发者需要编写不少代码实现类似功能
+2. 自动的表单校验:组件绑定了data,且符合[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)组件的表单校验规范,搭配使用会自动实现表单校验
+3. 本组件合并了单选多选
+4. 本组件有若干风格选择,如普通的单选多选框、并列button风格、tag风格。开发者可以快速选择需要的风格。但作为一个封装组件,样式代码虽然不用自己写了,却会牺牲一定的样式自定义性
+
+在uniCloud开发中,`DB Schema`中配置了enum枚举等类型后,在web控制台的[自动生成表单](https://uniapp.dcloud.io/uniCloud/schema?id=autocode)功能中,会自动生成``uni-data-checkbox``组件并绑定好data
+
+> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
+> - 组件需要依赖 `sass` 插件 ,请自行手动安装
+> - 本组件为数据驱动,目的是快速投入使用,只可通过 style 覆盖有限样式,不支持自定义更多样式
+> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
+> - 组件支持 nvue ,需要在 `manifest.json > app-plus` 节点下配置 `"nvueStyleCompiler" : "uni-app"` 
+> - 如组件显示有问题 ,请升级 `HBuilderX` 为 `v3.1.0` 以上
+
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另行文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+### 基本用法
+
+设置 `localdata` 属性后,组件会通过数据渲染出对应的内容,默认显示的是单选框 
+
+需要注意 `:multiple="false"` 时(单选) , `value/v-model` 的值是 `String|Number` 类型
+
+```html
+<template>
+	<view>
+		<uni-data-checkbox v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
+	</view>
+</template>
+
+```
+
+```javascript
+
+export default {
+	data() { 
+		return {
+			value: 0,
+			range: [{"value": 0,"text": "篮球"	},{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}]
+		}
+	},
+	methods: {
+		change(e){
+			console.log('e:',e);
+		}
+	}
+}
+```
+
+### 多选框
+
+设置 `multiple` 属性,组件显示为多选框
+
+需要注意 `:multiple="true"` 时(多选) , `value/v-model` 的值是 `Array` 类型
+
+```html
+<template>
+	<view>
+		<uni-data-checkbox multiple v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
+	</view>
+</template>
+
+```
+
+```javascript
+
+export default {
+	data() { 
+		return {
+			value: [0,2],
+			range: [{"value": 0,"text": "篮球"	},{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}]
+		}
+	},
+	methods: {
+		change(e){
+			console.log('e:',e);
+		}
+	}
+}
+```
+
+### 设置最大最小值
+
+设置 `:multiple="true"` 时(多选) ,可以设置 `min`、`max` 属性 
+
+如果选中个数小于 `min` 属性设置的值,那么选中内容将不可取消,只有当选中个数大于等于 `min`且小于 `max` 时,才可取消选中
+
+如果选中个数大于等于 `max` 属性设置的值,那么其他未选中内容将不可选
+
+```html
+<template>
+	<view>
+		<uni-data-checkbox min="1" max="2" multiple v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
+	</view>
+</template>
+
+```
+
+```javascript
+
+export default {
+	data() { 
+		return {
+			value: [0,2],
+			range: [{"value": 0,"text": "篮球"	},{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}]
+		}
+	},
+	methods: {
+		change(e){
+			console.log('e:',e);
+		}
+	}
+}
+```
+
+### 设置禁用
+
+如果需要禁用某项,需要在 `localdata` 属性的数据源中添加 `disable` 属性,而不是在组件中添加 `disable` 属性
+
+```html
+<template>
+	<view>
+		<uni-data-checkbox v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
+	</view>
+</template>
+
+```
+
+```javascript
+
+export default {
+	data() { 
+		return {
+			value: 0,
+			range: [{
+					"value": 0,
+					"text": "篮球"
+				},
+				{
+					"value": 1,
+					"text": "足球",
+					// 禁用当前项
+					"disable":true
+				},
+				{
+					"value": 2,
+					"text": "游泳"
+				}
+			]
+		}
+	},
+	methods: {
+		change(e){
+			console.log('e:',e);
+		}
+	}
+}
+```
+
+
+### 自定义选中颜色
+
+设置 `selectedColor` 属性,可以修改组件选中后的图标及边框颜色
+
+设置 `selectedTextColor` 属性,可以修改组件选中后的文字颜色,如不填写默认同 `selectedColor` 属性 ,`mode` 属性为 `tag` 时,默认为白色
+
+```html
+<template>
+	<view>
+		<uni-data-checkbox selectedColor="red" selectedTextColor="red" multiple v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
+	</view>
+</template>
+
+```
+
+```javascript
+
+export default {
+	data() { 
+		return {
+			value: [0,2],
+			range: [{"value": 0,"text": "篮球"	},{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}]
+		}
+	},
+	methods: {
+		change(e){
+			console.log('e:',e);
+		}
+	}
+}
+```
+
+### 更多模式
+
+设置 `mode` 属性,可以设置更多显示样式,目前内置样式有四种 `default/list/button/tag` 
+
+如果需要禁用某项,需要在 `localdata` 属性的数据源中添加 `disable` 属性,而不是在组件中添加 `disable` 属性
+
+```html
+<template>
+	<view>
+		<!-- 默认 default -->
+		<uni-data-checkbox v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
+		<!-- 列表 list ,显示左侧图标 -->
+		<uni-data-checkbox mode="list" icon="left" v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
+		<!-- 列表 list ,显示右侧图标 -->
+		<uni-data-checkbox mode="list" icon="right" v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
+		<!-- 按钮 button -->
+		<uni-data-checkbox mode="button" v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
+		<!-- 标签 tag -->
+		<uni-data-checkbox mode="tag" v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
+	</view>
+</template>
+
+```
+
+```javascript
+
+export default {
+	data() { 
+		return {
+			value: 0,
+			range: [{"value": 0,"text": "篮球"	},{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}]
+		}
+	},
+	methods: {
+		change(e){
+			console.log('e:',e);
+		}
+	}
+}
+```
+
+
+## API
+
+### DataCheckbox Props
+
+| 属性名			| 类型							|可选值									| 默认值| 说明																													|
+| :-:					| :-:								|:-:										|:-:		| :-:																														|
+|value/v-model|Array/String/Number|-											|-			|默认值,multiple=true时为 Array类型,否则为 String或Number类型	|
+|localdata		|Array							|-											|-			|本地渲染数据,												|
+|mode					| String						|default/list/button/tag|default|显示模式			|
+|multiple			|Boolean						|-											|false	|是否多选		|
+|min					|String/Number			|-											|-			|最小选择个数 ,multiple为true时生效		|
+|max					|String/Number			|-											|-			|最大选择个数 ,multiple为true时生效		|
+|wrap					|Boolean						|-											|-			|是否换行显示				|
+|icon					|String							|left/right							|left		|list 列表模式下 icon 显示的位置	|
+|selectedColor|String							|-											|#007aff|选中颜色|
+|selectedTextColor|String					|-											|#333		|选中文本颜色,如不填写则自动显示|
+|emptyText 	|String					|-											|暂无数据		|没有数据时显示的文字 ,本地数据无效|
+
+#### Localdata Options
+
+`localdata` 属性的格式为数组,数组内每项是对象,需要严格遵循如下格式
+
+|属性名		| 说明				|
+|:-:			| :-:				|
+|text			|显示文本			|
+|value		|选中后的值		|
+|disable	|是否禁用			|
+
+#### Mode Options 
+
+|属性名		| 说明							|
+|:-:			| :-:							|
+|default	|默认值,横向显示		|
+|list			|列表							|
+|button		|按钮							|
+|tag			|标签							|
+
+
+### DataCheckbox Events
+
+| 事件名	| 事件说明								| 返回参数|
+| :-:		| :-:									| :-:			|
+| @chage| 选中状态改变时触发事件	| -				|
+
+

+ 8 - 0
uni_modules/uni-data-picker/changelog.md

@@ -0,0 +1,8 @@
+## 0.2.0(2021-03-15)
+- 修复 nodeclick、popupopened、popupclosed事件无法触发的问题
+## 0.1.9(2021-03-09)
+- 修复 微信小程序某些情况下无法选择的问题
+## 0.1.8(2021-02-05)
+- 优化 部分样式在nvue上的兼容表现
+## 0.1.7(2021-02-05)
+- 调整为uni_modules目录规范

+ 12 - 0
uni_modules/uni-data-picker/components/uni-data-picker/config.json

@@ -0,0 +1,12 @@
+{
+	"id": "3796",
+	"name": "DataPicker",
+	"desc": "数据驱动的picker选择器",
+	"url": "data-picker",
+	"type": "表单组件",
+	"edition": "0.0.8",
+	"suffix": "vue",
+	"module": ["uni-data-picker","uni-data-pickerview","uni-load-more"],
+	"path": "https://ext.dcloud.net.cn/plugin?id=3796",
+	"update_log": ["- 优化 增加下拉箭头"]
+}

+ 45 - 0
uni_modules/uni-data-picker/components/uni-data-picker/keypress.js

@@ -0,0 +1,45 @@
+// #ifdef H5
+export default {
+  name: 'Keypress',
+  props: {
+    disable: {
+      type: Boolean,
+      default: false
+    }
+  },
+  mounted () {
+    const keyNames = {
+      esc: ['Esc', 'Escape'],
+      tab: 'Tab',
+      enter: 'Enter',
+      space: [' ', 'Spacebar'],
+      up: ['Up', 'ArrowUp'],
+      left: ['Left', 'ArrowLeft'],
+      right: ['Right', 'ArrowRight'],
+      down: ['Down', 'ArrowDown'],
+      delete: ['Backspace', 'Delete', 'Del']
+    }
+    const listener = ($event) => {
+      if (this.disable) {
+        return
+      }
+      const keyName = Object.keys(keyNames).find(key => {
+        const keyName = $event.key
+        const value = keyNames[key]
+        return value === keyName || (Array.isArray(value) && value.includes(keyName))
+      })
+      if (keyName) {
+        // 避免和其他按键事件冲突
+        setTimeout(() => {
+          this.$emit(keyName, {})
+        }, 0)
+      }
+    }
+    document.addEventListener('keyup', listener)
+    this.$once('hook:beforeDestroy', () => {
+      document.removeEventListener('keyup', listener)
+    })
+  },
+	render: () => {}
+}
+// #endif

+ 462 - 0
uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue

@@ -0,0 +1,462 @@
+<template>
+	<view class="uni-data-tree">
+		<view class="uni-data-tree-input" @click="handleInput">
+			<slot :options="options" :data="inputSelected" :error="errorMessage">
+				<view class="input-value" :class="{'input-value-border': border}">
+					<text v-if="errorMessage" class="selected-area error-text">{{errorMessage}}</text>
+					<view v-else-if="loading && !isOpened" class="selected-area">
+						<uni-load-more class="load-more" :contentText="loadMore" status="loading"></uni-load-more>
+					</view>
+					<scroll-view v-else-if="inputSelected.length" class="selected-area" scroll-x="true">
+						<view class="selected-list">
+							<view class="selected-item" v-for="(item,index) in inputSelected" :key="index">
+								<text>{{item.text}}</text><text v-if="index<inputSelected.length-1" class="input-split-line">{{split}}</text>
+							</view>
+						</view>
+					</scroll-view>
+					<text v-else class="selected-area placeholder">{{placeholder}}</text>
+					<view class="arrow-area" v-if="!readonly">
+						<view class="input-arrow"></view>
+					</view>
+				</view>
+			</slot>
+		</view>
+		<view class="uni-data-tree-cover" v-if="isOpened" @click="handleClose"></view>
+		<view class="uni-data-tree-dialog" v-if="isOpened">
+			<view class="dialog-caption">
+				<view class="title-area">
+					<text class="dialog-title">{{popupTitle}}</text>
+				</view>
+				<view class="dialog-close" @click="handleClose">
+					<view class="dialog-close-plus" data-id="close"></view>
+					<view class="dialog-close-plus dialog-close-rotate" data-id="close"></view>
+				</view>
+			</view>
+			<data-picker-view class="picker-view" ref="pickerView" v-model="value" :localdata="localdata" :preload="preload"
+			 :collection="collection" :field="field" :orderby="orderby" :where="where" :step-searh="stepSearh" :self-field="selfField"
+			 :parent-field="parentField" :managed-mode="true" @change="onchange" @datachange="ondatachange" @nodeclick="onnodeclick"></data-picker-view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import dataPicker from "../uni-data-pickerview/uni-data-picker.js"
+	import DataPickerView from "../uni-data-pickerview/uni-data-pickerview.vue"
+
+	/**
+	 * uni-data-picker
+	 * @description uni-data-picker
+	 * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-data-picker
+	 * @property {String} popup-title 弹出窗口标题
+	 * @property {Array} localdata 本地数据,参考
+	 * @property {Boolean} border = [true|false] 是否有边框
+	 * @property {Boolean} readonly = [true|false] 是否仅读
+	 * @property {Boolean} preload = [true|false] 是否预加载数据
+	 * @value true 开启预加载数据,点击弹出窗口后显示已加载数据
+	 * @value false 关闭预加载数据,点击弹出窗口后开始加载数据
+	 * @property {Boolean} step-searh = [true|false] 是否分布查询
+	 * @value true 启用分布查询,仅查询当前选中节点
+	 * @value false 关闭分布查询,一次查询出所有数据
+	 * @property {String|DBFieldString} self-field 分布查询当前字段名称
+	 * @property {String|DBFieldString} parent-field 分布查询父字段名称
+	 * @property {String|DBCollectionString} collection 表名
+	 * @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
+	 * @property {String} orderby 排序字段及正序倒叙设置
+	 * @property {String|JQLString} where 查询条件
+	 * @event {Function} popupshow 弹出的选择窗口打开时触发此事件
+	 * @event {Function} popuphide 弹出的选择窗口关闭时触发此事件
+	 */
+	export default {
+		name: 'UniDataPicker',
+		mixins: [dataPicker],
+		components: {
+			DataPickerView
+		},
+		props: {
+			options: {
+				type: [Object, Array],
+				default () {
+					return {}
+				}
+			},
+			popupTitle: {
+				type: String,
+				default: '请选择'
+			},
+			placeholder: {
+				type: String,
+				default: '请选择'
+			},
+			heightMobile: {
+				type: String,
+				default: ''
+			},
+			readonly: {
+				type: Boolean,
+				default: false
+			},
+			border: {
+				type: Boolean,
+				default: true
+			},
+			split: {
+				type: String,
+				default: '/'
+			}
+		},
+		data() {
+			return {
+				isOpened: false,
+				inputSelected: []
+			}
+		},
+		created() {
+			this.form = this.getForm('uniForms')
+			this.formItem = this.getForm('uniFormsItem')
+			if (this.formItem) {
+				if (this.formItem.name) {
+					this.rename = this.formItem.name
+					this.form.inputChildrens.push(this)
+				}
+			}
+
+			this.$nextTick(() => {
+				this.load()
+			})
+		},
+		methods: {
+			onPropsChange() {
+				this._treeData = []
+				this.selectedIndex = 0
+				this.load()
+			},
+			load() {
+				if (this.readonly) {
+					this._processReadonly(this.localdata, this.value)
+					return
+				}
+
+				if (this.isLocaldata) {
+					this.loadData()
+					this.inputSelected = this.selected.slice(0)
+				} else if (this.value.length) {
+					this.getTreePath(() => {
+						this.inputSelected = this.selected.slice(0)
+					})
+				}
+			},
+			getForm(name = 'uniForms') {
+				let parent = this.$parent;
+				let parentName = parent.$options.name;
+				while (parentName !== name) {
+					parent = parent.$parent;
+					if (!parent) return false;
+					parentName = parent.$options.name;
+				}
+				return parent;
+			},
+			show() {
+				this.isOpened = true
+				this.$nextTick(() => {
+					this.$refs.pickerView.updateData({
+						treeData: this._treeData,
+						selected: this.selected,
+						selectedIndex: this.selectedIndex
+					})
+				})
+				this.$emit('popupopened')
+			},
+			hide() {
+				this.isOpened = false
+				this.$emit('popupclosed')
+			},
+			handleInput() {
+				if (this.readonly) {
+					return
+				}
+				this.show()
+			},
+			handleClose(e) {
+				this.hide()
+			},
+			onnodeclick(e) {
+				this.$emit('nodeclick', e)
+			},
+			ondatachange(e) {
+				this._treeData = this.$refs.pickerView._treeData
+			},
+			onchange(e) {
+				this.hide()
+				this.inputSelected = e
+				this._dispatchEvent(e)
+			},
+			_processReadonly(dataList, valueArray) {
+				var isTree = dataList.findIndex((item) => {
+					return item.children
+				})
+				if (isTree > -1) {
+					if (Array.isArray(valueArray)) {
+						let inputValue = valueArray[valueArray.length - 1]
+						if (typeof inputValue === 'object' && inputValue.value) {
+							inputValue = inputValue.value
+						}
+					}
+					this.inputSelected = this._findNodePath(inputValue, this.localdata)
+					return
+				}
+
+				let result = []
+				for (let i = 0; i < valueArray.length; i++) {
+					var value = valueArray[i]
+					var item = dataList.find((v) => {
+						return v.value == value
+					})
+					if (item) {
+						result.push(item)
+					}
+				}
+				if (result.length) {
+					this.inputSelected = result
+				}
+			},
+			_filterForArray(data, valueArray) {
+				var result = []
+				for (let i = 0; i < valueArray.length; i++) {
+					var value = valueArray[i]
+					var found = data.find((item) => {
+						return item.value == value
+					})
+					if (found) {
+						result.push(found)
+					}
+				}
+				return result
+			},
+			_dispatchEvent(selected) {
+				var value = new Array(selected.length)
+				for (var i = 0; i < selected.length; i++) {
+					value[i] = selected[i].value
+				}
+
+				if (this.formItem) {
+					const item = selected[selected.length - 1]
+					this.formItem.setValue(item.value)
+				}
+
+				this.$emit('change', {
+					detail: {
+						value: selected
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped>
+	.uni-data-tree {
+		position: relative;
+		font-size: 14px;
+	}
+
+	.error-text {
+		color: #DD524D;
+	}
+
+	.input-value {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		align-items: center;
+		flex-wrap: nowrap;
+		font-size: 14px;
+		line-height: 38px;
+		padding: 0 5px;
+		overflow: hidden;
+		/* #ifdef APP-NVUE */
+		height: 40px;
+		/* #endif */
+	}
+
+	.input-value-border {
+		border: 1px solid #e5e5e5;
+		border-radius: 5px;
+	}
+
+	.selected-area {
+		flex: 1;
+		overflow: hidden;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+	}
+
+	.load-more {
+		/* #ifndef APP-NVUE */
+		margin-right: auto;
+		/* #endif */
+		/* #ifdef APP-NVUE */
+		width: 40px;
+		/* #endif */
+	}
+
+	.selected-list {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		flex-wrap: nowrap;
+		padding: 0 5px;
+	}
+
+	.selected-item {
+		flex-direction: row;
+		padding: 0 1px;
+		/* #ifndef APP-NVUE */
+		white-space: nowrap;
+		/* #endif */
+	}
+
+	.placeholder {
+		color: grey;
+	}
+
+	.input-split-line {
+		opacity: .5;
+	}
+
+	.arrow-area {
+		position: relative;
+		width: 20px;
+		/* #ifndef APP-NVUE */
+		margin-left: auto;
+		display: flex;
+		/* #endif */
+		justify-content: center;
+		transform: rotate(-45deg);
+		transform-origin: center;
+	}
+
+	.input-arrow {
+		width: 7px;
+		height: 7px;
+		border-left: 1px solid #999;
+		border-bottom: 1px solid #999;
+	}
+
+	.uni-data-tree-cover {
+		position: fixed;
+		left: 0;
+		top: 0;
+		right: 0;
+		bottom: 0;
+		background-color: rgba(0, 0, 0, .4);
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		z-index: 100;
+	}
+
+	.uni-data-tree-dialog {
+		position: fixed;
+		left: 0;
+		top: 20%;
+		right: 0;
+		bottom: 0;
+		background-color: #FFFFFF;
+		border-top-left-radius: 10px;
+		border-top-right-radius: 10px;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		z-index: 102;
+		overflow: hidden;
+		/* #ifdef APP-NVUE */
+		width: 750rpx;
+		/* #endif */
+	}
+
+	.dialog-caption {
+		position: relative;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		border-bottom: 1px solid #f0f0f0;
+	}
+
+	.title-area {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		align-items: center;
+		/* #ifndef APP-NVUE */
+		margin: auto;
+		/* #endif */
+		padding: 0 10px;
+	}
+
+	.dialog-title {
+		font-weight: bold;
+		line-height: 44px;
+	}
+
+	.dialog-close {
+		position: absolute;
+		top: 0;
+		right: 0;
+		bottom: 0;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		align-items: center;
+		padding: 0 15px;
+	}
+
+	.dialog-close-plus {
+		width: 16px;
+		height: 2px;
+		background-color: #666;
+		border-radius: 2px;
+		transform: rotate(45deg);
+	}
+
+	.dialog-close-rotate {
+		position: absolute;
+		transform: rotate(-45deg);
+	}
+
+	.picker-view {
+		flex: 1;
+		overflow: hidden;
+	}
+
+	/* #ifdef H5 */
+	@media all and (min-width: 768px) {
+		.uni-data-tree-cover {
+			background-color: transparent;
+		}
+
+		.uni-data-tree-dialog {
+			position: absolute;
+			top: 100%;
+			height: auto;
+			min-height: 400px;
+			max-height: 50vh;
+			background-color: #fff;
+			border-radius: 5px;
+			box-shadow: 0 0 20px 5px rgba(0, 0, 0, .3);
+		}
+
+		.dialog-caption {
+			display: none;
+		}
+	}
+
+	/* #endif */
+</style>

+ 468 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js

@@ -0,0 +1,468 @@
+export default {
+  props: {
+    localdata: {
+      type: [Array, Object],
+      default () {
+        return []
+      }
+    },
+    collection: {
+      type: String,
+      default: ''
+    },
+    action: {
+      type: String,
+      default: ''
+    },
+    field: {
+      type: String,
+      default: ''
+    },
+    orderby: {
+      type: String,
+      default: ''
+    },
+    where: {
+      type: [String, Object],
+      default: ''
+    },
+    pageData: {
+      type: String,
+      default: 'add'
+    },
+    pageCurrent: {
+      type: Number,
+      default: 1
+    },
+    pageSize: {
+      type: Number,
+      default: 20
+    },
+    getcount: {
+      type: [Boolean, String],
+      default: false
+    },
+    getone: {
+      type: [Boolean, String],
+      default: false
+    },
+    gettree: {
+      type: [Boolean, String],
+      default: false
+    },
+    manual: {
+      type: Boolean,
+      default: false
+    },
+    value: {
+      type: [Array, String, Number],
+      default () {
+        return []
+      }
+    },
+    preload: {
+      type: Boolean,
+      default: false
+    },
+    stepSearh: {
+      type: Boolean,
+      default: true
+    },
+    selfField: {
+      type: String,
+      default: ''
+    },
+    parentField: {
+      type: String,
+      default: ''
+    },
+    multiple: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      loading: false,
+      errorMessage: '',
+      loadMore: {
+        contentdown: '',
+        contentrefresh: '',
+        contentnomore: ''
+      },
+      dataList: [],
+      selected: [],
+      selectedIndex: 0,
+      page: {
+        current: this.pageCurrent,
+        size: this.pageSize,
+        count: 0
+      }
+    }
+  },
+  computed: {
+    isLocaldata() {
+      return this.localdata.length > 0
+    },
+    postField() {
+      return `${this.field}, ${this.parentField} as parent_value`
+    }
+  },
+  created() {
+    this.$watch(() => {
+      var al = [];
+      ['pageCurrent',
+        'pageSize',
+        'value',
+        'localdata',
+        'collection',
+        'action',
+        'field',
+        'orderby',
+        'where',
+        'getont',
+        'getcount',
+        'gettree'
+      ].forEach(key => {
+        al.push(this[key])
+      });
+      return al
+    }, (newValue, oldValue) => {
+      let needReset = false
+      for (let i = 2; i < newValue.length; i++) {
+        if (newValue[i] != oldValue[i]) {
+          needReset = true
+          break
+        }
+      }
+      if (newValue[0] != oldValue[0]) {
+        this.page.current = this.pageCurrent
+      }
+      this.page.size = this.pageSize
+
+      this.onPropsChange()
+    })
+    this._treeData = []
+  },
+  methods: {
+    onPropsChange() {
+      this._treeData = []
+    },
+    getCommand(options = {}) {
+      /* eslint-disable no-undef */
+      let db = uniCloud.database()
+
+      const action = options.action || this.action
+      if (action) {
+        db = db.action(action)
+      }
+
+      const collection = options.collection || this.collection
+      db = db.collection(collection)
+
+      const where = options.where || this.where
+      if (!(!where || !Object.keys(where).length)) {
+        db = db.where(where)
+      }
+
+      const field = options.field || this.field
+      if (field) {
+        db = db.field(field)
+      }
+
+      const orderby = options.orderby || this.orderby
+      if (orderby) {
+        db = db.orderBy(orderby)
+      }
+
+      const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current
+      const size = options.pageSize !== undefined ? options.pageSize : this.page.size
+      const getCount = options.getcount !== undefined ? options.getcount : this.getcount
+      const getTree = options.gettree !== undefined ? options.gettree : this.gettree
+
+      const getOptions = {
+        getCount,
+        getTree
+      }
+      if (options.getTreePath) {
+        getOptions.getTreePath = options.getTreePath
+      }
+
+      db = db.skip(size * (current - 1)).limit(size).get(getOptions)
+
+      return db
+    },
+    getTreePath(callback) {
+      if (this.loading) {
+        return
+      }
+      this.loading = true
+
+      this.getCommand({
+        field: this.postField,
+        getTreePath: {
+          startWith: `${this.selfField}=='${this.value}'`
+        }
+      }).then((res) => {
+        this.loading = false
+        let treePath = []
+        this._extractTreePath(res.result.data, treePath)
+        this.selected = treePath
+        callback && callback()
+      }).catch((err) => {
+        this.loading = false
+        this.errorMessage = err
+      })
+    },
+    loadData() {
+      if (this.isLocaldata) {
+        this._processLocalData()
+        return
+      }
+
+      if (this.value.length) {
+        this._loadNodeData((data) => {
+          this._treeData = data
+          this._updateBindData()
+          this._updateSelected()
+        })
+        return
+      }
+
+      if (this.stepSearh) {
+        this._loadNodeData((data) => {
+          this._treeData = data
+          this._updateBindData()
+        })
+      } else {
+        this._loadAllData((data) => {
+          this._treeData = []
+          this._extractTree(data, this._treeData, null)
+          this._updateBindData()
+        })
+      }
+    },
+    _loadAllData(callback) {
+      if (this.loading) {
+        return
+      }
+      this.loading = true
+
+      this.getCommand({
+        field: this.postField,
+        gettree: true,
+        startwith: `${this.selfField}=='${this.value}'`
+      }).then((res) => {
+        this.loading = false
+        callback(res.result.data)
+        this.onDataChange()
+      }).catch((err) => {
+        this.loading = false
+        this.errorMessage = err
+      })
+    },
+    _loadNodeData(callback, pw) {
+      if (this.loading) {
+        return
+      }
+      this.loading = true
+
+      this.getCommand({
+        field: this.postField,
+        where: pw || this._postWhere(),
+        pageSize: 500
+      }).then((res) => {
+        this.loading = false
+        callback(res.result.data)
+        this.onDataChange()
+      }).catch((err) => {
+        this.loading = false
+        this.errorMessage = err
+      })
+    },
+    _postWhere() {
+      let result = []
+      let selected = this.selected
+      result.push(`${this.parentField} == null`)
+      if (selected.length) {
+        for (var i = 0; i < selected.length - 1; i++) {
+          result.push(`${this.parentField} == '${selected[i].value}'`)
+        }
+      }
+
+      if (this.where) {
+        return `(${this.where}) && (${result.join(' || ')})`
+      }
+
+      return result.join(' || ')
+    },
+    _nodeWhere() {
+      let result = []
+      let selected = this.selected
+      if (selected.length) {
+        result.push(`${this.parentField} == '${selected[selected.length - 1].value}'`)
+      }
+
+      if (this.where) {
+        return `(${this.where}) && (${result.join(' || ')})`
+      }
+
+      return result.join(' || ')
+    },
+    _updateSelected() {
+      var dl = this.dataList
+      var sl = this.selected
+      for (var i = 0; i < sl.length; i++) {
+        var value = sl[i].value
+        var dl2 = dl[i]
+        for (var j = 0; j < dl2.length; j++) {
+          var item2 = dl2[j]
+          if (item2.value === value) {
+            sl[i].text = item2.text
+            break
+          }
+        }
+      }
+    },
+    _updateBindData(node) {
+      const {
+        dataList,
+        hasNodes
+      } = this._filterData(this._treeData, this.selected)
+
+      let isleaf = this._stepSearh === false && !hasNodes
+
+      if (node) {
+        node.isleaf = isleaf
+      }
+
+      this.dataList = dataList
+      this.selectedIndex = dataList.length - 1
+
+      if (!isleaf && this.selected.length < dataList.length) {
+        this.selected.push({
+          value: null,
+          text: "请选择"
+        })
+      }
+
+      return {
+        isleaf,
+        hasNodes
+      }
+    },
+    _filterData(data, paths) {
+      let dataList = []
+
+      let hasNodes = true
+
+      dataList.push(data.filter((item) => {
+        return item.parent_value === undefined
+      }))
+      for (let i = 0; i < paths.length; i++) {
+        var value = paths[i].value
+        var nodes = data.filter((item) => {
+          return item.parent_value === value
+        })
+
+        if (nodes.length) {
+          dataList.push(nodes)
+        } else {
+          hasNodes = false
+        }
+      }
+
+      return {
+        dataList,
+        hasNodes
+      }
+    },
+    _extractTree(nodes, result, parent_value) {
+      let list = result || []
+      for (let i = 0; i < nodes.length; i++) {
+        let node = nodes[i]
+
+        let child = {}
+        for (let key in node) {
+          if (key !== 'children') {
+            child[key] = node[key]
+          }
+        }
+        if (parent_value !== null) {
+          child.parent_value = parent_value
+        }
+        result.push(child)
+
+        let children = node.children
+        if (children) {
+          this._extractTree(children, result, node.value)
+        }
+      }
+    },
+    _extractTreePath(nodes, result) {
+      let list = result || []
+      for (let i = 0; i < nodes.length; i++) {
+        let node = nodes[i]
+
+        let child = {}
+        for (let key in node) {
+          if (key !== 'children') {
+            child[key] = node[key]
+          }
+        }
+        result.push(child)
+
+        let children = node.children
+        if (children) {
+          this._extractTreePath(children, result)
+        }
+      }
+    },
+    _findNodePath(key, nodes, path = []) {
+      for (let i = 0; i < nodes.length; i++) {
+        let {
+          value,
+          text,
+          children
+        } = nodes[i]
+
+        path.push({
+          value,
+          text
+        })
+
+        if (value === key) {
+          return path
+        }
+
+        if (children) {
+          const p = this._findNodePath(key, children, path)
+          if (p.length) {
+            return p
+          }
+        }
+
+        path.pop()
+      }
+      return []
+    },
+    _processLocalData() {
+      this._treeData = []
+      this._extractTree(this.localdata, this._treeData)
+
+      var inputValue = this.value
+      if (inputValue === undefined) {
+        return
+      }
+
+      if (Array.isArray(inputValue)) {
+        inputValue = inputValue[inputValue.length - 1]
+        if (typeof inputValue === 'object' && inputValue.value) {
+          inputValue = inputValue.value
+        }
+      }
+
+      this.selected = this._findNodePath(inputValue, this.localdata)
+    }
+  }
+}

+ 289 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue

@@ -0,0 +1,289 @@
+<template>
+  <view class="uni-data-pickerview">
+    <scroll-view class="selected-area" scroll-x="true" scroll-y="false" :show-scrollbar="false">
+      <view class="selected-list">
+        <view class="selected-item" :class="{'selected-item-active':index==selectedIndex}" v-for="(item,index) in selected"
+          :key="index" v-if="item.text" @click="handleSelect(index)">
+          <text class="">{{item.text}}</text>
+        </view>
+      </view>
+    </scroll-view>
+    <view class="tab-c">
+      <scroll-view class="list" v-for="(child, i) in dataList" :key="i" v-if="i==selectedIndex" :scroll-y="true">
+        <view class="item" :class="{'is-disabled': !!item.disable}" v-for="(item, j) in child" :key="j" @click="handleNodeClick(item, i, j)">
+          <text class="item-text">{{item.text}}</text>
+          <view class="check" v-if="selected.length > i && item.value == selected[i].value"></view>
+        </view>
+      </scroll-view>
+      <view class="loading-cover" v-if="loading">
+        <uni-load-more class="load-more" :contentText="loadMore" status="loading"></uni-load-more>
+      </view>
+      <view class="error-message" v-if="errorMessage">
+        <text class="error-text">{{errorMessage}}</text>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+  import dataPicker from "./uni-data-picker.js"
+
+  /**
+   * uni-data-pickerview
+   * @description uni-data-pickerview
+   * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-data-picker
+   * @property {Array} localdata 本地数据,参考
+   * @property {Boolean} step-searh = [true|false] 是否分布查询
+   * @value true 启用分布查询,仅查询当前选中节点
+   * @value false 关闭分布查询,一次查询出所有数据
+   * @property {String|DBFieldString} self-field 分布查询当前字段名称
+   * @property {String|DBFieldString} parent-field 分布查询父字段名称
+   * @property {String|DBCollectionString} collection 表名
+   * @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
+   * @property {String} orderby 排序字段及正序倒叙设置
+   * @property {String|JQLString} where 查询条件
+   */
+  export default {
+    name: 'UniDataPickerView',
+    mixins: [dataPicker],
+    props: {
+      managedMode: {
+        type: Boolean,
+        default: false
+      }
+    },
+    data() {
+      return {}
+    },
+    created() {
+      if (this.managedMode) {
+        return
+      }
+
+      this.$nextTick(() => {
+        this.load()
+      })
+    },
+    methods: {
+      onPropsChange() {
+        this._treeData = []
+        this.selectedIndex = 0
+        this.load()
+      },
+      load() {
+        if (this.isLocaldata) {
+          this.loadData()
+        } else if (this.value.length) {
+          this.getTreePath((res) => {
+            this.loadData()
+          })
+        }
+      },
+      handleSelect(index) {
+        this.selectedIndex = index
+      },
+      handleNodeClick(item, i, j) {
+        if (item.disable) {
+          return
+        }
+
+        const node = this.dataList[i][j]
+        const {
+          value,
+          text
+        } = node
+
+        if (i < this.selected.length - 1) {
+          this.selected.splice(i, this.selected.length - i)
+          this.selected.push(node)
+        } else if (i === this.selected.length - 1) {
+          this.selected[i] = node
+        }
+
+        if (node.isleaf) {
+          this.onSelectedChange(node, node.isleaf)
+          return
+        }
+
+        const {
+          isleaf,
+          hasNodes
+        } = this._updateBindData()
+
+        if (this.isLocaldata && (!hasNodes || isleaf)) {
+          this.onSelectedChange(node, true)
+          return
+        }
+
+        if (!isleaf && !hasNodes) {
+          this._loadNodeData((data) => {
+            if (!data.length) {
+              node.isleaf = true
+            } else {
+              this._treeData.push(...data)
+              this._updateBindData(node)
+            }
+            this.onSelectedChange(node, node.isleaf)
+          }, this._nodeWhere())
+          return
+        }
+
+        this.onSelectedChange(node, false)
+      },
+      updateData(data) {
+        this._treeData = data.treeData
+        this.selected = data.selected
+        if (!this._treeData.length) {
+          this.loadData()
+        } else {
+          //this.selected = data.selected
+          this._updateBindData()
+        }
+      },
+      onDataChange() {
+        this.$emit('datachange')
+      },
+      onSelectedChange(node, isleaf) {
+        if (isleaf) {
+          this._dispatchEvent()
+        }
+
+				if (node) {
+					this.$emit('nodeclick', node)
+				}
+      },
+      _dispatchEvent() {
+        this.$emit('change', this.selected.slice(0))
+      }
+    }
+  }
+</script>
+
+<style scoped>
+  .uni-data-pickerview {
+    flex: 1;
+    /* #ifndef APP-NVUE */
+    display: flex;
+    /* #endif */
+    flex-direction: column;
+    overflow: hidden;
+    height: 100%;
+  }
+
+  .error-text {
+    color: #DD524D;
+  }
+
+  .loading-cover {
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(255, 255, 255, .5);
+    /* #ifndef APP-NVUE */
+    display: flex;
+    /* #endif */
+    flex-direction: column;
+    align-items: center;
+    z-index: 1001;
+  }
+
+  .load-more {
+		/* #ifndef APP-NVUE */
+    margin: auto;
+		/* #endif */
+  }
+
+  .error-message {
+    background-color: #fff;
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    padding: 15px;
+    opacity: .9;
+    z-index: 102;
+  }
+
+  /* #ifdef APP-NVUE */
+  .selected-area {
+    width: 750rpx;
+  }
+
+  /* #endif */
+
+  .selected-list {
+    /* #ifndef APP-NVUE */
+    display: flex;
+    /* #endif */
+    flex-direction: row;
+    flex-wrap: nowrap;
+    padding: 0 5px;
+    border-bottom: 1px solid #f8f8f8;
+  }
+
+  .selected-item {
+    margin-left: 10px;
+    margin-right: 10px;
+    padding: 12px 0;
+		/* #ifndef APP-NVUE */
+		white-space: nowrap;
+		/* #endif */
+  }
+
+  .selected-item-active {
+    border-bottom: 2px solid #007aff;
+  }
+
+  .selected-item-text {
+    color: #007aff;
+  }
+
+  .tab-c {
+    position: relative;
+    flex: 1;
+    /* #ifndef APP-NVUE */
+    display: flex;
+    /* #endif */
+    flex-direction: row;
+    overflow: hidden;
+  }
+
+  .list {
+    flex: 1;
+  }
+
+  .item {
+    padding: 12px 15px;
+    border-bottom: 1px solid #f0f0f0;
+    /* #ifndef APP-NVUE */
+    display: flex;
+    /* #endif */
+    flex-direction: row;
+  }
+
+  .is-disabled {
+    opacity: .5;
+  }
+
+  .item-text {
+    flex: 1;
+    color: #333333;
+  }
+
+  .check {
+    margin-right: 5px;
+    border: 2px solid #007aff;
+    border-left: 0;
+    border-top: 0;
+    height: 12px;
+    width: 6px;
+    transform-origin: center;
+    /* #ifndef APP-NVUE */
+    transition: all 0.3s;
+    /* #endif */
+    transform: rotate(45deg);
+  }
+</style>

+ 86 - 0
uni_modules/uni-data-picker/package.json

@@ -0,0 +1,86 @@
+{
+  "id": "uni-data-picker",
+  "displayName": "DataPicker 数据驱动的picker选择器",
+  "version": "0.2.0",
+  "description": "Picker选择器",
+  "keywords": [
+    "",
+    "picker",
+    "级联",
+    "uni-data-picker",
+    "省市区选择",
+    "地址选择"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [
+      "uni-load-more"
+    ],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 253 - 0
uni_modules/uni-data-picker/readme.md

@@ -0,0 +1,253 @@
+## DataPicker 级联选择
+> 代码块: `uDataPicker`
+> 关联组件:`uni-data-pickerview`、`uni-load-more`。
+
+
+`<uni-data-picker>` 是一个选择类[datacom组件](https://uniapp.dcloud.net.cn/component/datacom)。
+
+支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。
+
+候选数据支持一次性加载完毕,也支持懒加载,比如示例图中,选择了“北京”后,动态加载北京的区县数据。
+
+`<uni-data-picker>` 组件尤其适用于地址选择、分类选择等选择类。
+
+`<uni-data-picker>` 支持本地数据、云端静态数据(json),uniCloud云数据库数据。
+
+`<uni-data-picker>` 可以通过JQL直连uniCloud云数据库,配套[DB Schema](https://uniapp.dcloud.net.cn/uniCloud/schema),可在schema2code中自动生成前端页面,还支持服务器端校验。
+
+在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。
+
+
+> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
+> - 组件需要依赖 `sass` 插件 ,请自行手动安装
+> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
+> - `<uni-data-picker>` 内部包含了弹出层组件 `<uni-data-pickerview>` 外层的布局可能会影响弹出层,[详情](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Common_CSS_Questions)
+
+
+
+### 平台差异说明
+
+暂不支持在nvue页面中使用
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`componets`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+## API
+
+### DataPicker Props
+
+|属性名								| 类型						|	可选值 		 | 		默认值			| 说明|
+|:-:									| :-:						|:-:				 | :-:					| :-:	|
+|v-model 							|String/ Number	| -				 	 |	-						|绑定数据|
+|localdata						|Array					| 					 |							|数据,[详情](https://gitee.com/dcloud/datacom)|
+|preload 							|Boolean				| true/false |	false				|预加载数据|
+|step-searh 					|Boolean				| true/false |	true				|分步查询时,点击节点请求数据|
+|step-search-url			|String					| 					 |							|分步查询时,动态加载云端数据url格式,`https://xxx.com/{parentValue}`(当前版本暂不支持,下版支持)|
+|self-field						|String					| 					 |							|分步查询时当前字段名称|
+|parent-field					|String					| 					 |							|分步查询时父字段名称|
+|collection						|String					| 					 |							|表名。支持输入多个表名,用 `,` 分割|
+|field								|String					| 					 |							|查询字段,多个字段用 `,` 分割|
+|where								|String					| 					 |							|查询条件,内容较多,另见jql文档:[详情](https://uniapp.dcloud.net.cn/uniCloud/uni-clientDB?id=jsquery)|
+|orderby							|String					| 					 |							|排序字段及正序倒叙设置|
+|popup-title					|String					| 					 |							|弹出层标题|
+
+
+> `collection/where/orderby` 和 `<unicloud-db>` 的用法一致,[详情](https://uniapp.dcloud.net.cn/uniCloud/unicloud-db)
+
+
+
+### DataPicker Events
+
+|事件称名					| 类型						| 说明																						|
+|:-:							| :-:						|	:-:																						|
+|@change 					|EventHandle		|	选择完成时触发 {detail: {value}}								|
+|@nodeclick				|EventHandle		| 节点被点击时触发																|
+|@stepsearch			|EventHandle		| 动态加载节点数据前触发(当前版本暂不支持,下版支持)	|
+|@popupopened			|EventHandle		| 弹出层弹出时触发																|
+|@popupclosed			|EventHandle		| 弹出层关闭时触发																|
+
+
+
+### 基本用法
+
+#### 云端数据
+
+> - 云端数据需要关联服务空间
+> - 下面示例中使用的表 `opendb-city-china`(中国城市省市区数据,含港澳台), 在[uniCloud控制台](https://unicloud.dcloud.net.cn/)使用opendb创建,[详情](https://gitee.com/dcloud/opendb)
+
+
+```html
+<template>
+  <view>
+    <uni-data-picker placeholder="请选择地址" popup-title="请选择城市" collection="opendb-city-china" field="code as value, name as text" orderby="value asc" :step-searh="true" :self-field="code" parent-field="parent_code"
+ @change="onchange" @nodeclick="onnodeclick">
+    </uni-data-picker>
+  </view>
+</template>
+
+<script>
+  export default {
+    data() {
+      return {
+      }
+    },
+    methods: {
+      onchange(e) {
+        const value = e.detail.value
+      },
+      onnodeclick(node) {}
+    }
+  }
+</script>
+
+```
+
+
+
+
+
+#### 本地数据
+
+```html
+<template>
+  <view>
+    <uni-data-picker :localdata="items" popup-title="请选择班级" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
+  </view>
+</template>
+
+<script>
+  export default {
+    data() {
+      return {
+        items: [{
+          text: "一年级",
+          value: "1-0",
+          children: [
+            {
+              text: "1.1班",
+              value: "1-1"
+            },
+            {
+              text: "1.2班",
+              value: "1-2"
+            }
+          ]
+        },
+        {
+          text: "二年级",
+          value: "2-0"
+        },
+        {
+          text: "三年级",
+          value: "3-0"
+        }]
+      }
+    },
+    methods: {
+      onchange(e) {
+        const value = e.detail.value
+      },
+      onnodeclick(node) {
+      }
+    }
+  }
+</script>
+
+```
+
+
+#### 自定义solt
+
+```html
+<uni-data-picker v-slot:default="{data, error, options}" popup-title="请选择所在地区">
+  <view v-if="error" class="error">
+    <text>{{error}}</text>
+  </view>
+  <view v-else-if="data.length" class="selected">
+    <view v-for="(item,index) in data" :key="index" class="selected-item">
+      <text>{{item.text}}</text>
+    </view>
+  </view>
+  <view v-else>
+    <text>请选择</text>
+  </view>
+</uni-data-picker>
+```
+
+
+> `localdata` 和 `collection` 同时配置时,`localdata` 优先
+
+
+
+#### 完整示例
+
+```html
+<template>
+	<view class="container">
+		<uni-data-picker @change="onchange" @nodeclick="onnodeclick" @stepsearch="onstepsearch" @popupopened="onpopupopened"
+		 @popupclosed="onpopupclosed">
+		</uni-data-picker>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				count: 1
+			}
+		},
+		methods: {
+			onchange(e) {
+				const value = e.detail.value
+			},
+			onnodeclick(node) {
+				// node 当前点击节点
+			},
+			onstepsearch(node, resolve) {
+				if (node.level === 0) {
+					return resolve([{
+						text: 'region1',
+						value: 'region1'
+					}, {
+						text: 'region2',
+						value: 'region1'
+					}]);
+				}
+
+				var hasChild;
+				if (node.text === 'region1') {
+					hasChild = true;
+				} else if (node.text === 'region2') {
+					hasChild = false;
+				} else {
+					hasChild = Math.random() > 0.5;
+				}
+
+				setTimeout(() => {
+					var data;
+					if (hasChild) {
+						data = [{
+							text: 'zone' + this.count++,
+							value: 'zone' + this.count++
+						}, {
+							text: 'zone' + this.count++,
+							value: 'zone' + this.count++
+						}];
+					} else {
+						data = [];
+					}
+
+					resolve(data);
+				}, 500);
+			},
+			onpopupopened() {},
+			onpopupclosed() {}
+		}
+	}
+</script>
+
+```

+ 3 - 0
uni_modules/uni-dateformat/changelog.md

@@ -0,0 +1,3 @@
+## 0.0.3(2021-02-04)
+- 调整为uni_modules目录规范
+- 修复 iOS 平台日期格式化出错的问题

+ 191 - 0
uni_modules/uni-dateformat/components/uni-dateformat/date-format.js

@@ -0,0 +1,191 @@
+// yyyy-MM-dd hh:mm:ss.SSS 所有支持的类型
+function pad(str, length = 2) {
+	str += ''
+	while (str.length < length) {
+		str = '0' + str
+	}
+	return str.slice(-length)
+}
+
+const parser = {
+	yyyy: (dateObj) => {
+		return pad(dateObj.year, 4)
+	},
+	yy: (dateObj) => {
+		return pad(dateObj.year)
+	},
+	MM: (dateObj) => {
+		return pad(dateObj.month)
+	},
+	M: (dateObj) => {
+		return dateObj.month
+	},
+	dd: (dateObj) => {
+		return pad(dateObj.day)
+	},
+	d: (dateObj) => {
+		return dateObj.day
+	},
+	hh: (dateObj) => {
+		return pad(dateObj.hour)
+	},
+	h: (dateObj) => {
+		return dateObj.hour
+	},
+	mm: (dateObj) => {
+		return pad(dateObj.minute)
+	},
+	m: (dateObj) => {
+		return dateObj.minute
+	},
+	ss: (dateObj) => {
+		return pad(dateObj.second)
+	},
+	s: (dateObj) => {
+		return dateObj.second
+	},
+	SSS: (dateObj) => {
+		return pad(dateObj.millisecond, 3)
+	},
+	S: (dateObj) => {
+		return dateObj.millisecond
+	},
+}
+
+// 这都n年了iOS依然不认识2020-12-12,需要转换为2020/12/12
+function getDate(time) {
+	if (time instanceof Date) {
+		return time
+	}
+	switch (typeof time) {
+		case 'string':
+			return new Date(time.replace(/-/g, '/'))
+		default:
+			return new Date(time)
+	}
+}
+
+export function formatDate(date, format = 'yyyy/MM/dd hh:mm:ss') {
+	if (!date && date !== 0) {
+		return ''
+	}
+	date = getDate(date)
+	const dateObj = {
+		year: date.getFullYear(),
+		month: date.getMonth() + 1,
+		day: date.getDate(),
+		hour: date.getHours(),
+		minute: date.getMinutes(),
+		second: date.getSeconds(),
+		millisecond: date.getMilliseconds()
+	}
+	const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/
+	let flag = true
+	let result = format
+	while (flag) {
+		flag = false
+		result = result.replace(tokenRegExp, function(matched) {
+			flag = true
+			return parser[matched](dateObj)
+		})
+	}
+	return result
+}
+
+export function friendlyDate(time, {
+	locale = 'zh',
+	threshold = [60000, 3600000],
+	format = 'yyyy/MM/dd hh:mm:ss'
+}) {
+	if (!time && time !== 0) {
+		return ''
+	}
+	const localeText = {
+		zh: {
+			year: '年',
+			month: '月',
+			day: '天',
+			hour: '小时',
+			minute: '分钟',
+			second: '秒',
+			ago: '前',
+			later: '后',
+			justNow: '刚刚',
+			soon: '马上',
+			template: '{num}{unit}{suffix}'
+		},
+		en: {
+			year: 'year',
+			month: 'month',
+			day: 'day',
+			hour: 'hour',
+			minute: 'minute',
+			second: 'second',
+			ago: 'ago',
+			later: 'later',
+			justNow: 'just now',
+			soon: 'soon',
+			template: '{num} {unit} {suffix}'
+		}
+	}
+	const text = localeText[locale] || localeText.zh
+	let date = getDate(time)
+	let ms = date.getTime() - Date.now()
+	let absMs = Math.abs(ms)
+	if (absMs < threshold[0]) {
+		return ms < 0 ? text.justNow : text.soon
+	}
+	if (absMs >= threshold[1]) {
+		return formatDate(date, format)
+	}
+	let num
+	let unit
+	let suffix = text.later
+	if (ms < 0) {
+		suffix = text.ago
+		ms = -ms
+	}
+	const seconds = Math.floor((ms) / 1000)
+	const minutes = Math.floor(seconds / 60)
+	const hours = Math.floor(minutes / 60)
+	const days = Math.floor(hours / 24)
+	const months = Math.floor(days / 30)
+	const years = Math.floor(months / 12)
+	switch (true) {
+		case years > 0:
+			num = years
+			unit = text.year
+			break
+		case months > 0:
+			num = months
+			unit = text.month
+			break
+		case days > 0:
+			num = days
+			unit = text.day
+			break
+		case hours > 0:
+			num = hours
+			unit = text.hour
+			break
+		case minutes > 0:
+			num = minutes
+			unit = text.minute
+			break
+		default:
+			num = seconds
+			unit = text.second
+			break
+	}
+
+	if (locale === 'en') {
+		if (num === 1) {
+			num = 'a'
+		} else {
+			unit += 's'
+		}
+	}
+
+	return text.template.replace(/{\s*num\s*}/g, num + '').replace(/{\s*unit\s*}/g, unit).replace(/{\s*suffix\s*}/g,
+		suffix)
+}

+ 90 - 0
uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue

@@ -0,0 +1,90 @@
+<template>
+	<text>{{dateShow}}</text>
+</template>
+
+<script>
+	/**
+	 * Dateformat 日期格式化
+	 * @description 日期格式化组件
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=3279
+	 * @property {Object|String|Number} date 日期对象/日期字符串/时间戳
+	 * @property {String} locale 格式化使用的语言
+	 * 	@value zh 中文
+	 * 	@value en 英文
+	 * @property {Array} threshold 应用不同类型格式化的阈值
+	 * @property {String} format 输出日期字符串时的格式
+	 */
+	import {
+		friendlyDate
+	} from './date-format.js'
+	export default {
+		name: 'uniDateformat',
+		props: {
+			date: {
+				type: [Object, String, Number],
+				default () {
+					return Date.now()
+				}
+			},
+			locale: {
+				type: String,
+				default: 'zh',
+			},
+			threshold: {
+				type: Array,
+				default () {
+					return [0, 0]
+				}
+			},
+			format: {
+				type: String,
+				default: 'yyyy/MM/dd hh:mm:ss'
+			},
+			// refreshRate使用不当可能导致性能问题,谨慎使用
+			refreshRate: {
+				type: [Number, String],
+				default: 0
+			}
+		},
+		data() {
+			return {
+				refreshMark: 0
+			}
+		},
+		computed: {
+			dateShow() {
+				this.refreshMark
+				return friendlyDate(this.date, {
+					locale: this.locale,
+					threshold: this.threshold,
+					format: this.format
+				})
+			}
+		},
+		watch: {
+			refreshRate: {
+				handler() {
+					this.setAutoRefresh()
+				},
+				immediate: true
+			}
+		},
+		methods: {
+			refresh() {
+				this.refreshMark++
+			},
+			setAutoRefresh() {
+				clearInterval(this.refreshInterval)
+				if (this.refreshRate) {
+					this.refreshInterval = setInterval(() => {
+						this.refresh()
+					}, parseInt(this.refreshRate))
+				}
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 83 - 0
uni_modules/uni-dateformat/package.json

@@ -0,0 +1,83 @@
+{
+  "id": "uni-dateformat",
+  "displayName": "Dateformat 日期格式化",
+  "version": "0.0.3",
+  "description": "日期格式化组件,可以将日期格式化为1分钟前、刚刚等形式",
+  "keywords": [
+    "日期格式化",
+    "时间格式化",
+    "格式化时间",
+    "",
+    "date-format"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "y",
+          "联盟": "y"
+        }
+      }
+    }
+  }
+}

+ 71 - 0
uni_modules/uni-dateformat/readme.md

@@ -0,0 +1,71 @@
+
+
+### DateFormat 日期格式化
+> 代码块: `uDateformat`
+
+
+日期格式化组件。
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+### 基本用法
+
+在 ``template`` 中使用组件
+
+```html
+<!-- 一般用法 -->
+<uni-dateformat date="2020/10/20 20:20:20"></uni-dateformat>
+
+<!-- 不显示刚刚/马上/xx分钟前 -->
+<uni-dateformat date="2020/10/20 20:20:20" :threshold="[0,0]"></uni-dateformat>
+```
+
+## API
+
+### Dateformat Props
+
+|属性名		|类型							|默认值					|说明												|
+|:-:		|:-:							|:-:					|:-:												|
+|date		|Object&#124;String&#124;Number	|Date.now()				|要格式化的日期对象/日期字符串/时间戳				|
+|threshold	|Array							|[0, 0]					|转化类型阈值										|
+|format		|String							|'yyyy/MM/dd hh:mm:ss'	|格式字符串											|
+|locale		|String							|zh						|格式化使用的语言,目前支持zh(中文)、en(英文)	|
+
+
+#### Threshold Options
+
+格式化组件会对时间进行用户友好转化,threshold就是用来控制转化的时间阈值的。
+
+以`[60000, 3600000]`为例,将传入时间与当前时间差的绝对值记为delta(单位毫秒)
+
+- `delta < 60000`时,时间会被转化为“刚刚|马上”
+- `delta >= 60000 && delta < 3600000`时,时间会被转化为“xx分钟前|xx分钟后”,如果超过1小时会显示成“xx小时前|xx小时后”,以此类推
+- `delta >= 3600000`时,会按照format参数传入的格式进行格式化
+
+如果不想转化为“马上|刚刚”可以传入`:threshold = "[0,3600000]"`。默认值`[0,0]`既不会转换为“马上|刚刚”也不会转化为“xx分钟前|xx分钟后”
+
+#### Format Options
+
+format接收字符以及含义如下:
+
+|字符	|说明							|
+|:-:	|:-:							|
+|yyyy	|四位年份						|
+|yy		|两位年份						|
+|MM		|两位月份(不足两位在前面补0)	|
+|M		|月份,不自动补0				|
+|dd		|两位天(不足两位在前面补0)	|
+|d		|天,不自动补0					|
+|hh		|两位小时(不足两位在前面补0)	|
+|h		|小时,不自动补0				|
+|mm		|两位分钟(不足两位在前面补0)	|
+|m		|分钟,不自动补0				|
+|ss		|两位秒(不足两位在前面补0)	|
+|s		|秒,不自动补0					|
+|SSS	|三位毫秒(不足三位在前面补0)	|
+|S		|毫秒,不自动补0				|
+

+ 6 - 0
uni_modules/uni-datetime-picker/changelog.md

@@ -0,0 +1,6 @@
+## 1.0.6(2021-03-18)
+- 新增 hide-second 属性,时间支持仅选择时、分
+- 修复 选择跟显示的日期不一样的 bug
+- 修复 chang事件触发2次的 bug
+- 修复 分、秒 end 范围错误的 bug
+- 优化 更好的 nvue 适配

+ 45 - 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/keypress.js

@@ -0,0 +1,45 @@
+// #ifdef H5
+export default {
+  name: 'Keypress',
+  props: {
+    disable: {
+      type: Boolean,
+      default: false
+    }
+  },
+  mounted () {
+    const keyNames = {
+      esc: ['Esc', 'Escape'],
+      tab: 'Tab',
+      enter: 'Enter',
+      space: [' ', 'Spacebar'],
+      up: ['Up', 'ArrowUp'],
+      left: ['Left', 'ArrowLeft'],
+      right: ['Right', 'ArrowRight'],
+      down: ['Down', 'ArrowDown'],
+      delete: ['Backspace', 'Delete', 'Del']
+    }
+    const listener = ($event) => {
+      if (this.disable) {
+        return
+      }
+      const keyName = Object.keys(keyNames).find(key => {
+        const keyName = $event.key
+        const value = keyNames[key]
+        return value === keyName || (Array.isArray(value) && value.includes(keyName))
+      })
+      if (keyName) {
+        // 避免和其他按键事件冲突
+        setTimeout(() => {
+          this.$emit(keyName, {})
+        }, 0)
+      }
+    }
+    document.addEventListener('keyup', listener)
+    this.$once('hook:beforeDestroy', () => {
+      document.removeEventListener('keyup', listener)
+    })
+  },
+	render: () => {}
+}
+// #endif

+ 903 - 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue

@@ -0,0 +1,903 @@
+<template>
+	<view class="uni-datetime-picker">
+		<view @click="initTimePicker">
+			<slot>
+				<view class="uni-datetime-picker-timebox-pointer"
+					:class="{'uni-datetime-picker-disabled': disabled, 'uni-datetime-picker-timebox': border}">
+					<text class="uni-datetime-picker-text">{{time}}</text>
+					<view v-if="!time" class="uni-datetime-picker-time">
+						<text class="uni-datetime-picker-text">选择{{title}}</text>
+					</view>
+				</view>
+			</slot>
+		</view>
+		<view v-if="visible" id="mask" class="uni-datetime-picker-mask" @click="tiggerTimePicker"></view>
+		<view v-if="visible" class="uni-datetime-picker-popup" :class="[dateShow && timeShow ? '' : 'fix-nvue-height']" :style="fixNvueBug">
+			<view class="uni-title">
+				<text class="uni-datetime-picker-text">设置{{title}}</text>
+			</view>
+			<view v-if="dateShow" class="uni-datetime-picker__container-box">
+				<picker-view class="uni-datetime-picker-view" :indicator-style="indicatorStyle" :value="ymd"
+					@change="bindDateChange">
+					<picker-view-column>
+						<view class="uni-datetime-picker-item" v-for="(item,index) in years" :key="index">
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
+						</view>
+					</picker-view-column>
+					<picker-view-column>
+						<view class="uni-datetime-picker-item" v-for="(item,index) in months" :key="index">
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
+						</view>
+					</picker-view-column>
+					<picker-view-column>
+						<view class="uni-datetime-picker-item" v-for="(item,index) in days" :key="index">
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
+						</view>
+					</picker-view-column>
+				</picker-view>
+				<!-- 兼容 nvue 不支持伪类 -->
+				<text class="uni-datetime-picker-sign sign-left">-</text>
+				<text class="uni-datetime-picker-sign sign-right">-</text>
+			</view>
+			<view v-if="timeShow" class="uni-datetime-picker__container-box">
+				<picker-view class="uni-datetime-picker-view" :class="[hideSecond ? 'time-hide-second' : '']"
+					:indicator-style="indicatorStyle" :value="hms" @change="bindTimeChange">
+					<picker-view-column>
+						<view class="uni-datetime-picker-item" v-for="(item,index) in hours" :key="index">
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
+						</view>
+					</picker-view-column>
+					<picker-view-column>
+						<view class="uni-datetime-picker-item" v-for="(item,index) in minutes" :key="index">
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
+						</view>
+					</picker-view-column>
+					<picker-view-column v-if="!hideSecond">
+						<view class="uni-datetime-picker-item" v-for="(item,index) in seconds" :key="index">
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
+						</view>
+					</picker-view-column>
+				</picker-view>
+				<!-- 兼容 nvue 不支持伪类 -->
+				<text class="uni-datetime-picker-sign" :class="[hideSecond ? 'sign-center' : 'sign-left']">:</text>
+				<text v-if="!hideSecond" class="uni-datetime-picker-sign sign-right">:</text>
+			</view>
+			<view class="uni-datetime-picker-btn">
+				<view @click="clearTime">
+					<text class="uni-datetime-picker-btn-text">清空</text>
+				</view>
+				<view class="uni-datetime-picker-btn-group">
+					<view class="uni-datetime-picker-cancel" @click="tiggerTimePicker">
+						<text class="uni-datetime-picker-btn-text">取消</text>
+					</view>
+					<view @click="setTime">
+						<text class="uni-datetime-picker-btn-text">确定</text>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- #ifdef H5 -->
+		<keypress v-if="visible" @esc="tiggerTimePicker" @enter="setTime" />
+		<!-- #endif -->
+	</view>
+</template>
+
+<script>
+	// #ifdef H5
+	import keypress from './keypress'
+	// #endif
+
+	/**
+	 * DatetimePicker 时间选择器
+	 * @description 可以同时选择日期和时间的选择器
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=xxx
+	 * @property {String} type = [datetime | date | time] 显示模式
+	 * @property {Boolean} multiple = [true|false] 是否多选
+	 * @property {String|Number} value 默认值
+	 * @property {String|Number} start 起始日期或时间
+	 * @property {String|Number} end 起始日期或时间
+	 * @property {String} return-type = [timestamp | string]
+	 * @event {Function} change  选中发生变化触发
+	 */
+
+	export default {
+		name: 'UniDatetimePicker',
+		components: {
+			// #ifdef H5
+			keypress
+			// #endif
+		},
+		data() {
+			return {
+				indicatorStyle: `height: 50px;`,
+				visible: false,
+				fixNvueBug: {},
+				dateShow: true,
+				timeShow: true,
+				title: '日期和时间',
+				// 输入框当前时间
+				time: '',
+				// 当前的年月日时分秒
+				year: 1900,
+				month: 0,
+				day: 0,
+				hour: 0,
+				minute: 0,
+				second: 0,
+				// 起始时间
+				startYear: 1920,
+				startMonth: 1,
+				startDay: 1,
+				startHour: 0,
+				startMinute: 0,
+				startSecond: 0,
+				// 结束时间
+				endYear: 2120,
+				endMonth: 12,
+				endDay: 31,
+				endHour: 23,
+				endMinute: 59,
+				endSecond: 59,
+			}
+		},
+		props: {
+			type: {
+				type: String,
+				default: 'datetime'
+			},
+			value: {
+				type: [String, Number],
+				default: ''
+			},
+			start: {
+				type: [Number, String],
+				default: ''
+			},
+			end: {
+				type: [Number, String],
+				default: ''
+			},
+			returnType: {
+				type: String,
+				default: 'string'
+			},
+			disabled: {
+				type: [Boolean, String],
+				default: false
+			},
+			border: {
+				type: [Boolean, String],
+				default: true
+			},
+			hideSecond: {
+				type: [Boolean, String],
+				default: false
+			}
+		},
+		watch: {
+			value: {
+				handler(newVal, oldVal) {
+					if (newVal) {
+						this.parseValue(this.fixIosDateFormat(newVal)) //兼容 iOS、safari 日期格式
+						this.initTime(false)
+					} else {
+						this.parseValue(Date.now())
+					}
+				},
+				immediate: true
+			},
+			type: {
+				handler(newValue) {
+					if (newValue === 'date') {
+						this.dateShow = true
+						this.timeShow = false
+						this.title = '日期'
+					} else if (newValue === 'time') {
+						this.dateShow = false
+						this.timeShow = true
+						this.title = '时间'
+					} else {
+						this.dateShow = true
+						this.timeShow = true
+						this.title = '日期和时间'
+					}
+				},
+				immediate: true
+			},
+			start: {
+				handler(newVal) {
+					this.parseDatetimeRange(this.fixIosDateFormat(newVal), 'start') //兼容 iOS、safari 日期格式
+				},
+				immediate: true
+			},
+			end: {
+				handler(newVal) {
+					this.parseDatetimeRange(this.fixIosDateFormat(newVal), 'end') //兼容 iOS、safari 日期格式
+				},
+				immediate: true
+			},
+
+			// 月、日、时、分、秒可选范围变化后,检查当前值是否在范围内,不在则当前值重置为可选范围第一项
+			months(newVal) {
+				this.checkValue('month', this.month, newVal)
+			},
+			days(newVal) {
+				this.checkValue('day', this.day, newVal)
+			},
+			hours(newVal) {
+				this.checkValue('hour', this.hour, newVal)
+			},
+			minutes(newVal) {
+				this.checkValue('minute', this.minute, newVal)
+			},
+			seconds(newVal) {
+				this.checkValue('second', this.second, newVal)
+			}
+		},
+		created() {
+			this.form = this.getForm('uniForms')
+			this.formItem = this.getForm('uniFormsItem')
+
+			if (this.formItem) {
+				if (this.formItem.name) {
+					this.rename = this.formItem.name
+					this.form.inputChildrens.push(this)
+				}
+			}
+		},
+		computed: {
+			// 当前年、月、日、时、分、秒选择范围
+			years() {
+				return this.getCurrentRange('year')
+			},
+
+			months() {
+				return this.getCurrentRange('month')
+			},
+
+			days() {
+				return this.getCurrentRange('day')
+			},
+
+			hours() {
+				return this.getCurrentRange('hour')
+			},
+
+			minutes() {
+				return this.getCurrentRange('minute')
+			},
+
+			seconds() {
+				return this.getCurrentRange('second')
+			},
+
+			// picker 当前值数组
+			ymd() {
+				return [this.year - this.minYear, this.month - this.minMonth, this.day - this.minDay]
+			},
+			hms() {
+				return [this.hour - this.minHour, this.minute - this.minMinute, this.second - this.minSecond]
+			},
+
+			// 当前 date 是 start
+			currentDateIsStart() {
+				return this.year === this.startYear && this.month === this.startMonth && this.day === this.startDay
+			},
+
+			// 当前 date 是 end
+			currentDateIsEnd() {
+				return this.year === this.endYear && this.month === this.endMonth && this.day === this.endDay
+			},
+
+			// 当前年、月、日、时、分、秒的最小值和最大值
+			minYear() {
+				return this.startYear
+			},
+			maxYear() {
+				return this.endYear
+			},
+			minMonth() {
+				if (this.year === this.startYear) {
+					return this.startMonth
+				} else {
+					return 1
+				}
+			},
+			maxMonth() {
+				if (this.year === this.endYear) {
+					return this.endMonth
+				} else {
+					return 12
+				}
+			},
+			minDay() {
+				if (this.year === this.startYear && this.month === this.startMonth) {
+					return this.startDay
+				} else {
+					return 1
+				}
+			},
+			maxDay() {
+				if (this.year === this.endYear && this.month === this.endMonth) {
+					return this.endDay
+				} else {
+					return this.daysInMonth(this.year, this.month)
+				}
+			},
+			minHour() {
+				if (this.type === 'datetime') {
+					if (this.currentDateIsStart) {
+						return this.startHour
+					} else {
+						return 0
+					}
+				}
+				if (this.type === 'time') {
+					return this.startHour
+				}
+			},
+			maxHour() {
+				if (this.type === 'datetime') {
+					if (this.currentDateIsEnd) {
+						return this.endHour
+					} else {
+						return 23
+					}
+				}
+				if (this.type === 'time') {
+					return this.endHour
+				}
+			},
+			minMinute() {
+				if (this.type === 'datetime') {
+					if (this.currentDateIsStart && this.hour === this.startHour) {
+						return this.startMinute
+					} else {
+						return 0
+					}
+				}
+				if (this.type === 'time') {
+					if (this.hour === this.startHour) {
+						return this.startMinute
+					} else {
+						return 0
+					}
+				}
+			},
+			maxMinute() {
+				if (this.type === 'datetime') {
+					if (this.currentDateIsEnd && this.hour === this.endHour) {
+						return this.endMinute
+					} else {
+						return 59
+					}
+				}
+				if (this.type === 'time') {
+					if (this.hour === this.endHour) {
+						return this.endMinute
+					} else {
+						return 59
+					}
+				}
+			},
+			minSecond() {
+				if (this.type === 'datetime') {
+					if (this.currentDateIsStart && this.hour === this.startHour && this.minute === this.startMinute) {
+						return this.startSecond
+					} else {
+						return 0
+					}
+				}
+				if (this.type === 'time') {
+					if (this.hour === this.startHour && this.minute === this.startMinute) {
+						return this.startSecond
+					} else {
+						return 0
+					}
+				}
+			},
+			maxSecond() {
+				if (this.type === 'datetime') {
+					if (this.currentDateIsEnd && this.hour === this.endHour && this.minute === this.endMinute) {
+						return this.endSecond
+					} else {
+						return 59
+					}
+				}
+				if (this.type === 'time') {
+					if (this.hour === this.endHour && this.minute === this.endMinute) {
+						return this.endSecond
+					} else {
+						return 59
+					}
+				}
+			}
+		},
+
+		mounted() {
+			// #ifdef APP-NVUE
+			const res = uni.getSystemInfoSync();
+			this.fixNvueBug = {
+				top: res.windowHeight / 2,
+				left: res.windowWidth / 2
+			}
+			// #endif
+		},
+
+		methods: {
+			/**
+			 * @param {Object} item
+			 * 小于 10 在前面加个 0
+			 */
+
+			lessThanTen(item) {
+				return item < 10 ? '0' + item : item
+			},
+
+			/**
+			 * 获取父元素实例
+			 */
+			getForm(name = 'uniForms') {
+				let parent = this.$parent;
+				let parentName = parent.$options.name;
+				while (parentName !== name) {
+					parent = parent.$parent;
+					if (!parent) return false
+					parentName = parent.$options.name;
+				}
+				return parent;
+			},
+
+			/**
+			 * 解析时分秒字符串,例如:00:00:00
+			 * @param {String} timeString
+			 */
+			parseTimeType(timeString) {
+				if (timeString) {
+					let timeArr = timeString.split(':')
+					this.hour = Number(timeArr[0])
+					this.minute = Number(timeArr[1])
+					this.second = Number(timeArr[2])
+				}
+			},
+
+			/**
+			 * 解析选择器初始值,类型可以是字符串、时间戳,例如:2000-10-02、'08:30:00'、 1610695109000
+			 * @param {String | Number} datetime
+			 */
+			initPickerValue(datetime) {
+				let defaultValue = null
+				if (datetime) {
+					defaultValue = this.compareValueWithStartAndEnd(datetime, this.start, this.end)
+				} else {
+					defaultValue = Date.now()
+					defaultValue = this.compareValueWithStartAndEnd(defaultValue, this.start, this.end)
+				}
+				this.parseValue(defaultValue)
+			},
+
+			/**
+			 * 初始值规则:
+			 * - 用户设置初始值 value
+			 * 	- 设置了起始时间 start、终止时间 end,并 start < value < end,初始值为 value, 否则初始值为 start
+			 * 	- 只设置了起始时间 start,并 start < value,初始值为 value,否则初始值为 start
+			 * 	- 只设置了终止时间 end,并 value < end,初始值为 value,否则初始值为 end
+			 * 	- 无起始终止时间,则初始值为 value
+			 * - 无初始值 value,则初始值为当前本地时间 Date.now()
+			 * @param {Object} value
+			 * @param {Object} dateBase
+			 */
+			compareValueWithStartAndEnd(value, start, end) {
+				let winner = null
+				value = this.superTimeStamp(value)
+				start = this.superTimeStamp(start)
+				end = this.superTimeStamp(end)
+
+				if (start && end) {
+					if (value < start) {
+						winner = new Date(start)
+					} else if (value > end) {
+						winner = new Date(end)
+					} else {
+						winner = new Date(value)
+					}
+				} else if (start && !end) {
+					winner = start <= value ? new Date(value) : new Date(start)
+				} else if (!start && end) {
+					winner = value <= end ? new Date(value) : new Date(end)
+				} else {
+					winner = new Date(value)
+				}
+
+				return winner
+			},
+
+			/**
+			 * 转换为可比较的时间戳,接受日期、时分秒、时间戳
+			 * @param {Object} value
+			 */
+			superTimeStamp(value) {
+				let dateBase = ''
+				if (this.type === 'time' && value && typeof value === 'string') {
+					const now = new Date()
+					const year = now.getFullYear()
+					const month = now.getMonth() + 1
+					const day = now.getDate()
+					dateBase = year + '/' + month + '/' + day + ' '
+				}
+				if (Number(value) && typeof value !== NaN) {
+					value = parseInt(value)
+					dateBase = 0
+				}
+				return this.createTimeStamp(dateBase + value)
+			},
+
+			/**
+			 * 解析默认值 value,字符串、时间戳
+			 * @param {Object} defaultTime
+			 */
+			parseValue(value) {
+				if (!value) return
+				if (this.type === 'time' && typeof value === "string") {
+					this.parseTimeType(value)
+				} else {
+					let defaultDate = null
+					defaultDate = new Date(value)
+					if (this.type !== 'time') {
+						this.year = defaultDate.getFullYear()
+						this.month = defaultDate.getMonth() + 1
+						this.day = defaultDate.getDate()
+					}
+					if (this.type !== 'date') {
+						this.hour = defaultDate.getHours()
+						this.minute = defaultDate.getMinutes()
+						this.second = defaultDate.getSeconds()
+					}
+				}
+				if (this.hideSecond) {
+					this.second = 0
+				}
+			},
+
+			/**
+			 * 解析可选择时间范围 start、end,年月日字符串、时间戳
+			 * @param {Object} defaultTime
+			 */
+			parseDatetimeRange(point, pointType) {
+				if (point && this.type === 'time') {
+					const pointArr = point.split(':')
+					this[pointType + 'Hour'] = Number(pointArr[0])
+					this[pointType + 'Minute'] = Number(pointArr[1])
+					this[pointType + 'Second'] = Number(pointArr[2])
+				} else {
+					if (!point) {
+						pointType === 'start' ? this.startYear = this.year - 60 : this.endYear = this.year + 60
+						return
+					}
+					if (Number(point) && Number(point) !== NaN) {
+						point = parseInt(point)
+					}
+					// datetime 的 end 没有时分秒, 则不限制
+					const hasTime = /[0-9]:[0-9]/
+					if (this.type === 'datetime' && pointType === 'end' && typeof point === 'string' && !hasTime.test(
+							point)) {
+						point = point + ' 23:59:59'
+					}
+					const pointDate = new Date(point)
+					this[pointType + 'Year'] = pointDate.getFullYear()
+					this[pointType + 'Month'] = pointDate.getMonth() + 1
+					this[pointType + 'Day'] = pointDate.getDate()
+					if (this.type === 'datetime') {
+						this[pointType + 'Hour'] = pointDate.getHours()
+						this[pointType + 'Minute'] = pointDate.getMinutes()
+						this[pointType + 'Second'] = pointDate.getSeconds()
+					}
+				}
+			},
+
+			// 获取 年、月、日、时、分、秒 当前可选范围
+			getCurrentRange(value) {
+				const range = []
+				for (let i = this['min' + this.capitalize(value)]; i <= this['max' + this.capitalize(value)]; i++) {
+					range.push(i)
+				}
+				return range
+			},
+
+			// 字符串首字母大写
+			capitalize(str) {
+				return str.charAt(0).toUpperCase() + str.slice(1)
+			},
+
+			// 检查当前值是否在范围内,不在则当前值重置为可选范围第一项
+			checkValue(name, value, values) {
+				if (values.indexOf(value) === -1) {
+					this[name] = values[0]
+				}
+			},
+
+			// 每个月的实际天数
+			daysInMonth(year, month) { // Use 1 for January, 2 for February, etc.
+				return new Date(year, month, 0).getDate();
+			},
+
+			//兼容 iOS、safari 日期格式
+			fixIosDateFormat(value) {
+				if (typeof value === 'string') {
+					value = value.replace(/-/g, '/')
+				}
+				return value
+			},
+
+			/**
+			 * 生成时间戳
+			 * @param {Object} time
+			 */
+			createTimeStamp(time) {
+				if (!time) return
+				if (typeof time === "number") {
+					return time
+				} else {
+					time = time.replace(/-/g, '/')
+					if (this.type === 'date') {
+						time = time + ' ' + '00:00:00'
+					}
+					return Date.parse(time)
+				}
+			},
+
+			/**
+			 * 生成日期或时间的字符串
+			 */
+			createDomSting() {
+				const yymmdd = this.year +
+					'-' +
+					this.lessThanTen(this.month) +
+					'-' +
+					this.lessThanTen(this.day)
+
+				let hhmmss = this.lessThanTen(this.hour) +
+					':' +
+					this.lessThanTen(this.minute)
+
+				if(!this.hideSecond) {
+					hhmmss = hhmmss + ':' + this.lessThanTen(this.second)
+				}
+
+				if (this.type === 'date') {
+					return yymmdd
+				} else if (this.type === 'time') {
+					return hhmmss
+				} else {
+					return yymmdd + ' ' + hhmmss
+				}
+			},
+
+			/**
+			 * 初始化返回值,并抛出 change 事件
+			 */
+			initTime(emit = true) {
+				this.time = this.createDomSting()
+				if (!emit) return
+				if (this.returnType === 'timestamp' && this.type !== 'time') {
+					this.formItem && this.formItem.setValue(this.createTimeStamp(this.time))
+					this.$emit('change', this.createTimeStamp(this.time))
+					this.$emit('input', this.createTimeStamp(this.time))
+				} else {
+					this.formItem && this.formItem.setValue(this.time)
+					this.$emit('change', this.time)
+					this.$emit('input', this.time)
+				}
+			},
+
+			/**
+			 * 用户选择日期或时间更新 data
+			 * @param {Object} e
+			 */
+			bindDateChange(e) {
+				const val = e.detail.value
+				this.year = this.years[val[0]]
+				this.month = this.months[val[1]]
+				this.day = this.days[val[2]]
+			},
+			bindTimeChange(e) {
+				const val = e.detail.value
+				this.hour = this.hours[val[0]]
+				this.minute = this.minutes[val[1]]
+				this.second = this.seconds[val[2]]
+			},
+
+			/**
+			 * 初始化弹出层
+			 */
+			initTimePicker() {
+				if (this.disabled) return
+				const value = this.fixIosDateFormat(this.value)
+				this.initPickerValue(value)
+				this.visible = !this.visible
+			},
+
+			/**
+			 * 触发或关闭弹框
+			 */
+			tiggerTimePicker(e) {
+				this.visible = !this.visible
+			},
+
+			/**
+			 * 用户点击“清空”按钮,清空当前值
+			 */
+			clearTime() {
+				this.time = ''
+				this.formItem && this.formItem.setValue(this.time)
+				this.$emit('change', this.time)
+				this.$emit('input', this.time)
+				this.tiggerTimePicker()
+			},
+
+			/**
+			 * 用户点击“确定”按钮
+			 */
+			setTime() {
+				this.initTime()
+				this.tiggerTimePicker()
+			}
+		}
+	}
+</script>
+
+<style>
+	.uni-datetime-picker {
+		/* #ifndef APP-NVUE */
+		width: 100%;
+		/* #endif */
+	}
+
+	.uni-datetime-picker-view {
+		height: 130px;
+		width: 270px;
+		/* #ifndef APP-NVUE */
+		cursor: pointer;
+		/* #endif */
+	}
+
+	.uni-datetime-picker-item {
+		height: 50px;
+		line-height: 50px;
+		text-align: center;
+		font-size: 14px;
+	}
+
+	.uni-datetime-picker-btn {
+		margin-top: 60px;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		cursor: pointer;
+		/* #endif */
+		flex-direction: row;
+		justify-content: space-between;
+	}
+
+	.uni-datetime-picker-btn-text {
+		font-size: 14px;
+		color: #007AFF;
+	}
+
+	.uni-datetime-picker-btn-group {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+	}
+
+	.uni-datetime-picker-cancel {
+		margin-right: 30px;
+	}
+
+	.uni-datetime-picker-mask {
+		position: fixed;
+		bottom: 0px;
+		top: 0px;
+		left: 0px;
+		right: 0px;
+		background-color: rgba(0, 0, 0, 0.4);
+		transition-duration: 0.3s;
+		z-index: 998;
+	}
+
+	.uni-datetime-picker-popup {
+		border-radius: 8px;
+		padding: 30px;
+		width: 270px;
+		/* #ifdef APP-NVUE */
+		height: 500px;
+		/* #endif */
+		/* #ifdef APP-NVUE */
+		width: 330px;
+		/* #endif */
+		background-color: #fff;
+		position: fixed;
+		top: 50%;
+		left: 50%;
+		transform: translate(-50%, -50%);
+		transition-duration: 0.3s;
+		z-index: 999;
+	}
+
+	.fix-nvue-height {
+		/* #ifdef APP-NVUE */
+		height: 330px;
+		/* #endif */
+	}
+
+	.uni-datetime-picker-time {
+		color: grey;
+	}
+
+	.uni-datetime-picker-column {
+		height: 50px;
+	}
+
+	.uni-datetime-picker-timebox {
+
+		border: 1px solid #E5E5E5;
+		border-radius: 5px;
+		padding: 7px 10px;
+		/* #ifndef APP-NVUE */
+		box-sizing: border-box;
+		cursor: pointer;
+		/* #endif */
+	}
+
+	.uni-datetime-picker-timebox-pointer {
+		/* #ifndef APP-NVUE */
+		cursor: pointer;
+		/* #endif */
+	}
+
+
+	.uni-datetime-picker-disabled {
+		opacity: 0.4;
+		/* #ifdef H5 */
+		cursor: not-allowed !important;
+		/* #endif */
+	}
+
+	.uni-datetime-picker-text {
+		font-size: 14px;
+	}
+
+	.uni-datetime-picker-sign {
+		position: absolute;
+		top: 53px;
+		/* 减掉 10px 的元素高度,兼容nvue */
+		color: #999;
+		/* #ifdef APP-NVUE */
+		font-size: 16px;
+		/* #endif */
+	}
+
+	.sign-left {
+		left: 86px;
+	}
+
+	.sign-right {
+		right: 86px;
+	}
+
+	.sign-center {
+		left: 135px;
+	}
+
+	.uni-datetime-picker__container-box {
+		position: relative;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		margin-top: 40px;
+	}
+
+	.time-hide-second {
+		width: 180px;
+	}
+</style>

+ 82 - 0
uni_modules/uni-datetime-picker/package.json

@@ -0,0 +1,82 @@
+{
+  "id": "uni-datetime-picker",
+  "displayName": "DatetimePicker 日期选择器",
+  "version": "1.0.6",
+  "description": "DatetimePicker 可以同时选择日期和时间的选择器",
+  "keywords": [
+    "DatetimePicker",
+    "uni-ui",
+    "日期时间选择器",
+    "日期时间"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "n"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 61 - 0
uni_modules/uni-datetime-picker/readme.md

@@ -0,0 +1,61 @@
+
+
+## DatetimePicker 时间选择器
+> 代码块: `uDatetimePicker`
+
+
+该组件的优势是,支持**时间戳**输入和输出(起始时间、终止时间也支持时间戳),可**同时选择**日期和时间。
+
+若只是需要单独选择日期和时间,不需要时间戳输入和输出,可使用原生的 picker 组件。
+
+
+___点击 picker 默认值规则:___
+
+- 若设置初始值 value, 会显示在 picker 显示框中; 若无初始值 value,则初始值 value 为当前本地时间 Date.now(), 但不会显示在 picker 显示框中
+	- 设置了起始时间 start、终止时间 end,并 start < value < end,初始值为 value, 否则初始值为 start
+	- 只设置了起始时间 start,并 start < value,初始值为 value,否则初始值为 start
+	- 只设置了终止时间 end,并 value < end,初始值为 value,否则初始值为 end
+	- 无起始终止时间,则初始值为 value
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+### 基本用法
+
+在 ``template`` 中使用组件
+
+```html
+<uni-datetime-picker></uni-datetime-picker>
+<uni-datetime-picker v-model="vModelDatetime" start="2010-6-10 08:30:30" end="2021-6-10 08:30:30"></uni-datetime-picker>
+<uni-datetime-picker :value="timestamp" return-type="timestamp" start="1276129830000" end="1623285030000" @change="timestampChange"></uni-datetime-picker>
+<uni-datetime-picker type="date" :value="date" start="2020-6-15" end="2025-6-15" @change="dateChange"></uni-datetime-picker>
+<uni-datetime-picker type="time" :value="time" start="06:30:30" end="12:30:30" @change="timeChange"></uni-datetime-picker>
+```
+
+## API
+
+### DatetimePicker Props
+
+|属性名			|类型						|默认值		|值域									|说明																											|
+|:-:				|:-:						|:-:			|											|:-:																											|
+|type				|String					|datetime	|datetime、date、time	|选择器类型																								|
+|value			|String、Number	|-				|-										|输入框当前值																							|
+|start			|String、Number	|-				|-										|最小值,可以使用日期的字符串(String)、时间戳(Number)	|
+|end				|String、Number	|-				|-										|最大值,可以使用日期的字符串(String)、时间戳(Number)	|
+|return-type|String					|timestamp|timestamp 、string		|返回值格式																								|
+|border			|Boolean、String|true			|											|是否有边框																								|
+|hide-second|Boolean、String|false		|											|是否隐藏秒																								|
+|disabled		|Boolean、String|false		|											|是否不可选择																							|
+
+
+
+注:如 type 为 time 类型,无对应的时间戳,则返回值格式 return-type 无论为何值,都会返回 string
+
+### DatetimePicker Events
+
+|事件名称	|说明																				|返回值	|
+|:-:		|:-:																				|:-:		|
+|change	|确定日期时间时触发的事件,参数为当前选择的 value	|-			|

+ 2 - 0
uni_modules/uni-drawer/changelog.md

@@ -0,0 +1,2 @@
+## 1.0.6(2021-02-04)
+- 调整为uni_modules目录规范

+ 45 - 0
uni_modules/uni-drawer/components/uni-drawer/keypress.js

@@ -0,0 +1,45 @@
+// #ifdef H5
+export default {
+  name: 'Keypress',
+  props: {
+    disable: {
+      type: Boolean,
+      default: false
+    }
+  },
+  mounted () {
+    const keyNames = {
+      esc: ['Esc', 'Escape'],
+      tab: 'Tab',
+      enter: 'Enter',
+      space: [' ', 'Spacebar'],
+      up: ['Up', 'ArrowUp'],
+      left: ['Left', 'ArrowLeft'],
+      right: ['Right', 'ArrowRight'],
+      down: ['Down', 'ArrowDown'],
+      delete: ['Backspace', 'Delete', 'Del']
+    }
+    const listener = ($event) => {
+      if (this.disable) {
+        return
+      }
+      const keyName = Object.keys(keyNames).find(key => {
+        const keyName = $event.key
+        const value = keyNames[key]
+        return value === keyName || (Array.isArray(value) && value.includes(keyName))
+      })
+      if (keyName) {
+        // 避免和其他按键事件冲突
+        setTimeout(() => {
+          this.$emit(keyName, {})
+        }, 0)
+      }
+    }
+    document.addEventListener('keyup', listener)
+    this.$once('hook:beforeDestroy', () => {
+      document.removeEventListener('keyup', listener)
+    })
+  },
+	render: () => {}
+}
+// #endif

+ 181 - 0
uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue

@@ -0,0 +1,181 @@
+<template>
+	<view v-if="visibleSync" :class="{ 'uni-drawer--visible': showDrawer }" class="uni-drawer" @touchmove.stop.prevent="clear">
+		<view class="uni-drawer__mask" :class="{ 'uni-drawer__mask--visible': showDrawer && mask }" @tap="close('mask')" />
+		<view class="uni-drawer__content" :class="{'uni-drawer--right': rightMode,'uni-drawer--left': !rightMode, 'uni-drawer__content--visible': showDrawer}" :style="{width:drawerWidth+'px'}">
+			<slot />
+		</view>
+		<!-- #ifdef H5 -->
+		<keypress @esc="close('mask')" />
+		<!-- #endif -->
+	</view>
+</template>
+
+<script>
+	// #ifdef H5
+	import keypress from './keypress.js'
+	// #endif
+	/**
+	 * Drawer 抽屉
+	 * @description 抽屉侧滑菜单
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=26
+	 * @property {Boolean} mask = [true | false] 是否显示遮罩
+	 * @property {Boolean} maskClick = [true | false] 点击遮罩是否关闭
+	 * @property {Boolean} mode = [left | right] Drawer 滑出位置
+	 * 	@value left 从左侧滑出
+	 * 	@value right 从右侧侧滑出
+	 * @property {Number} width 抽屉的宽度 ,仅 vue 页面生效
+	 * @event {Function} close 组件关闭时触发事件
+	 */
+	export default {
+		name: 'UniDrawer',
+		components: {
+			// #ifdef H5
+			keypress
+			// #endif
+		},
+		props: {
+			/**
+			 * 显示模式(左、右),只在初始化生效
+			 */
+			mode: {
+				type: String,
+				default: ''
+			},
+			/**
+			 * 蒙层显示状态
+			 */
+			mask: {
+				type: Boolean,
+				default: true
+			},
+			/**
+			 * 遮罩是否可点击关闭
+			 */
+			maskClick:{
+				type: Boolean,
+				default: true
+			},
+			/**
+			 * 抽屉宽度
+			 */
+			width: {
+				type: Number,
+				default: 220
+			}
+		},
+		data() {
+			return {
+				visibleSync: false,
+				showDrawer: false,
+				rightMode: false,
+				watchTimer: null,
+				drawerWidth: 220
+			}
+		},
+		created() {
+			// #ifndef APP-NVUE
+			this.drawerWidth = this.width
+			// #endif
+			this.rightMode = this.mode === 'right'
+		},
+		methods: {
+			clear(){},
+			close(type) {
+				// fixed by mehaotian 抽屉尚未完全关闭或遮罩禁止点击时不触发以下逻辑
+				if((type === 'mask' && !this.maskClick) || !this.visibleSync) return
+				this._change('showDrawer', 'visibleSync', false)
+			},
+			open() {
+				// fixed by mehaotian 处理重复点击打开的事件
+				if(this.visibleSync) return
+				this._change('visibleSync', 'showDrawer', true)
+			},
+			_change(param1, param2, status) {
+				this[param1] = status
+				if (this.watchTimer) {
+					clearTimeout(this.watchTimer)
+				}
+				this.watchTimer = setTimeout(() => {
+					this[param2] = status
+					this.$emit('change',status)
+				}, status ? 50 : 300)
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	// 抽屉宽度
+	$drawer-width: 220px;
+
+	.uni-drawer {
+		/* #ifndef APP-NVUE */
+		display: block;
+		/* #endif */
+		position: fixed;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		overflow: hidden;
+		z-index: 999;
+	}
+
+	.uni-drawer__content {
+		/* #ifndef APP-NVUE */
+		display: block;
+		/* #endif */
+		position: absolute;
+		top: 0;
+		width: $drawer-width;
+		bottom: 0;
+		background-color: $uni-bg-color;
+		transition: transform 0.3s ease;
+	}
+
+	.uni-drawer--left {
+		left: 0;
+		/* #ifdef APP-NVUE */
+		transform: translateX(-$drawer-width);
+		/* #endif */
+		/* #ifndef APP-NVUE */
+		transform: translateX(-100%);
+		/* #endif */
+	}
+
+	.uni-drawer--right {
+		right: 0;
+		/* #ifdef APP-NVUE */
+		transform: translateX($drawer-width);
+		/* #endif */
+		/* #ifndef APP-NVUE */
+		transform: translateX(100%);
+		/* #endif */
+	}
+
+	.uni-drawer__content--visible {
+		transform: translateX(0px);
+	}
+
+
+	.uni-drawer__mask {
+		/* #ifndef APP-NVUE */
+		display: block;
+		/* #endif */
+		opacity: 0;
+		position: absolute;
+		top: 0;
+		left: 0;
+		bottom: 0;
+		right: 0;
+		background-color: $uni-bg-color-mask;
+		transition: opacity 0.3s;
+	}
+
+	.uni-drawer__mask--visible {
+		/* #ifndef APP-NVUE */
+		display: block;
+		/* #endif */
+		opacity: 1;
+	}
+</style>

+ 83 - 0
uni_modules/uni-drawer/package.json

@@ -0,0 +1,83 @@
+{
+  "id": "uni-drawer",
+  "displayName": "Drawer 抽屉",
+  "version": "1.0.6",
+  "description": "抽屉式导航,用于展示侧滑菜单,侧滑导航。",
+  "keywords": [
+    "drawer",
+    "uni-ui",
+    "抽屉",
+    "侧滑导航",
+    "侧滑"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

Some files were not shown because too many files changed in this diff