unknown 2 سال پیش
والد
کامیت
5359353d49
100فایلهای تغییر یافته به همراه11895 افزوده شده و 0 حذف شده
  1. 16 0
      .hbuilderx/launch.json
  2. BIN
      static/back_r.png
  3. BIN
      static/back_w.png
  4. BIN
      static/colse_fill.png
  5. BIN
      static/home.png
  6. BIN
      static/home/home12.png
  7. BIN
      static/home/home13.png
  8. BIN
      static/home/home5.png
  9. BIN
      static/home_b.png
  10. BIN
      static/img/aimg.png
  11. BIN
      static/img/aimg1.png
  12. BIN
      static/img/deng1.png
  13. BIN
      static/img/deng2.png
  14. BIN
      static/img/deng3.png
  15. BIN
      static/img/deng4.png
  16. BIN
      static/img/deng5.png
  17. BIN
      static/img/icon-account.png
  18. BIN
      static/img/icon-my1.png
  19. BIN
      static/img/icon-my2.png
  20. BIN
      static/img/icon-square1.png
  21. BIN
      static/img/icon-square2.png
  22. BIN
      static/img/icon-weixin.png
  23. BIN
      static/img/icon-workspace1.png
  24. BIN
      static/img/icon-workspace2.png
  25. BIN
      static/img/icon1.png
  26. BIN
      static/img/icon2.png
  27. BIN
      static/img/icon3.png
  28. BIN
      static/img/icon4.png
  29. BIN
      static/img/png1.png
  30. BIN
      static/img/png2.png
  31. BIN
      static/img/png3.png
  32. BIN
      static/img/png4.png
  33. BIN
      static/img/renzheng3.png
  34. BIN
      static/map.png
  35. BIN
      static/menus.png
  36. BIN
      static/play.png
  37. BIN
      static/s.png
  38. BIN
      static/search.png
  39. BIN
      static/searchB.png
  40. BIN
      static/uni.ttf
  41. 70 0
      uni_modules/sakura-canvas/changelog.md
  42. 1445 0
      uni_modules/sakura-canvas/js_sdk/draw.js
  43. 147 0
      uni_modules/sakura-canvas/js_sdk/image-tools.js
  44. 1088 0
      uni_modules/sakura-canvas/js_sdk/qrcode.js
  45. 346 0
      uni_modules/sakura-canvas/js_sdk/util.js
  46. 79 0
      uni_modules/sakura-canvas/package.json
  47. 478 0
      uni_modules/sakura-canvas/readme.md
  48. 20 0
      uni_modules/uni-badge/changelog.md
  49. 253 0
      uni_modules/uni-badge/components/uni-badge/uni-badge.vue
  50. 88 0
      uni_modules/uni-badge/package.json
  51. 58 0
      uni_modules/uni-badge/readme.md
  52. 10 0
      uni_modules/uni-calendar/changelog.md
  53. 546 0
      uni_modules/uni-calendar/components/uni-calendar/calendar.js
  54. 12 0
      uni_modules/uni-calendar/components/uni-calendar/i18n/en.json
  55. 8 0
      uni_modules/uni-calendar/components/uni-calendar/i18n/index.js
  56. 12 0
      uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hans.json
  57. 12 0
      uni_modules/uni-calendar/components/uni-calendar/i18n/zh-Hant.json
  58. 181 0
      uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue
  59. 547 0
      uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue
  60. 352 0
      uni_modules/uni-calendar/components/uni-calendar/util.js
  61. 88 0
      uni_modules/uni-calendar/package.json
  62. 103 0
      uni_modules/uni-calendar/readme.md
  63. 12 0
      uni_modules/uni-card/changelog.md
  64. 431 0
      uni_modules/uni-card/components/uni-card/uni-card.vue
  65. 89 0
      uni_modules/uni-card/package.json
  66. 104 0
      uni_modules/uni-card/readme.md
  67. 27 0
      uni_modules/uni-collapse/changelog.md
  68. 402 0
      uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue
  69. 146 0
      uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue
  70. 88 0
      uni_modules/uni-collapse/package.json
  71. 276 0
      uni_modules/uni-collapse/readme.md
  72. 10 0
      uni_modules/uni-combox/changelog.md
  73. 239 0
      uni_modules/uni-combox/components/uni-combox/uni-combox.vue
  74. 89 0
      uni_modules/uni-combox/package.json
  75. 52 0
      uni_modules/uni-combox/readme.md
  76. 14 0
      uni_modules/uni-countdown/changelog.md
  77. 6 0
      uni_modules/uni-countdown/components/uni-countdown/i18n/en.json
  78. 8 0
      uni_modules/uni-countdown/components/uni-countdown/i18n/index.js
  79. 6 0
      uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hans.json
  80. 6 0
      uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hant.json
  81. 260 0
      uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue
  82. 86 0
      uni_modules/uni-countdown/package.json
  83. 57 0
      uni_modules/uni-countdown/readme.md
  84. 36 0
      uni_modules/uni-data-checkbox/changelog.md
  85. 823 0
      uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
  86. 87 0
      uni_modules/uni-data-checkbox/package.json
  87. 299 0
      uni_modules/uni-data-checkbox/readme.md
  88. 25 0
      uni_modules/uni-data-picker/changelog.md
  89. 45 0
      uni_modules/uni-data-picker/components/uni-data-picker/keypress.js
  90. 472 0
      uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
  91. 545 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
  92. 300 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
  93. 90 0
      uni_modules/uni-data-picker/package.json
  94. 270 0
      uni_modules/uni-data-picker/readme.md
  95. 7 0
      uni_modules/uni-dateformat/changelog.md
  96. 200 0
      uni_modules/uni-dateformat/components/uni-dateformat/date-format.js
  97. 88 0
      uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue
  98. 88 0
      uni_modules/uni-dateformat/package.json
  99. 77 0
      uni_modules/uni-dateformat/readme.md
  100. 76 0
      uni_modules/uni-datetime-picker/changelog.md

+ 16 - 0
.hbuilderx/launch.json

@@ -0,0 +1,16 @@
+{ // 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": [{
+     	"default" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"mp-weixin" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"type" : "uniCloud"
+     }
+    ]
+}

BIN
static/back_r.png


BIN
static/back_w.png


BIN
static/colse_fill.png


BIN
static/home.png


BIN
static/home/home12.png


BIN
static/home/home13.png


BIN
static/home/home5.png


BIN
static/home_b.png


BIN
static/img/aimg.png


BIN
static/img/aimg1.png


BIN
static/img/deng1.png


BIN
static/img/deng2.png


BIN
static/img/deng3.png


BIN
static/img/deng4.png


BIN
static/img/deng5.png


BIN
static/img/icon-account.png


BIN
static/img/icon-my1.png


BIN
static/img/icon-my2.png


BIN
static/img/icon-square1.png


BIN
static/img/icon-square2.png


BIN
static/img/icon-weixin.png


BIN
static/img/icon-workspace1.png


BIN
static/img/icon-workspace2.png


BIN
static/img/icon1.png


BIN
static/img/icon2.png


BIN
static/img/icon3.png


BIN
static/img/icon4.png


BIN
static/img/png1.png


BIN
static/img/png2.png


BIN
static/img/png3.png


BIN
static/img/png4.png


BIN
static/img/renzheng3.png


BIN
static/map.png


BIN
static/menus.png


BIN
static/play.png


BIN
static/s.png


BIN
static/search.png


BIN
static/searchB.png


BIN
static/uni.ttf


+ 70 - 0
uni_modules/sakura-canvas/changelog.md

@@ -0,0 +1,70 @@
+## 1.0.29(2021-08-05)
+[修改] 安卓上面图片不显示的问题
+## 1.0.28(2021-08-05)
+[修改] 安卓上面图片不显示的问题
+## 1.0.27(2021-08-05)
+[修改] 安卓上面图片不显示的问题
+## 1.0.26(2021-07-27)
+紧急,忘记改方法名称了。
+## 1.0.25(2021-07-27)
+[修改] 绘制文字时,callBack ex值的不准缺席
+[修改] 绘制图片时,当图片为空时一直停留在绘制状态中的问题
+## 1.0.24(2021-07-22)
+修改 绘制透明背景的png图片时背景成黑色
+## 1.0.23(2021-07-22)
+修改 绘制透明背景的png图片时背景成黑色
+## 1.0.22(2021-07-22)
+...
+## 1.0.21(2021-07-21)
+...
+## 1.0.20(2021-07-21)
+绘制文字添加 lastWidth 属性,用于限制行数的时候,最后一行的宽度 
+绘制矩形,绘制图片添加 borderType属性,用于设置圆角方向
+## 1.0.19(2021-07-21)
+绘制文字添加 lastWidth 属性,用于限制行数的时候,最后一行的宽度
+绘制矩形,绘制图片添加 borderType属性,用于设置圆角方向
+## 1.0.18(2021-07-10)
+修复绘制文字传入的内容是Number类型时的错误
+## 1.0.17(2021-07-01)
+完善文档
+## 1.0.16(2021-07-01)
+添加示例项目
+## 1.0.15(2021-07-01)
+添加callBack
+## 1.0.14(2021-07-01)
+紧急修复因为疏忽导致的问题
+修改文档参数
+## 1.0.13(2021-06-30)
+修改一些很蠢的问题
+文字添加首行缩进功能
+添加绘制海报示例
+## 1.0.12(2021-06-30)
+绘制文字添加\n实现自定义换行
+## 1.0.11(2021-06-29)
+添加绘制二维码功能
+添加矩形,圆形,三角形绘制边框功能
+## 1.0.10(2021-06-28)
+添加 三角形定点朝向
+## 1.0.09(2021-06-27)
+添加图片设置透明度
+## 1.0.08(2021-06-26)
+添加实例项目
+## 1.0.07(2021-06-26)
+添加使用文档
+## 1.0.06(2021-06-25)
+1、添加图片压缩
+2、添加绘制三角形
+3、添加绘制三角形图片
+4、添加图片旋转,矩形旋转。三角形旋转
+## 1.0.05(2021-06-18)
+添加图片mode模式
+## 1.0.04(2021-06-16)
+[优化] 绘制canvas的的速度
+## 1.0.03(2021-06-15)
+使用class重新书写绘制canvas
+## 1.0.02(2021-06-08)
+无
+## 1.0.01(2021-06-08)
+无
+## 1.0.0(2021-06-08)
+无

+ 1445 - 0
uni_modules/sakura-canvas/js_sdk/draw.js

