Parcourir la source

删除多余文件

chenrui il y a 4 ans
Parent
commit
e4b1f8d043

+ 0 - 42
api/store.js

@@ -1,42 +0,0 @@
-import axios from '@/libs/axios.js';
-
-// 获取首页网点列表
-export const getMapStoreList = params => {
-  return axios.request({
-    url: `store/findList`,
-    method: 'post',
-	data: params
-  },true)
-};
-
-// 获取网点列表
-export const getStoreList = params => {
-  return axios.request({
-    url: `store/findSortList`,
-    method: 'post',
-	data: params
-  })
-};
-// 获取网点详情
-export const getStoreDetail = params => {
-  return axios.request({
-    url: `store/findDetail`,
-    method: 'post',
-	data: params
-  })
-};
-// 获取当前排队情况照片
-export const getWaitPhoto = params => {
-  return axios.request({
-    url: `device/image/${params.deviceNo}`,
-    method: 'get'
-  })
-};
-
-// 查看网点营业状态
-export const getStoreStatus = params => {
-  return axios.request({
-    url: `store/validateStoreAndDevice?storeId=${params.storeId}&deviceNo=${params.deviceNo}`,
-    method: 'get'
-  })
-};

+ 0 - 645
components/jyf-parser/jyf-parser.vue

