Просмотр исходного кода

Merge branch 'developer' of http://git.caimei365.com/caimei-repository/caimei-applets-caimei into developer

yuwenjun1997 2 лет назад
Родитель
Сommit
ccad9c3d91

+ 0 - 22
common/css/common.scss

@@ -229,28 +229,6 @@ button::after{
 		padding: 0 10rpx;
 	}
 }
-/*富文本样式调整*/
-.product-rich-text{
-	rich-text.h4,rich-text.p,rich-text.h2{
-		padding: 0 24rpx;
-	}
-}
-.rich-text-temp {
-	rich-text.div, rich-text.h4, rich-text.p {
-		line-height: 58rpx;
-	}
-	rich-text.h4, rich-text.p {
-		font-size: 30rpx;
-	}
-	rich-text.div {
-		margin-bottom: 30rpx;
-		font-size: 28rpx;
-	}
-	rich-text.img {
-		width: 100%;
-		height: auto;
-	}
-}
 .form-item {
 	display: flex;
 	color: $text-color;

+ 20 - 41
components/cm-module/listTemplate/richTextTemplate.vue

@@ -1,50 +1,29 @@
 <template>
-	<view class="content">
-		<mp-html :content="html" :tag-style="tagStyle" />
-		<!-- <parser :html="html" :img-mode="widthFix"></parser> -->
-	</view>
+	<view class="content"> <mp-html :content="html" :tag-style="tagStyle" /> </view>
 </template>
 
 <script>
-	import parser from '@/components/jyf-Parser/index'
-	var self
-	export default{
-		components: {
-		   parser,
-		   // uPars
-		},
-		data() {
-			return{
-				serverUrl: '',
-				type: '',
-				html:'',
-				tagStyle:{
-					div:'line-height: 58rpx;margin-bottom: 10rpx;font-size: 28rpx;',
-					h4:'line-height: 54rpx;font-size: 30rpx;color:#666666;',
-					h3:'line-height: 54rpx;font-size: 30rpx;color:#666666;',
-					h2:'line-height: 54rpx;font-size: 30rpx;color:#666666;',
-					p:'line-height: 50rpx;font-size: 30rpx;color:#666666;',
-					a:'line-height: 50rpx;font-size: 30rpx;color:#666666;',
-					span:'line-height: 50rpx;font-size: 30rpx;color:#666666;',
-					img:'width: 100%;height: auto;'
-				}
-			}
-		},
-		created(){
-			self = this		
-		},
-		methods:{
-
+import { articleTagStyle } from '@/plugins/mp-html/config.js'
+export default {
+	data() {
+		return {
+			serverUrl: '',
+			type: '',
+			html: '',
+			tagStyle: articleTagStyle
 		}
-	}
+	},
+	created() {},
+	methods: {}
+}
 </script>
 
 <style lang="scss">
-	page{
-		background: #FFFFFF;
-		border-top: 1px solid #EBEBEB;
-	}
-	.content {
-		padding: 40rpx 24rpx;
-	}
+page {
+	background: #ffffff;
+	border-top: 1px solid #ebebeb;
+}
+.content {
+	padding: 40rpx 24rpx;
+}
 </style>

+ 0 - 158
components/jyf-Parser/CssHandler.js

@@ -1,158 +0,0 @@
-//CssHandler.js
-// #ifdef MP-WEIXIN
-const CanIUse = require('./api.js').versionHigherThan('2.7.1');
-// #endif
-function CssHandler(style, tagStyle) {
-	this._style = new CssTokenizer(style, tagStyle).parse();
-}
-CssHandler.prototype.match = function(name, attrs) {
-	let matched = this._style[name] ? (this._style[name] + ';') : '';
-	if (attrs.id)
-		matched += (this._style['#' + attrs.id] ? (this._style['#' + attrs.id] + ';') : '');
-	if (attrs.class)
-		for (var Class of attrs.class.split(' '))
-			matched += (this._style['.' + Class] ? (this._style['.' + Class] + ';') : '');
-	return matched;
-}
-
-function CssTokenizer(style = '', tagStyle = {}) {
-	this.res = this.initClass(tagStyle);
-	this._state = "SPACE";
-	this._buffer = style;
-	this._sectionStart = 0;
-	this._index = 0;
-	this._name = '';
-	this._content = '';
-	this._list = [];
-	this._comma = false;
-}
-CssTokenizer.prototype.initClass = function(tagStyle) {
-	let initStyle = JSON.parse(JSON.stringify(tagStyle));
-	initStyle.a = "display:inline;color:#366092;word-break:break-all;" + (initStyle.a || "");
-	initStyle.address = "font-style:italic;" + (initStyle.address || "");
-	initStyle.blockquote = initStyle.blockquote ||
-		'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px;';
-	initStyle.center = 'text-align:center;' + (initStyle.center || "");
-	initStyle.cite = "font-style:italic;" + (initStyle.cite || "");
-	initStyle.code = initStyle.code ||
-		'padding:0 1px 0 1px;margin-left:2px;margin-right:2px;background-color:#f8f8f8;border:1px solid #cccccc;border-radius:3px;';
-	initStyle.dd = "margin-left:40px;" + (initStyle.dd || "");
-	initStyle.img = "max-width:100%;" + (initStyle.img || "");
-	initStyle.mark = "display:inline;background-color:yellow;" + (initStyle.mark || "");
-	initStyle.pre = "overflow:scroll;" + (initStyle.pre || 'background-color:#f6f8fa;padding:5px;border-radius:5px;');
-	initStyle.s = "display:inline;text-decoration:line-through;" + (initStyle.s || "");
-	initStyle.u = "display:inline;text-decoration:underline;" + (initStyle.u || "");
-	// #ifdef MP-WEIXIN
-	//低版本兼容
-	if (!CanIUse) {
-		// #endif
-		initStyle.big = "display:inline;font-size:1.2em;" + (initStyle.big || "");
-		initStyle.small = "display:inline;font-size:0.8em;" + (initStyle.small || "");
-		initStyle.pre = "font-family:monospace;white-space:pre;" + initStyle.pre;
-		// #ifdef MP-WEIXIN
-	}
-	// #endif
-	return initStyle;
-}
-CssTokenizer.prototype.SPACE = function(c) {
-	if (/[a-zA-Z.#]/.test(c)) {
-		this._sectionStart = this._index;
-		this._state = "InName";
-	} else if (c == '@') this._state = "Ignore1";
-	else if (c == '/') this._state = "BeforeComment";
-};
-CssTokenizer.prototype.BeforeComment = function(c) {
-	if (c == '*') this._state = "InComment";
-	else {
-		this._index--;
-		this._state = "SPACE";
-	}
-};
-CssTokenizer.prototype.InComment = function(c) {
-	if (c == '*') this._state = "AfterComment";
-};
-CssTokenizer.prototype.AfterComment = function(c) {
-	if (c == '/') this._state = "SPACE";
-	else {
-		this._index--;
-		this._state = "InComment"
-	}
-};
-CssTokenizer.prototype.InName = function(c) {
-	if (c == '{') {
-		this._list.push(this._buffer.substring(this._sectionStart, this._index))
-		this._sectionStart = this._index + 1;
-		this._state = "InContent";
-	} else if (c == ',') {
-		this._list.push(this._buffer.substring(this._sectionStart, this._index));
-		this._sectionStart = this._index + 1;
-		this._comma = true;
-	} else if ((c == '.' || c == '#') && !this._comma) {
-		this._buffer = this._buffer.splice(this._index, 1, ' ');
-	} else if (/\s/.test(c)) {
-		this._name = this._buffer.substring(this._sectionStart, this._index);
-		this._state = "NameSpace";
-	} else if (/[>:\[]/.test(c)) {
-		if (this._list.length) this._state = "IgnoreName";
-		else this._state = "Ignore1";
-	} else this._comma = false;
-};
-CssTokenizer.prototype.NameSpace = function(c) {
-	if (c == '{') {
-		this._list.push(this._name);
-		this._sectionStart = this._index + 1;
-		this._state = "InContent";
-	} else if (c == ',') {
-		this._comma = true;
-		this._list.push(this._name);
-		this._sectionStart = this._index + 1;
-		this._state = "InName"
-	} else if (/\S/.test(c)) {
-		if (this._comma) {
-			this._sectionStart = this._index;
-			this._index--;
-			this._state = "InName";
-		} else if (this._list.length) this._state = "IgnoreName";
-		else this._state = "Ignore1"
-	}
-};
-CssTokenizer.prototype.InContent = function(c) {
-	if (c == '}') {
-		this._content = this._buffer.substring(this._sectionStart, this._index);
-		for (let item of this._list)
-			this.res[item] = (this.res[item] || '') + ";" + this._content;
-		this._list = [];
-		this._comma = false;
-		this._state = "SPACE";
-	}
-};
-CssTokenizer.prototype.IgnoreName = function(c) {
-	if (c == ',') {
-		this._sectionStart = this._index + 1;
-		this._state = "InName";
-	} else if (c == '{') {
-		this._sectionStart = this._index + 1;
-		this._state = "InContent";
-	}
-}
-CssTokenizer.prototype.Ignore1 = function(c) {
-	if (c == ';') {
-		this._state = "SPACE";
-		this._sectionStart = this._index + 1;
-	} else if (c == '{') this._state = "Ignore2";
-};
-CssTokenizer.prototype.Ignore2 = function(c) {
-	if (c == '}') {
-		this._state = "SPACE";
-		this._sectionStart = this._index + 1;
-	} else if (c == '{') this._state = "Ignore3";
-};
-CssTokenizer.prototype.Ignore3 = function(c) {
-	if (c == '}') this._state = "Ignore2";
-};
-CssTokenizer.prototype.parse = function() {
-	for (; this._index < this._buffer.length; this._index++)
-		this[this._state](this._buffer[this._index]);
-	return this.res;
-};
-module.exports = CssHandler;

+ 0 - 411
components/jyf-Parser/DomHandler.js

@@ -1,411 +0,0 @@
-//DomHandler.js
-var emoji; // 使用emoji补丁包时将此句改为 const emoji = require('./emoji.js');
-const CssHandler = require('./CssHandler.js');
-// #ifdef MP-WEIXIN
-const CanIUse = require('./api.js').versionHigherThan('2.7.1');
-// #endif
-const trustTag = {
-	a: 0,
-	abbr: 1,
-	ad: 0,
-	audio: 0,
-	b: 1,
-	blockquote: 1,
-	br: 0,
-	code: 1,
-	col: 0,
-	colgroup: 0,
-	dd: 1,
-	del: 1,
-	dl: 1,
-	dt: 1,
-	div: 1,
-	em: 1,
-	fieldset: 0,
-	font: 1,
-	h1: 0,
-	h2: 0,
-	h3: 0,
-	h4: 0,
-	h5: 0,
-	h6: 0,
-	hr: 0,
-	i: 1,
-	img: 1,
-	ins: 1,
-	label: 1,
-	legend: 0,
-	li: 0,
-	ol: 0,
-	p: 1,
-	q: 1,
-	source: 0,
-	span: 1,
-	strong: 1,
-	sub: 0,
-	sup: 0,
-	table: 0,
-	tbody: 0,
-	td: 0,
-	tfoot: 0,
-	th: 0,
-	thead: 0,
-	tr: 0,
-	u: 1,
-	ul: 0,
-	video: 1
-};
-const blockTag = {
-	address: true,
-	article: true,
-	aside: true,
-	body: true,
-	center: true,
-	cite: true,
-	footer: true,
-	header: true,
-	html: true,
-	nav: true,
-	pre: true,
-	section: true
-};
-const ignoreTag = {
-	area: true,
-	base: true,
-	basefont: true,
-	canvas: true,
-	circle: true,
-	command: true,
-	ellipse: true,
-	embed: true,
-	frame: true,
-	head: true,
-	iframe: true,
-	input: true,
-	isindex: true,
-	keygen: true,
-	line: true,
-	link: true,
-	map: true,
-	meta: true,
-	param: true,
-	path: true,
-	polygon: true,
-	polyline: true,
-	rect: true,
-	script: true,
-	stop: true,
-	textarea: true,
-	title: true,
-	track: true,
-	use: true,
-	wbr: true
-};
-// #ifdef MP-WEIXIN
-if (CanIUse) {
-	trustTag.bdi = 0;
-	trustTag.bdo = 0;
-	trustTag.caption = 0;
-	trustTag.rt = 0;
-	trustTag.ruby = 0;
-	ignoreTag.rp = true;
-	trustTag.big = 1;
-	trustTag.small = 1;
-	trustTag.pre = 0;
-	delete blockTag.pre;
-} else blockTag.caption = true;
-// #endif
-
-function randomId() {
-	var res = "";
-	for (var i = 0; i < 5; i++) {
-		let rand = parseInt(Math.random() * 52);
-		if (rand < 26)
-			res = res + String.fromCharCode(65 + rand);
-		else
-			res = res + String.fromCharCode(71 + rand);
-	}
-	return res;
-}
-
-function DomHandler(style, options) {
-	this.imgList = [];
-	this.imgIndex = 0;
-	this.nodes = [];
-	this.title = "";
-	this._CssHandler = new CssHandler(style, options.tagStyle);
-	this._tagStack = [];
-	this._videoNum = 0;
-	// #ifdef MP-BAIDU || MP-TOUTIAO || H5
-	this._imgMode = options.imgMode;
-	// #endif
-	this._whiteSpace = false;
-	this._domain = options.domain;
-	this._protocol = /:\/\//.test(options.domain) ? options.domain.split(/:\/\//)[0] : "http";
-	this._useAnchor = options.useAnchor;
-}
-DomHandler.prototype._addDomElement = function(element) {
-	if (element.name == 'pre' || (element.attrs && /white-space\s*:\s*pre/.test(element.attrs.style))) {
-		this._whiteSpace = true;
-		element.pre = true;
-	}
-	let parent = this._tagStack[this._tagStack.length - 1];
-	let siblings = parent ? parent.children : this.nodes;
-	siblings.push(element);
-};
-DomHandler.prototype._bubbling = function() {
-	for (let i = this._tagStack.length - 1; i >= 0; i--) {
-		if (trustTag[this._tagStack[i].name])
-			this._tagStack[i].continue = true;
-		else
-			return this._tagStack[i].name;
-	}
-}
-DomHandler.prototype.onopentag = function(name, attrs) {
-	let element = {
-		children: []
-	};
-	let matched = this._CssHandler.match(name, attrs, element);
-	//处理属性
-	switch (name) {
-		case 'div':
-		case 'p':
-			if (attrs.align) {
-				attrs.style += (';text-align:' + attrs.align);
-				delete attrs.align;
-			}
-			break;
-		case 'img':
-			if (attrs.width) {
-				attrs.style = 'width:' + attrs.width + (/[0-9]/.test(attrs.width[attrs.width.length - 1]) ? 'px' : '') + ';' +
-					attrs.style;
-				delete attrs.width;
-			}
-			if (attrs['data-src']) {
-				attrs.src = attrs.src || attrs['data-src'];
-				delete attrs['data-src'];
-			}
-			// #ifdef MP-BAIDU || MP-TOUTIAO || H5
-			if (this._imgMode == "widthFix") attrs.style += ";height:auto !important;";
-			// #endif
-			if (!attrs.hasOwnProperty('ignore') && attrs.src) {
-				if (this._bubbling() == 'a') {
-					attrs.ignore = "true"; // 图片在链接中不可预览
-					break;
-				}
-				var url = attrs.src;
-				// #ifdef MP-WEIXIN || MP-QQ || MP-BAIDU || MP-TOUTIAO
-				// 去重,至多重试10次
-				for (let i = 0; this.imgList.indexOf(url) != -1 && i < 10; i++) {
-					// 网络链接
-					if (/^http/.test(url)) {
-						url = url.replace(/^(https*):\/\/([\S]+?)\//, function() {
-							var domain = "";
-							for (var c of arguments[2]) {
-								if (/[a-zA-Z]/.test(c))
-									domain += (Math.random() >= 0.5 ? c.toUpperCase() : c);
-								else domain += c;
-							}
-							return (arguments[1] + '://' + domain + '/');
-						})
-					}
-					// base64
-					else if (/base64/.test(url)) {
-						url = url.replace(/^data:(image\/\S+);base64,/, function() {
-							var head = "";
-							for (var c of arguments[1]) {
-								if (/[a-zA-Z]/.test(c))
-									head += (Math.random() >= 0.5 ? c.toUpperCase() : c);
-								else head += c;
-							}
-							return ('data:' + head + ';base64,');
-						})
-					} else break;
-				}
-				// #endif
-				element.current = this.imgList.length;
-				this.imgList.push(url);
-			} else
-				attrs.ignore = "true";
-			if (this._domain && attrs.src[0] == '/') {
-				if (attrs.src[1] == '/') attrs.src = this._protocol + ":" + attrs.src;
-				else attrs.src = this._domain + attrs.src;
-			}
-			break;
-		case 'font':
-			name = 'span';
-			if (attrs.color) {
-				attrs.style += (';color:' + attrs.color);
-				delete attrs.color;
-			}
-			if (attrs.face) {
-				attrs.style += (";font-family:" + attrs.face);
-				delete attrs.face;
-			}
-			if (attrs.size) {
-				var size = parseInt(attrs.size);
-				if (size < 1) size = 1;
-				else if (size > 7) size = 7;
-				let map = [10, 13, 16, 18, 24, 32, 48];
-				attrs.style += (";font-size:" + map[size - 1] + "px");
-				delete attrs.size;
-			}
-			break;
-		case 'a':
-		case 'ad':
-			this._bubbling();
-			break;
-		case 'video':
-		case 'audio':
-			attrs.loop = attrs.hasOwnProperty('loop');
-			attrs.controls = attrs.hasOwnProperty('controls');
-			attrs.autoplay = attrs.hasOwnProperty('autoplay');
-			if (name == 'video') {
-				attrs.muted = attrs.hasOwnProperty('muted');
-				if (attrs.width) {
-					attrs.style = 'width:' + parseFloat(attrs.width) + 'px;' + attrs.style;
-					delete attrs.width;
-				}
-				if (attrs.height) {
-					attrs.style = 'height:' + parseFloat(attrs.height) + 'px;' + attrs.style;
-					delete attrs.height;
-				}
-			}
-			attrs.id = randomId() + (name == 'video' ? ++this._videoNum : '');
-			attrs.source = [];
-			if (attrs.src) attrs.source.push(attrs.src);
-			if (!attrs.controls && !attrs.autoplay)
-				console.warn('存在没有controls属性的' + name + '标签,可能导致无法播放', attrs);
-			this._bubbling();
-			break;
-		case 'source':
-			let parent = this._tagStack[this._tagStack.length - 1];
-			if (parent && (parent.name == 'video' || parent.name == 'audio')) {
-				parent.attrs.source.push(attrs.src);
-				if (!parent.attrs.src) parent.attrs.src = attrs.src;
-			}
-			this._tagStack.push(element);
-			return;
-	}
-	if(this._useAnchor && attrs.id) this._bubbling();
-	attrs.style = matched + attrs.style;
-	if (blockTag[name]) name = 'div';
-	else if (!trustTag.hasOwnProperty(name)) name = 'span';
-	element.name = name;
-	element.attrs = attrs;
-	this._addDomElement(element);
-	this._tagStack.push(element);
-};
-DomHandler.prototype.ontext = function(data) {
-	if (!this._whiteSpace) {
-		if (!/\S/.test(data))
-			return;
-		data = data.replace(/\s+/g, " ");
-	}
-	// #ifndef MP-WEIXIN || MP-QQ || APP-PLUS || H5
-	let entities = {
-		lt: "<",
-		gt: ">",
-		nbsp: "\u00A0",
-		ensp: "\u2002",
-		emsp: "\u2003",
-		amp: "&",
-		apos: "'",
-		quot: '"',
-		ndash: "–",
-		mdash: "—",
-		middot: "·",
-		lsquo: "‘",
-		rsquo: "’",
-		ldquo: "“",
-		rdquo: "”",
-		bull: "•",
-		hellip: "…",
-		permil: "‰",
-		copy: "©",
-		reg: "®",
-		trade: "™",
-		times: "×",
-		divide: "÷",
-		cent: "¢",
-		pound: "£",
-		yen: "¥",
-		euro: "€",
-		sect: "§"
-	};
-	data = data.replace(/&(\S{1,8}?);/g, function() {
-		if (entities[arguments[1]]) return entities[arguments[1]];
-		return "";
-	});
-	// #endif
-	let element = {
-		type: 'text'
-	};
-	// #ifdef MP-WEIXIN || MP-QQ || H5 || APP-PLUS
-	data = data.replace(/&nbsp;/g, '&#xA0;'); // 解决连续&nbsp;失效问题
-	if (/&#*((?!sp|lt|gt).){2,8};/.test(data)) element.decode = true;
-	// #endif
-	if (emoji) data = emoji.parseEmoji(data);
-	element.text = data;
-	this._addDomElement(element);
-};
-DomHandler.prototype.onclosetag = function(name) {
-	let element = this._tagStack.pop();
-	let parent = this._tagStack.length ? this._tagStack[this._tagStack.length - 1].children : this.nodes;
-	if (ignoreTag[name]) {
-		if (name == 'title') {
-			try {
-				this.title = element.children[0].text;
-			} catch (e) {}
-		}
-		parent.pop();
-	}
-	// 设置表格的边框
-	if (name == 'table') {
-		if (element.attrs.border)
-			element.attrs.style += (";border:" + element.attrs.border + "px solid gray;");
-		if (element.attrs.hasOwnProperty("cellspacing"))
-			element.attrs.style += (";border-spacing:" + element.attrs.cellspacing + "px");
-
-		function setBorder(node) {
-			if (node.type == 'text') return;
-			if (node.name == 'th' || node.name == 'td') {
-				if (element.attrs.border)
-					node.attrs.style += ";border:" + element.attrs.border + "px solid gray;";
-				if (element.attrs.hasOwnProperty("cellpadding"))
-					node.attrs.style += ";padding:" + element.attrs.cellpadding + "px";
-			}
-			for (var child of node.children)
-				setBorder(child);
-		}
-		if (element.attrs.border || element.attrs.hasOwnProperty("cellpadding")) {
-			for (var child of element.children)
-				setBorder(child);
-		}
-	}
-	// 合并一些不必要的层,减小节点深度
-	if (element.children.length == 1 && element.name == 'div') {
-		let child = element.children[0];
-		if (child.name == 'div' && !(/padding/.test(element.attrs.style)) && !(/margin/.test(element.attrs.style) &&
-				/margin/.test(child.attrs.style)) && !(/display/.test(element.attrs.style)) && !(/display/.test(child.attrs.style)) &&
-			!(element.attrs.id && child.attrs.id) && !(element.attrs.class && child.attrs.class)) {
-			if (/padding/.test(child.attrs.style))
-				child.attrs.style = ";box-sizing:border-box;" + child.attrs.style;
-			child.attrs.style = element.attrs.style + ";" + child.attrs.style;
-			child.attrs.id = (child.attrs.id || "") + (element.attrs.id || "");
-			child.attrs.class = (child.attrs.class || "") + (element.attrs.class || "");
-			parent[parent.indexOf(element)] = child;
-		}
-	}
-	if (element.pre) {
-		this._whiteSpace = false;
-		for (var ele of this._tagStack)
-			if (ele.pre)
-				this._whiteSpace = true;
-		delete element.pre;
-	}
-	// 多层样式处理 
-	if (this._CssHandler.pop)
-		this._CssHandler.pop(element);
-};
-module.exports = DomHandler;

+ 0 - 240
components/jyf-Parser/Parser.js

@@ -1,240 +0,0 @@
-//Parser.js
-const Tokenizer = require("./Tokenizer.js");
-const DomHandler = require("./DomHandler.js");
-const trustAttrs = {
-	align: true,
-	alt: true,
-	// #ifdef MP-BAIDU
-	appid: true,
-	apid: true,
-	// #endif
-	author: true,
-	autoplay: true,
-	border: true,
-	cellpadding: true,
-	cellspacing: true,
-	class: true,
-	color: true,
-	colspan: true,
-	controls: true,
-	"data-src": true,
-	dir: true,
-	face: true,
-	height: true,
-	href: true,
-	id: true,
-	ignore: true,
-	loop: true,
-	muted: true,
-	name: true,
-	poster: true,
-	rowspan: true,
-	size: true,
-	span: true,
-	src: true,
-	start: true,
-	style: true,
-	type: true,
-	// #ifdef MP-WEIXIN || MP-QQ
-	"unit-id": true,
-	// #endif
-	width: true,
-};
-// #ifdef MP-BAIDU || MP-TOUTIAO || H5
-const textTag = {
-  abbr: true,
-  b: true,
-  big: true,
-  code: true,
-  del: true,
-  em: true,
-  font: true,
-  i: true,
-  ins: true,
-  label: true,
-  mark: true,
-  q: true,
-  s: true,
-  small: true,
-  span: true,
-  strong: true,
-  sub: true,
-  sup: true,
-  u: true
-}
-const _traverse = function(nodes) {
-	for (var element of nodes) {
-		if (element.type == "text")
-			continue;
-		if (!element.continue) {
-			// #ifdef H5
-			if(textTag[element.name]){
-				element.continue = true;
-				_traverse(element.children);
-				continue;
-			}
-			// #endif
-			var res = "";
-			var style = element.attrs.style;
-			var reg = /float\s*:\s*[^;]*/i;
-			if (reg.test(style)) res += reg.exec(style)[0];
-			reg = /margin[^;]*/gi;
-			var margin = reg.exec(style);
-			while (margin) {
-				res += (';' + margin[0]);
-				margin = reg.exec(style);
-			}
-			reg = /display\s*:\s*([^;]*)/i;
-			if (reg.test(style) && reg.exec(style)[1] != "flex") res += (';' + reg.exec(style)[0]);
-			// #ifdef MP-BAIDU || MP-TOUTIAO
-			else if(textTag[element.name]) res+=";display:inline";
-			// #endif
-			else res += (";display:" + (element.name == 'img' ? 'inline-block' : 'block'));
-			reg = /flex\s*:[^;]*/i;
-			if (reg.test(style)) res += (';' + reg.exec(style)[0]);
-			reg = /[^;\s]*width[^;]*/ig;
-			var width = reg.exec(style);
-			while (width) {
-				res += (';' + width[0]);
-				width = reg.exec(style);
-			}
-			element.attrs.containStyle = res;
-			if (/[^-]width[^pev;]+/.test(";" + style))
-				element.attrs.style += ";width:100%";
-			let addMargin = "";
-			if (/margin\s*:/.test(style)) addMargin = ';margin:0';
-			else if (/margin-top/.test(style)) addMargin = ';margin-top:0';
-			else if (/margin-bottom/.test(style)) addMargin = ';margin-bottom:0';
-			element.attrs.style = element.attrs.style.replace(/margin[^;]*/gi, "");
-			element.attrs.style += addMargin;
-		} else _traverse(element.children);
-	}
-};
-// #endif
-const voidTag = {
-	area: true,
-	base: true,
-	basefont: true,
-	br: true,
-	col: true,
-	circle: true,
-	command: true,
-	ellipse: true,
-	embed: true,
-	frame: true,
-	hr: true,
-	img: true,
-	input: true,
-	isindex: true,
-	keygen: true,
-	line: true,
-	link: true,
-	meta: true,
-	param: true,
-	path: true,
-	polygon: true,
-	polyline: true,
-	rect: true,
-	source: true,
-	stop: true,
-	track: true,
-	use: true,
-	wbr: true
-};
-
-function Parser(cbs, callback) {
-	this._cbs = cbs;
-	this._callback = callback;
-	this._tagname = "";
-	this._attribname = "";
-	this._attribvalue = "";
-	this._attribs = null;
-	this._stack = [];
-	this._tokenizer = new Tokenizer(this);
-}
-Parser.prototype.ontext = function(data) {
-	this._cbs.ontext(data);
-};
-Parser.prototype.onopentagname = function(name) {
-	name = name.toLowerCase();
-	this._tagname = name;
-	this._attribs = {
-		style: ''
-	};
-	if (!voidTag[name]) this._stack.push(name);
-};
-Parser.prototype.onopentagend = function() {
-	if (this._attribs) {
-		this._cbs.onopentag(this._tagname, this._attribs);
-		this._attribs = null;
-	}
-	if (voidTag[this._tagname]) this._cbs.onclosetag(this._tagname);
-	this._tagname = "";
-};
-Parser.prototype.onclosetag = function(name) {
-	name = name.toLowerCase();
-	if (this._stack.length && !voidTag[name]) {
-		var pos = this._stack.lastIndexOf(name);
-		if (pos !== -1) {
-			pos = this._stack.length - pos;
-			while (pos--) this._cbs.onclosetag(this._stack.pop());
-		} else if (name === "p") {
-			this.onopentagname(name);
-			this._closeCurrentTag();
-		}
-	} else if (name === "br" || name === "hr" || name === "p") {
-		this.onopentagname(name);
-		this._closeCurrentTag();
-	}
-};
-Parser.prototype._closeCurrentTag = function() {
-	let name = this._tagname;
-	this.onopentagend();
-	if (this._stack[this._stack.length - 1] === name) {
-		this._cbs.onclosetag(name);
-		this._stack.pop();
-	}
-};
-Parser.prototype.onattribend = function() {
-	this._attribvalue = this._attribvalue.replace(/&quot;/g, '"');
-	if (this._attribs && trustAttrs[this._attribname]) {
-		this._attribs[this._attribname] = this._attribvalue;
-	}
-	this._attribname = "";
-	this._attribvalue = "";
-};
-Parser.prototype.onend = function() {
-	for (
-		var i = this._stack.length; i > 0; this._cbs.onclosetag(this._stack[--i])
-	);
-	this._callback({
-		'nodes': this._cbs.nodes,
-		'title': this._cbs.title,
-		'imgList': this._cbs.imgList
-	});
-};
-Parser.prototype.write = function(chunk) {
-	this._tokenizer.parse(chunk);
-};
-
-function html2nodes(data, options) {
-	return new Promise(function(resolve, reject) {
-		try {
-			let style = '';
-			data = data.replace(/<style.*?>([\s\S]*?)<\/style>/gi, function() {
-				style += arguments[1];
-				return '';
-			});
-			let handler = new DomHandler(style, options);
-			new Parser(handler, (res) => {
-				// #ifdef MP-BAIDU || MP-TOUTIAO || H5
-				_traverse(res.nodes);
-				// #endif
-				return resolve(res);
-			}).write(data);
-		} catch (err) {
-			return reject(err);
-		}
-	})
-}
-module.exports = html2nodes;

+ 0 - 218
components/jyf-Parser/Tokenizer.js

@@ -1,218 +0,0 @@
-//Tokenizer.js
-function Tokenizer(cbs) {
-	this._state = "TEXT";
-	this._buffer = "";
-	this._sectionStart = 0;
-	this._index = 0;
-	this._cbs = cbs;
-}
-Tokenizer.prototype.TEXT = function(c) {
-	var index = this._buffer.indexOf("<", this._index);
-	if (index != -1) {
-		this._index = index;
-		this._cbs.ontext(this._getSection());
-		this._state = "BeforeTag";
-		this._sectionStart = this._index;
-	} else this._index = this._buffer.length;
-};
-Tokenizer.prototype.BeforeTag = function(c) {
-	switch (c) {
-		case "/":
-			this._state = "BeforeCloseTag";
-			break;
-		case "!":
-			this._state = "BeforeDeclaration";
-			break;
-		case "?":
-			let index = this._buffer.indexOf(">", this._index);
-			if (index != -1) {
-				this._index = index;
-				this._sectionStart = this._index + 1;
-			} else this._sectionStart = this._index = this._buffer.length;
-			this._state = "TEXT";
-			break;
-		case ">":
-			this._state = "TEXT";
-			break;
-		case "<":
-			this._cbs.ontext(this._getSection());
-			this._sectionStart = this._index;
-			break;
-		default:
-			if (/\s/.test(c)) this._state = "TEXT";
-			else {
-				this._state = "InTag";
-				this._sectionStart = this._index;
-			}
-	}
-};
-Tokenizer.prototype.InTag = function(c) {
-	if (c === "/" || c === ">" || /\s/.test(c)) {
-		this._cbs.onopentagname(this._getSection());
-		this._state = "BeforeAttrsName";
-		this._index--;
-	}
-};
-Tokenizer.prototype.BeforeAttrsName = function(c) {
-	if (c === ">") {
-		this._cbs.onopentagend();
-		this._state = "TEXT";
-		this._sectionStart = this._index + 1;
-	} else if (c === "/") {
-		this._state = "InSelfCloseTag";
-	} else if (!(/\s/.test(c))) {
-		this._state = "InAttrsName";
-		this._sectionStart = this._index;
-	}
-};
-Tokenizer.prototype.InAttrsName = function(c) {
-	if (c === "=" || c === "/" || c === ">" || /\s/.test(c)) {
-		this._cbs._attribname = this._getSection().toLowerCase();
-		this._sectionStart = -1;
-		this._state = "AfterAttrsName";
-		this._index--;
-	}
-};
-Tokenizer.prototype.AfterAttrsName = function(c) {
-	if (c === "=") {
-		this._state = "BeforeAttrsValue";
-	} else if (c === "/" || c === ">") {
-		this._cbs.onattribend();
-		this._state = "BeforeAttrsName";
-		this._index--;
-	} else if (!(/\s/.test(c))) {
-		this._cbs.onattribend();
-		this._state = "InAttrsName";
-		this._sectionStart = this._index;
-	}
-};
-Tokenizer.prototype.BeforeAttrsValue = function(c) {
-	if (c === '"') {
-		this._state = "InAttrsValueDQ";
-		this._sectionStart = this._index + 1;
-	} else if (c === "'") {
-		this._state = "InAttrsValueSQ";
-		this._sectionStart = this._index + 1;
-	} else if (!(/\s/.test(c))) {
-		this._state = "InAttrsValueNQ";
-		this._sectionStart = this._index;
-		this._index--;
-	}
-};
-Tokenizer.prototype.InAttrsValueDQ = function(c) {
-	if (c === '"') {
-		this._cbs._attribvalue += this._getSection();
-		this._cbs.onattribend();
-		this._state = "BeforeAttrsName";
-	}
-};
-Tokenizer.prototype.InAttrsValueSQ = function(c) {
-	if (c === "'") {
-		this._cbs._attribvalue += this._getSection();
-		this._cbs.onattribend();
-		this._state = "BeforeAttrsName";
-	}
-};
-Tokenizer.prototype.InAttrsValueNQ = function(c) {
-	if (/\s/.test(c) || c === ">") {
-		this._cbs._attribvalue += this._getSection();
-		this._cbs.onattribend();
-		this._state = "BeforeAttrsName";
-		this._index--;
-	}
-};
-Tokenizer.prototype.BeforeCloseTag = function(c) {
-	if (/\s/.test(c));
-	else if (c === ">") {
-		this._state = "TEXT";
-	} else {
-		this._state = "InCloseTag";
-		this._sectionStart = this._index;
-	}
-};
-Tokenizer.prototype.InCloseTag = function(c) {
-	if (c === ">" || /\s/.test(c)) {
-		this._cbs.onclosetag(this._getSection());
-		this._state = "AfterCloseTag";
-		this._index--;
-	}
-};
-Tokenizer.prototype.InSelfCloseTag = function(c) {
-	if (c === ">") {
-		this._cbs.onopentagend();
-		this._state = "TEXT";
-		this._sectionStart = this._index + 1;
-	} else if (!(/\s/.test(c))) {
-		this._state = "BeforeAttrsName";
-		this._index--;
-	}
-};
-Tokenizer.prototype.AfterCloseTag = function(c) {
-	if (c === ">") {
-		this._state = "TEXT";
-		this._sectionStart = this._index + 1;
-	}
-};
-Tokenizer.prototype.BeforeDeclaration = function(c) {
-	if (c == '-') this._state = "InComment";
-	else if (c == '[') this._state = "BeforeCDATA1";
-	else this._state = "InDeclaration";
-};
-Tokenizer.prototype.InDeclaration = function(c) {
-	var index = this._buffer.indexOf(">", this._index);
-	if (index != -1) {
-		this._index = index;
-		this._sectionStart = index + 1;
-	} else this._sectionStart = this._index = this._buffer.length;
-	this._state = "TEXT";
-};
-Tokenizer.prototype.InComment = function(c) {
-	let key = (c == '-' ? '-->' : '>');
-	let index = this._buffer.indexOf(key, this._index);
-	if (index != -1) {
-		this._index = index + key.length - 1;
-		this._sectionStart = this._index + 1;
-	} else this._sectionStart = this._index = this._buffer.length;
-	this._state = "TEXT";
-};
-Tokenizer.prototype.BeforeCDATA1 = function(c) {
-	if (c == 'C') this._state = "BeforeCDATA2";
-	else this._state = "InDeclaration";
-};
-Tokenizer.prototype.BeforeCDATA2 = function(c) {
-	if (c == 'D') this._state = "BeforeCDATA3";
-	else this._state = "InDeclaration";
-};
-Tokenizer.prototype.BeforeCDATA3 = function(c) {
-	if (c == 'A') this._state = "BeforeCDATA4";
-	else this._state = "InDeclaration";
-};
-Tokenizer.prototype.BeforeCDATA4 = function(c) {
-	if (c == 'T') this._state = "BeforeCDATA5";
-	else this._state = "InDeclaration";
-};
-Tokenizer.prototype.BeforeCDATA5 = function(c) {
-	if (c == 'A') this._state = "InCDATA";
-	else this._state = "InDeclaration";
-};
-Tokenizer.prototype.InCDATA = function(c) {
-	let key = (c == '[' ? ']]>' : '>');
-	let index = this._buffer.indexOf(key, this._index);
-	if (index != -1) {
-		this._index = index + key.length - 1;
-		this._sectionStart = this._index + 1;
-	} else this._sectionStart = this._index = this._buffer.length;
-	this._state = "TEXT";
-};
-Tokenizer.prototype.parse = function(chunk) {
-	this._buffer += chunk;
-	for (; this._index < this._buffer.length; this._index++)
-		this[this._state](this._buffer[this._index]);
-	if (this._state === "TEXT" && this._sectionStart !== this._index)
-		this._cbs.ontext(this._buffer.substr(this._sectionStart));
-	this._cbs.onend();
-};
-Tokenizer.prototype._getSection = function() {
-	return this._buffer.substring(this._sectionStart, this._index);
-};
-module.exports = Tokenizer;

+ 0 - 41
components/jyf-Parser/api.js

@@ -1,41 +0,0 @@
-String.prototype.splice = function(start = 0, deleteCount = 0, addStr = '') {
-	if (start < 0) start = this.length + start;
-	if (deleteCount < 0) deleteCount = 0;
-	return this.substring(0, start) + addStr + this.substring(start + deleteCount);
-}
-// #ifndef MP-ALIPAY || H5 || APP-PLUS 
-const SDKVersion = uni.getSystemInfoSync().SDKVersion;
-// #endif
-module.exports = {
-	// #ifndef MP-ALIPAY || H5 || APP-PLUS 
-	versionHigherThan(version = '') {
-		var v1 = SDKVersion.split('.');
-		var v2 = version.split('.');
-		const len = Math.max(v1.length, v2.length);
-		while (v1.length < len) {
-			v1.push('0');
-		}
-		while (v2.length < len) {
-			v2.push('0');
-		}
-		for (let i = 0; i < len; i++) {
-			const num1 = parseInt(v1[i]);
-			const num2 = parseInt(v2[i]);
-			if (num1 > num2) {
-				return true;
-			} else if (num1 < num2) {
-				return false;
-			}
-		}
-		return true;
-	},
-	// #endif
-	html2nodes(html, tagStyle) {
-		const Parser = require('./Parser.js');
-		return Parser(html, tagStyle);
-	},
-	css2object(style, tagStyle) {
-		const CssHandler = require('./CssHandler.js');
-		return new CssHandler(style, tagStyle)._style;
-	}
-}

+ 0 - 70
components/jyf-Parser/handler.sjs

@@ -1,70 +0,0 @@
-var textTag = {
-	abbr: true,
-	b: true,
-	big: true,
-	code: true,
-	del: true,
-	em: true,
-	font: true,
-	i: true,
-	ins: true,
-	label: true,
-	mark: true,
-	q: true,
-	s: true,
-	small: true,
-	span: true,
-	strong: true,
-	u: true
-}
-export default {
-	getStyle: function(style, display) {
-		var res = "";
-		var reg = getRegExp("float\s*:\s*[^;]*", "i");
-		if (reg.test(style)) res += reg.exec(style)[0];
-		reg = getRegExp("margin[^;]*", "gi");
-		var margin = reg.exec(style);
-		while (margin) {
-			res += (';' + margin[0]);
-			margin = reg.exec(style);
-		}
-		reg = getRegExp("display\s*:\s*([^;]*)", "i");
-		if (reg.test(style) && reg.exec(style)[1] != "flex") res += (';' + reg.exec(style)[0]);
-		else res += (';display:' + display);
-		reg = getRegExp("flex\s*:[^;]*", "i");
-		if (reg.test(style)) res += (';' + reg.exec(style)[0]);
-		reg = getRegExp("[^;\s]*width[^;]*", "ig");
-		var width = reg.exec(style);
-		while (width) {
-			res += (';' + width[0]);
-			width = reg.exec(style);
-		}
-		return res;
-	},
-	setImgStyle: function(item, imgMode) {
-		if (imgMode == "widthFix")
-			item.attrs.style += ";height:auto !important";
-		if (getRegExp("[^-]width[^pev;]+").test(";" + item.attrs.style))
-			item.attrs.style += ";width:100%";
-		item.attrs.style = item.attrs.style.replace(getRegExp('margin[^;]*', "gi"), "");
-		return [item];
-	},
-	setStyle: function(item) {
-		if (getRegExp("[^-]width[^pev;]+").test(";" + item.attrs.style))
-			item.attrs.style += ";width:100%";
-		if (getRegExp('margin').test(item.attrs.style)) {
-			item.attrs.style = item.attrs.style.replace(getRegExp('margin[^;]*', "gi"), "");
-			item.attrs.style += ';margin:0'
-		}
-		return [item];
-	},
-	isContinue: function(item) {
-		if (textTag[item.name])
-			return false;
-		if (!item["continue"])
-			return true;
-		else if (item.name == 'a')
-			return true;
-		return false;
-	}
-}

+ 0 - 72
components/jyf-Parser/handler.wxs

@@ -1,72 +0,0 @@
-// Parser/trees/cssHandler.wxs
-var textTag = {
-	abbr: true,
-	b: true,
-	big: true,
-	code: true,
-	del: true,
-	em: true,
-	font: true,
-	i: true,
-	ins: true,
-	label: true,
-	mark: true,
-	q: true,
-	s: true,
-	small: true,
-	span: true,
-	strong: true,
-	u: true
-}
-module.exports = {
-	getStyle: function(style, display) {
-		var res = "";
-		var reg = getRegExp("float\s*:\s*[^;]*", "i");
-		if (reg.test(style)) res += reg.exec(style)[0];
-		reg = getRegExp("margin[^;]*", "gi");
-		var margin = reg.exec(style);
-		while (margin) {
-			res += (';' + margin[0]);
-			margin = reg.exec(style);
-		}
-		reg = getRegExp("display\s*:\s*([^;]*)", "i");
-		if (reg.test(style) && reg.exec(style)[1] != "flex") res += (';' + reg.exec(style)[0]);
-		else res += (';display:' + display);
-		reg = getRegExp("flex\s*:[^;]*", "i");
-		if (reg.test(style)) res += (';' + reg.exec(style)[0]);
-		reg = getRegExp("[^;\s]*width[^;]*", "ig");
-		var width = reg.exec(style);
-		while (width) {
-			res += (';' + width[0]);
-			width = reg.exec(style);
-		}
-		return res;
-	},
-	setImgStyle: function(item, imgMode, imgLoad) {
-		if (imgMode == "widthFix")
-			item.attrs.style += ";height:auto !important";
-		if (getRegExp("[^-]width[^pev;]+").test(";" + item.attrs.style))
-			item.attrs.style += ";width:100%";
-		item.attrs.style = item.attrs.style.replace(getRegExp('margin[^;]*', "gi"), "");
-		if (!imgLoad) {
-			delete item.attrs.src;
-			item.attrs.style += ";width:5px !important;height:5px !important"
-		}
-		return [item];
-	},
-	setStyle: function(item) {
-		if (getRegExp("[^-]width[^pev;]+").test(";" + item.attrs.style))
-			item.attrs.style += ";width:100%";
-		item.attrs.style = item.attrs.style.replace(getRegExp('margin[^;]*', "gi"), "");
-		return [item];
-	},
-	isContinue: function(item) {
-		if (textTag[item.name])
-			return false;
-		if (!item["continue"])
-			return true;
-		else if (item.name == 'a')
-			return true;
-		return false;
-	}
-}

+ 0 - 405
components/jyf-Parser/index.vue

@@ -1,405 +0,0 @@
-<template>
-	<view>
-		<!--#ifdef H5-->
-		<slot v-if="!html"></slot>
-		<iframe id="contain" :style="'width:100%;'+(selectable?'user-select:text;-webkit-user-select:text':'')+(showWithAnimation?('opacity:0;'+showAnimation):'')"
-		 frameborder="0"></iframe>
-		<!--#endif-->
-		<!--#ifndef H5-->
-		<slot v-if="!(html.nodes||((html&&(html[0].name||html[0].type))?1:nodes.length))"></slot>
-		<!--#endif-->
-		<!--#ifdef MP-ALIPAY || H5-->
-		<view class="contain" :style="(showWithAnimation?'opacity:0;':'')+(selectable?'user-select:text;-webkit-user-select:text':'')"
-		 :animation="showAnimation">
-			<trees :nodes="html.nodes||((html&&(html[0].name||html[0].type))?html:nodes)" :imgMode="imgMode" />
-		</view>
-		<!--#endif-->
-		<!--#ifndef MP-ALIPAY || H5-->
-		<trees class="contain" :style="'display:block'+(showWithAnimation?'opacity:0;':'')+(selectable?'user-select:text;-webkit-user-select:text':'')"
-		 :animation="showAnimation" :nodes="html.nodes||((html[0].name||html[0].type)?html:nodes)" :imgMode="imgMode"
-		 :lazyLoad="lazyLoad" :loadVideo="loadVideo" />
-		<!--#endif-->
-	</view>
-</template>
-
-<script>
-	import trees from "./trees"
-	const html2nodes = require("./Parser.js");
-	// #ifdef MP-WEIXIN || MP-QQ
-	const CanIUseObserver = require("./api.js").versionHigherThan('1.9.3');
-	// #endif
-	// #ifdef APP-PLUS
-	const CanIUseObserver = true;
-	// #endif
-	var Document; // 使用document补丁包时将此句改为 const Document = require('./document.js');
-	export default {
-		name: 'parser',
-		data() {
-			return {
-				nodes: [],
-				showAnimation: {},
-				// #ifdef APP-PLUS
-				loadVideo: false,
-				// #endif
-			}
-		},
-		components: {
-			trees
-		},
-		props: {
-			'html': {
-				type: null,
-				default: ''
-			},
-			'autocopy': {
-				type: Boolean,
-				default: true
-			},
-			// #ifndef MP-ALIPAY
-			'autopause': {
-				type: Boolean,
-				default: true
-			},
-			// #endif
-			'autopreview': {
-				type: Boolean,
-				default: true
-			},
-			'autosetTitle': {
-				type: Boolean,
-				default: true
-			},
-			'domain': {
-				type: String,
-				default: ''
-			},
-			'imgMode': {
-				type: String,
-				default: 'default'
-			},
-			// #ifdef MP-WEIXIN || MP-QQ || APP-PLUS
-			'lazyLoad': {
-				type: Boolean,
-				default: false
-			},
-			// #endif
-			'selectable': {
-				type: Boolean,
-				default: false
-			},
-			'tagStyle': {
-				type: Object,
-				default: () => {
-					return {};
-				}
-			},
-			'showWithAnimation': {
-				type: Boolean,
-				default: false
-			},
-			'animationDuration': {
-				type: Number,
-				default: 400
-			},
-			'useAnchor': {
-				type: Boolean,
-				default: false
-			}
-		},
-		mounted() {
-			this.execHtml(this.html);
-			// #ifndef MP-ALIPAY || H5
-			this.videoContext = [];
-			// #endif
-			// #ifdef MP-BAIDU || MP-ALIPAY
-			this.anchors = [];
-			// #endif
-		},
-		methods: {
-			execHtml(html) {
-				// #ifdef H5
-				var iframe = document.getElementById("contain");
-				// 支持 iframe.srcdoc
-				if (typeof(iframe.srcdoc) == "string") {
-					var script =
-						'<script>"use strict";function calcPageHeight(t){var e=Math.max(t.body.clientHeight,t.documentElement.clientHeight),n=Math.max(t.body.scrollHeight,t.documentElement.scrollHeight);return Math.max(e,n)}document.addEventListener("DOMContentLoaded",function(){for(var t=document.getElementsByTagName("img"),e=[],n=0;n<t.length;n++){var r=t[n];r.style+=";max-width:100%",e.push(r.src),r.index=n,"A"!=r.parentElement.nodeName&&(r.onclick=function(){parent.document.previewEvent(this,e)}),r.onerror=function(){parent.document.errorEvent(this,"img")};var o=document.getElementsByTagName("a"),a=!0,i=!1,c=void 0;try{for(var u,l=o[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){u.value.onclick=function(t){if("#"==this.getAttribute("href")[0]){var e=document.getElementById(this.getAttribute("href").substring(1));return parent.document.tapEvent(this,e?e.offsetTop:-1)}return parent.document.tapEvent(this)}}}catch(t){i=!0,c=t}finally{try{!a&&l.return&&l.return()}finally{if(i)throw c}}var d=document.getElementsByTagName("video"),m=!0,h=!1,s=void 0;try{for(var v,y=d[Symbol.iterator]();!(m=(v=y.next()).done);m=!0){var f=v.value;f.style+=";max-width:100%",f.onerror=function(){parent.document.errorEvent(this,"video")},f.onplay=function(){parent.document.playEvent(this)}}}catch(t){h=!0,s=t}finally{try{!m&&y.return&&y.return()}finally{if(h)throw s}}parent.document.setVideoContext(d);var g=document.getElementsByTagName("audios"),p=!0,E=!1,x=void 0;try{for(var b,w=g[Symbol.iterator]();!(p=(b=w.next()).done);p=!0){b.value.onerror=function(t){parent.document.errorEvent(this,"audio")}}}catch(t){E=!0,x=t}finally{try{!p&&w.return&&w.return()}finally{if(E)throw x}}}},!1),window.onload=function(){var t=calcPageHeight(document);parent.document.getElementById("contain").style.height=t+"px",parent.document.setTitle(document.title)};<\/script>';
-					if (!html) return;
-					if (typeof html != 'string') {
-						if (typeof html == 'object') {
-							var str = "";
-							for (var node of (html.nodes || html))
-								str += this.Dom2Str(node);
-							html = str;
-						} else {
-							this.$emit('error', {
-								source: "parse",
-								errMsg: "传入的html格式不正确!"
-							});
-							return;
-						}
-					}
-					// 处理 rpx
-					if (/[0-9.]*?rpx/.test(html)) {
-						var rpx = uni.getSystemInfoSync().screenWidth / 750;
-						html = html.replace(/([0-9.]*?)rpx/g, function() {
-							return parseFloat(arguments[1]) * rpx + "px";
-						})
-					}
-					document.previewEvent = (img, imgList) => {
-						if (!img.hasAttribute('ignore')) {
-							var preview = true;
-							img.ignore = () => preview = false;
-							this.$emit('imgtap', img);
-							if (preview && this.autopreview) {
-								uni.previewImage({
-									current: img.index,
-									urls: imgList
-								});
-							}
-						}
-					}
-					document.tapEvent = (link, offsetTop) => {
-						var jump = true;
-						this.$emit('linkpress', {
-							href: link.getAttribute("href"),
-							ignore: () => jump = false
-						});
-						if (jump && link.getAttribute("href")) {
-							if (link.getAttribute("href")[0] == '#') {
-								if (this.useAnchor)
-									window.scrollTo(0, iframe.offsetTop + offsetTop);
-							} else if (/^http/.test(link.getAttribute("href"))) {
-								if (this.autocopy)
-									window.location.href = link.href;
-							} else {
-								uni.navigateTo({
-									url: link.getAttribute("href")
-								})
-							}
-						}
-						return false;
-					}
-					document.setTitle = (title) => {
-						if (title && this.autosetTitle) {
-							uni.setNavigationBarTitle({
-								title: title
-							})
-						}
-						if (html)
-							uni.createSelectorQuery().in(this).select("#contain").boundingClientRect(res => {
-								this.$emit('ready', res);
-							}).exec()
-					}
-					document.errorEvent = (target, source) => {
-						this.$emit('error', {
-							source,
-							target
-						});
-					}
-					document.setVideoContext = (videos) => {
-						this.videoContext = videos;
-					}
-					document.playEvent = (v) => {
-						if (this.autopause) {
-							for (var video of this.videoContext) {
-								if (video != v)
-									video.pause();
-							}
-						}
-					}
-					iframe.srcdoc = script + html;
-					this.showAnimation =
-						"opacity: 1; transition: opacity 400ms ease 0ms, -webkit-transform 400ms ease 0ms, transform 400ms ease 0ms; transform-origin: 50% 50% 0px;";
-					return;
-				}
-				// #endif
-				let showAnimation = {};
-				if (this.showWithAnimation) {
-					showAnimation = uni.createAnimation({
-						duration: this.animationDuration,
-						timingFunction: "ease"
-					}).opacity(1).step().export();
-				}
-				if (!html) {
-					this.nodes = [];
-				} else if (typeof html == 'string') {
-					html2nodes(html, this).then(res => {
-						// #ifdef APP-PLUS
-						this.loadVideo = false;
-						// #endif
-						this.nodes = res.nodes;
-						this.showAnimation = showAnimation;
-						this.imgList = res.imgList;
-						if (Document) this.document = new Document("nodes", res.nodes, this);
-						if (res.title && this.autosetTitle) {
-							uni.setNavigationBarTitle({
-								title: res.title
-							})
-						}
-						this.$emit('parser', res);
-						this.ready();
-					}).catch(err => {
-						this.$emit('error', {
-							source: "parse",
-							errMsg: err
-						});
-					})
-				} else if (html.constructor == Array) {
-					this.showAnimation = showAnimation;
-					this.imgList = [];
-					// #ifdef APP-PLUS
-					this.loadVideo = false;
-					// #endif
-					if (Document) this.document = new Document("html", html, this);
-					this.ready();
-				} else if (typeof html == 'object') {
-					if (!html.nodes || html.nodes.constructor != Array) {
-						if ((html.name && html.children && html.attrs) || (html.type == "text"))
-							return;
-						this.$emit('error', {
-							source: "parse",
-							errMsg: "传入的nodes数组格式不正确!应该传入的类型是array,实际传入的类型是:" + typeof html.nodes
-						});
-						return;
-					}
-					this.showAnimation = showAnimation;
-					this.imgList = html.imgList || [];
-					// #ifdef APP-PLUS
-					this.loadVideo = false;
-					// #endif
-					if (Document) this.document = new Document("html.nodes", html.nodes, this);
-					if (html.title && this.autosetTitle)
-						uni.setNavigationBarTitle({
-							title: html.title
-						})
-					this.ready();
-				} else {
-					this.$emit('error', {
-						source: "parse",
-						errMsg: "错误的html类型:" + typeof html
-					});
-				}
-			},
-			// #ifdef H5
-			Dom2Str(node) {
-				if (node.type == "text")
-					return node.text;
-				var elem = '<' + node.name;
-				for (var attr in node.attrs)
-					elem += (' ' + atts + '="' + node.attrs[attr] + '"');
-				elem += ">";
-				for (var child of node.children)
-					elem += Dom2Str(child);
-				elem += ("</" + node.name + ">");
-				return elem;
-			},
-			// #endif
-			// #ifndef H5
-			getContext(components) {
-				for (let component of components) {
-					let observered = false;
-					if (!component.nodes)
-						return this.getContext(component.$children);
-					for (let item of component.nodes) {
-						// #ifndef MP-ALIPAY
-						if (item.name == 'img' && !observered) {
-							observered = true;
-							if (component.lazyLoad && CanIUseObserver) {
-								component._observer = uni.createIntersectionObserver(component);
-								component._observer.relativeToViewport({
-									top: 1000,
-									bottom: 1000
-								}).observe('.img', res => {
-									component.imgLoad = true;
-									component._observer.disconnect();
-									component._observer = null;
-								})
-							} else
-								component.imgLoad = true;
-						} else if (item.name == 'video') {
-							this.videoContext.push({
-								id: item.attrs.id,
-								context: uni.createVideoContext(item.attrs.id, component)
-							});
-						}
-						// #endif
-						// #ifdef MP-BAIDU || MP-ALIPAY
-						if (item.attrs && item.attrs.id) {
-							this.anchors.push({
-								id: item.attrs.id,
-								node: component
-							})
-						}
-						// #endif
-					}
-					this.getContext(component.$children);
-				}
-			},
-			// #endif
-			ready() {
-				this.$nextTick(() => {
-					this.navigateTo = (obj) => {
-						obj.success = obj.success || function() {};
-						obj.fail = obj.fail || function() {};
-						var Scroll = (selector,component) => {
-							const query = uni.createSelectorQuery().in(component?component:this);
-							query.select(selector).boundingClientRect();
-							query.selectViewport().scrollOffset();
-							query.exec(res => {
-								if (!res || !res[0])
-									return obj.fail({
-										errMsg: "Label Not Found"
-									});
-								uni.pageScrollTo({
-									scrollTop: res[1].scrollTop + res[0].top,
-									success: obj.success,
-									fail: obj.fail
-								})
-							})
-						}
-						if (!obj.id) Scroll(".contain");
-						else {
-							// #ifndef MP-BAIDU || MP-ALIPAY
-							Scroll('.contain >>> #' + obj.id);
-							// #endif
-							// #ifdef MP-BAIDU || MP-ALIPAY
-							for (var anchor of this.anchors) {
-								if (anchor.id == obj.id) {
-									Scroll("#" + obj.id, anchor.node);
-								}
-							}
-							// #endif
-						}
-					}
-					uni.createSelectorQuery().in(this).select(".contain").boundingClientRect(res => {
-						this.$emit("ready", res);
-					}).exec()
-					// #ifndef H5
-					this.getContext(this.$children);
-					// #endif
-					// #ifdef APP-PLUS
-					setTimeout(() => {
-						this.loadVideo = true;
-					}, 2000);
-					// #endif
-				})
-			}
-		},
-		watch: {
-			html(html) {
-				this.execHtml(html);
-			}
-		}
-	}
-</script>
-
-<style>
-	/* #ifndef MP-BAIDU */
-	:host {
-		display: block;
-		overflow: scroll;
-		-webkit-overflow-scrolling: touch;
-	}
-
-	/* #endif */
-</style>

+ 0 - 363
components/jyf-Parser/trees.vue

@@ -1,363 +0,0 @@
-<template>
-	<view style="display: inherit;white-space: inherit;">
-		<block v-for='(item, index) in nodes' v-bind:key='index'>
-			<!--#ifdef MP-WEIXIN || MP-QQ || APP-PLUS || MP-ALIPAY-->
-			<block v-if="handler.isContinue(item)">
-				<!--#endif-->
-				<!--#ifdef MP-BAIDU || MP-TOUTIAO || H5-->
-				<block v-if="!item.continue">
-					<!--#endif-->
-					<!--图片-->
-					<!--#ifdef MP-WEIXIN || MP-QQ || APP-PLUS-->
-					<rich-text v-if="item.name=='img'" :id="item.attrs.id||''" class="img" :style="'text-indent:0;'+handler.getStyle(item.attrs.style,'inline-block')"
-					 :nodes='handler.setImgStyle(item,imgMode,imgLoad)' :data-ignore='item.attrs.ignore' :data-src='item.attrs.src'
-					 :data-current='item.current' @tap='previewEvent' />
-					<!--#endif-->
-					<!--#ifdef MP-ALIPAY-->
-					<rich-text v-if="item.name=='img'" :id="item.attrs.id||''" :style="'text-indent:0;'+handler.getStyle(item.attrs.style,'inline-block')"
-					 :nodes='handler.setImgStyle(item,imgMode)' :data-ignore='item.attrs.ignore' :data-src='item.attrs.src'
-					 :data-current='item.current' @tap='previewEvent' />
-					<!--#endif-->
-					<!--#ifdef MP-BAIDU || MP-TOUTIAO || H5-->
-					<rich-text v-if="item.name=='img'" :id="item.attrs.id||''" :style="'text-indent:0;'+item.attrs.containStyle" :nodes='[item]' :data-ignore='item.attrs.ignore'
-					 :data-src='item.attrs.src' :data-current='item.current' @tap='previewEvent' />
-					<!--#endif-->
-					<!--文本-->
-					<!--#ifdef MP-WEIXIN || MP-QQ || H5 || APP-PLUS-->
-					<block v-else-if="item.type=='text'">
-						<text v-if="!item.decode" decode>{{item.text}}</text>
-						<rich-text v-else style="display:inline-block" :nodes="[item]"></rich-text>
-					</block>
-					<!--#endif-->
-					<!--#ifdef MP-ALIPAY-->
-					<text v-else-if="item.type=='text'" decode>{{item.text}}</text>
-					<!--#endif-->
-					<text v-else-if="item.name=='br'">\n</text>
-					<!--视频-->
-					<block v-else-if="item.name=='video'">
-						<!--#ifdef APP-PLUS-->
-						<view v-if="(!loadVideo||item.attrs.id[item.attrs.id.length-1]>'3')&&(!controls[item.attrs.id]||!controls[item.attrs.id].play)"
-						 :class="'pvideo '+(item.attrs.class||'')" :style="item.attrs.style" :data-id="item.attrs.id" @tap="_loadVideo">
-							<view class="video-triangle"></view>
-						</view>
-						<!--#endif-->
-						<!--#ifndef APP-PLUS-->
-						<view v-if="item.attrs.id[item.attrs.id.length-1]>'3'&&(!controls[item.attrs.id]||!controls[item.attrs.id].play)"
-						 :class="'pvideo '+(item.attrs.class||'')" :style="item.attrs.style" :data-id="item.attrs.id" @tap="_loadVideo">
-							<view class="video-triangle"></view>
-						</view>
-						<!--#endif-->
-						<video v-else :src='controls[item.attrs.id]?item.attrs.source[controls[item.attrs.id].index]:item.attrs.src' :id="item.attrs.id||''"
-						 :loop='item.attrs.loop' :controls='item.attrs.controls' :autoplay="item.attrs.autoplay||(controls[item.attrs.id]&&controls[item.attrs.id].play)"
-						 :unit-id="item.attrs['unit-id']" :class="'v '+(item.attrs.class||'')" :muted="item.attrs.muted" :style="item.attrs.style"
-						 :data-id="item.attrs.id" :data-source="item.attrs.source" @play='playEvent' @error="videoError" />
-					</block>
-					<!--音频-->
-					<audio v-else-if="item.name=='audio'" :src='controls[item.attrs.id]?item.attrs.source[controls[item.attrs.id].index]:item.attrs.src'
-					 :id="item.attrs.id||''" :loop='item.attrs.loop' :controls='item.attrs.controls' :poster='item.attrs.poster' :name='item.attrs.name'
-					 :author='item.attrs.author' :class="item.attrs.class||''" :style="item.attrs.style" :data-id="item.attrs.id"
-					 :data-source="item.attrs.source" @error="audioError" />
-					<!--链接-->
-					<view v-else-if="item.name=='a'" :class="'a '+(item.attrs.class||'')" :style="item.attrs.style" :data-href='item.attrs.href'
-					 hover-class="navigator-hover" :hover-start-time="25" :hover-stay-time="300" @tap="tapEvent">
-						<!--#ifdef H5-->
-						<trees :nodes="item.children" :imgMode="imgMode" />
-						<!--#endif-->
-						<!--#ifndef H5-->
-						<trees :nodes="item.children" :imgMode="imgMode" :lazyLoad="lazyLoad" :loadVideo="loadVideo" />
-						<!--#endif-->
-					</view>
-					<!--广告-->
-					<!--#ifdef MP-WEIXIN || MP-QQ-->
-					<ad v-else-if="item.name=='ad'" :unit-id="item.attrs['unit-id']" :class="item.attrs.class||''" :style="item.attrs.style"
-					 @error="adError"></ad>
-					<!--#endif-->
-					<!--#ifdef MP-BAIDU-->
-					<ad v-else-if="item.name=='ad'" :appid="item.attrs.appid" :apid="item.attrs.apid" :type="item.attrs.type" :class="item.attrs.class||''"
-					 :style="item.attrs.style" @error="adError"></ad>
-					<!--#endif-->
-					<!--富文本-->
-					<!--#ifdef MP-WEIXIN || MP-QQ || MP-ALIPAY || APP-PLUS-->
-					<rich-text v-else :id="item.attrs.id||''" :class="item.name" :style="''+handler.getStyle(item.attrs.style,'block')" :nodes="handler.setStyle(item)" />
-					<!--#endif-->
-					<!--#ifdef MP-BAIDU || MP-TOUTIAO || H5-->
-					<rich-text v-else :id="item.attrs.id||''" :class="item.name" :style="item.attrs?item.attrs.containStyle:''" :nodes="[item]" />
-					<!--#endif-->
-				</block>
-				<!--#ifdef MP-ALIPAY || H5-->
-				<view v-else :id="item.attrs.id||''" :class="item.name+' '+(item.attrs.class||'')" :style="item.attrs.style">
-					<trees :nodes="item.children" :imgMode="imgMode" />
-				</view>
-				<!--#endif-->
-				<!--#ifndef MP-ALIPAY || H5-->
-				<trees v-else :id="item.attrs.id||''" :class="item.name+' '+(item.attrs.class||'')" :style="item.attrs.style" :nodes="item.children"
-				 :imgMode="imgMode" :lazyLoad="lazyLoad" :loadVideo="loadVideo" />
-				<!--#endif-->
-			</block>
-	</view>
-</template>
-<script module="handler" lang="wxs" src="./handler.wxs"></script>
-<script module="handler" lang="sjs" src="./handler.sjs"></script>
-<script>
-	import trees from "./trees"
-	export default {
-		components: {
-			trees
-		},
-		name: 'trees',
-		data() {
-			return {
-				controls: {},
-				// #ifdef MP-WEIXIN || MP-QQ || APP-PLUS
-				imgLoad: false
-				// #endif
-			}
-		},
-		props: {
-			nodes: {
-				type: Array,
-				default: []
-			},
-			// #ifdef MP-WEIXIN || MP-QQ || APP-PLUS
-			lazyLoad: {
-				type: Boolean,
-				default: false
-			},
-			// #endif
-			// #ifdef APP-PLUS
-			loadVideo: {
-				type: Boolean,
-				default: false
-			},
-			// #endif
-			imgMode: {
-				type: String,
-				default: "default"
-			}
-		},
-		mounted() {
-			// 获取顶层组件
-			this._top = this.$parent;
-			while (this._top.$options.name != 'parser') {
-				if (this._top._top) {
-					this._top = this._top._top;
-					break;
-				}
-				this._top = this._top.$parent;
-			}
-		},
-		// #ifdef MP-WEIXIN || MP-QQ || APP-PLUS
-		beforeDestroy() {
-			if (this._observer)
-				this._observer.disconnect();
-		},
-		// #endif
-		methods: {
-			// #ifndef MP-ALIPAY
-			playEvent(e) {
-				if (this._top.videoContext.length > 1 && this._top.autopause) {
-					for (let video of this._top.videoContext) {
-						if (video.id == e.currentTarget.dataset.id) continue;
-						video.context.pause();
-					}
-				}
-			},
-			// #endif
-			previewEvent(e) {
-				if (!e.currentTarget.dataset.ignore) {
-					var preview = true;
-					this._top.$emit('imgtap', {
-						id: e.target.id,
-						src: e.currentTarget.dataset.src,
-						ignore: () => preview = false
-					});
-					if (preview && this._top.autopreview) {
-						uni.previewImage({
-							current: parseInt(e.currentTarget.dataset.current),
-							urls: this._top.imgList.length ? this._top.imgList : [e.currentTarget.dataset.src]
-						});
-					}
-				}
-			},
-			tapEvent(e) {
-				var jump = true;
-				this._top.$emit('linkpress', {
-					href: e.currentTarget.dataset.href,
-					ignore: () => jump = false
-				});
-				if (jump && e.currentTarget.dataset.href) {
-					if (e.currentTarget.dataset.href[0]) {
-						if (this._top.useAnchor)
-							this._top.navigateTo({
-								id: e.currentTarget.dataset.href.substring(1)
-							})
-					} else if (/^http/.test(e.currentTarget.dataset.href)) {
-						if (this._top.autocopy) {
-							// #ifndef H5
-							uni.setClipboardData({
-								data: e.currentTarget.dataset.href,
-								success() {
-									uni.showToast({
-										title: '链接已复制'
-									});
-								}
-							});
-							// #endif
-							// #ifdef H5
-							window.location.href = e.currentTarget.dataset.href;
-							// #endif
-						}
-					} else
-						uni.navigateTo({
-							url: e.currentTarget.dataset.href
-						})
-				}
-			},
-			triggerError(source, target, errMsg, errCode) {
-				this._top.$emit('error', {
-					source,
-					target,
-					errMsg,
-					errCode
-				});
-			},
-			loadSource(currentTarget) {
-				if (!this.controls[currentTarget.id] && currentTarget.source.length > 1) {
-					this.$set(this.controls, currentTarget.id, {
-						play: false,
-						index: 1
-					})
-				} else if (this.controls[currentTarget.id] && currentTarget.source.length > this.controls[
-						currentTarget.id].index + 1) {
-					this.$set(this.controls[currentTarget.id], "index", this.controls[currentTarget.id].index + 1);
-				}
-			},
-			adError(e) {
-				this.triggerError("ad", e.currentTarget, "", e.detail.errorCode);
-			},
-			videoError(e) {
-				this.loadSource(e.currentTarget.dataset);
-				this.triggerError("video", e.currentTarget, e.detail.errMsg);
-			},
-			audioError(e) {
-				this.loadSource(e.currentTarget.dataset);
-				this.triggerError("audio", e.currentTarget, e.detail.errMsg);
-			},
-			_loadVideo(e) {
-				this.$set(this.controls, e.currentTarget.dataset.id, {
-					play: true,
-					index: 0
-				})
-			}
-		}
-	}
-</script>
-
-<style>
-	/* 可以在这里引入自定义的外部样式 */
-
-	/* 链接受到点击的hover-class,可自定义修改 */
-	.navigator-hover {
-		opacity: 0.7;
-		text-decoration: underline;
-	}
-
-	/* 以下内容不建议修改 */
-	:host {
-		display: inherit;
-		float: inherit;
-	}
-
-	.a {
-		display: inline;
-		color: #366092;
-	}
-
-	/* #ifdef MP-WEIXIN || MP-QQ || MP-ALIPAY */
-	.sub,
-	.sup,
-	.bdo,
-	.bdi,
-	.ruby,
-	.rt {
-		display: inline-block !important;
-	}
-
-	/* #endif */
-
-	.div,
-	.blockquote,
-	.p {
-		display: block;
-	}
-
-	.b,
-	.strong {
-		display: inline;
-		font-weight: bold;
-	}
-
-	.em,
-	.i {
-		display: inline;
-		font-style: italic;
-	}
-
-	.del {
-		display: inline;
-		text-decoration: line-through;
-	}
-
-	.ins {
-		display: inline;
-		text-decoration: underline;
-	}
-
-	.code {
-		display: inline;
-		font-family: monospace;
-	}
-
-	.big {
-		font-size: 1.2em;
-		display: inline;
-	}
-
-	.small {
-		font-size: 0.8em;
-		display: inline;
-	}
-
-	.q,
-	.span,
-	.label,
-	.abbr {
-		display: inline;
-	}
-
-	.q::before {
-		content: '"';
-	}
-
-	.q::after {
-		content: '"';
-	}
-
-	.pvideo {
-		background-color: black;
-		width: 300px;
-		height: 225px;
-		display: inline-block;
-		position: relative;
-	}
-
-	.video-triangle {
-		border-width: 15px 0 15px 30px;
-		border-style: solid;
-		border-color: transparent transparent transparent white;
-		position: absolute;
-		left: 50%;
-		top: 50%;
-		margin: -15px 0 0 -15px;
-	}
-</style>

+ 1 - 2
pages/goods/components/cm-return-instructions.vue

@@ -52,8 +52,7 @@ export default {
         color: #666666;
 
         .iconfont {
-            font-size: 28rpx;
-            color: #666;
+            color: #b2b2b2;
         }
     }
 }

+ 3 - 3
pages/goods/instrument-details.vue

@@ -49,7 +49,7 @@
 			</view>	
 			<view class="product-details service" v-show="tabCurrentIndex == 0">
 				<view class="content tui-banner product-rich-text tui-skeleton-rect">
-					<parser :html="html" :img-mode="widthFix"></parser>
+					<mp-html :content="html" :tag-style="tagStyle" />
 				</view>
 			</view>	
 			<view class="product-details service" v-show="tabCurrentIndex == 1">
@@ -129,20 +129,20 @@
 <script>
 	import { mapState,mapMutations } from 'vuex'
 	import authorize from '@/common/config/authorize.js'
-	import parser from "@/components/jyf-Parser/index" //富文本处理
 	import customP from '@/components/cm-custom/custom-p.vue' 		 //自定义导航
 	import recommend from "./components/instrument-recommend" //相关推荐
 	import wxLogin from "@/common/config/wxLogin.js"
+	import { productTagStyle } from '@/plugins/mp-html/config.js'
 	var isPreviewImg;
 	export default{
 		components:{
 			customP,
-			parser,
 			recommend,
 		},
 		data(){
 			return{			
 				html:'<div style="text-align: center;color:#333333;">暂无内容</div>',
+				tagStyle: productTagStyle,
 				disabledTabNavList:[{name:'相关推荐'}],
 				mode:'round',
 				iconClass:'icon-aixin',

+ 2 - 12
pages/goods/mixins/proMixins.js

@@ -1,6 +1,5 @@
-// 统计数据
-// 统计类型 1:首页banner;2:直播模块;3:最新活动;4:热门文章;5:新品橱窗;6:活动列表
 import Vue from 'vue'
+import { productTagStyle } from '@/plugins/mp-html/config.js'
 const proMixins = {
     data() {
         return {
@@ -13,16 +12,7 @@ const proMixins = {
                 userId: 0,
                 source: 1
             },
-            tagStyle:{
-                div:'line-height: 58rpx;margin-bottom: 10rpx;font-size: 28rpx;',
-                h4:'line-height: 54rpx;font-size: 30rpx;color:#666666;padding: 0 20rpx;font-weight: normal;',
-                h3:'line-height: 54rpx;font-size: 30rpx;color:#666666;padding: 0 20rpx;font-weight: normal;',
-                h2:'line-height: 54rpx;font-size: 30rpx;color:#666666;padding: 0 20rpx;font-weight: normal;',
-                p:'line-height: 54rpx;font-size: 30rpx;color:#666666;padding: 0 20rpx;',
-                a:'line-height: 54rpx;font-size: 30rpx;color:#666666;',
-                span:'line-height: 54rpx;font-size: 30rpx;color:#666666;',
-                img:'width: 100%;height: auto;'
-            }
+            tagStyle:productTagStyle
         }
     },
     methods: {

+ 0 - 3
pages/goods/product.vue

@@ -273,7 +273,6 @@
 						<view class="title"> <view class="title-tab">商品详情</view> </view>
 						<view class="content tui-banner product-rich-text tui-skeleton-rect">
 							<template v-if="!goodsData.isNoneDisabled && product.productDetail.detailInfo">
-								<!-- <parser :html="html" :img-mode="widthFix"></parser> -->
 								<mp-html :content="html" :tag-style="tagStyle" />
 							</template>
 							<view class="product-rich-text-none" v-else>暂无商品信息</view>
@@ -599,7 +598,6 @@
 <script>
 import { mapState, mapMutations } from 'vuex'
 import customP from './components/cm-header.vue' //自定义导航
-import parser from '@/components/jyf-Parser/index' //富文本处理
 import cmPrice from './components/cm-price.vue' //价格显示
 import cmAttributes from './components/cm-attributes.vue' //规格信息
 import cmRecommend from './components/recommend' //相关推荐
@@ -624,7 +622,6 @@ export default {
 	mixins: [payMixins,proMixins,cmSrsMixins],
 	components: {
 		customP,
-		parser,
 		cmRecommend,
 		cmPrice,
 		cmAttributes,

+ 0 - 1970
pages/tabBar/cart/cart.vue

@@ -1,1970 +0,0 @@
-<template>
-	<view class="container cart clearfix" v-if="hasLogin"> 	
-		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
-		<view class="container-cart-main tui-skeleton" :style="{paddingTop:isshowDelbtn ? '0rpx':'80rpx'}">
-			<view class="foot-check-delbtn" v-if="!isshowDelbtn && goodsList.length>0">
-				<view class="foot-text">共<text>{{kindCount}}</text>件商品</view>
-				<view class="delBtn" @tap.stop="showDelManager">删除</view>
-			</view>
-			<view v-if="!isEmpty" class="container-cart"> 
-				<view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
-					<view class="goods-list">
-						<view v-for="(item, index) in goodsList" :key="index" class="goods-item clearfix">
-							<view class="shoptitle">
-								<!--选择商店的全部商品"-->
-								<view class="checkbox-box" @click.stop="checkShop(item)">
-									<view class="checkbox iconfont" :class="[item.checked ?'icon-yixuanze':'icon-weixuanze']"></view>
-								</view>
-								<view v-if="item.promotions" class="floor-item-act">
-									<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>	
-								</view>
-								<view class="text">{{item.name}}</view> 
-								<view class="text-coupon" @click="showPopup(0)">领券</view>
-							</view>
-							<view class="productlist">
-								<view 	class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
-									<view class="goods-pros-t">
-										<!--选择商品-->
-										<view class="checkbox-box" @click.stop="ischeck(item,pros)">
-											<view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-yixuanze':'icon-weixuanze']"></view>
-										</view>
-										<view class="pros-img" @click.stop="navToListPage(pros.productId)"	><image :src="pros.image ? pros.image:''" alt="" /></view>
-										<view class="pros-product">
-											<view class="producttitle" @click.stop="navToListPage(pros.productId)"	>{{pros.name}}</view>
-											<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
-											<view class="productprice">
-												<!--使用过滤器对总价改变-->
-												<view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
-													<text>¥</text>
-													{{ (PromotionsFormat(pros.promotions) ? pros.originalPrice : pros.price)  | NumFormat }}
-												</view>
-												<view class="count" v-if="pros.validFlag == 2 "  :class="[isshowDelbtn ? 'none':'show']">
-													<text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
-													<text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
-													<view class="number-box">
-														<view  class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
-														<input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
-														<view  class="iconfont icon-jiahao"  @click="changeCountAdd(item,pros)"></view>
-													</view>
-												</view>
-											</view>
-											<view v-show="pros.actStatus==1" class="floor-item-act">
-												<view v-if="PromotionsFormat(pros.promotions)"  class="floor-tags" @click.stop="clickPopupShow(pros,1)">
-													{{pros.promotions.name}}
-													<text v-if ="pros.promotions!=null && pros.promotions.type!=3">
-														:¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
-													</text>
-												</view>
-												<view v-else-if="pros.promotions.type!=3" class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>	
-											</view>
-											<view  v-if="pros.actStatus == null  &&  pros.ladderFlag == 1" class="floor-item-act">
-												<view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>	
-											</view>
-										</view>	
-									</view>
-								</view>
-							</view>	
-							<view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none':'show']" >
-								<view class="sum-none" v-if="item.reducedPrice>0">
-									<text class="money-sign">¥</text>
-									<text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
-									<text class="money-reduced">减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
-								</view>
-								<view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice | NumFormat}}</text></view>
-							</view>
-						</view>
-					</view>	
-					<view class="failure-list" v-if="failureList.length>0">
-						<view class="failure-title">
-							<view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
-							<view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
-						</view>
-						<view class="productlist">
-							<view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
-								<view class="goods-pros-t" @click.stop="failureToProduct(failure)">
-									<!--选择商品-->
-									<view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
-										<button class="checkbox iconfont" 
-												:class="[ failure.productsChecked ? 'icon-yixuanze':'icon-weixuanze']">
-										</button>
-									</view>
-									<text class="img-tip">失效</text>
-									<view class="pros-img">
-										<image :src="failure.image ? failure.image:''" alt="" />
-									</view>
-									<view class="pros-product">
-										<view class="producttitle">{{failure.name}}</view>
-										<view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
-										<view class="productstate">{{failureStateText(failure.status)}}</view>
-									</view>
-									<view class="pros-marks" v-if="failure.isFailureLayer"></view>
-								</view>
-							</view>
-						</view>	
-					</view>
-				</view>
-				<!-- 脚部菜单 -->
-				<view class="footer">
-					<view class="footer-le">
-						<view class="foot-check checkbox-box" @tap.stop="checkAll()">
-							<button class="checkbox iconfont" :class="[isCheckAll?'icon-yixuanze':'icon-weixuanze']"></button> 
-							<view class="text">全选</view>
-						</view>
-	
-						<view class="sum">
-							<view class="sum-price" :class="reducedPrice == 0 ? 'none' : ''">
-								总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
-							</view>
-							<view class="sum-none"  v-if="reducedPrice>0">
-								<!-- <text class="money-sign">¥</text> -->
-								<!-- <text class="money">{{ totalOriginalPrice | NumFormat }}</text> -->
-								<text class="money-reduced">共减<text>¥{{ reducedPrice | NumFormat}}</text></text>
-								<text class="money-popup" @click="showPopup(1)">优惠明细<text class="iconfont icon-xiangshangjiantou"></text></text>
-							</view>
-						</view>
-					</view>
-					<view v-if="!isshowDelbtn" class="footer-ri" >
-						<view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
-					</view>
-					<view v-else class="footer-del">
-						<view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
-						<view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
-					</view>
-				</view>
-			</view>
-			<view v-else class="cart-content empty">
-				<view  class="empty-container">
-					<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
-					<text class="error-text">购物车空空如也,快去商城逛逛吧~</text>
-					<view class="login-btn"  @click="goIndex">去商城</view>
-				</view>
-			</view>
-		</view>
-		<!-- 促销活动弹窗 -->
-		<activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
-		<!-- 透明模态层 -->
-		<modal-layer v-if='modallayer'></modal-layer>
-		<!-- 优惠券 -->
-		<tui-bottom-popup :radius="true" :show="popupShow0" @close="hidePopup(0)">
-			<view class="tui-popup-box clearfix">
-				<view class="title">优惠券</view>
-				<view class="tui-popup-close" @click="hidePopup(0)">
-					<text class="iconfont icon-iconfontguanbi"></text>
-				</view>
-				<view class="tui-popup-tabs">
-					<coupon-tabs  :tabs="navbar"
-								  :currentTab="currentTab>2?0:currentTab" 
-								  @change="couponChange" 
-								  :itemWidth="(100/navbar.length)+'%'"
-								  selectedColor="#e15616" 
-								  sliderBgColor="#e15616">
-					</coupon-tabs>
-				</view>
-				<div class="tui-popup-main coupon">
-					<scroll-view class="tui-popup-scroll"  scroll-y="true">
-						<view v-for="(coupon,index) in dataList" :key="index" :id="coupon.id" class="coupon-list">
-							<view class="list-cell-le">
-								<view class="coupon-maxMoney">
-									<text class="small">¥</text>
-									{{ coupon.maxMoney }}
-								</view>
-								<view class="coupon-minMoney">
-									满{{ coupon.minMoney }}可用
-								</view>
-							</view>
-							<view class="list-cell-ri">
-								<view class="list-cell-top">
-									<view class="list-cell-type">
-										<view class="list-cell-tags">
-											<text class="tags">{{ coupon.couponType | TypeFormat }}</text>
-										</view>
-										<view class="list-cell-texts" :class="currentTab == 1 || currentTab == 2 ? 'none' : ''">
-											<text v-if="coupon.useType == 1">{{ coupon.useType | TypeFormatText }}</text>
-											<text v-if="coupon.useType == 2">{{ coupon.useType | TypeFormatText }}</text>
-											<text v-if="coupon.useType == 3">{{ coupon.useType | TypeFormatText }}{{ coupon.couponText }}的商品</text>
-										</view>
-									</view>
-									<view class="list-cell-btn">
-										<view class="icon-used">
-											<view class="icon-used-btn receive" v-if="currentTab == 0" @click="receiveCoupon(coupon)">领取</view>
-											<view class="icon-used-btn make" v-if="currentTab == 1">已领取</view>
-										</view>
-									</view>
-								</view>
-								<view class="list-cell-time">{{ coupon.couponTime }}</view>
-							</view>
-						</view>
-					</scroll-view>
-				</div>
-			</view>	
-		</tui-bottom-popup>	
-		<!-- 优惠明细 -->
-		<tui-bottom-popup :radius="true" :show="popupShow1" @close="hidePopup(1)">
-			<view class="tui-popup-box clearfix">
-				<view class="title">优惠明细</view>
-				<view class="tui-popup-close" @click="hidePopup(1)">
-					<text class="iconfont icon-iconfontguanbi"></text>
-				</view>
-				<div class="tui-popup-main coupon">
-					<view class="tui-popup-coupon">
-						<view class="tui-popup-h1">
-							<view class="tui-popup-text left">商品总额</view>
-							<view class="tui-popup-text right bold">¥4500.00</view>
-						</view>
-						<view class="tui-popup-h1">
-							<view class="tui-popup-text left">促销满减</view>
-							<view class="tui-popup-text right bold red">¥500.00</view>
-						</view>
-						<view class="tui-popup-h1">
-							<view class="tui-popup-text left">优惠券</view>
-							<view class="tui-popup-text right bold red">¥100.00</view>
-						</view>
-						<view class="tui-popup-h1">
-							<view class="tui-popup-text left bold">共减</view>
-							<view class="tui-popup-text right bold red">¥600.00</view>
-						</view>
-						<view class="tui-popup-h1">
-							<view class="tui-popup-text left bold">总计</view>
-							<view class="tui-popup-text right bold">¥3900.00</view>
-						</view>
-					</view>
-				</div>
-			</view>	
-		</tui-bottom-popup>	
-	</view>
-</template>
-<script>
-	import authorize from '@/common/config/authorize.js'
-	import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
-	import tuiNomore from "@/components/tui-components/nomore/nomore"
-	import activiPopup from "@/components/cm-module/productDetails/cm-activipopu"
-	import couponTabs from '@/components/cm-module/coupon/tui-tabs.vue'
-	import modalLayer from "@/components/modal-layer"
-	import { mapState,mapMutations } from 'vuex';
-	
-	export default{
-		components:{
-			tuiLoadmore,
-			tuiNomore,
-			activiPopup,
-			couponTabs,
-			modalLayer
-		},
-		data(){
-			return{
-				CustomBar:this.CustomBar,// 顶部导航栏高度
-				isIphoneX:this.$store.state.isIphoneX,
-				userID:'',
-				alertType:'',
-				isStock:'',
-				handlerPros:{},//监听单挑促销商品
-				failureList:[],	//失效商品列表
-				goodsList:[],	//购物车的商品
-				promotionsList:[],//促销列表
-				delGoodsList:'',//要删除的商品
-				setGoodData:'', //确认订单的商品
-				isCheckAll:false,//是否全选
-				kindCount:0,//购物车宝贝数量
-				allPrice:0,//所有价格
-				totalOriginalPrice:0,//所有原价价
-				reducedPrice:0,//满减
-				allCount:0,//被选中的产品数量
-				isModallayer:false,
-				skeletonShow:true,
-				isshowDelbtn:false,
-				isDisabled: false, // 供应商/店铺全选是否禁用状态
-				isNoConfim:false,
-				isEmpty:false,//显示空购物车
-				scrollHeight: 'auto',
-				nomoreText: '上拉显示更多',
-				hasNextPage: false,
-				loadding: false,
-				pullUpOn: true,
-				pullFlag: true,
-				pageSize: 10,
-				pageNum: 1,
-				submitIds:[],
-				popupShow:false,
-				popupShow0:false,
-				popupShow1:false,
-				currentTab: 0,
-				navbar: [
-					{ name: "未领取",num:3 }, 
-					{ name: "已领取",num:4 } 
-				],
-				dataList:[
-					{
-						maxMoney:5000,
-						minMoney:1000,
-						couponType:1,
-						couponTime:'2021.06.28~2021.07.28',
-						couponText:'华熙生物技术有限公司',
-						useType:1,
-						couponBtnType:0
-					},
-					{
-						maxMoney:2000,
-						minMoney:200,
-						couponType:2,
-						couponTime:'2021.06.28~2021.07.28',
-						couponText:'华熙生物技术有限公司',
-						useType:2,
-						couponBtnType:0
-					},
-					{
-						maxMoney:4000,
-						minMoney:800,
-						couponType:3,
-						couponTime:'2021.06.28~2021.07.28',
-						couponText:'华熙生物技术有限公司',
-						useType:3,
-						couponBtnType:0
-					},
-					{
-						maxMoney:6000,
-						minMoney:1000,
-						couponType:4,
-						couponTime:'2021.06.28~2021.07.28',
-						couponText:'华熙生物技术有限公司',
-						useType:1,
-						couponBtnType:0
-					},
-					{
-						maxMoney:6000,
-						minMoney:1000,
-						couponType:5,
-						couponTime:'2021.06.28~2021.07.28',
-						couponText:'华熙生物技术有限公司',
-						useType:2,
-						couponBtnType:0
-					}
-				],
-			}
-		},
-		onLoad(){
-			this.setScrollHeight();
-		},
-		computed: {
-			...mapState(['hasLogin','userInfo','isWxAuthorize'])
-		},
-		filters:{
-			NumFormat(value) {//处理金额
-				return Number(value).toFixed(2);
-			},
-		    totalprice(val,count){//单件商品的价格 × 数量
-		        return (val * count).toFixed(2)
-		    },
-			TypeFormat:function(value) {
-				switch (value) {
-					case 1:
-						return  '活动券';
-						break;
-					case 2:
-						return  '品类券';
-						break;
-					case 3:
-						return  '店铺券';
-						break;
-					case 4:
-						return  '专享券';
-						break;
-					case 5:
-						return  '新用户券';
-						break;
-				}
-			},
-			TypeFormatText:function(value) {
-				switch (value) {
-					case 1:
-						return  '全商城商品通用';
-						break;
-					case 2:
-						return  '仅限购买仪器类商品';
-						break;
-					case 3:
-						return  '仅可购买店铺';
-						break;
-				}
-			}
-		},	
-		methods:{
-			initData(){
-				this.isModallayer = false //遮罩层 防止多次点击
-				this.skeletonShow = true //预加载圆圈
-				this.isCheckAll=false//是否全选
-				this.submitIds = []
-				this.$api.getStorage().then((resolve) => {
-					this.userID = resolve.userId;
-					this.initGetCartGoodsList();
-				})	
-			},
-			initLogin(){
-				this.$api.redirectTo('/pages/login/login?type=4')
-			},
-			clickPopupShow(pros,type){
-				this.popupShow = true;
-				this.handlerPros = pros;
-			},
-			setScrollHeight() {
-				// 窗口高度-footer高度
-				const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
-				setTimeout(()=> {
-					const query = uni.createSelectorQuery().in(this);
-					query.selectAll('.footer').boundingClientRect();
-					query.exec(res => {
-						this.windowHeight = windowHeight;
-						if(res[0][0]) {
-							this.scrollHeight = windowHeight - res[0][0].height;
-						}
-					})
-				}, 500)
-			},
-			initGetCartGoodsList(){//初始化购物车 index:1
-				this.ProductService.QueryShoppingCartList({userId:this.userID}).then(response =>{
-					this.skeletonShow = false
-					let data = response.data
-					this.kindCount = data.kindCount
-					this.promotionsList = data.promotions
-					this.$store.commit('updateAllNum',data.kindCount)
-					if( data.list.length > 0 || data.invalid.length > 0){
-						this.isEmpty =false
-					}else{
-						this.isEmpty =true
-					}
-					if(data.list && data.list.length > 0 ){
-						this.goodsList = data.list;
-						this.goodsList.forEach((item,index) => {
-							item.cartList.forEach(pros => {
-								pros.shopID = item.shopID;
-								pros.isStep = false
-								if(pros.step === 2){ 
-									if(pros.number % pros.min != 0){
-										pros.number = pros.min
-										this.totalShopPeice()
-										this.updateShoppogNum(pros)
-									}
-								}
-							})
-						})
-						this.totalShopPeice()
-					} else {
-						this.goodsList = [];
-					}
-					if( data.invalid && data.invalid.length > 0){
-						let newFailureList = [],isFailureLayer;
-						data.invalid.forEach((failure,index) => {
-							if(failure.status == 1 || failure.status == 2) {
-								isFailureLayer = true
-							}else{
-								isFailureLayer = false
-							}
-							newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
-						})
-						this.failureList = newFailureList
-					} else {
-						this.failureList = [];
-					}
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000);
-				})
-			},		
-			ischeckFailure(failure){
-				failure.productsChecked = !failure.productsChecked
-				this.updateCheckAllBtn()
-			},
-			ischeck(item,pro){//为未选中的时候改变为true,反之为true
-				pro.productsChecked = !pro.productsChecked;
-				if(pro.productsChecked) {
-					if(!this.submitIds.includes(pro.productID*1)){
-						this.submitIds.push(pro.productID);
-					}
-				} else {
-					var lent = this.submitIds.indexOf(pro.productID*1);
-					if(lent >=0 ){
-						this.submitIds.splice(lent, 1);
-					}
-				}
-				this.updateProductCheckedAllBtn(item);
-				this.updateCheckAllBtn();
-				
-			},
-			updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
-				let productsList = item.cartList,
-					productsCheckedLength = 0,
-					disabledLength = 0;
-				if(this.isshowDelbtn) {
-					productsList.forEach(pros => {
-						if(pros.productsChecked) {
-							productsCheckedLength++;
-						}
-					})
-				} else {
-					productsList.forEach(pros => {
-						if(pros.productsChecked) {
-							productsCheckedLength++;
-						}
-					})
-				}
-				item.checked = productsCheckedLength === productsList.length;
-			},
-			updateCheckAllBtn() {// 全选勾选判断
-				let goodsCheckedLength = 0,
-					goodsList = this.goodsList,
-					failureList = this.failureList;
-				goodsList.forEach(item => {
-					if(item.checked) {
-						goodsCheckedLength++;
-					}
-				})
-				failureList.forEach(failureItem=>{
-					if(failureItem.productsChecked){
-						goodsCheckedLength++;
-					}
-				})
-				if(this.isshowDelbtn){
-					this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length;
-				}else{
-					this.isCheckAll = goodsCheckedLength === goodsList.length;
-				}
-			},
-			checkShop(item){//与单选商品类似
-				item.checked = !item.checked;
-				this.setProductChecked(item);
-				this.updateCheckAllBtn();
-			},
-			setProductChecked(item) {
-				item.cartList.forEach(pros=>{
-					if(item.checked) {
-						pros.productsChecked = true;
-						if(!this.submitIds.includes(pros.productId*1)){
-							this.submitIds.push(pros.productId);
-						}
-					} else {
-						pros.productsChecked = false;
-						var lent = this.submitIds.indexOf(pros.productId*1);
-						if(lent >=0 ){
-							this.submitIds.splice(lent, 1);
-						}
-					}
-				})
-			},
-			updateBothCheckBtn() {
-				if(this.isshowDelbtn) {
-					// 当管理删除按钮出现时,失效的商品可被选择
-					this.goodsList.forEach((item)=>{
-						item.checked = this.isCheckAll;
-						this.setProductChecked(item);
-					})
-					//删除按钮 全选包括失效商品勾选
-					this.failureList.forEach(failureItem=>{
-						failureItem.productsChecked = this.isCheckAll;
-					})
-				} else {
-					this.goodsList.forEach((item)=>{
-						item.checked = this.isCheckAll && !item.isDisabled;
-						this.setProductChecked(item);
-					})
-				}
-			},
-			checkAll(){//全选方法内调用方法
-			    this.isCheckAll = !this.isCheckAll;
-				if(!this.isCheckAll){
-					this.popupShow1 = false
-				}
-				this.updateBothCheckBtn();     
-			},
-			totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
-				let touchPrice = 0;
-				let reducedPrice = 0;//商铺合计满减价
-				this.goodsList.map((item,index)=>{
-					//计算店铺满减后店铺合计
-					if(item.promotions && item.promotions.mode == 2){
-						let prosPrice=0;
-						let totalOriginalPrice = 0;//商铺合计原价
-						item.cartList.forEach(pros=>{
-							prosPrice += pros.price*pros.number
-							totalOriginalPrice += pros.originalPrice*pros.number
-						})
-						if(prosPrice >= item.promotions.touchPrice){
-							item.totalPrice = prosPrice - item.promotions.reducedPrice  
-							item.reducedPrice = item.promotions.reducedPrice
-							item.totalOriginalPrice = totalOriginalPrice
-						}else{
-							item.reducedPrice = 0  //统计合计价格
-							item.totalPrice = prosPrice
-						}
-					}else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
-						let _totalPrice = 0;
-						let _reducedPrice = 0;
-						let _totalOriginalPrice =0;
-						item.cartList.forEach(pros=>{
-							let _price = pros.price*pros.number
-							_totalOriginalPrice += pros.price*pros.number;
-							if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
-								if(_price >= pros.promotions.touchPrice){
-									_price = _price - pros.promotions.reducedPrice
-									_reducedPrice += pros.promotions.reducedPrice
-								}
-								_totalPrice +=  _price
-							}else{
-								_reducedPrice = 0;
-								_totalPrice += pros.price*pros.number;
-							}
-						})
-						item.reducedPrice = _reducedPrice
-						item.totalOriginalPrice = _totalOriginalPrice
-						item.totalPrice = _totalPrice
-					}
-				})
-			},
-			totalPeice(){//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
-				let totalPrice = 0;
-				let reducedPrice = 0;
-				let originalPrice = 0;
-				this.goodsList.forEach((item,index)=>{
-					let supplierPrice = 0;
-					let supplierReducedPrice = 0;
-					item.totalprice = 0;
-					item.reducedprice = 0;
-					item.originalprice = 0;
-					item.cartList.forEach(pros=>{	
-						if(pros.productsChecked){								
-							supplierPrice += pros.price*pros.number;
-							// 单品满减
-							if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
-								// 单品满减-重新计算供应商总价/满减金额
-								if(pros.price*pros.number >= pros.promotions.touchPrice){
-									supplierPrice -= pros.promotions.reducedPrice;
-									supplierReducedPrice += pros.promotions.reducedPrice;
-								}
-							}
-						}	
-					})
-					// 店铺满减
-					if(item.promotions && item.promotions.mode*1===2){
-						// 店铺满减-计算供应商总价/满减金额
-						if(supplierPrice >= item.promotions.touchPrice){
-							supplierPrice -= item.promotions.reducedPrice;
-							supplierReducedPrice += item.promotions.reducedPrice;
-						}
-					}
-					item.totalprice = supplierPrice;
-					item.reducedprice = supplierReducedPrice;
-					item.originalprice = (supplierPrice+supplierReducedPrice);
-					totalPrice += item.totalprice;
-					reducedPrice += item.reducedprice;
-					originalPrice += item.originalprice;
-				})
-				 //总促销计算
-				this.promotionsList.forEach(promotions =>{
-					// 凑单满减
-					if(promotions.mode*1===2 && promotions.type*1===2){
-						let total = 0;
-						 promotions.productList.forEach(pros=>{
-							if (this.submitIds.includes(pros.productId*1)){
-								total += pros.number * pros.price;
-							}
-						});
-						if(total>=promotions.touchPrice){
-							totalPrice -= promotions.reducedPrice;
-							reducedPrice += promotions.reducedPrice;
-						}
-					}
-				});
-				//最后统计商品原价
-				this.totalOriginalPrice = originalPrice;
-				//最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
-				this.reducedPrice = reducedPrice;
-				//最终合计价格 = 	店铺满减合计 + 单品满减  + 正常合计 + 凑单满减			
-				this.allPrice = totalPrice ;
-			},
-			totalCount(){//计算总数量
-			    this.allCount = 0
-				let prosAllCount=0
-				let validCount = 0
-				let validList =[];
-				let productsList =[];
-			    this.goodsList.forEach(item=>{
-					productsList = item.cartList
-					productsList.forEach(pros=>{
-						if(pros.productsChecked){
-							prosAllCount+=parseInt(pros.number);
-							this.allCount = prosAllCount
-						}
-					})
-			    })
-			},		
-			changeCountAdd(item,pros){//商品数量加加
-				if(pros.step === 2){
-					pros.isStep = false
-					pros.number += pros.min
-					this.processActivityPrice(pros)
-					this.isStock = false
-				}else{
-					pros.number++
-					this.processActivityPrice(pros)
-					this.isStock = false
-				}
-				this.updateShoppogNum(pros)
-				this.totalShopPeice();
-			},
-			changeCountSub(item,pros){//商品数量减减
-				if(pros.number<=pros.min){
-					pros.number= pros.min
-					this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
-					return
-				}else{
-					if(pros.step === 2){
-						pros.isStep = false
-						pros.number -= pros.min
-					}else{
-						pros.number--
-					}
-					this.processActivityPrice(pros)
-				}
-				this.updateShoppogNum(pros)
-				this.totalShopPeice();
-			},
-			changeInput(pros){//输入商品数量更新
-				pros.isStep = false
-			},
-			changeNnmber(e,item,pros){//输入商品数量更新
-				let _value = Number(e.detail.value);
-				if(!this.$api.isNumber(_value)){
-					pros.number = pros.min
-				}else if(_value < pros.min){	
-					this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
-					pros.number = pros.min
-				}else if(_value % pros.min != 0){
-					pros.isStep = true
-					pros.number = pros.min
-				}else{
-					pros.isStep = false
-					pros.number = e.detail.value
-					this.processActivityPrice(pros)
-				}
-				this.updateShoppogNum(pros)
-				this.totalShopPeice();
-			},
-			processActivityPrice(pros){//单独处理活动价格和阶梯价格
-				let ladderPriceList = pros.ladderPrices;
-				if(pros.ladderFlag == '0' || pros.actStatus == 1){
-					pros.price = pros.price
-				}else{
-					ladderPriceList.forEach((item,index)=>{
-						if(pros.number>=item.buyNum){
-							pros.price = item.buyPrice
-						}
-					})
-				}
-			},
-			updateShoppogNum(pros){//加减购物车商品更新到后台
-				let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
-				this.ProductService.ShoppingCartUpdate(params).then(response =>{
-					this.isshowDelbtn = false;
-					this.initGetCartGoodsList();
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000);
-				})
-			 },
-			toConfirmation(){//跳转确认订单页面			
-				let setGoodsList=[];
-				this.goodsList.forEach(res=>{
-					let products = res.cartList
-					products.forEach(pros=>{
-						if(pros.productsChecked){
-						    setGoodsList.push(pros.productId)
-						}
-					})
-				})
-				if(setGoodsList == ''){
-					this.$util.msg("请先选择结算商品~",2000);
-					return
-				}else{
-					this.isNoConfim = false
-					this.goodsList.forEach(el=>{
-						el.cartList.forEach(pros=>{
-							if(pros.productsChecked){
-							   if(pros.number<pros.min){
-								   this.isNoConfim = true
-							   }
-							}
-						})
-					})
-					if(this.isNoConfim){
-						this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
-						return;
-					}
-					let productID = '';
-					this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
-						el.cartList.forEach(pros=>{
-							if(pros.productsChecked){
-							   productID += pros.productId+','
-							}
-						})
-					})
-					let cartPramsData={
-							allPrice:this.allPrice,
-							allCount:this.allCount,
-							productID:productID.substring(0,productID.lastIndexOf(',')),
-							productCount:''
-						}
-					// 友盟埋点购物车去结算点击事件
-					if(process.env.NODE_ENV != 'development'){
-						this.$uma.trackEvent('Um_Event_shoppingCartConfirmOrder', {
-							Um_Key_PageName: '去结算',
-							Um_Key_SourcePage: '底部菜单购物车',
-						})
-					}	
-					this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
-				}
-			},
-			showDelManager(){//显示删除商品管理
-				this.isshowDelbtn = true;
-				if(this.isCheckAll) {
-					this.updateBothCheckBtn();	
-				} else {
-					this.goodsList.forEach(item => {
-						if(item.checked) {
-							item.cartList.forEach(pros => {
-								pros.productsChecked = true;
-							})
-						}
-					})
-					this.updateCheckAllBtn();
-				}
-				// 失效也被勾选
-				this.failureList.forEach(failureItem => {
-					if(failureItem.isFailureLayer){
-						failureItem.isFailureLayer = false
-					}
-				})
-			},
-			hideDelManage(){//隐藏删除商品管理			
-				this.isshowDelbtn = false;
-				let isFailureLayer,newFailureList =[];
-				if(this.isCheckAll) {
-					this.updateBothCheckBtn();	
-				} else {
-					// 失效商品取消勾选
-					this.goodsList.forEach(item => {
-						if(item.isDisabled) {
-							item.checked = false;
-						}
-						item.cartList.forEach(pros => {
-							if(pros.validFlag == 3) {
-								pros.productsChecked = false;
-							}
-						})
-					})
-					this.updateCheckAllBtn();
-				}
-				this.failureList.forEach((failure,index) => {
-					if(failure.failureState == 1 || failure.failureState == 2) {
-						isFailureLayer = true
-					}else{
-						isFailureLayer = false
-					}
-					newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
-				})
-				this.failureList = newFailureList;
-			},		
-			deleteList(){//删除购物车商品	
-				this.delGoodsList=[];
-				this.goodsList.forEach(delitem=>{
-					let products = delitem.cartList
-					products.forEach(pros=>{
-						if(pros.productsChecked){
-						    this.delGoodsList += pros.productId+','
-						}
-					})
-				})
-				this.failureList.forEach(failure=>{
-					if(failure.productsChecked){
-						this.delGoodsList += failure.productId+','
-					}
-				})
-				if(this.delGoodsList.length == 0){
-					this.$util.msg("请选择要删除的商品~",2000);
-					return
-				}else{			
-					this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
-						this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
-							this.$util.msg('删除成功',2000);
-							setTimeout(()=>{
-								this.isshowDelbtn = false;
-								this.initGetCartGoodsList();
-							},2000)
-						}).catch(error =>{
-							this.$util.msg(error.msg,2000)
-						})
-					})
-				}
-			},
-			deletefailureList(){
-				this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
-				this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
-					this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
-						this.$util.msg('删除成功',2000);
-						setTimeout(()=>{
-							this.isshowDelbtn = false;
-							this.initGetCartGoodsList();
-						},2000)
-					}).catch(error =>{
-						this.$util.msg(error.msg,2000)
-					})
-				})
-			},
-			goIndex(){
-				uni.switchTab({
-				    url: '/pages/tabBar/home/index'
-				});
-			},
-			goNavto(url){
-				uni.navigateTo ({
-					url
-				})
-			},
-			navToListPage(id){
-				this.isModallayer = true;
-				this.$api.navigateTo(`/pages/goods/product?id=${id}`)
-			},
-			failureToProduct(failure){
-				if(failure.status == 1){
-					this.$util.msg('商品已丢失,不能查看',2000)
-					return
-				}else if(failure.status == 2){
-					this.$util.msg('商品已停售,不能查看',2000)
-					return
-				}else{
-					this.isModallayer = true;
-					this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
-				}
-			},
-			failureStateText(state){
-				let stateText = '',
-					stateTextObject={
-						1:'商品已丢失',
-						2:'商品已停售',
-						3:'商品已下架',
-						4:'商品已售罄',
-						5:'价格仅会员可见,您不能购买',
-						6:'未公开价格',
-						7:'库存不足'
-					}
-				Object.keys(stateTextObject).forEach(key => {
-					if(key == state){
-						stateText = stateTextObject[key]
-					}
-				})
-				return stateText;
-			},
-			setHeaderBtnPosi(){
-				// 获得胶囊按钮位置信息
-				let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
-				return headerBtnPosi
-			},
-			setSysteminfo(){
-				let systeminfo;
-				uni.getSystemInfo({ // 获取设备信息
-					success: (res) => {
-						systeminfo = res
-					},
-				})
-				return systeminfo
-			},
-			PromotionsFormat(promo){//促销活动类型数据处理
-				if(promo!=null){
-					if(promo.type == 1 && promo.mode == 1){
-						return true
-					}else{
-						return false
-					}
-				}
-				return false
-			},
-			showPopup(index){// 显示popup弹窗
-				switch(index){
-					case 0:
-						this.popupShow0 = true
-						break;
-					case 1:
-						this.popupShow1 = true
-						break;
-				}
-			},
-			hidePopup(index){// 隐藏popup弹窗
-				switch(index){
-					case 0:
-						this.popupShow0 = false
-						break;
-					case 1:
-						this.popupShow1 = false
-						break;
-				}
-			},
-			couponChange(e) {
-				this.currentTab = e.index
-				console.log('currentTab',this.currentTab)
-				switch(this.currentTab){
-					case 0:
-						this.listClass = 'list-used'
-						break;
-					case 1:
-						this.listClass = 'list-none'
-						break;
-					case 2:
-						this.listClass = 'list-none'
-						break;
-					
-				}
-			},
-		},
-		watch:{//深度监听所有数据,每次改变重新计算总价和总数
-		    goodsList:{
-		        deep:true,
-		        handler(val,oldval){
-		            this.totalPeice()
-		            this.totalCount()
-		        }
-		    }
-		},
-		onPullDownRefresh() {//下拉刷新
-			this.initGetCartGoodsList()
-			uni.stopPullDownRefresh()
-		},
-		onShow(){
-			if(this.hasLogin){
-				this.initData()
-			}else{
-				this.initLogin()
-			}
-		},
-	}
-</script>
-
-<style lang="scss">
-	page{
-		background: #f7f7f7;
-		height: auto;
-	}
-	.cart-content{
-		position: relative;
-	}
-	.container-cart-main.none{
-		display: none;
-	}
-	.container-cart-main.show{
-		display: block;
-	}
-	.cart-content.empty.none{
-		display: none;
-	}
-	.cart-content.empty.show{
-		display: block;
-	}
-	.container-cart.show{
-		display: block;
-	}
-	.container-cart.none{
-		display: none;
-	}
-	.empty-container.none{
-		display: none;
-	}
-	.empty-container.show{
-		display: flex;
-	}
-	.foot-check-delbtn{
-		width: 100%;
-		height: 80rpx;
-		position: fixed;
-		top: 0;
-		left: 0;
-		box-sizing: border-box;
-		padding: 15rpx 24rpx;
-		background-color: #F7F7F7;
-		z-index: 990;
-		.foot-text{
-			font-size: $font-size-26;
-			height: 50rpx;
-			line-height: 50rpx;
-			color:#666666;
-			float: left;
-			padding-left: 10rpx;
-			text{
-				margin: 0 6rpx;
-			}
-		}
-		.delBtn{
-			width: 100rpx;
-			display: inline-block;
-			padding: 0 15rpx;
-			font-size: $font-size-26;
-			height: 50rpx;
-			line-height: 50rpx;
-			border-radius: 30rpx;
-			background:#FFFFFF;
-			border: 1px solid #e15616;
-			color: #E15616;
-			float: right;
-			text-align: center;
-			&.none{
-				display: none;	
-			}
-		}
-	}
-	.checkbox-box{
-		display: flex;
-		align-items: center;
-		.checkbox{
-			display: flex;
-			margin: 0;
-			padding: 5rpx;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			box-sizing: border-box;
-			text-align: center;
-			text-decoration: none;
-			border-radius: 0;
-			-webkit-tap-highlight-color: transparent;
-			overflow: hidden;
-			background-color:#FFFFFF;
-			font-size: 36rpx;
-			color:#999999;
-			&.icon-yixuanze{
-				color: $color-system;
-			}
-		}
-		&.disabled{
-			.checkbox{
-				color:#999999
-			}
-		}
-		.text{
-			font-size: $font-size-24;
-			margin-left: 10rpx;
-		}
-	}
-	.goods-list{
-		width: 100%;
-		height: auto;
-		background-color: #F7F7F7;
-		.goods-item{
-			width: 702rpx;
-			padding: 0 24rpx;
-			background: #FFFFFF;
-			margin-bottom: 24rpx;
-		}
-		.shoptitle{
-			height: 80rpx;
-			line-height: 80rpx;
-			.checkbox-box{
-				float: left;
-				height: 80rpx;
-				line-height: 80rpx;
-				display: inline-block;
-				box-sizing: border-box;
-				margin-left: 10rpx;
-			}
-			.text{
-				width: 400rpx;
-				float: left;
-				display: block;
-				overflow: hidden;
-				text-overflow:ellipsis;
-				white-space: nowrap;
-				line-height: 80rpx;
-				margin-left: 20rpx;
-				font-size: $font-size-28;
-				color: $text-color;
-				text-align: left;
-				font-weight: bold;
-			}
-			.text-coupon{
-				float: right;
-				line-height: 80rpx;
-				font-size: $font-size-30;
-				color: #e15616;
-			}
-			.floor-item-act{
-				width: 120rpx;
-				height: 80rpx;
-				text-align: center;
-				box-sizing: border-box;
-				float: left;
-				padding: 24rpx 0;
-				margin-left: 20rpx;
-				.floor-tags{
-					height: 28rpx;
-					border-radius: 6rpx;
-					background-color: #FFFFFF;
-					line-height: 28rpx;
-					color: $color-system;
-					text-align: center;
-					display: inline-block;
-					padding:0 16rpx;
-					font-size: $font-size-20;
-					border: 1px solid #E15616;
-					float: right;
-				}
-			}
-		}
-		.goods-pros{
-			width: 100%;
-			height: auto;
-			margin-bottom: 20rpx;
-		}	
-		.goods-pros-t{
-			display: flex;
-			align-items: center;
-			width: 100%;
-			height: 210rpx;
-			padding:0 0 26rpx 0;
-			.checkbox-box{
-				padding: 10rpx;
-			}
-			.pros-img{
-				width: 210rpx;
-				height: 100%;
-				border-radius: 10rpx;
-				margin:0 20rpx;
-				border:1px solid #f3f3f3;
-				image{
-					width: 100%;
-					height: 100%;
-					border-radius: 10rpx;
-				}
-			}
-		}
-		.goods-pros-b{
-			width:100%;
-			height: auto;
-			padding:0 0 24rpx 0;
-			box-sizing: border-box;
-			&.show{
-				display: block;
-			}
-			&.none{
-				display: none;
-			}
-			.sum-none{
-				width: 100%;
-				height: 48rpx;
-				line-height: 48rpx;
-				color: $text-color;
-				float: left;
-				text-align: right;
-				.money{
-					font-size: $font-size-26;
-					color: #999999;
-					text-decoration: line-through;
-				}
-				.money-sign{
-					font-size: $font-size-26;
-					color: #999999;
-					text-decoration: line-through;
-				}
-				.money-reduced{
-					margin-left: 10rpx;
-					font-size: $font-size-26;
-					color: $color-system;
-					.iconfont{
-						font-size: $font-size-34;
-					}
-				}
-			}
-			.sum{
-				width: 100%;
-				height: 40rpx;
-				font-size: $font-size-26;
-				line-height: 40rpx;
-				color: $text-color;
-				float: left;
-				display: flex;
-				justify-content: flex-end;
-				font-weight: bold;
-				.money{
-					color: #FF2A2A;
-					font-size: $font-size-26;
-				}
-				.money-sign{
-					font-size: $font-size-24;
-					color: #FF2A2A;
-				}
-			}
-		}
-		.pros-product{
-			width: 416rpx;
-			height: 100%;
-			line-height: 36rpx;
-			font-size: $font-size-28;	
-			position: relative;
-			.producttitle{
-				width: 100%;
-				display: inline-block;
-				height: auto;							
-				text-overflow:ellipsis;
-				display: -webkit-box;
-				word-break: break-all;
-				-webkit-box-orient: vertical;
-				-webkit-line-clamp: 2;
-				overflow: hidden;
-				margin-bottom: 15rpx;
-				.no-text{
-					display: inline-block;
-					height:36rpx;
-					padding: 0 12rpx;
-					line-height: 36rpx;
-					background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
-					border-radius:18rpx;
-					text-align: center;
-					color: #FFFFFF;
-					font-size:$font-size-28;
-					margin-right: 24rpx;
-				}
-			}
-			.productspec{
-				height: 36rpx;
-				color: #999999;
-				font-size: $font-size-26;
-			}
-			.productprice{
-				width: 100%;
-				height: 48rpx;
-				margin: 30rpx 0 0 0;
-				.price{
-					line-height: 48rpx;
-					font-size: $font-size-26;
-					width: 48%;
-					color: #FF2A2A;
-					float: left;
-					font-weight: bold;
-					&.disabled{
-						color: #999999;
-						text-decoration: line-through;
-					}
-					.money-sign{
-						font-size: $font-size-24;
-						color: #FF2A2A;
-					}
-				}
-				.count{
-					height: 100%;
-					float: right;
-					position: relative;
-					&.show{
-						display: block;
-					}
-					&.none{
-						display: none;
-					}
-					.count-tips{
-						width: auto;
-						display: inline-block;
-						padding: 0 15rpx;
-						line-height: 44rpx;
-						height: 44rpx;
-						border-radius: 22rpx;
-						background: $btn-confirm;
-						font-size: $font-size-24;
-						text-align: center;
-						color: #FFFFFF;
-						position: absolute;
-						top:-60rpx;
-						left: -5rpx; 
-						z-index: 5;
-						&.step{
-							left:-217rpx
-						}
-						&::before{
-							content: "";
-							position: absolute;
-							bottom: -30rpx;
-							right: 15rpx;
-							z-index:1;
-							width: 0; 
-							height: 0;
-							border-width: 18rpx;
-							border-style: solid;
-							border-color:$color-system transparent transparent transparent;
-						}
-					}
-					.number-box{
-						display: flex;
-						justify-content: center;
-						align-items: center;
-						border: 2rpx solid #ffe6dc;
-						border-radius: 30rpx;
-						.iconfont{
-							font-size: $font-size-24;
-							padding:0 18rpx;
-							color: #999999;
-							text-align: center;
-							line-height: 48rpx;
-							font-weight: bold;
-							background: #fef6f3;
-							&.icon-jianhao{
-								border-radius: 30rpx 0 0 30rpx;
-							}
-							&.icon-jiahao{
-								border-radius: 0 30rpx 30rpx 0;
-							}
-						}
-						.btn-input{
-							width: 62rpx;
-							height: 48rpx;
-							line-height: 48rpx;
-							background: #fff;
-							border-radius: 4rpx;
-							text-align: center;
-							font-size: $font-size-24;
-						}
-					}
-					.uni-numbox{
-						position: absolute;
-						left: 45rpx;
-						bottom: 0;
-						.uni-numbox-minus, .uni-numbox-plus{
-							width: 50rpx;
-							line-height: 40rpx;
-						}
-						.uni-numbox-value {
-							font-size: $font-size-28;
-							width: 60rpx;
-						}
-					}
-				}
-			}
-			.floor-item-act{
-				width: 100%;
-				height: 56rpx;
-				text-align: center;
-				box-sizing: border-box;
-				float: left;
-				padding:0 0 10rpx 0;
-				margin-left: 10rpx;
-			}
-		}
-	}
-	.failure-list{
-		width: 702rpx;
-		height: auto;
-		padding: 0 24rpx;
-		margin-top: 20rpx;
-		background: #FFFFFF;
-		.failure-title{
-			width: 100%;
-			height: 82rpx;
-			line-height: 82rpx;
-			font-size: $font-size-28;
-			border-bottom: 1px solid #EBEBEB;
-			.title-txt{
-				float: left;
-				color:#666666;
-				text-align: left;
-			}
-			.title-btn{
-				float: right;
-				color: $color-system;
-				text-align: right;
-				line-height: 80rpx;
-				.butto{
-					display: inline-block;
-					padding: 0 15rpx;
-					font-size: $font-size-26;
-					height: 50rpx;
-					line-height: 50rpx;
-					border-radius: 30rpx;
-					background:#FFFFFF;
-					// border: 1px solid #C9C9C9;
-					// color: #999999;
-					margin-top: 15rpx;
-				}
-			}
-		}
-		.productlist{
-			padding-top: 10rpx;
-			.goods-pros{
-				width: 100%;
-				height: auto;
-				padding: 20rpx 0;
-			}	
-			.goods-pros-t{
-				display: flex;
-				align-items: center;
-				width: 100%;
-				height: 210rpx;
-				position: relative;
-				.img-tip{
-					display: block;
-					width: 72rpx;
-					height: 36rpx;
-					line-height: 36rpx;
-					font-size: $font-size-24;
-					text-align: center;
-					color: #FFFFFF;
-					border-radius: 24rpx;
-					background:rgba(51,51,51,0.3);
-					// position: absolute;
-					// left: 0;
-					// top: 0;
-				}
-				.checkbox-box{
-					padding: 10rpx;
-				}
-				.pros-img{
-					width: 180rpx;
-					height: 100%;
-					border-radius: 10rpx;
-					margin:0 20rpx;
-					border:1px solid #f3f3f3;
-					position: relative;
-					image{
-						width: 100%;
-						height: 100%;
-						border-radius: 10rpx;
-					}
-				}
-				.pros-marks{
-					width: 730rpx;					height: 250rpx;
-					z-index: 90;
-					background: rgba(0,0,0,.05);
-					position: absolute;
-					left:-20rpx;
-					top: -20rpx;
-				}
-			}
-			.goods-pros-b{
-				width:622rpx;
-				margin-left: 84rpx;
-				height: 40rpx;
-				padding:0 0 26rpx 0;
-				// border-top: 1px solid #EBEBEB;
-				&.show{
-					display: block;
-				}
-				&.none{
-					display: none;
-				}
-				.sum{
-					font-size: $font-size-28;
-					line-height: 40rpx;
-					color: $text-color;
-					display: flex;
-					justify-content: flex-end;
-					.money{
-						color: #FF2A2A;
-						font-size: $font-size-28;
-					}
-					.money-sign{
-						font-size: $font-size-24;
-						color: #FF2A2A;
-					}
-				}
-			}
-			.pros-product{
-				width: 402rpx;
-				height: 100%;
-				line-height: 36rpx;
-				font-size: $font-size-28;	
-				position: relative;
-				.producttitle{
-					width: 100%;
-					display: inline-block;
-					height: auto;							
-					text-overflow:ellipsis;
-					display: -webkit-box;
-					word-break: break-all;
-					-webkit-box-orient: vertical;
-					-webkit-line-clamp: 2;
-					overflow: hidden;
-					margin-bottom: 8rpx;
-					.no-text{
-						display: inline-block;
-						height:36rpx;
-						padding: 0 12rpx;
-						line-height: 36rpx;
-						background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
-						border-radius:18rpx;
-						text-align: center;
-						color: #FFFFFF;
-						font-size: $font-size-28;
-						margin-right: 24rpx;
-					}
-				}
-				.productspec{
-					height: 36rpx;
-					color: #999999;
-					font-size: $font-size-26;
-					margin-top: 20rpx;
-				}
-				.productstate{
-					font-size: $font-size-28;
-					height: 44rpx;
-					color: #FF2A2A;
-					position: absolute;
-					bottom: 0;
-					left: 0;
-				}
-			}
-		}
-	}
-	.tui-popup-box {
-		position: relative;
-		box-sizing: border-box;
-		min-height: 220rpx;
-		padding:24rpx 24rpx 0 24rpx;
-		.tui-popup-close{
-			width: 90rpx;
-			height: 90rpx;
-			position: absolute;
-			right: 0;
-			top: 24rpx;
-			line-height: 90rpx;
-			text-align: center;
-			color: #b2b2b2;
-			.icon-iconfontguanbi{
-				font-size: $font-size-40;
-			}
-		}
-		.title{
-			font-size: $font-size-34;
-			color: $text-color;
-			line-height: 88rpx;
-			text-align: center;
-			float: left;
-			width: 100%;
-			height: 88rpx;
-			font-weight: bold;
-		}
-		.tui-popup-main{
-			width: 100%;
-			float: left;
-			&.coupon{
-				padding-bottom: 40rpx;
-			}
-			.tui-popup-scroll{
-				width: 100%;
-				height: 600rpx;
-				.coupon-list{
-					width: 100%;
-					height: 200rpx;
-					margin-top: 24rpx;
-					box-sizing: border-box;
-					background: url(https://static.caimei365.com/app/img/icon/icon-coupon-uesb@2x.png);
-					background-size: cover;
-					&:last-child{
-						margin-bottom: 24rpx;
-					}
-					.list-cell-le{
-						width: 224rpx;
-						height: 100%;
-						box-sizing: border-box;
-						padding: 37rpx 0;
-						float: left;
-						.coupon-maxMoney{
-							width: 100%;
-							height: 78rpx;
-							line-height: 78rpx;
-							font-size: 56rpx;
-							color: #FFFFFF;
-							text-align: center;
-							.small{
-								font-size: $font-size-24;
-							}
-						}
-						.coupon-minMoney{
-							width: 100%;
-							height: 33rpx;
-							line-height: 33rpx;
-							font-size: $font-size-24;
-							color: #FFFFFF;
-							text-align: center;
-						}
-					}
-					.list-cell-ri{
-						width: 478rpx;
-						height: 100%;
-						box-sizing: border-box;
-						padding: 20rpx 24rpx 0 24rpx;
-						float: right;
-						.list-cell-top{
-							width: 100%;
-							height: 121rpx;
-							float: left;
-							border-bottom: 1px solid #e1e1e1;
-							.list-cell-type{
-								width: 286rpx;
-								height: 100%;
-								float: left;
-								.list-cell-tags{
-									width: 100%;
-									height: 32rpx;
-									margin-bottom: 7rpx;
-									.tags{
-										display: inline-block;
-										padding: 0 10rpx;
-										height: 32rpx;
-										line-height: 32rpx;
-										background-color: #ffdcce;
-										color: #f94b4b;
-										font-size: $font-size-20;
-										border-radius: 8rpx;
-										text-align: center;
-										float: left;
-									}
-								}
-								.list-cell-texts{
-									width: 100%;
-									height: auto;
-									line-height:35rpx;
-									text-overflow:ellipsis;
-									display: -webkit-box;
-									word-break: break-all;
-									-webkit-box-orient: vertical;
-									-webkit-line-clamp: 2;
-									overflow: hidden;
-									font-size: 26rpx;
-									color: #333333;
-								}
-							}
-							.list-cell-btn{
-								width: 128rpx;
-								height: 100%;
-								float: right;
-								.icon-used{
-									width: 100%;
-									height: 100%;
-									box-sizing: border-box;
-									padding-top: 57rpx;
-									.icon-used-btn{
-										width: 128rpx;
-										height: 48rpx;
-										border-radius: 28rpx;
-										line-height: 48rpx;
-										font-size: $font-size-26;
-										text-align: center;
-										&.receive{
-											background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);;
-											color: #FFFFFF;
-										}
-										&.make{
-											border: solid 1px #f94b4b;
-											color: #f94b4b;
-										}
-									}
-								}
-							}
-						}
-						.list-cell-time{
-							width: 100%;
-							height: 58rpx;
-							line-height: 58rpx;
-							text-align: left;
-							font-size: $font-size-20;
-							color: #999999;
-						}
-					}
-				}
-			}	
-			.tui-popup-coupon{
-				width: 100%;
-				height: 500rpx;
-				box-sizing: border-box;
-				padding:30rpx 20rpx;
-				.tui-popup-h1{
-					width: 100%;
-					height: 66rpx;
-					display: flex;
-					align-items: center;
-					.tui-popup-text{
-						flex: 1;
-						height: 66rpx;
-						line-height: 66rpx;
-						font-size: $font-size-30;
-						color: #333333;
-						&.red{
-							color: #f94b4b;
-						}
-						&.bold{
-							font-weight: bold;
-						}
-						&.left{
-							text-align: left;
-						}
-						&.right{
-							text-align: right;
-						}
-					}
-				}
-			}
-		}
-	}			
-	.footer{
-		width: 100%;
-		background-color: #FFFFFF;
-		height: 110rpx;
-		position: fixed;
-		bottom: 0rpx;
-		z-index: 990;
-		.footer-le{
-			width: 520rpx;
-			height: 100%;
-			padding-left: 24rpx;
-			float: left;
-			box-sizing: border-box;
-			.foot-check{
-				width: 100rpx;
-				float: left;
-				line-height: 110rpx;
-				font-size: $font-size-24;
-				.checkbox{
-					width: 40rpx;
-					text-align: center;
-				}
-				.text{
-					width: 60rpx;
-					float: right;
-				}
-			}
-			.sum{
-				width: 360rpx;
-				height: 110rpx;
-				float: right;
-				box-sizing: border-box;
-				padding: 10rpx;
-				.sum-none{
-					width: 100%;
-					height: 45rpx;
-					line-height: 45rpx;
-					color: $text-color;
-					float: left;
-					text-align: left;
-					.money{
-						font-size: $font-size-24;
-						color: #999999;
-						text-decoration: line-through;
-					}
-					.money-sign{
-						font-size: $font-size-24;
-						color: #999999;
-						text-decoration: line-through;
-					}
-					.money-reduced{
-						margin-left: 10rpx;
-						font-size: $font-size-24;
-						color: #FF2A2A;
-					}
-					.money-popup{
-						height: 45rpx;
-						line-height: 45rpx;
-						display: inline-block;
-						float: right;
-						font-size: $font-size-24;
-						color: #FF2A2A;
-						.icon-xiangshangjiantou{
-							font-size: $font-size-30;
-							margin-left: 5rpx;
-						}
-					}
-				}
-				.sum-price{
-					width: 100%;
-					height: 45rpx;
-					line-height: 45rpx;
-					font-size: $font-size-30;
-					color: $text-color;
-					float: left;
-					font-weight: normal;
-					text-align: left;
-					&.none{
-						height: 90rpx;
-						line-height: 90rpx;
-					}
-					.money{
-						color: #FF2A2A;
-					}
-					.money-sign{
-						font-size: $font-size-24;
-						color: #FF2A2A;
-					}
-				}
-			}
-		}
-		.footer-ri{
-			width: 230rpx;
-			height: 100%;
-			float: right;
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			z-index: 999;
-			box-sizing: border-box;
-			padding: 13rpx 15rpx 13rpx 5rpx;
-			&.none{
-				display: none;
-			}
-			.btn{
-				width: 200rpx;
-				height: 100%;
-				background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
-				font-size: $font-size-28;
-				line-height: 84rpx;
-				color: #FFFFFF;
-				display: flex;
-				border-radius: 42rpx;
-				justify-content: center;
-				align-items: center;
-			}
-		}
-		.footer-del{
-			width: 400rpx;
-			height: 110rpx;
-			position: absolute;
-			padding-left: 200rpx;
-			background: #FFFFFF;
-			right: 0;
-			top: 0;
-			z-index: 1000;
-			&.show{
-				animation: showDelbtn 0s linear both;
-			}
-			&.none{
-				animation: hideDelbtn 0s linear both;
-			}
-			.btn{
-				width: 50%;
-				height: 100%;
-				line-height: 110rpx;
-				font-size: $font-size-28;
-				color: #FFFFFF;
-				text-align: center;
-				float: left;
-			}
-			.btn.btn-cancel{
-				background:#EEC1AB;
-			}
-			.btn.btn-confirm{
-				background:#FF2A2A;
-			}
-			@keyframes showDelbtn {
-				0% {
-					transform: translateX(0);
-				}
-				100% {
-					transform: translateX(-100%);
-				}
-			}
-			@keyframes hideDelbtn {
-				0% {
-					transform: translateX(-100%);
-				}
-				100% {
-					transform: translateX(0);
-				}
-			}
-		}
-	}
-</style>