@@ -0,0 +1,1445 @@
+import { base64ToPathFn, downloadFile, showLoading, hideLoading, 
+		countTextLength, getImageInfo, getModeImage, compressImage } from './util'
+
+import QRCodeAlg from './qrcode'
+
+/**
+ * 绘制
+ */
+export default class Draw{
+	constructor(params = {}) {
+		let { width, canvasId, height, background, drawDelayTime, delayTime, _this, fileType, quality, isCompressImage } = params
+		this.width = width
+		this.height = height
+		this.canvasId = canvasId || null
+		this.background = background || {
+			type: 'color',
+			w: this.width,
+			h: this.height,
+			color: '#ffffff'
+		}
+		this.drawDelayTime = drawDelayTime || 200
+		this.delayTime = delayTime || 200
+		this._this = _this || null
+		this.Context = uni.createCanvasContext(this.canvasId, this._this)
+		// 导出图片的类型
+		this.fileType = fileType || 'png'
+		// 导出图片的质量
+		this.quality = quality || 1
+		// 是否压缩图片,填写时绘制图片会进行压缩操作。绘制图片也能填写该参数。层级大于当前
+		this.isCompressImage = isCompressImage || false
+		this.callBack = {
+			bgObj: {
+				width: this.background.w,
+				height: this.background.h
+			},
+			ctxObj: {
+				width,
+				height
+			}
+		}
+		this.drawTipsText = params.drawTipsText || '绘制中...'
+		this.allCallBack = []
+	}
+
+	/**
+	 * 绘制矩形
+	 * @param { Object } params 绘制内容
+	 */
+	drawRect(params = {}) {
+		let { width, Context } = this
+		let { x, y, w, h, r, color, alpha, isFill, lineWidth, windowAlign, rotate, drawImage, borderColor, borderWidth, borderType } = {
+			x: params.x || 0,
+			y: params.y || 0,
+			w: params.w || width,
+			h: params.h || 0,
+			r: params.r || 0,
+			color: params.color || '#000000',
+			borderWidth: params.borderWidth || 0,
+			borderColor: params.borderColor || '#000000',
+			borderType: params.borderType || 'default',
+			alpha: params.alpha || 1,
+			lineWidth: params.lineWidth || 1,
+			isFill: params.isFill == undefined ? true : params.isFill,
+			// 窗口对齐的方式 默认: none 可选 居中: center 右边: right
+			windowAlign: params.windowAlign || 'none',
+			// 旋转
+			rotate: params.rotate || {},
+			// 是否是在绘制图片,默认不是
+			drawImage: params.drawImage == undefined ? false : params.drawImage,
+		}
+		if (r * 2 > h) {
+			r = h / 2
+		}
+		if (!drawImage && rotate.deg) {
+			Context.save()
+			this.setRotate(x, y, w, h, rotate)
+		}
+		Context.beginPath()
+		Context.setGlobalAlpha(alpha)
+		if (windowAlign != 'none') {
+			x = this.computedCenterX(width, w, windowAlign)
+		}
+		let tr = 0
+		let tl = 0
+		let br = 0
+		let bl = 0
+		if (typeof borderType == 'string') {
+			switch(borderType) {
+				case 'tr':
+					tr = r
+					break
+				case 'tl':
+					tl = r
+					break
+				case 'br':
+					br = r
+					break
+				case 'bl':
+					bl = r
+					break
+				default:
+					tr = r
+					tl = r
+					br = r
+					bl = r
+			}
+		}
+		if (borderType instanceof Array) {
+			if (borderType.includes('tr')) {
+				tr = r
+			}
+			if (borderType.includes('tl')) {
+				tl = r
+			}
+			if (borderType.includes('br')) {
+				br = r
+			}
+			if (borderType.includes('bl')) {
+				bl = r
+			}
+			if (borderType.includes('default')) {
+				tr = r
+				tl = r
+				br = r
+				bl = r
+			}
+		}
+		// 上右 tr
+		Context.lineTo(x + tl, y)
+		Context.arc(x + w - tr, y + tr, tr, Math.PI * 1.5, 0, false)
+		// 下右 br
+		Context.lineTo(x + w, y + h - br)
+		Context.arc(x + w - br,y + h - br, br, 0, Math.PI * .5, false)
+		// 下左 bl
+		Context.lineTo(x + bl, y + h)
+		Context.arc(x + bl, y + h - bl, bl, Math.PI * .5, Math.PI, false)
+		// 上左 tl
+		Context.lineTo(x, y + tl)
+		Context.arc(x + tl, y + tl, tl, Math.PI * 1, Math.PI * 1.5, false)
+		Context.closePath()
+		if (isFill) {
+			if (borderWidth != 0) {
+				Context.setLineWidth(borderWidth)
+				Context.setStrokeStyle(borderColor)
+				Context.stroke()
+			}
+			Context.setFillStyle(color)
+			Context.fill()
+		} else {
+			Context.setLineWidth(lineWidth)
+			Context.setStrokeStyle(color)
+			Context.stroke()
+		}
+		Context.setGlobalAlpha(1)
+		if (!drawImage && rotate.deg) {
+			Context.restore()
+		}
+	}
+
+	/**
+	 * 绘制圆
+	 * @param { Object } params 绘制内容
+	 */
+	drawArc(params = {}) {
+		let { width, Context } = this
+		let { x, y, r, s, e, d, alpha, isFill, lineWidth, color, windowAlign, borderColor, borderWidth } = {
+			x: params.x || 0,
+			y: params.y || 0,
+			r: params.r || 0,
+			s: params.s || 0,
+			e: params.e || Math.PI * 2,
+			// 可选。指定弧度的方向是逆时针还是顺时针。默认是false,即顺时针。
+			d: params.d == undefined ? false : params.d,
+			alpha: params.alpha || 1,
+			isFill: params.isFill == undefined ? true : params.isFill,
+			lineWidth: params.lineWidth || 1,
+			borderWidth: params.borderWidth || 0,
+			borderColor: params.borderColor || '#000000',
+			color: params.color || '#000000',
+			// 窗口对齐的方式 默认: none 可选 居中: center 右边: right
+			windowAlign: params.windowAlign || 'none'
+		}
+		Context.beginPath()
+		Context.setGlobalAlpha(alpha)
+		x = x + r
+		y = y + r
+		if (windowAlign != 'none') {
+			x = this.computedCenterX(width, r * 2, windowAlign)
+			x += r
+		}
+		Context.arc(x, y, r, s, e, d)
+		if (isFill) {
+			if (borderWidth != 0) {
+				Context.setLineWidth(borderWidth)
+				Context.setStrokeStyle(borderColor)
+				Context.stroke()
+			}
+			Context.setFillStyle(color)
+			Context.fill()
+		} else {
+			Context.setLineWidth(lineWidth)
+			Context.setStrokeStyle(color)
+			Context.stroke()
+		}
+		Context.setGlobalAlpha(1)
+	}
+
+
+	/**
+	 * 绘制三角形
+	 * @param @param { Object } params 绘制内容
+	 */
+	drawTriangle(params = {}) {
+		let { Context, width } = this
+		let { x, y, w, h, color, alpha, isFill, lineWidth, drawType, coordinate, rotate, windowAlign, direction, borderWidth, borderColor } = {
+			x: params.x || 0,
+			y: params.y || 0,
+			w: params.w || 0,
+			h: params.h || 0,
+			color: params.color || '#000000',
+			borderWidth: params.borderWidth || 0,
+			borderColor: params.borderColor || '#000000',
+			alpha: params.alpha || 1,
+			isFill: params.isFill == undefined ? true : params.isFill,
+			lineWidth: params.lineWidth || 1,
+			// 当绘制类别是自定义的时候需要传递的参数
+			coordinate: params.coordinate || [],
+			// 绘制三角形的类型
+			// right: 直角三角形
+			// isosceles: 等腰三角形
+			// custom: 自定义时,x, y, 宽, 高都不需要传递。需要传递绘制点的坐标类型是数组(coordinate)
+			// [[1, 3], [2, 3], [4, 5]]
+			drawType: params.drawType || 'isosceles',
+			// 三角形顶点朝向 top, left, right, bottom
+			direction: params.direction || 'top',
+			// 旋转
+			rotate: params.rotate || {},
+			// 窗口对齐的方式 默认: none 可选 居中: center 右边: right
+			windowAlign: params.windowAlign || 'none'
+		}
+		if (windowAlign != 'none' && drawType != 'custom') {
+			x = this.computedCenterX(width, w, windowAlign)
+		}
+		if (rotate.deg && drawType != 'custom') {
+			Context.save()
+			this.setTriangleRotate(x, y, w, h, rotate, drawType)
+		}
+		Context.beginPath()
+		Context.setGlobalAlpha(alpha)
+		if (drawType == 'isosceles') {
+			switch (direction) {
+				case 'top':
+					Context.lineTo(x + w / 2, y)
+					Context.lineTo(x, y + h)
+					Context.lineTo(x + w, y + h)
+					break
+				case 'bottom':
+					Context.lineTo(x, y)
+					Context.lineTo(x + w, y)
+					Context.lineTo(x + w / 2, y + h)
+					break
+				case 'right':
+					Context.lineTo(x, y)
+					Context.lineTo(x, y + h)
+					Context.lineTo(x + w, y + h / 2)
+					break
+				case 'left':
+					Context.lineTo(x + w, y)
+					Context.lineTo(x + w, y + h)
+					Context.lineTo(x, y + h / 2)
+					break
+			}
+		} else if (drawType == 'right') {
+			switch (direction) {
+				case 'top':
+					Context.lineTo(x, y)
+					Context.lineTo(x, y + h)
+					Context.lineTo(x + w, y + h)
+					break
+				case 'bottom':
+					Context.lineTo(x, y)
+					Context.lineTo(x + w, y)
+					Context.lineTo(x, y + h)
+					break
+				case 'left':
+					Context.lineTo(x, y)
+					Context.lineTo(x, y + h)
+					Context.lineTo(x + w, y)
+					break
+				case 'right':
+					Context.lineTo(x, y + h)
+					Context.lineTo(x + w, y + h)
+					Context.lineTo(x + w, y)
+					break
+			}
+			
+		} else if (drawType == 'custom') {
+			for (let i of coordinate) {
+				Context.lineTo(i[0], i[1])
+			}
+		}
+		Context.closePath()
+		if (isFill) {
+			if (borderWidth != 0) {
+				Context.setLineWidth(borderWidth)
+				Context.setStrokeStyle(borderColor)
+				Context.stroke()
+			}
+			Context.setFillStyle(color)
+			Context.fill()
+		} else {
+			Context.setLineWidth(lineWidth)
+			Context.setStrokeStyle(color)
+			Context.stroke()
+		}
+		Context.setGlobalAlpha(1)
+		if (rotate.deg && drawType != 'custom') {
+			Context.restore()
+		}
+	}
+
+
+	/**
+	 * 绘制图片
+	 * @param { Object } params 绘制内容
+	 */
+	drawImage(params = {}) {
+		let { width, Context } = this
+		return new Promise(async resolve => {
+			try {
+				let { x, y, w, h, r, src, alpha, drawType, borderWidth, windowAlign, color, mode, rotate, triangle, isCompressImage, quality, borderColor, borderType } = {
+					x: params.x || 0,
+					y: params.y || 0,
+					w: params.w || width,
+					h: params.h || 0,
+					r: params.r || 0,
+					src: params.src || '',
+					alpha: params.alpha || 1,
+					mode: params.mode || 'aspectFill',
+					// default: 默认,rect: 圆角矩形, arc: 圆形 triangle: 三角形
+					drawType: params.drawType || 'default',
+					borderWidth: params.borderWidth || 0,
+					borderColor: params.borderColor || '#000000',
+					borderType: params.borderType || 'default',
+					color: params.color || '#ffffff',
+					// 窗口对齐的方式 默认: none 可选 居中: center 右边: right
+					windowAlign: params.windowAlign || 'none',
+					// 旋转
+					rotate: params.rotate || {},
+					// 绘制三角形图片时三角形的内容
+					// triangle.type 三角形的类型 right: 直角三角形 isosceles: 等腰三角形 custom: 自定义三角形(不支持旋转)
+					// triangle.coordinate 自定义三角形时传递的坐标
+					// triangle.direction 三角形顶点朝向
+					triangle: params.triangle || {},
+					// 是否压缩图片
+					isCompressImage: params.isCompressImage != undefined ? params.isCompressImage : this.isCompressImage,
+					// 压缩图片时图片的质量只对jpg类型的图片生效
+					quality: params.quality || 80
+				}
+				if (!/\S/.test(src)) {
+					return resolve({
+						success: false,
+						message: '图片路径为空'
+					})
+				}
+				src = await base64ToPathFn(src)
+				// #ifndef MP-TOUTIAO
+				if (src.includes('http')) {
+					let downlaod = await downloadFile(src)
+					if (downlaod.data.statusCode != 200) {
+						hideLoading()
+						return resolve({
+							success: false,
+							msg: `图片路径为:${src}的文件下载失败`
+						})
+					}
+					if (!downlaod.success) {
+						hideLoading()
+						return resolve({
+							success: false,
+							msg: '下载图片失败'
+						})
+					}
+					src = downlaod.data.tempFilePath
+				}
+				// #endif
+				if (windowAlign != 'none') {
+					x = this.computedCenterX(width, w, windowAlign)
+				}
+				// #ifndef H5
+				// 压缩图片(不支持H5)
+				// if (isCompressImage) {
+				// 	let compressRes = await compressImage({
+				// 		src,
+				// 		quality
+				// 	})
+				// 	if (!compressRes.success) {
+				// 		return resolve(compressRes)
+				// 	}
+				// 	src = compressRes.src
+				// }
+				// #endif
+				// showLoading('获取图片信息中....')
+				let imageInfo = await getImageInfo(src)
+				if (!imageInfo.success) {
+					hideLoading()
+					return resolve(imageInfo)
+				}
+				// hideLoading()
+				let modeImage = getModeImage(Number(imageInfo.width), Number(imageInfo.height), x, y, w, h, mode)
+				let { dx, dy, dw, dh, sw, sh, sx, sy } = modeImage
+				Context.beginPath()
+				if (drawType == 'default') {
+					Context.save()
+					this.setRotate(x, y, w, h, rotate)
+					this.drawRect({
+						x,
+						y,
+						w,
+						h,
+						alpha,
+						color,
+						drawImage: true
+					})
+					Context.clip()
+					Context.setGlobalAlpha(alpha)
+					if (mode != 'default') {
+						await Context.drawImage(src, dx, dy, dw, dh, sx, sy, sw, sh)
+					} else {
+						await Context.drawImage(src, dx, dy, dw, dh)
+					}
+					Context.restore()
+				} else if (drawType == 'arc') {
+					// 绘制圆形图片
+					Context.save()
+					this.setRotate(x, y, w, h, rotate)
+					this.drawArc({
+						x,
+						y,
+						r: w / 2,
+						borderWidth,
+						borderColor,
+						color,
+					}, true)
+					Context.clip()
+					Context.setGlobalAlpha(alpha)
+					if (mode != 'default') {
+						await Context.drawImage(src, dx, dy, dw, dh, sx, sy, sw, sh)
+					} else {
+						await Context.drawImage(src, dx, dy, dw, dh)
+					}
+					Context.restore()
+				} else if (drawType == 'rect') {
+					// 绘制矩形图片
+					Context.save()
+					this.setRotate(x, y, w, h, rotate)
+					this.drawRect({
+						x,
+						y,
+						w,
+						h,
+						alpha,
+						borderWidth,
+						borderColor,
+						borderType,
+						r,
+						color,
+						drawImage: true
+					}, true)
+					Context.clip()
+					Context.setGlobalAlpha(alpha)
+					if (mode != 'default') {
+						await Context.drawImage(src, dx, dy, dw, dh, sx, sy, sw, sh)
+					} else {
+						await Context.drawImage(src, dx, dy, dw, dh)
+					}
+					Context.restore()
+				} else if (drawType == 'triangle') {
+					// 绘制三角形图片
+					Context.save()
+					let type = triangle.type || 'isosceles'
+					let coordinate = triangle.coordinate || []
+					let direction = triangle.direction || 'top'
+					if (type != 'custom') {
+						this.setTriangleRotate(x, y, w, h, rotate, type)
+					}
+					this.drawTriangle({
+						x,
+						y,
+						w,
+						h,
+						alpha,
+						borderWidth,
+						borderColor,
+						color,
+						coordinate,
+						direction,
+						drawType: type
+					}, true)
+					Context.clip()
+					Context.setGlobalAlpha(alpha)
+					if (mode != 'default') {
+						await Context.drawImage(src, dx, dy, dw, dh, sx, sy, sw, sh)
+					} else {
+						await Context.drawImage(src, dx, dy, dw, dh)
+					}
+					Context.restore()
+				}
+				Context.setGlobalAlpha(1)
+				return resolve({
+					success: true,
+					data: src
+				})
+			} catch(e) {
+				return resolve({
+					success: false,
+					msg: '绘制图片出错'
+				})
+			}
+
+		})
+	}
+
+	/**
+	 * 绘制文字
+	 * @param { Object } params 绘制内容 
+	 */
+	drawText(params = {}) {
+		let { width, Context } = this
+		let { x, y, w, text, textIndent, lastWidth, font, color, alpha, isFill, line, windowAlign, textAlign, baseline } = {
+			x: params.x || 0,
+			y: params.y || 0,
+			w: params.w || width - params.x,
+			text: String(params.text) || '',
+			textIndent: params.textIndent || 0,
+			lastWidth: params.lastWidth || 0,
+			font: this.getFont(params.font),
+			color: params.color || '#000000',
+			alpha: params.alpha || 1,
+			isFill: params.isFill == undefined ? true : params.isFill,
+			// 文字在窗口对齐的方式 默认: none 可选 居中: center 右边: right
+			windowAlign: params.windowAlign || 'none',
+			// 文字的对齐方式(在容器里面) none 默认 center: 居中 right: 右边
+			textAlign: params.textAlign || 'none',
+			// 水平对齐方式
+			baseline: params.baseline || 'top',
+			line: this.getTextLine(params.line)
+		}
+		Context.beginPath()
+		Context.setGlobalAlpha(alpha)
+		Context.font = font.style
+		Context.setTextBaseline(baseline)
+		if (typeof text != 'string') {
+			text += ''
+		}
+		let textArr = params.textArr
+		if (!textArr) {
+			textArr = this.computedFontTextLineHeight(x, y, w, text, textIndent, lastWidth, font, line, textAlign, windowAlign)
+		}
+		if (isFill) {
+			Context.setFillStyle(color)
+			for (let i of textArr) {
+				let { text, x, y, tx, ty, tw } = i
+				Context.fillText(text, x, y)
+				if (line.lineStyle != 'none') {
+					this.drawLine({
+						x: tx,
+						y: ty,
+						w: tw,
+						color,
+						lineType: line.lineType,
+						lineWidth: line.lineWidth
+					}, true)
+				}
+			}
+		} else {
+			Context.setStrokeStyle(color)
+			for (let i of textArr) {
+				let { text, x, y, tx, ty, tw } = i
+				Context.strokeText(text, x, y)
+				if (line.lineStyle != 'none') {
+					this.drawLine({
+						x: tx,
+						y: ty,
+						w: tw,
+						color,
+						lineType: line.lineType,
+						lineWidth: line.lineWidth
+					}, true)
+				}
+			}
+		}
+		Context.setGlobalAlpha(1)
+	}
+
+
+	/**
+	 * 获取字体样式
+	 * @param { Object } font 字体
+	 */
+	getFont(font = {}) {
+		let { fontSize, fontFamily, fontStyle, fontVariant, fontWeight } = {
+			fontSize: font.size || 12,
+			fontFamily: font.family || 'sans-serif',
+			// 斜体: italic, 倾斜体:oblique
+			fontStyle: font.style || 'normal',
+			fontVariant: font.variant || 'normal',
+			// 粗体
+			fontWeight: font.weight || 'normal'
+		}
+		return {
+			fontSize, fontFamily, fontStyle, fontVariant, fontWeight,
+			style: `${fontStyle} ${fontVariant} ${fontWeight} ${fontSize}px ${fontFamily}`
+		}
+	}
+
+	/**
+	 * 获取文字line样式
+	 * @param { Object } line 行高
+	 */
+	getTextLine(line = {}) {
+		return {
+			// 显示的行数 -1 不限制
+			lineNum: line.num || -1,
+			// 行高
+			lineHeight: line.height || 16,
+			// none: 不需要 underline: 下划线, lineThrough 删除线
+			lineStyle: line.style || 'none',
+			// 线的类型 dashed 虚线 solid 实线
+			lineType: line.type || 'solid',
+			// 线宽度
+			lineWidth: line.width || 1
+		}
+	}
+
+	/**
+	 * 画线
+	 * @param { Object } params 绘制内容 
+	 */
+	drawLine(params = {}) {
+		let { width, Context } = this
+		let { x, y, color, w, algin, alpha, lineType, pattern, offset, lineCap, lineWidth, windowAlign } = {
+			x: params.x || 0,
+			y: params.y || 0,
+			w: params.w || width - params.x,
+			color: params.color || '#000000',
+			algin: params.algin || 'right',
+			alpha: params.alpha || 1,
+			// dashed 虚线 solid 实线
+			lineType: params.lineType || 'solid',
+			// 详看CanvasContext.setLineDash文档
+			// 一组描述交替绘制线段和间距(坐标空间单位)长度的数字
+			pattern: params.pattern || [5, 5],
+			// 虚线偏移量
+			offset: params.offset || 5,
+			lineWidth: params.lineWidth || 1,
+			lineCap: params.lineCap || 'butt',
+			// 窗口对齐的方式 默认: none 可选 居中: center 右边: right
+			windowAlign: params.windowAlign || 'none'
+		}
+		Context.beginPath()
+		Context.setGlobalAlpha(alpha)
+		if (lineType == 'dashed') {
+			Context.setLineDash(pattern, offset)
+		}
+		Context.setLineCap(lineCap)
+		Context.setLineWidth(lineWidth)
+		Context.setStrokeStyle(color)
+		switch (algin) {
+			case 'right':
+				if (windowAlign != 'none') {
+					x = this.computedCenterX(width, w, windowAlign)
+				}
+				Context.moveTo(x, y)
+				Context.lineTo(w + x, y)
+				break
+			case 'left':
+				if (windowAlign != 'none') {
+					x = this.computedCenterX(width, w, windowAlign)
+				}
+				Context.moveTo(x, y)
+				Context.lineTo(windowAlign == 'none' ? x - w : x + w, y)
+				break
+			case 'top':
+				Context.moveTo(x, y)
+				Context.lineTo(x, -(y + w))
+				break
+			case 'bottom':
+				Context.moveTo(x, y)
+				Context.lineTo(x, y + w)
+				break
+		}
+		Context.stroke()
+		Context.closePath()
+		Context.setLineDash()
+		Context.setGlobalAlpha(1)
+	}
+
+
+	/**
+	 * 绘制二维码
+	 * @param { Object } params 二维码参数
+	 */
+	drawQrCode(params = {}) {
+		let { Context, width } = this
+		return new Promise(async resolve => {
+			let { x, y, image, windowAlign, ...options } = {
+				x: params.x || 0,
+				y: params.y || 0,
+				text: String(params.text) || '',
+				size: params.size || 100,
+				// 容错级别 默认3
+				correctLevel: params.lv || 3,
+				// 二维码背景色
+				background: params.background || '#000000',
+				// 二维码前景色
+				foreground: params.foreground || '#ffffff',
+				// 二维码角标色
+				pdground: params.pdground || '#ffffff',
+				image: params.image || {},
+				// 窗口对齐的方式 默认: none 可选 居中: center 右边: right
+				windowAlign: params.windowAlign || 'none'
+			}
+			if (windowAlign != 'none') {
+				x = this.computedCenterX(width, options.size, windowAlign)
+			}
+			//使用QRCodeAlg创建二维码结构
+			let qrcodeAlgObjCache = []
+			let qrCodeAlg = null
+			let l = qrcodeAlgObjCache.length
+			let d = 0
+			for (let i = 0;i < l; i++) {
+				d = i
+				if (qrcodeAlgObjCache[i].text == options.text && qrcodeAlgObjCache[i].text.correctLevel == options.correctLevel) {
+					qrCodeAlg = qrcodeAlgObjCache[i].obj
+					break
+				}
+			}
+			if (d == l) {
+				qrCodeAlg = new QRCodeAlg(options.text, options.correctLevel)
+				qrcodeAlgObjCache.push({
+					text: options.text,
+					correctLevel: options.correctLevel,
+					obj: qrCodeAlg
+				})
+			}
+			/**
+			 * 计算矩阵点的前景色
+			 * @param {Obj} config
+			 * @param {Number} config.row 点x坐标
+			 * @param {Number} config.col 点y坐标
+			 * @param {Number} config.count 矩阵大小
+			 * @param {Number} config.options 组件的options
+			 * @return {String}
+			 */
+			let getForeGround = function (config) {
+				let options = config.options
+				if (options.pdground && (
+					(config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5) ||
+					(config.row > (config.count - 6) && config.row < (config.count - 2) && config.col > 1 && config.col < 5) ||
+					(config.row > 1 && config.row < 5 && config.col > (config.count - 6) && config.col < (config.count - 2))
+				)) {
+					return options.pdground
+				}
+				return options.foreground
+			}
+			let count = qrCodeAlg.getModuleCount()
+			let ratioSize = options.size
+			let ratioImgSize = image.size || 30
+			//计算每个点的长宽
+			let tileW = (ratioSize / count).toPrecision(4)
+			let tileH = (ratioSize / count).toPrecision(4)
+			//绘制
+			for (let row = 0; row < count; row++) {
+				for (let col = 0; col < count; col++) {
+					let w = (Math.ceil((col + 1) * tileW) - Math.floor(col * tileW))
+					let h = (Math.ceil((row + 1) * tileW) - Math.floor(row * tileW))
+					let foreground = getForeGround({
+						row: row,
+						col: col,
+						count: count,
+						options: options
+					})
+					Context.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background)
+					Context.fillRect(x + Math.round(col * tileW), y + Math.round(row * tileH), w, h)
+				}
+			}
+			if (image.src) {
+				let { src, r, color, borderWidth, borderColor } = image
+				let dx = x + Number(((ratioSize - ratioImgSize) / 2).toFixed(2))
+                let dy = y + Number(((ratioSize - ratioImgSize) / 2).toFixed(2))
+				let drawImage = await this.drawImage({
+					x: dx,
+					y: dy,
+					w: ratioImgSize,
+					h: ratioImgSize,
+					src,
+					r,
+					color,
+					borderWidth,
+					borderColor,
+					drawType: 'rect',
+					isCompressImage: false,
+				}, true)
+				if (!drawImage.success) {
+					return resolve(drawImage)
+				}
+			}
+			return resolve({
+				success: true
+			})
+		})
+	}
+
+
+	/**
+	 * 计算出文字一共有多少列,渲染位置之类
+	 * @param { Number } x x轴
+	 * @param { Number } y y轴
+	 * @param { Number } w 文字宽度
+	 * @param { String } text 文字内容
+	 * @param { Number } textIndent 首行缩进
+	 * @param { Number } lastWidth 最后一行的宽度 
+	 * @param { Object } font 字体
+	 * @param { Object } line 行高
+	 * @param { String } textAlign 文字对齐方式
+	 * @param { String } windowAlign 窗口对齐方式
+	 * @returns 
+	 */
+	computedFontTextLineHeight(x, y, w, text, textIndent, lastWidth, font, line, textAlign, windowAlign) {
+		let { Context, width } = this
+		let { fontSize } = font
+		let { lineNum, lineHeight, lineStyle } = line
+		// 文字的总长度
+		let textLength = countTextLength(Context, text, fontSize)
+		let temp = ''
+		let row = []
+		if (text.includes('\n')) {
+			let texts = text.split('\n')
+			for (let text of texts) {
+				computedTextLength(text)
+			}
+		} else {
+			computedTextLength(text)
+		}
+		function computedTextLength(text) {
+			for (let i in text) {
+				let tempLength = countTextLength(Context, temp, fontSize)
+				if (row.length == 0 && textIndent != 0 && textAlign == 'none' && windowAlign == 'none') {
+					tempLength += textIndent * fontSize
+				}
+				if (tempLength <= w && countTextLength(Context, (temp + text[i]), fontSize) <= w) {
+					temp += text[i]
+				} else {
+					row.push(temp)
+					temp = text[i]
+				}
+				if (i == text.length - 1) {
+					row.push(temp)
+					temp = ''
+				}
+			}
+		}
+		if (lineNum != -1 && lastWidth != 0 && row.length != 0 && row.length > lineNum) {
+			let lastText = row[lineNum - 1]
+			let temp = ''
+			for (let i in lastText) {
+				let tempLength = countTextLength(Context, temp, fontSize)
+				if (tempLength <= lastWidth && countTextLength(Context, (temp + lastText[i]), fontSize) <= lastWidth) {
+					temp += lastText[i]
+					continue
+				}
+				break
+			}
+			row[lineNum - 1] = temp
+		}
+		lineHeight = lineHeight == 1 ? fontSize + 2 : lineHeight
+		// 获取一共有多少列
+		let lineSize = Math.ceil(textLength / w)
+		if (text.includes('\n') && lineNum == -1) {
+			lineNum = row.length
+		} else if (text.includes('\n') && lineNum != -1) {
+			lineSize = row.length
+			lineNum = lineNum > lineSize ? lineSize : lineNum
+		} else if (lineNum != -1) {
+			lineNum = lineNum > lineSize ? lineSize : lineNum
+		}
+		let size = lineNum != -1 ? lineNum : lineSize
+		let textArr = []
+		for (let i = 0; i < size; i++) {
+			let obj = {}
+			let text = row[i]
+			let textLength = countTextLength(Context, text, fontSize)
+			let wx = x
+			let tx = x
+			if (i == 0 && textIndent != 0 && textAlign == 'none' && windowAlign == 'none') {
+				textLength += textIndent * fontSize
+				wx += textIndent * fontSize
+				tx = wx
+			}
+			if (textAlign != 'none' && textLength < w) { 	
+				tx = this.computedCenterX(w, textLength, textAlign)
+				wx = tx
+			}
+			if (windowAlign != 'none' && textAlign != 'none') {
+				wx = this.computedCenterX(width, w, windowAlign)
+				wx += tx
+				tx = wx
+			} else if (windowAlign != 'none') {
+				wx = this.computedCenterX(width, w, windowAlign)
+				tx = wx
+			}
+			if (text && lineNum != -1 && i == lineNum - 1) {
+				if ((textLength + fontSize) >= w) {
+					text = text.substring(0, text.length - 1) + '...'
+				} else if (lastWidth != 0 && (textLength + fontSize) >= lastWidth) {
+					text = text.substring(0, text.length - 1) + '...'
+				}
+			}
+			if (lineStyle != 'none') {
+				obj.tx = tx
+				obj.tw = textLength
+				if (lineStyle == 'underline') {
+					obj.ty =  y + (i * lineHeight) + fontSize
+				}
+				if (lineStyle == 'lineThrough') {
+					obj.ty = y + (i * lineHeight) + fontSize / 2
+				}
+			}
+			obj.text = text
+			obj.x = wx
+			obj.y = y + (i * lineHeight)
+			text && textArr.push(obj)
+		}
+		return textArr
+	}
+	
+	/**
+	 * 计算内容需要显示在画布中间的x轴的位置
+	 * @param { Number | String } boxWidth 容器的宽度
+	 * @param { Number | String } contentWidth 内容宽度
+	 * @param { String } type 类型 center: 水平 right: 右边
+	 * @returns 
+	 */
+	computedCenterX(boxWidth, contentWidth, type = 'center') {
+		if (type == 'center') {
+			return (boxWidth - contentWidth) / 2
+		}
+		if (type == 'right') {
+			return boxWidth - contentWidth
+		}
+	}
+
+	/**
+	 * 设置旋转角度
+	 * @param { String } x x轴
+	 * @param { String } y y轴
+	 * @param { String } w 宽度
+	 * @param { String } h 高度
+	 * @param { Object } rotate 旋转内容
+	 * @param { String } rotate.deg 旋转角度
+	 * @param { String } rotate.type 类型 topLeft: 中心点在上左 topMiddle 中心点在上中 topRight 中心点在上右
+	 *                             middleLeft: 中心点在中左 bottomMiddle 中心点在正中间 middleRight 中心点在中右
+	 * 							   bottomLeft: 中心点在下左 bottomMiddle 中心点在下中 middleRight 中心点在下右
+	 */
+	setRotate(x, y, w, h, rotate) {
+		let { Context } = this
+		let deg = rotate.deg || 0
+		let type = rotate.type || 'middle'
+		let rx = x
+		let ry = y
+		switch (type) {
+			case 'topLeft':
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'topMiddle':
+				rx = x + (w / 2)
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'topRight':
+				rx = x + w
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'bottomLeft':
+				ry = y + h
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'bottomMiddle':
+				rx = x + (w / 2)
+				ry = y + h
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'bottomRight':
+				rx = x + w
+				ry = y + h
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'middleLeft':
+				ry = y + (h / 2)
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'middleRight':
+				rx = x + w
+				ry = y + (h / 2)
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'middle':
+				rx = x + (w / 2)
+				ry = y + (h / 2)
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+		}
+	}
+
+	/**
+	 * 设置三角形旋转角度
+	 * @param { String } x x轴
+	 * @param { String } y y轴
+	 * @param { String } w 宽度
+	 * @param { String } h 高度
+	 * @param { Object } rotate 旋转内容
+	 * @param { String } rotate.deg 旋转角度
+	 * @param { String } rotate.type 类型 top: 上 left: 左 right: 右 middle: 中心
+	 * @param { String } triangType 三角形类型(不支持自定义的三角形 ) right: 直角三角形 isosceles: 等腰三角形
+	 */
+	setTriangleRotate(x, y, w, h, rotate, triangType) {
+		let { Context } = this
+		let deg = rotate.deg || 0
+		let type = rotate.type || 'top'
+		let rx = x
+		let ry = y
+		switch (type) {
+			case 'top':
+				if (triangType == 'right') {
+					rx = x
+					ry = y
+				} else {
+					rx = x + w / 2
+					ry = y
+				}
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'left':
+				rx = x
+				ry = y + h
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'right':
+				rx = x + w
+				ry = y + h
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+			case 'middle':
+				rx = x + w / 2
+				ry = y + h / 2
+				Context.translate(rx, ry)
+				Context.rotate(deg * Math.PI / 180)
+				Context.translate(-rx, -ry)
+				break
+		}
+	}
+
+	/**
+	 * 排序drawArray 根据数据的zIndex进行排序,修改渲染顺序
+	 * @param { Array } drawArray 绘制内容
+	 */
+	sortDrawArray(drawArray) {
+		function compare() {
+			return function(after, current) {
+				let aZIndex = after.zIndex || 0
+				let cZIndex = current.zIndex || 0
+				return aZIndex - cZIndex
+			}
+		}
+		drawArray.sort(compare())
+		return drawArray
+	}
+
+	/**
+	 * 往所有的回调信息里面添加内容
+	 * @param { Object } params 内容
+	 */
+	setAllCallBack(params) {
+		let { width } = this
+		let { type, x, y, r, w, h, lineWidth, size, name } = params
+		w = w || width
+		h = h || 0
+		x = x || 0
+		y = y || 0
+		r = r || 0
+		lineWidth = lineWidth || 1
+		size = size || 0
+		name = name || ''
+		let sx = x
+		let sy = y
+		let ex = x + w
+		let ey = y + h
+		// 圆形
+		if (type == 'arc') {
+			ex = x + r * 2
+			ey = y + r * 2
+			w = r * 2
+			h = r * 2
+		}
+		// 文字
+		if (type == 'text') {
+			let { text, textIndent, lastWidth, font, line, textAlign, windowAlign } = {
+				text: String(params.text) || '',
+				textIndent: params.textIndent || 0,
+				lastWidth: params.lastWidth || 0,
+				font: this.getFont(params.font),
+				line: this.getTextLine(params.line),
+				textAlign: params.textAlign || 'none',
+				windowAlign: params.windowAlign || 'none',
+			}
+			if (w == width) {
+				w -= x
+			}
+			let textArr = this.computedFontTextLineHeight(x, y, w, text, textIndent, lastWidth, font, line, textAlign, windowAlign)
+			let lastText = textArr[textArr.length - 1]	
+			ex = lastText.x + (font.fontSize * lastText.text.length)
+			ey = lastText.y + font.fontSize
+			params.textArr = textArr
+			h = ey - sy
+		}
+		// 线
+		if (type == 'line') {
+			ey = y + lineWidth
+			h = lineWidth
+		}
+		// 二维码
+		if (type == 'qrcode') {
+			ex = x + size
+			ey = y + size
+			w = size
+			h = size
+		}
+		this.allCallBack.push({
+			sx,
+			sy,
+			ex,
+			ey,
+			w,
+			h,
+			name
+		})
+	}
+
+	/**
+	 * 绘制内容
+	 * @returns 
+	 */
+	drawCanvas(drawArray) {
+		let { Context } = this
+		return new Promise(async resolve => {
+			try {
+				for (let i of drawArray) {
+					if (i.callBack && typeof i.callBack == 'function' && i.type != 'custom') {
+						let beforeInfo = this.allCallBack.length == 0 ? {} : this.allCallBack[this.allCallBack.length - 1]
+						let callBackInfo = i.callBack(beforeInfo, this.allCallBack) || {}
+						let { callBack, ...data } = i
+						i = { ...data, ...callBackInfo }
+					}
+					if (i.type != 'custom' && i.drawType != 'custom') {
+						this.setAllCallBack(i)
+					}
+					switch (i.type) {
+						// 文字
+						case 'text': 
+							this.drawText(i)
+							break
+						// 矩形
+						case 'rect':
+							this.drawRect(i)
+							break
+						// 图片
+						case 'image': 
+							let image = await this.drawImage(i)
+							if (!image.success) {
+								return resolve(image)
+							}
+							break
+						// 圆形
+						case 'arc':
+							this.drawArc(i)
+							break
+						// 三角形
+						case 'triangle':
+							this.drawTriangle(i)
+							break
+						// 线条
+						case 'line':
+							this.drawLine(i)
+							break
+						// 二维码
+						case 'qrcode':
+							await this.drawQrCode(i)
+							break
+						// 自定义
+						case 'custom':
+							i.setDarw(Context, this)
+							break
+					}
+				}
+				resolve({
+					success: true
+				})
+			} catch(e) {
+				hideLoading()
+				return resolve({
+					success: false,
+					msg: '绘制内容失败:' + e
+				})
+			}
+	
+		})
+	}
+
+	/**
+	 * 绘制背景
+	 * @returns 
+	 */
+	drawBackground() {
+		let { background, width, height } = this
+		return new Promise(async resolve => {
+			let { type, ...params } = background
+			// 绘制背景色
+			if (type == 'color') {
+				this.drawRect({
+					...params,
+					w: params.w || width,
+					h: params.h || height,
+					color: params.color || '#ffffff'
+				}, true)
+			}
+			// 绘制背景图
+			if (type == 'image') {
+				await this.drawImage({
+					...params,
+					w: params.w || width,
+					h: params.h || height,
+				}, true)
+			}
+			resolve({
+				success: true
+			})
+		})
+	}
+
+	/**
+	 * 创建canvas导出文件
+	 * @returns 
+	 */
+	createdCanvasFilePath() {
+		let { canvasId, width, height, _this, fileType, quality } = this
+		return new Promise(resolve => {
+			try {
+				uni.canvasToTempFilePath({
+					canvasId,
+					x: 0,
+					y: 0,
+					width,
+					height,
+					quality,
+					fileType,
+					success: res => {
+						resolve({
+							success: true,
+							data: res.tempFilePath,
+							msg: '绘画成功'
+						})
+					},
+					fail: err => {
+						resolve({
+							success: false,
+							msg: `导出图片失败: ${JSON.stringify(err)}`
+						})
+						hideLoading()
+					}
+				}, _this || null)
+			} catch (e) {
+				hideLoading()
+				resolve({
+					success: false,
+					msg: '导出图片失败: 绘画错误'
+				})
+			}
+		})
+	}
+
+	/**
+	 * 预绘制背景
+	 * @returns 
+	 */
+	preDrawBackground() {
+		return new Promise(async resolve => {
+			try {
+				showLoading('初始化中...')
+				// 绘制背景
+				const drawBackground = await this.drawBackground()
+				if (!drawBackground.success) {
+					hideLoading()
+					return resolve({
+						success: false,
+						msg: '初始化失败,绘制背景图失败'
+					})
+				}
+				hideLoading()
+				return resolve({
+					success: true,
+					msg: '初始化成功'
+				})
+			} catch(e) {
+				hideLoading()
+				resolve({
+					success: false,
+					msg: e
+				})
+			}
+		})
+	}
+
+	/**
+	 * 将绘制的内容绘制到画布上
+	 * @param { Boolean } complete 是否完成,如果为true会绘制图片并返回图片路径
+	 * @returns 
+	 */
+	canvasDraw(complete = true) {
+		let { Context, drawDelayTime } = this
+		return new Promise(async resolve => {
+			setTimeout(async () => {
+				hideLoading()
+				await Context.draw(true, async () => {
+					if (complete) {
+						return resolve(await this.exportImage())
+					}
+					return resolve({
+						success: true,
+						msg: '成功'
+					})
+				})
+			}, drawDelayTime || 200)
+		})
+	}
+
+	/**
+	 * 预绘画
+	 * @param { Function } drawArray 绘制内容 返回一个数组
+	 * @param { Boolean } complete 是否完成,如果为true会绘制图片
+	 * @returns 
+	 */
+	preDraw(drawArray, complete = false) {
+		return new Promise(async resolve => {
+			try {
+				let { callBack, drawTipsText } = this
+				showLoading(drawTipsText)
+				let drawCanvas = await this.drawCanvas(this.sortDrawArray(drawArray(callBack)))
+				// 绘制内容
+				if (!drawCanvas.success) {
+					hideLoading()
+					return resolve(drawCanvas)
+				}
+				return resolve(await this.canvasDraw(complete))
+			} catch(e) {
+				hideLoading()
+				resolve({
+					success: false,
+					msg: e
+				})
+			}
+
+		})
+	}
+
+
+	/**
+	 * 导出图片
+	 * @returns 
+	 */
+	exportImage() {
+		let { canvasId, width, height, _this, delayTime } = this
+		return new Promise(resolve => {
+			showLoading('加载图片中...')
+			// 绘制图片
+			setTimeout(async () => {
+				resolve(await this.createdCanvasFilePath(canvasId, width, height, _this))
+				hideLoading()
+			}, delayTime || 200)
+		})
+	}
+
+	
+	/**
+	 * 创建绘制海报
+	 * @param { Function } drawArray 绘制内容 返回一个数组
+	 * @returns 
+	 */
+	createdSharePoster(drawArray) {
+		let { callBack } = this
+		return new Promise(async resolve => {
+			if (drawArray == null || drawArray == undefined) {
+				return resolve({
+					success: false,
+					msg: '请传递绘制内容'
+				})
+			}
+			let backgroundRes = await this.preDrawBackground()
+			if (!backgroundRes.success) {
+				return resolve(backgroundRes)
+			}
+			showLoading('绘制中,请稍等')
+			let drawRes = await this.drawCanvas(this.sortDrawArray(await drawArray(callBack)))
+			// 绘制内容
+			if (!drawRes.success) {
+				hideLoading()
+				return resolve(drawRes)
+			}
+			return resolve(await this.canvasDraw())
+		})
+	}
+}