@@ -1,645 +0,0 @@
-<template>
-	<view>
-		<slot v-if="!nodes.length" />
-		<!--#ifdef APP-PLUS-NVUE-->
-		<web-view id="_top" ref="web" :style="'margin-top:-2px;height:'+height+'px'" @onPostMessage="_message" />
-		<!--#endif-->
-		<!--#ifndef APP-PLUS-NVUE-->
-		<view id="_top" :style="showAm+(selectable?';user-select:text;-webkit-user-select:text':'')">
-			<!--#ifdef H5 || MP-360-->
-			<div :id="'rtf'+uid"></div>
-			<!--#endif-->
-			<!--#ifndef H5 || MP-360-->
-			<trees :nodes="nodes" :lazyLoad="lazyLoad" :loading="loadingImg" />
-			<!--#endif-->
-		</view>
-		<!--#endif-->
-	</view>
-</template>
-
-<script>
-	var search;
-	// #ifndef H5 || APP-PLUS-NVUE || MP-360
-	import trees from './libs/trees';
-	var cache = {},
-		// #ifdef MP-WEIXIN || MP-TOUTIAO
-		fs = uni.getFileSystemManager ? uni.getFileSystemManager() : null,
-		// #endif
-		Parser = require('./libs/MpHtmlParser.js');
-	var dom;
-	// 计算 cache 的 key
-	function hash(str) {
-		for (var i = str.length, val = 5381; i--;)
-			val += (val << 5) + str.charCodeAt(i);
-		return val;
-	}
-	// #endif
-	// #ifdef H5 || APP-PLUS-NVUE || MP-360
-	var {
-		windowWidth,
-		platform
-	} = uni.getSystemInfoSync(),
-		cfg = require('./libs/config.js');
-	// #endif
-	// #ifdef APP-PLUS-NVUE
-	var weexDom = weex.requireModule('dom');
-	// #endif
-	/**
-	 * Parser 富文本组件
-	 * @tutorial https://github.com/jin-yufeng/Parser
-	 * @property {String} html 富文本数据
-	 * @property {Boolean} autopause 是否在播放一个视频时自动暂停其他视频
-	 * @property {Boolean} autoscroll 是否自动给所有表格添加一个滚动层
-	 * @property {Boolean} autosetTitle 是否自动将 title 标签中的内容设置到页面标题
-	 * @property {Number} compress 压缩等级
-	 * @property {String} domain 图片、视频等链接的主域名
-	 * @property {Boolean} lazyLoad 是否开启图片懒加载
-	 * @property {String} loadingImg 图片加载完成前的占位图
-	 * @property {Boolean} selectable 是否开启长按复制
-	 * @property {Object} tagStyle 标签的默认样式
-	 * @property {Boolean} showWithAnimation 是否使用渐显动画
-	 * @property {Boolean} useAnchor 是否使用锚点
-	 * @property {Boolean} useCache 是否缓存解析结果
-	 * @event {Function} parse 解析完成事件
-	 * @event {Function} load dom 加载完成事件
-	 * @event {Function} ready 所有图片加载完毕事件
-	 * @event {Function} error 错误事件
-	 * @event {Function} imgtap 图片点击事件
-	 * @event {Function} linkpress 链接点击事件
-	 * @author JinYufeng
-	 * @version 20201029
-	 * @listens MIT
-	 */
-	export default {
-		name: 'parser',
-		data() {
-			return {
-				// #ifdef H5 || MP-360
-				uid: this._uid,
-				// #endif
-				// #ifdef APP-PLUS-NVUE
-				height: 1,
-				// #endif
-				// #ifndef APP-PLUS-NVUE
-				showAm: '',
-				// #endif
-				nodes: []
-			}
-		},
-		// #ifndef H5 || APP-PLUS-NVUE || MP-360
-		components: {
-			trees
-		},
-		// #endif
-		props: {
-			html: String,
-			autopause: {
-				type: Boolean,
-				default: true
-			},
-			autoscroll: Boolean,
-			autosetTitle: {
-				type: Boolean,
-				default: true
-			},
-			// #ifndef H5 || APP-PLUS-NVUE || MP-360
-			compress: Number,
-			loadingImg: String,
-			useCache: Boolean,
-			// #endif
-			domain: String,
-			lazyLoad: Boolean,
-			selectable: Boolean,
-			tagStyle: Object,
-			showWithAnimation: Boolean,
-			useAnchor: Boolean
-		},
-		watch: {
-			html(html) {
-				this.setContent(html);
-			}
-		},
-		created() {
-			// 图片数组
-			this.imgList = [];
-			this.imgList.each = function(f) {
-				for (var i = 0, len = this.length; i < len; i++)
-					this.setItem(i, f(this[i], i, this));
-			}
-			this.imgList.setItem = function(i, src) {
-				if (i == void 0 || !src) return;
-				// #ifndef MP-ALIPAY || APP-PLUS
-				// 去重
-				if (src.indexOf('http') == 0 && this.includes(src)) {
-					var newSrc = src.split('://')[0];
-					for (var j = newSrc.length, c; c = src[j]; j++) {
-						if (c == '/' && src[j - 1] != '/' && src[j + 1] != '/') break;
-						newSrc += Math.random() > 0.5 ? c.toUpperCase() : c;
-					}
-					newSrc += src.substr(j);
-					return this[i] = newSrc;
-				}
-				// #endif
-				this[i] = src;
-				// 暂存 data src
-				if (src.includes('data:image')) {
-					var filePath, info = src.match(/data:image\/(\S+?);(\S+?),(.+)/);
-					if (!info) return;
-					// #ifdef MP-WEIXIN || MP-TOUTIAO
-					filePath = `${wx.env.USER_DATA_PATH}/${Date.now()}.${info[1]}`;
-					fs && fs.writeFile({
-						filePath,
-						data: info[3],
-						encoding: info[2],
-						success: () => this[i] = filePath
-					})
-					// #endif
-					// #ifdef APP-PLUS
-					filePath = `_doc/parser_tmp/${Date.now()}.${info[1]}`;
-					var bitmap = new plus.nativeObj.Bitmap();
-					bitmap.loadBase64Data(src, () => {
-						bitmap.save(filePath, {}, () => {
-							bitmap.clear()
-							this[i] = filePath;
-						})
-					})
-					// #endif
-				}
-			}
-		},
-		mounted() {
-			// #ifdef H5 || MP-360
-			this.document = document.getElementById('rtf' + this._uid);
-			// #endif
-			// #ifndef H5 || APP-PLUS-NVUE || MP-360
-			if (dom) this.document = new dom(this);
-			// #endif
-			if (search) this.search = args => search(this, args);
-			// #ifdef APP-PLUS-NVUE
-			this.document = this.$refs.web;
-			setTimeout(() => {
-				// #endif
-				if (this.html) this.setContent(this.html);
-				// #ifdef APP-PLUS-NVUE
-			}, 30)
-			// #endif
-		},
-		beforeDestroy() {
-			// #ifdef H5 || MP-360
-			if (this._observer) this._observer.disconnect();
-			// #endif
-			this.imgList.each(src => {
-				// #ifdef APP-PLUS
-				if (src && src.includes('_doc')) {
-					plus.io.resolveLocalFileSystemURL(src, entry => {
-						entry.remove();
-					});
-				}
-				// #endif
-				// #ifdef MP-WEIXIN || MP-TOUTIAO
-				if (src && src.includes(uni.env.USER_DATA_PATH))
-					fs && fs.unlink({
-						filePath: src
-					})
-				// #endif
-			})
-			clearInterval(this._timer);
-		},
-		methods: {
-			// 设置富文本内容
-			setContent(html, append) {
-				// #ifdef APP-PLUS-NVUE
-				if (!html)
-					return this.height = 1;
-				if (append)
-					this.$refs.web.evalJs("var b=document.createElement('div');b.innerHTML='" + html.replace(/'/g, "\\'") +
-						"';document.getElementById('parser').appendChild(b)");
-				else {
-					html =
-						'<meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><style>html,body{width:100%;height:100%;overflow:hidden}body{margin:0}</style><base href="' +
-						this.domain + '"><div id="parser"' + (this.selectable ? '>' : ' style="user-select:none">') + this._handleHtml(html).replace(/\n/g, '\\n') +
-						'</div><script>"use strict";function e(e){if(window.__dcloud_weex_postMessage||window.__dcloud_weex_){var t={data:[e]};window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessage(t):window.__dcloud_weex_.postMessage(JSON.stringify(t))}}document.body.onclick=function(){e({action:"click"})},' +
-						(this.showWithAnimation ? 'document.body.style.animation="_show .5s",' : '') +
-						'setTimeout(function(){e({action:"load",text:document.body.innerText,height:document.getElementById("parser").scrollHeight})},50);\x3c/script>';
-					if (platform == 'android') html = html.replace(/%/g, '%25');
-					this.$refs.web.evalJs("document.write('" + html.replace(/'/g, "\\'") + "');document.close()");
-				}
-				this.$refs.web.evalJs(
-					'var t=document.getElementsByTagName("title");t.length&&e({action:"getTitle",title:t[0].innerText});for(var o,n=document.getElementsByTagName("style"),r=1;o=n[r++];)o.innerHTML=o.innerHTML.replace(/body/g,"#parser");for(var a,c=document.getElementsByTagName("img"),s=[],i=0==c.length,d=0,l=0,g=0;a=c[l];l++)parseInt(a.style.width||a.getAttribute("width"))>' +
-					windowWidth + '&&(a.style.height="auto"),a.onload=function(){++d==c.length&&(i=!0)},a.onerror=function(){++d==c.length&&(i=!0),' + (cfg.errorImg ? 'this.src="' + cfg.errorImg + '",' : '') +
-					'e({action:"error",source:"img",target:this})},a.hasAttribute("ignore")||"A"==a.parentElement.nodeName||(a.i=g++,s.push(a.getAttribute("original-src")||a.src||a.getAttribute("data-src")),a.onclick=function(t){t.stopPropagation(),e({action:"preview",img:{i:this.i,src:this.src}})});e({action:"getImgList",imgList:s});for(var u,m=document.getElementsByTagName("a"),f=0;u=m[f];f++)u.onclick=function(m){m.stopPropagation();var t,o=this.getAttribute("href");if("#"==o[0]){var n=document.getElementById(o.substr(1));n&&(t=n.offsetTop)}return e({action:"linkpress",href:o,offset:t}),!1};for(var h,y=document.getElementsByTagName("video"),v=0;h=y[v];v++)h.style.maxWidth="100%",h.onerror=function(){e({action:"error",source:"video",target:this})}' +
-					(this.autopause ? ',h.onplay=function(){for(var e,t=0;e=y[t];t++)e!=this&&e.pause()}' : '') +
-					';for(var _,p=document.getElementsByTagName("audio"),w=0;_=p[w];w++)_.onerror=function(){e({action:"error",source:"audio",target:this})};' +
-					(this.autoscroll ? 'for(var T,E=document.getElementsByTagName("table"),B=0;T=E[B];B++){var N=document.createElement("div");N.style.overflow="scroll",T.parentNode.replaceChild(N,T),N.appendChild(T)}' : '') +
-					'var x=document.getElementById("parser");clearInterval(window.timer),window.timer=setInterval(function(){i&&clearInterval(window.timer),e({action:"ready",ready:i,height:x.scrollHeight})},350)'
-				)
-				this.nodes = [1];
-				// #endif
-				// #ifdef H5 || MP-360
-				if (!html) {
-					if (this.rtf && !append) this.rtf.parentNode.removeChild(this.rtf);
-					return;
-				}
-				var div = document.createElement('div');
-				if (!append) {
-					if (this.rtf) this.rtf.parentNode.removeChild(this.rtf);
-					this.rtf = div;
-				} else {
-					if (!this.rtf) this.rtf = div;
-					else this.rtf.appendChild(div);
-				}
-				div.innerHTML = this._handleHtml(html, append);
-				for (var styles = this.rtf.getElementsByTagName('style'), i = 0, style; style = styles[i++];) {
-					style.innerHTML = style.innerHTML.replace(/body/g, '#rtf' + this._uid);
-					style.setAttribute('scoped', 'true');
-				}
-				// 懒加载
-				if (!this._observer && this.lazyLoad && IntersectionObserver) {
-					this._observer = new IntersectionObserver(changes => {
-						for (let item, i = 0; item = changes[i++];) {
-							if (item.isIntersecting) {
-								item.target.src = item.target.getAttribute('data-src');
-								item.target.removeAttribute('data-src');
-								this._observer.unobserve(item.target);
-							}
-						}
-					}, {
-						rootMargin: '500px 0px 500px 0px'
-					})
-				}
-				var _ts = this;
-				// 获取标题
-				var title = this.rtf.getElementsByTagName('title');
-				if (title.length && this.autosetTitle)
-					uni.setNavigationBarTitle({
-						title: title[0].innerText
-					})
-				// 填充 domain
-				var fill = target => {
-					var src = target.getAttribute('src');
-					if (this.domain && src) {
-						if (src[0] == '/') {
-							if (src[1] == '/')
-								target.src = (this.domain.includes('://') ? this.domain.split('://')[0] : '') + ':' + src;
-							else target.src = this.domain + src;
-						} else if (!src.includes('://') && src.indexOf('data:') != 0) target.src = this.domain + '/' + src;
-					}
-				}
-				// 图片处理
-				this.imgList.length = 0;
-				var imgs = this.rtf.getElementsByTagName('img');
-				for (let i = 0, j = 0, img; img = imgs[i]; i++) {
-					if (parseInt(img.style.width || img.getAttribute('width')) > windowWidth)
-						img.style.height = 'auto';
-					fill(img);
-					if (!img.hasAttribute('ignore') && img.parentElement.nodeName != 'A') {
-						img.i = j++;
-						_ts.imgList.push(img.getAttribute('original-src') || img.src || img.getAttribute('data-src'));
-						img.onclick = function(e) {
-							e.stopPropagation();
-							var preview = true;
-							this.ignore = () => preview = false;
-							_ts.$emit('imgtap', this);
-							if (preview) {
-								uni.previewImage({
-									current: this.i,
-									urls: _ts.imgList
-								});
-							}
-						}
-					}
-					img.onerror = function() {
-						if (cfg.errorImg)
-							_ts.imgList[this.i] = this.src = cfg.errorImg;
-						_ts.$emit('error', {
-							source: 'img',
-							target: this
-						});
-					}
-					if (_ts.lazyLoad && this._observer && img.src && img.i != 0) {
-						img.setAttribute('data-src', img.src);
-						img.removeAttribute('src');
-						this._observer.observe(img);
-					}
-				}
-				// 链接处理
-				var links = this.rtf.getElementsByTagName('a');
-				for (var link of links) {
-					link.onclick = function(e) {
-						e.stopPropagation();
-						var jump = true,
-							href = this.getAttribute('href');
-						_ts.$emit('linkpress', {
-							href,
-							ignore: () => jump = false
-						});
-						if (jump && href) {
-							if (href[0] == '#') {
-								if (_ts.useAnchor) {
-									_ts.navigateTo({
-										id: href.substr(1)
-									})
-								}
-							} else if (href.indexOf('http') == 0 || href.indexOf('//') == 0)
-								return true;
-							else
-								uni.navigateTo({
-									url: href
-								})
-						}
-						return false;
-					}
-				}
-				// 视频处理
-				var videos = this.rtf.getElementsByTagName('video');
-				_ts.videoContexts = videos;
-				for (let video, i = 0; video = videos[i++];) {
-					fill(video);
-					video.style.maxWidth = '100%';
-					video.onerror = function() {
-						_ts.$emit('error', {
-							source: 'video',
-							target: this
-						});
-					}
-					video.onplay = function() {
-						if (_ts.autopause)
-							for (let item, i = 0; item = _ts.videoContexts[i++];)
-								if (item != this) item.pause();
-					}
-				}
-				// 音频处理
-				var audios = this.rtf.getElementsByTagName('audio');
-				for (var audio of audios) {
-					fill(audio);
-					audio.onerror = function() {
-						_ts.$emit('error', {
-							source: 'audio',
-							target: this
-						});
-					}
-				}
-				// 表格处理
-				if (this.autoscroll) {
-					var tables = this.rtf.getElementsByTagName('table');
-					for (var table of tables) {
-						let div = document.createElement('div');
-						div.style.overflow = 'scroll';
-						table.parentNode.replaceChild(div, table);
-						div.appendChild(table);
-					}
-				}
-				if (!append) this.document.appendChild(this.rtf);
-				this.$nextTick(() => {
-					this.nodes = [1];
-					this.$emit('load');
-				});
-				setTimeout(() => this.showAm = '', 500);
-				// #endif
-				// #ifndef APP-PLUS-NVUE
-				// #ifndef H5 || MP-360
-				var nodes;
-				if (!html) return this.nodes = [];
-				var parser = new Parser(html, this);
-				// 缓存读取
-				if (this.useCache) {
-					var hashVal = hash(html);
-					if (cache[hashVal])
-						nodes = cache[hashVal];
-					else {
-						nodes = parser.parse();
-						cache[hashVal] = nodes;
-					}
-				} else nodes = parser.parse();
-				this.$emit('parse', nodes);
-				if (append) this.nodes = this.nodes.concat(nodes);
-				else this.nodes = nodes;
-				if (nodes.length && nodes.title && this.autosetTitle)
-					uni.setNavigationBarTitle({
-						title: nodes.title
-					})
-				if (this.imgList) this.imgList.length = 0;
-				this.videoContexts = [];
-				this.$nextTick(() => {
-					(function f(cs) {
-						for (var i = cs.length; i--;) {
-							if (cs[i].top) {
-								cs[i].controls = [];
-								cs[i].init();
-								f(cs[i].$children);
-							}
-						}
-					})(this.$children)
-					this.$emit('load');
-				})
-				// #endif
-				var height;
-				clearInterval(this._timer);
-				this._timer = setInterval(() => {
-					// #ifdef H5 || MP-360
-					this.rect = this.rtf.getBoundingClientRect();
-					// #endif
-					// #ifndef H5 || MP-360
-					uni.createSelectorQuery().in(this)
-						.select('#_top').boundingClientRect().exec(res => {
-							if (!res) return;
-							this.rect = res[0];
-							// #endif
-							if (this.rect.height == height) {
-								this.$emit('ready', this.rect)
-								clearInterval(this._timer);
-							}
-							height = this.rect.height;
-							// #ifndef H5 || MP-360
-						});
-					// #endif
-				}, 350);
-				if (this.showWithAnimation && !append) this.showAm = 'animation:_show .5s';
-				// #endif
-			},
-			// 获取文本内容
-			getText(ns = this.nodes) {
-				var txt = '';
-				// #ifdef APP-PLUS-NVUE
-				txt = this._text;
-				// #endif
-				// #ifdef H5 || MP-360
-				txt = this.rtf.innerText;
-				// #endif
-				// #ifndef H5 || APP-PLUS-NVUE || MP-360
-				for (var i = 0, n; n = ns[i++];) {
-					if (n.type == 'text') txt += n.text.replace(/&nbsp;/g, '\u00A0').replace(/&lt;/g, '<').replace(/&gt;/g, '>')
-						.replace(/&amp;/g, '&');
-					else if (n.type == 'br') txt += '\n';
-					else {
-						// 块级标签前后加换行
-						var block = n.name == 'p' || n.name == 'div' || n.name == 'tr' || n.name == 'li' || (n.name[0] == 'h' && n.name[1] >
-							'0' && n.name[1] < '7');
-						if (block && txt && txt[txt.length - 1] != '\n') txt += '\n';
-						if (n.children) txt += this.getText(n.children);
-						if (block && txt[txt.length - 1] != '\n') txt += '\n';
-						else if (n.name == 'td' || n.name == 'th') txt += '\t';
-					}
-				}
-				// #endif
-				return txt;
-			},
-			// 锚点跳转
-			in (obj) {
-				if (obj.page && obj.selector && obj.scrollTop) this._in = obj;
-			},
-			navigateTo(obj) {
-				if (!this.useAnchor) return obj.fail && obj.fail('Anchor is disabled');
-				// #ifdef APP-PLUS-NVUE
-				if (!obj.id)
-					weexDom.scrollToElement(this.$refs.web);
-				else
-					this.$refs.web.evalJs('var pos=document.getElementById("' + obj.id +
-						'");if(pos)post({action:"linkpress",href:"#",offset:pos.offsetTop+' + (obj.offset || 0) + '})');
-				obj.success && obj.success();
-				// #endif
-				// #ifndef APP-PLUS-NVUE
-				var d = ' ';
-				// #ifdef MP-WEIXIN || MP-QQ || MP-TOUTIAO
-				d = '>>>';
-				// #endif
-				var selector = uni.createSelectorQuery().in(this._in ? this._in.page : this).select((this._in ? this._in.selector :
-					'#_top') + (obj.id ? `${d}#${obj.id},${this._in?this._in.selector:'#_top'}${d}.${obj.id}` : '')).boundingClientRect();
-				if (this._in) selector.select(this._in.selector).scrollOffset().select(this._in.selector).boundingClientRect();
-				else selector.selectViewport().scrollOffset();
-				selector.exec(res => {
-					if (!res[0]) return obj.fail && obj.fail('Label not found')
-					var scrollTop = res[1].scrollTop + res[0].top - (res[2] ? res[2].top : 0) + (obj.offset || 0);
-					if (this._in) this._in.page[this._in.scrollTop] = scrollTop;
-					else uni.pageScrollTo({
-						scrollTop,
-						duration: 300
-					})
-					obj.success && obj.success();
-				})
-				// #endif
-			},
-			// 获取视频对象
-			getVideoContext(id) {
-				// #ifndef APP-PLUS-NVUE
-				if (!id) return this.videoContexts;
-				else
-					for (var i = this.videoContexts.length; i--;)
-						if (this.videoContexts[i].id == id) return this.videoContexts[i];
-				// #endif
-			},
-			// #ifdef H5 || APP-PLUS-NVUE || MP-360
-			_handleHtml(html, append) {
-				if (!append) {
-					// 处理 tag-style 和 userAgentStyles
-					var style = '<style>@keyframes _show{0%{opacity:0}100%{opacity:1}}img{max-width:100%}';
-					for (var item in cfg.userAgentStyles)
-						style += `${item}{${cfg.userAgentStyles[item]}}`;
-					for (item in this.tagStyle)
-						style += `${item}{${this.tagStyle[item]}}`;
-					style += '</style>';
-					html = style + html;
-				}
-				// 处理 rpx
-				if (html.includes('rpx'))
-					html = html.replace(/[0-9.]+\s*rpx/g, $ => (parseFloat($) * windowWidth / 750) + 'px');
-				return html;
-			},
-			// #endif
-			// #ifdef APP-PLUS-NVUE
-			_message(e) {
-				// 接收 web-view 消息
-				var d = e.detail.data[0];
-				switch (d.action) {
-					case 'load':
-						this.$emit('load');
-						this.height = d.height;
-						this._text = d.text;
-						break;
-					case 'getTitle':
-						if (this.autosetTitle)
-							uni.setNavigationBarTitle({
-								title: d.title
-							})
-						break;
-					case 'getImgList':
-						this.imgList.length = 0;
-						for (var i = d.imgList.length; i--;)
-							this.imgList.setItem(i, d.imgList[i]);
-						break;
-					case 'preview':
-						var preview = true;
-						d.img.ignore = () => preview = false;
-						this.$emit('imgtap', d.img);
-						if (preview)
-							uni.previewImage({
-								current: d.img.i,
-								urls: this.imgList
-							})
-						break;
-					case 'linkpress':
-						var jump = true,
-							href = d.href;
-						this.$emit('linkpress', {
-							href,
-							ignore: () => jump = false
-						})
-						if (jump && href) {
-							if (href[0] == '#') {
-								if (this.useAnchor)
-									weexDom.scrollToElement(this.$refs.web, {
-										offset: d.offset
-									})
-							} else if (href.includes('://'))
-								plus.runtime.openWeb(href);
-							else
-								uni.navigateTo({
-									url: href
-								})
-						}
-						break;
-					case 'error':
-						if (d.source == 'img' && cfg.errorImg)
-							this.imgList.setItem(d.target.i, cfg.errorImg);
-						this.$emit('error', {
-							source: d.source,
-							target: d.target
-						})
-						break;
-					case 'ready':
-						this.height = d.height;
-						if (d.ready) uni.createSelectorQuery().in(this).select('#_top').boundingClientRect().exec(res => {
-							this.rect = res[0];
-							this.$emit('ready', res[0]);
-						})
-						break;
-					case 'click':
-						this.$emit('click');
-						this.$emit('tap');
-				}
-			},
-			// #endif
-		}
-	}
-</script>
-
-<style>
-	@keyframes _show {
-		0% {
-			opacity: 0;
-		}
-
-		100% {
-			opacity: 1;
-		}
-	}
-
-	/* #ifdef MP-WEIXIN */
-	:host {
-		display: block;
-		overflow: auto;
-		-webkit-overflow-scrolling: touch;
-	}
-
-	/* #endif */
-</style>

+ 0 - 100
components/jyf-parser/libs/CssHandler.js

@@ -1,100 +0,0 @@
-const cfg = require('./config.js'),
-	isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
-
-function CssHandler(tagStyle) {
-	var styles = Object.assign(Object.create(null), cfg.userAgentStyles);
-	for (var item in tagStyle)
-		styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
-	this.styles = styles;
-}
-CssHandler.prototype.getStyle = function(data) {
-	this.styles = new parser(data, this.styles).parse();
-}
-CssHandler.prototype.match = function(name, attrs) {
-	var tmp, matched = (tmp = this.styles[name]) ? tmp + ';' : '';
-	if (attrs.class) {
-		var items = attrs.class.split(' ');
-		for (var i = 0, item; item = items[i]; i++)
-			if (tmp = this.styles['.' + item])
-				matched += tmp + ';';
-	}
-	if (tmp = this.styles['#' + attrs.id])
-		matched += tmp + ';';
-	return matched;
-}
-module.exports = CssHandler;
-
-function parser(data, init) {
-	this.data = data;
-	this.floor = 0;
-	this.i = 0;
-	this.list = [];
-	this.res = init;
-	this.state = this.Space;
-}
-parser.prototype.parse = function() {
-	for (var c; c = this.data[this.i]; this.i++)
-		this.state(c);
-	return this.res;
-}
-parser.prototype.section = function() {
-	return this.data.substring(this.start, this.i);
-}
-// 状态机
-parser.prototype.Space = function(c) {
-	if (c == '.' || c == '#' || isLetter(c)) {
-		this.start = this.i;
-		this.state = this.Name;
-	} else if (c == '/' && this.data[this.i + 1] == '*')
-		this.Comment();
-	else if (!cfg.blankChar[c] && c != ';')
-		this.state = this.Ignore;
-}
-parser.prototype.Comment = function() {
-	this.i = this.data.indexOf('*/', this.i) + 1;
-	if (!this.i) this.i = this.data.length;
-	this.state = this.Space;
-}
-parser.prototype.Ignore = function(c) {
-	if (c == '{') this.floor++;
-	else if (c == '}' && !--this.floor) {
-		this.list = [];
-		this.state = this.Space;
-	}
-}
-parser.prototype.Name = function(c) {
-	if (cfg.blankChar[c]) {
-		this.list.push(this.section());
-		this.state = this.NameSpace;
-	} else if (c == '{') {
-		this.list.push(this.section());
-		this.Content();
-	} else if (c == ',') {
-		this.list.push(this.section());
-		this.Comma();
-	} else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
-		this.state = this.Ignore;
-}
-parser.prototype.NameSpace = function(c) {
-	if (c == '{') this.Content();
-	else if (c == ',') this.Comma();
-	else if (!cfg.blankChar[c]) this.state = this.Ignore;
-}
-parser.prototype.Comma = function() {
-	while (cfg.blankChar[this.data[++this.i]]);
-	if (this.data[this.i] == '{') this.Content();
-	else {
-		this.start = this.i--;
-		this.state = this.Name;
-	}
-}
-parser.prototype.Content = function() {
-	this.start = ++this.i;
-	if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
-	var content = this.section();
-	for (var i = 0, item; item = this.list[i++];)
-		if (this.res[item]) this.res[item] += ';' + content;
-		else this.res[item] = content;
-	this.list = [];
-	this.state = this.Space;
-}

+ 0 - 580
components/jyf-parser/libs/MpHtmlParser.js

@@ -1,580 +0,0 @@
-/**
- * html 解析器
- * @tutorial https://github.com/jin-yufeng/Parser
- * @version 20201029
- * @author JinYufeng
- * @listens MIT
- */
-const cfg = require('./config.js'),
-	blankChar = cfg.blankChar,
-	CssHandler = require('./CssHandler.js'),
-	windowWidth = uni.getSystemInfoSync().windowWidth;
-var emoji;
-
-function MpHtmlParser(data, options = {}) {
-	this.attrs = {};
-	this.CssHandler = new CssHandler(options.tagStyle, windowWidth);
-	this.data = data;
-	this.domain = options.domain;
-	this.DOM = [];
-	this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
-	options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
-	this.options = options;
-	this.state = this.Text;
-	this.STACK = [];
-	// 工具函数
-	this.bubble = () => {
-		for (var i = this.STACK.length, item; item = this.STACK[--i];) {
-			if (cfg.richOnlyTags[item.name]) return false;
-			item.c = 1;
-		}
-		return true;
-	}
-	this.decode = (val, amp) => {
-		var i = -1,
-			j, en;
-		while (1) {
-			if ((i = val.indexOf('&', i + 1)) == -1) break;
-			if ((j = val.indexOf(';', i + 2)) == -1) break;
-			if (val[i + 1] == '#') {
-				en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
-				if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
-			} else {
-				en = val.substring(i + 1, j);
-				if (cfg.entities[en] || en == amp)
-					val = val.substr(0, i) + (cfg.entities[en] || '&') + val.substr(j + 1);
-			}
-		}
-		return val;
-	}
-	this.getUrl = url => {
-		if (url[0] == '/') {
-			if (url[1] == '/') url = this.options.prot + ':' + url;
-			else if (this.domain) url = this.domain + url;
-		} else if (this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
-			url = this.domain + '/' + url;
-		return url;
-	}
-	this.isClose = () => this.data[this.i] == '>' || (this.data[this.i] == '/' && this.data[this.i + 1] == '>');
-	this.section = () => this.data.substring(this.start, this.i);
-	this.parent = () => this.STACK[this.STACK.length - 1];
-	this.siblings = () => this.STACK.length ? this.parent().children : this.DOM;
-}
-MpHtmlParser.prototype.parse = function() {
-	if (emoji) this.data = emoji.parseEmoji(this.data);
-	for (var c; c = this.data[this.i]; this.i++)
-		this.state(c);
-	if (this.state == this.Text) this.setText();
-	while (this.STACK.length) this.popNode(this.STACK.pop());
-	return this.DOM;
-}
-// 设置属性
-MpHtmlParser.prototype.setAttr = function() {
-	var name = this.attrName.toLowerCase(),
-		val = this.attrVal;
-	if (cfg.boolAttrs[name]) this.attrs[name] = 'T';
-	else if (val) {
-		if (name == 'src' || (name == 'data-src' && !this.attrs.src)) this.attrs.src = this.getUrl(this.decode(val, 'amp'));
-		else if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');
-		else if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
-	}
-	this.attrVal = '';
-	while (blankChar[this.data[this.i]]) this.i++;
-	if (this.isClose()) this.setNode();
-	else {
-		this.start = this.i;
-		this.state = this.AttrName;
-	}
-}
-// 设置文本节点
-MpHtmlParser.prototype.setText = function() {
-	var back, text = this.section();
-	if (!text) return;
-	text = (cfg.onText && cfg.onText(text, () => back = true)) || text;
-	if (back) {
-		this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
-		let j = this.start + text.length;
-		for (this.i = this.start; this.i < j; this.i++) this.state(this.data[this.i]);
-		return;
-	}
-	if (!this.pre) {
-		// 合并空白符
-		var flag, tmp = [];
-		for (let i = text.length, c; c = text[--i];)
-			if (!blankChar[c]) {
-				tmp.unshift(c);
-				if (!flag) flag = 1;
-			} else {
-				if (tmp[0] != ' ') tmp.unshift(' ');
-				if (c == '\n' && flag == void 0) flag = 0;
-			}
-		if (flag == 0) return;
-		text = tmp.join('');
-	}
-	this.siblings().push({
-		type: 'text',
-		text: this.decode(text)
-	});
-}
-// 设置元素节点
-MpHtmlParser.prototype.setNode = function() {
-	var node = {
-			name: this.tagName.toLowerCase(),
-			attrs: this.attrs
-		},
-		close = cfg.selfClosingTags[node.name];
-	if (this.options.nodes.length) node.type = 'node';
-	this.attrs = {};
-	if (!cfg.ignoreTags[node.name]) {
-		// 处理属性
-		var attrs = node.attrs,
-			style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
-			styleObj = {};
-		if (attrs.id) {
-			if (this.options.compress & 1) attrs.id = void 0;
-			else if (this.options.useAnchor) this.bubble();
-		}
-		if ((this.options.compress & 2) && attrs.class) attrs.class = void 0;
-		switch (node.name) {
-			case 'a':
-			case 'ad': // #ifdef APP-PLUS
-			case 'iframe':
-				// #endif
-				this.bubble();
-				break;
-			case 'font':
-				if (attrs.color) {
-					styleObj['color'] = attrs.color;
-					attrs.color = void 0;
-				}
-				if (attrs.face) {
-					styleObj['font-family'] = attrs.face;
-					attrs.face = void 0;
-				}
-				if (attrs.size) {
-					var size = parseInt(attrs.size);
-					if (size < 1) size = 1;
-					else if (size > 7) size = 7;
-					var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
-					styleObj['font-size'] = map[size - 1];
-					attrs.size = void 0;
-				}
-				break;
-			case 'embed':
-				// #ifndef APP-PLUS
-				var src = node.attrs.src || '',
-					type = node.attrs.type || '';
-				if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
-					node.name = 'video';
-				else if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes(
-						'.aac'))
-					node.name = 'audio';
-				else break;
-				if (node.attrs.autostart)
-					node.attrs.autoplay = 'T';
-				node.attrs.controls = 'T';
-				// #endif
-				// #ifdef APP-PLUS
-				this.bubble();
-				break;
-				// #endif
-			case 'video':
-			case 'audio':
-				if (!attrs.id) attrs.id = node.name + (++this[`${node.name}Num`]);
-				else this[`${node.name}Num`]++;
-				if (node.name == 'video') {
-					if (this.videoNum > 3)
-						node.lazyLoad = 1;
-					if (attrs.width) {
-						styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
-						attrs.width = void 0;
-					}
-					if (attrs.height) {
-						styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
-						attrs.height = void 0;
-					}
-				}
-				if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
-				attrs.source = [];
-				if (attrs.src) {
-					attrs.source.push(attrs.src);
-					attrs.src = void 0;
-				}
-				this.bubble();
-				break;
-			case 'td':
-			case 'th':
-				if (attrs.colspan || attrs.rowspan)
-					for (var k = this.STACK.length, item; item = this.STACK[--k];)
-						if (item.name == 'table') {
-							item.flag = 1;
-							break;
-						}
-		}
-		if (attrs.align) {
-			if (node.name == 'table') {
-				if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';
-				else styleObj['float'] = attrs.align;
-			} else styleObj['text-align'] = attrs.align;
-			attrs.align = void 0;
-		}
-		// 压缩 style
-		var styles = style.split(';');
-		style = '';
-		for (var i = 0, len = styles.length; i < len; i++) {
-			var info = styles[i].split(':');
-			if (info.length < 2) continue;
-			let key = info[0].trim().toLowerCase(),
-				value = info.slice(1).join(':').trim();
-			if (value[0] == '-' || value.includes('safe'))
-				style += `;${key}:${value}`;
-			else if (!styleObj[key] || value.includes('import') || !styleObj[key].includes('import'))
-				styleObj[key] = value;
-		}
-		if (node.name == 'img') {
-			if (attrs.src && !attrs.ignore) {
-				if (this.bubble())
-					attrs.i = (this.imgNum++).toString();
-				else attrs.ignore = 'T';
-			}
-			if (attrs.ignore) {
-				style += ';-webkit-touch-callout:none';
-				styleObj['max-width'] = '100%';
-			}
-			var width;
-			if (styleObj.width) width = styleObj.width;
-			else if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
-			if (width) {
-				styleObj.width = width;
-				attrs.width = '100%';
-				if (parseInt(width) > windowWidth) {
-					styleObj.height = '';
-					if (attrs.height) attrs.height = void 0;
-				}
-			}
-			if (styleObj.height) {
-				attrs.height = styleObj.height;
-				styleObj.height = '';
-			} else if (attrs.height && !attrs.height.includes('%'))
-				attrs.height = parseFloat(attrs.height) + 'px';
-		}
-		for (var key in styleObj) {
-			var value = styleObj[key];
-			if (!value) continue;
-			if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
-			// 填充链接
-			if (value.includes('url')) {
-				var j = value.indexOf('(');
-				if (j++ != -1) {
-					while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) j++;
-					value = value.substr(0, j) + this.getUrl(value.substr(j));
-				}
-			}
-			// 转换 rpx
-			else if (value.includes('rpx'))
-				value = value.replace(/[0-9.]+\s*rpx/g, $ => parseFloat($) * windowWidth / 750 + 'px');
-			else if (key == 'white-space' && value.includes('pre') && !close)
-				this.pre = node.pre = true;
-			style += `;${key}:${value}`;
-		}
-		style = style.substr(1);
-		if (style) attrs.style = style;
-		if (!close) {
-			node.children = [];
-			if (node.name == 'pre' && cfg.highlight) {
-				this.remove(node);
-				this.pre = node.pre = true;
-			}
-			this.siblings().push(node);
-			this.STACK.push(node);
-		} else if (!cfg.filter || cfg.filter(node, this) != false)
-			this.siblings().push(node);
-	} else {
-		if (!close) this.remove(node);
-		else if (node.name == 'source') {
-			var parent = this.parent();
-			if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
-				parent.attrs.source.push(node.attrs.src);
-		} else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
-	}
-	if (this.data[this.i] == '/') this.i++;
-	this.start = this.i + 1;
-	this.state = this.Text;
-}
-// 移除标签
-MpHtmlParser.prototype.remove = function(node) {
-	var name = node.name,
-		j = this.i;
-	// 处理 svg
-	var handleSvg = () => {
-		var src = this.data.substring(j, this.i + 1);
-		node.attrs.xmlns = 'http://www.w3.org/2000/svg';
-		for (var key in node.attrs) {
-			if (key == 'viewbox') src = ` viewBox="${node.attrs.viewbox}"` + src;
-			else if (key != 'style') src = ` ${key}="${node.attrs[key]}"` + src;
-		}
-		src = '<svg' + src;
-		var parent = this.parent();
-		if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
-			parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
-		this.siblings().push({
-			name: 'img',
-			attrs: {
-				src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
-				style: node.attrs.style,
-				ignore: 'T'
-			}
-		})
-	}
-	if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
-	while (1) {
-		if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
-			if (name == 'pre' || name == 'svg') this.i = j;
-			else this.i = this.data.length;
-			return;
-		}
-		this.start = (this.i += 2);
-		while (!blankChar[this.data[this.i]] && !this.isClose()) this.i++;
-		if (this.section().toLowerCase() == name) {
-			// 代码块高亮
-			if (name == 'pre') {
-				this.data = this.data.substr(0, j + 1) + cfg.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data
-					.substr(this.i - 5);
-				return this.i = j;
-			} else if (name == 'style')
-				this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));
-			else if (name == 'title')
-				this.DOM.title = this.data.substring(j + 1, this.i - 7);
-			if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
-			if (name == 'svg') handleSvg();
-			return;
-		}
-	}
-}
-// 节点出栈处理
-MpHtmlParser.prototype.popNode = function(node) {
-	// 空白符处理
-	if (node.pre) {
-		node.pre = this.pre = void 0;
-		for (let i = this.STACK.length; i--;)
-			if (this.STACK[i].pre)
-				this.pre = true;
-	}
-	var siblings = this.siblings(),
-		len = siblings.length,
-		childs = node.children;
-	if (node.name == 'head' || (cfg.filter && cfg.filter(node, this) == false))
-		return siblings.pop();
-	var attrs = node.attrs;
-	// 替换一些标签名
-	if (cfg.blockTags[node.name]) node.name = 'div';
-	else if (!cfg.trustTags[node.name]) node.name = 'span';
-	// 处理列表
-	if (node.c && (node.name == 'ul' || node.name == 'ol')) {
-		if ((node.attrs.style || '').includes('list-style:none')) {
-			for (let i = 0, child; child = childs[i++];)
-				if (child.name == 'li')
-					child.name = 'div';
-		} else if (node.name == 'ul') {
-			var floor = 1;
-			for (let i = this.STACK.length; i--;)
-				if (this.STACK[i].name == 'ul') floor++;
-			if (floor != 1)
-				for (let i = childs.length; i--;)
-					childs[i].floor = floor;
-		} else {
-			for (let i = 0, num = 1, child; child = childs[i++];)
-				if (child.name == 'li') {
-					child.type = 'ol';
-					child.num = ((num, type) => {
-						if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
-						if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
-						if (type == 'i' || type == 'I') {
-							num = (num - 1) % 99 + 1;
-							var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
-								ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
-								res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
-							if (type == 'i') return res.toLowerCase();
-							return res;
-						}
-						return num;
-					})(num++, attrs.type) + '.';
-				}
-		}
-	}
-	// 处理表格
-	if (node.name == 'table') {
-		var padding = parseFloat(attrs.cellpadding),
-			spacing = parseFloat(attrs.cellspacing),
-			border = parseFloat(attrs.border);
-		if (node.c) {
-			if (isNaN(padding)) padding = 2;
-			if (isNaN(spacing)) spacing = 2;
-		}
-		if (border) attrs.style = `border:${border}px solid gray;${attrs.style || ''}`;
-		if (node.flag && node.c) {
-			// 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
-			attrs.style = `${attrs.style || ''};${spacing ? `;grid-gap:${spacing}px` : ';border-left:0;border-top:0'}`;
-			var row = 1,
-				col = 1,
-				colNum,
-				trs = [],
-				children = [],
-				map = {};
-			(function f(ns) {
-				for (var i = 0; i < ns.length; i++) {
-					if (ns[i].name == 'tr') trs.push(ns[i]);
-					else f(ns[i].children || []);
-				}
-			})(node.children)
-			for (let i = 0; i < trs.length; i++) {
-				for (let j = 0, td; td = trs[i].children[j]; j++) {
-					if (td.name == 'td' || td.name == 'th') {
-						while (map[row + '.' + col]) col++;
-						var cell = {
-							name: 'div',
-							c: 1,
-							attrs: {
-								style: (td.attrs.style || '') + (border ? `;border:${border}px solid gray` + (spacing ? '' :
-									';border-right:0;border-bottom:0') : '') + (padding ? `;padding:${padding}px` : '')
-							},
-							children: td.children
-						}
-						if (td.attrs.colspan) {
-							cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
-							if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
-							col += parseInt(td.attrs.colspan) - 1;
-						}
-						if (td.attrs.rowspan) {
-							cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
-							if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
-							for (var k = 1; k < td.attrs.rowspan; k++) map[(row + k) + '.' + col] = 1;
-						}
-						children.push(cell);
-						col++;
-					}
-				}
-				if (!colNum) {
-					colNum = col - 1;
-					attrs.style += `;grid-template-columns:repeat(${colNum},auto)`
-				}
-				col = 1;
-				row++;
-			}
-			node.children = children;
-		} else {
-			attrs.style = `border-spacing:${spacing}px;${attrs.style || ''}`;
-			if (border || padding)
-				(function f(ns) {
-					for (var i = 0, n; n = ns[i]; i++) {
-						if (n.name == 'th' || n.name == 'td') {
-							if (border) n.attrs.style = `border:${border}px solid gray;${n.attrs.style || ''}`;
-							if (padding) n.attrs.style = `padding:${padding}px;${n.attrs.style || ''}`;
-						} else f(n.children || []);
-					}
-				})(childs)
-		}
-		if (this.options.autoscroll) {
-			var table = Object.assign({}, node);
-			node.name = 'div';
-			node.attrs = {
-				style: 'overflow:scroll'
-			}
-			node.children = [table];
-		}
-	}
-	this.CssHandler.pop && this.CssHandler.pop(node);
-	// 自动压缩
-	if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div')
-		siblings[len - 1] = childs[0];
-}
-// 状态机
-MpHtmlParser.prototype.Text = function(c) {
-	if (c == '<') {
-		var next = this.data[this.i + 1],
-			isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
-		if (isLetter(next)) {
-			this.setText();
-			this.start = this.i + 1;
-			this.state = this.TagName;
-		} else if (next == '/') {
-			this.setText();
-			if (isLetter(this.data[++this.i + 1])) {
-				this.start = this.i + 1;
-				this.state = this.EndTag;
-			} else this.Comment();
-		} else if (next == '!' || next == '?') {
-			this.setText();
-			this.Comment();
-		}
-	}
-}
-MpHtmlParser.prototype.Comment = function() {
-	var key;
-	if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';
-	else if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';
-	else key = '>';
-	if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;
-	else this.i += key.length - 1;
-	this.start = this.i + 1;
-	this.state = this.Text;
-}
-MpHtmlParser.prototype.TagName = function(c) {
-	if (blankChar[c]) {
-		this.tagName = this.section();
-		while (blankChar[this.data[this.i]]) this.i++;
-		if (this.isClose()) this.setNode();
-		else {
-			this.start = this.i;
-			this.state = this.AttrName;
-		}
-	} else if (this.isClose()) {
-		this.tagName = this.section();
-		this.setNode();
-	}
-}
-MpHtmlParser.prototype.AttrName = function(c) {
-	if (c == '=' || blankChar[c] || this.isClose()) {
-		this.attrName = this.section();
-		if (blankChar[c])
-			while (blankChar[this.data[++this.i]]);
-		if (this.data[this.i] == '=') {
-			while (blankChar[this.data[++this.i]]);
-			this.start = this.i--;
-			this.state = this.AttrValue;
-		} else this.setAttr();
-	}
-}
-MpHtmlParser.prototype.AttrValue = function(c) {
-	if (c == '"' || c == "'") {
-		this.start++;
-		if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
-		this.attrVal = this.section();
-		this.i++;
-	} else {
-		for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++);
-		this.attrVal = this.section();
-	}
-	this.setAttr();
-}
-MpHtmlParser.prototype.EndTag = function(c) {
-	if (blankChar[c] || c == '>' || c == '/') {
-		var name = this.section().toLowerCase();
-		for (var i = this.STACK.length; i--;)
-			if (this.STACK[i].name == name) break;
-		if (i != -1) {
-			var node;
-			while ((node = this.STACK.pop()).name != name) this.popNode(node);
-			this.popNode(node);
-		} else if (name == 'p' || name == 'br')
-			this.siblings().push({
-				name,
-				attrs: {}
-			});
-		this.i = this.data.indexOf('>', this.i);
-		this.start = this.i + 1;
-		if (this.i == -1) this.i = this.data.length;
-		else this.state = this.Text;
-	}
-}
-module.exports = MpHtmlParser;

