From 0ff44afa1e019452b64d03ddcc174c2a55628277 Mon Sep 17 00:00:00 2001 From: itgaojian Date: Fri, 8 Dec 2023 11:30:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E3=80=81=E6=88=91=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 3 +- components/mp-html/index.js | 8 ++ components/mp-html/index.json | 1 + components/mp-html/index.wxml | 1 + components/mp-html/index.wxss | 1 + components/mp-html/node/node.js | 1 + components/mp-html/node/node.json | 1 + components/mp-html/node/node.wxml | 1 + components/mp-html/node/node.wxss | 1 + components/mp-html/parser.js | 1 + images/ic_check_item_icon.png | Bin 0 -> 884 bytes images/ic_report_item_icon.png | Bin 0 -> 910 bytes miniprogram_npm/dayjs/index.js | 4 +- .../date-time-picker/date-time-picker.js | 2 +- package-lock.json | 6 ++ package.json | 1 + pages/census/census.js | 6 ++ pages/index/index.js | 8 +- pages/index/index.wxml | 2 +- pages/index/index.wxss | 2 +- pages/mine/mine.js | 93 ++++++------------ pages/mine/mine.wxml | 13 ++- pages/mine/mine.wxss | 51 +++++++++- pages/newsDetail/newsDetail.js | 56 +++++++++++ pages/newsDetail/newsDetail.json | 8 ++ pages/newsDetail/newsDetail.wxml | 12 +++ pages/newsDetail/newsDetail.wxss | 41 ++++++++ project.config.json | 2 + 28 files changed, 256 insertions(+), 70 deletions(-) create mode 100755 components/mp-html/index.js create mode 100755 components/mp-html/index.json create mode 100755 components/mp-html/index.wxml create mode 100755 components/mp-html/index.wxss create mode 100755 components/mp-html/node/node.js create mode 100755 components/mp-html/node/node.json create mode 100755 components/mp-html/node/node.wxml create mode 100755 components/mp-html/node/node.wxss create mode 100755 components/mp-html/parser.js create mode 100644 images/ic_check_item_icon.png create mode 100644 images/ic_report_item_icon.png create mode 100644 pages/newsDetail/newsDetail.js create mode 100644 pages/newsDetail/newsDetail.json create mode 100644 pages/newsDetail/newsDetail.wxml create mode 100644 pages/newsDetail/newsDetail.wxss diff --git a/app.json b/app.json index 8ddaa69..b95ffba 100644 --- a/app.json +++ b/app.json @@ -12,7 +12,8 @@ "pages/chooseArea/chooseArea", "pages/censusDetail/censusDetail", "pages/censusEdit/censusEdit", - "pages/caseHistory/caseHistory" + "pages/caseHistory/caseHistory", + "pages/newsDetail/newsDetail" ], "window": { "backgroundTextStyle": "light", diff --git a/components/mp-html/index.js b/components/mp-html/index.js new file mode 100755 index 0000000..c1576d6 --- /dev/null +++ b/components/mp-html/index.js @@ -0,0 +1,8 @@ +"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}/*! + * mp-html v2.4.2 + * https://github.com/jin-yufeng/mp-html + * + * Released under the MIT license + * Author: Jin Yufeng + */ +var t=require("./parser"),n=[];Component({data:{nodes:[]},properties:{containerStyle:String,content:{type:String,value:"",observer:function(e){this.setContent(e)}},copyLink:{type:Boolean,value:!0},domain:String,errorImg:String,lazyLoad:Boolean,loadingImg:String,pauseVideo:{type:Boolean,value:!0},previewImg:{type:Boolean,value:!0},scrollTable:Boolean,selectable:null,setTitle:{type:Boolean,value:!0},showImgMenu:{type:Boolean,value:!0},tagStyle:Object,useAnchor:null},created:function(){this.plugins=[];for(var e=n.length;e--;)this.plugins.push(new n[e](this))},detached:function(){this._hook("onDetached")},methods:{in:function(e,t,n){e&&t&&n&&(this._in={page:e,selector:t,scrollTop:n})},navigateTo:function(t,n){var i=this;return new Promise(function(o,r){if(!i.data.useAnchor)return void r(Error("Anchor is disabled"));var a=wx.createSelectorQuery().in(i._in?i._in.page:i).select((i._in?i._in.selector:"._root")+(t?"".concat(">>>","#").concat(t):"")).boundingClientRect();i._in?a.select(i._in.selector).scrollOffset().select(i._in.selector).boundingClientRect():a.selectViewport().scrollOffset(),a.exec(function(t){if(!t[0])return void r(Error("Label not found"));var a=t[1].scrollTop+t[0].top-(t[2]?t[2].top:0)+(n||parseInt(i.data.useAnchor)||0);i._in?i._in.page.setData(e({},i._in.scrollTop,a)):wx.pageScrollTo({scrollTop:a,duration:300}),o()})})},getText:function(e){var t="";return function e(n){for(var i=0;i"0"&&o.name[1]<"7";r&&t&&"\n"!==t[t.length-1]&&(t+="\n"),o.children&&e(o.children),r&&"\n"!==t[t.length-1]?t+="\n":"td"!==o.name&&"th"!==o.name||(t+="\t")}}}(e||this.data.nodes),t},getRect:function(){var e=this;return new Promise(function(t,n){wx.createSelectorQuery().in(e).select("._root").boundingClientRect().exec(function(e){return e[0]?t(e[0]):n(Error("Root label not found"))})})},pauseMedia:function(){for(var e=(this._videos||[]).length;e--;)this._videos[e].pause()},setPlaybackRate:function(e){this.playbackRate=e;for(var t=(this._videos||[]).length;t--;)this._videos[t].playbackRate(e)},setContent:function(e,n){var i=this;this.imgList&&n||(this.imgList=[]),this._videos=[];var o={},r=new t(this).parse(e);if(n)for(var a=this.data.nodes.length,s=r.length;s--;)o["nodes[".concat(a+s,"]")]=r[s];else o.nodes=r;if(this.setData(o,function(){i._hook("onLoad"),i.triggerEvent("load")}),this.data.lazyLoad||this.imgList._unloadimgs \ No newline at end of file diff --git a/components/mp-html/index.wxss b/components/mp-html/index.wxss new file mode 100755 index 0000000..5f74d06 --- /dev/null +++ b/components/mp-html/index.wxss @@ -0,0 +1 @@ +._root{padding:1px 0;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}._select{-webkit-user-select:text;user-select:text} \ No newline at end of file diff --git a/components/mp-html/node/node.js b/components/mp-html/node/node.js new file mode 100755 index 0000000..00272c2 --- /dev/null +++ b/components/mp-html/node/node.js @@ -0,0 +1 @@ +"use strict";function t(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Component({data:{ctrl:{},isiOS:wx.getSystemInfoSync().system.includes("iOS")},properties:{childs:Array,opts:Array},options:{addGlobalClass:!0},attached:function(){this.triggerEvent("add",this,{bubbles:!0,composed:!0})},methods:{noop:function(){},getNode:function(t){try{for(var e=t.split("_"),i=this.data.childs[e[0]],r=1;rr.src.length&&(o=0),ovar e={abbr:!0,b:!0,big:!0,code:!0,del:!0,em:!0,i:!0,ins:!0,label:!0,q:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0};module.exports=function(n,i){return e[n]||-1!==(i||"").indexOf("inline")};