+ 147 - 0
uni_modules/sakura-canvas/js_sdk/image-tools.js

@@ -0,0 +1,147 @@
+function getLocalFilePath(path) {
+    if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf('_downloads') === 0) {
+        return path
+    }
+    if (path.indexOf('file://') === 0) {
+        return path
+    }
+    if (path.indexOf('/storage/emulated/0/') === 0) {
+        return path
+    }
+    if (path.indexOf('/') === 0) {
+        var localFilePath = plus.io.convertAbsoluteFileSystem(path)
+        if (localFilePath !== path) {
+            return localFilePath
+        } else {
+            path = path.substr(1)
+        }
+    }
+    return '_www/' + path
+}
+
+export function pathToBase64(path) {
+    return new Promise(function(resolve, reject) {
+        if (typeof window === 'object' && 'document' in window) {
+            if (typeof FileReader === 'function') {
+                var xhr = new XMLHttpRequest()
+                xhr.open('GET', path, true)
+                xhr.responseType = 'blob'
+                xhr.onload = function() {
+                    if (this.status === 200) {
+                        let fileReader = new FileReader()
+                        fileReader.onload = function(e) {
+                            resolve(e.target.result)
+                        }
+                        fileReader.onerror = reject
+                        fileReader.readAsDataURL(this.response)
+                    }
+                }
+                xhr.onerror = reject
+                xhr.send()
+                return
+            }
+            var canvas = document.createElement('canvas')
+            var c2x = canvas.getContext('2d')
+            var img = new Image
+            img.onload = function() {
+                canvas.width = img.width
+                canvas.height = img.height
+                c2x.drawImage(img, 0, 0)
+                resolve(canvas.toDataURL())
+                canvas.height = canvas.width = 0
+            }
+            img.onerror = reject
+            img.src = path
+            return
+        }
+        if (typeof plus === 'object') {
+            plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) {
+                entry.file(function(file) {
+                    var fileReader = new plus.io.FileReader()
+                    fileReader.onload = function(data) {
+                        resolve(data.target.result)
+                    }
+                    fileReader.onerror = function(error) {
+                        reject(error)
+                    }
+                    fileReader.readAsDataURL(file)
+                }, function(error) {
+                    reject(error)
+                })
+            }, function(error) {
+                reject(error)
+            })
+            return
+        }
+        if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
+            wx.getFileSystemManager().readFile({
+                filePath: path,
+                encoding: 'base64',
+                success: function(res) {
+                    resolve('data:image/png;base64,' + res.data)
+                },
+                fail: function(error) {
+                    reject(error)
+                }
+            })
+            return
+        }
+        reject(new Error('not support'))
+    })
+}
+
+export function base64ToPath(base64) {
+    return new Promise(function(resolve, reject) {
+        if (typeof window === 'object' && 'document' in window) {
+            base64 = base64.split(',')
+            var type = base64[0].match(/:(.*?);/)[1]
+            var str = atob(base64[1])
+            var n = str.length
+            var array = new Uint8Array(n)
+            while (n--) {
+                array[n] = str.charCodeAt(n)
+            }
+            return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], { type: type })))
+        }
+        var extName = base64.match(/data\:\S+\/(\S+);/)
+        if (extName) {
+            extName = extName[1]
+        } else {
+            reject(new Error('base64 error'))
+        }
+        var fileName = Date.now() + '.' + extName
+        if (typeof plus === 'object') {
+            var bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now())
+            bitmap.loadBase64Data(base64, function() {
+                var filePath = '_doc/uniapp_temp/' + fileName
+                bitmap.save(filePath, {}, function() {
+                    bitmap.clear()
+                    resolve(filePath)
+                }, function(error) {
+                    bitmap.clear()
+                    reject(error)
+                })
+            }, function(error) {
+                bitmap.clear()
+                reject(error)
+            })
+            return
+        }
+        if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
+            var filePath = wx.env.USER_DATA_PATH + '/' + fileName
+            wx.getFileSystemManager().writeFile({
+                filePath: filePath,
+                data: base64.replace(/^data:\S+\/\S+;base64,/, ''),
+                encoding: 'base64',
+                success: function() {
+                    resolve(filePath)
+                },
+                fail: function(error) {
+                    reject(error)
+                }
+            })
+            return
+        }
+        reject(new Error('not support'))
+    })
+}

+ 1088 - 0
uni_modules/sakura-canvas/js_sdk/qrcode.js