+ 0 - 80
components/jyf-parser/libs/config.js

@@ -1,80 +0,0 @@
-/* 配置文件 */
-var cfg = {
-	// 出错占位图
-	errorImg: null,
-	// 过滤器函数
-	filter: null,
-	// 代码高亮函数
-	highlight: null,
-	// 文本处理函数
-	onText: null,
-	// 实体编码列表
-	entities: {
-		quot: '"',
-		apos: "'",
-		semi: ';',
-		nbsp: '\xA0',
-		ensp: '\u2002',
-		emsp: '\u2003',
-		ndash: '–',
-		mdash: '—',
-		middot: '·',
-		lsquo: '‘',
-		rsquo: '’',
-		ldquo: '“',
-		rdquo: '”',
-		bull: '•',
-		hellip: '…'
-	},
-	blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
-	boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
-	// 块级标签,将被转为 div
-	blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
-	// 将被移除的标签
-	ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
-	// 只能被 rich-text 显示的标签
-	richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
-	// 自闭合的标签
-	selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
-	// 信任的标签
-	trustTags: makeMap('a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video'),
-	// 默认的标签样式
-	userAgentStyles: {
-		address: 'font-style:italic',
-		big: 'display:inline;font-size:1.2em',
-		blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
-		caption: 'display:table-caption;text-align:center',
-		center: 'text-align:center',
-		cite: 'font-style:italic',
-		dd: 'margin-left:40px',
-		mark: 'background-color:yellow',
-		pre: 'font-family:monospace;white-space:pre;overflow:scroll',
-		s: 'text-decoration:line-through',
-		small: 'display:inline;font-size:0.8em',
-		u: 'text-decoration:underline'
-	}
-}
-
-function makeMap(str) {
-	var map = Object.create(null),
-		list = str.split(',');
-	for (var i = list.length; i--;)
-		map[list[i]] = true;
-	return map;
-}
-
-// #ifdef MP-WEIXIN
-if (wx.canIUse('editor')) {
-	cfg.blockTags.pre = void 0;
-	cfg.ignoreTags.rp = true;
-	Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
-	Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
-}
-// #endif
-
-// #ifdef APP-PLUS
-cfg.ignoreTags.iframe = void 0;
-Object.assign(cfg.trustTags, makeMap('embed,iframe'));
-// #endif
-
-module.exports = cfg;

