commit 71a7cadeed654249b0c60f1a10060c1637944eaf
Author: wuhui_zzw <1760308791@qq.com>
Date: Thu Sep 7 09:58:40 2023 +0800
初始化
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..10b731c
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,5 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..3f5c741
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+ {{ cardData.introduction || '什么都没写~'}}
":"\n",l="richText"===i,u={},h=0,c=this.getData(),d=c.mapDimension("defaultedTooltip",!0),p=d.length,v=this.getRawValue(t),m=_(v),y=c.getItemVisual(t,"color");S(y)&&y.colorStops&&(y=(y.colorStops[0]||{}).color),y=y||"transparent";var x=p>1||m&&!p?r(v):a(p?$s(c,t,d[0]):m?v[0]:v),w=x.content,b=o.seriesIndex+"at"+h,M=Go({color:y,type:"item",renderMode:i,markerId:b});u[b]=y,++h;var I=c.getName(t),T=this.name;ar(this)||(T=""),T=T?Fo(T)+(e?": ":s):"";var C="string"==typeof M?M:M.content,D=e?C+T+w:T+C+(I?Fo(I)+": "+w:w);return{html:D,markers:u}},isAnimationEnabled:function(){if(yp.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,n){var i=this.ecModel,r=ax.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});c(Wx,Fx),c(Wx,ax);var Xx=function(){this.group=new Lg,this.uid=vo("viewComponent")};Xx.prototype={constructor:Xx,init:function(){},render:function(){},dispose:function(){},filterForExposedEvent:null};var Ux=Xx.prototype;Ux.updateView=Ux.updateLayout=Ux.updateVisual=function(){},vr(Xx),_r(Xx,{registerWhenExtend:!0});var Yx=function(){var t=lr();return function(e){var n=t(e),i=e.pipelineContext,r=n.large,a=n.progressiveRender,o=n.large=i&&i.large,s=n.progressiveRender=i&&i.progressiveRender;return!!(r^o||a^s)&&"reset"}},jx=lr(),qx=Yx();cl.prototype={type:"chart",init:function(){},render:function(){},highlight:function(t,e,n,i){fl(t.getData(),i,"emphasis")},downplay:function(t,e,n,i){fl(t.getData(),i,"normal")},remove:function(){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var Zx=cl.prototype;Zx.updateView=Zx.updateLayout=Zx.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},vr(cl,["dispose"]),_r(cl,{registerWhenExtend:!0}),cl.markUpdateMethod=function(t,e){jx(t).updateMethod=e};var Kx={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},$x="\x00__throttleOriginMethod",Qx="\x00__throttleRate",Jx="\x00__throttleType",t_={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=(t.visualColorAccessPath||"itemStyle.color").split("."),r=t.get(i),a=!w(r)||r instanceof dy?null:r;(!r||a)&&(r=t.getColorFromPalette(t.name,null,e.getSeriesCount())),n.setVisual("color",r);var o=(t.visualBorderColorAccessPath||"itemStyle.borderColor").split("."),s=t.get(o);if(n.setVisual("borderColor",s),!e.isSeriesFiltered(t)){a&&n.each(function(e){n.setItemVisual(e,"color",a(t.getDataParams(e)))});var l=function(t,e){var n=t.getItemModel(e),r=n.get(i,!0),a=n.get(o,!0);null!=r&&t.setItemVisual(e,"color",r),null!=a&&t.setItemVisual(e,"borderColor",a)};return{dataEach:n.hasItemOption?l:null}}}},e_={legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}},n_=function(t,e){function n(t,e){if("string"!=typeof t)return t;var n=t;return f(e,function(t,e){n=n.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),n}function i(t){var e=o.get(t);if(null==e){for(var n=t.split("."),i=e_.aria,r=0;r
"):(r=new Yf(e),this._newLine="\n"),this._tooltipContent=r
+}},render:function(t,e,n){if(!yp.node){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=n,this._lastDataByCoordSys=null,this._alwaysShowContent=t.get("alwaysShowContent");var i=this._tooltipContent;i.update(t),i.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var t=this._tooltipModel,e=t.get("triggerOn");mf("itemTooltip",this._api,mM(function(t,n,i){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(n,i):"leave"===t&&this._hide(i))},this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,n=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&i.manuallyShowTip(t,e,n,{x:i._lastX,y:i._lastY})})}},manuallyShowTip:function(t,e,n,i){if(i.from!==this.uid&&!yp.node){var r=qf(i,n);this._ticket="";var a=i.dataByCoordSys;if(i.tooltip&&null!=i.x&&null!=i.y){var o=_M;o.position=[i.x,i.y],o.update(),o.tooltip=i.tooltip,this._tryShow({offsetX:i.x,offsetY:i.y,target:o},r)}else if(a)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:i.dataByCoordSys,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var s=tM(i,e),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:i.position,target:s.el},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},manuallyHideTip:function(t,e,n,i){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,i.from!==this.uid&&this._hide(qf(i,n))},_manuallyAxisShowTip:function(t,e,n,i){var r=i.seriesIndex,a=i.dataIndex,o=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=a&&null!=o){var s=e.getSeriesByIndex(r);if(s){var l=s.getData(),t=jf([l.getItemModel(a),s,(s.coordinateSystem||{}).model,t]);if("axis"===t.get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:a,position:i.position}),!0}}},_tryShow:function(t,e){var n=t.target,i=this._tooltipModel;if(i){this._lastX=t.offsetX,this._lastY=t.offsetY;var r=t.dataByCoordSys;r&&r.length?this._showAxisTooltip(r,t):n&&null!=n.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,n,e)):n&&n.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,n,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var n=t.get("showDelay");e=y(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},_showAxisTooltip:function(t,e){var n=this._ecModel,i=this._tooltipModel,a=[e.offsetX,e.offsetY],o=[],s=[],l=jf([e.tooltipOption,i]),u=this._renderMode,h=this._newLine,c={};yM(t,function(t){yM(t.dataByAxis,function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),i=t.value,a=[];if(e&&null!=i){var l=Of(i,e.axis,n,t.seriesDataIndices,t.valueLabelOpt);f(t.seriesDataIndices,function(o){var h=n.getSeriesByIndex(o.seriesIndex),d=o.dataIndexInside,f=h&&h.getDataParams(d);if(f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=Wh(e.axis,i),f.axisValueLabel=l,f){s.push(f);var p,g=h.formatTooltip(d,!0,null,u);if(S(g)){p=g.html;var v=g.markers;r(c,v)}else p=g;a.push(p)}});var d=l;o.push("html"!==u?a.join(h):(d?Fo(d)+h:"")+a.join(h))}})},this),o.reverse(),o=o.join(this._newLine+this._newLine);var d=e.position;this._showOrMove(l,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(l,d,a[0],a[1],this._tooltipContent,s):this._showTooltipContent(l,o,s,Math.random(),a[0],a[1],d,void 0,c)})},_showSeriesItemTooltip:function(t,e,n){var i=this._ecModel,r=e.seriesIndex,a=i.getSeriesByIndex(r),o=e.dataModel||a,s=e.dataIndex,l=e.dataType,u=o.getData(l),h=jf([u.getItemModel(s),o,a&&(a.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d,f,p=o.getDataParams(s,l),g=o.formatTooltip(s,!1,l,this._renderMode);S(g)?(d=g.html,f=g.markers):(d=g,f=null);var v="item_"+o.name+"_"+s;this._showOrMove(h,function(){this._showTooltipContent(h,d,p,v,t.offsetX,t.offsetY,t.position,t.target,f)}),n({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:r,from:this.uid})}},_showComponentItemTooltip:function(t,e,n){var i=e.tooltip;if("string"==typeof i){var r=i;i={content:r,formatter:r}}var a=new fo(i,this._tooltipModel,this._ecModel),o=a.get("content"),s=Math.random();this._showOrMove(a,function(){this._showTooltipContent(a,o,a.get("formatterParams")||{},s,t.offsetX,t.offsetY,t.position,e)}),n({type:"showTip",from:this.uid})},_showTooltipContent:function(t,e,n,i,r,a,o,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent,h=t.get("formatter");o=o||t.get("position");var c=e;if(h&&"string"==typeof h)c=Vo(h,n,!0);else if("function"==typeof h){var d=mM(function(e,i){e===this._ticket&&(u.setContent(i,l,t),this._updatePosition(t,o,r,a,u,n,s))},this);this._ticket=i,c=h(n,i,d)}u.setContent(c,l,t),u.show(t),this._updatePosition(t,o,r,a,u,n,s)}},_updatePosition:function(t,e,n,i,r,a,o){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=r.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=o&&o.getBoundingRect().clone();if(o&&d.applyTransform(o.transform),"function"==typeof e&&(e=e([n,i],a,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),_(e))n=xM(e[0],s),i=xM(e[1],l);else if(S(e)){e.width=u[0],e.height=u[1];var f=Ko(e,{width:s,height:l});n=f.x,i=f.y,h=null,c=null}else if("string"==typeof e&&o){var p=$f(e,d,u);n=p[0],i=p[1]}else{var p=Zf(n,i,r,s,l,h?null:20,c?null:20);n=p[0],i=p[1]}if(h&&(n-=Qf(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=Qf(c)?u[1]/2:"bottom"===c?u[1]:0),t.get("confine")){var p=Kf(n,i,r,s,l);n=p[0],i=p[1]}r.moveTo(n,i)},_updateContentNotChangedOnAxis:function(t){var e=this._lastDataByCoordSys,n=!!e&&e.length===t.length;return n&&yM(e,function(e,i){var r=e.dataByAxis||{},a=t[i]||{},o=a.dataByAxis||[];n&=r.length===o.length,n&&yM(r,function(t,e){var i=o[e]||{},r=t.seriesDataIndices||[],a=i.seriesDataIndices||[];n&=t.value===i.value&&t.axisType===i.axisType&&t.axisId===i.axisId&&r.length===a.length,n&&yM(r,function(t,e){var i=a[e];n&=t.seriesIndex===i.seriesIndex&&t.dataIndex===i.dataIndex})})}),this._lastDataByCoordSys=t,!!n},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){yp.node||(this._tooltipContent.dispose(),Sf("itemTooltip",e))}}),Su({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),Su({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){});var wM=Ro,bM=Fo,SM=ku({type:"marker",dependencies:["series","grid","polar","geo"],init:function(t,e,n){if(pp&&"marker"===this.type)throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");this.mergeDefaultAndTheme(t,n),this._mergeOption(t,n,!1,!0)},isAnimationEnabled:function(){if(yp.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},mergeOption:function(t,e){this._mergeOption(t,e,!1,!1)},_mergeOption:function(t,e,n,i){var r=this.constructor,a=this.mainType+"Model";n||e.eachSeries(function(t){var n=t.get(this.mainType,!0),s=t[a];return n&&n.data?(s?s._mergeOption(n,e,!0):(i&&Jf(n),f(n.data,function(t){t instanceof Array?(Jf(t[0]),Jf(t[1])):Jf(t)}),s=new r(n,this,e),o(s,{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),s.__hostSeries=t),void(t[a]=s)):void(t[a]=null)},this)},formatTooltip:function(t,e,n,i){var r=this.getData(),a=this.getRawValue(t),o=_(a)?p(a,wM).join(", "):wM(a),s=r.getName(t),l=bM(this.name),u="html"===i?"
":"\n";return(null!=a||s)&&(l+=u),s&&(l+=bM(s),null!=a&&(l+=" : ")),null!=a&&(l+=bM(o)),l},getData:function(){return this._data},setData:function(t){this._data=t}});c(SM,Fx),SM.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var MM=u,IM=x,TM={min:IM(np,"min"),max:IM(np,"max"),average:IM(np,"average")},CM=Pu({type:"marker",init:function(){this.markerGroupMap=N()},render:function(t,e,n){var i=this.markerGroupMap;i.each(function(t){t.__keep=!1});var r=this.type+"Model";e.eachSeries(function(t){var i=t[r];i&&this.renderSeries(t,i,e,n)},this),i.each(function(t){!t.__keep&&this.group.remove(t.group)},this)},renderSeries:function(){}}),DM=function(t,e,n,i){var r=ip(t,i[0]),o=ip(t,i[1]),s=D,l=r.coord,u=o.coord;l[0]=s(l[0],-1/0),l[1]=s(l[1],-1/0),u[0]=s(u[0],1/0),u[1]=s(u[1],1/0);var h=a([{},r,o]);return h.coord=[r.coord,o.coord],h.x0=r.x,h.y0=r.y,h.x1=o.x,h.y1=o.y,h},AM=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];CM.extend({type:"markArea",updateTransform:function(t,e,n){e.eachSeries(function(t){var e=t.markAreaModel;if(e){var i=e.getData();i.each(function(e){var r=p(AM,function(r){return cp(i,e,r,t,n)});i.setItemLayout(e,r);var a=i.getItemGraphicEl(e);a.setShape("points",r)})}},this)},renderSeries:function(t,e,n,i){var r=t.coordinateSystem,a=t.id,o=t.getData(),l=this.markerGroupMap,u=l.get(a)||l.set(a,{group:new Lg});this.group.add(u.group),u.__keep=!0;var h=dp(r,t,e);e.setData(h),h.each(function(e){var n=p(AM,function(n){return cp(h,e,n,t,i)}),a=!0;f(AM,function(t){if(a){var n=h.get(t[0],e),i=h.get(t[1],e);(lp(n)||r.getAxis("x").containData(n))&&(lp(i)||r.getAxis("y").containData(i))&&(a=!1)}}),h.setItemLayout(e,{points:n,allClipped:a}),h.setItemVisual(e,{color:o.getVisual("color")})}),h.diff(u.__data).add(function(t){var e=h.getItemLayout(t);if(!e.allClipped){var n=new ey({shape:{points:e.points}});h.setItemGraphicEl(t,n),u.group.add(n)}}).update(function(t,n){var i=u.__data.getItemGraphicEl(n),r=h.getItemLayout(t);r.allClipped?i&&u.group.remove(i):(i?Ja(i,{shape:{points:r.points}},e,t):i=new ey({shape:{points:r.points}}),h.setItemGraphicEl(t,i),u.group.add(i))}).remove(function(t){var e=u.__data.getItemGraphicEl(t);u.group.remove(e)}).execute(),h.eachItemGraphicEl(function(t,n){var i=h.getItemModel(n),r=i.getModel("label"),a=i.getModel("emphasis.label"),o=h.getItemVisual(n,"color");t.useStyle(s(i.getModel("itemStyle").getItemStyle(),{fill:ln(o,.4),stroke:o})),t.hoverStyle=i.getModel("emphasis.itemStyle").getItemStyle(),Ha(t.style,t.hoverStyle,r,a,{labelFetcher:e,labelDataIndex:n,defaultText:h.getName(n)||"",isRectText:!0,autoColor:o}),Ra(t,{}),t.dataModel=e}),u.__data=h,u.group.silent=e.get("silent")||t.get("silent")}}),_u(function(t){t.markArea=t.markArea||{}}),t.version=O_,t.dependencies=E_,t.PRIORITY=j_,t.init=fu,t.connect=pu,t.disConnect=gu,t.disconnect=fw,t.dispose=vu,t.getInstanceByDom=mu,t.getInstanceById=yu,t.registerTheme=xu,t.registerPreprocessor=_u,t.registerProcessor=wu,t.registerPostUpdate=bu,t.registerAction=Su,t.registerCoordinateSystem=Mu,t.getCoordinateSystemDimensions=Iu,t.registerLayout=Tu,t.registerVisual=Cu,t.registerLoading=Au,t.extendComponentModel=ku,t.extendComponentView=Pu,t.extendSeriesModel=Lu,t.extendChartView=Ou,t.setCanvasCreator=Eu,t.registerMap=Bu,t.getMap=zu,t.dataTool=pw,t.zrender=kv,t.number=Hy,t.format=qy,t.throttle=vl,t.helper=vb,t.matrix=tg,t.vector=Np,t.color=xg,t.parseGeoJSON=yb,t.parseGeoJson=bb,t.util=Sb,t.graphic=Mb,t.List=Tw,t.Model=fo,t.Axis=wb,t.env=yp});
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/ec-canvas/wx-canvas.js b/yun-min-program-plugin-master/ec-canvas/wx-canvas.js
new file mode 100644
index 0000000..23ce9ad
--- /dev/null
+++ b/yun-min-program-plugin-master/ec-canvas/wx-canvas.js
@@ -0,0 +1,97 @@
+export default class WxCanvas {
+ constructor(ctx, canvasId) {
+ this.ctx = ctx;
+ this.canvasId = canvasId;
+ this.chart = null;
+
+ // this._initCanvas(zrender, ctx);
+ this._initStyle(ctx);
+ this._initEvent();
+ }
+
+ getContext(contextType) {
+ if (contextType === '2d') {
+ return this.ctx;
+ }
+ }
+
+ // canvasToTempFilePath(opt) {
+ // if (!opt.canvasId) {
+ // opt.canvasId = this.canvasId;
+ // }
+
+ // return wx.canvasToTempFilePath(opt, this);
+ // }
+
+ setChart(chart) {
+ this.chart = chart;
+ }
+
+ attachEvent () {
+ // noop
+ }
+
+ detachEvent() {
+ // noop
+ }
+
+ _initCanvas(zrender, ctx) {
+ zrender.util.getContext = function () {
+ return ctx;
+ };
+
+ zrender.util.$override('measureText', function (text, font) {
+ ctx.font = font || '12px sans-serif';
+ return ctx.measureText(text);
+ });
+ }
+
+ _initStyle(ctx) {
+ var styles = ['fillStyle', 'strokeStyle', 'globalAlpha',
+ 'textAlign', 'textBaseAlign', 'shadow', 'lineWidth',
+ 'lineCap', 'lineJoin', 'lineDash', 'miterLimit', 'fontSize'];
+
+ styles.forEach(style => {
+ Object.defineProperty(ctx, style, {
+ set: value => {
+ if (style !== 'fillStyle' && style !== 'strokeStyle'
+ || value !== 'none' && value !== null
+ ) {
+ ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value);
+ }
+ }
+ });
+ });
+
+ ctx.createRadialGradient = () => {
+ return ctx.createCircularGradient(arguments);
+ };
+ }
+
+ _initEvent() {
+ this.event = {};
+ const eventNames = [{
+ wxName: 'touchStart',
+ ecName: 'mousedown'
+ }, {
+ wxName: 'touchMove',
+ ecName: 'mousemove'
+ }, {
+ wxName: 'touchEnd',
+ ecName: 'mouseup'
+ }, {
+ wxName: 'touchEnd',
+ ecName: 'click'
+ }];
+
+ eventNames.forEach(name => {
+ this.event[name.wxName] = e => {
+ const touch = e.touches[0];
+ this.chart.getZr().handler.dispatch(name.ecName, {
+ zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
+ zrY: name.wxName === 'tap' ? touch.clientY : touch.y
+ });
+ };
+ });
+ }
+}
diff --git a/yun-min-program-plugin-master/host.js b/yun-min-program-plugin-master/host.js
new file mode 100644
index 0000000..349c8e5
--- /dev/null
+++ b/yun-min-program-plugin-master/host.js
@@ -0,0 +1,15 @@
+// var host = 'https://gl.cdwwzc.com/',uniacid = '115';
+// var host = 'https://ht.cdwwzc.com/',uniacid = '1';// wx27de59c2d28d5a5f
+var host = 'https://jank.cdlfjy.com/',uniacid = '30';
+module.exports = {host, uniacid};
+// 获取第三方配置信息 覆盖当前配置信息
+let config = wx.getExtConfigSync() || {};
+if(Object.keys(config).length > 0){
+ host = config.host || host;
+ uniacid = config.uniacid ?? uniacid;
+}
+
+
+
+
+
diff --git a/yun-min-program-plugin-master/image/card_img_a.png b/yun-min-program-plugin-master/image/card_img_a.png
new file mode 100644
index 0000000..c4f7394
Binary files /dev/null and b/yun-min-program-plugin-master/image/card_img_a.png differ
diff --git a/yun-min-program-plugin-master/image/card_img_b.png b/yun-min-program-plugin-master/image/card_img_b.png
new file mode 100644
index 0000000..c788de6
Binary files /dev/null and b/yun-min-program-plugin-master/image/card_img_b.png differ
diff --git a/yun-min-program-plugin-master/image/card_img_c.png b/yun-min-program-plugin-master/image/card_img_c.png
new file mode 100644
index 0000000..62f77de
Binary files /dev/null and b/yun-min-program-plugin-master/image/card_img_c.png differ
diff --git a/yun-min-program-plugin-master/image/card_img_d.png b/yun-min-program-plugin-master/image/card_img_d.png
new file mode 100644
index 0000000..679baf8
Binary files /dev/null and b/yun-min-program-plugin-master/image/card_img_d.png differ
diff --git a/yun-min-program-plugin-master/image/couponsbg_1.png b/yun-min-program-plugin-master/image/couponsbg_1.png
new file mode 100644
index 0000000..a07a7e4
Binary files /dev/null and b/yun-min-program-plugin-master/image/couponsbg_1.png differ
diff --git a/yun-min-program-plugin-master/image/couponsbg_2.png b/yun-min-program-plugin-master/image/couponsbg_2.png
new file mode 100644
index 0000000..cc9b057
Binary files /dev/null and b/yun-min-program-plugin-master/image/couponsbg_2.png differ
diff --git a/yun-min-program-plugin-master/image/couponsbg_3.png b/yun-min-program-plugin-master/image/couponsbg_3.png
new file mode 100644
index 0000000..cdfe70d
Binary files /dev/null and b/yun-min-program-plugin-master/image/couponsbg_3.png differ
diff --git a/yun-min-program-plugin-master/image/couponsbg_4.png b/yun-min-program-plugin-master/image/couponsbg_4.png
new file mode 100644
index 0000000..54d38f8
Binary files /dev/null and b/yun-min-program-plugin-master/image/couponsbg_4.png differ
diff --git a/yun-min-program-plugin-master/image/couponsbg_5.png b/yun-min-program-plugin-master/image/couponsbg_5.png
new file mode 100644
index 0000000..b5fa425
Binary files /dev/null and b/yun-min-program-plugin-master/image/couponsbg_5.png differ
diff --git a/yun-min-program-plugin-master/image/couponsbg_6.png b/yun-min-program-plugin-master/image/couponsbg_6.png
new file mode 100644
index 0000000..32d8ed3
Binary files /dev/null and b/yun-min-program-plugin-master/image/couponsbg_6.png differ
diff --git a/yun-min-program-plugin-master/image/couponsbg_7.png b/yun-min-program-plugin-master/image/couponsbg_7.png
new file mode 100644
index 0000000..2e3c0db
Binary files /dev/null and b/yun-min-program-plugin-master/image/couponsbg_7.png differ
diff --git a/yun-min-program-plugin-master/image/couponsbg_8.png b/yun-min-program-plugin-master/image/couponsbg_8.png
new file mode 100644
index 0000000..a36febc
Binary files /dev/null and b/yun-min-program-plugin-master/image/couponsbg_8.png differ
diff --git a/yun-min-program-plugin-master/image/credit_value_popup_decoration.png b/yun-min-program-plugin-master/image/credit_value_popup_decoration.png
new file mode 100644
index 0000000..7162a8c
Binary files /dev/null and b/yun-min-program-plugin-master/image/credit_value_popup_decoration.png differ
diff --git a/yun-min-program-plugin-master/image/directSeeding/cart.png b/yun-min-program-plugin-master/image/directSeeding/cart.png
new file mode 100644
index 0000000..ec33088
Binary files /dev/null and b/yun-min-program-plugin-master/image/directSeeding/cart.png differ
diff --git a/yun-min-program-plugin-master/image/directSeeding/close.png b/yun-min-program-plugin-master/image/directSeeding/close.png
new file mode 100644
index 0000000..2c60b9f
Binary files /dev/null and b/yun-min-program-plugin-master/image/directSeeding/close.png differ
diff --git a/yun-min-program-plugin-master/image/directSeeding/close2_icon.png b/yun-min-program-plugin-master/image/directSeeding/close2_icon.png
new file mode 100644
index 0000000..f3474a5
Binary files /dev/null and b/yun-min-program-plugin-master/image/directSeeding/close2_icon.png differ
diff --git a/yun-min-program-plugin-master/image/directSeeding/close3_icon.png b/yun-min-program-plugin-master/image/directSeeding/close3_icon.png
new file mode 100644
index 0000000..62c6013
Binary files /dev/null and b/yun-min-program-plugin-master/image/directSeeding/close3_icon.png differ
diff --git a/yun-min-program-plugin-master/image/directSeeding/close_icon.png b/yun-min-program-plugin-master/image/directSeeding/close_icon.png
new file mode 100644
index 0000000..8494ae5
Binary files /dev/null and b/yun-min-program-plugin-master/image/directSeeding/close_icon.png differ
diff --git a/yun-min-program-plugin-master/image/directSeeding/start_icon.png b/yun-min-program-plugin-master/image/directSeeding/start_icon.png
new file mode 100644
index 0000000..e0a04bf
Binary files /dev/null and b/yun-min-program-plugin-master/image/directSeeding/start_icon.png differ
diff --git a/yun-min-program-plugin-master/image/directSeeding/zb_gift_icon.png b/yun-min-program-plugin-master/image/directSeeding/zb_gift_icon.png
new file mode 100644
index 0000000..5ca7bdd
Binary files /dev/null and b/yun-min-program-plugin-master/image/directSeeding/zb_gift_icon.png differ
diff --git a/yun-min-program-plugin-master/image/directSeeding/zb_like_icon.png b/yun-min-program-plugin-master/image/directSeeding/zb_like_icon.png
new file mode 100644
index 0000000..a243336
Binary files /dev/null and b/yun-min-program-plugin-master/image/directSeeding/zb_like_icon.png differ
diff --git a/yun-min-program-plugin-master/image/icon_API.png b/yun-min-program-plugin-master/image/icon_API.png
new file mode 100644
index 0000000..be84110
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_API.png differ
diff --git a/yun-min-program-plugin-master/image/icon_API_HL.png b/yun-min-program-plugin-master/image/icon_API_HL.png
new file mode 100644
index 0000000..acd2305
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_API_HL.png differ
diff --git a/yun-min-program-plugin-master/image/icon_I.png b/yun-min-program-plugin-master/image/icon_I.png
new file mode 100644
index 0000000..2008fab
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_I.png differ
diff --git a/yun-min-program-plugin-master/image/icon_I_HL.png b/yun-min-program-plugin-master/image/icon_I_HL.png
new file mode 100644
index 0000000..7024576
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_I_HL.png differ
diff --git a/yun-min-program-plugin-master/image/icon_cart.png b/yun-min-program-plugin-master/image/icon_cart.png
new file mode 100644
index 0000000..8354406
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_cart.png differ
diff --git a/yun-min-program-plugin-master/image/icon_cart_HL.png b/yun-min-program-plugin-master/image/icon_cart_HL.png
new file mode 100644
index 0000000..0f6e96e
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_cart_HL.png differ
diff --git a/yun-min-program-plugin-master/image/icon_commission.png b/yun-min-program-plugin-master/image/icon_commission.png
new file mode 100644
index 0000000..cf70a54
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_commission.png differ
diff --git a/yun-min-program-plugin-master/image/icon_commission_HL.png b/yun-min-program-plugin-master/image/icon_commission_HL.png
new file mode 100644
index 0000000..5de17ed
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_commission_HL.png differ
diff --git a/yun-min-program-plugin-master/image/icon_component.png b/yun-min-program-plugin-master/image/icon_component.png
new file mode 100644
index 0000000..9d3cb2d
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_component.png differ
diff --git a/yun-min-program-plugin-master/image/icon_component_HL.png b/yun-min-program-plugin-master/image/icon_component_HL.png
new file mode 100644
index 0000000..0287c5e
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_component_HL.png differ
diff --git a/yun-min-program-plugin-master/image/icon_index.png b/yun-min-program-plugin-master/image/icon_index.png
new file mode 100644
index 0000000..bc9ce23
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_index.png differ
diff --git a/yun-min-program-plugin-master/image/icon_index_HL.png b/yun-min-program-plugin-master/image/icon_index_HL.png
new file mode 100644
index 0000000..0fa8982
Binary files /dev/null and b/yun-min-program-plugin-master/image/icon_index_HL.png differ
diff --git a/yun-min-program-plugin-master/image/kefu.png b/yun-min-program-plugin-master/image/kefu.png
new file mode 100644
index 0000000..59c3f07
Binary files /dev/null and b/yun-min-program-plugin-master/image/kefu.png differ
diff --git a/yun-min-program-plugin-master/image/level-icon.png b/yun-min-program-plugin-master/image/level-icon.png
new file mode 100644
index 0000000..6e5337f
Binary files /dev/null and b/yun-min-program-plugin-master/image/level-icon.png differ
diff --git a/yun-min-program-plugin-master/image/rob-time.png b/yun-min-program-plugin-master/image/rob-time.png
new file mode 100644
index 0000000..9f2b974
Binary files /dev/null and b/yun-min-program-plugin-master/image/rob-time.png differ
diff --git a/yun-min-program-plugin-master/image/uppictures.png b/yun-min-program-plugin-master/image/uppictures.png
new file mode 100644
index 0000000..6aa17a2
Binary files /dev/null and b/yun-min-program-plugin-master/image/uppictures.png differ
diff --git a/yun-min-program-plugin-master/images.wxss b/yun-min-program-plugin-master/images.wxss
new file mode 100644
index 0000000..bd23231
--- /dev/null
+++ b/yun-min-program-plugin-master/images.wxss
@@ -0,0 +1,19 @@
+.background-member-userinfo {
+ background: url("http://oih1b0zlf.bkt.clouddn.com/userinfoBg.png") no-repeat top left #f55955;
+ background-size: 100% auto;
+}
+
+.background-supplier-userinfo {
+ background: url("http://oih1b0zlf.bkt.clouddn.com/userinfoBg.png") no-repeat top left #4eae7b;
+ background-size: 100% auto;
+}
+
+.background-commission-userinfo {
+ background: url("http://oih1b0zlf.bkt.clouddn.com/userinfoBg.png") no-repeat top left #4c5c6e;
+ background-size: 100% auto;
+}
+
+.background-address {
+ background: url("http://oih1b0zlf.bkt.clouddn.com/addressBorder.png") repeat-x bottom left;
+ background-size: auto 12rpx;
+}
diff --git a/yun-min-program-plugin-master/jsconfig.json b/yun-min-program-plugin-master/jsconfig.json
new file mode 100644
index 0000000..e3765ee
--- /dev/null
+++ b/yun-min-program-plugin-master/jsconfig.json
@@ -0,0 +1,7 @@
+{
+ "compilerOptions": {
+
+ },
+ "exclude": [
+ ]
+}
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/mybehaviors/getInvite/getInvite.js b/yun-min-program-plugin-master/mybehaviors/getInvite/getInvite.js
new file mode 100644
index 0000000..ae565fe
--- /dev/null
+++ b/yun-min-program-plugin-master/mybehaviors/getInvite/getInvite.js
@@ -0,0 +1,149 @@
+var app = getApp();
+module.exports = Behavior({
+ data: {},
+ methods: {
+ checktoInvite(data, flag) {
+ let that = this;
+ if (data.real_name_auth_is_open === 1) {
+ // 判断实名插件是否开启
+ if (data.is_auth !== 1) {
+ // 是否已经实名过
+ this.bind_real_name(data.real_name_auth_scene, app.globalData.pathData, flag);
+ }
+ return;
+ }
+
+ if (data.is_bind_mobile !== 0) {
+ this.bindMobile(data.is_bind_mobile, app.globalData.pathData, flag);
+ } else {
+ if (data.is_login === 1) {
+ // 登录
+ if (data.is_invite !== 1) {
+ // 是否填写过邀请人
+ if (data.invite_page === 1) {
+ //是否开启邀请页面
+ wx.redirectTo({
+ url: "/packageC/member/visit/Inviter/Inviter",
+ });
+ } else {
+ that.gotourl(flag);
+ }
+ } else {
+ if (typeof data.invite_mobile != "undefined" && data.invite_mobile !== 1 && data.invite_page === 1) {
+ wx.redirectTo({
+ url: "/packageC/member/visit/Inviter/Inviter",
+ });
+ } else {
+ that.gotourl(flag);
+ }
+ }
+ } else {
+ that.gotourl(flag);
+ }
+ }
+ },
+ //查看用户是否需要绑定手机号 fromApp是路由跳转条件
+ bindMobile(e, setpathData, flag) {
+ if (e == 1) {
+ //跳转绑定手机页面
+ wx.reLaunch({
+ url: "/packageA/member/editmobile/editmobile?logintype=1&fromApp=1",
+ });
+ } else if (e == 2 && setpathData.indexOf("index_v2/index_v2") > 0) {
+ wx.reLaunch({
+ url: "/packageA/member/editmobile/editmobile?logintype=1&fromApp=2",
+ });
+ } else if (e == 3 && setpathData.indexOf("detail_v2/detail_v2") > 0) {
+ wx.reLaunch({
+ url: "/packageA/member/editmobile/editmobile?logintype=1&fromApp=1",
+ });
+ } else if (e == 4 && setpathData.indexOf("extension/extension") > 0) {
+ wx.reLaunch({
+ url: "/packageA/member/editmobile/editmobile?logintype=1&fromApp=4",
+ });
+ } else {
+ this.gotourl(flag);
+ }
+ },
+
+ bind_real_name(scene, routeData, flag) {
+ // 全局1 提现申请2 发布短视频3 发布微贴4 推广中心5
+ if (routeData !== 'packageH/signPage/personBank/personBank') {
+ wx.setStorageSync("real_name_redirect", routeData);
+ }
+ if (scene.indexOf('1') > -1) {
+ wx.reLaunch({
+ url: "/packageH/signPage/personBank/personBank?from=bindRealName",
+ });
+ } else if (scene.indexOf('2') > -1 && routeData == "packageA/member/withdrawal/withdrawal") {
+ // 提现申请
+ wx.reLaunch({
+ url: "/packageH/signPage/personBank/personBank?from=bindRealName",
+ });
+ } else if (scene.indexOf('3') > -1 && (routeData == "packageC/video_goods/videoAgreement/videoAgreement" || routeData == "packageC/video_goods/releaseVideo/releaseVideo")) {
+ // 发布短视频
+ wx.reLaunch({
+ url: "/packageH/signPage/personBank/personBank?from=bindRealName",
+ });
+ } else if (scene.indexOf('4') > -1 && routeData == "packageC/micro_communities/microRelease/microRelease") {
+ // 发布微贴
+ wx.reLaunch({
+ url: "/packageH/signPage/personBank/personBank?from=bindRealName",
+ });
+ } else if (scene.indexOf('5') > -1 && routeData == "packageG/pages/member/extension/extension") {
+ // 推广中心
+ wx.reLaunch({
+ url: "/packageH/signPage/personBank/personBank?from=bindRealName",
+ });
+ } else {
+ this.gotourl(flag);
+ }
+
+ },
+ gotourl(flag) {
+ try {
+ if (!this.data.yzredirect || flag === 'member') {
+ this.gomember();
+ } else {
+ if (this.data.yzredirect.indexOf("login/login") > 0) {
+ this.gomember();
+ } else if (this.data.yzredirect.indexOf("pages/live-player-plugin") > 0) {
+ //从直播进入商品详情授权登录
+ let pages = getCurrentPages();
+ let page = pages[pages.length - 2];
+ page.onLoad(page.options);
+ wx.navigateBack({
+ delta: 1,
+ fail: (res) => {
+ // 防止跳转不了 尝试直接指向会员中心
+ wx.reLaunch({
+ url: '/packageG/member_v2/member_v2',
+ });
+ }
+ });
+ } else {
+ wx.reLaunch({
+ url: "/" + this.data.yzredirect,
+ fail: (res) => {
+ // 防止跳转不了 尝试直接指向会员中心
+ wx.reLaunch({
+ url: '/packageG/member_v2/member_v2',
+ });
+ }
+ });
+ }
+ }
+ } catch (e) {
+ wx.reLaunch({
+ url: "/packageG/index/index",
+ });
+ }
+ },
+
+ gomember() {
+ wx.reLaunch({
+ url: "/packageG/member_v2/member_v2",
+ });
+ },
+ },
+});
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/mybehaviors/location/location.js b/yun-min-program-plugin-master/mybehaviors/location/location.js
new file mode 100644
index 0000000..c4d2ea4
--- /dev/null
+++ b/yun-min-program-plugin-master/mybehaviors/location/location.js
@@ -0,0 +1,144 @@
+var app = getApp();
+module.exports = Behavior({
+ data: {
+ address_a: "",
+ point: {
+ lat: "",
+ lng: "",
+ },
+ city: "",
+ },
+ methods: {
+ _getLocation(callback,errCall) {
+ if (app.globalData.isLocationIng) {
+ // 防止同时获取定位信息弹窗
+ setTimeout(() => {
+ this._getLocation(callback);
+ }, 100);
+ return;
+ }
+ app.globalData.isLocationIng = true;
+ wx.getSetting({
+ success: (resData) => {
+ if (!resData.authSetting["scope.userLocation"]) {
+ wx.authorize({
+ scope: "scope.userLocation",
+ success() {},
+ fail(msgData) {},
+ complete: () => {
+ this.getlocaldata(callback,errCall);
+ },
+ });
+ } else {
+ this.getlocaldata(callback,errCall);
+ }
+ },
+ fail(msgData) {
+ console.log(msgData);
+ }
+ });
+ },
+ getlocaldata(callback,errCall) {
+ if (wx.getStorageSync("address-point")) {
+ let point = wx.getStorageSync("address-point").point;
+ this._setaddressData({
+ lat: point.lat,
+ lng: point.lng,
+ from: 'storage'
+ },
+ callback
+ );
+ } else {
+ wx.getLocation({
+ type: "gcj02",
+ success: (res) => {
+ const latitude = res.latitude;
+ const longitude = res.longitude;
+ // const speed = res.speed;
+ // const accuracy = res.accuracy;
+ this._setaddressData({
+ lat: latitude,
+ lng: longitude,
+ },
+ callback
+ );
+ },
+ fail: (err) => {
+ if (err.errMsg === "getLocation:fail auth deny") {
+ console.log("当初用户拒绝,再次发起授权");
+ wx.openSetting({
+ success: (settingdata) => {
+ if (settingdata.authSetting["scope.userLocation"]) {
+ wx.showToast({
+ icon: "none",
+ title: "获取权限成功",
+ duration: 1500,
+ });
+ this.getlocaldata(callback);
+ } else {
+ app.globalData.isLocationIng = false;
+ wx.showToast({
+ icon: "none",
+ title: "获取权限失败,定位需要用户授权",
+ duration: 1500,
+ });
+ }
+ },
+ fail:(err)=>{
+ try {
+ this.is_errCall(errCall)
+ } catch (error) {
+ console.log(error)
+ }
+ }
+ });
+ }else{
+ app.globalData.isLocationIng = false;
+ }
+ },
+ });
+ }
+ },
+ is_errCall(errCall){
+ errCall(false)
+ },
+ _setaddressData(e, callback) {
+ app
+ .getReverseGeocoder(e.lat, e.lng)
+ .then((res) => {
+ let mapdata = res;
+ this.setData({
+ "point.lat": e.lat||'',
+ "point.lng": e.lng||'',
+ address_a: mapdata.address,
+ title: mapdata.formatted_addresses&&mapdata.formatted_addresses.recommend?mapdata.formatted_addresses.recommend:'',
+ city: !app._isTextEmpty(mapdata.address_component.city) ? mapdata.address_component.city :(!app._isTextEmpty(mapdata.address_component.province)?mapdata.address_component.province:'') ,
+ });
+ if (e.from === 'storage') {
+ // 缓存获取就不重新设置
+ app.globalData.isLocationIng = false;
+ callback && callback(mapdata, e);
+ } else {
+ wx.setStorage({
+ key: "address-point",
+ data: {
+ point: this.data.point,
+ city: this.data.city,
+ address_component: mapdata.address_component
+ },
+ success: (res) => {
+ //异步缓存
+ app.globalData.isLocationIng = false;
+ callback && callback(mapdata, e);
+ },
+ });
+ }
+
+ })
+ .catch((err) => {
+ app.globalData.isLocationIng = false;
+ console.log(err);
+ });
+ },
+ },
+});
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/mycomponent/ConnectCustomerService/ConnectCustomerService.js b/yun-min-program-plugin-master/mycomponent/ConnectCustomerService/ConnectCustomerService.js
new file mode 100644
index 0000000..1f43fbc
--- /dev/null
+++ b/yun-min-program-plugin-master/mycomponent/ConnectCustomerService/ConnectCustomerService.js
@@ -0,0 +1,56 @@
+// mycomponent/ConnectCustomerService/DConnectCustomerService.js
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ zIndex: {
+ type: Number,
+ value: 2,
+ },
+ show: {
+ type: Boolean,
+ value: false,
+ },
+ qrcode: {
+ type: String,
+ value: null,
+ },
+ online: {
+ type: String,
+ value: null,
+ },
+ customer_open: {
+ type: String || Number,
+ value: null,
+ },
+ tel: {
+ type: String,
+ value: null,
+ },
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {},
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ closePopup() {
+ this.triggerEvent("closed");
+ this.setData({
+ show: false,
+ });
+ },
+ phoneCall() {
+ if (this.data.tel) {
+ wx.makePhoneCall({
+ phoneNumber: this.data.tel,
+ });
+ }
+ },
+ },
+});
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/mycomponent/ConnectCustomerService/ConnectCustomerService.json b/yun-min-program-plugin-master/mycomponent/ConnectCustomerService/ConnectCustomerService.json
new file mode 100644
index 0000000..ac54723
--- /dev/null
+++ b/yun-min-program-plugin-master/mycomponent/ConnectCustomerService/ConnectCustomerService.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "van-popup": "/dist/popup/index"
+ }
+}
diff --git a/yun-min-program-plugin-master/mycomponent/ConnectCustomerService/ConnectCustomerService.wxml b/yun-min-program-plugin-master/mycomponent/ConnectCustomerService/ConnectCustomerService.wxml
new file mode 100644
index 0000000..ac8c1ff
--- /dev/null
+++ b/yun-min-program-plugin-master/mycomponent/ConnectCustomerService/ConnectCustomerService.wxml
@@ -0,0 +1,26 @@
+
+其他信息
+ {
+ wx.navigateTo({
+ url: '/packageD/article/articleList/articleList?article_id=' + that.data.article_id
+ });
+ }, 500);
+ }
+ });
+ return;
+ }
+ }
+ that.setData({
+ articleData: _data,
+ article_content: _data.content,
+ is_liked: _data.liked,
+ like_num: _data.like_num + _data.virtual_like_num,
+ read_num: _data.read_num + _data.virtual_read_num,
+ miQrCodeUrl: _data.miQrCodeUrl,
+ qr: _data.qr,
+ });
+ if (_data.comment) {
+ // 文章评论功能有开启才请求
+ that.setData({
+ comment: _data.comment
+ });
+ that.getComment();
+ }
+ // 设置页面标题
+ wx.setNavigationBarTitle({
+ title: _data.title,
+ });
+ if (success != undefined) {
+ success(res);
+ }
+ } else {
+ if (res.data.msg == "您尚未购买该文章内容,无法观看") {
+ wx.showToast({
+ title: res.data.msg,
+ icon: "none",
+ duration: 1500,
+ success: function () {
+ setTimeout(function () {
+ //要延时执行的代码
+ wx.redirectTo({
+ url: "/packageD/article/articleList/articleList?article_id=" + that.data.article_id,
+ });
+ }, 1500); //延迟时间
+ },
+ });
+ } else {
+ wx.showToast({
+ title: res.data.msg,
+ icon: "none",
+ duration: 1500,
+ success: function () {
+ setTimeout(function () {
+ //要延时执行的代码
+ wx.navigateBack({
+ delta: 1,
+ });
+ }, 1500); //延迟时间
+ },
+ });
+ }
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ },
+ });
+ },
+
+ _getQrCode: function (success) {
+ var that = this;
+ // 获取二维码
+ app._getNetWork({
+ url: app.getNetAddresss("member.member.getArticleQr"),
+ success: function (res) {
+ if (res.data.result == 1) {
+ let _data = res.data.data;
+ that.setData({
+ codeUrl: _data,
+ });
+ if (success != undefined) {
+ success(res);
+ }
+ } else {
+ console.error(res);
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ },
+ });
+ },
+ _toLike: function (success) {
+ var that = this;
+ // 点赞
+ app._getNetWork({
+ url: app.getNetAddresss("plugin.article.api.article.like"),
+ data: {
+ article_id: that.data.article_id,
+ },
+ success: function (res) {
+ if (res.data.result == 1) {
+ let _data = res.data.data;
+ if (_data.liked == 1) {
+ that.setData({
+ is_liked: true,
+ like_num: that.data.like_num + 1,
+ });
+ wx.showToast({
+ title: "点赞成功",
+ });
+ } else {
+ that.setData({
+ is_liked: false,
+ like_num: that.data.like_num - 1,
+ });
+ if (that.data.like_num < 0) {
+ that.setData({
+ like_num: 0,
+ });
+ }
+ wx.showToast({
+ title: "取消点赞",
+ icon: "none",
+ });
+ }
+
+ success && success(res);
+ } else {
+ console.error(res);
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ },
+ });
+ },
+
+ clickLike: function () {
+ this._toLike();
+ },
+
+ toAdv: function () {
+ console.log("跳转到广告");
+ if (!app._isTextEmpty(this.data.articleData) && app._isTextEmpty(this.data.articleData.min_app_advs_link)) {
+ return;
+ }
+ wx.navigateTo({
+ url: this.data.articleData.min_app_advs_link,
+ });
+ },
+
+ toLink: function (e) {
+ let url = e.currentTarget.dataset.link;
+ wx.navigateTo({
+ url: url,
+ });
+ },
+
+ toReport: function () {
+ wx.navigateTo({
+ url: "/packageA/member/article/noticeReport/noticeReport?article_id=" + this.data.article_id,
+ });
+ },
+
+ previewImage: function (e) {
+ var current = e.target.dataset.src; //这里获取到的是一张本地的图片
+ wx.previewImage({
+ current: current, //需要预览的图片链接列表
+ urls: [current], //当前显示图片的链接
+ });
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {},
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ wx.showShareMenu({
+ withShareTicket: false,
+ menus: ["shareAppMessage", "shareTimeline"],
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {},
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {},
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {},
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {},
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareTimeline() {
+ var value = wx.getStorageSync("yz_uid");
+ var mid = "";
+ if (value) {
+ mid = value;
+ }
+ return {
+ title: this.data.articleData.desc,
+ query: `mid=${mid}&article_id=${this.data.article_id}`,
+ imageUrl: this.data.articleData.thumb ? this.data.articleData.thumb : "",
+ };
+ },
+ onShareAppMessage: function () {
+ var value = wx.getStorageSync("yz_uid");
+ var mid = "";
+ if (value) {
+ mid = value;
+ }
+ return {
+ path: "/packageA/member/article/articleContent/articleContent?article_id=" + this.data.article_id + "&mid=" + mid,
+ title: this.data.articleData.desc,
+ imageUrl: this.data.articleData.thumb ? this.data.articleData.thumb : "",
+ };
+ },
+ // ============================== 文章评论二开 ===============================
+ // commentOpen(){
+ // this.setData({
+ // commentOn:!this.data.commentOn
+ // });
+ // },
+ // 上传图片
+ uploaderFun(e) {
+ wx.showLoading({
+ title: "加载中",
+ });
+ let that = this;
+ let urlStr = app.getNetAddresss("upload.uploadPic");
+ wx.chooseImage({
+ count: 1,
+ sizeType: ["original", "compressed"],
+ sourceType: ["album", "camera"],
+ success(res) {
+ const tempFilePaths = res.tempFilePaths;
+ let photourl = tempFilePaths[0];
+ wx.uploadFile({
+ url: urlStr,
+ filePath: photourl,
+ name: "file",
+ success(resdata) {
+ var res = JSON.parse(resdata.data);
+ wx.hideLoading();
+ if (res.result == 1) {
+ let imgList = that.data.imgList;
+ imgList.push(res.data.img_url);
+ that.setData({
+ imgList,
+ });
+ } else {
+ wx.showToast({
+ icon: "none",
+ title: res.msg,
+ duration: 1500,
+ });
+ }
+ },
+ });
+ },
+ fail: function (res) {
+ wx.hideLoading({
+ success: (res) => {},
+ });
+ }
+ });
+ },
+ delCommentIMg(e) {
+ let val = e.target.dataset.index;
+ this.data.imgList.splice(val, 1);
+ this.setData({
+ imgList: this.data.imgList,
+ });
+ },
+ getComment() {
+ let that = this;
+ app._getNetWork({
+ url: app.getNetAddresss("plugin.article.api.comment.comment-list"),
+ data: {
+ page: this.data.commentPage,
+ article_id: this.data.article_id,
+ },
+ success: function (res) {
+ if (res.data.result == 1) {
+ let list = res.data.data.list.data;
+ for (let i = 0; i < list.length; i++) {
+ if (list[i].reply_num > 0) {
+ list[i].commentShow = true;
+ } else {
+ list[i].commentShow = false;
+ }
+ list[i].commenMorePage = 1;
+ list[i].child = [];
+ }
+ that.setData({
+ last_page: res.data.data.list.last_page,
+ commenMember: res.data.data.member,
+ commentList: res.data.data.list.data,
+ commentNum: res.data.data.num
+ });
+ } else {
+ console.error(res);
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ },
+ });
+ },
+ watchImg(e) {
+ // 评论图片预览
+ let item = e.currentTarget.dataset.item;
+ wx.previewImage({
+ current: item[0], // 当前显示图片的http链接
+ urls: item // 需要预览的图片http链接列表
+ });
+ },
+ getMore() {
+ let that = this;
+ this.setData({
+ commentPage: this.data.commentPage + 1,
+ });
+ wx.showLoading({
+ title: '加载中',
+ duration: 1000,
+ icon: 'none'
+ });
+ app._getNetWork({
+ url: app.getNetAddresss("plugin.article.api.comment.comment-list"),
+ data: {
+ page: this.data.commentPage,
+ article_id: this.data.article_id,
+ },
+ success: function (res) {
+ if (res.data.result == 1) {
+ let dataMore = res.data.data.list.data;
+ for (let i = 0; i < dataMore.length; i++) {
+ if (dataMore[i].reply_num > 0) {
+ dataMore[i].commentShow = true;
+ } else {
+ dataMore[i].commentShow = false;
+ }
+ dataMore[i].commenMorePage = 1;
+ dataMore[i].child = [];
+ }
+ that.setData({
+ commentList: that.data.commentList.concat(dataMore),
+ last_page: res.data.data.list.last_page,
+ });
+ } else {
+ console.error(res);
+ }
+ wx.hideLoading({
+ success: (res) => {},
+ });
+ },
+ fail: function (res) {
+ console.error(res);
+ wx.hideLoading({
+ success: (res) => {},
+ });
+ },
+ });
+ },
+ // 评论功能
+ subMainCommentBtn() {
+ this.setData({
+ maincomment: "",
+ mainCommentShow: true,
+ });
+ },
+ // 遮罩关闭
+ mainCommentShowClose() {
+ this.setData({
+ mainCommentShow: false,
+ });
+ },
+ replyshowClose() {
+ this.setData({
+ replyshow: false,
+ });
+ },
+ // 输入框事件 主评论文字
+ maincommentinp(e) {
+ let val = e.detail.value;
+ this.setData({
+ maincomment: val,
+ });
+ },
+ replyContentinp(e) {
+ let val = e.detail.value;
+ this.setData({
+ replyContent: val,
+ });
+ },
+ // 回复
+ replyBtn(e) {
+ let item = e.currentTarget.dataset.item;
+ let name = item.nick_name;
+ this.setData({
+ keyInd: e.currentTarget.dataset.kind,
+ replyshow: true,
+ replyId: item.id,
+ comment_id: item.comment_id == 0 ? item.comment_id : item.id,
+ replyName: name,
+ commentManagement: false,
+ });
+ },
+ // 发送按钮
+ subMainBtn(e) {
+ let type = e.currentTarget.dataset.type;
+ this.getReplyComments(type);
+ },
+ // 发送请求
+ getReplyComments(type) {
+ let that = this;
+ let urlStr;
+ let dataJson = {
+ images: that.data.imgList,
+ content: "",
+ };
+ console.log(type);
+ if (type == "main") {
+ if (app._isTextEmpty(this.data.maincomment)) {
+ wx.showToast({
+ title: "请输入评论内容",
+ icon: "none",
+ duration: 1000,
+ });
+ return;
+ }
+ urlStr = "plugin.article.api.comment.create-comment";
+ dataJson.article_id = that.data.article_id;
+ dataJson.content = that.data.maincomment;
+ } else if (type == "reply") {
+ if (app._isTextEmpty(this.data.replyContent)) {
+ wx.showToast({
+ title: "请输入评论内容",
+ icon: "none",
+ duration: 1000,
+ });
+ return;
+ }
+ urlStr = "plugin.article.api.comment.reply-comment";
+ dataJson.content = that.data.replyContent;
+ dataJson.comment_id = that.data.replyId;
+ }
+ wx.showLoading({
+ title: '加载中',
+ duration: 1000,
+ icon: 'none'
+ });
+ app._getNetWork({
+ url: app.getNetAddresss(urlStr),
+ data: dataJson,
+ success: function (res) {
+ if (res.data.result == 1) {
+ if (type == "main") {
+ that.setData({
+ commentPage: 1,
+ mainCommentShow: false,
+ replyshow: false,
+ maincomment: ''
+ });
+ that.getComment();
+ } else if (type == 'reply') {
+ that.updateInfo(res.data.data, that.data.keyInd);
+ }
+ } else {
+ console.error(res);
+ }
+ wx.hideLoading({
+ success: (res) => {},
+ });
+ },
+ fail: function (res) {
+ wx.hideLoading({
+ success: (res) => {},
+ });
+ console.error(res);
+ },
+ });
+ },
+ // 回复后更新数据
+ updateInfo(data, ind) {
+ console.log(data, ind);
+ let arr = [];
+ arr.push(data);
+ if (this.data.commentList[ind].child) {
+ this.data.commentList[ind].child.unshift(arr[0]);
+ } else {
+ this.data.commentList[ind].child = arr;
+ }
+ this.setData({
+ commentList: this.data.commentList,
+ mainCommentShow: false,
+ replyshow: false,
+ replyContent: ''
+ });
+ },
+ // 加载子评论
+ moreCommentLis(e) {
+ console.log(e);
+ wx.showLoading({
+ title: '加载中',
+ icon: 'none',
+ duration: 1000
+ });
+ let that = this;
+ let id = e.currentTarget.dataset.item.id;
+ let ind = e.currentTarget.dataset.ind;
+ let urlStr = "plugin.article.api.comment.get-replys";
+ console.log(this.data.commentList);
+ let is_page = Number(this.data.commentList[ind].commenMorePage);
+ let dataJson = {
+ page: is_page,
+ comment_id: id,
+ };
+ app._getNetWork({
+ url: app.getNetAddresss(urlStr),
+ data: dataJson,
+ success: function (res) {
+ if (res.data.result == 1) {
+ let resdata = res.data.data;
+ console.log(resdata);
+ let childs = resdata.data;
+ let num = that.data.commentList[ind].reply_num - resdata.data.length;
+ that.data.commentList[ind].reply_num = num;
+ let arr = that.data.commentList[ind].child.concat(childs);
+ that.data.commentList[ind].child = arr;
+ let moreLast_page = resdata.data.last_page;
+ if (is_page >= moreLast_page) {
+ is_page = 1;
+ } else {
+ is_page = is_page + 1;
+ }
+ that.data.commentList[ind].commenMorePage = is_page;
+ that.setData({
+ commentList: that.data.commentList,
+ });
+ } else {
+ console.error(res);
+ }
+ wx.hideLoading({
+ success: (res) => {},
+ });
+ },
+ fail: function (res) {
+ wx.hideLoading({
+ success: (res) => {},
+ });
+ console.error(res);
+ },
+ });
+ },
+ // 删除评论
+ delComment(e) {
+ console.log(e);
+ let myUid;
+ try {
+ myUid = wx.getStorageSync('uid');
+ } catch (error) {
+ myUid = '';
+ }
+ let item = e.currentTarget.dataset.item;
+ let ind = e.currentTarget.dataset.ind;
+ let index;
+ try {
+ index = e.currentTarget.dataset.index;
+ } catch (error) {
+ index = null;
+ }
+ console.log(item, ind, index);
+ if (this.data.commentList[ind].child.length > 0) {
+ if (item.uid == myUid) {
+ console.log('子评论是我的,可以删');
+ this.delRequst(item.id, ind, index, 'child');
+ }
+ } else {
+ if (myUid == item.uid) {
+ console.log('主评论是我的,可以删');
+ this.delRequst(item.id, ind, index, 'list');
+ }
+ }
+
+ },
+ delRequst(id, ind, index, key) {
+ let that = this;
+
+ wx.showModal({
+ content: '是否删除评论',
+ success: function (res) {
+ if (res.confirm) {
+ console.log('删除');
+ wx.showLoading({
+ title: '加载中',
+ duration: 1000,
+ icon: 'none'
+ });
+ app._getNetWork({
+ url: app.getNetAddresss("plugin.article.api.comment.del"),
+ data: {
+ comment_id: id,
+ },
+ success: function (res) {
+ if (res.data.result == 1) {
+ if (key == 'child') {
+ that.data.commentList[ind].child.splice(index, 1);
+ } else {
+ that.data.commentList.splice(ind, 1);
+ }
+ that.setData({
+ commentList: that.data.commentList
+ });
+ wx.showToast({
+ title: res.data.data,
+ icon: 'none',
+ duration: 1000
+ });
+ } else {
+ console.error(res);
+ }
+ wx.hideLoading({
+ success: (res) => {},
+ });
+ },
+ fail: function (res) {
+ console.error(res);
+ wx.hideLoading({
+ success: (res) => {},
+ });
+ },
+ });
+ }
+ }
+ });
+ }
+});
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/packageA/member/article/articleContent/articleContent.json b/yun-min-program-plugin-master/packageA/member/article/articleContent/articleContent.json
new file mode 100644
index 0000000..195450b
--- /dev/null
+++ b/yun-min-program-plugin-master/packageA/member/article/articleContent/articleContent.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "mp-html": "/mycomponent/mp-html/index",
+ "van-popup":"../../../../dist/popup/index"
+ }
+}
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/packageA/member/article/articleContent/articleContent.wxml b/yun-min-program-plugin-master/packageA/member/article/articleContent/articleContent.wxml
new file mode 100644
index 0000000..26347d7
--- /dev/null
+++ b/yun-min-program-plugin-master/packageA/member/article/articleContent/articleContent.wxml
@@ -0,0 +1,174 @@
+
+
+
0 &&
+ that.data.chapter_id
+ ) {
+ for (
+ let i = 0; i < has_many_dig_chapter[j].has_many_chapter.length; i++
+ ) {
+ if (has_many_dig_chapter[j].has_many_chapter[i].id === Number(that.data.chapter_id)) {
+ playCourse = has_many_dig_chapter[j].has_many_chapter[i];
+ playActive = i;
+ }
+ }
+ } else {
+ playCourse = has_many_dig_chapter[j].has_many_chapter[0];
+ }
+ }
+ that.setData({
+ courseData: _data,
+ rewardBtnShow: _data.is_reward,
+ goodTit: _data.has_one_goods.title,
+ goodPrice: _data.has_one_goods.price,
+ vip_level_status: _data.has_one_goods.vip_level_status,
+ chapterNum: _data.course_chapter_num,
+ teacherImg: _data.has_one_lecturer && _data.has_one_lecturer.has_one_member ? _data.has_one_lecturer.has_one_member.avatar : '',
+ teacherName: _data.has_one_lecturer && _data.has_one_lecturer.real_name,
+ goodsContent: _data.has_one_goods.content,
+ chapter_id: playCourse.id,
+ isLook: playCourse.is_audition,
+ courseId: _data.id,
+ pushGoodList: _data.pushGoods,
+ courseShare: _data.has_one_goods.has_one_share,
+ live: _data.live,
+ live_title: _data.live_title,
+ questionnaire_time: _data.questionnaire_time,
+ plugin_point_name: _data.plugin_point_name ? _data.plugin_point_name : '积分'
+ });
+ let sec = (_data.questionnaire_time * 1000);
+ if (_data.questionnaire_is_open) {
+ this.data.is_questionnaire_time = setTimeout(() => {
+ if (!that.data.is_questionnaire_time) {
+ return;
+ }
+ that.setData({
+ questionnaire_is_open: _data.questionnaire_is_open
+ });
+ }, sec);
+ }
+ switch (_data.watch) {
+ case 0:
+ // Dialog.alert({
+ // title: '提示',
+ // message: '请升级会员或者购买课程',
+ // context: that
+ // }).then(() => {
+ // // on close
+ // })
+ that.setData({
+ is_update: false,
+ is_buy: false
+ });
+ that.videoInit(playActive, playCourse);
+ break;
+ case 1:
+ // 判断是否免费章节
+ if (playCourse.is_audition == 1) {
+ that.setData({
+ is_update: false,
+ is_buy: false,
+ is_show: false,
+ is_vshow: true
+ });
+ that.videoInit(playActive, playCourse);
+ break;
+ } else if (playCourse.is_audition == 0) {
+ Dialog.alert({
+ title: '提示',
+ message: '请升级会员或者购买课程',
+ context: that
+ }).then(() => {
+ // on close
+ });
+ that.setData({
+ is_update: true,
+ is_buy: true
+ });
+ break;
+ } else {
+ break;
+ }
+ case 2:
+ that.setData({
+ is_update: false,
+ is_buy: false
+ });
+ that.videoInit(playActive, playCourse);
+ break;
+ case 3:
+ that.setData({
+ is_update: false,
+ is_buy: false
+ });
+ that.videoInit(playActive, playCourse);
+ break;
+ default:
+ break;
+ }
+ } else {
+ wx.showToast({
+ title: '视频加载出错',
+ icon: 'none',
+ duration: 1500
+ });
+ console.error(res);
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ }
+ });
+ },
+ videoInit(index, item) {
+ this.setData({
+ is_show: false,
+ is_vshow: true,
+ active: item.id
+ });
+ this.viewPermission(
+ item.id,
+ index,
+ item.course_id,
+ item.is_audition
+ );
+ // this.isMp4(this.data.vedioSrc)
+ },
+ viewPermissionBtn(e) {
+ let dataset = e.currentTarget.dataset;
+ let id = dataset.item.id;
+ let index = dataset.index;
+ let course_id = dataset.item.course_id;
+ let audition = dataset.item.is_audition;
+ console.log(id, index, course_id, audition);
+ console.log(dataset);
+ this.viewPermission(id, index, course_id, audition);
+ },
+ // 根据观看权限
+ viewPermission(id, index, course_id, audition) {
+ // id, index, address, course_id, audition
+ let that = this;
+ this.setData({
+ is_show: true,
+ is_vshow: false,
+ islive: false
+ });
+ this.setData({
+ chapter_id: id,
+ active: id
+ });
+
+ let param = {
+ goods_id: this.data.goods_id,
+ chapter_id: id
+ };
+ let url = app.getNetAddresss('plugin.video-demand.api.video-course-goods.get-video-address');
+ app._getNetWork({
+ url: url,
+ data: param,
+ success: function (res) {
+ if (res.data.result == 1) {
+ let _data = res.data.data;
+ that.viewType(_data.watch, index, _data.video_address, course_id, id, audition, _data.video_cover_address, _data.is_try, _data.try_time);
+ } else {
+ console.error(res);
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ }
+ });
+ },
+ viewType(type, index, address, course_id, id, audition, coverSrc, is_try, try_time) {
+ if (is_try == 1 && type == 1 && audition == 1) {
+ this.setData({
+ is_update: false,
+ is_buy: false,
+ isLook: true,
+ is_vshow: true,
+ is_show: false
+ });
+ this.videoPlay(index, address, course_id, id, coverSrc);
+ return;
+ } else if ((type != 2 && type != 3) && is_try == 1 && try_time > 0) {
+ this.setData({
+ is_update: false,
+ is_buy: false,
+ isLook: true,
+ });
+ this.videoPlay(index, address, course_id, id, coverSrc);
+ if (!this.data.is_try_time) {
+ // 防止重复设置定时器
+ this.data.is_try_time = setTimeout(() => {
+ this.setData({
+ islive: false,
+ is_show: true,
+ is_vshow: false
+ });
+ if (this.data.is_try_time) {
+ // 防止返回还执行弹窗
+ wx.showModal({
+ title: '提示',
+ content: '请升级会员或者购买课程',
+ });
+ }
+
+ this.setData({
+ is_update: true,
+ is_buy: true,
+ isLook: false,
+ is_vshow: false,
+ is_show: true
+ });
+ }, try_time * 1000);
+ }
+
+ return;
+ }
+ switch (type) {
+ case 0:
+ wx.showModal({
+ title: '提示',
+ content: '请升级会员或者购买课程',
+ });
+ this.setData({
+ is_update: true,
+ is_buy: true,
+ isLook: false,
+ is_vshow: false,
+ is_show: true
+ });
+ break;
+ case 1:
+ if (audition == 1) {
+ this.setData({
+ is_update: false,
+ is_buy: false,
+ isLook: true,
+ is_vshow: true,
+ is_show: false
+ });
+ this.videoPlay(index, address, course_id, id, coverSrc);
+ break;
+ } else if (audition == 0) {
+ Dialog.alert({
+ title: '提示',
+ message: '请升级会员或者购买课程',
+ context: that
+ }).then(() => {
+ // on close
+ });
+ this.setData({
+ is_update: true,
+ is_buy: true,
+ isLook: false
+ });
+ break;
+ } else {
+ break;
+ }
+ case 2:
+ this.setData({
+ is_update: false,
+ is_buy: false,
+ isLook: true
+ });
+ this.videoPlay(index, address, course_id, id, coverSrc);
+ break;
+ case 3:
+ this.setData({
+ is_update: false,
+ is_buy: false,
+ isLook: true
+ });
+ this.videoPlay(index, address, course_id, id, coverSrc);
+ break;
+ default:
+ break;
+ }
+ },
+ // 观看视频
+ videoPlay(index, src, course_id, id, coverSrc) {
+ console.log(index, src, course_id, id, coverSrc);
+ this.setData({
+ is_show: false,
+ is_vshow: true,
+ active: id,
+ vedioSrc: src,
+ coverImg: coverSrc
+ });
+
+ // 判断当前路径
+ this.isMp4(this.data.vedioSrc);
+
+ app._getNetWork({
+ url: app.getNetAddresss('plugin.video-demand.api.video-demand-member.set-watch-history'),
+ data: {
+ course_id: course_id,
+ chapter_id: id
+ },
+ success: function (res) {
+ if (res.data.result == 1) {
+ // let _data = res.data.data
+ // console.log(_data)
+ } else {
+ // console.error(res)
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ }
+ });
+ },
+ // 判断是否MP4
+ isMp4(src) {
+ if (src.endsWith('.mp4')) {
+ this.setData({
+ isVideo: true,
+ is_show: false
+ });
+ } else {
+ this.setData({
+ isVideo: false,
+ is_show: false
+ });
+ }
+ },
+ study() {
+ this.setData({
+ is_show: false,
+ is_vshow: true
+ });
+ },
+ // 升级会员
+ update() {
+ if (this.data.ios_virtual_pay) {
+ wx.showModal({
+ title: '提示',
+ content: '十分抱歉,由于相关规定,你暂时无法在这里充值!',
+ confirmText: '知道了',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log(res);
+ }
+ }
+ });
+ return false;
+ }
+ wx.navigateTo({
+ url: '/packageA/member/course/CourseMemberUpdate/CourseMemberUpdate?goods_id=' + this.data.goods_id
+ });
+ },
+ // 立即购买
+ buy() {
+ if (this.data.ios_virtual_pay) {
+ wx.showModal({
+ title: '提示',
+ content: '十分抱歉,由于相关规定,你暂时无法在这里充值!',
+ confirmText: '知道了',
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log(res);
+ }
+ }
+ });
+ return false;
+ }
+ if (this.data.vip_level_status && this.data.vip_level_status.status == 1) {
+ wx.showToast({
+ title: this.data.vip_level_status.tips,
+ icon: 'none',
+ duration: 1500
+ });
+ return false;
+ }
+ if (this.data.loadBtn) {
+ return;
+ }
+ wx.navigateTo({
+ url: '/packageD/buy/myOrder_v2/myOrder_v2?tag=-2&total=1&optionsId=&goodsId=' + this.data.goods_id
+ });
+ },
+ // 跳转至我的课程
+ toMyCourse() {
+ wx.navigateTo({
+ url: '/packageA/member/course/CourseMy/CourseMy'
+ });
+ },
+ // 推荐商品跳转
+ pushGoodGoto(val) {
+ let item = val.currentTarget.dataset.item;
+ wx.navigateTo({
+ url: '/packageA/detail_v2/detail_v2?id=' + item.id
+ });
+ },
+ // 选择打赏金额
+ chooseMoney(e) {
+ let money = e.currentTarget.dataset.money;
+ this.setData({
+ rewardMoney: money
+ });
+ },
+ // 确定打赏
+ confirmReward() {
+ if (app._isTextEmpty(this.data.rewardMoney)) {
+ wx.showToast({
+ title: '请输入或选择打赏金额',
+ icon: 'none',
+ duration: 1500
+ });
+ return;
+ }
+
+ if (this.data.rewardMoney <= 0) {
+ wx.showToast({
+ title: '打赏金额必须大于0',
+ icon: 'none',
+ duration: 1500
+ });
+ return;
+ }
+ this.getPayData();
+ },
+ // 获取支付类型参数
+ getPayData() {
+ var that = this;
+ // let actionSheetItems = [];
+ app._getNetWork({
+ url: app.getNetAddresss('plugin.video-demand.api.lecturer-reward.pay-type'),
+ success: function (res) {
+ if (res.data.result === 1) {
+ let btnData = res.data.data.buttons;
+ that.setData({
+ showPopup: false,
+ btnData: btnData,
+ rewardPayshow: true
+ });
+
+ } else {
+ console.error(res);
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ }
+ });
+ },
+ rewardPayshowClose() {
+ this.setData({
+ rewardPayshow: false
+ });
+ },
+ rewardPayCancelBtn() {
+ this.setData({
+ rewardPayshow: false
+ });
+ },
+
+ // 支付
+ payPost(e) {
+ this.setData({
+ rewardPayshow: false
+ });
+ let type, name, btn = null;
+ if (e.currentTarget) {
+ btn = e.currentTarget.dataset.info;
+ type = e.currentTarget.dataset.info.value;
+ name = e.currentTarget.dataset.info.name;
+ } else {
+ btn = e;
+ type = e.value;
+ name = e.name;
+ }
+ let dataJson = {
+ pay_method: type,
+ amount: this.data.rewardMoney,
+ pay_name: name,
+ trick_id: this.data.stickid,
+ client_type: '2',
+ goods_id: this.data.goods_id
+ };
+
+ app._getNetWork({
+ url: app.getNetAddresss('plugin.video-demand.api.lecturer-reward.run-reward-pay'),
+ data: dataJson,
+ success: (res) => {
+ if (res.data.result === 1) {
+ this.handleOtherPay(btn, type, res.data.data);
+ this.onClose();
+ } else {
+ Dialog.alert({
+ title: '提示',
+ message: res.data.msg
+ }).then(() => {
+ // on close
+ });
+ console.error(res);
+ }
+ },
+ fail: (res) => {
+ console.error(res);
+ }
+ });
+ },
+ moneyShow() {
+ this.setData({
+ showPopup: true
+ });
+ },
+ openInputReward() {
+ this.setData({
+ showPopup: false,
+ rewardMoneyBtn: true
+ });
+ },
+ onClose() {
+ this.setData({
+ showPopup: false,
+ rewardMoneyBtn: false,
+ actionSheetShow: false,
+ questionnaire_is_open: false
+ });
+ },
+ goSurvey() {
+ wx.navigateTo({
+ url: '/packageE/questionnaire/questions/questions?goods_id=' + this.data.goods_id + '&tag=video',
+ });
+ },
+ openActionSheet() {
+ this.setData({
+ showPopup: false,
+ actionSheetShow: true
+ });
+ },
+ previewImage: function (e) {
+ var current = e.currentTarget.dataset.src; // 这里获取到的是一张本地的图片
+ wx.previewImage({
+ current: current, // 需要预览的图片链接列表
+ urls: [current] // 当前显示图片的链接
+ });
+ },
+ onChange(event) {
+ this.setData({
+ activeNames: event.detail
+ });
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+ let language = wx.getStorageSync('langIndex');
+ this.setData({
+ 'language': language.en
+ });
+ wx.setNavigationBarTitle({
+ title: '课程详情'
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ wx.showShareMenu({
+ withShareTicket: false,
+ menus: ['shareAppMessage', 'shareTimeline']
+ });
+ this._getData();
+ },
+ onHide() {
+ this.data.is_try_time = null;
+ this.data.is_questionnaire_time = null;
+ clearTimeout(this.data.is_try_time);
+ clearTimeout(this.data.is_questionnaire_time);
+ console.log('onHide监听小程序隐藏', this.data.is_try_time);
+ },
+ onUnload() {
+ this.data.is_try_time = null;
+ this.data.is_questionnaire_time = null;
+ clearTimeout(this.data.is_try_time);
+ clearTimeout(this.data.is_questionnaire_time);
+ console.log('onUnload监听小程序隐藏', this.data.is_try_time);
+ },
+});
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/packageA/member/course/CourseDetail/CourseDetail.json b/yun-min-program-plugin-master/packageA/member/course/CourseDetail/CourseDetail.json
new file mode 100644
index 0000000..f0bbb41
--- /dev/null
+++ b/yun-min-program-plugin-master/packageA/member/course/CourseDetail/CourseDetail.json
@@ -0,0 +1,18 @@
+{
+ "usingComponents": {
+ "van-tab": "../../../../dist/tab/index",
+ "van-tabs": "../../../../dist/tabs/index",
+ "van-action-sheet": "../../../../dist/action-sheet/index",
+ "van-popup": "../../../../dist/popup/index",
+ "van-field": "../../../../dist/field/index",
+ "van-cell": "../../../../dist/cell/index",
+ "van-cell-group": "../../../../dist/cell-group/index",
+ "van-dialog": "../../../../dist/dialog/index",
+ "van-nav-bar": "../../../../dist/nav-bar/index",
+ "van-collapse": "../../../../dist/collapse/index",
+ "van-collapse-item": "../../../../dist/collapse-item/index",
+ "van-icon": "../../../../dist/icon/index",
+ "goods-qrcode":"/mycomponent/temp/goods_qrcode/goods_qrcode",
+ "pay-keyboard":"/mycomponent/payKeyboard/payKeyboard"
+ }
+}
diff --git a/yun-min-program-plugin-master/packageA/member/course/CourseDetail/CourseDetail.wxml b/yun-min-program-plugin-master/packageA/member/course/CourseDetail/CourseDetail.wxml
new file mode 100644
index 0000000..b529c4f
--- /dev/null
+++ b/yun-min-program-plugin-master/packageA/member/course/CourseDetail/CourseDetail.wxml
@@ -0,0 +1,188 @@
+
+
0 && that.data.chapter_id) {
+ for (let i = 0; i < has_many_dig_chapter[j].has_many_chapter.length; i++) {
+ if (has_many_dig_chapter[j].has_many_chapter[i].id === Number(that.data.chapter_id)) {
+ playCourse = has_many_dig_chapter[j].has_many_chapter[i];
+ playActive = i;
+ }
+ }
+ } else {
+ playActive = 0;
+ playCourse = has_many_dig_chapter[0].has_many_chapter[0];
+ }
+ }
+
+ let goodPrice = "";
+ if (that.data.point_goods) {
+ goodPrice = that.data.point_goods.point;
+ } else {
+ goodPrice = _data.has_one_goods.price;
+ }
+ let countDownTime = _data.course_expiration_time?app.getTimeDifference(_data.course_expiration_time):null;
+ that.setData({
+ courseData: _data,
+ rewardBtnShow: _data.is_reward,
+ goodTit: _data.has_one_goods.title,
+ goodPrice: goodPrice,
+ vip_level_status: _data.has_one_goods.vip_level_status,
+ chapterNum: _data.course_chapter_num,
+ teacherImg: _data.has_one_lecturer && _data.has_one_lecturer.has_one_member ? _data.has_one_lecturer.has_one_member.avatar : '',
+ teacherName: _data.has_one_lecturer && _data.has_one_lecturer.real_name||'',
+ goodsContent: _data.has_one_goods.content,
+ chapter_id: playCourse && playCourse.id || 0,
+ isLook: playCourse && playCourse.is_audition || true,
+ courseId: _data.id,
+ pushGoodList: _data.pushGoods,
+ courseShare: _data.has_one_goods.has_one_share,
+ live: _data.live,
+ live_title: _data.live_title,
+ questionnaire_time: _data.questionnaire_time,
+ service_QRcode: _data.shopSet.service_QRcode,
+ service_mobile: _data.shopSet.service_mobile,
+ shopSet: _data.shopSet,
+ plugin_point_name: _data.plugin_point_name ? _data.plugin_point_name : '',
+ styleSetOptions: _data.styleSet,
+ countDownTime: countDownTime,
+ HasBuyPermissions: _data.buyPermissions||false
+ });
+ let sec = _data.questionnaire_time * 1000;
+ if (_data.questionnaire_is_open) {
+ if (that.data.is_opens == "close") {
+ console.log(that.data.is_opens);
+ } else {
+ that.data.is_questionnaire_time = setTimeout(() => {
+ if (!that.data.is_questionnaire_time) {
+ return;
+ }
+ that.setData({
+ questionnaire_is_open: _data.questionnaire_is_open,
+ });
+ }, sec);
+ }
+ }
+ switch (_data.watch) {
+ case 0:
+ // Dialog.alert({
+ // title: '提示',
+ // message: '请升级会员或者购买课程',
+ // context: that
+ // }).then(() => {
+ // // on close
+ // })
+ that.setData({
+ is_update: false,
+ is_buy: false,
+ });
+ that.videoInit(playActive, playCourse);
+ break;
+ case 1:
+ // 判断是否免费章节
+ if (playCourse.is_audition == 1) {
+ that.setData({
+ is_update: false,
+ is_buy: false,
+ is_show: false,
+ is_vshow: true,
+ });
+ that.videoInit(playActive, playCourse);
+ break;
+ } else if (playCourse.is_audition == 0) {
+ Dialog.alert({
+ title: "提示",
+ message: "请升级会员或者购买课程",
+ context: that,
+ }).then(() => {
+ // on close
+ });
+ that.setData({
+ is_update: true,
+ is_buy: true,
+ });
+ break;
+ } else {
+ break;
+ }
+ case 2:
+ that.setData({
+ is_update: false,
+ is_buy: false,
+ });
+ that.videoInit(playActive, playCourse);
+ break;
+ case 3:
+ case 4:
+ that.setData({
+ is_update: false,
+ is_buy: false,
+ });
+ that.videoInit(playActive, playCourse);
+ break;
+ default:
+ break;
+ }
+
+ wx.setStorageSync("orderErrReturnUrl", _data.mini_not_permit_link);//无权限购买时,下单弹出框确认按钮跳转路径
+ } else {
+ wx.showToast({
+ title: "视频加载出错",
+ icon: "none",
+ duration: 1500,
+ });
+ console.error(res);
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ },
+ });
+ },
+ videoInit(index, item) {
+ // if(!item) return;
+ this.setData({
+ is_show: false,
+ is_vshow: true,
+ active: item.id,
+ });
+ this.viewPermission(item.id, index, item.course_id, item.is_audition);
+ this.isMp4(this.data.vedioSrc);
+ },
+ viewPermissionBtn(e) {
+ let dataset = e.currentTarget.dataset;
+ let id = dataset.item.id;
+ let index = dataset.index;
+ let course_id = dataset.item.course_id;
+ let audition = dataset.item.is_audition;
+ this.viewPermission(id, index, course_id, audition);
+ },
+ // 根据观看权限
+ viewPermission(id, index, course_id, audition) {
+ // id, index, address, course_id, audition
+ let that = this;
+ this.setData({
+ is_show: true,
+ is_vshow: false,
+ islive: false,
+ });
+ this.setData({
+ chapter_id: id,
+ active: id,
+ });
+
+ let param = {
+ goods_id: this.data.goods_id,
+ chapter_id: id,
+ };
+ let url = app.getNetAddresss("plugin.video-demand.api.video-course-goods.get-video-address");
+ app._getNetWork({
+ url: url,
+ data: param,
+ success: function (res) {
+ if (res.data.result == 1) {
+ let _data = res.data.data;
+ that.viewType(_data.watch, index, _data.video_address, course_id, id, audition, _data.video_cover_address, _data.is_try, _data.try_time);
+ } else {
+ console.error(res);
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ },
+ });
+ },
+ viewType(type, index, address, course_id, id, audition, coverSrc, is_try, try_time) {
+ if (is_try == 1 && type == 1 && audition == 1) {
+ console.log("执行1");
+ this.setData({
+ coverImg: coverSrc,
+ is_update: false,
+ is_buy: false,
+ isLook: true,
+ is_vshow: true,
+ is_show: false,
+ });
+ this.videoPlay(index, address, course_id, id, coverSrc);
+ return;
+ } else if (type != 2 && type != 3 && type != 4 && is_try == 1 && try_time > 0) {
+ console.log("执行2");
+ this.setData({
+ is_update: false,
+ is_buy: false,
+ isLook: true,
+ });
+ this.videoPlay(index, address, course_id, id, coverSrc);
+ if (!this.data.is_try_time) {
+ // 防止重复设置定时器
+ this.data.is_try_time = setTimeout(() => {
+ this.setData({
+ islive: false,
+ is_show: true,
+ is_vshow: false
+ });
+ this.isNoPlay();
+ }, try_time * 1000);
+ }
+ return;
+ } else {
+ console.log("执行3");
+ this.setData({
+ vedioSrc: address,
+ coverImg: coverSrc,
+ });
+ this.isMp4(this.data.vedioSrc);
+ }
+ switch (type) {
+ case 0:
+ this.setData({
+ is_vshow: false,
+ is_show: true,
+ });
+ this.isNoPlay();
+ break;
+ case 1:
+ if (audition == 1) {
+ this.setData({
+ is_update: false,
+ is_buy: false,
+ isLook: true,
+ is_vshow: true,
+ is_show: false,
+ });
+ this.videoPlay(index, address, course_id, id, coverSrc);
+ break;
+ } else if (audition == 0) {
+ this.isNoPlay();
+ break;
+ } else {
+ break;
+ }
+ case 2:
+ this.setData({
+ is_update: false,
+ is_buy: false,
+ isLook: true,
+ });
+ this.videoPlay(index, address, course_id, id, coverSrc);
+ break;
+ case 3:
+ case 4:
+ this.setData({
+ is_update: false,
+ is_buy: false,
+ isLook: true,
+ });
+ this.videoPlay(index, address, course_id, id, coverSrc);
+ break;
+ default:
+ break;
+ }
+ },
+ isNoPlay() {
+ this.setData({
+ is_update: true,
+ is_buy: true,
+ isLook: false,
+ });
+ if (!this.data.styleSetOptions.buy_now_button) return;
+ this.openBuyDialog();
+ },
+ openBuyDialog(){
+ Dialog.alert({
+ title: "提示",
+ message: "请升级会员或者购买课程",
+ context: this,
+ }).then(() => {
+ // on close
+ });
+ },
+ // 观看视频
+ videoPlay(index, src, course_id, id, coverSrc) {
+ this.setData({
+ is_show: false,
+ is_vshow: true,
+ active: id,
+ vedioSrc: src,
+ coverImg: coverSrc,
+ });
+
+ // 判断当前路径
+ this.isMp4(this.data.vedioSrc);
+
+ app._getNetWork({
+ url: app.getNetAddresss("plugin.video-demand.api.video-demand-member.set-watch-history"),
+ data: {
+ course_id: course_id,
+ chapter_id: id,
+ },
+ success: function (res) {},
+ });
+ },
+ // 判断是否MP4
+ isMp4(src) {
+ if (src == "") return;
+ if (src.endsWith(".mp4") || src.endsWith(".MP4")) {
+ this.setData({
+ isVideo: true,
+ is_show: false,
+ });
+ } else {
+ this.setData({
+ isVideo: false,
+ is_show: false,
+ });
+ }
+ },
+ study() {
+ this.setData({
+ is_show: false,
+ is_vshow: true,
+ });
+ },
+ // 升级会员
+ update() {
+ if (this.data.ios_virtual_pay) {
+ wx.showModal({
+ title: "提示",
+ content: "十分抱歉,由于相关规定,你暂时无法在这里充值!",
+ confirmText: "知道了",
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log(res);
+ }
+ },
+ });
+ return false;
+ }
+ wx.navigateTo({
+ url: "/packageA/member/course/CourseMemberUpdate/CourseMemberUpdate?goods_id=" + this.data.goods_id,
+ });
+ },
+ // 立即购买
+ buy() {
+ if(this.data.HasBuyPermissions){
+ wx.showModal({
+ title: "提示",
+ content: this.data.HasBuyPermissions,
+ confirmText: "确定",
+ showCancel: false,
+ success(res) {},
+ });
+ return false;
+ }
+ if (this.data.ios_virtual_pay) {
+ wx.showModal({
+ title: "提示",
+ content: "十分抱歉,由于相关规定,你暂时无法在这里充值!",
+ confirmText: "知道了",
+ showCancel: false,
+ success(res) {
+ if (res.confirm) {
+ console.log(res);
+ }
+ },
+ });
+ return false;
+ }
+ //价格权限
+ if (this.data.vip_level_status && this.data.vip_level_status.status == 1) {
+ wx.showToast({
+ title: this.data.vip_level_status.tips,
+ icon: "none",
+ duration: 1500,
+ });
+ return false;
+ }
+
+ wx.navigateTo({
+ url: "/packageD/buy/myOrder_v2/myOrder_v2?tag=-2&total=1&optionsId=&goodsId=" + this.data.goods_id,
+ });
+ },
+ // 跳转至我的课程
+ toMyCourse() {
+ wx.navigateTo({
+ url: "/packageA/member/course/CourseMy/CourseMy",
+ });
+ },
+ // 推荐商品跳转
+ pushGoodGoto(val) {
+ let item = val.currentTarget.dataset.item;
+ wx.navigateTo({
+ url: "/packageA/detail_v2/detail_v2?id=" + item.id,
+ });
+ },
+ // 选择打赏金额
+ chooseMoney(e) {
+ let money = e.currentTarget.dataset.money;
+ this.setData({
+ rewardMoney: money,
+ });
+ },
+ moneyInput(e) {
+ this.setData({
+ rewardMoney: e.detail,
+ });
+ },
+ // 确定打赏
+ confirmReward() {
+ console.log(this.data.rewardMoney);
+ if (app._isTextEmpty(this.data.rewardMoney)) {
+ wx.showToast({
+ title: "请输入或选择打赏金额",
+ icon: "none",
+ duration: 1500,
+ });
+ return;
+ }
+
+ if (this.data.rewardMoney <= 0) {
+ wx.showToast({
+ title: "打赏金额必须大于0",
+ icon: "none",
+ duration: 1500,
+ });
+ return;
+ }
+
+ this.getPayData();
+ },
+ // 获取支付类型参数
+ getPayData() {
+ var that = this;
+ app._getNetWork({
+ url: app.getNetAddresss("plugin.video-demand.api.lecturer-reward.pay-type"),
+ success: function (res) {
+ if (res.data.result === 1) {
+ let btnData = res.data.data.buttons;
+ that.setData({
+ showPopup: false,
+ btnData: btnData,
+ rewardPayshow: true,
+ });
+ } else {
+ console.error(res);
+ }
+ },
+ fail: function (res) {
+ console.error(res);
+ },
+ });
+ },
+ // 支付
+ payPost(e) {
+ this.setData({
+ rewardPayshow: false,
+ });
+ let type, name, btn = null;
+ if (e.currentTarget) {
+ type = e.currentTarget.dataset.info.value;
+ name = e.currentTarget.dataset.info.name;
+ btn = e.currentTarget.dataset.info;
+ } else {
+ type = e.value;
+ name = e.name;
+ btn = e;
+ }
+ let dataJson = {
+ pay_method: type,
+ amount: this.data.rewardMoney,
+ pay_name: name,
+ goods_id: this.data.goodsId,
+ trick_id: this.data.stickid,
+ client_type: "2",
+ };
+
+ app._getNetWork({
+ url: app.getNetAddresss("plugin.video-demand.api.lecturer-reward.run-reward-pay"),
+ data: dataJson,
+ success: (res) => {
+ if (res.data.result === 1) {
+ this.handleOtherPay(btn, type, res.data.data);
+ this.onClose();
+ } else {
+ Dialog.alert({
+ title: "提示",
+ message: res.data.msg,
+ context: this,
+ }).then(() => {
+ // on close
+ });
+ }
+ },
+ fail: (res) => {
+ console.error(res);
+ },
+ });
+ },
+ moneyShow() {
+ this.setData({
+ showPopup: true,
+ });
+ },
+ openInputReward() {
+ this.setData({
+ showPopup: false,
+ rewardMoneyBtn: true,
+ });
+ },
+ onClose() {
+ this.setData({
+ showPopup: false,
+ rewardMoneyBtn: false,
+ actionSheetShow: false,
+ questionnaire_is_open: false,
+ });
+ },
+ openActionSheet() {
+ this.setData({
+ showPopup: false,
+ actionSheetShow: true,
+ });
+ },
+ previewImage: function (e) {
+ var current = e.target.dataset.src; // 这里获取到的是一张本地的图片
+ wx.previewImage({
+ current: current, // 需要预览的图片链接列表
+ urls: [current], // 当前显示图片的链接
+ });
+ },
+ // 足迹记录
+ footSet() {
+ if (!this.data.isGoods) {
+ return;
+ }
+ let urlStr = app.getNetAddresss("member.member-history.store");
+ urlStr += "&goods_id=" + this.properties.goodsId + "&mark=" + this.properties.mark + "&mark_id=" + this.properties.mark_id;
+ app._getNetWork({
+ showToastIn: false,
+ url: urlStr,
+ success: (resdata) => {
+ var res = resdata.data;
+ if (res.result == 1) {
+ console.log(res);
+ } else {
+ wx.showToast({
+ icon: "none",
+ title: res.msg,
+ duration: 1500,
+ });
+ }
+ },
+ fail: function (res) {},
+ });
+ },
+ onChange(event) {
+ this.setData({
+ activeNames: event.detail,
+ });
+ },
+ rewardPayshowClose() {
+ this.setData({
+ rewardPayshow: false,
+ });
+ },
+ rewardPayCancelBtn() {
+ this.setData({
+ rewardPayshow: false,
+ });
+ },
+ onChangecountDown(e) {
+ this.setData({
+ timeData: e.detail,
+ });
+ },
+ countDownFinish(){
+ this.setData({
+ iscCountDownFinish: true
+ });
+ }
+ },
+});
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/packageA/mycomponent/course_goods/course_goods.json b/yun-min-program-plugin-master/packageA/mycomponent/course_goods/course_goods.json
new file mode 100644
index 0000000..af3bb86
--- /dev/null
+++ b/yun-min-program-plugin-master/packageA/mycomponent/course_goods/course_goods.json
@@ -0,0 +1,21 @@
+{
+ "component": true,
+ "usingComponents": {
+ "van-tab": "../../../dist/tab/index",
+ "van-tabs": "../../../dist/tabs/index",
+ "van-action-sheet": "../../../dist/action-sheet/index",
+ "van-popup": "../../../dist/popup/index",
+ "van-field": "../../../dist/field/index",
+ "van-cell": "../../../dist/cell/index",
+ "van-cell-group": "../../../dist/cell-group/index",
+ "van-dialog": "../../../dist/dialog/index",
+ "van-loading": "../../../dist/loading/index",
+ "van-nav-bar": "../../../dist/nav-bar/index",
+ "van-collapse": "../../../dist/collapse/index",
+ "van-collapse-item": "../../../dist/collapse-item/index",
+ "van-icon": "../../../dist/icon/index",
+ "van-count-down": "../../../dist/count-down/index",
+ "goods-qrcode":"/mycomponent/temp/goods_qrcode/goods_qrcode",
+ "pay-keyboard":"/mycomponent/payKeyboard/payKeyboard"
+ }
+}
diff --git a/yun-min-program-plugin-master/packageA/mycomponent/course_goods/course_goods.wxml b/yun-min-program-plugin-master/packageA/mycomponent/course_goods/course_goods.wxml
new file mode 100644
index 0000000..26ec93c
--- /dev/null
+++ b/yun-min-program-plugin-master/packageA/mycomponent/course_goods/course_goods.wxml
@@ -0,0 +1,255 @@
+
+
视频号发布视频粘贴扩展链接{{ good.title }}
+
+
+
视频号发布视频粘贴扩展链接
");
+ return item;
+ } else {
+ item.description = '';
+ return item;
+ }
+ });
+ that.setData({
+ level_type: res.data.level_type,
+ levelList: level_message,
+ memberInfo: res.data.member_data,
+ right: res.data.member_data.rights ? res.data.member_data.rights : '',
+ shopDesc: res.data.shop_description,
+ name: (res.data.shop_set?res.data.shop_set.name:''),
+ balance_recharge:res.data.balance_recharge, //购买是否开启
+ });
+ if(res.data.shop_set && res.data.shop_set!=null){
+ that.setData({
+ customer_open: res.data.shop_set.customer_open == '1' ? true : false,
+ service_QRcode: res.data.shop_set.service_QRcode,
+ service_mobile: res.data.shop_set.service_mobile
+ });
+ }
+ // let article = that.data.shopDesc;
+ /**
+ * WxParse.wxParse(bindName , type, data, target,imagePadding)
+ * 1.bindName绑定的数据名(必填)
+ * 2.type可以为html或者md(必填)
+ * 3.data为传入的具体数据(必填)
+ * 4.target为Page对象,一般为this(必填)
+ * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)
+ */
+ // WxParse.wxParse('article', 'html', article, that);
+ }
+ },
+ fail: function(res) {
+ console.log(res);
+ }
+ });
+ },
+ buy(e) {
+ let goodid = e.currentTarget.dataset.goodid;
+ wx.navigateTo({
+ url: '/packageA/detail_v2/detail_v2?id=' + goodid
+ });
+ },
+ gotoRightGood(e) {
+ let id = e.currentTarget.dataset.id;
+ wx.navigateTo({
+ url: '/packageB/member/RightGood/RightGood?level_id=' + id
+ });
+ },
+ goChongzhi(e){
+ let money = e.currentTarget.dataset.money;
+ wx.navigateTo({
+ url: '/packageA/member/balance/balance_recharge/balance_recharge?balance=' + money
+ });
+ }
+});
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/packageB/member/MemberGradeList/MemberGradeList.json b/yun-min-program-plugin-master/packageB/member/MemberGradeList/MemberGradeList.json
new file mode 100644
index 0000000..bb80760
--- /dev/null
+++ b/yun-min-program-plugin-master/packageB/member/MemberGradeList/MemberGradeList.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "会员权益",
+ "usingComponents": {
+ "van-popup": "../../../dist/popup/index",
+ "mp-html": "/mycomponent/mp-html/index"
+ }
+}
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/packageB/member/MemberGradeList/MemberGradeList.wxml b/yun-min-program-plugin-master/packageB/member/MemberGradeList/MemberGradeList.wxml
new file mode 100644
index 0000000..f8fdfa0
--- /dev/null
+++ b/yun-min-program-plugin-master/packageB/member/MemberGradeList/MemberGradeList.wxml
@@ -0,0 +1,139 @@
+
+
+
+ 可领取红包数量
+
+ {{can_total}}
+ 个
+
+ {{redpack.msg}}
+ {{redpack.love ? redpack.love : 0 }}
+
+
+
+
+ {{item.has_one_order_project.project_title}}
+{{language['money']}}{{ item.price }}
+
+ ${per.value}
`; + } + if (per.type === 'image') { + jsonStr += `
+ 订单已支付
+{{ item.member.username }}
+ID:{{ item.member_id }}
+支出:{{language['money']}}{{ item.amount || 0 }}
+{{ item.created_at }}
+
+ // add to parents
+ var parent = bufArray[0] || results;
+ if (parent.nodes === undefined) {
+ parent.nodes = [];
+ }
+ parent.nodes.push(node);
+ } else {
+ bufArray.unshift(node);
+ }
+ },
+ end: function (tag) {
+ //debug(tag);
+ // merge into parent tag
+ var node = bufArray.shift();
+ if (node.tag !== tag) console.error('invalid state: mismatch end tag');
+
+ if (bufArray.length === 0) {
+ results.nodes.push(node);
+ } else {
+ var parent = bufArray[0];
+ if (parent.nodes === undefined) {
+ parent.nodes = [];
+ }
+ parent.nodes.push(node);
+ }
+ },
+ chars: function (text) {
+ //debug(text);
+ var node = {
+ node: 'text',
+ text: text,
+ textArray:transEmojiStr(text)
+ };
+
+ if (bufArray.length === 0) {
+ results.nodes.push(node);
+ } else {
+ var parent = bufArray[0];
+ if (parent.nodes === undefined) {
+ parent.nodes = [];
+ }
+ parent.nodes.push(node);
+ }
+ },
+ comment: function (text) {
+ //debug(text);
+ var node = {
+ node: 'comment',
+ text: text,
+ };
+ var parent = bufArray[0];
+ if (parent.nodes === undefined) {
+ parent.nodes = [];
+ }
+ parent.nodes.push(node);
+ },
+ });
+ return results;
+};
+
+function transEmojiStr(str){
+ // var eReg = new RegExp("["+__reg+' '+"]");
+// str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
+
+ var emojiObjs = [];
+ //如果正则表达式为空
+ if(__emojisReg.length == 0 || !__emojis){
+ var emojiObj = {}
+ emojiObj.node = "text";
+ emojiObj.text = str;
+ array = [emojiObj];
+ return array;
+ }
+ //这个地方需要调整
+ str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
+ var eReg = new RegExp("[:]");
+ var array = str.split(eReg);
+ for(var i = 0; i < array.length; i++){
+ var ele = array[i];
+ var emojiObj = {};
+ if(__emojis[ele]){
+ emojiObj.node = "element";
+ emojiObj.tag = "emoji";
+ emojiObj.text = __emojis[ele];
+ emojiObj.baseSrc= __emojisBaseSrc;
+ }else{
+ emojiObj.node = "text";
+ emojiObj.text = ele;
+ }
+ emojiObjs.push(emojiObj);
+ }
+
+ return emojiObjs;
+}
+
+function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
+ __emojisReg = reg;
+ __emojisBaseSrc=baseSrc;
+ __emojis=emojis;
+}
+
+module.exports = {
+ html2json: html2json,
+ emojisInit:emojisInit
+};
+
diff --git a/yun-min-program-plugin-master/wxParse/htmlparser.js b/yun-min-program-plugin-master/wxParse/htmlparser.js
new file mode 100644
index 0000000..7406b45
--- /dev/null
+++ b/yun-min-program-plugin-master/wxParse/htmlparser.js
@@ -0,0 +1,182 @@
+/**
+ * author: Di (微信小程序开发工程师)
+ * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
+ * 垂直微信小程序开发交流社区
+ *
+ * github地址: https://github.com/icindy/wxParse
+ *
+ * for: 微信小程序富文本解析
+ * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
+ */
+// Regular Expressions for parsing tags and attributes
+var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
+ endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/,
+ attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
+
+// Empty Elements - HTML 5
+var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
+
+// Block Elements - HTML 5
+var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
+
+// Inline Elements - HTML 5
+var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
+
+// Elements that you can, intentionally, leave open
+// (and which close themselves)
+var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
+
+// Attributes that have their values filled in disabled="disabled"
+var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
+
+// Special Elements (can contain anything)
+var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
+
+function HTMLParser(html, handler) {
+ var index, chars, match, stack = [], last = html;
+ stack.last = function () {
+ return this[this.length - 1];
+ };
+
+ while (html) {
+ chars = true;
+
+ // Make sure we're not in a script or style element
+ if (!stack.last() || !special[stack.last()]) {
+
+ // Comment
+ if (html.indexOf("");
+
+ if (index >= 0) {
+ if (handler.comment)
+ handler.comment(html.substring(4, index));
+ html = html.substring(index + 3);
+ chars = false;
+ }
+
+ // end tag
+ } else if (html.indexOf("") == 0) {
+ match = html.match(endTag);
+
+ if (match) {
+ html = html.substring(match[0].length);
+ match[0].replace(endTag, parseEndTag);
+ chars = false;
+ }
+
+ // start tag
+ } else if (html.indexOf("<") == 0) {
+ match = html.match(startTag);
+
+ if (match) {
+ html = html.substring(match[0].length);
+ match[0].replace(startTag, parseStartTag);
+ chars = false;
+ }
+ }
+
+ if (chars) {
+ index = html.indexOf("<");
+
+ var text = index < 0 ? html : html.substring(0, index);
+ html = index < 0 ? "" : html.substring(index);
+
+ if (handler.chars)
+ handler.chars(text);
+ }
+
+ } else {
+
+ html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) {
+ text = text.replace(/|/g, "$1$2");
+ if (handler.chars)
+ handler.chars(text);
+
+ return "";
+ });
+
+
+ parseEndTag("", stack.last());
+ }
+
+ if (html == last)
+ throw "Parse Error: " + html;
+ last = html;
+ }
+
+ // Clean up any remaining tags
+ parseEndTag();
+
+ function parseStartTag(tag, tagName, rest, unary) {
+ tagName = tagName.toLowerCase();
+
+ if (block[tagName]) {
+ while (stack.last() && inline[stack.last()]) {
+ parseEndTag("", stack.last());
+ }
+ }
+
+ if (closeSelf[tagName] && stack.last() == tagName) {
+ parseEndTag("", tagName);
+ }
+
+ unary = empty[tagName] || !!unary;
+
+ if (!unary)
+ stack.push(tagName);
+
+ if (handler.start) {
+ var attrs = [];
+
+ rest.replace(attr, function (match, name) {
+ var value = arguments[2] ? arguments[2] :
+ arguments[3] ? arguments[3] :
+ arguments[4] ? arguments[4] :
+ fillAttrs[name] ? name : "";
+
+ attrs.push({
+ name: name,
+ value: value,
+ escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //"
+ });
+ });
+
+ if (handler.start) {
+ handler.start(tagName, attrs, unary);
+ }
+
+ }
+ }
+
+ function parseEndTag(tag, tagName) {
+ // If no tag name is provided, clean shop
+ if (!tagName)
+ var pos = 0;
+
+ // Find the closest opened tag of the same type
+ else
+ for (var pos = stack.length - 1; pos >= 0; pos--)
+ if (stack[pos] == tagName)
+ break;
+
+ if (pos >= 0) {
+ // Close all the open elements, up the stack
+ for (var i = stack.length - 1; i >= pos; i--)
+ if (handler.end)
+ handler.end(stack[i]);
+
+ // Remove the open elements from the stack
+ stack.length = pos;
+ }
+ }
+};
+
+function makeMap(str) {
+ var obj = {}, items = str.split(",");
+ for (var i = 0; i < items.length; i++)
+ obj[items[i]] = true;
+ return obj;
+}
+
+module.exports = HTMLParser;
diff --git a/yun-min-program-plugin-master/wxParse/showdown.js b/yun-min-program-plugin-master/wxParse/showdown.js
new file mode 100644
index 0000000..a1f830f
--- /dev/null
+++ b/yun-min-program-plugin-master/wxParse/showdown.js
@@ -0,0 +1,2529 @@
+/**
+ * author: Di (微信小程序开发工程师)
+ * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
+ * 垂直微信小程序开发交流社区
+ *
+ * github地址: https://github.com/icindy/wxParse
+ *
+ * for: 微信小程序富文本解析
+ * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
+ */
+
+function getDefaultOpts(simple) {
+ 'use strict';
+
+ var defaultOptions = {
+ omitExtraWLInCodeBlocks: {
+ defaultValue: false,
+ describe: 'Omit the default extra whiteline added to code blocks',
+ type: 'boolean'
+ },
+ noHeaderId: {
+ defaultValue: false,
+ describe: 'Turn on/off generated header id',
+ type: 'boolean'
+ },
+ prefixHeaderId: {
+ defaultValue: false,
+ describe: 'Specify a prefix to generated header ids',
+ type: 'string'
+ },
+ headerLevelStart: {
+ defaultValue: false,
+ describe: 'The header blocks level start',
+ type: 'integer'
+ },
+ parseImgDimensions: {
+ defaultValue: false,
+ describe: 'Turn on/off image dimension parsing',
+ type: 'boolean'
+ },
+ simplifiedAutoLink: {
+ defaultValue: false,
+ describe: 'Turn on/off GFM autolink style',
+ type: 'boolean'
+ },
+ literalMidWordUnderscores: {
+ defaultValue: false,
+ describe: 'Parse midword underscores as literal underscores',
+ type: 'boolean'
+ },
+ strikethrough: {
+ defaultValue: false,
+ describe: 'Turn on/off strikethrough support',
+ type: 'boolean'
+ },
+ tables: {
+ defaultValue: false,
+ describe: 'Turn on/off tables support',
+ type: 'boolean'
+ },
+ tablesHeaderId: {
+ defaultValue: false,
+ describe: 'Add an id to table headers',
+ type: 'boolean'
+ },
+ ghCodeBlocks: {
+ defaultValue: true,
+ describe: 'Turn on/off GFM fenced code blocks support',
+ type: 'boolean'
+ },
+ tasklists: {
+ defaultValue: false,
+ describe: 'Turn on/off GFM tasklist support',
+ type: 'boolean'
+ },
+ smoothLivePreview: {
+ defaultValue: false,
+ describe: 'Prevents weird effects in live previews due to incomplete input',
+ type: 'boolean'
+ },
+ smartIndentationFix: {
+ defaultValue: false,
+ description: 'Tries to smartly fix identation in es6 strings',
+ type: 'boolean'
+ }
+ };
+ if (simple === false) {
+ return JSON.parse(JSON.stringify(defaultOptions));
+ }
+ var ret = {};
+ for (var opt in defaultOptions) {
+ if (defaultOptions.hasOwnProperty(opt)) {
+ ret[opt] = defaultOptions[opt].defaultValue;
+ }
+ }
+ return ret;
+}
+
+/**
+ * Created by Tivie on 06-01-2015.
+ */
+
+// Private properties
+var showdown = {},
+ parsers = {},
+ extensions = {},
+ globalOptions = getDefaultOpts(true),
+ flavor = {
+ github: {
+ omitExtraWLInCodeBlocks: true,
+ prefixHeaderId: 'user-content-',
+ simplifiedAutoLink: true,
+ literalMidWordUnderscores: true,
+ strikethrough: true,
+ tables: true,
+ tablesHeaderId: true,
+ ghCodeBlocks: true,
+ tasklists: true
+ },
+ vanilla: getDefaultOpts(true)
+ };
+
+/**
+ * helper namespace
+ * @type {{}}
+ */
+showdown.helper = {};
+
+/**
+ * TODO LEGACY SUPPORT CODE
+ * @type {{}}
+ */
+showdown.extensions = {};
+
+/**
+ * Set a global option
+ * @static
+ * @param {string} key
+ * @param {*} value
+ * @returns {showdown}
+ */
+showdown.setOption = function (key, value) {
+ 'use strict';
+ globalOptions[key] = value;
+ return this;
+};
+
+/**
+ * Get a global option
+ * @static
+ * @param {string} key
+ * @returns {*}
+ */
+showdown.getOption = function (key) {
+ 'use strict';
+ return globalOptions[key];
+};
+
+/**
+ * Get the global options
+ * @static
+ * @returns {{}}
+ */
+showdown.getOptions = function () {
+ 'use strict';
+ return globalOptions;
+};
+
+/**
+ * Reset global options to the default values
+ * @static
+ */
+showdown.resetOptions = function () {
+ 'use strict';
+ globalOptions = getDefaultOpts(true);
+};
+
+/**
+ * Set the flavor showdown should use as default
+ * @param {string} name
+ */
+showdown.setFlavor = function (name) {
+ 'use strict';
+ if (flavor.hasOwnProperty(name)) {
+ var preset = flavor[name];
+ for (var option in preset) {
+ if (preset.hasOwnProperty(option)) {
+ globalOptions[option] = preset[option];
+ }
+ }
+ }
+};
+
+/**
+ * Get the default options
+ * @static
+ * @param {boolean} [simple=true]
+ * @returns {{}}
+ */
+showdown.getDefaultOptions = function (simple) {
+ 'use strict';
+ return getDefaultOpts(simple);
+};
+
+/**
+ * Get or set a subParser
+ *
+ * subParser(name) - Get a registered subParser
+ * subParser(name, func) - Register a subParser
+ * @static
+ * @param {string} name
+ * @param {function} [func]
+ * @returns {*}
+ */
+showdown.subParser = function (name, func) {
+ 'use strict';
+ if (showdown.helper.isString(name)) {
+ if (typeof func !== 'undefined') {
+ parsers[name] = func;
+ } else {
+ if (parsers.hasOwnProperty(name)) {
+ return parsers[name];
+ } else {
+ throw Error('SubParser named ' + name + ' not registered!');
+ }
+ }
+ }
+};
+
+/**
+ * Gets or registers an extension
+ * @static
+ * @param {string} name
+ * @param {object|function=} ext
+ * @returns {*}
+ */
+showdown.extension = function (name, ext) {
+ 'use strict';
+
+ if (!showdown.helper.isString(name)) {
+ throw Error('Extension \'name\' must be a string');
+ }
+
+ name = showdown.helper.stdExtName(name);
+
+ // Getter
+ if (showdown.helper.isUndefined(ext)) {
+ if (!extensions.hasOwnProperty(name)) {
+ throw Error('Extension named ' + name + ' is not registered!');
+ }
+ return extensions[name];
+
+ // Setter
+ } else {
+ // Expand extension if it's wrapped in a function
+ if (typeof ext === 'function') {
+ ext = ext();
+ }
+
+ // Ensure extension is an array
+ if (!showdown.helper.isArray(ext)) {
+ ext = [ext];
+ }
+
+ var validExtension = validate(ext, name);
+
+ if (validExtension.valid) {
+ extensions[name] = ext;
+ } else {
+ throw Error(validExtension.error);
+ }
+ }
+};
+
+/**
+ * Gets all extensions registered
+ * @returns {{}}
+ */
+showdown.getAllExtensions = function () {
+ 'use strict';
+ return extensions;
+};
+
+/**
+ * Remove an extension
+ * @param {string} name
+ */
+showdown.removeExtension = function (name) {
+ 'use strict';
+ delete extensions[name];
+};
+
+/**
+ * Removes all extensions
+ */
+showdown.resetExtensions = function () {
+ 'use strict';
+ extensions = {};
+};
+
+/**
+ * Validate extension
+ * @param {array} extension
+ * @param {string} name
+ * @returns {{valid: boolean, error: string}}
+ */
+function validate(extension, name) {
+ 'use strict';
+
+ var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
+ ret = {
+ valid: true,
+ error: ''
+ };
+
+ if (!showdown.helper.isArray(extension)) {
+ extension = [extension];
+ }
+
+ for (var i = 0; i < extension.length; ++i) {
+ var baseMsg = errMsg + ' sub-extension ' + i + ': ',
+ ext = extension[i];
+ if (typeof ext !== 'object') {
+ ret.valid = false;
+ ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';
+ return ret;
+ }
+
+ if (!showdown.helper.isString(ext.type)) {
+ ret.valid = false;
+ ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given';
+ return ret;
+ }
+
+ var type = ext.type = ext.type.toLowerCase();
+
+ // normalize extension type
+ if (type === 'language') {
+ type = ext.type = 'lang';
+ }
+
+ if (type === 'html') {
+ type = ext.type = 'output';
+ }
+
+ if (type !== 'lang' && type !== 'output' && type !== 'listener') {
+ ret.valid = false;
+ ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
+ return ret;
+ }
+
+ if (type === 'listener') {
+ if (showdown.helper.isUndefined(ext.listeners)) {
+ ret.valid = false;
+ ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"';
+ return ret;
+ }
+ } else {
+ if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) {
+ ret.valid = false;
+ ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method';
+ return ret;
+ }
+ }
+
+ if (ext.listeners) {
+ if (typeof ext.listeners !== 'object') {
+ ret.valid = false;
+ ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + ' given';
+ return ret;
+ }
+ for (var ln in ext.listeners) {
+ if (ext.listeners.hasOwnProperty(ln)) {
+ if (typeof ext.listeners[ln] !== 'function') {
+ ret.valid = false;
+ ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln +
+ ' must be a function but ' + typeof ext.listeners[ln] + ' given';
+ return ret;
+ }
+ }
+ }
+ }
+
+ if (ext.filter) {
+ if (typeof ext.filter !== 'function') {
+ ret.valid = false;
+ ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + ' given';
+ return ret;
+ }
+ } else if (ext.regex) {
+ if (showdown.helper.isString(ext.regex)) {
+ ext.regex = new RegExp(ext.regex, 'g');
+ }
+ if (!ext.regex instanceof RegExp) {
+ ret.valid = false;
+ ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given';
+ return ret;
+ }
+ if (showdown.helper.isUndefined(ext.replace)) {
+ ret.valid = false;
+ ret.error = baseMsg + '"regex" extensions must implement a replace string or function';
+ return ret;
+ }
+ }
+ }
+ return ret;
+}
+
+/**
+ * Validate extension
+ * @param {object} ext
+ * @returns {boolean}
+ */
+showdown.validateExtension = function (ext) {
+ 'use strict';
+
+ var validateExtension = validate(ext, null);
+ if (!validateExtension.valid) {
+ console.warn(validateExtension.error);
+ return false;
+ }
+ return true;
+};
+
+/**
+ * showdownjs helper functions
+ */
+
+if (!showdown.hasOwnProperty('helper')) {
+ showdown.helper = {};
+}
+
+/**
+ * Check if var is string
+ * @static
+ * @param {string} a
+ * @returns {boolean}
+ */
+showdown.helper.isString = function isString(a) {
+ 'use strict';
+ return (typeof a === 'string' || a instanceof String);
+};
+
+/**
+ * Check if var is a function
+ * @static
+ * @param {string} a
+ * @returns {boolean}
+ */
+showdown.helper.isFunction = function isFunction(a) {
+ 'use strict';
+ var getType = {};
+ return a && getType.toString.call(a) === '[object Function]';
+};
+
+/**
+ * ForEach helper function
+ * @static
+ * @param {*} obj
+ * @param {function} callback
+ */
+showdown.helper.forEach = function forEach(obj, callback) {
+ 'use strict';
+ if (typeof obj.forEach === 'function') {
+ obj.forEach(callback);
+ } else {
+ for (var i = 0; i < obj.length; i++) {
+ callback(obj[i], i, obj);
+ }
+ }
+};
+
+/**
+ * isArray helper function
+ * @static
+ * @param {*} a
+ * @returns {boolean}
+ */
+showdown.helper.isArray = function isArray(a) {
+ 'use strict';
+ return a.constructor === Array;
+};
+
+/**
+ * Check if value is undefined
+ * @static
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
+ */
+showdown.helper.isUndefined = function isUndefined(value) {
+ 'use strict';
+ return typeof value === 'undefined';
+};
+
+/**
+ * Standardidize extension name
+ * @static
+ * @param {string} s extension name
+ * @returns {string}
+ */
+showdown.helper.stdExtName = function (s) {
+ 'use strict';
+ return s.replace(/[_-]||\s/g, '').toLowerCase();
+};
+
+function escapeCharactersCallback(wholeMatch, m1) {
+ 'use strict';
+ var charCodeToEscape = m1.charCodeAt(0);
+ return '~E' + charCodeToEscape + 'E';
+}
+
+/**
+ * Callback used to escape characters when passing through String.replace
+ * @static
+ * @param {string} wholeMatch
+ * @param {string} m1
+ * @returns {string}
+ */
+showdown.helper.escapeCharactersCallback = escapeCharactersCallback;
+
+/**
+ * Escape characters in a string
+ * @static
+ * @param {string} text
+ * @param {string} charsToEscape
+ * @param {boolean} afterBackslash
+ * @returns {XML|string|void|*}
+ */
+showdown.helper.escapeCharacters = function escapeCharacters(text, charsToEscape, afterBackslash) {
+ 'use strict';
+ // First we have to escape the escape characters so that
+ // we can build a character class out of them
+ var regexString = '([' + charsToEscape.replace(/([\[\]\\])/g, '\\$1') + '])';
+
+ if (afterBackslash) {
+ regexString = '\\\\' + regexString;
+ }
+
+ var regex = new RegExp(regexString, 'g');
+ text = text.replace(regex, escapeCharactersCallback);
+
+ return text;
+};
+
+var rgxFindMatchPos = function (str, left, right, flags) {
+ 'use strict';
+ var f = flags || '',
+ g = f.indexOf('g') > -1,
+ x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),
+ l = new RegExp(left, f.replace(/g/g, '')),
+ pos = [],
+ t, s, m, start, end;
+
+ do {
+ t = 0;
+ while ((m = x.exec(str))) {
+ if (l.test(m[0])) {
+ if (!(t++)) {
+ s = x.lastIndex;
+ start = s - m[0].length;
+ }
+ } else if (t) {
+ if (!--t) {
+ end = m.index + m[0].length;
+ var obj = {
+ left: {start: start, end: s},
+ match: {start: s, end: m.index},
+ right: {start: m.index, end: end},
+ wholeMatch: {start: start, end: end}
+ };
+ pos.push(obj);
+ if (!g) {
+ return pos;
+ }
+ }
+ }
+ }
+ } while (t && (x.lastIndex = s));
+
+ return pos;
+};
+
+/**
+ * matchRecursiveRegExp
+ *
+ * (c) 2007 Steven Levithan tags around block-level tags. + text = showdown.subParser('hashHTMLBlocks')(text, options, globals); + text = showdown.subParser('paragraphs')(text, options, globals); + + text = globals.converter._dispatch('blockGamut.after', text, options, globals); + + return text; +}); + +showdown.subParser('blockQuotes', function (text, options, globals) { + 'use strict'; + + text = globals.converter._dispatch('blockQuotes.before', text, options, globals); + /* + text = text.replace(/ + ( // Wrap whole match in $1 + ( + ^[ \t]*>[ \t]? // '>' at the start of a line + .+\n // rest of the first line + (.+\n)* // subsequent consecutive lines + \n* // blanks + )+ + ) + /gm, function(){...}); + */ + + text = text.replace(/((^[ \t]{0,3}>[ \t]?.+\n(.+\n)*\n*)+)/gm, function (wholeMatch, m1) { + var bq = m1; + + // attacklab: hack around Konqueror 3.5.4 bug: + // "----------bug".replace(/^-/g,"") == "bug" + bq = bq.replace(/^[ \t]*>[ \t]?/gm, '~0'); // trim one level of quoting + + // attacklab: clean up hack + bq = bq.replace(/~0/g, ''); + + bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines + bq = showdown.subParser('githubCodeBlocks')(bq, options, globals); + bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse + + bq = bq.replace(/(^|\n)/g, '$1 '); + // These leading spaces screw with
content, so we need to fix that:
+ bq = bq.replace(/(\s*[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) {
+ var pre = m1;
+ // attacklab: hack around Konqueror 3.5.4 bug:
+ pre = pre.replace(/^ /mg, '~0');
+ pre = pre.replace(/~0/g, '');
+ return pre;
+ });
+
+ return showdown.subParser('hashBlock')('\n' + bq + '\n
', options, globals);
+ });
+
+ text = globals.converter._dispatch('blockQuotes.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Process Markdown `` blocks.
+ */
+showdown.subParser('codeBlocks', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('codeBlocks.before', text, options, globals);
+ /*
+ text = text.replace(text,
+ /(?:\n\n|^)
+ ( // $1 = the code block -- one or more lines, starting with a space/tab
+ (?:
+ (?:[ ]{4}|\t) // Lines must start with a tab or a tab-width of spaces - attacklab: g_tab_width
+ .*\n+
+ )+
+ )
+ (\n*[ ]{0,3}[^ \t\n]|(?=~0)) // attacklab: g_tab_width
+ /g,function(){...});
+ */
+
+ // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
+ text += '~0';
+
+ var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g;
+ text = text.replace(pattern, function (wholeMatch, m1, m2) {
+ var codeblock = m1,
+ nextChar = m2,
+ end = '\n';
+
+ codeblock = showdown.subParser('outdent')(codeblock);
+ codeblock = showdown.subParser('encodeCode')(codeblock);
+ codeblock = showdown.subParser('detab')(codeblock);
+ codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
+ codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing newlines
+
+ if (options.omitExtraWLInCodeBlocks) {
+ end = '';
+ }
+
+ codeblock = '' + codeblock + end + '
';
+
+ return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar;
+ });
+
+ // attacklab: strip sentinel
+ text = text.replace(/~0/, '');
+
+ text = globals.converter._dispatch('codeBlocks.after', text, options, globals);
+ return text;
+});
+
+/**
+ *
+ * * Backtick quotes are used for spans.
+ *
+ * * You can use multiple backticks as the delimiters if you want to
+ * include literal backticks in the code span. So, this input:
+ *
+ * Just type ``foo `bar` baz`` at the prompt.
+ *
+ * Will translate to:
+ *
+ * Just type foo `bar` baz at the prompt.
+ *
+ * There's no arbitrary limit to the number of backticks you
+ * can use as delimters. If you need three consecutive backticks
+ * in your code, use four for delimiters, etc.
+ *
+ * * You can use spaces to get literal backticks at the edges:
+ *
+ * ... type `` `bar` `` ...
+ *
+ * Turns to:
+ *
+ * ... type `bar` ...
+ */
+showdown.subParser('codeSpans', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('codeSpans.before', text, options, globals);
+
+ /*
+ text = text.replace(/
+ (^|[^\\]) // Character before opening ` can't be a backslash
+ (`+) // $2 = Opening run of `
+ ( // $3 = The code block
+ [^\r]*?
+ [^`] // attacklab: work around lack of lookbehind
+ )
+ \2 // Matching closer
+ (?!`)
+ /gm, function(){...});
+ */
+
+ if (typeof(text) === 'undefined') {
+ text = '';
+ }
+ text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
+ function (wholeMatch, m1, m2, m3) {
+ var c = m3;
+ c = c.replace(/^([ \t]*)/g, ''); // leading whitespace
+ c = c.replace(/[ \t]*$/g, ''); // trailing whitespace
+ c = showdown.subParser('encodeCode')(c);
+ return m1 + '' + c + '';
+ }
+ );
+
+ text = globals.converter._dispatch('codeSpans.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Convert all tabs to spaces
+ */
+showdown.subParser('detab', function (text) {
+ 'use strict';
+
+ // expand first n-1 tabs
+ text = text.replace(/\t(?=\t)/g, ' '); // g_tab_width
+
+ // replace the nth with two sentinels
+ text = text.replace(/\t/g, '~A~B');
+
+ // use the sentinel to anchor our regex so it doesn't explode
+ text = text.replace(/~B(.+?)~A/g, function (wholeMatch, m1) {
+ var leadingText = m1,
+ numSpaces = 4 - leadingText.length % 4; // g_tab_width
+
+ // there *must* be a better way to do this:
+ for (var i = 0; i < numSpaces; i++) {
+ leadingText += ' ';
+ }
+
+ return leadingText;
+ });
+
+ // clean up sentinels
+ text = text.replace(/~A/g, ' '); // g_tab_width
+ text = text.replace(/~B/g, '');
+
+ return text;
+
+});
+
+/**
+ * Smart processing for ampersands and angle brackets that need to be encoded.
+ */
+showdown.subParser('encodeAmpsAndAngles', function (text) {
+ 'use strict';
+ // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
+ // http://bumppo.net/projects/amputator/
+ text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, '&');
+
+ // Encode naked <'s
+ text = text.replace(/<(?![a-z\/?\$!])/gi, '<');
+
+ return text;
+});
+
+/**
+ * Returns the string, with after processing the following backslash escape sequences.
+ *
+ * attacklab: The polite way to do this is with the new escapeCharacters() function:
+ *
+ * text = escapeCharacters(text,"\\",true);
+ * text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
+ *
+ * ...but we're sidestepping its use of the (slow) RegExp constructor
+ * as an optimization for Firefox. This function gets called a LOT.
+ */
+showdown.subParser('encodeBackslashEscapes', function (text) {
+ 'use strict';
+ text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
+ text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g, showdown.helper.escapeCharactersCallback);
+ return text;
+});
+
+/**
+ * Encode/escape certain characters inside Markdown code runs.
+ * The point is that in code, these characters are literals,
+ * and lose their special Markdown meanings.
+ */
+showdown.subParser('encodeCode', function (text) {
+ 'use strict';
+
+ // Encode all ampersands; HTML entities are not
+ // entities within a Markdown code span.
+ text = text.replace(/&/g, '&');
+
+ // Do the angle bracket song and dance:
+ text = text.replace(//g, '>');
+
+ // Now, escape characters that are magic in Markdown:
+ text = showdown.helper.escapeCharacters(text, '*_{}[]\\', false);
+
+ // jj the line above breaks this:
+ //---
+ //* Item
+ // 1. Subitem
+ // special char: *
+ // ---
+
+ return text;
+});
+
+/**
+ * Input: an email address, e.g. "foo@example.com"
+ *
+ * Output: the email address as a mailto link, with each character
+ * of the address encoded as either a decimal or hex entity, in
+ * the hopes of foiling most address harvesting spam bots. E.g.:
+ *
+ * foo
+ * @example.com
+ *
+ * Based on a filter by Matthew Wickline, posted to the BBEdit-Talk
+ * mailing list:
+ *
+ */
+showdown.subParser('encodeEmailAddress', function (addr) {
+ 'use strict';
+
+ var encode = [
+ function (ch) {
+ return '' + ch.charCodeAt(0) + ';';
+ },
+ function (ch) {
+ return '' + ch.charCodeAt(0).toString(16) + ';';
+ },
+ function (ch) {
+ return ch;
+ }
+ ];
+
+ addr = 'mailto:' + addr;
+
+ addr = addr.replace(/./g, function (ch) {
+ if (ch === '@') {
+ // this *must* be encoded. I insist.
+ ch = encode[Math.floor(Math.random() * 2)](ch);
+ } else if (ch !== ':') {
+ // leave ':' alone (to spot mailto: later)
+ var r = Math.random();
+ // roughly 10% raw, 45% hex, 45% dec
+ ch = (
+ r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch)
+ );
+ }
+ return ch;
+ });
+
+ addr = '' + addr + '';
+ addr = addr.replace(/">.+:/g, '">'); // strip the mailto: from the visible part
+
+ return addr;
+});
+
+/**
+ * Within tags -- meaning between < and > -- encode [\ ` * _] so they
+ * don't conflict with their use in Markdown for code, italics and strong.
+ */
+showdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text) {
+ 'use strict';
+
+ // Build a regex to find HTML tags and comments. See Friedl's
+ // "Mastering Regular Expressions", 2nd Ed., pp. 200-201.
+ var regex = /(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|)/gi;
+
+ text = text.replace(regex, function (wholeMatch) {
+ var tag = wholeMatch.replace(/(.)<\/?code>(?=.)/g, '$1`');
+ tag = showdown.helper.escapeCharacters(tag, '\\`*_', false);
+ return tag;
+ });
+
+ return text;
+});
+
+/**
+ * Handle github codeblocks prior to running HashHTML so that
+ * HTML contained within the codeblock gets escaped properly
+ * Example:
+ * ```ruby
+ * def hello_world(x)
+ * puts "Hello, #{x}"
+ * end
+ * ```
+ */
+showdown.subParser('githubCodeBlocks', function (text, options, globals) {
+ 'use strict';
+
+ // early exit if option is not enabled
+ if (!options.ghCodeBlocks) {
+ return text;
+ }
+
+ text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals);
+
+ text += '~0';
+
+ text = text.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g, function (wholeMatch, language, codeblock) {
+ var end = (options.omitExtraWLInCodeBlocks) ? '' : '\n';
+
+ // First parse the github code block
+ codeblock = showdown.subParser('encodeCode')(codeblock);
+ codeblock = showdown.subParser('detab')(codeblock);
+ codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
+ codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing whitespace
+
+ codeblock = '' + codeblock + end + '
';
+
+ codeblock = showdown.subParser('hashBlock')(codeblock, options, globals);
+
+ // Since GHCodeblocks can be false positives, we need to
+ // store the primitive text and the parsed text in a global var,
+ // and then return a token
+ return '\n\n~G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
+ });
+
+ // attacklab: strip sentinel
+ text = text.replace(/~0/, '');
+
+ return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals);
+});
+
+showdown.subParser('hashBlock', function (text, options, globals) {
+ 'use strict';
+ text = text.replace(/(^\n+|\n+$)/g, '');
+ return '\n\n~K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\n\n';
+});
+
+showdown.subParser('hashElement', function (text, options, globals) {
+ 'use strict';
+
+ return function (wholeMatch, m1) {
+ var blockText = m1;
+
+ // Undo double lines
+ blockText = blockText.replace(/\n\n/g, '\n');
+ blockText = blockText.replace(/^\n/, '');
+
+ // strip trailing blank lines
+ blockText = blockText.replace(/\n+$/g, '');
+
+ // Replace the element text with a marker ("~KxK" where x is its key)
+ blockText = '\n\n~K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\n\n';
+
+ return blockText;
+ };
+});
+
+showdown.subParser('hashHTMLBlocks', function (text, options, globals) {
+ 'use strict';
+
+ var blockTags = [
+ 'pre',
+ 'div',
+ 'h1',
+ 'h2',
+ 'h3',
+ 'h4',
+ 'h5',
+ 'h6',
+ 'blockquote',
+ 'table',
+ 'dl',
+ 'ol',
+ 'ul',
+ 'script',
+ 'noscript',
+ 'form',
+ 'fieldset',
+ 'iframe',
+ 'math',
+ 'style',
+ 'section',
+ 'header',
+ 'footer',
+ 'nav',
+ 'article',
+ 'aside',
+ 'address',
+ 'audio',
+ 'canvas',
+ 'figure',
+ 'hgroup',
+ 'output',
+ 'video',
+ 'p'
+ ],
+ repFunc = function (wholeMatch, match, left, right) {
+ var txt = wholeMatch;
+ // check if this html element is marked as markdown
+ // if so, it's contents should be parsed as markdown
+ if (left.search(/\bmarkdown\b/) !== -1) {
+ txt = left + globals.converter.makeHtml(match) + right;
+ }
+ return '\n\n~K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
+ };
+
+ for (var i = 0; i < blockTags.length; ++i) {
+ text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^(?: |\\t){0,3}<' + blockTags[i] + '\\b[^>]*>', '' + blockTags[i] + '>', 'gim');
+ }
+
+ // HR SPECIAL CASE
+ text = text.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
+ showdown.subParser('hashElement')(text, options, globals));
+
+ // Special case for standalone HTML comments:
+ text = text.replace(/()/g,
+ showdown.subParser('hashElement')(text, options, globals));
+
+ // PHP and ASP-style processor instructions (...?> and <%...%>)
+ text = text.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,
+ showdown.subParser('hashElement')(text, options, globals));
+ return text;
+});
+
+/**
+ * Hash span elements that should not be parsed as markdown
+ */
+showdown.subParser('hashHTMLSpans', function (text, config, globals) {
+ 'use strict';
+
+ var matches = showdown.helper.matchRecursiveRegExp(text, ']*>', '', 'gi');
+
+ for (var i = 0; i < matches.length; ++i) {
+ text = text.replace(matches[i][0], '~L' + (globals.gHtmlSpans.push(matches[i][0]) - 1) + 'L');
+ }
+ return text;
+});
+
+/**
+ * Unhash HTML spans
+ */
+showdown.subParser('unhashHTMLSpans', function (text, config, globals) {
+ 'use strict';
+
+ for (var i = 0; i < globals.gHtmlSpans.length; ++i) {
+ text = text.replace('~L' + i + 'L', globals.gHtmlSpans[i]);
+ }
+
+ return text;
+});
+
+/**
+ * Hash span elements that should not be parsed as markdown
+ */
+showdown.subParser('hashPreCodeTags', function (text, config, globals) {
+ 'use strict';
+
+ var repFunc = function (wholeMatch, match, left, right) {
+ // encode html entities
+ var codeblock = left + showdown.subParser('encodeCode')(match) + right;
+ return '\n\n~G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
+ };
+
+ text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^(?: |\\t){0,3}]*>\\s*]*>', '^(?: |\\t){0,3}\\s*
', 'gim');
+ return text;
+});
+
+showdown.subParser('headers', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('headers.before', text, options, globals);
+
+ var prefixHeader = options.prefixHeaderId,
+ headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
+
+ // Set text-style headers:
+ // Header 1
+ // ========
+ //
+ // Header 2
+ // --------
+ //
+ setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
+ setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
+
+ text = text.replace(setextRegexH1, function (wholeMatch, m1) {
+
+ var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
+ hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
+ hLevel = headerLevelStart,
+ hashBlock = '' + spanGamut + ' ';
+ return showdown.subParser('hashBlock')(hashBlock, options, globals);
+ });
+
+ text = text.replace(setextRegexH2, function (matchFound, m1) {
+ var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
+ hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
+ hLevel = headerLevelStart + 1,
+ hashBlock = '' + spanGamut + ' ';
+ return showdown.subParser('hashBlock')(hashBlock, options, globals);
+ });
+
+ // atx-style headers:
+ // # Header 1
+ // ## Header 2
+ // ## Header 2 with closing hashes ##
+ // ...
+ // ###### Header 6
+ //
+ text = text.replace(/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm, function (wholeMatch, m1, m2) {
+ var span = showdown.subParser('spanGamut')(m2, options, globals),
+ hID = (options.noHeaderId) ? '' : ' id="' + headerId(m2) + '"',
+ hLevel = headerLevelStart - 1 + m1.length,
+ header = '' + span + ' ';
+
+ return showdown.subParser('hashBlock')(header, options, globals);
+ });
+
+ function headerId(m) {
+ var title, escapedId = m.replace(/[^\w]/g, '').toLowerCase();
+
+ if (globals.hashLinkCounts[escapedId]) {
+ title = escapedId + '-' + (globals.hashLinkCounts[escapedId]++);
+ } else {
+ title = escapedId;
+ globals.hashLinkCounts[escapedId] = 1;
+ }
+
+ // Prefix id to prevent causing inadvertent pre-existing style matches.
+ if (prefixHeader === true) {
+ prefixHeader = 'section';
+ }
+
+ if (showdown.helper.isString(prefixHeader)) {
+ return prefixHeader + title;
+ }
+ return title;
+ }
+
+ text = globals.converter._dispatch('headers.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Turn Markdown image shortcuts into
tags.
+ */
+showdown.subParser('images', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('images.before', text, options, globals);
+
+ var inlineRegExp = /!\[(.*?)]\s?\([ \t]*()(\S+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(['"])(.*?)\6[ \t]*)?\)/g,
+ referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[(.*?)]()()()()()/g;
+
+ function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
+
+ var gUrls = globals.gUrls,
+ gTitles = globals.gTitles,
+ gDims = globals.gDimensions;
+
+ linkId = linkId.toLowerCase();
+
+ if (!title) {
+ title = '';
+ }
+
+ if (url === '' || url === null) {
+ if (linkId === '' || linkId === null) {
+ // lower-case and turn embedded newlines into spaces
+ linkId = altText.toLowerCase().replace(/ ?\n/g, ' ');
+ }
+ url = '#' + linkId;
+
+ if (!showdown.helper.isUndefined(gUrls[linkId])) {
+ url = gUrls[linkId];
+ if (!showdown.helper.isUndefined(gTitles[linkId])) {
+ title = gTitles[linkId];
+ }
+ if (!showdown.helper.isUndefined(gDims[linkId])) {
+ width = gDims[linkId].width;
+ height = gDims[linkId].height;
+ }
+ } else {
+ return wholeMatch;
+ }
+ }
+
+ altText = altText.replace(/"/g, '"');
+ altText = showdown.helper.escapeCharacters(altText, '*_', false);
+ url = showdown.helper.escapeCharacters(url, '*_', false);
+ var result = '
';
+ return result;
+ }
+
+ // First, handle reference-style labeled images: ![alt text][id]
+ text = text.replace(referenceRegExp, writeImageTag);
+
+ // Next, handle inline images: 
+ text = text.replace(inlineRegExp, writeImageTag);
+
+ text = globals.converter._dispatch('images.after', text, options, globals);
+ return text;
+});
+
+showdown.subParser('italicsAndBold', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('italicsAndBold.before', text, options, globals);
+
+ if (options.literalMidWordUnderscores) {
+ //underscores
+ // Since we are consuming a \s character, we need to add it
+ text = text.replace(/(^|\s|>|\b)__(?=\S)([\s\S]+?)__(?=\b|<|\s|$)/gm, '$1$2');
+ text = text.replace(/(^|\s|>|\b)_(?=\S)([\s\S]+?)_(?=\b|<|\s|$)/gm, '$1$2');
+ //asterisks
+ text = text.replace(/(\*\*)(?=\S)([^\r]*?\S[*]*)\1/g, '$2');
+ text = text.replace(/(\*)(?=\S)([^\r]*?\S)\1/g, '$2');
+
+ } else {
+ // must go first:
+ text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, '$2');
+ text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, '$2');
+ }
+
+ text = globals.converter._dispatch('italicsAndBold.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Form HTML ordered (numbered) and unordered (bulleted) lists.
+ */
+showdown.subParser('lists', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('lists.before', text, options, globals);
+ /**
+ * Process the contents of a single ordered or unordered list, splitting it
+ * into individual list items.
+ * @param {string} listStr
+ * @param {boolean} trimTrailing
+ * @returns {string}
+ */
+ function processListItems (listStr, trimTrailing) {
+ // The $g_list_level global keeps track of when we're inside a list.
+ // Each time we enter a list, we increment it; when we leave a list,
+ // we decrement. If it's zero, we're not in a list anymore.
+ //
+ // We do this because when we're not inside a list, we want to treat
+ // something like this:
+ //
+ // I recommend upgrading to version
+ // 8. Oops, now this line is treated
+ // as a sub-list.
+ //
+ // As a single paragraph, despite the fact that the second line starts
+ // with a digit-period-space sequence.
+ //
+ // Whereas when we're inside a list (or sub-list), that line will be
+ // treated as the start of a sub-list. What a kludge, huh? This is
+ // an aspect of Markdown's syntax that's hard to parse perfectly
+ // without resorting to mind-reading. Perhaps the solution is to
+ // change the syntax rules such that sub-lists must start with a
+ // starting cardinal number; e.g. "1." or "a.".
+ globals.gListLevel++;
+
+ // trim trailing blank lines:
+ listStr = listStr.replace(/\n{2,}$/, '\n');
+
+ // attacklab: add sentinel to emulate \z
+ listStr += '~0';
+
+ var rgx = /(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,
+ isParagraphed = (/\n[ \t]*\n(?!~0)/.test(listStr));
+
+ listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) {
+ checked = (checked && checked.trim() !== '');
+ var item = showdown.subParser('outdent')(m4, options, globals),
+ bulletStyle = '';
+
+ // Support for github tasklists
+ if (taskbtn && options.tasklists) {
+ bulletStyle = ' class="task-list-item" style="list-style-type: none;"';
+ item = item.replace(/^[ \t]*\[(x|X| )?]/m, function () {
+ var otp = '';
+ return otp;
+ });
+ }
+ // m1 - Leading line or
+ // Has a double return (multi paragraph) or
+ // Has sublist
+ if (m1 || (item.search(/\n{2,}/) > -1)) {
+ item = showdown.subParser('githubCodeBlocks')(item, options, globals);
+ item = showdown.subParser('blockGamut')(item, options, globals);
+ } else {
+ // Recursion for sub-lists:
+ item = showdown.subParser('lists')(item, options, globals);
+ item = item.replace(/\n$/, ''); // chomp(item)
+ if (isParagraphed) {
+ item = showdown.subParser('paragraphs')(item, options, globals);
+ } else {
+ item = showdown.subParser('spanGamut')(item, options, globals);
+ }
+ }
+ item = '\n' + item + ' \n';
+ return item;
+ });
+
+ // attacklab: strip sentinel
+ listStr = listStr.replace(/~0/g, '');
+
+ globals.gListLevel--;
+
+ if (trimTrailing) {
+ listStr = listStr.replace(/\s+$/, '');
+ }
+
+ return listStr;
+ }
+
+ /**
+ * Check and parse consecutive lists (better fix for issue #142)
+ * @param {string} list
+ * @param {string} listType
+ * @param {boolean} trimTrailing
+ * @returns {string}
+ */
+ function parseConsecutiveLists(list, listType, trimTrailing) {
+ // check if we caught 2 or more consecutive lists by mistake
+ // we use the counterRgx, meaning if listType is UL we look for UL and vice versa
+ var counterRxg = (listType === 'ul') ? /^ {0,2}\d+\.[ \t]/gm : /^ {0,2}[*+-][ \t]/gm,
+ subLists = [],
+ result = '';
+
+ if (list.search(counterRxg) !== -1) {
+ (function parseCL(txt) {
+ var pos = txt.search(counterRxg);
+ if (pos !== -1) {
+ // slice
+ result += '\n\n<' + listType + '>' + processListItems(txt.slice(0, pos), !!trimTrailing) + '' + listType + '>\n\n';
+
+ // invert counterType and listType
+ listType = (listType === 'ul') ? 'ol' : 'ul';
+ counterRxg = (listType === 'ul') ? /^ {0,2}\d+\.[ \t]/gm : /^ {0,2}[*+-][ \t]/gm;
+
+ //recurse
+ parseCL(txt.slice(pos));
+ } else {
+ result += '\n\n<' + listType + '>' + processListItems(txt, !!trimTrailing) + '' + listType + '>\n\n';
+ }
+ })(list);
+ for (var i = 0; i < subLists.length; ++i) {
+
+ }
+ } else {
+ result = '\n\n<' + listType + '>' + processListItems(list, !!trimTrailing) + '' + listType + '>\n\n';
+ }
+
+ return result;
+ }
+
+ // attacklab: add sentinel to hack around khtml/safari bug:
+ // http://bugs.webkit.org/show_bug.cgi?id=11231
+ text += '~0';
+
+ // Re-usable pattern to match any entire ul or ol list:
+ var wholeList = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
+
+ if (globals.gListLevel) {
+ text = text.replace(wholeList, function (wholeMatch, list, m2) {
+ var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
+ return parseConsecutiveLists(list, listType, true);
+ });
+ } else {
+ wholeList = /(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
+ //wholeList = /(\n\n|^\n?)( {0,3}([*+-]|\d+\.)[ \t]+[\s\S]+?)(?=(~0)|(\n\n(?!\t| {2,}| {0,3}([*+-]|\d+\.)[ \t])))/g;
+ text = text.replace(wholeList, function (wholeMatch, m1, list, m3) {
+
+ var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
+ return parseConsecutiveLists(list, listType);
+ });
+ }
+
+ // attacklab: strip sentinel
+ text = text.replace(/~0/, '');
+
+ text = globals.converter._dispatch('lists.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Remove one level of line-leading tabs or spaces
+ */
+showdown.subParser('outdent', function (text) {
+ 'use strict';
+
+ // attacklab: hack around Konqueror 3.5.4 bug:
+ // "----------bug".replace(/^-/g,"") == "bug"
+ text = text.replace(/^(\t|[ ]{1,4})/gm, '~0'); // attacklab: g_tab_width
+
+ // attacklab: clean up hack
+ text = text.replace(/~0/g, '');
+
+ return text;
+});
+
+/**
+ *
+ */
+showdown.subParser('paragraphs', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('paragraphs.before', text, options, globals);
+ // Strip leading and trailing lines:
+ text = text.replace(/^\n+/g, '');
+ text = text.replace(/\n+$/g, '');
+
+ var grafs = text.split(/\n{2,}/g),
+ grafsOut = [],
+ end = grafs.length; // Wrap tags
+
+ for (var i = 0; i < end; i++) {
+ var str = grafs[i];
+ // if this is an HTML marker, copy it
+ if (str.search(/~(K|G)(\d+)\1/g) >= 0) {
+ grafsOut.push(str);
+ } else {
+ str = showdown.subParser('spanGamut')(str, options, globals);
+ str = str.replace(/^([ \t]*)/g, '
');
+ str += '
';
+ grafsOut.push(str);
+ }
+ }
+
+ /** Unhashify HTML blocks */
+ end = grafsOut.length;
+ for (i = 0; i < end; i++) {
+ var blockText = '',
+ grafsOutIt = grafsOut[i],
+ codeFlag = false;
+ // if this is a marker for an html block...
+ while (grafsOutIt.search(/~(K|G)(\d+)\1/) >= 0) {
+ var delim = RegExp.$1,
+ num = RegExp.$2;
+
+ if (delim === 'K') {
+ blockText = globals.gHtmlBlocks[num];
+ } else {
+ // we need to check if ghBlock is a false positive
+ if (codeFlag) {
+ // use encoded version of all text
+ blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text);
+ } else {
+ blockText = globals.ghCodeBlocks[num].codeblock;
+ }
+ }
+ blockText = blockText.replace(/\$/g, '$$$$'); // Escape any dollar signs
+
+ grafsOutIt = grafsOutIt.replace(/(\n\n)?~(K|G)\d+\2(\n\n)?/, blockText);
+ // Check if grafsOutIt is a pre->code
+ if (/^]*>\s*]*>/.test(grafsOutIt)) {
+ codeFlag = true;
+ }
+ }
+ grafsOut[i] = grafsOutIt;
+ }
+ text = grafsOut.join('\n\n');
+ // Strip leading and trailing lines:
+ text = text.replace(/^\n+/g, '');
+ text = text.replace(/\n+$/g, '');
+ return globals.converter._dispatch('paragraphs.after', text, options, globals);
+});
+
+/**
+ * Run extension
+ */
+showdown.subParser('runExtension', function (ext, text, options, globals) {
+ 'use strict';
+
+ if (ext.filter) {
+ text = ext.filter(text, globals.converter, options);
+
+ } else if (ext.regex) {
+ // TODO remove this when old extension loading mechanism is deprecated
+ var re = ext.regex;
+ if (!re instanceof RegExp) {
+ re = new RegExp(re, 'g');
+ }
+ text = text.replace(re, ext.replace);
+ }
+
+ return text;
+});
+
+/**
+ * These are all the transformations that occur *within* block-level
+ * tags like paragraphs, headers, and list items.
+ */
+showdown.subParser('spanGamut', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('spanGamut.before', text, options, globals);
+ text = showdown.subParser('codeSpans')(text, options, globals);
+ text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals);
+ text = showdown.subParser('encodeBackslashEscapes')(text, options, globals);
+
+ // Process anchor and image tags. Images must come first,
+ // because ![foo][f] looks like an anchor.
+ text = showdown.subParser('images')(text, options, globals);
+ text = showdown.subParser('anchors')(text, options, globals);
+
+ // Make links out of things like ` `
+ // Must come after _DoAnchors(), because you can use < and >
+ // delimiters in inline links like [this]().
+ text = showdown.subParser('autoLinks')(text, options, globals);
+ text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals);
+ text = showdown.subParser('italicsAndBold')(text, options, globals);
+ text = showdown.subParser('strikethrough')(text, options, globals);
+
+ // Do hard breaks:
+ text = text.replace(/ +\n/g, '
\n');
+
+ text = globals.converter._dispatch('spanGamut.after', text, options, globals);
+ return text;
+});
+
+showdown.subParser('strikethrough', function (text, options, globals) {
+ 'use strict';
+
+ if (options.strikethrough) {
+ text = globals.converter._dispatch('strikethrough.before', text, options, globals);
+ text = text.replace(/(?:~T){2}([\s\S]+?)(?:~T){2}/g, '$1');
+ text = globals.converter._dispatch('strikethrough.after', text, options, globals);
+ }
+
+ return text;
+});
+
+/**
+ * Strip any lines consisting only of spaces and tabs.
+ * This makes subsequent regexs easier to write, because we can
+ * match consecutive blank lines with /\n+/ instead of something
+ * contorted like /[ \t]*\n+/
+ */
+showdown.subParser('stripBlankLines', function (text) {
+ 'use strict';
+ return text.replace(/^[ \t]+$/mg, '');
+});
+
+/**
+ * Strips link definitions from text, stores the URLs and titles in
+ * hash references.
+ * Link defs are in the form: ^[id]: url "optional title"
+ *
+ * ^[ ]{0,3}\[(.+)\]: // id = $1 attacklab: g_tab_width - 1
+ * [ \t]*
+ * \n? // maybe *one* newline
+ * [ \t]*
+ * (\S+?)>? // url = $2
+ * [ \t]*
+ * \n? // maybe one newline
+ * [ \t]*
+ * (?:
+ * (\n*) // any lines skipped = $3 attacklab: lookbehind removed
+ * ["(]
+ * (.+?) // title = $4
+ * [")]
+ * [ \t]*
+ * )? // title is optional
+ * (?:\n+|$)
+ * /gm,
+ * function(){...});
+ *
+ */
+showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
+ 'use strict';
+
+ var regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*(\S+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=~0))/gm;
+
+ // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
+ text += '~0';
+
+ text = text.replace(regex, function (wholeMatch, linkId, url, width, height, blankLines, title) {
+ linkId = linkId.toLowerCase();
+ globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url); // Link IDs are case-insensitive
+
+ if (blankLines) {
+ // Oops, found blank lines, so it's not a title.
+ // Put back the parenthetical statement we stole.
+ return blankLines + title;
+
+ } else {
+ if (title) {
+ globals.gTitles[linkId] = title.replace(/"|'/g, '"');
+ }
+ if (options.parseImgDimensions && width && height) {
+ globals.gDimensions[linkId] = {
+ width: width,
+ height: height
+ };
+ }
+ }
+ // Completely remove the definition from the text
+ return '';
+ });
+
+ // attacklab: strip sentinel
+ text = text.replace(/~0/, '');
+
+ return text;
+});
+
+showdown.subParser('tables', function (text, options, globals) {
+ 'use strict';
+
+ if (!options.tables) {
+ return text;
+ }
+
+ var tableRgx = /^[ \t]{0,3}\|?.+\|.+\n[ \t]{0,3}\|?[ \t]*:?[ \t]*(?:-|=){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:-|=){2,}[\s\S]+?(?:\n\n|~0)/gm;
+
+ function parseStyles(sLine) {
+ if (/^:[ \t]*--*$/.test(sLine)) {
+ return ' style="text-align:left;"';
+ } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
+ return ' style="text-align:right;"';
+ } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
+ return ' style="text-align:center;"';
+ } else {
+ return '';
+ }
+ }
+
+ function parseHeaders(header, style) {
+ var id = '';
+ header = header.trim();
+ if (options.tableHeaderId) {
+ id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"';
+ }
+ header = showdown.subParser('spanGamut')(header, options, globals);
+
+ return '' + header + ' \n';
+ }
+
+ function parseCells(cell, style) {
+ var subText = showdown.subParser('spanGamut')(cell, options, globals);
+ return '' + subText + ' \n';
+ }
+
+ function buildTable(headers, cells) {
+ var tb = '\n\n\n',
+ tblLgn = headers.length;
+
+ for (var i = 0; i < tblLgn; ++i) {
+ tb += headers[i];
+ }
+ tb += ' \n\n\n';
+
+ for (i = 0; i < cells.length; ++i) {
+ tb += '\n';
+ for (var ii = 0; ii < tblLgn; ++ii) {
+ tb += cells[i][ii];
+ }
+ tb += ' \n';
+ }
+ tb += '\n
\n';
+ return tb;
+ }
+
+ text = globals.converter._dispatch('tables.before', text, options, globals);
+
+ text = text.replace(tableRgx, function (rawTable) {
+
+ var i, tableLines = rawTable.split('\n');
+
+ // strip wrong first and last column if wrapped tables are used
+ for (i = 0; i < tableLines.length; ++i) {
+ if (/^[ \t]{0,3}\|/.test(tableLines[i])) {
+ tableLines[i] = tableLines[i].replace(/^[ \t]{0,3}\|/, '');
+ }
+ if (/\|[ \t]*$/.test(tableLines[i])) {
+ tableLines[i] = tableLines[i].replace(/\|[ \t]*$/, '');
+ }
+ }
+
+ var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),
+ rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),
+ rawCells = [],
+ headers = [],
+ styles = [],
+ cells = [];
+
+ tableLines.shift();
+ tableLines.shift();
+
+ for (i = 0; i < tableLines.length; ++i) {
+ if (tableLines[i].trim() === '') {
+ continue;
+ }
+ rawCells.push(
+ tableLines[i]
+ .split('|')
+ .map(function (s) {
+ return s.trim();
+ })
+ );
+ }
+
+ if (rawHeaders.length < rawStyles.length) {
+ return rawTable;
+ }
+
+ for (i = 0; i < rawStyles.length; ++i) {
+ styles.push(parseStyles(rawStyles[i]));
+ }
+
+ for (i = 0; i < rawHeaders.length; ++i) {
+ if (showdown.helper.isUndefined(styles[i])) {
+ styles[i] = '';
+ }
+ headers.push(parseHeaders(rawHeaders[i], styles[i]));
+ }
+
+ for (i = 0; i < rawCells.length; ++i) {
+ var row = [];
+ for (var ii = 0; ii < headers.length; ++ii) {
+ if (showdown.helper.isUndefined(rawCells[i][ii])) {
+
+ }
+ row.push(parseCells(rawCells[i][ii], styles[ii]));
+ }
+ cells.push(row);
+ }
+
+ return buildTable(headers, cells);
+ });
+
+ text = globals.converter._dispatch('tables.after', text, options, globals);
+
+ return text;
+});
+
+/**
+ * Swap back in all the special characters we've hidden.
+ */
+showdown.subParser('unescapeSpecialChars', function (text) {
+ 'use strict';
+
+ text = text.replace(/~E(\d+)E/g, function (wholeMatch, m1) {
+ var charCodeToReplace = parseInt(m1);
+ return String.fromCharCode(charCodeToReplace);
+ });
+ return text;
+});
+module.exports = showdown;
diff --git a/yun-min-program-plugin-master/wxParse/wxDiscode.js b/yun-min-program-plugin-master/wxParse/wxDiscode.js
new file mode 100644
index 0000000..e339f7a
--- /dev/null
+++ b/yun-min-program-plugin-master/wxParse/wxDiscode.js
@@ -0,0 +1,206 @@
+// HTML 支持的数学符号
+function strNumDiscode(str){
+ str = str.replace(/∀/g, '∀');
+ str = str.replace(/∂/g, '∂');
+ str = str.replace(/&exists;/g, '∃');
+ str = str.replace(/∅/g, '∅');
+ str = str.replace(/∇/g, '∇');
+ str = str.replace(/∈/g, '∈');
+ str = str.replace(/∉/g, '∉');
+ str = str.replace(/∋/g, '∋');
+ str = str.replace(/∏/g, '∏');
+ str = str.replace(/∑/g, '∑');
+ str = str.replace(/−/g, '−');
+ str = str.replace(/∗/g, '∗');
+ str = str.replace(/√/g, '√');
+ str = str.replace(/∝/g, '∝');
+ str = str.replace(/∞/g, '∞');
+ str = str.replace(/∠/g, '∠');
+ str = str.replace(/∧/g, '∧');
+ str = str.replace(/∨/g, '∨');
+ str = str.replace(/∩/g, '∩');
+ str = str.replace(/∩/g, '∪');
+ str = str.replace(/∫/g, '∫');
+ str = str.replace(/∴/g, '∴');
+ str = str.replace(/∼/g, '∼');
+ str = str.replace(/≅/g, '≅');
+ str = str.replace(/≈/g, '≈');
+ str = str.replace(/≠/g, '≠');
+ str = str.replace(/≤/g, '≤');
+ str = str.replace(/≥/g, '≥');
+ str = str.replace(/⊂/g, '⊂');
+ str = str.replace(/⊃/g, '⊃');
+ str = str.replace(/⊄/g, '⊄');
+ str = str.replace(/⊆/g, '⊆');
+ str = str.replace(/⊇/g, '⊇');
+ str = str.replace(/⊕/g, '⊕');
+ str = str.replace(/⊗/g, '⊗');
+ str = str.replace(/⊥/g, '⊥');
+ str = str.replace(/⋅/g, '⋅');
+ return str;
+}
+
+//HTML 支持的希腊字母
+function strGreeceDiscode(str){
+ str = str.replace(/Α/g, 'Α');
+ str = str.replace(/Β/g, 'Β');
+ str = str.replace(/Γ/g, 'Γ');
+ str = str.replace(/Δ/g, 'Δ');
+ str = str.replace(/Ε/g, 'Ε');
+ str = str.replace(/Ζ/g, 'Ζ');
+ str = str.replace(/Η/g, 'Η');
+ str = str.replace(/Θ/g, 'Θ');
+ str = str.replace(/Ι/g, 'Ι');
+ str = str.replace(/Κ/g, 'Κ');
+ str = str.replace(/Λ/g, 'Λ');
+ str = str.replace(/Μ/g, 'Μ');
+ str = str.replace(/Ν/g, 'Ν');
+ str = str.replace(/Ξ/g, 'Ν');
+ str = str.replace(/Ο/g, 'Ο');
+ str = str.replace(/Π/g, 'Π');
+ str = str.replace(/Ρ/g, 'Ρ');
+ str = str.replace(/Σ/g, 'Σ');
+ str = str.replace(/Τ/g, 'Τ');
+ str = str.replace(/Υ/g, 'Υ');
+ str = str.replace(/Φ/g, 'Φ');
+ str = str.replace(/Χ/g, 'Χ');
+ str = str.replace(/Ψ/g, 'Ψ');
+ str = str.replace(/Ω/g, 'Ω');
+
+ str = str.replace(/α/g, 'α');
+ str = str.replace(/β/g, 'β');
+ str = str.replace(/γ/g, 'γ');
+ str = str.replace(/δ/g, 'δ');
+ str = str.replace(/ε/g, 'ε');
+ str = str.replace(/ζ/g, 'ζ');
+ str = str.replace(/η/g, 'η');
+ str = str.replace(/θ/g, 'θ');
+ str = str.replace(/ι/g, 'ι');
+ str = str.replace(/κ/g, 'κ');
+ str = str.replace(/λ/g, 'λ');
+ str = str.replace(/μ/g, 'μ');
+ str = str.replace(/ν/g, 'ν');
+ str = str.replace(/ξ/g, 'ξ');
+ str = str.replace(/ο/g, 'ο');
+ str = str.replace(/π/g, 'π');
+ str = str.replace(/ρ/g, 'ρ');
+ str = str.replace(/ς/g, 'ς');
+ str = str.replace(/σ/g, 'σ');
+ str = str.replace(/τ/g, 'τ');
+ str = str.replace(/υ/g, 'υ');
+ str = str.replace(/φ/g, 'φ');
+ str = str.replace(/χ/g, 'χ');
+ str = str.replace(/ψ/g, 'ψ');
+ str = str.replace(/ω/g, 'ω');
+ str = str.replace(/ϑ/g, 'ϑ');
+ str = str.replace(/ϒ/g, 'ϒ');
+ str = str.replace(/ϖ/g, 'ϖ');
+ str = str.replace(/·/g, '·');
+ return str;
+}
+
+//
+
+function strcharacterDiscode(str){
+ // 加入常用解析
+ str = str.replace(/ /g, ' ');
+ str = str.replace(/"/g, '"');
+ str = str.replace(/&/g, '&');
+ // str = str.replace(/</g, '‹');
+ // str = str.replace(/>/g, '›');
+
+ str = str.replace(/</g, '<');
+ str = str.replace(/>/g, '>');
+
+ return str;
+}
+
+// HTML 支持的其他实体
+function strOtherDiscode(str){
+ str = str.replace(/Œ/g, 'Œ');
+ str = str.replace(/œ/g, 'œ');
+ str = str.replace(/Š/g, 'Š');
+ str = str.replace(/š/g, 'š');
+ str = str.replace(/Ÿ/g, 'Ÿ');
+ str = str.replace(/ƒ/g, 'ƒ');
+ str = str.replace(/ˆ/g, 'ˆ');
+ str = str.replace(/˜/g, '˜');
+ str = str.replace(/ /g, '');
+ str = str.replace(/ /g, '');
+ str = str.replace(/ /g, '');
+ str = str.replace(//g, '');
+ str = str.replace(//g, '');
+ str = str.replace(//g, '');
+ str = str.replace(//g, '');
+ str = str.replace(/–/g, '–');
+ str = str.replace(/—/g, '—');
+ str = str.replace(/‘/g, '‘');
+ str = str.replace(/’/g, '’');
+ str = str.replace(/‚/g, '‚');
+ str = str.replace(/“/g, '“');
+ str = str.replace(/”/g, '”');
+ str = str.replace(/„/g, '„');
+ str = str.replace(/†/g, '†');
+ str = str.replace(/‡/g, '‡');
+ str = str.replace(/•/g, '•');
+ str = str.replace(/…/g, '…');
+ str = str.replace(/‰/g, '‰');
+ str = str.replace(/′/g, '′');
+ str = str.replace(/″/g, '″');
+ str = str.replace(/‹/g, '‹');
+ str = str.replace(/›/g, '›');
+ str = str.replace(/‾/g, '‾');
+ str = str.replace(/€/g, '€');
+ str = str.replace(/™/g, '™');
+
+ str = str.replace(/←/g, '←');
+ str = str.replace(/↑/g, '↑');
+ str = str.replace(/→/g, '→');
+ str = str.replace(/↓/g, '↓');
+ str = str.replace(/↔/g, '↔');
+ str = str.replace(/↵/g, '↵');
+ str = str.replace(/⌈/g, '⌈');
+ str = str.replace(/⌉/g, '⌉');
+
+ str = str.replace(/⌊/g, '⌊');
+ str = str.replace(/⌋/g, '⌋');
+ str = str.replace(/◊/g, '◊');
+ str = str.replace(/♠/g, '♠');
+ str = str.replace(/♣/g, '♣');
+ str = str.replace(/♥/g, '♥');
+
+ str = str.replace(/♦/g, '♦');
+
+ return str;
+}
+
+function strMoreDiscode(str){
+ str = str.replace(/\r\n/g,"");
+ str = str.replace(/\n/g,"");
+
+ str = str.replace(/code/g,"wxxxcode-style");
+ return str;
+}
+
+function strDiscode(str){
+ str = strNumDiscode(str);
+ str = strGreeceDiscode(str);
+ str = strcharacterDiscode(str);
+ str = strOtherDiscode(str);
+ str = strMoreDiscode(str);
+ return str;
+}
+function urlToHttpUrl(url,rep){
+
+ var patt1 = new RegExp("^//");
+ var result = patt1.test(url);
+ if(result){
+ url = rep+":"+url;
+ }
+ return url;
+}
+
+module.exports = {
+ strDiscode:strDiscode,
+ urlToHttpUrl:urlToHttpUrl
+}
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/wxParse/wxParse.js b/yun-min-program-plugin-master/wxParse/wxParse.js
new file mode 100644
index 0000000..8adab50
--- /dev/null
+++ b/yun-min-program-plugin-master/wxParse/wxParse.js
@@ -0,0 +1,146 @@
+/**
+ * author: Di (微信小程序开发工程师)
+ * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
+ * 垂直微信小程序开发交流社区
+ *
+ * github地址: https://github.com/icindy/wxParse
+ *
+ * for: 微信小程序富文本解析
+ * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
+ */
+
+/**
+ * utils函数引入
+ **/
+import showdown from 'showdown.js';
+import HtmlToJson from 'html2json.js';
+/**
+ * 配置及公有属性
+ **/
+/**
+ * 主函数入口区
+ **/
+function wxParse(bindName = 'wxParseData', type='html', data='数据不能为空', target,imagePadding) {
+ var that = target;
+ var transData = {};//存放转化后的数据
+ if (type == 'html') {
+ transData = HtmlToJson.html2json(data, bindName);
+ // console.log(JSON.stringify(transData, ' ', ' '));
+ } else if (type == 'md' || type == 'markdown') {
+ var converter = new showdown.Converter();
+ var html = converter.makeHtml(data);
+ transData = HtmlToJson.html2json(html, bindName);
+ // console.log(JSON.stringify(transData, ' ', ' '));
+ }
+ transData.view = {};
+ transData.view.imagePadding = 0;
+ if(typeof(imagePadding) != 'undefined'){
+ transData.view.imagePadding = imagePadding
+ }
+ var bindData = {};
+ bindData[bindName] = transData;
+ that.setData(bindData)
+ that.wxParseImgLoad = wxParseImgLoad;
+ that.wxParseImgTap = wxParseImgTap;
+}
+// 图片点击事件
+function wxParseImgTap(e) {
+ var that = this;
+ var nowImgUrl = e.target.dataset.src;
+ var tagFrom = e.target.dataset.from;
+ if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
+ wx.previewImage({
+ current: nowImgUrl, // 当前显示图片的http链接
+ urls: that.data[tagFrom].imageUrls // 需要预览的图片http链接列表
+ })
+ }
+}
+
+/**
+ * 图片视觉宽高计算函数区
+ **/
+function wxParseImgLoad(e) {
+ var that = this;
+ var tagFrom = e.target.dataset.from;
+ var idx = e.target.dataset.idx;
+ if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
+ calMoreImageInfo(e, idx, that, tagFrom)
+ }
+}
+// 假循环获取计算图片视觉最佳宽高
+function calMoreImageInfo(e, idx, that, bindName) {
+ var temData = that.data[bindName];
+ if (temData.images.length == 0) {
+ return;
+ }
+ var temImages = temData.images;
+ //因为无法获取view宽度 需要自定义padding进行计算,稍后处理
+ var recal = wxAutoImageCal(e.detail.width, e.detail.height,that,bindName);
+ temImages[idx].width = recal.imageWidth;
+ temImages[idx].height = recal.imageheight;
+ temData.images = temImages;
+ var bindData = {};
+ bindData[bindName] = temData;
+ that.setData(bindData);
+}
+
+// 计算视觉优先的图片宽高
+function wxAutoImageCal(originalWidth, originalHeight,that,bindName) {
+ //获取图片的原始长宽
+ var windowWidth = 0, windowHeight = 0;
+ var autoWidth = 0, autoHeight = 0;
+ var results = {};
+ wx.getSystemInfo({
+ success: function (res) {
+ var padding = that.data[bindName].view.imagePadding;
+ windowWidth = res.windowWidth-2*padding;
+ windowHeight = res.windowHeight;
+ //判断按照那种方式进行缩放
+ // console.log("windowWidth" + windowWidth);
+ if (originalWidth > windowWidth) {//在图片width大于手机屏幕width时候
+ autoWidth = windowWidth;
+ // console.log("autoWidth" + autoWidth);
+ autoHeight = (autoWidth * originalHeight) / originalWidth;
+ // console.log("autoHeight" + autoHeight);
+ results.imageWidth = autoWidth;
+ results.imageheight = autoHeight;
+ } else {//否则展示原来的数据
+ results.imageWidth = originalWidth;
+ results.imageheight = originalHeight;
+ }
+ }
+ })
+ return results;
+}
+
+function wxParseTemArray(temArrayName,bindNameReg,total,that){
+ var array = [];
+ var temData = that.data;
+ var obj = null;
+ for(var i = 0; i < total; i++){
+ var simArr = temData[bindNameReg+i].nodes;
+ array.push(simArr);
+ }
+
+ temArrayName = temArrayName || 'wxParseTemArray';
+ obj = JSON.parse('{"'+ temArrayName +'":""}');
+ obj[temArrayName] = array;
+ that.setData(obj);
+}
+
+/**
+ * 配置emojis
+ *
+ */
+
+function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
+ HtmlToJson.emojisInit(reg,baseSrc,emojis);
+}
+
+module.exports = {
+ wxParse: wxParse,
+ wxParseTemArray:wxParseTemArray,
+ emojisInit:emojisInit
+}
+
+
diff --git a/yun-min-program-plugin-master/wxParse/wxParse.wxml b/yun-min-program-plugin-master/wxParse/wxParse.wxml
new file mode 100644
index 0000000..cac5587
--- /dev/null
+++ b/yun-min-program-plugin-master/wxParse/wxParse.wxml
@@ -0,0 +1,921 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.text}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yun-min-program-plugin-master/wxParse/wxParse.wxss b/yun-min-program-plugin-master/wxParse/wxParse.wxss
new file mode 100644
index 0000000..190003b
--- /dev/null
+++ b/yun-min-program-plugin-master/wxParse/wxParse.wxss
@@ -0,0 +1,182 @@
+
+/**
+ * author: Di (微信小程序开发工程师)
+ * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
+ * 垂直微信小程序开发交流社区
+ *
+ * github地址: https://github.com/icindy/wxParse
+ *
+ * for: 微信小程序富文本解析
+ * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
+ */
+
+.wxParse{
+ margin: 0 5px;
+ font-family: Helvetica,sans-serif;
+ font-size: 28rpx;
+ color: #666;
+ line-height: 1.8;
+}
+view{
+ word-break:break-all;
+}
+.wxParse-inline{
+ display: inline;
+ margin: 0;
+ padding: 0;
+}
+/*//标题 */
+.wxParse-div{margin: 0;padding: 0;}
+.wxParse-h1{ font-size:2em; margin: .67em 0 }
+.wxParse-h2{ font-size:1.5em; margin: .75em 0 }
+.wxParse-h3{ font-size:1.17em; margin: .83em 0 }
+.wxParse-h4{ margin: 1.12em 0}
+.wxParse-h5 { font-size:.83em; margin: 1.5em 0 }
+.wxParse-h6{ font-size:.75em; margin: 1.67em 0 }
+
+.wxParse-h1 {
+ font-size: 18px;
+ font-weight: 400;
+ margin-bottom: .9em;
+}
+.wxParse-h2 {
+ font-size: 16px;
+ font-weight: 400;
+ margin-bottom: .34em;
+}
+.wxParse-h3 {
+ font-weight: 400;
+ font-size: 15px;
+ margin-bottom: .34em;
+}
+.wxParse-h4 {
+ font-weight: 400;
+ font-size: 14px;
+ margin-bottom: .24em;
+}
+.wxParse-h5 {
+ font-weight: 400;
+ font-size: 13px;
+ margin-bottom: .14em;
+}
+.wxParse-h6 {
+ font-weight: 400;
+ font-size: 12px;
+ margin-bottom: .04em;
+}
+
+.wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong { font-weight: bolder }
+
+.wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}
+.wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}
+.wxParse-pre{white-space:pre}
+.wxParse-big{font-size:1.17em}
+.wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}
+.wxParse-sub{vertical-align:sub}
+.wxParse-sup{vertical-align:super}
+.wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}
+/*wxparse-自定义个性化的css样式*/
+/*增加video的css样式*/
+.wxParse-strong,wxParse-s{display: inline}
+.wxParse-a{
+ color: deepskyblue;
+ word-break:break-all;
+ overflow:auto;
+}
+
+.wxParse-video{
+ text-align: center;
+ margin: 10px 0;
+}
+
+.wxParse-video-video{
+ width:100%;
+}
+
+.wxParse-img{
+ background-color: #efefef;
+ overflow: hidden;
+ display: inline-block!important;
+ width:40px;
+ height: 40px;
+}
+
+.wxParse-blockquote {
+ margin: 0;
+ padding:10px 0 10px 5px;
+ font-family:Courier, Calibri,"宋体";
+ background:#f5f5f5;
+ border-left: 3px solid #dbdbdb;
+}
+
+.wxParse-code,.wxParse-wxxxcode-style{
+ display: inline;
+ background:#f5f5f5;
+}
+.wxParse-ul{
+ margin: 20rpx 10rpx;
+}
+
+.wxParse-li,.wxParse-li-inner{
+ display: flex;
+ align-items: baseline;
+ margin: 10rpx 0;
+}
+.wxParse-li-text{
+
+ align-items: center;
+ line-height: 20px;
+}
+
+.wxParse-li-circle{
+ display: inline-flex;
+ width: 5px;
+ height: 5px;
+ background-color: #333;
+ margin-right: 5px;
+}
+
+.wxParse-li-square{
+ display: inline-flex;
+ width: 10rpx;
+ height: 10rpx;
+ background-color: #333;
+ margin-right: 5px;
+}
+.wxParse-li-ring{
+ display: inline-flex;
+ width: 10rpx;
+ height: 10rpx;
+ border: 2rpx solid #333;
+ border-radius: 50%;
+ background-color: #fff;
+ margin-right: 5px;
+}
+
+/*.wxParse-table{
+ width: 100%;
+ height: 400px;
+}
+.wxParse-thead,.wxParse-tfoot,.wxParse-tr{
+ display: flex;
+ flex-direction: row;
+}
+.wxParse-th,.wxParse-td{
+ display: flex;
+ width: 580px;
+ overflow: auto;
+}*/
+
+.wxParse-u {
+ text-decoration: underline;
+}
+.wxParse-hide{
+ display: none;
+}
+.WxEmojiView{
+ align-items: center;
+}
+.wxEmoji{
+ width: 16px;
+ height:16px;
+}