@@ -0,0 +1,1088 @@
+/**
+ * 获取单个字符的utf8编码
+ * unicode BMP平面约65535个字符
+ * @param {num} code
+ * return {array}
+ */
+function unicodeFormat8(code) {
+    // 1 byte
+    var c0, c1, c2;
+    if (code < 128) {
+        return [code];
+        // 2 bytes
+    } else if (code < 2048) {
+        c0 = 192 + (code >> 6);
+        c1 = 128 + (code & 63);
+        return [c0, c1];
+        // 3 bytes
+    } else {
+        c0 = 224 + (code >> 12);
+        c1 = 128 + (code >> 6 & 63);
+        c2 = 128 + (code & 63);
+        return [c0, c1, c2];
+    }
+}
+/**
+ * 获取字符串的utf8编码字节串
+ * @param {string} string
+ * @return {array}
+ */
+function getUTF8Bytes(string) {
+    var utf8codes = [];
+    for (var i = 0; i < string.length; i++) {
+        var code = string.charCodeAt(i);
+        var utf8 = unicodeFormat8(code);
+        for (var j = 0; j < utf8.length; j++) {
+            utf8codes.push(utf8[j]);
+        }
+    }
+    return utf8codes;
+}
+/**
+ * 二维码算法实现
+ * @param {string} data              要编码的信息字符串
+ * @param {num} errorCorrectLevel 纠错等级
+ */
+export default function QRCodeAlg(data, errorCorrectLevel) {
+    this.typeNumber = -1; //版本
+    this.errorCorrectLevel = errorCorrectLevel;
+    this.modules = null; //二维矩阵,存放最终结果
+    this.moduleCount = 0; //矩阵大小
+    this.dataCache = null; //数据缓存
+    this.rsBlocks = null; //版本数据信息
+    this.totalDataCount = -1; //可使用的数据量
+    this.data = data;
+    this.utf8bytes = getUTF8Bytes(data);
+    this.make();
+}
+QRCodeAlg.prototype = {
+    constructor: QRCodeAlg,
+    /**
+     * 获取二维码矩阵大小
+     * @return {num} 矩阵大小
+     */
+    getModuleCount: function () {
+        return this.moduleCount;
+    },
+    /**
+     * 编码
+     */
+    make: function () {
+        this.getRightType();
+        this.dataCache = this.createData();
+        this.createQrcode();
+    },
+    /**
+     * 设置二位矩阵功能图形
+     * @param  {bool} test 表示是否在寻找最好掩膜阶段
+     * @param  {num} maskPattern 掩膜的版本
+     */
+    makeImpl: function (maskPattern) {
+        this.moduleCount = this.typeNumber * 4 + 17;
+        this.modules = new Array(this.moduleCount);
+        for (var row = 0; row < this.moduleCount; row++) {
+            this.modules[row] = new Array(this.moduleCount);
+        }
+        this.setupPositionProbePattern(0, 0);
+        this.setupPositionProbePattern(this.moduleCount - 7, 0);
+        this.setupPositionProbePattern(0, this.moduleCount - 7);
+        this.setupPositionAdjustPattern();
+        this.setupTimingPattern();
+        this.setupTypeInfo(true, maskPattern);
+        if (this.typeNumber >= 7) {
+            this.setupTypeNumber(true);
+        }
+        this.mapData(this.dataCache, maskPattern);
+    },
+    /**
+     * 设置二维码的位置探测图形
+     * @param  {num} row 探测图形的中心横坐标
+     * @param  {num} col 探测图形的中心纵坐标
+     */
+    setupPositionProbePattern: function (row, col) {
+        for (var r = -1; r <= 7; r++) {
+            if (row + r <= -1 || this.moduleCount <= row + r) continue;
+            for (var c = -1; c <= 7; c++) {
+                if (col + c <= -1 || this.moduleCount <= col + c) continue;
+                if ((0 <= r && r <= 6 && (c == 0 || c == 6)) || (0 <= c && c <= 6 && (r == 0 || r == 6)) || (2 <= r && r <= 4 && 2 <= c && c <= 4)) {
+                    this.modules[row + r][col + c] = true;
+                } else {
+                    this.modules[row + r][col + c] = false;
+                }
+            }
+        }
+    },
+    /**
+     * 创建二维码
+     * @return {[type]} [description]
+     */
+    createQrcode: function () {
+        var minLostPoint = 0;
+        var pattern = 0;
+        var bestModules = null;
+        for (var i = 0; i < 8; i++) {
+            this.makeImpl(i);
+            var lostPoint = QRUtil.getLostPoint(this);
+            if (i == 0 || minLostPoint > lostPoint) {
+                minLostPoint = lostPoint;
+                pattern = i;
+                bestModules = this.modules;
+            }
+        }
+        this.modules = bestModules;
+        this.setupTypeInfo(false, pattern);
+        if (this.typeNumber >= 7) {
+            this.setupTypeNumber(false);
+        }
+    },
+    /**
+     * 设置定位图形
+     * @return {[type]} [description]
+     */
+    setupTimingPattern: function () {
+        for (var r = 8; r < this.moduleCount - 8; r++) {
+            if (this.modules[r][6] != null) {
+                continue;
+            }
+            this.modules[r][6] = (r % 2 == 0);
+            if (this.modules[6][r] != null) {
+                continue;
+            }
+            this.modules[6][r] = (r % 2 == 0);
+        }
+    },
+    /**
+     * 设置矫正图形
+     * @return {[type]} [description]
+     */
+    setupPositionAdjustPattern: function () {
+        var pos = QRUtil.getPatternPosition(this.typeNumber);
+        for (var i = 0; i < pos.length; i++) {
+            for (var j = 0; j < pos.length; j++) {
+                var row = pos[i];
+                var col = pos[j];
+                if (this.modules[row][col] != null) {
+                    continue;
+                }
+                for (var r = -2; r <= 2; r++) {
+                    for (var c = -2; c <= 2; c++) {
+                        if (r == -2 || r == 2 || c == -2 || c == 2 || (r == 0 && c == 0)) {
+                            this.modules[row + r][col + c] = true;
+                        } else {
+                            this.modules[row + r][col + c] = false;
+                        }
+                    }
+                }
+            }
+        }
+    },
+    /**
+     * 设置版本信息(7以上版本才有)
+     * @param  {bool} test 是否处于判断最佳掩膜阶段
+     * @return {[type]}      [description]
+     */
+    setupTypeNumber: function (test) {
+        var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
+        for (var i = 0; i < 18; i++) {
+            var mod = (!test && ((bits >> i) & 1) == 1);
+            this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
+            this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
+        }
+    },
+    /**
+     * 设置格式信息(纠错等级和掩膜版本)
+     * @param  {bool} test
+     * @param  {num} maskPattern 掩膜版本
+     * @return {}
+     */
+    setupTypeInfo: function (test, maskPattern) {
+        var data = (QRErrorCorrectLevel[this.errorCorrectLevel] << 3) | maskPattern;
+        var bits = QRUtil.getBCHTypeInfo(data);
+        // vertical
+        for (var i = 0; i < 15; i++) {
+            var mod = (!test && ((bits >> i) & 1) == 1);
+            if (i < 6) {
+                this.modules[i][8] = mod;
+            } else if (i < 8) {
+                this.modules[i + 1][8] = mod;
+            } else {
+                this.modules[this.moduleCount - 15 + i][8] = mod;
+            }
+            // horizontal
+            var mod = (!test && ((bits >> i) & 1) == 1);
+            if (i < 8) {
+                this.modules[8][this.moduleCount - i - 1] = mod;
+            } else if (i < 9) {
+                this.modules[8][15 - i - 1 + 1] = mod;
+            } else {
+                this.modules[8][15 - i - 1] = mod;
+            }
+        }
+        // fixed module
+        this.modules[this.moduleCount - 8][8] = (!test);
+    },
+    /**
+     * 数据编码
+     * @return {[type]} [description]
+     */
+    createData: function () {
+        var buffer = new QRBitBuffer();
+        var lengthBits = this.typeNumber > 9 ? 16 : 8;
+        buffer.put(4, 4); //添加模式
+        buffer.put(this.utf8bytes.length, lengthBits);
+        for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
+            buffer.put(this.utf8bytes[i], 8);
+        }
+        if (buffer.length + 4 <= this.totalDataCount * 8) {
+            buffer.put(0, 4);
+        }
+        // padding
+        while (buffer.length % 8 != 0) {
+            buffer.putBit(false);
+        }
+        // padding
+        while (true) {
+            if (buffer.length >= this.totalDataCount * 8) {
+                break;
+            }
+            buffer.put(QRCodeAlg.PAD0, 8);
+            if (buffer.length >= this.totalDataCount * 8) {
+                break;
+            }
+            buffer.put(QRCodeAlg.PAD1, 8);
+        }
+        return this.createBytes(buffer);
+    },
+    /**
+     * 纠错码编码
+     * @param  {buffer} buffer 数据编码
+     * @return {[type]}
+     */
+    createBytes: function (buffer) {
+        var offset = 0;
+        var maxDcCount = 0;
+        var maxEcCount = 0;
+        var length = this.rsBlock.length / 3;
+        var rsBlocks = new Array();
+        for (var i = 0; i < length; i++) {
+            var count = this.rsBlock[i * 3 + 0];
+            var totalCount = this.rsBlock[i * 3 + 1];
+            var dataCount = this.rsBlock[i * 3 + 2];
+            for (var j = 0; j < count; j++) {
+                rsBlocks.push([dataCount, totalCount]);
+            }
+        }
+        var dcdata = new Array(rsBlocks.length);
+        var ecdata = new Array(rsBlocks.length);
+        for (var r = 0; r < rsBlocks.length; r++) {
+            var dcCount = rsBlocks[r][0];
+            var ecCount = rsBlocks[r][1] - dcCount;
+            maxDcCount = Math.max(maxDcCount, dcCount);
+            maxEcCount = Math.max(maxEcCount, ecCount);
+            dcdata[r] = new Array(dcCount);
+            for (var i = 0; i < dcdata[r].length; i++) {
+                dcdata[r][i] = 0xff & buffer.buffer[i + offset];
+            }
+            offset += dcCount;
+            var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
+            var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
+            var modPoly = rawPoly.mod(rsPoly);
+            ecdata[r] = new Array(rsPoly.getLength() - 1);
+            for (var i = 0; i < ecdata[r].length; i++) {
+                var modIndex = i + modPoly.getLength() - ecdata[r].length;
+                ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0;
+            }
+        }
+        var data = new Array(this.totalDataCount);
+        var index = 0;
+        for (var i = 0; i < maxDcCount; i++) {
+            for (var r = 0; r < rsBlocks.length; r++) {
+                if (i < dcdata[r].length) {
+                    data[index++] = dcdata[r][i];
+                }
+            }
+        }
+        for (var i = 0; i < maxEcCount; i++) {
+            for (var r = 0; r < rsBlocks.length; r++) {
+                if (i < ecdata[r].length) {
+                    data[index++] = ecdata[r][i];
+                }
+            }
+        }
+        return data;
+
+    },
+    /**
+     * 布置模块,构建最终信息
+     * @param  {} data
+     * @param  {} maskPattern
+     * @return {}
+     */
+    mapData: function (data, maskPattern) {
+        var inc = -1;
+        var row = this.moduleCount - 1;
+        var bitIndex = 7;
+        var byteIndex = 0;
+        for (var col = this.moduleCount - 1; col > 0; col -= 2) {
+            if (col == 6) col--;
+            while (true) {
+                for (var c = 0; c < 2; c++) {
+                    if (this.modules[row][col - c] == null) {
+                        var dark = false;
+                        if (byteIndex < data.length) {
+                            dark = (((data[byteIndex] >>> bitIndex) & 1) == 1);
+                        }
+                        var mask = QRUtil.getMask(maskPattern, row, col - c);
+                        if (mask) {
+                            dark = !dark;
+                        }
+                        this.modules[row][col - c] = dark;
+                        bitIndex--;
+                        if (bitIndex == -1) {
+                            byteIndex++;
+                            bitIndex = 7;
+                        }
+                    }
+                }
+                row += inc;
+                if (row < 0 || this.moduleCount <= row) {
+                    row -= inc;
+                    inc = -inc;
+                    break;
+                }
+            }
+        }
+    }
+};
+/**
+ * 填充字段
+ */
+QRCodeAlg.PAD0 = 0xEC;
+QRCodeAlg.PAD1 = 0x11;
+//---------------------------------------------------------------------
+// 纠错等级对应的编码
+//---------------------------------------------------------------------
+var QRErrorCorrectLevel = [1, 0, 3, 2];
+//---------------------------------------------------------------------
+// 掩膜版本
+//---------------------------------------------------------------------
+var QRMaskPattern = {
+    PATTERN000: 0,
+    PATTERN001: 1,
+    PATTERN010: 2,
+    PATTERN011: 3,
+    PATTERN100: 4,
+    PATTERN101: 5,
+    PATTERN110: 6,
+    PATTERN111: 7
+};
+//---------------------------------------------------------------------
+// 工具类
+//---------------------------------------------------------------------
+var QRUtil = {
+    /*
+    每个版本矫正图形的位置
+        */
+    PATTERN_POSITION_TABLE: [
+        [],
+        [6, 18],
+        [6, 22],
+        [6, 26],
+        [6, 30],
+        [6, 34],
+        [6, 22, 38],
+        [6, 24, 42],
+        [6, 26, 46],
+        [6, 28, 50],
+        [6, 30, 54],
+        [6, 32, 58],
+        [6, 34, 62],
+        [6, 26, 46, 66],
+        [6, 26, 48, 70],
+        [6, 26, 50, 74],
+        [6, 30, 54, 78],
+        [6, 30, 56, 82],
+        [6, 30, 58, 86],
+        [6, 34, 62, 90],
+        [6, 28, 50, 72, 94],
+        [6, 26, 50, 74, 98],
+        [6, 30, 54, 78, 102],
+        [6, 28, 54, 80, 106],
+        [6, 32, 58, 84, 110],
+        [6, 30, 58, 86, 114],
+        [6, 34, 62, 90, 118],
+        [6, 26, 50, 74, 98, 122],
+        [6, 30, 54, 78, 102, 126],
+        [6, 26, 52, 78, 104, 130],
+        [6, 30, 56, 82, 108, 134],
+        [6, 34, 60, 86, 112, 138],
+        [6, 30, 58, 86, 114, 142],
+        [6, 34, 62, 90, 118, 146],
+        [6, 30, 54, 78, 102, 126, 150],
+        [6, 24, 50, 76, 102, 128, 154],
+        [6, 28, 54, 80, 106, 132, 158],
+        [6, 32, 58, 84, 110, 136, 162],
+        [6, 26, 54, 82, 110, 138, 166],
+        [6, 30, 58, 86, 114, 142, 170]
+    ],
+    G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0),
+    G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0),
+    G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1),
+    /*
+    BCH编码格式信息
+        */
+    getBCHTypeInfo: function (data) {
+        var d = data << 10;
+        while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
+            d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15)));
+        }
+        return ((data << 10) | d) ^ QRUtil.G15_MASK;
+    },
+    /*
+    BCH编码版本信息
+        */
+    getBCHTypeNumber: function (data) {
+        var d = data << 12;
+        while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
+            d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18)));
+        }
+        return (data << 12) | d;
+    },
+    /*
+    获取BCH位信息
+        */
+    getBCHDigit: function (data) {
+        var digit = 0;
+        while (data != 0) {
+            digit++;
+            data >>>= 1;
+        }
+        return digit;
+    },
+    /*
+    获取版本对应的矫正图形位置
+        */
+    getPatternPosition: function (typeNumber) {
+        return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
+    },
+    /*
+    掩膜算法
+        */
+    getMask: function (maskPattern, i, j) {
+        switch (maskPattern) {
+            case QRMaskPattern.PATTERN000:
+                return (i + j) % 2 == 0;
+            case QRMaskPattern.PATTERN001:
+                return i % 2 == 0;
+            case QRMaskPattern.PATTERN010:
+                return j % 3 == 0;
+            case QRMaskPattern.PATTERN011:
+                return (i + j) % 3 == 0;
+            case QRMaskPattern.PATTERN100:
+                return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
+            case QRMaskPattern.PATTERN101:
+                return (i * j) % 2 + (i * j) % 3 == 0;
+            case QRMaskPattern.PATTERN110:
+                return ((i * j) % 2 + (i * j) % 3) % 2 == 0;
+            case QRMaskPattern.PATTERN111:
+                return ((i * j) % 3 + (i + j) % 2) % 2 == 0;
+            default:
+                throw new Error("bad maskPattern:" + maskPattern);
+        }
+    },
+    /*
+    获取RS的纠错多项式
+        */
+    getErrorCorrectPolynomial: function (errorCorrectLength) {
+        var a = new QRPolynomial([1], 0);
+        for (var i = 0; i < errorCorrectLength; i++) {
+            a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
+        }
+        return a;
+    },
+    /*
+    获取评价
+        */
+    getLostPoint: function (qrCode) {
+        var moduleCount = qrCode.getModuleCount(),
+            lostPoint = 0,
+            darkCount = 0;
+        for (var row = 0; row < moduleCount; row++) {
+            var sameCount = 0;
+            var head = qrCode.modules[row][0];
+            for (var col = 0; col < moduleCount; col++) {
+                var current = qrCode.modules[row][col];
+                //level 3 评价
+                if (col < moduleCount - 6) {
+                    if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
+                        if (col < moduleCount - 10) {
+                            if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
+                                lostPoint += 40;
+                            }
+                        } else if (col > 3) {
+                            if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
+                                lostPoint += 40;
+                            }
+                        }
+                    }
+                }
+                //level 2 评价
+                if ((row < moduleCount - 1) && (col < moduleCount - 1)) {
+                    var count = 0;
+                    if (current) count++;
+                    if (qrCode.modules[row + 1][col]) count++;
+                    if (qrCode.modules[row][col + 1]) count++;
+                    if (qrCode.modules[row + 1][col + 1]) count++;
+                    if (count == 0 || count == 4) {
+                        lostPoint += 3;
+                    }
+                }
+                //level 1 评价
+                if (head ^ current) {
+                    sameCount++;
+                } else {
+                    head = current;
+                    if (sameCount >= 5) {
+                        lostPoint += (3 + sameCount - 5);
+                    }
+                    sameCount = 1;
+                }
+                //level 4 评价
+                if (current) {
+                    darkCount++;
+                }
+            }
+        }
+        for (var col = 0; col < moduleCount; col++) {
+            var sameCount = 0;
+            var head = qrCode.modules[0][col];
+            for (var row = 0; row < moduleCount; row++) {
+                var current = qrCode.modules[row][col];
+                //level 3 评价
+                if (row < moduleCount - 6) {
+                    if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
+                        if (row < moduleCount - 10) {
+                            if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
+                                lostPoint += 40;
+                            }
+                        } else if (row > 3) {
+                            if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
+                                lostPoint += 40;
+                            }
+                        }
+                    }
+                }
+                //level 1 评价
+                if (head ^ current) {
+                    sameCount++;
+                } else {
+                    head = current;
+                    if (sameCount >= 5) {
+                        lostPoint += (3 + sameCount - 5);
+                    }
+                    sameCount = 1;
+                }
+            }
+        }
+        // LEVEL4
+        var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
+        lostPoint += ratio * 10;
+        return lostPoint;
+    }
+
+};
+//---------------------------------------------------------------------
+// QRMath使用的数学工具
+//---------------------------------------------------------------------
+var QRMath = {
+    /*
+    将n转化为a^m
+        */
+    glog: function (n) {
+        if (n < 1) {
+            throw new Error("glog(" + n + ")");
+        }
+        return QRMath.LOG_TABLE[n];
+    },
+    /*
+    将a^m转化为n
+        */
+    gexp: function (n) {
+        while (n < 0) {
+            n += 255;
+        }
+        while (n >= 256) {
+            n -= 255;
+        }
+        return QRMath.EXP_TABLE[n];
+    },
+    EXP_TABLE: new Array(256),
+    LOG_TABLE: new Array(256)
+
+};
+for (var i = 0; i < 8; i++) {
+    QRMath.EXP_TABLE[i] = 1 << i;
+}
+for (var i = 8; i < 256; i++) {
+    QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
+}
+for (var i = 0; i < 255; i++) {
+    QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
+}
+//---------------------------------------------------------------------
+// QRPolynomial 多项式
+//---------------------------------------------------------------------
+/**
+ * 多项式类
+ * @param {Array} num   系数
+ * @param {num} shift a^shift
+ */
+function QRPolynomial(num, shift) {
+    if (num.length == undefined) {
+        throw new Error(num.length + "/" + shift);
+    }
+    var offset = 0;
+    while (offset < num.length && num[offset] == 0) {
+        offset++;
+    }
+    this.num = new Array(num.length - offset + shift);
+    for (var i = 0; i < num.length - offset; i++) {
+        this.num[i] = num[i + offset];
+    }
+}
+QRPolynomial.prototype = {
+    get: function (index) {
+        return this.num[index];
+    },
+    getLength: function () {
+        return this.num.length;
+    },
+    /**
+     * 多项式乘法
+     * @param  {QRPolynomial} e 被乘多项式
+     * @return {[type]}   [description]
+     */
+    multiply: function (e) {
+        var num = new Array(this.getLength() + e.getLength() - 1);
+        for (var i = 0; i < this.getLength(); i++) {
+            for (var j = 0; j < e.getLength(); j++) {
+                num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
+            }
+        }
+        return new QRPolynomial(num, 0);
+    },
+    /**
+     * 多项式模运算
+     * @param  {QRPolynomial} e 模多项式
+     * @return {}
+     */
+    mod: function (e) {
+        var tl = this.getLength(),
+            el = e.getLength();
+        if (tl - el < 0) {
+            return this;
+        }
+        var num = new Array(tl);
+        for (var i = 0; i < tl; i++) {
+            num[i] = this.get(i);
+        }
+        while (num.length >= el) {
+            var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
+
+            for (var i = 0; i < e.getLength(); i++) {
+                num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
+            }
+            while (num[0] == 0) {
+                num.shift();
+            }
+        }
+        return new QRPolynomial(num, 0);
+    }
+};
+
+//---------------------------------------------------------------------
+// RS_BLOCK_TABLE
+//---------------------------------------------------------------------
+/*
+二维码各个版本信息[块数, 每块中的数据块数, 每块中的信息块数]
+    */
+var RS_BLOCK_TABLE = [
+    // L
+    // M
+    // Q
+    // H
+    // 1
+    [1, 26, 19],
+    [1, 26, 16],
+    [1, 26, 13],
+    [1, 26, 9],
+
+    // 2
+    [1, 44, 34],
+    [1, 44, 28],
+    [1, 44, 22],
+    [1, 44, 16],
+
+    // 3
+    [1, 70, 55],
+    [1, 70, 44],
+    [2, 35, 17],
+    [2, 35, 13],
+
+    // 4
+    [1, 100, 80],
+    [2, 50, 32],
+    [2, 50, 24],
+    [4, 25, 9],
+
+    // 5
+    [1, 134, 108],
+    [2, 67, 43],
+    [2, 33, 15, 2, 34, 16],
+    [2, 33, 11, 2, 34, 12],
+
+    // 6
+    [2, 86, 68],
+    [4, 43, 27],
+    [4, 43, 19],
+    [4, 43, 15],
+
+    // 7
+    [2, 98, 78],
+    [4, 49, 31],
+    [2, 32, 14, 4, 33, 15],
+    [4, 39, 13, 1, 40, 14],
+
+    // 8
+    [2, 121, 97],
+    [2, 60, 38, 2, 61, 39],
+    [4, 40, 18, 2, 41, 19],
+    [4, 40, 14, 2, 41, 15],
+
+    // 9
+    [2, 146, 116],
+    [3, 58, 36, 2, 59, 37],
+    [4, 36, 16, 4, 37, 17],
+    [4, 36, 12, 4, 37, 13],
+
+    // 10
+    [2, 86, 68, 2, 87, 69],
+    [4, 69, 43, 1, 70, 44],
+    [6, 43, 19, 2, 44, 20],
+    [6, 43, 15, 2, 44, 16],
+
+    // 11
+    [4, 101, 81],
+    [1, 80, 50, 4, 81, 51],
+    [4, 50, 22, 4, 51, 23],
+    [3, 36, 12, 8, 37, 13],
+
+    // 12
+    [2, 116, 92, 2, 117, 93],
+    [6, 58, 36, 2, 59, 37],
+    [4, 46, 20, 6, 47, 21],
+    [7, 42, 14, 4, 43, 15],
+
+    // 13
+    [4, 133, 107],
+    [8, 59, 37, 1, 60, 38],
+    [8, 44, 20, 4, 45, 21],
+    [12, 33, 11, 4, 34, 12],
+
+    // 14
+    [3, 145, 115, 1, 146, 116],
+    [4, 64, 40, 5, 65, 41],
+    [11, 36, 16, 5, 37, 17],
+    [11, 36, 12, 5, 37, 13],
+
+    // 15
+    [5, 109, 87, 1, 110, 88],
+    [5, 65, 41, 5, 66, 42],
+    [5, 54, 24, 7, 55, 25],
+    [11, 36, 12],
+
+    // 16
+    [5, 122, 98, 1, 123, 99],
+    [7, 73, 45, 3, 74, 46],
+    [15, 43, 19, 2, 44, 20],
+    [3, 45, 15, 13, 46, 16],
+
+    // 17
+    [1, 135, 107, 5, 136, 108],
+    [10, 74, 46, 1, 75, 47],
+    [1, 50, 22, 15, 51, 23],
+    [2, 42, 14, 17, 43, 15],
+
+    // 18
+    [5, 150, 120, 1, 151, 121],
+    [9, 69, 43, 4, 70, 44],
+    [17, 50, 22, 1, 51, 23],
+    [2, 42, 14, 19, 43, 15],
+
+    // 19
+    [3, 141, 113, 4, 142, 114],
+    [3, 70, 44, 11, 71, 45],
+    [17, 47, 21, 4, 48, 22],
+    [9, 39, 13, 16, 40, 14],
+
+    // 20
+    [3, 135, 107, 5, 136, 108],
+    [3, 67, 41, 13, 68, 42],
+    [15, 54, 24, 5, 55, 25],
+    [15, 43, 15, 10, 44, 16],
+
+    // 21
+    [4, 144, 116, 4, 145, 117],
+    [17, 68, 42],
+    [17, 50, 22, 6, 51, 23],
+    [19, 46, 16, 6, 47, 17],
+
+    // 22
+    [2, 139, 111, 7, 140, 112],
+    [17, 74, 46],
+    [7, 54, 24, 16, 55, 25],
+    [34, 37, 13],
+
+    // 23
+    [4, 151, 121, 5, 152, 122],
+    [4, 75, 47, 14, 76, 48],
+    [11, 54, 24, 14, 55, 25],
+    [16, 45, 15, 14, 46, 16],
+
+    // 24
+    [6, 147, 117, 4, 148, 118],
+    [6, 73, 45, 14, 74, 46],
+    [11, 54, 24, 16, 55, 25],
+    [30, 46, 16, 2, 47, 17],
+
+    // 25
+    [8, 132, 106, 4, 133, 107],
+    [8, 75, 47, 13, 76, 48],
+    [7, 54, 24, 22, 55, 25],
+    [22, 45, 15, 13, 46, 16],
+
+    // 26
+    [10, 142, 114, 2, 143, 115],
+    [19, 74, 46, 4, 75, 47],
+    [28, 50, 22, 6, 51, 23],
+    [33, 46, 16, 4, 47, 17],
+
+    // 27
+    [8, 152, 122, 4, 153, 123],
+    [22, 73, 45, 3, 74, 46],
+    [8, 53, 23, 26, 54, 24],
+    [12, 45, 15, 28, 46, 16],
+
+    // 28
+    [3, 147, 117, 10, 148, 118],
+    [3, 73, 45, 23, 74, 46],
+    [4, 54, 24, 31, 55, 25],
+    [11, 45, 15, 31, 46, 16],
+
+    // 29
+    [7, 146, 116, 7, 147, 117],
+    [21, 73, 45, 7, 74, 46],
+    [1, 53, 23, 37, 54, 24],
+    [19, 45, 15, 26, 46, 16],
+
+    // 30
+    [5, 145, 115, 10, 146, 116],
+    [19, 75, 47, 10, 76, 48],
+    [15, 54, 24, 25, 55, 25],
+    [23, 45, 15, 25, 46, 16],
+
+    // 31
+    [13, 145, 115, 3, 146, 116],
+    [2, 74, 46, 29, 75, 47],
+    [42, 54, 24, 1, 55, 25],
+    [23, 45, 15, 28, 46, 16],
+
+    // 32
+    [17, 145, 115],
+    [10, 74, 46, 23, 75, 47],
+    [10, 54, 24, 35, 55, 25],
+    [19, 45, 15, 35, 46, 16],
+
+    // 33
+    [17, 145, 115, 1, 146, 116],
+    [14, 74, 46, 21, 75, 47],
+    [29, 54, 24, 19, 55, 25],
+    [11, 45, 15, 46, 46, 16],
+
+    // 34
+    [13, 145, 115, 6, 146, 116],
+    [14, 74, 46, 23, 75, 47],
+    [44, 54, 24, 7, 55, 25],
+    [59, 46, 16, 1, 47, 17],
+
+    // 35
+    [12, 151, 121, 7, 152, 122],
+    [12, 75, 47, 26, 76, 48],
+    [39, 54, 24, 14, 55, 25],
+    [22, 45, 15, 41, 46, 16],
+
+    // 36
+    [6, 151, 121, 14, 152, 122],
+    [6, 75, 47, 34, 76, 48],
+    [46, 54, 24, 10, 55, 25],
+    [2, 45, 15, 64, 46, 16],
+
+    // 37
+    [17, 152, 122, 4, 153, 123],
+    [29, 74, 46, 14, 75, 47],
+    [49, 54, 24, 10, 55, 25],
+    [24, 45, 15, 46, 46, 16],
+
+    // 38
+    [4, 152, 122, 18, 153, 123],
+    [13, 74, 46, 32, 75, 47],
+    [48, 54, 24, 14, 55, 25],
+    [42, 45, 15, 32, 46, 16],
+
+    // 39
+    [20, 147, 117, 4, 148, 118],
+    [40, 75, 47, 7, 76, 48],
+    [43, 54, 24, 22, 55, 25],
+    [10, 45, 15, 67, 46, 16],
+
+    // 40
+    [19, 148, 118, 6, 149, 119],
+    [18, 75, 47, 31, 76, 48],
+    [34, 54, 24, 34, 55, 25],
+    [20, 45, 15, 61, 46, 16]
+];
+
+/**
+ * 根据数据获取对应版本
+ * @return {[type]} [description]
+ */
+QRCodeAlg.prototype.getRightType = function () {
+    for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
+        var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
+        if (rsBlock == undefined) {
+            throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
+        }
+        var length = rsBlock.length / 3;
+        var totalDataCount = 0;
+        for (var i = 0; i < length; i++) {
+            var count = rsBlock[i * 3 + 0];
+            var dataCount = rsBlock[i * 3 + 2];
+            totalDataCount += dataCount * count;
+        }
+        var lengthBytes = typeNumber > 9 ? 2 : 1;
+        if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
+            this.typeNumber = typeNumber;
+            this.rsBlock = rsBlock;
+            this.totalDataCount = totalDataCount;
+            break;
+        }
+    }
+};
+
+//---------------------------------------------------------------------
+// QRBitBuffer
+//---------------------------------------------------------------------
+function QRBitBuffer() {
+    this.buffer = new Array();
+    this.length = 0;
+}
+QRBitBuffer.prototype = {
+    get: function (index) {
+        var bufIndex = Math.floor(index / 8);
+        return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1);
+    },
+    put: function (num, length) {
+        for (var i = 0; i < length; i++) {
+            this.putBit(((num >>> (length - i - 1)) & 1));
+        }
+    },
+    putBit: function (bit) {
+        var bufIndex = Math.floor(this.length / 8);
+        if (this.buffer.length <= bufIndex) {
+            this.buffer.push(0);
+        }
+        if (bit) {
+            this.buffer[bufIndex] |= (0x80 >>> (this.length % 8));
+        }
+        this.length++;
+    }
+};
+
+
+
+// // xzedit
+// let qrcodeAlgObjCache = []
+// /**
+//  * 二维码构造函数,主要用于绘制
+//  * @param  {参数列表} opt 传递参数
+//  * @return {}
+//  */
+// this.options = {
+//     text: '',
+//     size: 256,
+//     correctLevel: 3,
+//     background: '#ffffff',
+//     foreground: '#000000',
+//     pdground: '#000000',
+//     image: '',
+//     imageSize: 30,
+// }
+// //使用QRCodeAlg创建二维码结构
+// let qrCodeAlg = null
+// let l = qrcodeAlgObjCache.length
+// let i
+// for (i = 0;i < l; i++) {
+//     if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
+//         qrCodeAlg = qrcodeAlgObjCache[i].obj
+//         break
+//     }
+// }
+// if (i == l) {
+//     qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel)
+//     qrcodeAlgObjCache.push({
+//         text: this.options.text,
+//         correctLevel: this.options.correctLevel,
+//         obj: qrCodeAlg
+//     })
+// }
+// /**
+//  * 计算矩阵点的前景色
+//  * @param {Obj} config
+//  * @param {Number} config.row 点x坐标
+//  * @param {Number} config.col 点y坐标
+//  * @param {Number} config.count 矩阵大小
+//  * @param {Number} config.options 组件的options
+//  * @return {String}
+//  */
+// let getForeGround = function (config) {
+//     var options = config.options
+//     if (options.pdground && (
+//         (config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5) ||
+//         (config.row > (config.count - 6) && config.row < (config.count - 2) && config.col > 1 && config.col < 5) ||
+//         (config.row > 1 && config.row < 5 && config.col > (config.count - 6) && config.col < (config.count - 2))
+//     )) {
+//         return options.pdground
+//     }
+//     return options.foreground
+// }
+// let count = qrCodeAlg.getModuleCount()
+// let ratioSize = options.size
+// let ratioImgSize = options.imageSize
+// //计算每个点的长宽
+// let tileW = (ratioSize / count).toPrecision(4)
+// let tileH = (ratioSize / count).toPrecision(4)
+// //绘制
+// for (let row = 0; row < count; row++) {
+//     for (var col = 0; col < count; col++) {
+//         var w = (Math.ceil((col + 1) * tileW) - Math.floor(col * tileW))
+//         var h = (Math.ceil((row + 1) * tileW) - Math.floor(row * tileW))
+//         var foreground = getForeGround({
+//             row: row,
+//             col: col,
+//             count: count,
+//             options: options
+//         })
+//         ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background)
+//         ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h)
+//     }
+// }