+ 0 - 22
components/jyf-parser/libs/handler.wxs

@@ -1,22 +0,0 @@
-var inline = {
-	abbr: 1,
-	b: 1,
-	big: 1,
-	code: 1,
-	del: 1,
-	em: 1,
-	i: 1,
-	ins: 1,
-	label: 1,
-	q: 1,
-	small: 1,
-	span: 1,
-	strong: 1,
-	sub: 1,
-	sup: 1
-}
-module.exports = {
-	use: function(item) {
-		return !item.c && !inline[item.name] && (item.attrs.style || '').indexOf('display:inline') == -1
-	}
-}

+ 0 - 505
components/jyf-parser/libs/trees.vue

@@ -1,505 +0,0 @@
-<template>
-	<view :class="'interlayer '+(c||'')" :style="s">
-		<block v-for="(n, i) in nodes" v-bind:key="i">
-			<!--图片-->
-			<view v-if="n.name=='img'" :class="'_img '+n.attrs.class" :style="n.attrs.style" :data-attrs="n.attrs" @tap.stop="imgtap">
-				<rich-text v-if="ctrl[i]!=0" :nodes="[{attrs:{src:loading&&(ctrl[i]||0)<2?loading:(lazyLoad&&!ctrl[i]?placeholder:(ctrl[i]==3?errorImg:n.attrs.src||'')),alt:n.attrs.alt||'',width:n.attrs.width||'',style:'-webkit-touch-callout:none;max-width:100%;display:block'+(n.attrs.height?';height:'+n.attrs.height:'')},name:'img'}]" />
-				<image class="_image" :src="lazyLoad&&!ctrl[i]?placeholder:n.attrs.src" :lazy-load="lazyLoad"
-				 :show-menu-by-longpress="!n.attrs.ignore" :data-i="i" :data-index="n.attrs.i" data-source="img" @load="loadImg"
-				 @error="error" />
-			</view>
-			<!--文本-->
-			<text v-else-if="n.type=='text'" decode>{{n.text}}</text>
-			<!--#ifndef MP-BAIDU-->
-			<text v-else-if="n.name=='br'">\n</text>
-			<!--#endif-->
-			<!--视频-->
-			<view v-else-if="((n.lazyLoad&&!n.attrs.autoplay)||(n.name=='video'&&!loadVideo))&&ctrl[i]==undefined" :id="n.attrs.id"
-			 :class="'_video '+(n.attrs.class||'')" :style="n.attrs.style" :data-i="i" @tap.stop="_loadVideo" />
-			<video v-else-if="n.name=='video'" :id="n.attrs.id" :class="n.attrs.class" :style="n.attrs.style" :autoplay="n.attrs.autoplay||ctrl[i]==0"
-			 :controls="n.attrs.controls" :loop="n.attrs.loop" :muted="n.attrs.muted" :poster="n.attrs.poster" :src="n.attrs.source[ctrl[i]||0]"
-			 :unit-id="n.attrs['unit-id']" :data-id="n.attrs.id" :data-i="i" data-source="video" @error="error" @play="play" />
-			<!--音频-->
-			<audio v-else-if="n.name=='audio'" :ref="n.attrs.id" :class="n.attrs.class" :style="n.attrs.style" :author="n.attrs.author"
-			 :autoplay="n.attrs.autoplay" :controls="n.attrs.controls" :loop="n.attrs.loop" :name="n.attrs.name" :poster="n.attrs.poster"
-			 :src="n.attrs.source[ctrl[i]||0]" :data-i="i" :data-id="n.attrs.id" data-source="audio" @error.native="error"
-			 @play.native="play" />
-			<!--链接-->
-			<view v-else-if="n.name=='a'" :id="n.attrs.id" :class="'_a '+(n.attrs.class||'')" hover-class="_hover" :style="n.attrs.style"
-			 :data-attrs="n.attrs" @tap.stop="linkpress">
-				<trees class="_span" c="_span" :nodes="n.children" />
-			</view>
-			<!--广告-->
-			<!--<ad v-else-if="n.name=='ad'" :class="n.attrs.class" :style="n.attrs.style" :unit-id="n.attrs['unit-id']" :appid="n.attrs.appid" :apid="n.attrs.apid" :type="n.attrs.type" :adpid="n.attrs.adpid" data-source="ad" @error="error" />-->
-			<!--列表-->
-			<view v-else-if="n.name=='li'" :id="n.attrs.id" :class="n.attrs.class" :style="(n.attrs.style||'')+';display:flex;flex-direction:row'">
-				<view v-if="n.type=='ol'" class="_ol-bef">{{n.num}}</view>
-				<view v-else class="_ul-bef">
-					<view v-if="n.floor%3==0" class="_ul-p1">█</view>
-					<view v-else-if="n.floor%3==2" class="_ul-p2" />
-					<view v-else class="_ul-p1" style="border-radius:50%">█</view>
-				</view>
-				<trees class="_li" c="_li" :nodes="n.children" :lazyLoad="lazyLoad" :loading="loading" />
-			</view>
-			<!--表格-->
-			<view v-else-if="n.name=='table'&&n.c&&n.flag" :id="n.attrs.id" :class="n.attrs.class" :style="(n.attrs.style||'')+';display:grid'">
-				<trees v-for="(cell,n) in n.children" v-bind:key="n" :class="cell.attrs.class" :c="cell.attrs.class" :style="cell.attrs.style"
-				 :s="cell.attrs.style" :nodes="cell.children" />
-			</view>
-			<view v-else-if="n.name=='table'&&n.c" :id="n.attrs.id" :class="n.attrs.class" :style="(n.attrs.style||'')+';display:table'">
-				<view v-for="(tbody, o) in n.children" v-bind:key="o" :class="tbody.attrs.class" :style="(tbody.attrs.style||'')+(tbody.name[0]=='t'?';display:table-'+(tbody.name=='tr'?'row':'row-group'):'')">
-					<view v-for="(tr, p) in tbody.children" v-bind:key="p" :class="tr.attrs.class" :style="(tr.attrs.style||'')+(tr.name[0]=='t'?';display:table-'+(tr.name=='tr'?'row':'cell'):'')">
-						<trees v-if="tr.name=='td'" :nodes="tr.children" />
-						<trees v-else v-for="(td, q) in tr.children" v-bind:key="q" :class="td.attrs.class" :c="td.attrs.class" :style="(td.attrs.style||'')+(td.name[0]=='t'?';display:table-'+(td.name=='tr'?'row':'cell'):'')"
-						 :s="(td.attrs.style||'')+(td.name[0]=='t'?';display:table-'+(td.name=='tr'?'row':'cell'):'')" :nodes="td.children" />
-					</view>
-				</view>
-			</view>
-			<!--#ifdef APP-PLUS-->
-			<iframe v-else-if="n.name=='iframe'" :style="n.attrs.style" :allowfullscreen="n.attrs.allowfullscreen" :frameborder="n.attrs.frameborder"
-			 :width="n.attrs.width" :height="n.attrs.height" :src="n.attrs.src" />
-			<embed v-else-if="n.name=='embed'" :style="n.attrs.style" :width="n.attrs.width" :height="n.attrs.height" :src="n.attrs.src" />
-			<!--#endif-->
-			<!--富文本-->
-			<!--#ifdef MP-WEIXIN || MP-QQ || APP-PLUS-->
-			<rich-text v-else-if="handler.use(n)" :id="n.attrs.id" :class="'_p __'+n.name" :nodes="[n]" />
-			<!--#endif-->
-			<!--#ifndef MP-WEIXIN || MP-QQ || APP-PLUS-->
-			<rich-text v-else-if="!n.c" :id="n.attrs.id" :nodes="[n]" style="display:inline" />
-			<!--#endif-->
-			<trees v-else :class="(n.attrs.id||'')+' _'+n.name+' '+(n.attrs.class||'')" :c="(n.attrs.id||'')+' _'+n.name+' '+(n.attrs.class||'')"
-			 :style="n.attrs.style" :s="n.attrs.style" :nodes="n.children" :lazyLoad="lazyLoad" :loading="loading" />
-		</block>
-	</view>
-</template>
-<script module="handler" lang="wxs" src="./handler.wxs"></script>
-<script>
-	global.Parser = {};
-	import trees from './trees'
-	const errorImg = require('../libs/config.js').errorImg;
-	export default {
-		components: {
-			trees
-		},
-		name: 'trees',
-		data() {
-			return {
-				ctrl: [],
-				placeholder: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="225"/>',
-				errorImg,
-				loadVideo: typeof plus == 'undefined',
-				// #ifndef MP-ALIPAY
-				c: '',
-				s: ''
-				// #endif
-			}
-		},
-		props: {
-			nodes: Array,
-			lazyLoad: Boolean,
-			loading: String,
-			// #ifdef MP-ALIPAY
-			c: String,
-			s: String
-			// #endif
-		},
-		mounted() {
-			for (this.top = this.$parent; this.top.$options.name != 'parser'; this.top = this.top.$parent);
-			this.init();
-		},
-		// #ifdef APP-PLUS
-		beforeDestroy() {
-			this.observer && this.observer.disconnect();
-		},
-		// #endif
-		methods: {
-			init() {
-				for (var i = this.nodes.length, n; n = this.nodes[--i];) {
-					if (n.name == 'img') {
-						this.top.imgList.setItem(n.attrs.i, n.attrs['original-src'] || n.attrs.src);
-						// #ifdef APP-PLUS
-						if (this.lazyLoad && !this.observer) {
-							this.observer = uni.createIntersectionObserver(this).relativeToViewport({
-								top: 500,
-								bottom: 500
-							});
-							setTimeout(() => {
-								this.observer.observe('._img', res => {
-									if (res.intersectionRatio) {
-										for (var j = this.nodes.length; j--;)
-											if (this.nodes[j].name == 'img')
-												this.$set(this.ctrl, j, 1);
-										this.observer.disconnect();
-									}
-								})
-							}, 0)
-						}
-						// #endif
-					} else if (n.name == 'video' || n.name == 'audio') {
-						var ctx;
-						if (n.name == 'video') {
-							ctx = uni.createVideoContext(n.attrs.id
-								// #ifndef MP-BAIDU
-								, this
-								// #endif
-							);
-						} else if (this.$refs[n.attrs.id])
-							ctx = this.$refs[n.attrs.id][0];
-						if (ctx) {
-							ctx.id = n.attrs.id;
-							this.top.videoContexts.push(ctx);
-						}
-					}
-				}
-				// #ifdef APP-PLUS
-				// APP 上避免 video 错位需要延时渲染
-				setTimeout(() => {
-					this.loadVideo = true;
-				}, 1000)
-				// #endif
-			},
-			play(e) {
-				var contexts = this.top.videoContexts;
-				if (contexts.length > 1 && this.top.autopause)
-					for (var i = contexts.length; i--;)
-						if (contexts[i].id != e.currentTarget.dataset.id)
-							contexts[i].pause();
-			},
-			imgtap(e) {
-				var attrs = e.currentTarget.dataset.attrs;
-				if (!attrs.ignore) {
-					var preview = true,
-						data = {
-							id: e.target.id,
-							src: attrs.src,
-							ignore: () => preview = false
-						};
-					global.Parser.onImgtap && global.Parser.onImgtap(data);
-					this.top.$emit('imgtap', data);
-					if (preview) {
-						var urls = this.top.imgList,
-							current = urls[attrs.i] ? parseInt(attrs.i) : (urls = [attrs.src], 0);
-						uni.previewImage({
-							current,
-							urls
-						})
-					}
-				}
-			},
-			loadImg(e) {
-				var i = e.currentTarget.dataset.i;
-				if (this.lazyLoad && !this.ctrl[i]) {
-					// #ifdef QUICKAPP-WEBVIEW
-					this.$set(this.ctrl, i, 0);
-					this.$nextTick(function() {
-						// #endif
-						// #ifndef APP-PLUS
-						this.$set(this.ctrl, i, 1);
-						// #endif
-						// #ifdef QUICKAPP-WEBVIEW
-					})
-					// #endif
-				} else if (this.loading && this.ctrl[i] != 2) {
-					// #ifdef QUICKAPP-WEBVIEW
-					this.$set(this.ctrl, i, 0);
-					this.$nextTick(function() {
-						// #endif
-						this.$set(this.ctrl, i, 2);
-						// #ifdef QUICKAPP-WEBVIEW
-					})
-					// #endif
-				}
-			},
-			linkpress(e) {
-				var jump = true,
-					attrs = e.currentTarget.dataset.attrs;
-				attrs.ignore = () => jump = false;
-				global.Parser.onLinkpress && global.Parser.onLinkpress(attrs);
-				this.top.$emit('linkpress', attrs);
-				if (jump) {
-					// #ifdef MP
-					if (attrs['app-id']) {
-						return uni.navigateToMiniProgram({
-							appId: attrs['app-id'],
-							path: attrs.path
-						})
-					}
-					// #endif
-					if (attrs.href) {
-						if (attrs.href[0] == '#') {
-							if (this.top.useAnchor)
-								this.top.navigateTo({
-									id: attrs.href.substring(1)
-								})
-						} else if (attrs.href.indexOf('http') == 0 || attrs.href.indexOf('//') == 0) {
-							// #ifdef APP-PLUS
-							plus.runtime.openWeb(attrs.href);
-							// #endif
-							// #ifndef APP-PLUS
-							uni.setClipboardData({
-								data: attrs.href,
-								success: () =>
-									uni.showToast({
-										title: '链接已复制'
-									})
-							})
-							// #endif
-						} else
-							uni.navigateTo({
-								url: attrs.href,
-								fail() {
-									uni.switchTab({
-										url: attrs.href,
-									})
-								}
-							})
-					}
-				}
-			},
-			error(e) {
-				var target = e.currentTarget,
-					source = target.dataset.source,
-					i = target.dataset.i;
-				if (source == 'video' || source == 'audio') {
-					// 加载其他 source
-					var index = this.ctrl[i] ? this.ctrl[i].i + 1 : 1;
-					if (index < this.nodes[i].attrs.source.length)
-						this.$set(this.ctrl, i, index);
-					if (e.detail.__args__)
-						e.detail = e.detail.__args__[0];
-				} else if (errorImg && source == 'img') {
-					this.top.imgList.setItem(target.dataset.index, errorImg);
-					this.$set(this.ctrl, i, 3);
-				}
-				this.top && this.top.$emit('error', {
-					source,
-					target,
-					errMsg: e.detail.errMsg
-				});
-			},
-			_loadVideo(e) {
-				this.$set(this.ctrl, e.target.dataset.i, 0);
-			}
-		}
-	}
-</script>
-
-<style>
-	/* 在这里引入自定义样式 */
-
-	/* 链接和图片效果 */
-	._a {
-		display: inline;
-		padding: 1.5px 0 1.5px 0;
-		color: #366092;
-		word-break: break-all;
-	}
-
-	._hover {
-		text-decoration: underline;
-		opacity: 0.7;
-	}
-
-	._img {
-		display: inline-block;
-		max-width: 100%;
-		overflow: hidden;
-	}
-
-	/* #ifdef MP-WEIXIN */
-	:host {
-		display: inline;
-	}
-
-	/* #endif */
-
-	/* #ifndef MP-ALIPAY || APP-PLUS */
-	.interlayer {
-		display: inherit;
-		flex-direction: inherit;
-		flex-wrap: inherit;
-		align-content: inherit;
-		align-items: inherit;
-		justify-content: inherit;
-		width: 100%;
-		white-space: inherit;
-	}
-
-	/* #endif */
-
-	._b,
-	._strong {
-		font-weight: bold;
-	}
-
-	/* #ifndef MP-ALIPAY */
-	._blockquote,
-	._div,
-	._p,
-	._ol,
-	._ul,
-	._li {
-		display: block;
-	}
-
-	/* #endif */
-
-	._code {
-		font-family: monospace;
-	}
-
-	._del {
-		text-decoration: line-through;
-	}
-
-	._em,
-	._i {
-		font-style: italic;
-	}
-
-	._h1 {
-		font-size: 2em;
-	}
-
-	._h2 {
-		font-size: 1.5em;
-	}
-
-	._h3 {
-		font-size: 1.17em;
-	}
-
-	._h5 {
-		font-size: 0.83em;
-	}
-
-	._h6 {
-		font-size: 0.67em;
-	}
-
-	._h1,
-	._h2,
-	._h3,
-	._h4,
-	._h5,
-	._h6 {
-		display: block;
-		font-weight: bold;
-	}
-
-	._image {
-		display: block;
-		width: 100%;
-		height: 360px;
-		margin-top: -360px;
-		opacity: 0;
-	}
-
-	._ins {
-		text-decoration: underline;
-	}
-
-	._li {
-		flex: 1;
-		width: 0;
-	}
-
-	._ol-bef {
-		width: 36px;
-		margin-right: 5px;
-		text-align: right;
-	}
-
-	._ul-bef {
-		display: block;
-		margin: 0 12px 0 23px;
-		line-height: normal;
-	}
-
-	._ol-bef,
-	._ul-bef {
-		flex: none;
-		user-select: none;
-	}
-
-	._ul-p1 {
-		display: inline-block;
-		width: 0.3em;
-		height: 0.3em;
-		overflow: hidden;
-		line-height: 0.3em;
-	}
-
-	._ul-p2 {
-		display: inline-block;
-		width: 0.23em;
-		height: 0.23em;
-		border: 0.05em solid black;
-		border-radius: 50%;
-	}
-
-	._q::before {
-		content: '"';
-	}
-
-	._q::after {
-		content: '"';
-	}
-
-	._sub {
-		font-size: smaller;
-		vertical-align: sub;
-	}
-
-	._sup {
-		font-size: smaller;
-		vertical-align: super;
-	}
-
-	/* #ifdef MP-ALIPAY || APP-PLUS || QUICKAPP-WEBVIEW */
-	._abbr,
-	._b,
-	._code,
-	._del,
-	._em,
-	._i,
-	._ins,
-	._label,
-	._q,
-	._span,
-	._strong,
-	._sub,
-	._sup {
-		display: inline;
-	}
-
-	/* #endif */
-
-	/* #ifdef MP-WEIXIN || MP-QQ */
-	.__bdo,
-	.__bdi,
-	.__ruby,
-	.__rt {
-		display: inline-block;
-	}
-
-	/* #endif */
-	._video {
-		position: relative;
-		display: inline-block;
-		width: 300px;
-		height: 225px;
-		background-color: black;
-	}
-
-	._video::after {
-		position: absolute;
-		top: 50%;
-		left: 50%;
-		margin: -15px 0 0 -15px;
-		content: '';
-		border-color: transparent transparent transparent white;
-		border-style: solid;
-		border-width: 15px 0 15px 30px;
-	}
-</style>