+ 153 - 0
pages/tabBar/home/index.js

@@ -0,0 +1,153 @@
+// 首页数据
+import Vue from 'vue'
+import { mapState,mapMutations} from 'vuex'
+import authorize from '@/common/config/authorize.js'
+const homeMiXins = {
+    data() {
+        return {
+            bankInfo:{}
+        }
+    },
+    computed: {
+        ...mapState(['hasLogin', 'userInfo', 'identity', 'isActivity', 'isWxAuthorize'])
+    },
+    methods: {
+        ...mapMutations(['login', 'logout','updateNoticeNum','updateRossShow']),
+        async GetWxAuthorize() {
+        	const wechatCode = await authorize.getCode('weixin') // 根据微信的code获取用户登录状态:1已登录过 -1未登录过
+        	const getUserInfo = await authorize.getUserInfo('weixin')
+        	this.UserService.UserLoginAuthApplets({
+        		code: wechatCode,
+        		encryptedData: getUserInfo.encryptedData,
+        		iv: getUserInfo.iv
+        	})
+        		.then(response => {
+        			this.isLogin = true
+        			this.userID = response.data.userId
+        			this.clubId = response.data.clubId
+        			this.userIdentity = response.data.userIdentity
+        			this.clubStatus = response.data.clubStatus
+        			this.$store.commit('updateStatus', response.data)
+        			this.login(response.data)
+        			uni.setStorageSync('token', response.data.token)
+        			uni.setStorageSync('unionId', response.data.unionId)
+        			if (response.data.userIdentity == 1) {
+        				this.$api.redirectTo('/pages/seller/index/index')
+        			} else if (response.data.userIdentity === 3) {
+        				this.$api.redirectTo('/pages/supplier/index/index')
+        			}
+        			this.updateRossShow()
+        			this.GetInitBeansInfo()
+        			this.getHomeInformation()
+        		})
+        		.catch(error => {
+        			this.isLogin = false
+        			this.logout()
+        			uni.setStorageSync('unionId', error.data.unionId)
+        			this.$store.commit('updateStatus', error.data)
+        			this.updateRossShow()
+        			this.getHomeInformation()
+        		})
+        },
+        GetHomeTopDataInfo() {
+        	//直播、活动、文章模块
+        	this.CommonService.GetHomeTopDataInfo({ source: 2 })
+        		.then(response => {
+        			this.templateData = response.data
+        			this.isLiveRequest = true
+        		})
+        		.catch(error => {
+        			this.$util.msg(error.msg, 2000)
+        		})
+        },
+        GetHomeFloorInfo() {
+        	//初始化首页楼层数据
+        	this.CommonService.GetHomeDataInfo({ userId: this.userID, source: 2 })
+        		.then(response => {
+        			let data = response.data
+        			this.pageList = data.homePageFloor
+        			this.hotListPageFloor = data.pageFloorList
+        			this.supplierObj = data.supplierImage
+        			setTimeout(() => {
+        				this.isRequest = true
+        			}, 500)
+        		})
+        		.catch(error => {
+        			this.$util.msg(error.msg, 2000)
+        		})
+        },
+        GetInitBeansInfo() {
+        	//初始化采美豆信息
+        	this.UserService.GetHomeObtainBeans({ userId: this.userID })
+        		.then(response => {
+        			this.beansType = response.data.beansType
+        			this.beanNumber = response.data.num
+        			this.isActivityBean = true
+        		})
+        		.catch(error => {
+        			console.log('用户暂无采美豆推送~')
+        		})
+        },
+        getHomeInformation() {
+        	//初始化首页数据
+        	this.CommonService.GetHomeModulesDataInfo({ source: 2 })
+        		.then(res => {
+        			let data = res.data
+        			this.bannerImageList = data.bannerList
+        			this.mallPageModules = data.mallPageModules
+        			this.skeletonShow = false
+        			this.navBarsList = data.topMenuList
+        			this.couponEntry = data.couponEntry
+        			this.newsList = data.annlist
+        			if (!this.hasLogin && this.couponEntry == 1) {
+        				if (uni.getStorageSync('isActivitySwitch')) {
+        					this.$store.commit('setActivity', false)
+        				} else {
+        					this.$store.commit('setActivity', true)
+        				}
+        			}
+        			this.GetHomeTopDataInfo()
+        			this.GetHomeFloorInfo()
+        			if (this.hasLogin) {
+        				this.initShoppingCartCount()
+        				this.updateNoticeNum()
+        			}
+        			this.isNavRequest = true
+        		})
+        		.catch(error => {
+        			this.$util.msg(error.msg, 2000)
+        		})
+        },
+        initShoppingCartCount() {
+        	// 获取购物车数量
+        	this.OrderService.ShoppingCartCount({ userId: this.userID }).then(res => {
+        		this.$store.commit('updateAllNum', res.data)
+        	})
+        },
+        handleClick(data) {
+        	const pageId = 306
+        	this.$api.navigateTo('/pages/user/coupon/coupon-collection')
+        	this.$store.commit('setActivity', data)
+        	uni.setStorageSync('lockTime', Date.now())
+        	uni.setStorageSync('isActivitySwitch', true)
+        	// 友盟自定义事件
+        	// if(process.env.NODE_ENV != 'development'){
+        	// 	this.$uma.trackEvent('meibohui_click', {
+        	// 		Um_Key_PageName: '美博会',
+        	// 		Um_Key_PageCategory: '活动专题页面',
+        	// 		Um_Key_SourcePage: '首页',
+        	// 	})
+        	// }
+        },
+        handleCancelClick(data) {
+        	this.$store.commit('setActivity', data)
+        	uni.setStorageSync('lockTime', Date.now())
+        	uni.setStorageSync('isActivitySwitch', true)
+        },
+        handleBeanlClick() {
+        	this.isActivityBean = false
+        }
+    }
+}
+
+export default homeMiXins