+ 346 - 0
uni_modules/sakura-canvas/js_sdk/util.js

@@ -0,0 +1,346 @@
+// 路径转base64
+import { base64ToPath } from './image-tools'
+/**
+ * base64转本地路径
+ * @param { String } path 路径
+ * @returns 
+ */
+ export function base64ToPathFn(path) {
+	let reg =
+		/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*?)\s*$/i
+	if (!reg.test(path)) {
+		return Promise.resolve(path)
+	}
+	return base64ToPath(path)
+}
+
+/**
+ * 下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径
+ * @param { String } url 资源路径
+ * @param { Object } options 回调 
+ * @returns 
+ */
+export function downloadFile(url, options = {
+	onProgressUpdate: () => {}
+}) {
+	return new Promise(resolve => {
+		try {
+			let download = uni.downloadFile({
+				url,
+				header: options.header || {},
+				success(res) {
+					return resolve({
+						success: true,
+						data: res
+					})
+				},
+				fail() {
+					return resolve({
+						success: false,
+						message: `下载资源${url}失败`
+					})
+				}
+			})
+			// 下载进度回调
+			download.onProgressUpdate(data => {
+				options.onProgressUpdate(data)
+			})
+		} catch(e) {
+			return resolve({
+				success: false,
+				msg: `下载资源${url}失败`
+			})
+		}
+	})
+}
+
+/**
+ * 加载提示框
+ * @param { String } title 提示内容
+ * @param { Boolean } mask 是否显示透明蒙层
+ */
+export function showLoading(title, mask = true) {
+	uni.showLoading({
+		title,
+		mask
+	})
+}
+
+/**
+ * 关闭加载提示框
+ */
+export function hideLoading() {
+	uni.hideLoading()
+}
+
+/**
+ * 不需要确认提示框
+ * @param { String } title 提示内容
+ * @param { Object } options 参数
+ * @param { Stirng } options.icon 提示图片
+ * @param { String || Number } options.duration 时效
+ */
+export function showToast(title, options = {}) {
+	uni.showToast({
+		title,
+		icon: options.icon || "none",
+		duration: options.duration || 1500,
+		mask: options.mask || false
+	})
+}
+
+/**
+ * 保存图片到系统相册。
+ * @param { String } filePath 图片文件路径,可以是临时文件路径也可以是永久文件路径,不支持网络图片路径
+ * @returns 
+ */
+export function saveImageToPhotosAlbum(filePath) {
+	return new Promise(resolve => {
+		showLoading('保存中...')
+		uni.saveImageToPhotosAlbum({
+			filePath,
+			success(res) {
+				hideLoading()
+				resolve({
+					success: true,
+					data: res.file
+				})
+			},
+			fail(err) {
+				hideLoading()
+				resolve({
+					success: false,
+					message: err
+				})
+			}
+		})
+	})
+}
+
+/**
+ * 计算文字长度
+ * @param { CanvasText } Context canvas对象
+ * @param { String } text 文本
+ * @param { String } size 长度
+ * @returns 
+ */
+export function countTextLength(Context, text, size) {
+    let textLength = 0
+    Context.setFontSize(size)
+    try {
+        textLength = Context.measureText(text)
+    } catch(e) {
+        textLength = {}
+    }
+    textLength = textLength && textLength.width ? textLength.width : 0
+    if (textLength == 0) {
+        for (let i of text) {
+            textLength += Context.measureText(text)
+        }
+        textLength * size
+    }
+    return textLength
+}
+
+
+/**
+ * 压缩图片 H5不支持
+ * @param { Object } params 
+ * @param { String } params.src 图片路径,图片的路径,可以是相对路径、临时文件路径、存储文件路径
+ * @param { String } params.quality 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)
+ * @param { String } params.width 缩放图片的宽度,支持像素值(如"100px")、百分比(如"50%")、自动计算(如"auto",即根据height与源图高的缩放比例计算,若未设置height则使用源图高度)
+ * @param { String } params.height 缩放图片的高度,支持像素值(如"100px")、百分比(如"50%")、自动计算(如"auto",即根据height与源图高的缩放比例计算,若未设置height则使用源图高度)
+ * @returns 
+ */
+export function compressImage(params = {}) {
+	return new Promise(resolve => {
+		uni.compressImage({
+			src: params.src || '',
+			quality: params.quality || 80,
+			width: params.width || 'auto',
+			height: params.height || 'auto',
+			success: res => {
+				resolve({
+					success: true,
+					src: res.tempFilePath
+				})
+			},
+			fail: res => {
+				resolve({
+					success: false,
+					message: '压缩图片失败'
+				})
+			}
+		})
+	})
+}
+
+
+/**
+* 获取图片信息
+* @param { String } src 图片地址
+*/
+export function getImageInfo(src){
+   	return new Promise(resolve =>{
+		uni.getImageInfo({
+			src,
+			success: res => {
+				let { path } = res
+				// #ifdef H5
+				let index = path.lastIndexOf('.', path.length)
+				let type = ''
+				if (index != -1) {
+					type = path.substring(index + 1, path.length)
+				} else {
+					type = 'png'
+				}
+				res.type = type
+				// #endif
+				resolve({
+					success: true,
+					...res
+				})
+			},
+			fail: e => {
+				resolve({
+					success: false,
+					msg: e
+				})
+			}
+		})
+	})
+}
+
+
+/**
+ * 获取使用模式的图片信息
+ * @param { String | Number } oWidth 原图宽度
+ * @param { String | Number } oHeight 原图高度
+ * @param { String | Number } x x轴位置
+ * @param { String | Number } y y轴位置
+ * @param { String | Number } width 宽度
+ * @param { String | Number } height 高度
+ * @param { String } mode 模式 
+ * 			 		 aspectFit 保持纵横比缩放图片,使图片的长边能完全显示出来。也就是说,可以完整地将图片显示出来。
+ * 					 aspectFill 保持纵横比缩放图片,只保证图片的短边能完全显示出来。也就是说,图片通常只在水平或垂直方向是完整的,另一个方向将会发生截取。
+ * 					 widthFix  宽度不变,高度自动变化,保持原图宽高比不变
+ * 					 heightFix 高度不变,宽度自动变化,保持原图宽高比不变
+ */
+export function getModeImage(oWidth, oHeight, x, y, width, height, mode) {
+	if (mode == 'aspectFit') {
+		return getAspectFitModelInfo(oWidth, oHeight, x, y, width, height)
+	}
+
+	if (mode == 'aspectFill') {
+		return getAspectFillModelInfo(oWidth, oHeight, x, y, width, height)
+	}
+
+	if (mode == 'widthFix') {
+		return getWidthFixModelInfo(oWidth, oHeight, x, y, width, height)
+	}
+
+	if (mode == 'heightFix') {
+		return getHeightFixModelInfo(oWidth, oHeight, x, y, width, height)
+	}
+	
+	if (mode == 'default') {
+		return {
+			dw: width,
+			dh: height,
+			dx: x,
+			dy: y
+		}
+	}
+	return getAspectFillModelInfo(oWidth, oHeight, x, y, width, height)
+}
+
+
+// aspectFit 保持纵横比缩放图片,使图片的长边能完全显示出来。也就是说,可以完整地将图片显示出来。
+function getAspectFitModelInfo(oWidth, oHeight, x, y, width, height) {
+	let aspect = oHeight / oWidth
+	let sw = width
+	let sh = aspect * sw
+	if (aspect > 1) {
+		aspect = oWidth / oHeight
+		sh = height
+		sw = aspect * sh
+	}
+	return {
+		sw,
+		sh,
+		sx: x,
+		sy: y,
+		dw: oWidth,
+		dh: oHeight,
+		dx: 0,
+		dy: 0
+	}
+}
+
+// 保持纵横比缩放图片,只保证图片的短边能完全显示出来。也就是说,图片通常只在水平或垂直方向是完整的,另一个方向将会发生截取。
+function getAspectFillModelInfo(oWidth, oHeight, x, y, width, height) {
+	// 高比宽大 宽是短边
+	let aspect = oHeight / oWidth
+	let sw = width
+	let sh = aspect * sw
+	let dx = 0
+	let dy = (sh - height) / 2
+	if (aspect < 1) {
+		// 高比宽小 高是短边
+		aspect = oWidth / oHeight
+		sh = height
+		sw = aspect * sh
+		dy = 0
+		dx = (sw - width) / 2
+	}
+	return {
+		sw,
+		sh,
+		sx: x,
+		sy: y,
+		dw: oWidth,
+		dh: oHeight,
+		dx,
+		dy
+	}
+}
+
+
+// 宽度不变,高度自动变化,保持原图宽高比不变
+function getWidthFixModelInfo(oWidth, oHeight, x, y, width, height) {
+	let aspect = oHeight / oWidth
+	let sw = width
+	let sh = sw * aspect
+	let dx = 0
+	let dy = 0
+	return {
+		sw,
+		sh,
+		sx: x,
+		sy: y,
+		dw: oWidth,
+		dh: oHeight,
+		dx,
+		dy
+	}
+}
+
+
+// 高度不变,宽度自动变化,保持原图宽高比不变
+function getHeightFixModelInfo(oWidth, oHeight, x, y, width, height) {
+	let aspect = oWidth / oHeight
+	let sh = height
+	let sw = sh * aspect
+	let dx = 0
+	let dy = 0
+	return {
+		sw,
+		sh,
+		sx: x,
+		sy: y,
+		dw: oWidth,
+		dh: oHeight,
+		dx,
+		dy
+	}
+}

+ 79 - 0
uni_modules/sakura-canvas/package.json