+ 0 - 127
components/uni-popup/image-txt-popup.vue

@@ -1,127 +0,0 @@
-<template>
-	<view class="image-txt-wrap">
-		<image :src="captchaBase" class="image" @click="getCode"></image>
-		<text class="tip-txt">* 点击图片即可切换验证码</text>
-		<input v-model="captcha" @input="inpChange" class="item-inp" name="captcha" type="text" maxlength="4" placeholder="请输入上方的图形验证码" />
-		<button :type="btnType" size="mini" class="popup-button-yz" @click="verify">验证</button>
-	</view>
-</template>
-
-<script>
-	import { getCaptcha, memberCaptcha } from '@/api/user.js'
-	export default{
-		name: 'ImageTxtPopup',
-		props: {
-			changeImg: {
-				type: Boolean,
-				default: false
-			},
-			//  applyImageTxt申请试用   forgetImageTxt忘记密码
-			type: {
-				type: String,
-				default: ''
-			},
-		},
-		watch: {
-			changeImg(newV, oldV){
-				if(newV === true){
-					this.getCode()
-				}
-			}
-		},
-		data(){
-			return{
-				captchaBase: '',  //  图片验证码base64
-				captcha: '',  //  图文验证码
-				nowRandomCode: '',  // 当前随机码
-				btnType: 'default',  //  验证按钮type
-			}
-		},
-		created() {
-			this.getCode()
-		},
-		methods: {
-			//  获取验证码
-			getCode(){
-			  const _this = this
-			  //  6位随机数
-			  this.nowRandomCode = Math.random().toString().slice(-6)
-			  let portAddress = ''
-			  if(_this.type == 'applyImageTxt'){  //  申请试用  获取图片验证码
-				  portAddress = getCaptcha
-			  }else if(_this.type == 'forgetImageTxt'){  //  忘记密码  获取图片验证码
-				  portAddress = memberCaptcha
-			  }
-			  portAddress(this.nowRandomCode).then(res => {
-			    //  获取图片路径
-			    _this.captchaBase = 'data:image/png;base64,' + res.data
-			    // 显示图文验证码弹框
-			    _this.captcha = ''  //  清空图文输入内容
-			  })
-			},
-			//  验证码输入监听
-			inpChange(){
-				if(this.captcha.length == 4){
-					this.btnType = 'primary'
-				}else{
-					this.btnType = 'default'
-				}
-			},
-			//  验证
-			verify(){
-				if(!this.captcha){
-					uni.showToast({icon: 'none',title: '请输入上方的图形验证码'})
-					return
-				}else{
-					if(this.captcha.length != 4){
-						uni.showToast({icon: 'none',title: '请输入4位图形验证码'})
-						return
-					}
-					this.$emit('captchaImg', this.captcha, this.nowRandomCode)
-				}
-			},
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.image-txt-wrap{
-		line-height: 1.8;
-		.tip-txt{
-			display: block;
-			font-size: 24upx;
-			color: #999;
-			margin-bottom: 40upx;
-			text-align: center;
-		}
-		.item-inp{
-			background-color: #fff;
-			border: 2upx solid #dcdee2;
-			border-radius: 8upx;
-			color: #666;
-			display: inline-block;
-			font-size: 24upx;
-			height: 64upx;
-			line-height: 1.5;
-			padding: 8upx 14upx;
-			width: 100%;
-			box-sizing: border-box;
-		}
-		.image{
-			max-width: 100%;
-			width: 400upx;
-			height: 160upx;
-			margin: 30upx auto 20upx;
-			display: block;
-			img{
-				max-width: 100%;
-			}
-		}
-		.popup-button-yz{
-			display: block;
-			margin: 40upx auto 50upx;
-			width: 30%;
-			line-height: 2.8;
-		}
-	}
-</style>

+ 0 - 22
components/uni-popup/message.js

@@ -1,22 +0,0 @@
-export default {
-	created() {
-		if (this.type === 'message') {
-			// 不显示遮罩
-			this.maskShow = false 
-			// 获取子组件对象
-			this.childrenMsg = null
-		}
-	},
-	methods: {
-		customOpen() {
-			if (this.childrenMsg) {
-				this.childrenMsg.open()
-			}
-		},
-		customClose() {
-			if (this.childrenMsg) {
-				this.childrenMsg.close()
-			}
-		}
-	}
-}

+ 0 - 96
components/uni-popup/popup-con.vue

@@ -1,96 +0,0 @@
-<template>
-	<view class="popup-con">
-		<text class="popup-header">{{title}}</text>
-		<view class="popup-content">
-			<image-txt-popup :type="type" :changeImg="changeImg" @captchaImg="captchaImg"></image-txt-popup>
-		</view>
-		<view class="popup-footer">
-			<text class="popup-button" v-for="(item, index) in popBtn" :key="index" :style="{ color: item.color }">{{item.name}}</text>
-		</view>
-	</view>
-</template>
-
-<script>
-	import imageTxtPopup from '@/components/uni-popup/image-txt-popup.vue'
-	export default{
-		name: 'PopupCon',
-		props: {
-			//  applyImageTxt申请试用   forgetImageTxt忘记密码
-			type: {
-				type: String,
-				default: ''
-			},
-			title: {
-				type: String,
-				default: '标题'
-			},
-			//  操作按钮
-			popBtn: {
-				type: Array,
-				default: function (){
-				  return []
-				}
-			},
-			changeImg: {
-				type: Boolean,
-				default: false
-			}
-		},
-		components: {
-			imageTxtPopup
-		},
-		data(){
-			return{}
-		},
-		methods: {
-			captchaImg(captcha, nowRandomCode){
-				this.$emit('captchaImg', captcha, nowRandomCode)
-			}
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.popup-con{
-		box-sizing: border-box;
-		position: absolute;
-		top: 50%;
-		left: 50%;
-		transform: translate(-50%, -50%);
-		box-shadow: 0 8upx 24upx rgba(0,0,0,.15);
-		display: flex;
-		flex-direction: column;
-		padding: 30upx;
-		width: 600upx;
-		background-color: #fff;
-		border-radius: 20upx;
-		.popup-header{
-			margin-bottom: 20upx;
-			text-align: center;
-			font-weight: 700;
-			font-size: 32upx;
-			color: #333;
-			line-height: 1.8;
-		}
-		.popup-content{
-			font-size: 28upx;
-			color: #666;
-		}
-		.popup-footer{
-			display: flex;
-			flex-direction: row;
-			margin-top: 40upx;
-			.popup-button{
-				flex: 1;
-				text-align: center;
-				font-size: 28upx;
-				color: #3b4144;
-				line-height: 1.8;
-			}
-			.popup-confirm{
-				color: #57a3f3;
-			}
-		}
-	}
-	
-</style>

+ 0 - 25
components/uni-popup/popup.js

@@ -1,25 +0,0 @@
-import message from './message.js';
-// 定义 type 类型:弹出类型:top/bottom/center
-const config = {
-	// 顶部弹出
-	top:'top',
-	// 底部弹出
-	bottom:'bottom',
-	// 居中弹出
-	center:'center',
-	// 消息提示
-	message:'top',
-	// 对话框
-	dialog:'center',
-	// 分享
-	share:'bottom',
-}
-
-export default {
-	data(){
-		return {
-			config:config
-		}
-	},
-	mixins: [message],
-}

+ 0 - 243
components/uni-popup/uni-popup-dialog.vue

@@ -1,243 +0,0 @@
-<template>
-	<view class="uni-popup-dialog">
-		<view class="uni-dialog-title">
-			<text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{title}}</text>
-		</view>
-		<view class="uni-dialog-content">
-			<text class="uni-dialog-content-text" v-if="mode === 'base'">{{content}}</text>
-			<input v-else class="uni-dialog-input" v-model="val" type="text" :placeholder="placeholder" :focus="focus" >
-		</view>
-		<view class="uni-dialog-button-group">
-			<view class="uni-dialog-button" @click="close">
-				<text class="uni-dialog-button-text">取消</text>
-			</view>
-			<view class="uni-dialog-button uni-border-left" @click="onOk">
-				<text class="uni-dialog-button-text uni-button-color">确定</text>
-			</view>
-		</view>
-
-	</view>
-</template>
-
-<script>
-	/**
-	 * PopUp 弹出层-对话框样式
-	 * @description 弹出层-对话框样式
-	 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
-	 * @property {String} value input 模式下的默认值
-	 * @property {String} placeholder input 模式下输入提示
-	 * @property {String} type = [success|warning|info|error] 主题样式
-	 *  @value success 成功
-	 * 	@value warning 提示
-	 * 	@value info 消息
-	 * 	@value error 错误
-	 * @property {String} mode = [base|input] 模式、
-	 * 	@value base 基础对话框
-	 * 	@value input 可输入对话框
-	 * @property {String} content 对话框内容
-	 * @property {Boolean} beforeClose 是否拦截取消事件
-	 * @event {Function} confirm 点击确认按钮触发
-	 * @event {Function} close 点击取消按钮触发
-	 */
-
-	export default {
-		name: "uniPopupDialog",
-		props: {
-			value: {
-				type: [String, Number],
-				default: ''
-			},
-			placeholder: {
-				type: [String, Number],
-				default: '请输入内容'
-			},
-			/**
-			 * 对话框主题 success/warning/info/error	  默认 success
-			 */
-			type: {
-				type: String,
-				default: 'error'
-			},
-			/**
-			 * 对话框模式 base/input
-			 */
-			mode: {
-				type: String,
-				default: 'base'
-			},
-			/**
-			 * 对话框标题
-			 */
-			title: {
-				type: String,
-				default: '提示'
-			},
-			/**
-			 * 对话框内容
-			 */
-			content: {
-				type: String,
-				default: ''
-			},
-			/**
-			 * 拦截取消事件 ,如果拦截取消事件,必须监听close事件,执行 done()
-			 */
-			beforeClose: {
-				type: Boolean,
-				default: false
-			}
-		},
-		data() {
-			return {
-				dialogType: 'error',
-				focus: false,
-				val: ""
-			}
-		},
-		inject: ['popup'],
-		watch: {
-			type(val) {
-				this.dialogType = val
-			},
-			mode(val) {
-				if (val === 'input') {
-					this.dialogType = 'info'
-				}
-			},
-			value(val) {
-				this.val = val
-			}
-		},
-		created() {
-			// 对话框遮罩不可点击
-			this.popup.mkclick = false
-			if (this.mode === 'input') {
-				this.dialogType = 'info'
-				this.val = this.value
-			} else {
-				this.dialogType = this.type
-			}
-		},
-		mounted() {
-			this.focus = true
-		},
-		methods: {
-			/**
-			 * 点击确认按钮
-			 */
-			onOk() {
-				this.$emit('confirm', () => {
-					this.popup.close()
-					if (this.mode === 'input') this.val = this.value
-				}, this.mode === 'input' ? this.val : '')
-			},
-			/**
-			 * 点击取消按钮
-			 */
-			close() {
-				if (this.beforeClose) {
-					this.$emit('close', () => {
-						this.popup.close()
-					})
-					return
-				}
-				this.popup.close()
-			}
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.uni-popup-dialog {
-		width: 300px;
-		border-radius: 15px;
-		background-color: #fff;
-	}
-
-	.uni-dialog-title {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		justify-content: center;
-		padding-top: 15px;
-		padding-bottom: 5px;
-	}
-
-	.uni-dialog-title-text {
-		font-size: 16px;
-		font-weight: 500;
-	}
-
-	.uni-dialog-content {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		justify-content: center;
-		align-items: center;
-		padding: 5px 15px 15px 15px;
-	}
-
-	.uni-dialog-content-text {
-		font-size: 14px;
-		color: #6e6e6e;
-	}
-
-	.uni-dialog-button-group {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		border-top-color: #f5f5f5;
-		border-top-style: solid;
-		border-top-width: 1px;
-	}
-
-	.uni-dialog-button {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-
-		flex: 1;
-		flex-direction: row;
-		justify-content: center;
-		align-items: center;
-		height: 45px;
-	}
-
-	.uni-border-left {
-		border-left-color: #f0f0f0;
-		border-left-style: solid;
-		border-left-width: 1px;
-	}
-
-	.uni-dialog-button-text {
-		font-size: 14px;
-	}
-
-	.uni-button-color {
-		color: $uni-color-primary;
-	}
-
-	.uni-dialog-input {
-		flex: 1;
-		font-size: 14px;
-	}
-
-	.uni-popup__success {
-		color: $uni-color-success;
-	}
-
-	.uni-popup__warn {
-		color: $uni-color-warning;
-	}
-
-	.uni-popup__error {
-		color: $uni-color-error;
-	}
-
-	.uni-popup__info {
-		color: #909399;
-	}
-</style>

+ 0 - 116
components/uni-popup/uni-popup-message.vue

@@ -1,116 +0,0 @@
-<template>
-	<view class="uni-popup-message" :class="'uni-popup__'+[type]">
-		<text class="uni-popup-message-text" :class="'uni-popup__'+[type]+'-text'">{{message}}</text>
-	</view>
-</template>
-
-<script>
-	
-	/**
-	 * PopUp 弹出层-消息提示
-	 * @description 弹出层-消息提示
-	 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
-	 * @property {String} type = [success|warning|info|error] 主题样式
-	 *  @value success 成功
-	 * 	@value warning 提示
-	 * 	@value info 消息
-	 * 	@value error 错误
-	 * @property {String} message 消息提示文字
-	 * @property {String} duration 显示时间,设置为 0 则不会自动关闭
-	 */
-	
-	export default {
-		name: 'UniPopupMessage',
-		props: {
-			/**
-			 * 主题 success/warning/info/error	  默认 success
-			 */
-			type: {
-				type: String,
-				default: 'success'
-			},
-			/**
-			 * 消息文字
-			 */
-			message: {
-				type: String,
-				default: ''
-			},
-			/**
-			 * 显示时间,设置为 0 则不会自动关闭
-			 */
-			duration: {
-				type: Number,
-				default: 3000
-			}
-		},
-		inject: ['popup'],
-		data() {
-			return {}
-		},
-		created() {
-			this.popup.childrenMsg = this
-		},
-		methods: {
-			open() {
-				if (this.duration === 0) return
-				clearTimeout(this.popuptimer)
-				this.popuptimer = setTimeout(() => {
-					this.popup.close()
-				}, this.duration)
-			},
-			close() {
-				clearTimeout(this.popuptimer)
-			}
-		}
-	}
-</script>
-<style lang="scss" scoped>
-	.uni-popup-message {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		background-color: #e1f3d8;
-		padding: 10px 15px;
-		border-color: #eee;
-		border-style: solid;
-		border-width: 1px;
-	}
-	.uni-popup-message-text {
-		font-size: 14px;
-		padding: 0;
-	}
-
-	.uni-popup__success {
-		background-color: #e1f3d8;
-	}
-
-	.uni-popup__success-text {
-		color: #67C23A;
-	}
-
-	.uni-popup__warn {
-		background-color: #faecd8;
-	}
-
-	.uni-popup__warn-text {
-		color: #E6A23C;
-	}
-
-	.uni-popup__error {
-		background-color: #fde2e2;
-	}
-
-	.uni-popup__error-text {
-		color: #F56C6C;
-	}
-
-	.uni-popup__info {
-		background-color: #F2F6FC;
-	}
-
-	.uni-popup__info-text {
-		color: #909399;
-	}
-</style>

+ 0 - 165
components/uni-popup/uni-popup-share.vue

@@ -1,165 +0,0 @@
-<template>
-	<view class="uni-popup-share">
-		<view class="uni-share-title"><text class="uni-share-title-text">{{title}}</text></view>
-		<view class="uni-share-content">
-			<view class="uni-share-content-box">
-				<view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)">
-					<image class="uni-share-image" :src="item.icon" mode="aspectFill"></image>
-					<text class="uni-share-text">{{item.text}}</text>
-				</view>
-
-			</view>
-		</view>
-		<view class="uni-share-button-box">
-			<button class="uni-share-button" @click="close">取消</button>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		name: 'UniPopupShare',
-		props: {
-			title: {
-				type: String,
-				default: '分享到'
-			}
-		},
-		inject: ['popup'],
-		data() {
-			return {
-				bottomData: [{
-						text: '微信',
-						icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-2.png',
-						name: 'wx'
-					},
-					{
-						text: '支付宝',
-						icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-8.png',
-						name: 'wx'
-					},
-					{
-						text: 'QQ',
-						icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/gird-3.png',
-						name: 'qq'
-					},
-					{
-						text: '新浪',
-						icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-1.png',
-						name: 'sina'
-					},
-					{
-						text: '百度',
-						icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-7.png',
-						name: 'copy'
-					},
-					{
-						text: '其他',
-						icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-5.png',
-						name: 'more'
-					}
-				]
-			}
-		},
-		created() {},
-		methods: {
-			/**
-			 * 选择内容
-			 */
-			select(item, index) {
-				this.$emit('select', {
-					item,
-					index
-				}, () => {
-					this.popup.close()
-				})
-			},
-			/**
-			 * 关闭窗口
-			 */
-			close() {
-				this.popup.close()
-			}
-		}
-	}
-</script>
-<style lang="scss" scoped>
-	.uni-popup-share {
-		background-color: #fff;
-	}
-	.uni-share-title {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		align-items: center;
-		justify-content: center;
-		height: 40px;
-	}
-	.uni-share-title-text {
-		font-size: 14px;
-		color: #666;
-	}
-	.uni-share-content {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		justify-content: center;
-		padding-top: 10px;
-	}
-	
-	.uni-share-content-box {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		flex-wrap: wrap;
-		width: 360px;
-	}
-	
-	.uni-share-content-item {
-		width: 90px;
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: column;
-		justify-content: center;
-		padding: 10px 0;
-		align-items: center;
-	}
-	
-	.uni-share-content-item:active {
-		background-color: #f5f5f5;
-	}
-	
-	.uni-share-image {
-		width: 30px;
-		height: 30px;
-	}
-	
-	.uni-share-text {
-		margin-top: 10px;
-		font-size: 14px;
-		color: #3B4144;
-	}
-	
-	.uni-share-button-box {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		padding: 10px 15px;
-	}
-	
-	.uni-share-button {
-		flex: 1;
-		border-radius: 50px;
-		color: #666;
-		font-size: 16px;
-	}
-	
-	.uni-share-button::after {
-		border-radius: 50px;
-	}
-</style>

+ 0 - 294
components/uni-popup/uni-popup.vue

@@ -1,294 +0,0 @@
-<template>
-	<view v-if="showPopup" class="uni-popup" :class="[popupstyle]" @touchmove.stop.prevent="clear">
-		<uni-transition v-if="maskShow" :mode-class="['fade']" :styles="maskClass" :duration="duration" :show="showTrans"
-		 @click="onTap" />
-		<uni-transition :mode-class="ani" :styles="transClass" :duration="duration" :show="showTrans" @click="onTap">
-			<view class="uni-popup__wrapper-box" @click.stop="clear">
-				<slot />
-			</view>
-		</uni-transition>
-	</view>
-</template>
-
-<script>
-	import uniTransition from '../uni-transition/uni-transition.vue'
-	import popup from './popup.js'
-	/**
-	 * PopUp 弹出层
-	 * @description 弹出层组件,为了解决遮罩弹层的问题
-	 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
-	 * @property {String} type = [top|center|bottom] 弹出方式
-	 * 	@value top 顶部弹出
-	 * 	@value center 中间弹出
-	 * 	@value bottom 底部弹出
-	 * 	@value message 消息提示
-	 * 	@value dialog 对话框
-	 * 	@value share 底部分享示例
-	 * @property {Boolean} animation = [ture|false] 是否开启动画
-	 * @property {Boolean} maskClick = [ture|false] 蒙版点击是否关闭弹窗
-	 * @event {Function} change 打开关闭弹窗触发,e={show: false}
-	 */
-
-	export default {
-		name: 'UniPopup',
-		components: {
-			uniTransition
-		},
-		props: {
-			// 开启动画
-			animation: {
-				type: Boolean,
-				default: true
-			},
-			// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
-			// message: 消息提示 ; dialog : 对话框
-			type: {
-				type: String,
-				default: 'center'
-			},
-			// maskClick
-			maskClick: {
-				type: Boolean,
-				default: true
-			}
-		},
-		provide() {
-			return {
-				popup: this
-			}
-		},
-		mixins: [popup],
-		watch: {
-			/**
-			 * 监听type类型
-			 */
-			type: {
-				handler: function(newVal) {
-					this[this.config[newVal]]()
-				},
-				immediate: true
-			},
-			/**
-			 * 监听遮罩是否可点击
-			 * @param {Object} val
-			 */
-			maskClick(val) {
-				this.mkclick = val
-			}
-		},
-		data() {
-			return {
-				duration: 300,
-				ani: [],
-				showPopup: false,
-				showTrans: false,
-				maskClass: {
-					'position': 'fixed',
-					'bottom': 0,
-					'top': 0,
-					'left': 0,
-					'right': 0,
-					'backgroundColor': 'rgba(0, 0, 0, 0.4)'
-				},
-				transClass: {
-					'position': 'fixed',
-					'left': 0,
-					'right': 0,
-				},
-				maskShow: true,
-				mkclick: true,
-				popupstyle: 'top'
-			}
-		},
-		created() {
-			this.mkclick = this.maskClick
-			if (this.animation) {
-				this.duration = 300
-			} else {
-				this.duration = 0
-			}
-		},
-		methods: {
-			clear(e) {
-				// TODO nvue 取消冒泡
-				e.stopPropagation()
-			},
-			open() {
-				this.showPopup = true
-				this.$nextTick(() => {
-					new Promise(resolve => {
-						clearTimeout(this.timer)
-						this.timer = setTimeout(() => {
-							this.showTrans = true
-							// fixed by mehaotian 兼容 app 端
-							this.$nextTick(() => {
-								resolve();
-							})
-						}, 50);
-					}).then(res => {
-						// 自定义打开事件
-						clearTimeout(this.msgtimer)
-						this.msgtimer = setTimeout(() => {
-							this.customOpen && this.customOpen()
-						}, 100)
-						this.$emit('change', {
-							show: true,
-							type: this.type
-						})
-					})
-				})
-			},
-			close(type) {
-				this.showTrans = false
-				this.$nextTick(() => {
-					this.$emit('change', {
-						show: false,
-						type: this.type
-					})
-					clearTimeout(this.timer)
-					// 自定义关闭事件
-					this.customOpen && this.customClose()
-					this.timer = setTimeout(() => {
-						this.showPopup = false
-					}, 300)
-				})
-			},
-			onTap() {
-				if (!this.mkclick) return
-				this.close()
-			},
-			/**
-			 * 顶部弹出样式处理
-			 */
-			top() {
-				this.popupstyle = 'top'
-				this.ani = ['slide-top']
-				this.transClass = {
-					'position': 'fixed',
-					'left': 0,
-					'right': 0,
-				}
-			},
-			/**
-			 * 底部弹出样式处理
-			 */
-			bottom() {
-				this.popupstyle = 'bottom'
-				this.ani = ['slide-bottom']
-				this.transClass = {
-					'position': 'fixed',
-					'left': 0,
-					'right': 0,
-					'bottom': 0
-				}
-			},
-			/**
-			 * 中间弹出样式处理
-			 */
-			center() {
-				this.popupstyle = 'center'
-				this.ani = ['zoom-out', 'fade']
-				this.transClass = {
-					'position': 'fixed',
-					/* #ifndef APP-NVUE */
-					'display': 'flex',
-					'flexDirection': 'column',
-					/* #endif */
-					'bottom': 0,
-					'left': 0,
-					'right': 0,
-					'top': 0,
-					'justifyContent': 'center',
-					'alignItems': 'center'
-				}
-			}
-		}
-	}
-</script>
-<style lang="scss" scoped>
-	.uni-popup {
-		position: fixed;
-		/* #ifndef APP-NVUE */
-		z-index: 99;
-		/* #endif */
-	}
-
-	.uni-popup__mask {
-		position: absolute;
-		top: 0;
-		bottom: 0;
-		left: 0;
-		right: 0;
-		background-color: $uni-bg-color-mask;
-		opacity: 0;
-	}
-
-	.mask-ani {
-		transition-property: opacity;
-		transition-duration: 0.2s;
-	}
-
-	.uni-top-mask {
-		opacity: 1;
-	}
-
-	.uni-bottom-mask {
-		opacity: 1;
-	}
-
-	.uni-center-mask {
-		opacity: 1;
-	}
-
-	.uni-popup__wrapper {
-		/* #ifndef APP-NVUE */
-		display: block;
-		/* #endif */
-		position: absolute;
-	}
-
-	.top {
-		/* #ifdef H5 */
-		top: var(--window-top);
-		/* #endif */
-		/* #ifndef H5 */
-		top: 0;
-		/* #endif */
-	}
-
-	.bottom {
-		bottom: 0;
-	}
-
-	.uni-popup__wrapper-box {
-		/* #ifndef APP-NVUE */
-		display: block;
-		/* #endif */
-		position: relative;
-		/* iphonex 等安全区设置,底部安全区适配 */
-		/* #ifndef APP-NVUE */
-		padding-bottom: constant(safe-area-inset-bottom);
-		padding-bottom: env(safe-area-inset-bottom);
-		/* #endif */
-	}
-
-	.content-ani {
-		// transition: transform 0.3s;
-		transition-property: transform, opacity;
-		transition-duration: 0.2s;
-	}
-
-
-	.uni-top-content {
-		transform: translateY(0);
-	}
-
-	.uni-bottom-content {
-		transform: translateY(0);
-	}
-
-	.uni-center-content {
-		transform: scale(1);
-		opacity: 1;
-	}
-</style>

+ 0 - 279
components/uni-transition/uni-transition.vue

@@ -1,279 +0,0 @@
-<template>
-	<view v-if="isShow" ref="ani" class="uni-transition" :class="[ani.in]" :style="'transform:' +transform+';'+stylesObject"
-	 @click="change">
-		 <slot></slot>
-	</view>
-</template>
-
-<script>
-	// #ifdef APP-NVUE
-	const animation = uni.requireNativePlugin('animation');
-	// #endif
-	/**
-	 * Transition 过渡动画
-	 * @description 简单过渡动画组件
-	 * @tutorial https://ext.dcloud.net.cn/plugin?id=985
-	 * @property {Boolean} show = [false|true] 控制组件显示或隐藏
-     * @property {Array} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
-     *  @value fade 渐隐渐出过渡
-     *  @value slide-top 由上至下过渡
-     *  @value slide-right 由右至左过渡
-     *  @value slide-bottom 由下至上过渡
-     *  @value slide-left 由左至右过渡
-     *  @value zoom-in 由小到大过渡
-     *  @value zoom-out 由大到小过渡
-	 * @property {Number} duration 过渡动画持续时间
-	 * @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
-	 */
-	export default {
-		name: 'uniTransition',
-		props: {
-			show: {
-				type: Boolean,
-				default: false
-			},
-			modeClass: {
-				type: Array,
-				default () {
-					return []
-				}
-			},
-			duration: {
-				type: Number,
-				default: 300
-			},
-			styles: {
-				type: Object,
-				default () {
-					return {}
-				}
-			}
-		},
-		data() {
-			return {
-				isShow: false,
-				transform: '',
-				ani: { in: '',
-					active: ''
-				}
-			};
-		},
-		watch: {
-			show: {
-				handler(newVal) {
-					if (newVal) {
-						this.open()
-					} else {
-						this.close()
-					}
-				},
-				immediate: true
-			}
-		},
-		computed: {
-			stylesObject() {
-				let styles = {
-					...this.styles,
-					'transition-duration': this.duration / 1000 + 's'
-				}
-				let transfrom = ''
-				for (let i in styles) {
-					let line = this.toLine(i)
-					transfrom += line + ':' + styles[i] + ';'
-				}
-				return transfrom
-			}
-		},
-		created() {
-			// this.timer = null
-			// this.nextTick = (time = 50) => new Promise(resolve => {
-			// 	clearTimeout(this.timer)
-			// 	this.timer = setTimeout(resolve, time)
-			// 	return this.timer
-			// });
-		},
-		methods: {
-			change() {
-				this.$emit('click', {
-					detail: this.isShow
-				})
-			},
-			open() {
-				clearTimeout(this.timer)
-				this.isShow = true
-				this.transform = ''
-				this.ani.in = ''
-				for (let i in this.getTranfrom(false)) {
-					if (i === 'opacity') {
-						this.ani.in = 'fade-in'
-					} else {
-						this.transform += `${this.getTranfrom(false)[i]} `
-					}
-				}
-				this.$nextTick(() => {
-					setTimeout(() => {
-						this._animation(true)
-					}, 50)
-				})
-
-			},
-			close(type) {
-				clearTimeout(this.timer)
-				this._animation(false)
-			},
-			_animation(type) {
-				let styles = this.getTranfrom(type)
-				// #ifdef APP-NVUE
-				if(!this.$refs['ani']) return
-				animation.transition(this.$refs['ani'].ref, {
-					styles,
-					duration: this.duration, //ms
-					timingFunction: 'ease',
-					needLayout: false,
-					delay: 0 //ms
-				}, () => {
-					if (!type) {
-						this.isShow = false
-					}
-					this.$emit('change', {
-						detail: this.isShow
-					})
-				})
-				// #endif
-				// #ifndef APP-NVUE
-				this.transform = ''
-				for (let i in styles) {
-					if (i === 'opacity') {
-						this.ani.in = `fade-${type?'out':'in'}`
-					} else {
-						this.transform += `${styles[i]} `
-					}
-				}
-				this.timer = setTimeout(() => {
-					if (!type) {
-						this.isShow = false
-					}
-					this.$emit('change', {
-						detail: this.isShow
-					})
-
-				}, this.duration)
-				// #endif
-
-			},
-			getTranfrom(type) {
-				let styles = {
-					transform: ''
-				}
-				this.modeClass.forEach((mode) => {
-					switch (mode) {
-						case 'fade':
-							styles.opacity = type ? 1 : 0
-							break;
-						case 'slide-top':
-							styles.transform += `translateY(${type?'0':'-100%'}) `
-							break;
-						case 'slide-right':
-							styles.transform += `translateX(${type?'0':'100%'}) `
-							break;
-						case 'slide-bottom':
-							styles.transform += `translateY(${type?'0':'100%'}) `
-							break;
-						case 'slide-left':
-							styles.transform += `translateX(${type?'0':'-100%'}) `
-							break;
-						case 'zoom-in':
-							styles.transform += `scale(${type?1:0.8}) `
-							break;
-						case 'zoom-out':
-							styles.transform += `scale(${type?1:1.2}) `
-							break;
-					}
-				})
-				return styles
-			},
-			_modeClassArr(type) {
-				let mode = this.modeClass
-				if (typeof(mode) !== "string") {
-					let modestr = ''
-					mode.forEach((item) => {
-						modestr += (item + '-' + type + ',')
-					})
-					return modestr.substr(0, modestr.length - 1)
-				} else {
-					return mode + '-' + type
-				}
-			},
-			// getEl(el) {
-			// 	console.log(el || el.ref || null);
-			// 	return el || el.ref || null
-			// },
-			toLine(name) {
-				return name.replace(/([A-Z])/g, "-$1").toLowerCase();
-			}
-		}
-	}
-</script>
-
-<style>
-	.uni-transition {
-		transition-timing-function: ease;
-		transition-duration: 0.3s;
-		transition-property: transform, opacity;
-	}
-
-	.fade-in {
-		opacity: 0;
-	}
-
-	.fade-active {
-		opacity: 1;
-	}
-
-	.slide-top-in {
-		/* transition-property: transform, opacity; */
-		transform: translateY(-100%);
-	}
-
-	.slide-top-active {
-		transform: translateY(0);
-		/* opacity: 1; */
-	}
-
-	.slide-right-in {
-		transform: translateX(100%);
-	}
-
-	.slide-right-active {
-		transform: translateX(0);
-	}
-
-	.slide-bottom-in {
-		transform: translateY(100%);
-	}
-
-	.slide-bottom-active {
-		transform: translateY(0);
-	}
-
-	.slide-left-in {
-		transform: translateX(-100%);
-	}
-
-	.slide-left-active {
-		transform: translateX(0);
-		opacity: 1;
-	}
-
-	.zoom-in-in {
-		transform: scale(0.8);
-	}
-
-	.zoom-out-active {
-		transform: scale(1);
-	}
-
-	.zoom-out-in {
-		transform: scale(1.2);
-	}
-</style>

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
components/w-picker/areadata/areadata.js


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+ 0 - 44
js_sdk/dc-market/market.js

@@ -1,44 +0,0 @@
-
-/**
- * 打开应用市场
- * @param {Object} options 应用市场参数
- *     ios: appstore中应用的id标识,应用的页面地址(如https://apps.apple.com/cn/app/id682211190)的id后面的数字
- *     android: 应用的包名,apk文件中AndroidManifest.xml中的package字段值
- *     key: 为设置id标识或包名时,打开搜索页面使用的关键词
- * 如果未设置参数,则打开应用市场的搜索页面
- */
-function openMarket(options){
-	try{
-	var os = plus.os.name;
-	options = options||{};
-	if('iOS' == os){
-		if(options.ios&&''!=options.ios){
-			//itms-apps://itunes.apple.com/app/id682211190
-			plus.runtime.openURL('itms-apps://itunes.apple.com/app/id'+options.ios);
-		}else{
-			//itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/search?q=helloh5
-			plus.runtime.openURL('itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/search?q='+options.key);
-		}
-	}else{
-		if(options.android&&''!=options.android){
-			//io.dcloud.helloh5
-			var uri = plus.android.invoke('android.net.Uri', 'parse', 'market://details?id='+options.android);
-			var Intent = plus.android.importClass('android.content.Intent');
-			var intent = new Intent(Intent.ACTION_VIEW, uri);
-			intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-			var main = plus.android.runtimeMainActivity();
-			main.startActivity(intent);
-		}else{
-			//market://search?q=helloh5
-			plus.runtime.openURL('market://search?q='+options.key);
-		}
-	}
-	}catch(e){
-		console.error('error @openMarket!!');
-	}
-}
-
-
-module.exports = {
-	open: openMarket
-}

+ 7 - 7
pages/index/map.vue

@@ -1,12 +1,12 @@
 <template>
 	<view class="map-container">
 		<map
-			id="map" 
-			:latitude="latitude" 
-			:longitude="longitude" 
-			scale="12" 
-			show-compass 
-			show-location 
+			id="map"
+			:latitude="latitude"
+			:longitude="longitude"
+			scale="12"
+			show-compass
+			show-location
 			:markers="markers"
 			:polyline="polyline"
 			style="width: 100%; height:100%;">
@@ -77,7 +77,7 @@
 								{latitude: null, longitude: null}
 							],
 							width: 4,
-							color: '#'+(~~(Math.random()*(1<<24))).toString(16)
+							color: '#07c160'
 						})
 						if(index==0){
 							_this.polyline[index].points[0].latitude = _this.latitude

+ 0 - 1
pages/login/pwLogin.vue

@@ -24,7 +24,6 @@
 </template>
 
 <script>
-import market from "@/js_sdk/dc-market/market.js"
 import { checkVersionToLoadUpdate, setStorageForAppVersion,clzConfirm } from '@/libs/tools'
 import { isvalidPhone } from '@/libs/validate.js';
 import { loginPhone } from '@/api/user.js';

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