+ 3 - 144
pages/tabBar/home/index.vue

@@ -51,7 +51,7 @@
 </template>
 
 <script>
-import authorize from '@/common/config/authorize.js'
+import { mapState, mapMutations } from 'vuex'
 import customer from '@/components/cm-module/homeIndex/customer.vue'
 import banner from '@/components/cm-module/homeIndex/banner.vue'
 import navbars from '@/components/cm-module/homeIndex/navbars.vue'
@@ -64,8 +64,9 @@ import pageSpecial from '@/components/cm-module/homeIndex/pageSpecial.vue'
 import supplierList from '@/components/cm-module/homeIndex/supplierList.vue'
 import activityAlert from '@/components/cm-module/activity/activity.vue'
 import activityBean from '@/components/cm-module/activity/activityBean.vue'
-import { mapState, mapMutations } from 'vuex'
+import homeMiXins from './index.js'
 export default {
+	mixins: [ homeMiXins ], 
 	components: {
 		customer,
 		banner,
@@ -97,7 +98,6 @@ export default {
 			clubStatus: '',
 			current: 0,
 			mode: 'round',
-			modallayer: false,
 			isLogin: false,
 			skeletonShow: true,
 			userIdentity: 0,
@@ -121,146 +121,6 @@ export default {
 		}
 	},
 	onLoad() {},
-	computed: {
-		...mapState(['hasLogin', 'userInfo', 'identity', 'isActivity', 'isWxAuthorize'])
-	},
-	methods: {
-		...mapMutations(['login', 'logout','updateNoticeNum','updateRossShow']),
-		async GetWxAuthorize() {
-			const wechatCode = await authorize.getCode('weixin') // 根据微信的code获取用户登录状态:1已登录过 -1未登录过
-			const getUserInfo = await authorize.getUserInfo('weixin')
-			this.UserService.UserLoginAuthApplets({
-				code: wechatCode,
-				encryptedData: getUserInfo.encryptedData,
-				iv: getUserInfo.iv
-			})
-				.then(response => {
-					this.isLogin = true
-					this.userID = response.data.userId
-					this.clubId = response.data.clubId
-					this.userIdentity = response.data.userIdentity
-					this.clubStatus = response.data.clubStatus
-					this.$store.commit('updateStatus', response.data)
-					this.login(response.data)
-					uni.setStorageSync('token', response.data.token)
-					uni.setStorageSync('unionId', response.data.unionId)
-					if (response.data.userIdentity == 1) {
-						this.$api.redirectTo('/pages/seller/index/index')
-					} else if (response.data.userIdentity === 3) {
-						this.$api.redirectTo('/pages/supplier/index/index')
-					}
-					this.updateRossShow()
-					this.GetInitBeansInfo()
-					this.getHomeInformation()
-				})
-				.catch(error => {
-					this.isLogin = false
-					this.logout()
-					uni.setStorageSync('unionId', error.data.unionId)
-					this.$store.commit('updateStatus', error.data)
-					this.updateRossShow()
-					this.getHomeInformation()
-				})
-		},
-		GetHomeTopDataInfo() {
-			//直播、活动、文章模块
-			this.CommonService.GetHomeTopDataInfo({ source: 2 })
-				.then(response => {
-					this.templateData = response.data
-					this.isLiveRequest = true
-				})
-				.catch(error => {
-					this.$util.msg(error.msg, 2000)
-				})
-		},
-		GetHomeFloorInfo() {
-			//初始化首页楼层数据
-			this.CommonService.GetHomeDataInfo({ userId: this.userID, source: 2 })
-				.then(response => {
-					let data = response.data
-					this.pageList = data.homePageFloor
-					this.hotListPageFloor = data.pageFloorList
-					this.supplierObj = data.supplierImage
-					setTimeout(() => {
-						this.isRequest = true
-					}, 500)
-				})
-				.catch(error => {
-					this.$util.msg(error.msg, 2000)
-				})
-		},
-		GetInitBeansInfo() {
-			//初始化采美豆信息
-			this.UserService.GetHomeObtainBeans({ userId: this.userID })
-				.then(response => {
-					this.beansType = response.data.beansType
-					this.beanNumber = response.data.num
-					this.isActivityBean = true
-				})
-				.catch(error => {
-					console.log('用户暂无采美豆推送~')
-				})
-		},
-		getHomeInformation() {
-			//初始化首页数据
-			this.CommonService.GetHomeModulesDataInfo({ source: 2 })
-				.then(res => {
-					let data = res.data
-					this.bannerImageList = data.bannerList
-					this.mallPageModules = data.mallPageModules
-					this.skeletonShow = false
-					this.navBarsList = data.topMenuList
-					this.couponEntry = data.couponEntry
-					this.newsList = data.annlist
-					if (!this.hasLogin && this.couponEntry == 1) {
-						if (uni.getStorageSync('isActivitySwitch')) {
-							this.$store.commit('setActivity', false)
-						} else {
-							this.$store.commit('setActivity', true)
-						}
-					}
-					this.GetHomeTopDataInfo()
-					this.GetHomeFloorInfo()
-					if (this.hasLogin) {
-						this.initShoppingCartCount()
-						this.updateNoticeNum()
-					}
-					this.isNavRequest = true
-				})
-				.catch(error => {
-					this.$util.msg(error.msg, 2000)
-				})
-		},
-		initShoppingCartCount() {
-			// 获取购物车数量
-			this.OrderService.ShoppingCartCount({ userId: this.userID }).then(res => {
-				this.$store.commit('updateAllNum', res.data)
-			})
-		},
-		handleClick(data) {
-			const pageId = 306
-			this.$api.navigateTo('/pages/user/coupon/coupon-collection')
-			this.$store.commit('setActivity', data)
-			uni.setStorageSync('lockTime', Date.now())
-			uni.setStorageSync('isActivitySwitch', true)
-			// 友盟自定义事件
-			// if(process.env.NODE_ENV != 'development'){
-			// 	this.$uma.trackEvent('meibohui_click', {
-			// 		Um_Key_PageName: '美博会',
-			// 		Um_Key_PageCategory: '活动专题页面',
-			// 		Um_Key_SourcePage: '首页',
-			// 	})
-			// }
-		},
-		handleCancelClick(data) {
-			this.$store.commit('setActivity', data)
-			uni.setStorageSync('lockTime', Date.now())
-			uni.setStorageSync('isActivitySwitch', true)
-		},
-		handleBeanlClick() {
-			this.isActivityBean = false
-		}
-	},
 	onPageScroll(e) {
 		//实时获取到滚动的值
 		if (e.scrollTop > 50) {
@@ -291,7 +151,6 @@ export default {
 		}
 	},
 	onShow() {
-		this.modallayer = false
 		this.autoplay = true
 		this.GetWxAuthorize()
 	},

+ 21 - 0
plugins/mp-html/config.js

@@ -0,0 +1,21 @@
+// 富文本文案样式 公告文章 商品详情 项目详情
+export const productTagStyle = {
+    div: 'line-height: 58rpx;margin-bottom: 10rpx;font-size: 28rpx;',
+    h4: 'line-height: 54rpx;font-size: 30rpx;color:#666666;padding: 0 20rpx;font-weight: normal;',
+    h3: 'line-height: 54rpx;font-size: 30rpx;color:#666666;padding: 0 20rpx;font-weight: normal;',
+    h2: 'line-height: 54rpx;font-size: 30rpx;color:#666666;padding: 0 20rpx;font-weight: normal;',
+    p: 'line-height: 54rpx;font-size: 30rpx;color:#666666;padding: 0 20rpx;',
+    a: 'line-height: 54rpx;font-size: 30rpx;color:#666666;',
+    span: 'line-height: 54rpx;font-size: 30rpx;color:#666666;',
+    img: 'width: 100%;height: auto;'
+}
+export const articleTagStyle = {
+    div:'line-height: 58rpx;margin-bottom: 10rpx;font-size: 28rpx;',
+    h4:'line-height: 54rpx;font-size: 30rpx;color:#666666;',
+    h3:'line-height: 54rpx;font-size: 30rpx;color:#666666;',
+    h2:'line-height: 54rpx;font-size: 30rpx;color:#666666;',
+    p:'line-height: 50rpx;font-size: 30rpx;color:#666666;',
+    a:'line-height: 50rpx;font-size: 30rpx;color:#666666;',
+    span:'line-height: 50rpx;font-size: 30rpx;color:#666666;',
+    img:'width: 100%;height: auto;'
+}