@@ -0,0 +1,79 @@
+{
+  "id": "sakura-canvas",
+  "displayName": "canvas绘制海报(分享图) ",
+  "version": "1.0.29",
+  "description": "支持JSON格式绘制海报。内置拥有许多的封装方法,便于你更快绘制",
+  "keywords": [
+    "uni_modules",
+    "canvas",
+    "绘制海报",
+    "分享图"
+],
+  "repository": "",
+  "engines": {
+    "HBuilderX": "^3.1.0"
+  },
+  "dcloudext": {
+    "category": [
+        "JS SDK",
+        "通用 SDK"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": ""
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "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",
+          "阿里": "u",
+          "百度": "u",
+          "字节跳动": "y",
+          "QQ": "u"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 478 - 0
uni_modules/sakura-canvas/readme.md

@@ -0,0 +1,478 @@
+# sakura-canvas(海报生成器)
+
+
+
+# 用前需知: 
+
+## 1、小程序绘制时,记得配置图片的域名为安全域名(白名单)
+
+## 2、兼容性。目前只测试过APP(不包括NVUE页面), 微信小程序, H5, 字节跳动小程序。其他小程序未测。
+
+
+
+
+
+# 引入
+
+```javascript
+import Draw from '@/uni_modules/sakura-canvas/js_sdk/draw'
+```
+
+
+
+# 使用教程
+
+
+
+## 初始化
+
+```javascript
+let draw = new Draw({
+    width: 375, // canvas(海报)的宽度 必填
+    height: 500, // canvas(海报)的高度 必填
+    canvasId: 'myCanvas', // canvasId 必填
+    _this: this, // 传入this实例 必填
+    background: {
+        type: 'color', // 背景样式 color: 纯色 image: 图片
+        color: '#fffff',
+        // color: 参数详看绘制矩形的参数
+        // image: 详看绘制图片时的参数
+    }, // 背景 默认纯白,
+    drawDelayTime: 200, // 绘制海报时的延迟时间(单位毫秒),默认200,
+    delayTime: 200, // 导出图片时的延迟时间(单位毫秒),默认200,
+    fileType: 'png', // 导出图片的类型, 默认png 可选jpg, png
+    quality: 1, // 导出图片的质量, 默认1 值范围0~1, 大于一都为1处理
+    drawTipsText: '绘制中...', // 绘制时的加载提示, 默认绘制中...
+})
+```
+
+
+
+## Draw类内置方法大纲
+
+
+
+# 非Json方式绘制
+
+## 绘制文本-text
+
+# !!!注意绘制文本添加使用\n实现自定义换行
+
+```javascript
+// 绘制文字
+draw.drawText({
+    x: 0, // x轴方向 默认 0
+    y: 0, // y轴方向 默认 0
+    w: 100, // 文字宽度 默认整个画布的宽度 - x轴的距离
+    text: '你好\n世界', // 文字内容
+    textIndent: 0, // 文字首行缩进 默认0 注意在设置了windowAlign或者textAlign的时候会失去作用
+    font: {
+        size: 12, // 文字大小 默认12
+        family: '微软雅黑', // 文字字体 默认sans-serif
+        style: 'normal', // 文字样式 默认 normal 可选: italic: 斜体 oblique: 倾斜体
+        weight: 'normal' // 文字粗体 默认 normal 可传递 bold: 粗体 数字
+    },
+    line: {
+        num: -1, // 限制文字行数,默认 -1: 不限制 限制行数,多出部分会变成...
+        height: 16, // 行高默认16
+        style: 'none', // 样式 默认none: 不需要 可选 underline: 下划线, lineThrough 删除线
+        type: 'solid', // 线类型 当使用样式时线的类型 默认: solid 实线 可选: dashed 虚线 
+        width: 1, // 线宽度 默认1
+    },
+    color: '#000000', // 文字颜色 默认#000000 在不考虑字节跳动小程序的前提下可简写(#000)
+    alpha: 1, // 透明度 默认1 取值范围 0~1
+    isFill: true, // 是否是填充字体, false: 线性字体
+    windowAlign: 'none', // 文字在窗口(整个画布的宽度)对齐的方式 默认: none 可选 居中: center 右边: right
+    textAlign: 'none', // 文字水平对齐的方式 默认: none 可选 居中: center 右边: right
+})
+```
+
+
+
+## 绘制矩形-rect
+
+```javascript
+// 绘制矩形
+draw.drawRect({
+    x: 0, // x轴方向 默认 0
+    y: 0, // y轴方向 默认 0
+    w: 100, // 宽度 必填
+    h: 100, // 高度 必填
+    r: 0, // 矩形圆角大小 默认: 0
+    color: '#000000', // 颜色 默认#000000 在不考虑字节跳动小程序的前提下可简写(#000)
+    alpha: 1, // 透明度 默认1 取值范围 0~1
+    isFill: true, // 是否是填充矩形, false: 线性矩形
+    lineWidth: 1, // 当矩形为线性时,矩形的边框宽度
+    windowAlign: 'none', // 矩形在窗口(整个画布的宽度)对齐的方式 默认: none 可选 居中: center 右边: right
+    // 旋转
+    rotate: {
+        deg: 0, // 旋转角度
+        type: 'middle', // 旋转的中心点 默认: middle: 矩形正中心
+        // topLeft: 中心点在上左 topMiddle 中心点在上中 topRight 中心点在上右
+        // middleLeft: 中心点在中左 bottomMiddle 中心点在正中间 middleRight 中心点在中右
+        // bottomLeft: 中心点在下左 bottomMiddle 中心点在下中 middleRight 中心点在下右
+    },
+    borderWidth: 0, // 边框大小 默认0 (类型为填充矩形时生效)
+    borderColor: '#ffffff', // 边框颜色 默认无颜色 (类型为填充矩形时生效)
+    // 圆角的方向
+    // 值类型为数组, 添加不同的圆角方向设置哪里是圆角哪里不是圆角
+    // 参数可选值 tr: 上右; tl: 上左; bl:左下; br: 左右; default: 全圆角
+    borderType: ['tr', 'tl'] // 默认全圆角['default']
+})
+```
+
+
+
+## 绘制圆-arc
+
+```javascript
+// 绘制圆
+draw.drawArc({
+    x: 0, // x轴方向 默认 0
+    y: 0, // y轴方向 默认 0
+    r: 100, // 圆半径 必填
+    s: 0, // 画圆的起始角度
+    e: Math.PI * 2, // 画圆的终止角度
+    d: false, // 指定弧度的方向是逆时针还是顺时针。默认是false,即顺时针。
+    color: '#000000', // 颜色 默认#000000 在不考虑字节跳动小程序的前提下可简写(#000)
+    alpha: 1, // 透明度 默认1 取值范围 0~1
+    isFill: true, // 是否是填充圆, false: 线性圆
+    lineWidth: 1, // 当圆为线性时,圆的边框宽度
+    windowAlign: 'none', // 圆在窗口(整个画布的宽度)对齐的方式 默认: none 可选 居中: center 右边: right
+    borderWidth: 0, // 边框大小 默认0 (类型为填充圆时生效)
+    borderColor: '#ffffff' // 边框颜色 默认无颜色 (类型为填充圆时生效)
+})
+```
+
+
+
+## 绘制三角形-triangle
+
+```javascript
+// 绘制三角形
+draw.drawTriangle({
+    x: 0, // x轴方向 默认 0
+    y: 0, // y轴方向 默认 0
+    w: 100, // 宽度 必填
+    h: 100, // 高度 必填
+    r: 0, // 矩形圆角大小 默认: 0
+    color: '#000000', // 颜色 默认#000000 在不考虑字节跳动小程序的前提下可简写(#000)
+    alpha: 1, // 透明度 默认1 取值范围 0~1
+    isFill: true, // 是否是填充三角形, false: 线性三角形
+    lineWidth: 1, // 当三角形为线性时,三角形的边框宽度
+    drawType: 'isosceles', // 绘制的三角形类型 默认 isosceles: 等腰三角形 right: 直角三角形 custom: 自定义自定义时,x, y, 宽, 高都不需要传递。需要传递绘制点的坐标类型是数组(coordinate)
+    // 三角形定点朝向 top, left, right, bottom (只在等腰三角形和直角三角形里生效,自定义绘制不生效)
+    direction: params.direction || 'top',
+    coordinate: [], // 当绘制类别是自定义的时候需要传递的参数[[x1, y1], [x2, y2], [x3, y3]]
+    windowAlign: 'none', // 三角形在窗口(整个画布的宽度)对齐的方式 默认: none 可选 居中: center 右边: right (并且三角形类型不能为自定义)
+    // 旋转
+    rotate: {
+        deg: 0, // 旋转角度
+        type: 'middle', // 旋转的中心点 默认: middle: 三角形正中心
+        // top: 上 left: 左 right: 右 middle: 中心
+    },
+    borderWidth: 0, // 边框大小 默认0 (类型为填充三角形时生效)
+    borderColor: '#ffffff' // 边框颜色 默认无颜色 (类型为填充三角形时生效)
+})
+```
+
+
+
+## 绘制线条-line
+
+```javascript
+// 绘制线条
+draw.drawLine({
+    x: 0, // x轴方向 默认 0
+    y: 0, // y轴方向 默认 0
+    w: 100, // 宽度 默认整个画布的宽度 - x轴的距离
+    color: '#000000', // 颜色 默认#000000 在不考虑字节跳动小程序的前提下可简写(#000)
+    alpha: 1, // 透明度 默认1 取值范围 0~1
+    lineType: 'solid', // 线条类型 默认 solid: 实线 可选 dashed: 虚线 
+    pattern: [5, 5], // 当线条类型为虚线是生效,具体详看CanvasContext.setLineDash文档
+    offset: 5, // 虚线偏移量 默认: 5
+    lineWidth: 1, // 线条高度
+    lineCap: 'butt', // 线条端点样式 默认 butt 可选 round, square
+    windowAlign: 'none', // 线条在窗口(整个画布的宽度)对齐的方式 默认: none 可选 居中: center 右边: right
+})
+```
+
+
+
+## 绘制图片-image
+
+```javascript
+// 绘制图片
+await draw.drawImage({
+    x: 0, // x轴方向 默认 0
+    y: 0, // y轴方向 默认 0
+    w: 100, // 图片宽度 必填
+    h: 100, // 图片高度 必填
+    r: 0, // 当图片样式为矩形时, 圆角的大小
+    alpha: 1, // 透明度 默认1 取值范围 0~1
+    src: '/static/logo.png', // 图片资源路径 必填 网络路径(小程序中需要配置白名单),本地路径, base64(使用base64格式绘制速度会稍微慢点,在IOS端显著。)
+    mode: 'aspectFill', // 图片模式 默认 aspectFill 可选 aspectFit, widthFix, heightFix
+    drawType: 'default', // 图片样式 default: 默认 rect: 矩形, arc: 圆形 triangle: 三角形
+    triangle: {
+        type: 'isosceles', // 三角形的类型 right: 直角三角形 isosceles: 等腰三角形 custom: 自定义三角形(不支持旋转)
+        coordinate: [], // 自定义时传递, [[x1, y1], [x2, y2], [x3, y3]],
+        triangle: 'top', // 三角形顶点朝向
+    }, // 绘制三角形时传递
+    borderWidth: 0, // 图片边框大小
+    borderColor: '#ffffff', // 图片边框颜色
+    // 图片圆角的方向
+    // 值类型为数组, 添加不同的圆角方向设置哪里是圆角哪里不是圆角
+    // 参数可选值 tr: 上右; tl: 上左; bl:左下; br: 左右; default: 全圆角
+    borderType: ['tr', 'tl'], // 默认全圆角['default']
+    windowAlign: 'none', // 图片在窗口(整个画布的宽度)对齐的方式 默认: none 可选 居中: center 右边: right
+    quality: 80, // 压缩图片的质量 默认 80 值范围0~100
+    rotate: {}, // 旋转 具体可看绘制矩形和绘制三角形中的属性值
+})
+```
+
+
+
+
+
+## 绘制二维码
+
+```javascript
+// 绘制二维码
+draw.drawQrCode({
+   	x: 0, // x轴方向 默认 0
+    y: 0, // y轴方向 默认 0
+    size: 100, // 二维码的大小 默认100
+    text: '', // 二维码内容 默认''
+    background: '#000000', // 二维码背景色 默认#00000
+    foreground: '#ffffff', // 二维码前景色 默认#fffff
+    pdground: '#ffffff', // 二维码角标色 默认 #fffff
+    lv: 3, // 容错级别(一般不需要调它) 默认值是3
+    windowAlign: 'none', // 二维码在窗口(整个画布的宽度)对齐的方式 默认: none 可选 居中: center 右边: right
+    // 二维码中间的图片 可选
+    image: {
+        src: '/static/logo.png', //网络路径(小程序中需要配置白名单),本地路径, base64(使用base64格式绘制速度会稍微慢点,在IOS端显著。)
+        size: 30,  // 图片大小 默认 30
+        r: 0,  // 图片圆角 默认 0
+        borderWidth: 0, // 图片边框大小 默认0
+        borderColor: '#ffffff' // 图片边框颜色 默认无颜色
+    }
+})
+```
+
+
+
+## 自定义绘制-custom
+
+### 具体详看Context文档  [点我跳转](https://uniapp.dcloud.io/api/canvas/CanvasContext)
+
+```javascript
+// 自定义绘制
+draw.Context.fillText('你好', 0, 200)
+```
+
+
+
+## 将通过以上方法绘制的内容绘制到画板上
+
+```javascript
+// complete 是否导出图片,默认 true会绘制图片并返回图片路径 false时需要自行调用uni.canvasToTempFilePath()方法导出图片
+await draw.canvasDraw(complete)
+```
+
+
+
+
+
+# Json方式绘制内容(推荐使用Json方式绘制)
+
+
+
+```javascript
+// bgObj: 背景大小含有背景宽高
+// ctxObj: 画布大小含有画布宽高
+// res接收参数格式
+// res.success: 是否成功 true: 成功 false: 失败
+// res.message: 成功或者失败时的信息
+// res.data: 成功时绘制的图片路径
+let res = await draw.createdSharePoster(({ bgObj, ctxObj }) => {
+    let data = [
+        // 绘制文字
+        {
+            name: '', // 用于在callBack中寻找
+            type: 'text',
+            // callBack: 用于知道上一次绘制的内容具体的数据
+            // before: 上一次绘制的内容的数据,当你绘制的内容处于第一个则是一个空对象
+            // all: 所有绘制内容的数据
+            callBack: (before, all) => {
+                let { sx, sy, ex, ey, w, h } = before
+                // sx: 上一次绘制内容开始的x轴位置
+                // sy: 上一次绘制内容开始的y轴位置
+                // ex: 上一次绘制内容结束的x轴位置
+                // ey: 上一次绘制内容结束的y轴位置
+                // w: 上一次绘制内容的宽度
+                // h: 上一次绘制内容的高度
+                // callBack 返回的对象会覆盖原属性
+                return {
+                    x: sx,
+                    y: sy
+                }
+            }
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawText 方法的参数
+        },
+        // 绘制矩形
+        {
+            type: 'rect',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawRect 方法的参数
+        },
+        // 绘制圆
+        {
+            type: 'arc',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawArc 方法的参数
+        },
+        // 绘制三角形
+        {
+            type: 'triangle',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawTriangle 方法的参数
+        },
+        // 绘制线条
+        {
+            type: 'line',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawLine 方法的参数
+        },
+        // 绘制图片
+        {
+            type: 'image',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawImage 方法的参数
+        },
+        // 绘制二维码
+        {
+            type: 'qrcode',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawQrCode 方法的参数
+        },
+        // 自定义绘制
+        {
+            type: 'custom',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // Context: 调用原生方法绘制
+            // _this: 调用draw类的内置方法绘制
+            setDarw(Context, _this) {
+                // 原生方法绘制
+                Context.fillText('你好', 0, 200)
+                // 使用draw类内置方法绘制
+                _this.drawText({
+                    x: 0,
+                    y: 0,
+                    text: '你好, 世界'
+                })
+            }
+        }
+    ]
+    return data
+})
+```
+
+
+
+
+
+# 绘制时,需要提前绘制一部分内容,然后后面等数据有了在绘制一部分内容的需求
+
+
+
+```javascript
+// 初始化
+let draw = new Draw({
+    width: 375, // canvas(海报)的宽度,
+    height: 500, // canvas(海报)的高度,
+    canvasId: 'myCanvas', // canvasId 必填
+    _this: this, // 传入this实例 必填
+    drawDelayTime: 200, // 绘制海报时的延迟时间(单位毫秒),默认200,
+    delayTime: 200, // 导出图片时的延迟时间(单位毫秒),默认200,
+    fileType: 'png', // 导出图片的类型, 默认png 可选jpg, png
+    quality: 1, // 导出图片的质量, 默认1 值范围0~1, 大于一都为1处理
+    drawTipsText: '绘制中...', // 绘制时的加载提示, 默认绘制中...
+})
+// 预绘制需要自行调用绘制背景
+await draw.preDrawBackground()
+// draw.preDraw(drawArray), complete)
+// 参数
+// drawArray: 参数如下
+// complete: 是否绘制完成,绘制完成会自行导出图片 默认false
+// 返回值
+// res接收参数格式
+// res.success: 是否成功 true: 成功 false: 失败
+// res.message: 成功或者失败时的信息
+// res.data: 成功时绘制的图片路径
+let res = await draw.preDraw(({ bgObj, ctxObj }) => {
+    let data = [
+        // 绘制文字
+        {
+            type: 'text',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawText 方法的参数
+        },
+        // 绘制矩形
+        {
+            type: 'rect',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawRect 方法的参数
+        },
+        // 绘制圆
+        {
+            type: 'arc',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawArc 方法的参数
+        },
+        // 绘制三角形
+        {
+            type: 'triangle',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawTriangle 方法的参数
+        },
+        // 绘制线条
+        {
+            type: 'line',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawLine 方法的参数
+        },
+        // 绘制图片
+        {
+            type: 'image',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawImage 方法的参数
+        },
+		// 绘制二维码
+        {
+            type: 'qrcode',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // 参数详看draw.drawQrCode 方法的参数
+        },
+        // 自定义绘制
+        {
+            type: 'custom',
+            zIndex: 0, // 绘制顺序 越小越先绘制
+            // Context: 调用原生方法绘制
+            // _this: 调用draw类的内置方法绘制
+            setDarw(Context, _this) {
+                // 原生方法绘制
+                Context.fillText('你好', 0, 200)
+                // 使用draw类内置方法绘制
+                _this.drawText({
+                    x: 0,
+                    y: 0,
+                    text: '你好, 世界'
+                })
+            }
+        }
+    ]
+    return data
+})
+```
+

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

@@ -0,0 +1,20 @@
+## 1.1.5(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.1.4(2021-07-29)
+- 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性
+## 1.1.3(2021-06-24)
+- 优化 示例项目
+## 1.1.1(2021-05-12)
+- 新增 组件示例地址
+## 1.1.0(2021-05-12)
+- 新增 uni-badge 的 absolute 属性,支持定位
+- 新增 uni-badge 的 offset 属性,支持定位偏移
+- 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点
+- 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+
+- 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式
+## 1.0.7(2021-05-07)
+- 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug
+- 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug
+- 新增 uni-badge 属性 custom-style, 支持自定义样式
+## 1.0.6(2021-02-04)
+- 调整为uni_modules目录规范

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

@@ -0,0 +1,253 @@
+<template>
+	<view class="uni-badge--x">
+		<slot />
+		<text v-if="text" :class="classNames" :style="[badgeWidth, positionStyle, customStyle, dotStyle]"
+			class="uni-badge"
+			@click="onClick()">{{displayValue}}</text>
+	</view>
+</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',
+		emits:['click'],
+		props: {
+			type: {
+				type: String,
+				default: 'default'
+			},
+			inverted: {
+				type: Boolean,
+				default: false
+			},
+			isDot: {
+				type: Boolean,
+				default: false
+			},
+			maxNum: {
+				type: Number,
+				default: 99
+			},
+			absolute: {
+				type: String,
+				default: ''
+			},
+			offset: {
+				type: Array,
+				default () {
+					return [0, 0]
+				}
+			},
+			text: {
+				type: [String, Number],
+				default: ''
+			},
+			size: {
+				type: String,
+				default: 'normal'
+			},
+			customStyle: {
+				type: Object,
+				default () {
+					return {}
+				}
+			}
+		},
+		data() {
+			return {};
+		},
+		computed: {
+			width() {
+				return String(this.text).length * 8 + 12
+			},
+			classNames() {
+				const {
+					inverted,
+					type,
+					size,
+					absolute
+				} = this
+				return [
+					inverted ? 'uni-badge--' + type + '-inverted' : '',
+					'uni-badge--' + type,
+					'uni-badge--' + size,
+					absolute ? 'uni-badge--absolute' : ''
+				]
+			},
+			positionStyle() {
+				if (!this.absolute) return {}
+				let w = this.width / 2,
+					h = 10
+				if (this.isDot) {
+					w = 5
+					h = 5
+				}
+				const x = `${- w  + this.offset[0]}px`
+				const y = `${- h + this.offset[1]}px`
+
+				const whiteList = {
+					rightTop: {
+						right: x,
+						top: y
+					},
+					rightBottom: {
+						right: x,
+						bottom: y
+					},
+					leftBottom: {
+						left: x,
+						bottom: y
+					},
+					leftTop: {
+						left: x,
+						top: y
+					}
+				}
+				const match = whiteList[this.absolute]
+				return match ? match : whiteList['rightTop']
+			},
+			badgeWidth() {
+				return {
+					width: `${this.width}px`
+				}
+			},
+			dotStyle() {
+				if (!this.isDot) return {}
+				return {
+					width: '10px',
+					height: '10px',
+					borderRadius: '10px'
+				}
+			},
+			displayValue() {
+				const { isDot, text, maxNum } = this
+				return isDot ? '' : (Number(text) > maxNum ? `${maxNum}+` : text)
+			}
+		},
+		methods: {
+			onClick() {
+				this.$emit('click');
+			}
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	$bage-size: 12px;
+	$bage-small: scale(0.8);
+	$bage-height: 20px;
+
+	.uni-badge--x {
+		/* #ifdef APP-NVUE */
+		// align-self: flex-start;
+		/* #endif */
+		/* #ifndef APP-NVUE */
+		display: inline-block;
+		/* #endif */
+		position: relative;
+	}
+
+	.uni-badge--absolute {
+		position: absolute;
+	}
+
+	.uni-badge {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		overflow: hidden;
+		box-sizing: border-box;
+		/* #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;
+		/* #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>

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

@@ -0,0 +1,88 @@
+{
+  "id": "uni-badge",
+  "displayName": "uni-badge 数字角标",
+  "version": "1.1.5",
+  "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
+  "keywords": [
+    "",
+    "badge",
+    "uni-ui",
+    "uniui",
+    "数字角标",
+    "徽章"
+],
+  "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"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

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

@@ -0,0 +1,58 @@
+
+
+## Badge 数字角标
+> **组件名:uni-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 size="small" :text="100" absolute="rightBottom" type="primary">
+	<button type="default">右上</button>
+</uni-badge>
+<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																															|
+|is-dot				|Boolean|false	|不展示数字,只有一个小点																																				|
+|max-num				|String/Numbuer|99	|展示封顶的数字值,超过 99 显示99+					|		
+|custom-style	|Object	|		{}		|自定义 Badge 样式, 样式对象语法																																|
+|inverted			|Boolean|false	|是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色																			|
+|absolute	(不支持 nvue)	|String|	rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角)	、leftTop(左上角)	|
+|offset			|Array[number]|	[0, 0]|距定位角中心点的偏移量,[-10, -10] 表示向 absolute 指定的方向偏移 10px,[10, 10] 表示向 absolute 指定的反方向偏移 10px,只有存在 absolute 属性时有效,与absolute 的值一一对应(例如:值为rightTop, 对应 offset 为 [right, Top])|
+
+### Badge Events
+
+|事件名	|事件说明			|返回参数	|
+|:-:	|:-:				|:-:		|
+|@click	|点击 Badge 触发事件| -			|
+
+
+
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge](https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge)

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

@@ -0,0 +1,10 @@
+## 1.4.2(2021-08-24)
+- 新增 支持国际化
+## 1.4.1(2021-08-05)
+- 修复 弹出层被 tabbar 遮盖 bug
+## 1.4.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.3.16(2021-05-12)
+- 新增 组件示例地址
+## 1.3.15(2021-02-04)
+- 调整为uni_modules目录规范 

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

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

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

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

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

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

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

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

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

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

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

@@ -0,0 +1,181 @@
+<template>
+	<view class="uni-calendar-item__weeks-box" :class="{
+		'uni-calendar-item--disable':weeks.disable,
+		'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+		'uni-calendar-item--checked':(calendar.fullDate === weeks.fullDate && !weeks.isDay) ,
+		'uni-calendar-item--before-checked':weeks.beforeMultiple,
+		'uni-calendar-item--multiple': weeks.multiple,
+		'uni-calendar-item--after-checked':weeks.afterMultiple,
+		}"
+	 @click="choiceDate(weeks)">
+		<view class="uni-calendar-item__weeks-box-item">
+			<text v-if="selected&&weeks.extraInfo" class="uni-calendar-item__weeks-box-circle"></text>
+			<text class="uni-calendar-item__weeks-box-text" :class="{
+				'uni-calendar-item--isDay-text': weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				'uni-calendar-item--disable':weeks.disable,
+				}">{{weeks.date}}</text>
+			<text v-if="!lunar&&!weeks.extraInfo && weeks.isDay" class="uni-calendar-item__weeks-lunar-text" :class="{
+				'uni-calendar-item--isDay-text':weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				}">{{todayText}}</text>
+			<text v-if="lunar&&!weeks.extraInfo" class="uni-calendar-item__weeks-lunar-text" :class="{
+				'uni-calendar-item--isDay-text':weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				'uni-calendar-item--disable':weeks.disable,
+				}">{{weeks.isDay ? todayText : (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text>
+			<text v-if="weeks.extraInfo&&weeks.extraInfo.info" class="uni-calendar-item__weeks-lunar-text" :class="{
+				'uni-calendar-item--extra':weeks.extraInfo.info,
+				'uni-calendar-item--isDay-text':weeks.isDay,
+				'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
+				'uni-calendar-item--multiple': weeks.multiple,
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
+				'uni-calendar-item--disable':weeks.disable,
+				}">{{weeks.extraInfo.info}}</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+	initVueI18n
+	} from '@dcloudio/uni-i18n'
+	import messages from './i18n/index.js'
+	const {	t	} = initVueI18n(messages)
+	export default {
+		emits:['change'],
+		props: {
+			weeks: {
+				type: Object,
+				default () {
+					return {}
+				}
+			},
+			calendar: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			},
+			selected: {
+				type: Array,
+				default: () => {
+					return []
+				}
+			},
+			lunar: {
+				type: Boolean,
+				default: false
+			}
+		},
+		computed: {
+			todayText() {
+				return t("uni-calender.today")
+			},
+		},
+		methods: {
+			choiceDate(weeks) {
+				this.$emit('change', weeks)
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.uni-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>

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

@@ -0,0 +1,547 @@
+<template>
+	<view class="uni-calendar">
+		<view v-if="!insert&&show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}" @click="clean"></view>
+		<view v-if="insert || show" class="uni-calendar__content" :class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow}">
+			<view v-if="!insert" class="uni-calendar__header uni-calendar--fixed-top">
+				<view class="uni-calendar__header-btn-box" @click="close">
+					<text class="uni-calendar__header-text uni-calendar--fixed-width">{{cancelText}}</text>
+				</view>
+				<view class="uni-calendar__header-btn-box" @click="confirm">
+					<text class="uni-calendar__header-text uni-calendar--fixed-width">{{okText}}</text>
+				</view>
+			</view>
+			<view class="uni-calendar__header">
+				<view class="uni-calendar__header-btn-box" @click.stop="pre">
+					<view class="uni-calendar__header-btn uni-calendar--left"></view>
+				</view>
+				<picker mode="date" :value="date" fields="month" @change="bindDateChange">
+					<text class="uni-calendar__header-text">{{ (nowDate.year||'') +' / '+( nowDate.month||'')}}</text>
+				</picker>
+				<view class="uni-calendar__header-btn-box" @click.stop="next">
+					<view class="uni-calendar__header-btn uni-calendar--right"></view>
+				</view>
+				<text class="uni-calendar__backtoday" @click="backtoday">{{todayText}}</text>
+
+			</view>
+			<view class="uni-calendar__box">
+				<view v-if="showMonth" class="uni-calendar__box-bg">
+					<text class="uni-calendar__box-bg-text">{{nowDate.month}}</text>
+				</view>
+				<view class="uni-calendar__weeks">
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{SUNText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{monText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{TUEText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{WEDText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{THUText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{FRIText}}</text>
+					</view>
+					<view class="uni-calendar__weeks-day">
+						<text class="uni-calendar__weeks-day-text">{{SATText}}</text>
+					</view>
+				</view>
+				<view class="uni-calendar__weeks" v-for="(item,weekIndex) in weeks" :key="weekIndex">
+					<view class="uni-calendar__weeks-item" v-for="(weeks,weeksIndex) in item" :key="weeksIndex">
+						<calendar-item class="uni-calendar-item--hook" :weeks="weeks" :calendar="calendar" :selected="selected" :lunar="lunar" @change="choiceDate"></calendar-item>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import Calendar from './util.js';
+	import calendarItem from './uni-calendar-item.vue'
+	import {
+	initVueI18n
+	} from '@dcloudio/uni-i18n'
+	import messages from './i18n/index.js'
+	const {	t	} = initVueI18n(messages)
+	/**
+	 * Calendar 日历
+	 * @description 日历组件可以查看日期,选择任意范围内的日期,打点操作。常用场景如:酒店日期预订、火车机票选择购买日期、上下班打卡等
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=56
+	 * @property {String} date 自定义当前时间,默认为今天
+	 * @property {Boolean} lunar 显示农历
+	 * @property {String} startDate 日期选择范围-开始日期
+	 * @property {String} endDate 日期选择范围-结束日期
+	 * @property {Boolean} range 范围选择
+	 * @property {Boolean} insert = [true|false] 插入模式,默认为false
+	 * 	@value true 弹窗模式
+	 * 	@value false 插入模式
+	 * @property {Boolean} clearDate = [true|false] 弹窗模式是否清空上次选择内容
+	 * @property {Array} selected 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}]
+	 * @property {Boolean} showMonth 是否选择月份为背景
+	 * @event {Function} change 日期改变,`insert :ture` 时生效
+	 * @event {Function} confirm 确认选择`insert :false` 时生效
+	 * @event {Function} monthSwitch 切换月份时触发
+	 * @example <uni-calendar :insert="true":lunar="true" :start-date="'2019-3-2'":end-date="'2019-5-20'"@change="change" />
+	 */
+	export default {
+		components: {
+			calendarItem
+		},
+		emits:['close','confirm','change','monthSwitch'],
+		props: {
+			date: {
+				type: String,
+				default: ''
+			},
+			selected: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			lunar: {
+				type: Boolean,
+				default: false
+			},
+			startDate: {
+				type: String,
+				default: ''
+			},
+			endDate: {
+				type: String,
+				default: ''
+			},
+			range: {
+				type: Boolean,
+				default: false
+			},
+			insert: {
+				type: Boolean,
+				default: true
+			},
+			showMonth: {
+				type: Boolean,
+				default: true
+			},
+			clearDate: {
+				type: Boolean,
+				default: true
+			}
+		},
+		data() {
+			return {
+				show: false,
+				weeks: [],
+				calendar: {},
+				nowDate: '',
+				aniMaskShow: false
+			}
+		},
+		computed:{
+			/**
+			 * for i18n
+			 */
+
+			okText() {
+				return t("uni-calender.ok")
+			},
+			cancelText() {
+				return t("uni-calender.cancel")
+			},
+			todayText() {
+				return t("uni-calender.today")
+			},
+			monText() {
+				return t("uni-calender.MON")
+			},
+			TUEText() {
+				return t("uni-calender.TUE")
+			},
+			WEDText() {
+				return t("uni-calender.WED")
+			},
+			THUText() {
+				return t("uni-calender.THU")
+			},
+			FRIText() {
+				return t("uni-calender.FRI")
+			},
+			SATText() {
+				return t("uni-calender.SAT")
+			},
+			SUNText() {
+				return t("uni-calender.SUN")
+			},
+		},
+		watch: {
+			date(newVal) {
+				// this.cale.setDate(newVal)
+				this.init(newVal)
+			},
+			startDate(val){
+				this.cale.resetSatrtDate(val)
+			},
+			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: calc(var(--window-bottom));
+		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

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

@@ -0,0 +1,88 @@
+{
+  "id": "uni-calendar",
+  "displayName": "uni-calendar 日历",
+  "version": "1.4.2",
+  "description": "日历组件",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "日历",
+    "",
+    "打卡",
+    "日历选择"
+],
+  "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"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

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

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

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

@@ -0,0 +1,12 @@
+## 1.2.1(2021-07-30)
+- 优化 vue3下事件警告的问题
+## 1.2.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.1.8(2021-07-01)
+- 优化 图文卡片无图片加载时,提供占位图标
+- 新增 header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持)
+- 修复 thumbnail 不存在仍然占位的 bug
+## 1.1.7(2021-05-12)
+- 新增 组件示例地址
+## 1.1.6(2021-02-04)
+- 调整为uni_modules目录规范

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

@@ -0,0 +1,431 @@
+<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" @click.stop="onClick" class="uni-card__head-padding">
+			<view class="uni-card__header uni-border-bottom">
+				<slot name="header">
+					<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>
+				</slot>
+			</view>
+		</view>
+		<!-- 标题 -->
+		<view v-if="mode === 'title'" @click.stop="onClick" class="uni-card__head-padding">
+			<view class="uni-card__title uni-border-bottom">
+				<slot name="header">
+					<view class="uni-card__title-box">
+						<view v-if="thumbnail" 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>
+				</slot>
+			</view>
+		</view>
+		<!-- 图文 -->
+		<view v-if="mode === 'style'" class="uni-card__thumbnailimage" @click.stop="onClick">
+			<view class="uni-card__thumbnailimage-box">
+				<image v-if="thumbnail" class="uni-card__thumbnailimage-image" :src="thumbnail" mode="aspectFill" />
+				<uni-icons v-if="!thumbnail" type="image" size="30" color="#999" />
+			</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',
+		emits:['click'],
+		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;
+		/* #ifndef APP-NVUE */
+		// display: flex;
+		/* #endif */
+		flex-direction: column;
+		justify-content: center;
+		height: 150px;
+		background-color: #F1F1F1;
+		overflow: hidden;
+	}
+
+	.uni-card__thumbnailimage-box {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex: 1;
+		height: 150px;
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		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;
+		padding-right: 10px;
+	}
+
+	.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;
+		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 */
+	}
+
+	.uni-card__head-padding {
+		// mar: 12px;
+	}
+</style>

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

@@ -0,0 +1,89 @@
+{
+  "id": "uni-card",
+  "displayName": "uni-card 卡片",
+  "version": "1.2.1",
+  "description": "Card 组件,提供常见的卡片样式。",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "card",
+    "",
+    "卡片"
+],
+  "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"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

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

@@ -0,0 +1,104 @@
+
+
+## Card 卡片
+> **组件名:uni-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
+
+|插槽称名	|说明				|
+|:-:		|:-:				|
+|header	|卡片头部插槽( 图文卡片 mode="style" 时,不支持)|
+|footer	|卡片底部插槽 |
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/card/card](https://hellouniapp.dcloud.net.cn/pages/extUI/card/card)

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

@@ -0,0 +1,27 @@
+## 1.3.3(2021-08-17)
+- 优化 show-arrow 属性默认为true
+## 1.3.2(2021-08-17)
+- 新增 show-arrow 属性,控制是否显示右侧箭头
+## 1.3.1(2021-07-30)
+- 优化 vue3下小程序事件警告的问题
+## 1.3.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.2.2(2021-07-21)
+- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug
+## 1.2.1(2021-07-21)
+- 优化 组件示例
+## 1.2.0(2021-07-21)
+- 新增 组件折叠动画
+- 新增 value\v-model 属性 ,动态修改面板折叠状态
+- 新增 title 插槽 ,可定义面板标题
+- 新增 border 属性 ,显示隐藏面板内容分隔线
+- 新增 title-border 属性 ,显示隐藏面板标题分隔线
+- 修复 resize 方法失效的Bug
+- 修复 change 事件返回参数不正确的Bug
+- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法
+## 1.1.7(2021-05-12)
+- 新增 组件示例地址
+## 1.1.6(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+## 1.1.5(2021-02-05)
+- 调整为uni_modules目录规范

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

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

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

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

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

@@ -0,0 +1,88 @@
+{
+  "id": "uni-collapse",
+  "displayName": "uni-collapse 折叠面板",
+  "version": "1.3.3",
+  "description": "Collapse 组件,可以折叠 / 展开的内容区域。",
+  "keywords": [
+    "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": [
+      "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"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

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

@@ -0,0 +1,276 @@
+
+
+## Collapse 折叠面板
+> **组件名:uni-collapse**
+> 代码块: `uCollapse`
+> 关联组件:`uni-collapse-item`、`uni-icons`。
+
+
+折叠面板用来折叠/显示过长的内容或者是列表。通常是在多内容分类项使用,折叠不重要的内容,显示重要内容。点击可以展开折叠部分。
+
+> **注意事项**
+> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
+> - 组件需要依赖 `sass` 插件 ,请自行手动安装
+> - `App` 端默认关闭组件动画 ,因为 `height` 动画开销比较大,会导致页面卡顿,请酌情使用动画
+> - 如在使用组件过程从发现卡顿严重,请尝试停用组件动画,问题原因如上
+> - 在小程序端组件内容发生变化,需要手动调用 resize() 方法,手动更新几点信息,避免出现内容错位
+> - 如需自定义组件默认边框颜色等,请使用插槽自定义内容并合理使用 `border ` 和 `title-border` 属性
+> - 折叠面板仅支持嵌套使用,请勿单独使用
+> - 组件支持 nvue ,需要在 `manifest.json > app-plus` 节点下配置 `"nvueStyleCompiler" : "uni-app"` 
+> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
+
+
+### 安装方式
+
+本组件符合[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)
+
+
+### 基本用法
+
+使用 `title` 属性指定面板显示内容 
+
+使用 `open` 属性默认打开当前面板
+
+使用 `disabled` 属性禁用面板
+
+
+```html
+<uni-collapse>
+	<uni-collapse-item title="默认开启" :open="true">
+		<text>折叠内容</text>
+	</uni-collapse-item>
+	<uni-collapse-item title="折叠内容">
+			<text>折叠内容</text>
+	</uni-collapse-item>
+	<uni-collapse-item title="禁用状态" disabled>
+		<text>折叠内容</text>
+	</uni-collapse-item>
+</uni-collapse>
+```
+
+### 手风琴效果
+
+使用 `accordion` 属性,可以仅打开一个面板并关闭其他已经打开的面板,效果类似手风琴
+
+设置 `accordion` 属性时,`open` 属性则生效在最后一个组件
+
+```html
+<uni-collapse accordion>
+	<uni-collapse-item title="手风琴效果">
+		<text>折叠内容</text>
+	</uni-collapse-item>
+	<uni-collapse-item title="手风琴效果">
+			<text>折叠内容</text>
+	</uni-collapse-item>
+	<uni-collapse-item title="禁用状态" disabled>
+		<text>折叠内容</text>
+	</uni-collapse-item>
+</uni-collapse>
+```
+
+### 动态设置折叠面板打开状态
+
+使用 `v-model` 属性,动态设置面板的显示状态
+
+使用 `name` 属性设置每个面板的唯一标识,如不设置使用默认索引,从字符串 `"0"` 开始记数
+
+**注意**
+
+- 如果 `accordion` 属性为 `true` 则 `v-model` 类型为 `String`
+- 如果 `accordion` 属性为 `false` 则 `v-model` 类型为 `Array`
+- 请注意 `v-model` 属性与 `open` 属性请勿一起使用 ,建议只使用 `v-model`
+
+```html
+<uni-collapse v-model="value">
+	<uni-collapse-item name="key1" title="默认开启">
+		<text>折叠内容</text>
+	</uni-collapse-item>
+	<uni-collapse-item name="key2" title="默认开启">
+			<text>折叠内容</text>
+	</uni-collapse-item>
+	<uni-collapse-item name="key3" title="默认不开启">
+			<text>折叠内容</text>
+	</uni-collapse-item>
+</uni-collapse>
+```
+
+```javascript
+export default {
+	data(){
+		return {
+			value:['key1','key2'],
+			// 如果设置了 accordion 属性,则使用 string 类型
+			// value:'key1'
+		}
+	}
+}
+```
+
+### 使用动画
+
+使用 `show-animation` 属性开启或关闭面板折叠动画,默认动画开启
+
+**注意**
+
+- `App` 端默认关闭组件动画 ,因为 height 动画开销比较大,会导致页面卡顿,请酌情使用动画,如出现明显卡顿,尝试关闭动画
+
+
+```html
+<uni-collapse>
+	<uni-collapse-item :show-animation="true" title="开启动画">
+		<text>折叠内容</text>
+	</uni-collapse-item>
+	<uni-collapse-item :show-animation="true"  title="开启动画">
+			<text>折叠内容</text>
+	</uni-collapse-item>
+	<uni-collapse-item :show-animation="false"  title="不开启动画">
+			<text>折叠内容</text>
+	</uni-collapse-item>
+</uni-collapse>
+```
+
+### 配置图片
+
+使用 `thumb` 配置图片地址, 可在面板左侧显示一个图片
+
+如需显示更多内容,如图标等,请见下方自定义插槽的说明
+
+```html
+<uni-collapse>
+	<uni-collapse-item title="标题文字"
+		thumb="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png">
+		<view class="content">
+			<text class="text">折叠内容主体,可自定义内容及样式</text>
+		</view>
+	</uni-collapse-item>
+</uni-collapse>
+```
+
+### 自定义插槽
+
+如果需要自定义面板显示,可以使用 `title` 插槽达成完全自定义。下面是一个使用 `uni-list` 的列表示例,需要引入 `uni-list` 组件
+
+```html
+<uni-collapse>
+	<!-- 因为list默认带一条分隔线,所以使用 titleBorder="none" 取消面板的分隔线 -->
+	<uni-collapse-item title-border="none" :border="false">
+		<template v-slot:title>
+			<uni-list>
+				<uni-list-item title="标题使用自定义标题插槽" :show-extra-icon="true" :extra-icon="extraIcon">
+				</uni-list-item>
+			</uni-list>
+		</template>
+		<view class="content">
+			<text class="text">折叠内容主体,可自定义内容及样式</text>
+		</view>
+	</uni-collapse-item>
+</uni-collapse>
+```
+
+**注意**
+
+- 在折叠面板组件中使用list时,在 App-Nvue 下请勿单独使用 uni-list-item,会导致组件无法正常显示,其他平台不做限制
+- 在默认插槽里使用 uni-list 组件与上方示例一样,直接写在默认插槽里即可
+
+## API
+
+### Collapse Props
+
+|属性名|类型|默认值|说明|
+|:-:|:-:|:-:|:-:|
+|value/v-model|String/Array|-|当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array)|
+|accordion|Boolean|false|是否开启手风琴效果	|
+
+### Collapse Event
+
+|事件称名|说明|返回值|
+|:-:|:-:|:-:|
+|@change|切换面板时触发	|切换面板时触发,如果是手风琴模式,返回类型为string,否则为array|
+
+### Collapse Methods
+
+|方法名称|说明|
+|:-:|:-:|
+|resize	|更新当前列表高度|
+
+> **提示**
+> - resize 方法解决动态添加数据,带动画的折叠面板高度不更新的问题
+> - 需要在数据渲染完毕之后使用 `resize` 方法。推荐在 `this.$nextTick()` 中使用
+> - 当前只有小程序端需要调用此方法,H5\App 端已经做了处理,不需要手动更新高度
+> ```html
+> 	<view>
+> 		<uni-collapse ref="collapse" v-model="value">
+> 			<uni-collapse-item title="默认开启" >
+> 				<view class="content">
+> 					<text class="text">{{content}}</text>
+> 				</view>
+> 			</uni-collapse-item>
+> 			<uni-collapse-item title="折叠内容">
+> 				<view class="content">
+> 					<text class="text">折叠内容主体,这是一段比较长内容。默认折叠主要内容,只显示当前项标题。点击标题展开,才能看到这段文字。再次点击标题,折叠内容。</text>
+> 				</view>
+> 			</uni-collapse-item>
+> 		</uni-collapse>
+> 		<button class="button" type="primary" @click="add">动态修改内容</button>
+> 	</view>
+> ```
+> ```javascript
+> export default {
+> 	data() {
+> 		return {
+> 			value:['0'],
+> 			content: '折叠内容主体,可自定义内容及样式,点击按钮修改内容使高度发生变化。',
+> 		}
+> 	},
+> 	methods: {
+> 		add() {
+> 			if (this.content.length > 35) {
+> 				this.content = '折叠内容主体,可自定义内容及样式,点击按钮修改内容使高度发生变化。'
+> 			} else {
+> 				this.content = '折叠内容主体,这是一段比较长内容。通过点击按钮修改后内容后,使组件高度发生变化,在次点击按钮恢复之前的内容和高度。'
+> 			}
+> 			// TODO 小程序中不支持自动更新 ,需要手动resize 更新组件高度
+> 			// #ifdef MP
+> 			this.$nextTick(() => {
+> 				this.$refs.collapse.resize()
+> 			})
+> 			// #endif
+> 		}
+> 	}
+> }
+> ```
+
+
+### CollapseItem Props
+
+|属性名|类型|默认值|说明|
+|:-:|:-:|:-:|:-:|
+|title|String|-|标题文字|
+|thumb|String|-|标题左侧缩略图|
+|disabled|Boolean|false|是否禁用|
+|open|Boolean|false|是否展开面板|
+|show-animation|Boolean|false|开启动画|
+|border|Boolean|true|折叠面板内容分隔线|
+|title-border|String|auto|折叠面板标题分隔线可选值见下方 **TitleBorder Params**|
+|show-arrow|Boolean|true|是否显示右侧箭头|
+
+#### TitleBorder Params
+
+|参数名|说明|
+|:-:|:-:|
+|auto|分隔线自动显示|
+|none|不显示分隔线|
+|show|一直显示分隔线|
+
+### Collapse Slots
+
+|插槽名|说明|
+|:-:| :-:|
+|default|默认插槽|
+|title|面板标题插槽,如使用此插槽禁用样式效果将失效|
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/collapse/collapse](https://hellouniapp.dcloud.net.cn/pages/extUI/collapse/collapse)

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

@@ -0,0 +1,10 @@
+## 0.1.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 0.0.6(2021-05-12)
+- 新增 组件示例地址
+## 0.0.5(2021-04-21)
+- 优化 添加依赖 uni-icons, 导入后自动下载依赖
+## 0.0.4(2021-02-05)
+- 优化 组件引用关系,通过uni_modules引用组件
+## 0.0.3(2021-02-04)
+- 调整为uni_modules目录规范

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

@@ -0,0 +1,239 @@
+<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',
+		emits:['input','update:modelValue'],
+		props: {
+			label: {
+				type: String,
+				default: ''
+			},
+			labelWidth: {
+				type: String,
+				default: 'auto'
+			},
+			placeholder: {
+				type: String,
+				default: ''
+			},
+			candidates: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			emptyTips: {
+				type: String,
+				default: '无匹配项'
+			},
+			// #ifndef VUE3
+			value: {
+				type: [String, Number],
+				default: ''
+			},
+			// #endif
+			// #ifdef VUE3
+			modelValue: {
+				type: [String, Number],
+				default: ''
+			},
+			// #endif
+		},
+		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: {
+			// #ifndef VUE3
+			value: {
+				handler(newVal) {
+					this.inputVal = newVal
+				},
+				immediate: true
+			},
+			// #endif
+			// #ifdef VUE3
+			modelValue: {
+				handler(newVal) {
+					this.inputVal = newVal
+				},
+				immediate: true
+			},
+			// #endif
+		},
+		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)
+				this.$emit('update:modelValue', this.inputVal)
+			},
+			onInput() {
+				setTimeout(() => {
+					this.$emit('input', this.inputVal)
+					this.$emit('update:modelValue', 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 {
+		/* #ifndef APP-NVUE */
+		box-sizing: border-box;
+		/* #endif */
+		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 {
+		/* #ifndef APP-NVUE */
+		max-height: 200px;
+		box-sizing: border-box;
+		/* #endif */
+	}
+
+	.uni-combox__selector::before {
+		/* #ifndef APP-NVUE */
+		content: '';
+		/* #endif */
+		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 {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		cursor: pointer;
+		/* #endif */
+		line-height: 36px;
+		font-size: 14px;
+		text-align: center;
+		border-bottom: solid 1px #DDDDDD;
+		margin: 0px 10px;
+	}
+
+	.uni-combox__selector-empty:last-child,
+	.uni-combox__selector-item:last-child {
+		/* #ifndef APP-NVUE */
+		border-bottom: none;
+		/* #endif */
+	}
+</style>

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

@@ -0,0 +1,89 @@
+{
+  "id": "uni-combox",
+  "displayName": "uni-combox 组合框",
+  "version": "0.1.0",
+  "description": "可以选择也可以输入的表单项 ",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "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": [
+			"uni-icons"
+		],
+    "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"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

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

@@ -0,0 +1,52 @@
+
+
+## Combox 组合框
+> **组件名:uni-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值|
+
+
+
+
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/combox/combox](https://hellouniapp.dcloud.net.cn/pages/extUI/combox/combox)

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

@@ -0,0 +1,14 @@
+## 1.1.2(2021-08-24)
+- 新增 支持国际化
+## 1.1.1(2021-07-30)
+- 优化 vue3下小程序事件警告的问题
+## 1.1.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.0.5(2021-06-18)
+- 修复 uni-countdown 重复赋值跳两秒的 bug
+## 1.0.4(2021-05-12)
+- 新增 组件示例地址
+## 1.0.3(2021-05-08)
+- 修复 uni-countdown 不能控制倒计时的 bug
+## 1.0.2(2021-02-04)
+- 调整为uni_modules目录规范

+ 6 - 0
uni_modules/uni-countdown/components/uni-countdown/i18n/en.json

@@ -0,0 +1,6 @@
+{
+	"uni-countdown.day": "day",
+	"uni-countdown.h": "h",
+	"uni-countdown.m": "m",
+	"uni-countdown.s": "s"
+}

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

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

+ 6 - 0
uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hans.json

@@ -0,0 +1,6 @@
+{
+	"uni-countdown.day": "天",
+	"uni-countdown.h": "时",
+	"uni-countdown.m": "分",
+	"uni-countdown.s": "秒"
+}

+ 6 - 0
uni_modules/uni-countdown/components/uni-countdown/i18n/zh-Hant.json

@@ -0,0 +1,6 @@
+{
+	"uni-countdown.day": "天",
+	"uni-countdown.h": "時",
+	"uni-countdown.m": "分",
+	"uni-countdown.s": "秒"
+}

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

@@ -0,0 +1,260 @@
+<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">{{dayText}}</text>
+		<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }"
+			class="uni-countdown__number">{{ h }}</text>
+		<text :style="{ color: splitorColor }" class="uni-countdown__splitor">{{ showColon ? ':' : hourText }}</text>
+		<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }"
+			class="uni-countdown__number">{{ i }}</text>
+		<text :style="{ color: splitorColor }" class="uni-countdown__splitor">{{ showColon ? ':' : minuteText }}</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">{{secondText}}</text>
+	</view>
+</template>
+<script>
+	import {
+	initVueI18n
+	} from '@dcloudio/uni-i18n'
+	import messages from './i18n/index.js'
+	const {	t	} = initVueI18n(messages)
+	/**
+	 * 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',
+		emits:['timeup'],
+		props: {
+			showDay: {
+				type: Boolean,
+				default: true
+			},
+			showColon: {
+				type: Boolean,
+				default: true
+			},
+			start: {
+				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
+			}
+		},
+		computed: {
+			dayText() {
+				return t("uni-countdown.day")
+			},
+			hourText(val) {
+				return t("uni-countdown.h")
+			},
+			minuteText(val) {
+				return t("uni-countdown.m")
+			},
+			secondText(val) {
+				return t("uni-countdown.s")
+			},
+		},
+		watch: {
+			day(val) {
+				this.changeFlag()
+			},
+			hour(val) {
+				this.changeFlag()
+			},
+			minute(val) {
+				this.changeFlag()
+			},
+			second(val) {
+				this.changeFlag()
+			},
+			start: {
+				immediate: true,
+				handler(newVal, oldVal) {
+					if (newVal) {
+						this.startData();
+					} else {
+						if (!oldVal) return
+						clearInterval(this.timer)
+					}
+				}
+
+			}
+		},
+		created: function(e) {
+			this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
+			this.countDown()
+		},
+		// #ifndef VUE3
+		destroyed() {
+			clearInterval(this.timer)
+		},
+		// #endif
+		// #ifdef VUE3
+		unmounted() {
+			clearInterval(this.timer)
+		},
+		// #endif
+		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
+				}
+				clearInterval(this.timer)
+				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>

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

@@ -0,0 +1,86 @@
+{
+  "id": "uni-countdown",
+  "displayName": "uni-countdown 倒计时",
+  "version": "1.1.2",
+  "description": "CountDown 倒计时组件",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "countdown",
+    "倒计时"
+],
+  "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"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

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

@@ -0,0 +1,57 @@
+
+
+## CountDown 倒计时
+> **组件名:uni-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	|是否以冒号为分隔符	|
+|start			|Boolean|true	|是否初始化组件后就开始倒计时|
+
+### Countdown Events
+
+|事件称名	|说明							|返回值	|
+|:-:		|:-:							|:-:		|
+|@timeup|倒计时时间到触发事件	|-			|
+
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/countdown/countdown](https://hellouniapp.dcloud.net.cn/pages/extUI/countdown/countdown)

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

@@ -0,0 +1,36 @@
+## 0.2.5(2021-08-23)
+- 修复 在uni-forms中 modelValue 中不存在当前字段,当前字段必填写也不参与校验的问题
+## 0.2.4(2021-08-17)
+- 修复 单选 list 模式下 ,icon 为 left 时,选中图标不显示的问题
+## 0.2.3(2021-08-11)
+- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题
+## 0.2.2(2021-07-30)
+- 优化 在uni-forms组件,与label不对齐的问题
+## 0.2.1(2021-07-27)
+- 修复 单选默认值为0不能选中的Bug
+## 0.2.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 0.1.11(2021-07-06)
+- 优化 删除无用日志
+## 0.1.10(2021-07-05)
+- 修复 由 0.1.9 引起的非 nvue 端图标不显示的问题
+## 0.1.9(2021-07-05)
+- 修复 nvue 黑框样式问题
+## 0.1.8(2021-06-28)
+- 修复 selectedTextColor 属性不生效的Bug
+## 0.1.7(2021-06-02)
+- 新增 map 属性,可以方便映射text/value属性
+## 0.1.6(2021-05-26)
+- 修复 不关联服务空间的情况下组件报错的Bug
+## 0.1.5(2021-05-12)
+- 新增 组件示例地址
+## 0.1.4(2021-04-09)
+- 修复 nvue 下无法选中的问题
+## 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)
+- “暂无数据”显示居中

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

@@ -0,0 +1,823 @@
+<template>
+	<view class="uni-data-checklist" :style="{'margin-top':isTop+'px'}">
+		<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">
+				<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[map.value]+''" :checked="item.selected" />
+					<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="checkbox__inner"  :style="item.styleIcon">
+						<view class="checkbox__inner-icon"></view>
+					</view>
+					<view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}">
+						<text class="checklist-text" :style="item.styleIconText">{{item[map.text]}}</text>
+						<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[map.value]+''" :checked="item.selected" />
+					<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="radio__inner"
+					 :style="item.styleBackgroud">
+						<view class="radio__inner-icon" :style="item.styleIcon"></view>
+					</view>
+					<view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}">
+						<text class="checklist-text" :style="item.styleIconText">{{item[map.text]}}</text>
+						<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 选中文本颜色,如不填写则自动显示
+	 * @property {Object} map 字段映射, 默认 map={text:'text',value:'value'}
+	 * @value left 左侧显示
+	 * @value right 右侧显示
+	 * @event {Function} change  选中发生变化触发
+	 */
+
+	// import clientdb from './clientdb.js'
+	export default {
+		name: 'uniDataChecklist',
+		// mixins: [clientdb],
+		mixins: [uniCloud.mixinDatacom || {}],
+		// model: {
+		// 	prop: 'modelValue',
+		// 	event: 'update:modelValue'
+		// },
+		emits:['input','update:modelValue','change'],
+		props: {
+			mode: {
+				type: String,
+				default: 'default'
+			},
+
+			multiple: {
+				type: Boolean,
+				default: false
+			},
+			value: {
+				type: [Array, String, Number],
+				default () {
+					return ''
+				}
+			},
+			// TODO vue3
+			modelValue: {
+				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: ''
+			},
+			selectedTextColor: {
+				type: String,
+				default: ''
+			},
+			emptyText:{
+				type: String,
+				default: '暂无数据'
+			},
+			disabled:{
+				type: Boolean,
+				default: false
+			},
+			map:{
+				type: Object,
+				default(){
+					return {
+						text:'text',
+						value:'value'
+					}
+				}
+			}
+		},
+		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)
+				// fix by mehaotian is_reset 在 uni-forms 中定义
+				if(!this.is_reset){
+					this.is_reset = false
+					this.formItem && this.formItem.setValue(newVal)
+				}
+			},
+			modelValue(newVal) {
+				this.dataList = this.getDataList(newVal);
+				if(!this.is_reset){
+					this.is_reset = false
+					this.formItem && this.formItem.setValue(newVal)
+				}
+			}
+		},
+		data() {
+			return {
+				dataList: [],
+				range: [],
+				contentText: {
+					contentdown: '查看更多',
+					contentrefresh: '加载中',
+					contentnomore: '没有更多'
+				},
+				isLocal:true,
+				styles: {
+					selectedColor: '#007aff',
+					selectedTextColor: '#333',
+				},
+				isTop:0
+			};
+		},
+		computed:{
+			dataValue(){
+				if(this.value === '')return this.modelValue
+				if(this.modelValue === '') return this.value
+				return this.value
+			}
+		},
+		created() {
+			this.form = this.getForm('uniForms')
+			this.formItem = this.getForm('uniFormsItem')
+			// this.formItem && this.formItem.setValue(this.value)
+
+			if (this.formItem) {
+				this.isTop = 6
+				if (this.formItem.name) {
+					// 如果存在name添加默认值,否则formData 中不存在这个字段不校验
+					if(!this.is_reset){
+						this.is_reset = false
+						this.formItem.setValue(this.dataValue)
+					}
+					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[this.map.value] + '')) {
+							detail.value.push(item[this.map.value])
+							detail.data.push(item)
+						}
+					})
+				} else {
+					const range = this.range.find(item => (item[this.map.value] + '') === values)
+					if (range) {
+						detail = {
+							value: range[this.map.value],
+							data: range
+						}
+					}
+				}
+				this.formItem && this.formItem.setValue(detail.value)
+				// TODO 兼容 vue2
+				this.$emit('input', detail.value);
+				// // TOTO 兼容 vue3
+				this.$emit('update:modelValue', 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[this.map.value])
+							item.selected = have !== undefined
+						} else {
+							item.selected = false
+						}
+					} else {
+						item.selected = value === item[this.map.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[this.map.value] === item[this.map.value])
+							if (have !== undefined) {
+								item.disabled = true
+							}
+						}
+
+						if (selectList.length >= max && max !== '') {
+							let have = selectList.find(val => val[this.map.value] === item[this.map.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.dataValue
+				let selectedArr = []
+				range.forEach((item) => {
+					if (item.selected) {
+						selectedArr.push(item[this.map.value])
+					}
+				})
+				return this.dataValue.length > 0 ? this.dataValue : selectedArr
+			},
+
+			/**
+			 * 设置背景样式
+			 */
+			setStyleBackgroud(item) {
+				let styles = {}
+				let selectedColor = this.selectedColor?this.selectedColor:'#007aff'
+				if (this.mode !== 'list') {
+					styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
+				}
+				if (this.mode === 'tag') {
+					styles['background-color'] = item.selected? selectedColor:'#f5f5f5'
+				}
+				let classles = ''
+				for (let i in styles) {
+					classles += `${i}:${styles[i]};`
+				}
+				return classles
+			},
+			setStyleIcon(item) {
+				let styles = {}
+				let classles = ''
+				let selectedColor = this.selectedColor?this.selectedColor:'#007aff'
+				styles['background-color'] = item.selected?selectedColor:'#fff'
+				styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
+
+				if(!item.selected && item.disabled){
+					styles['background-color'] = '#F2F6FC'
+					styles['border-color'] = item.selected?selectedColor:'#DCDFE6'
+				}
+
+				for (let i in styles) {
+					classles += `${i}:${styles[i]};`
+				}
+				return classles
+			},
+			setStyleIconText(item) {
+				let styles = {}
+				let classles = ''
+				let selectedColor = this.selectedColor?this.selectedColor:'#007aff'
+				if (this.mode === 'tag') {
+					styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#333'
+				} else {
+					styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor: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 (this.mode === 'list') {
+					styles['border-color'] = item.selected?this.styles.selectedColor:'#DCDFE6'
+				}
+				for (let i in styles) {
+					classles += `${i}:${styles[i]};`
+				}
+
+				return classles
+			}
+		}
+	}
+</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;
+					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;
+					}
+
+					.checkobx__list {
+						border-right-width: 1px;
+						border-right-color: #007aff;
+						border-right-style: solid;
+						border-bottom-width:1px;
+						border-bottom-color: #007aff;
+						border-bottom-style: solid;
+						height: 12px;
+						width: 6px;
+						left: -5px;
+						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-right-width: 1px;
+						border-right-color: #fff;
+						border-right-style: solid;
+						border-bottom-width:1px ;
+						border-bottom-color: #fff;
+						border-bottom-style: solid;
+						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;
+							}
+							.radio__inner {
+								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);
+							}
+						}
+						.radio__inner {
+							.radio__inner-icon {
+								opacity: 1;
+							}
+						}
+						.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>

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

@@ -0,0 +1,87 @@
+{
+  "id": "uni-data-checkbox",
+  "displayName": "uni-data-checkbox 数据选择器",
+  "version": "0.2.5",
+  "description": "通过数据驱动的单选框和复选框",
+  "keywords": [
+    "uni-ui",
+    "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"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

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

@@ -0,0 +1,299 @@
+
+
+## DataCheckbox 数据驱动的单选复选框
+> **组件名:uni-data-checkbox**
+> 代码块: `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					|-											|暂无数据		|没有数据时显示的文字 ,本地数据无效|
+|map 				|Object					|-											|{text:'text',value:'value'}		|字段映射,将text/value映射到数据中的其他字段|
+
+#### Localdata Options
+
+`localdata` 属性的格式为数组,数组内每项是对象,需要严格遵循如下格式
+
+|属性名		| 说明				|
+|:-:			| :-:				|
+|text			|显示文本			|
+|value		|选中后的值		|
+|disable	|是否禁用			|
+
+#### Mode Options 
+
+|属性名		| 说明							|
+|:-:			| :-:							|
+|default	|默认值,横向显示		|
+|list			|列表							|
+|button		|按钮							|
+|tag			|标签							|
+
+
+### DataCheckbox Events
+
+| 事件名	| 事件说明								| 返回参数|
+| :-:		| :-:									| :-:			|
+| @change| 选中状态改变时触发事件	| -				|
+
+
+
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/data-checkbox/data-checkbox](https://hellouniapp.dcloud.net.cn/pages/extUI/data-checkbox/data-checkbox)

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

@@ -0,0 +1,25 @@
+## 0.4.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 0.3.5(2021-06-04)
+- 修复 无法加载云端数据的问题
+## 0.3.4(2021-05-28)
+- 修复 v-model无效问题
+- 修复 loaddata 为空数据组时加载时间过长问题
+- 修复 上个版本引出的本地数据无法选择带有children的2级节点
+## 0.3.3(2021-05-12)
+- 新增 组件示例地址
+## 0.3.2(2021-04-22)
+- 修复 非树形数据有 where 属性查询报错的问题
+## 0.3.1(2021-04-15)
+- 修复 本地数据概率无法回显时问题
+## 0.3.0(2021-04-07)
+- 新增 支持云端非树形表结构数据
+- 修复 根节点 parent_field 字段等于null时选择界面错乱问题
+## 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目录规范

+ 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

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

@@ -0,0 +1,472 @@
+<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="dataValue" :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"
+
+	/**
+	 * DataPicker 级联选择
+	 * @description 支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=3796
+	 * @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',
+		emits: ['popupopened', 'popupclosed', 'nodeclick', 'input', 'change','update:modelValue'],
+		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.dataValue)
+					return
+				}
+
+				if (this.isLocaldata) {
+					this.loadData()
+					this.inputSelected = this.selected.slice(0)
+				} else if (!this.parentField && !this.selfField && this.dataValue) {
+					this.getNodeData(() => {
+						this.inputSelected = this.selected.slice(0)
+					})
+				} else if (this.dataValue.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
+				}
+
+				const item = selected[selected.length - 1]
+
+				if (this.formItem) {
+					this.formItem.setValue(item.value)
+				}
+
+				this.$emit('input', item.value)
+				this.$emit('update:modelValue', 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>

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

@@ -0,0 +1,545 @@
+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 []
+      }
+    },
+	modelValue: {
+		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.collection.length
+    },
+    postField() {
+			let fields = [this.field];
+			if (this.parentField) {
+				fields.push(`${this.parentField} as parent_value`);
+			}
+      return fields.join(',');
+    },
+	dataValue(){
+		let isarr = Array.isArray(this.value) && this.value.length === 0
+		let isstr = typeof this.value === 'string' && !this.value
+		let isnum = typeof this.value === 'number' && !this.value
+		
+		if(isarr || isstr || isnum){
+			return this.modelValue
+		}
+		
+		return this.value
+	}
+  },
+  created() {
+    this.$watch(() => {
+      var al = [];
+      ['pageCurrent',
+        'pageSize',
+        'value',
+        'modelValue',
+        '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
+    },
+		getNodeData(callback) {
+		  if (this.loading) {
+		    return
+		  }
+		  this.loading = true
+		  this.getCommand({
+		    field: this.postField,
+				where: this._pathWhere()
+		  }).then((res) => {
+		    this.loading = false
+		    this.selected = res.result.data
+		    callback && callback()
+		  }).catch((err) => {
+		    this.loading = false
+		    this.errorMessage = err
+		  })
+		},
+    getTreePath(callback) {
+      if (this.loading) {
+        return
+      }
+      this.loading = true
+
+      this.getCommand({
+        field: this.postField,
+        getTreePath: {
+          startWith: `${this.selfField}=='${this.dataValue}'`
+        }
+      }).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.dataValue.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.dataValue}'`
+      }).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
+      })
+    },
+    _pathWhere() {
+      let result = []
+      let where_field = this._getParentNameByField();
+      if (where_field) {
+        result.push(`${where_field} == '${this.dataValue}'`)
+      }
+
+      if (this.where) {
+        return `(${this.where}) && (${result.join(' || ')})`
+      }
+
+      return result.join(' || ')
+    },
+    _postWhere() {
+      let result = []
+      let selected = this.selected
+      let parentField = this.parentField
+      if (parentField) {
+        result.push(`${parentField} == null || ${parentField} == ""`)
+      }
+      if (selected.length) {
+        for (var i = 0; i < selected.length - 1; i++) {
+          result.push(`${parentField} == '${selected[i].value}'`)
+        }
+      }
+
+      let where = []
+      if (this.where) {
+        where.push(`(${this.where})`)
+      }
+      if (result.length) {
+        where.push(`(${result.join(' || ')})`)
+      }
+
+      return where.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(' || ')
+    },
+    _getParentNameByField() {
+      const fields = this.field.split(',');
+      let where_field = null;
+      for (let i = 0; i < fields.length; i++) {
+        const items = fields[i].split('as');
+        if (items.length < 2) {
+          continue;
+        }
+        if (items[1].trim() === 'value') {
+          where_field = items[0].trim();
+          break;
+        }
+      }
+      return where_field
+    },
+    _isTreeView() {
+      return (this.parentField && this.selfField)
+    },
+    _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 !== undefined) {
+          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.dataValue
+      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)
+    }
+  }
+}

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

@@ -0,0 +1,300 @@
+<template>
+  <view class="uni-data-pickerview">
+    <scroll-view class="selected-area" scroll-x="true" scroll-y="false" :show-scrollbar="false">
+      <view class="selected-list">
+	    <template v-for="(item,index) in selected">
+			<view class="selected-item" :class="{'selected-item-active':index==selectedIndex}"
+				:key="index" v-if="item.text" @click="handleSelect(index)">
+				<text class="">{{item.text}}</text>
+			</view>
+	    </template>
+      </view>
+    </scroll-view>
+    <view class="tab-c">
+		<template v-for="(child, i) in dataList">
+			<scroll-view class="list"  :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>
+		</template>
+      
+      <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"
+
+  /**
+   * DataPickerview
+   * @description uni-data-pickerview
+   * @tutorial https://ext.dcloud.net.cn/plugin?id=3796
+   * @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',
+	emits:['nodeclick','change','datachange','update:modelValue'],
+    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.dataValue.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._isTreeView() && !hasNodes) {
+          this.onSelectedChange(node, true)
+          return
+        }
+
+        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>

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

@@ -0,0 +1,90 @@
+{
+  "id": "uni-data-picker",
+  "displayName": "uni-data-picker 数据驱动的picker选择器",
+  "version": "0.4.0",
+  "description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "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"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

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

@@ -0,0 +1,270 @@
+## DataPicker 级联选择
+> **组件名:uni-data-picker**
+> 代码块: `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				|预加载数据|
+|readonly 						|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>
+```
+
+```js
+<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>
+```
+
+```js
+<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>
+```
+
+```js
+<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>
+
+```
+
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/data-picker/data-picker](https://hellouniapp.dcloud.net.cn/pages/extUI/data-picker/data-picker)

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

@@ -0,0 +1,7 @@
+## 0.0.5(2021-07-08)
+- 调整 默认时间不再是当前时间,而是显示'-'字符
+## 0.0.4(2021-05-12)
+- 新增 组件示例地址
+## 0.0.3(2021-02-04)
+- 调整为uni_modules目录规范
+- 修复 iOS 平台日期格式化出错的问题

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

@@ -0,0 +1,200 @@
+// 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':
+			{
+				// 2020-12-12T12:12:12.000Z、2020-12-12T12:12:12.000
+				if (time.indexOf('T') > -1) {
+					return new Date(time)
+				}
+				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 === '-') {
+		return time
+	}
+	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)
+}

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

@@ -0,0 +1,88 @@
+<template>
+	<text>{{dateShow}}</text>
+</template>
+
+<script>
+	import {friendlyDate} from './date-format.js'
+	/**
+	 * 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 输出日期字符串时的格式
+	 */
+	export default {
+		name: 'uniDateformat',
+		props: {
+			date: {
+				type: [Object, String, Number],
+				default () {
+					return '-'
+				}
+			},
+			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>

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

@@ -0,0 +1,88 @@
+{
+  "id": "uni-dateformat",
+  "displayName": "uni-dateformat 日期格式化",
+  "version": "0.0.5",
+  "description": "日期格式化组件,可以将日期格式化为1分钟前、刚刚等形式",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "日期格式化",
+    "时间格式化",
+    "格式化时间",
+    ""
+],
+  "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"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

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

@@ -0,0 +1,77 @@
+
+
+### DateFormat 日期格式化
+> **组件名:uni-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				|
+
+
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/dateformat/dateformat](https://hellouniapp.dcloud.net.cn/pages/extUI/dateformat/dateformat)

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

@@ -0,0 +1,76 @@
+## 2.1.4(2021-09-10)
+- 修复 hide-second 在移动端的 bug
+- 修复 单选赋默认值时,赋值日期未高亮的 bug
+- 修复 赋默认值时,移动端未正确显示时间的 bug
+## 2.1.3(2021-09-09)
+- 新增 hide-second 属性,支持只使用时分,隐藏秒
+## 2.1.2(2021-09-03)
+- 优化 取消选中时(范围选)直接开始下一次选择, 避免多点一次
+- 优化 移动端支持清除按钮,同时支持通过 ref 调用组件的 clear 方法
+- 优化 调整字号大小,美化日历界面
+- 修复 因国际化导致的 placeholder 失效的 bug
+## 2.1.1(2021-08-24)
+- 新增 支持国际化
+- 优化 范围选择器在 pc 端过宽的问题
+## 2.1.0(2021-08-09)
+- 新增 适配 vue3
+## 2.0.19(2021-08-09)
+- 新增 支持作为 uni-forms 子组件相关功能
+- 修复 在 uni-forms 中使用时,选择时间报 NAN 错误的 bug
+## 2.0.18(2021-08-05)
+- 修复 type 属性动态赋值无效的 bug
+- 修复 ‘确认’按钮被 tabbar 遮盖 bug
+- 修复 组件未赋值时范围选左、右日历相同的 bug
+## 2.0.17(2021-08-04)
+- 修复 范围选未正确显示当前值的 bug
+- 修复 h5 平台(移动端)报错 'cale' of undefined 的 bug
+## 2.0.16(2021-07-21)
+- 新增 return-type 属性支持返回 date 日期对象
+## 2.0.15(2021-07-14)
+- 修复 单选日期类型,初始赋值后不在当前日历的 bug
+- 新增 clearIcon 属性,显示框的清空按钮可配置显示隐藏(仅 pc 有效)
+- 优化 移动端移除显示框的清空按钮,无实际用途
+## 2.0.14(2021-07-14)
+- 修复 组件赋值为空,界面未更新的 bug
+- 修复 start 和 end 不能动态赋值的 bug
+- 修复 范围选类型,用户选择后再次选择右侧日历(结束日期)显示不正确的 bug
+## 2.0.13(2021-07-08)
+- 修复 范围选择不能动态赋值的 bug
+## 2.0.12(2021-07-08)
+- 修复 范围选择的初始时间在一个月内时,造成无法选择的bug
+## 2.0.11(2021-07-08)
+- 优化 弹出层在超出视窗边缘定位不准确的问题
+## 2.0.10(2021-07-08)
+- 修复 范围起始点样式的背景色与今日样式的字体前景色融合,导致日期字体看不清的 bug
+- 优化 弹出层在超出视窗边缘被遮盖的问题
+## 2.0.9(2021-07-07)
+- 新增 maskClick 事件
+- 修复 特殊情况日历 rpx 布局错误的 bug,rpx -> px
+- 修复 范围选择时清空返回值不合理的bug,['', ''] -> []
+## 2.0.8(2021-07-07)
+- 新增 日期时间显示框支持插槽
+## 2.0.7(2021-07-01)
+- 优化 添加 uni-icons 依赖
+## 2.0.6(2021-05-22)
+- 修复 图标在小程序上不显示的 bug
+- 优化 重命名引用组件,避免潜在组件命名冲突
+## 2.0.5(2021-05-20)
+- 优化 代码目录扁平化
+## 2.0.4(2021-05-12)
+- 新增 组件示例地址
+## 2.0.3(2021-05-10)
+- 修复 ios 下不识别 '-' 日期格式的 bug
+- 优化 pc 下弹出层添加边框和阴影
+## 2.0.2(2021-05-08)
+- 修复 在 admin 中获取弹出层定位错误的bug
+## 2.0.1(2021-05-08)
+- 修复 type 属性向下兼容,默认值从 date 变更为 datetime
+## 2.0.0(2021-04-30)
+- 支持日历形式的日期+时间的范围选择
+ > 注意:此版本不向后兼容,不再支持单独时间选择(type=time)及相关的 hide-second 属性(时间选可使用内置组件 picker)
+## 1.0.6(2021-03-18)
+- 新增 hide-second 属性,时间支持仅选择时、分
+- 修复 选择跟显示的日期不一样的 bug
+- 修复 chang事件触发2次的 bug
+- 修复 分、秒 end 范围错误的 bug
+- 优化 更好的 nvue 适配

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است