From 7ba35ffd5d09488d327a8603cc146f0dc1551541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= Date: Fri, 28 Nov 2025 00:01:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=8F=AF=E8=A7=86=E5=8C=96=E7=9C=8B=E6=9D=BF=E3=80=81=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/index.js | 2 +- api/v2/plugin.data-statistics.js | 35 + common/locales/en.js | 23 - common/locales/zh.js | 23 - components/heatmap/heatmap.vue | 468 + components/r-canvas/r-canvas.js | 735 -- components/r-canvas/r-canvas.vue | 26 - components/t-color-picker/t-color-picker.vue | 784 -- config/uhalo.config.js | 2 +- main.js | 28 +- package.json | 3 - pages.json | 727 +- pages/index/index.vue | 181 +- pages/tabbar/about/about.vue | 14 +- pagesA/article-detail/article-detail.vue | 248 +- pagesA/data-visual/data-visual.vue | 528 ++ static/login/login_bottom_bg.jpg | Bin 17085 -> 0 bytes static/login/login_top2.jpg | Bin 29842 -> 0 bytes uni_modules/lime-painter/changelog.md | 225 - .../components/common/relation.js | 150 - .../l-painter-image/l-painter-image.vue | 28 - .../l-painter-qrcode/l-painter-qrcode.vue | 27 - .../l-painter-text/l-painter-text.vue | 33 - .../l-painter-view/l-painter-view.vue | 34 - .../components/l-painter/l-painter.vue | 461 - .../lime-painter/components/l-painter/nvue.js | 214 - .../components/l-painter/painter.js | 1 - .../components/l-painter/props.js | 56 - .../components/l-painter/single.js | 1 - .../components/l-painter/utils.js | 368 - .../components/lime-painter/lime-painter.vue | 235 - .../lime-painter/hybrid/html/index.html | 119 - .../lime-painter/hybrid/html/painter.js | 1 - .../hybrid/html/uni.webview.1.5.3.js | 1 - uni_modules/lime-painter/parser.js | 388 - uni_modules/lime-painter/readme.md | 961 -- uni_modules/liu-poster/package.json | 181 +- uni_modules/lsj-upload/changelog.md | 92 - .../components/lsj-upload/LsjFile.js | 392 - .../components/lsj-upload/lsj-upload.vue | 310 - .../lsj-upload/hybrid/html/js/vue.min.js | 8 - .../lsj-upload/hybrid/html/uploadFile.html | 179 - uni_modules/lsj-upload/package.json | 82 - uni_modules/lsj-upload/readme.md | 330 - uni_modules/qiun-data-charts/changelog.md | 320 + .../qiun-data-charts/qiun-data-charts.vue | 1618 ++++ .../components/qiun-error/qiun-error.vue | 46 + .../components/qiun-loading/loading1.vue | 162 + .../components/qiun-loading/loading2.vue | 170 + .../components/qiun-loading/loading3.vue | 173 + .../components/qiun-loading/loading4.vue | 222 + .../components/qiun-loading/loading5.vue | 229 + .../components/qiun-loading/qiun-loading.vue | 36 + .../js_sdk/u-charts/config-echarts.js | 422 + .../js_sdk/u-charts/config-ucharts.js | 631 ++ .../js_sdk/u-charts/readme.md | 5 + .../js_sdk/u-charts/u-charts.js | 7706 +++++++++++++++++ .../js_sdk/u-charts/u-charts.min.js | 18 + uni_modules/qiun-data-charts/license.md | 201 + .../package.json | 59 +- uni_modules/qiun-data-charts/readme.md | 84 + .../static/app-plus/echarts.min.js | 23 + .../qiun-data-charts/static/h5/echarts.min.js | 23 + utils/halo.logs.js | 51 - utils/plugin.js | 10 + 65 files changed, 13731 insertions(+), 7182 deletions(-) create mode 100644 api/v2/plugin.data-statistics.js delete mode 100644 common/locales/en.js delete mode 100644 common/locales/zh.js create mode 100644 components/heatmap/heatmap.vue delete mode 100644 components/r-canvas/r-canvas.js delete mode 100644 components/r-canvas/r-canvas.vue delete mode 100644 components/t-color-picker/t-color-picker.vue create mode 100644 pagesA/data-visual/data-visual.vue delete mode 100644 static/login/login_bottom_bg.jpg delete mode 100644 static/login/login_top2.jpg delete mode 100644 uni_modules/lime-painter/changelog.md delete mode 100644 uni_modules/lime-painter/components/common/relation.js delete mode 100644 uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue delete mode 100644 uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue delete mode 100644 uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue delete mode 100644 uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue delete mode 100644 uni_modules/lime-painter/components/l-painter/l-painter.vue delete mode 100644 uni_modules/lime-painter/components/l-painter/nvue.js delete mode 100644 uni_modules/lime-painter/components/l-painter/painter.js delete mode 100644 uni_modules/lime-painter/components/l-painter/props.js delete mode 100644 uni_modules/lime-painter/components/l-painter/single.js delete mode 100644 uni_modules/lime-painter/components/l-painter/utils.js delete mode 100644 uni_modules/lime-painter/components/lime-painter/lime-painter.vue delete mode 100644 uni_modules/lime-painter/hybrid/html/index.html delete mode 100644 uni_modules/lime-painter/hybrid/html/painter.js delete mode 100644 uni_modules/lime-painter/hybrid/html/uni.webview.1.5.3.js delete mode 100644 uni_modules/lime-painter/parser.js delete mode 100644 uni_modules/lime-painter/readme.md delete mode 100644 uni_modules/lsj-upload/changelog.md delete mode 100644 uni_modules/lsj-upload/components/lsj-upload/LsjFile.js delete mode 100644 uni_modules/lsj-upload/components/lsj-upload/lsj-upload.vue delete mode 100644 uni_modules/lsj-upload/hybrid/html/js/vue.min.js delete mode 100644 uni_modules/lsj-upload/hybrid/html/uploadFile.html delete mode 100644 uni_modules/lsj-upload/package.json delete mode 100644 uni_modules/lsj-upload/readme.md create mode 100644 uni_modules/qiun-data-charts/changelog.md create mode 100644 uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue create mode 100644 uni_modules/qiun-data-charts/components/qiun-error/qiun-error.vue create mode 100644 uni_modules/qiun-data-charts/components/qiun-loading/loading1.vue create mode 100644 uni_modules/qiun-data-charts/components/qiun-loading/loading2.vue create mode 100644 uni_modules/qiun-data-charts/components/qiun-loading/loading3.vue create mode 100644 uni_modules/qiun-data-charts/components/qiun-loading/loading4.vue create mode 100644 uni_modules/qiun-data-charts/components/qiun-loading/loading5.vue create mode 100644 uni_modules/qiun-data-charts/components/qiun-loading/qiun-loading.vue create mode 100644 uni_modules/qiun-data-charts/js_sdk/u-charts/config-echarts.js create mode 100644 uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js create mode 100644 uni_modules/qiun-data-charts/js_sdk/u-charts/readme.md create mode 100644 uni_modules/qiun-data-charts/js_sdk/u-charts/u-charts.js create mode 100644 uni_modules/qiun-data-charts/js_sdk/u-charts/u-charts.min.js create mode 100644 uni_modules/qiun-data-charts/license.md rename uni_modules/{lime-painter => qiun-data-charts}/package.json (54%) create mode 100644 uni_modules/qiun-data-charts/readme.md create mode 100644 uni_modules/qiun-data-charts/static/app-plus/echarts.min.js create mode 100644 uni_modules/qiun-data-charts/static/h5/echarts.min.js delete mode 100644 utils/halo.logs.js diff --git a/api/index.js b/api/index.js index 4e2581e..94e5d5a 100644 --- a/api/index.js +++ b/api/index.js @@ -16,7 +16,7 @@ import v2Config from './v2/all.config.js' const ApiManager = { v2, - v2Config, + v2Config }; const install = (Vue) => { diff --git a/api/v2/plugin.data-statistics.js b/api/v2/plugin.data-statistics.js new file mode 100644 index 0000000..93bfbeb --- /dev/null +++ b/api/v2/plugin.data-statistics.js @@ -0,0 +1,35 @@ +/** + * Halo 数据看板插件 + * @link https://www.halo.run/store/apps/app-rtnbbgfk + */ +import { + getPersonalToken +} from '@/utils/token.js' +import HttpHandler from '@/common/http/request.js' +import qs from 'qs' + +import { + getAppConfigs +} from '@/config/index.js' + +export default { + /** + * 获取图表统计数据 + * @description - 标签、分类、文章发布趋势、评论活跃用户、获取热门文章top10 + */ + getChartData: () => { + return HttpHandler.Get(`/apis/api.data.statistics.xhhao.com/v1alpha1/chart/data`,{}) + }, + /** + * 获取Github配置信息 + */ + getGithubConfig:()=>{ + return HttpHandler.Get('/apis/api.data.statistics.xhhao.com/v1alpha1/github/config',{}) + }, + /** + * 获取 Uptime Kuma 状态页面数据 + */ + getUptimeStatus:()=>{ + return HttpHandler.Get('/apis/api.data.statistics.xhhao.com/v1alpha1/github/config',{}) + } +} \ No newline at end of file diff --git a/common/locales/en.js b/common/locales/en.js deleted file mode 100644 index 4062516..0000000 --- a/common/locales/en.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * - * 可以以页面为单位来写, - * 比如首页的内容,写在index字段,个人中心写在center,共同部分写在common部分 - * */ - -export default { - app: { - name: "alley studio", - author: "Evan Mo", - }, - tabbar: { - home: "Home", - moments: "Moments", - publish: "Publish", - mall: "Mall", - mine: "Mine", - }, - // 提示文本 - tips: { - switchLang: "switch Lang", - }, -}; diff --git a/common/locales/zh.js b/common/locales/zh.js deleted file mode 100644 index 6797d33..0000000 --- a/common/locales/zh.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * - * 可以以页面为单位来写, - * 比如首页的内容,写在index字段,个人中心写在center,共同部分写在common部分 - * */ - -export default { - app: { - name: "巷子工坊", - author: "小莫唐尼", - }, - tabbar: { - home: "首页", - moments: "动态", - publish: "发布", - mall: "商店", - mine: "我的", - }, - // 提示文本 - tips: { - switchLang: "切换语言", - }, -}; diff --git a/components/heatmap/heatmap.vue b/components/heatmap/heatmap.vue new file mode 100644 index 0000000..27c791b --- /dev/null +++ b/components/heatmap/heatmap.vue @@ -0,0 +1,468 @@ + + + + + diff --git a/components/r-canvas/r-canvas.js b/components/r-canvas/r-canvas.js deleted file mode 100644 index b2c7dbe..0000000 --- a/components/r-canvas/r-canvas.js +++ /dev/null @@ -1,735 +0,0 @@ -export default{ - data(){ - return{ - system_info:{}, //system info - canvas_width:0, //canvas width px - canvas_height:0, //canvas height px - ctx:null, //canvas object - canvas_id:null, //canvas id - hidden:false,//Whether to hide canvas - scale:1,//canvas scale - r_canvas_scale:1, - if_ctx:true - } - }, - methods:{ - /** - * save r-canvas.vue object - * @param {Object} that - */ - // saveThis(that){ - // rCanvasThis = that - // }, - /** - * Draw round rect text - * @param {Object} config - * @param {Number} config.x x坐标 - * @param {Number} config.y y坐标 - * @param {Number} config.w 宽度 - * @param {Number} config.h 高度 - * @param {Number} config.radius 圆角弧度 - * @param {String} config.fill_color 矩形颜色 - */ - fillRoundRect(config) { - return new Promise((resolve,reject)=>{ - let x = this.compatibilitySize(parseFloat(config.x)*this.scale) - let y = this.compatibilitySize(parseFloat(config.y)*this.scale) - let w = this.compatibilitySize(parseFloat(config.w)*this.scale) - let h = this.compatibilitySize(parseFloat(config.h)*this.scale) - let radius = config.radius?parseFloat(config.radius)*this.scale:10*this.scale - - let fill_color = config.fill_color || "black" - // The diameter of the circle must be less than the width and height of the rectangle - if (2 * radius > w || 2 * radius > h) { - reject("The diameter of the circle must be less than the width and height of the rectangle") - return false; - } - this.ctx.save(); - this.ctx.translate(x, y); - // - this.drawRoundRectPath({ - w: w, - h: h, - radius: radius - }); - this.ctx.fillStyle = fill_color - this.ctx.fill(); - this.ctx.restore(); - resolve() - }) - }, - /** - * Draws the sides of a rounded rectangle - * @param {Object} config - * @param {Number} config.w 宽度 - * @param {Number} config.h 高度 - * @param {Number} config.radius 圆角弧度 - */ - drawRoundRectPath(config) { - this.ctx.beginPath(0); - this.ctx.arc(config.w - config.radius, config.h - config.radius, config.radius, 0, Math.PI / 2); - this.ctx.lineTo(config.radius, config.h); - this.ctx.arc(config.radius, config.h - config.radius, config.radius, Math.PI / 2, Math.PI); - this.ctx.lineTo(0, config.radius); - this.ctx.arc(config.radius, config.radius, config.radius, Math.PI, Math.PI * 3 / 2); - this.ctx.lineTo(config.w - config.radius, 0); - this.ctx.arc(config.w - config.radius, config.radius, config.radius, Math.PI * 3 / 2, Math.PI * 2); - this.ctx.lineTo(config.w, config.h - config.radius); - this.ctx.closePath(); - }, - /** - * Draw special Text,line wrapping is not supported - * @param {Object} config - * @param {String} config.text 文字 - * @param {Number} config.x x坐标 - * @param {Number} config.y y坐标 - * @param {String} config.font_color 文字颜色 - * @param {String} config.font_family 文字字体 - * @param {Number} config.font_size 文字大小(px) - */ - drawSpecialText(params){ - let general = params.general - let list = params.list - return new Promise(async (resolve,reject)=>{ - if(!general){ - reject("general cannot be empty:101") - return; - }else if(list && list.length>0){ - for(let i in list){ - if(i != 0){ - let font_size = list[i-1].font_size?parseFloat(list[i-1].font_size):20 - this.ctx.setFontSize(font_size) - general.x = parseFloat(general.x) + this.ctx.measureText(list[i-1].text).width - } - list[i].x = general.x - list[i].y = general.y + (list[i].margin_top?parseFloat(list[i].margin_top):0) - await this.drawText(list[i]) - } - resolve() - }else{ - reject("The length of config arr is less than 0") - return; - } - - }) - }, - /** - * array delete empty - * @param {Object} arr - */ - arrDeleteEmpty(arr){ - let newArr = [] - for(let i in arr){ - if(arr[i]){ - newArr.push(arr[i]) - } - } - return newArr - }, - /** - * Draw Text,support line - * @param {Object} config - * @param {String} config.text 文字 - * @param {Number} config.max_width 文字最大宽度(大于宽度自动换行) - * @param {Number} config.line_height 文字上下行间距 - * @param {Number} config.x x坐标 - * @param {Number} config.y y坐标 - * @param {String} config.font_color 文字颜色 - * @param {String} config.font_family 文字字体 默认值:Arial - * @param {String} config.text_align 文字对齐方式(left/center/right) - * @param {Number} config.font_size 文字大小(px) - * @param {Boolean} config.line_through_height 中划线大小 - * @param {Boolean} config.line_through_color 中划线颜色 - * @param {String} config.font_style 规定文字样式 - * @param {String} config.font_variant 规定字体变体 - * @param {String} config.font_weight 规定字体粗细 - * @param {String} config.line_through_cap 线末端类型 - * @param {String} config.line_clamp 最大行数 - * @param {String} config.line_clamp_hint 超过line_clamp后,尾部显示的自定义标识 如 ... - * @param {String} config.is_line_break 是否开启换行符换行 - * - */ - drawText(config,configuration = {}){ - - configuration['line_num'] = configuration.line_num?configuration.line_num:0 - configuration['text_width'] = configuration.text_width?configuration.text_width:0 - - return new Promise(async (resolve,reject)=>{ - - if(config.text){ - - let draw_width = 0,draw_height = 0,draw_x = config.x,draw_y = config.y - let font_size = config.font_size?(parseFloat(config.font_size)*this.scale):(20*this.scale) - let font_color = config.font_color || "#000" - let font_family = config.font_family || "Arial" - let line_height = config.line_height || config.font_size || 20 - let text_align = config.text_align || "left" - let font_weight = config.font_weight || "normal" - let font_variant = config.font_variant || "normal" - let font_style = config.font_style || "normal" - let line_clamp_hint = config.line_clamp_hint || '...' - let lineBreakJoinText = "" - let max_width = config.max_width?parseFloat(config.max_width)*this.scale:0 - // checkout is line break - if(config.is_line_break){ - let splitTextArr = config.text.split(/[\n]/g) - if(splitTextArr && splitTextArr.length > 0){ - let newSplitTextArr = this.arrDeleteEmpty(splitTextArr) - if(newSplitTextArr && newSplitTextArr.length > 0){ - lineBreakJoinText = newSplitTextArr.slice(1).join("\n") - config.text = newSplitTextArr[0] - }else{ - reject("Text cannot be empty:103") - return - } - }else{ - reject("Text cannot be empty:102") - return - } - } - - this.ctx.setFillStyle(font_color) // color - this.ctx.textAlign = text_align; - this.ctx.font = `${font_style} ${font_variant} ${font_weight} ${parseInt(font_size)}px ${font_family}` - if(configuration.text_width >= this.ctx.measureText(config.text).width){ - draw_width = configuration.text_width - }else if(max_width > 0){ - draw_width = max_width < this.ctx.measureText(config.text).width ? this.resetCompatibilitySize(max_width) : this.resetCompatibilitySize(this.ctx.measureText(config.text).width) - }else{ - draw_width = this.ctx.measureText(config.text).width - } - configuration.text_width = draw_width / this.scale - if( max_width && this.compatibilitySize(this.ctx.measureText(config.text).width) > this.compatibilitySize(max_width)){ - let current_text = "" - let text_arr = config.text.split("") - for(let i in text_arr){ - if( this.compatibilitySize(this.ctx.measureText(current_text+text_arr[i]).width) > this.compatibilitySize(max_width) ){ - // Hyphenation that is greater than the drawable width continues to draw - if(config.line_clamp && parseInt(config.line_clamp) == 1){ - // Subtracting the current_text tail width from the line_clamp_hint width - let current_text_arr = current_text.split('') - let json_current_text = '' - while(true){ - current_text_arr = current_text_arr.slice(1) - json_current_text = current_text_arr.join('') - if(this.compatibilitySize(this.ctx.measureText(json_current_text).width) <= this.compatibilitySize(this.ctx.measureText(line_clamp_hint).width)){ - current_text = current_text.replace(json_current_text,'') - break; - } - } - configuration.line_num += 1 - this.ctx.setFontSize(parseInt(this.compatibilitySize(font_size))) // font size - this.ctx.fillText(current_text + line_clamp_hint, this.compatibilitySize(parseFloat(config.x)*this.scale), this.compatibilitySize(parseFloat(config.y)*this.scale)); - }else{ - configuration.line_num += 1 - this.ctx.setFontSize(parseInt(this.compatibilitySize(font_size))) // font size - this.ctx.fillText(current_text, this.compatibilitySize(parseFloat(config.x)*this.scale), this.compatibilitySize(parseFloat(config.y)*this.scale)); - config.text = text_arr.slice(i).join("") - config.y = config.y + line_height - if(config.line_clamp){ - config.line_clamp = parseInt(config.line_clamp) - 1 - } - await this.drawText(config,configuration) - } - - break; - }else{ - current_text = current_text+text_arr[i] - } - } - }else{ - if(config.line_through_height){ - let x = parseFloat(config.x)*this.scale - let w - let y = parseFloat(config.y)*this.scale - (font_size / 2.6) - if(text_align == "left"){ - w = this.ctx.measureText(config.text).width/1.1 + parseFloat(config.x)*this.scale - }else if(text_align == "right"){ - w = parseFloat(config.x)*this.scale - this.ctx.measureText(config.text).width/1.1 - }else if(text_align == "center"){ - x = parseFloat(config.x)*this.scale - this.ctx.measureText(config.text).width / 1.1 / 2 - w = parseFloat(config.x)*this.scale + this.ctx.measureText(config.text).width / 1.1 / 2 - } - this.drawLineTo({ - x:x, - y:y, - w:w, - h:y, - line_width:config.line_through_height, - line_color:config.line_through_color, - line_cap:config.line_through_cap - }) - } - configuration.line_num += 1 - this.ctx.setFontSize(parseInt(this.compatibilitySize(font_size))) // font size - this.ctx.fillText(config.text, this.compatibilitySize(parseFloat(config.x)*this.scale), this.compatibilitySize(parseFloat(config.y)*this.scale)); - if(config.line_clamp){ - config.line_clamp = parseInt(config.line_clamp) - 1 - } - } - if(lineBreakJoinText){ - await this.drawText({...config,text:lineBreakJoinText,y:config.y + line_height},configuration) - } - draw_height = config.font_size * configuration.line_num - draw_width = configuration.text_width - resolve({draw_width,draw_height,draw_x,draw_y}) - }else{ - reject("Text cannot be empty:101") - } - }) - }, - /** - * Draw Line - * @param {Object} config - * @param {Object} config.x x坐标 - * @param {Object} config.y y坐标 - * @param {Object} config.w 线的宽度 - * @param {Object} config.h 线的高度 - * @param {Object} config.line_width 线的宽度 - * @param {Object} config.line_color 线条颜色 - */ - drawLineTo(config){ - let x = this.compatibilitySize(config.x) - let y = this.compatibilitySize(config.y) - let w = this.compatibilitySize(config.w) - let h = this.compatibilitySize(config.h) - let line_width = config.line_width?parseFloat(config.line_width)*this.scale:1*this.scale - let line_color = config.line_color || "black" - let line_cap = config.line_cap || "butt" - this.ctx.beginPath() - this.ctx.lineCap = line_cap - this.ctx.lineWidth = line_width - this.ctx.strokeStyle = line_color - this.ctx.moveTo(x,y) - this.ctx.lineTo(w,h) - this.ctx.stroke() - }, - /** - * Compatibility px - * @param {Object} size - */ - compatibilitySize(size) { - let canvasSize = (parseFloat(size) / 750) * this.system_info.windowWidth - canvasSize = parseFloat(canvasSize * 2) - return canvasSize - }, - /** - * Restore compatibility px - * @param {Object} size - */ - resetCompatibilitySize(size) { - let canvasSize = (parseFloat(size/2)/this.system_info.windowWidth) * 750 - return canvasSize - }, - /** - * Init canvas - */ - init(config){ - return new Promise(async (resolve,reject)=>{ - if(!config.canvas_id){ - reject("Canvas ID cannot be empty, please refer to the usage example") - return; - } - this.hidden = config.hidden - this.canvas_id = config.canvas_id - let system_info = await uni.getSystemInfoSync() - this.system_info = system_info - this.scale = config.scale&&parseFloat(config.scale)>0?parseInt(config.scale):1 - this.canvas_width = (config.canvas_width ? this.compatibilitySize(config.canvas_width) : system_info.windowWidth) * this.scale - this.canvas_height = (config.canvas_height ? this.compatibilitySize(config.canvas_height) : system_info.windowHeight) * this.scale, - this.r_canvas_scale = 1/this.scale - this.ctx = uni.createCanvasContext(this.canvas_id,this) - this.setCanvasConfig({ - global_alpha:config.global_alpha?parseFloat(config.global_alpha):1, - backgroundColor:config.background_color?config.background_color:"#fff" - }) - resolve() - }) - }, - /** - * clear canvas all path - */ - clearCanvas(){ - return new Promise(async (resolve,reject)=>{ - if(!this.ctx){ - reject("canvas is not initialized:101") - return - }else{ - this.ctx.clearRect(0,0,parseFloat(this.canvas_width)*this.scale,parseFloat(this.canvas_height)*this.scale) - await this.draw() - resolve() - } - }) - }, - /** - * Set canvas config - * @param {Object} config - */ - setCanvasConfig(config){ - this.ctx.globalAlpha = config.global_alpha - this.ctx.fillStyle = config.backgroundColor - this.ctx.fillRect(0, 0, parseFloat(this.canvas_width)*this.scale, parseFloat(this.canvas_height)*this.scale) - }, - /** - * set canvas width - * @param {Object} width - */ - setCanvasWidth(width){ - if(!width){ - uni.showToast({ - title:'setCanvasWidth:width error', - icon:'none' - }) - } - this.canvas_width = this.compatibilitySize(parseFloat(width)) * this.scale - this.ctx.width = this.canvas_width - }, - /** - * set canvas height - * @param {Object} height - */ - setCanvasHeight(height){ - if(!height){ - uni.showToast({ - title:'setCanvasWidth:height error', - icon:'none' - }) - } - this.canvas_height = this.compatibilitySize(parseFloat(height)) * this.scale - this.ctx.height = this.canvas_height - }, - /** - * Draw to filepath - */ - draw(callback){ - return new Promise((resolve,reject)=>{ - let stop = setTimeout(()=>{ - this.ctx.draw(false,setTimeout(()=>{ - uni.canvasToTempFilePath({ - canvasId: this.canvas_id, - quality: 1, - success: (res)=>{ - console.log('res',res) - resolve(res) - callback && callback(res) - }, - fail:(err)=>{ - reject(JSON.stringify(err)|| "Failed to generate poster:101") - } - },this) - },300)) - clearTimeout(stop) - },300) - }) - }, - /** - * draw rect - * @param {Number} config.x x坐标 - * @param {Number} config.y y坐标 - * @param {Number} config.w 图形宽度(px) - * @param {Number} config.h 图形高度(px) - * @param {Number} config.color 图形颜色 - * @param {Number} config.is_radius 是否开启圆图(1.1.6及以下版本废弃,请使用border_radius) - * @param {Number} config.border_width 边框大小 - * @param {Number} config.border_color 边框颜色 - * - */ - drawRect(config){ - return new Promise(async (resolve,reject)=>{ - if(!config.border_width || config.border_width <=0){ - config.border_width = 0 - }else{ - config.border_width = parseFloat(config.border_width) - } - if(parseFloat(config.border_width) > 0){ - let sub_config = JSON.parse(JSON.stringify(config)) - sub_config.border_width = 0 - sub_config.w = config.w + config.border_width - sub_config.h = config.h + config.border_width - sub_config.color = config.border_color || 'black' - if(sub_config.border_radius){ - sub_config.border_radius = parseFloat(sub_config.border_radius) + parseFloat(config.border_width) / 2 - } - await this.drawRect(sub_config) - } - - let color = config.color || 'white' - config.x = (parseFloat(config.x) + config.border_width / 2) - config.y = (parseFloat(config.y) + config.border_width / 2) - config['color'] = color - this.ctx.fillStyle = color; - if(config.is_radius || config.border_radius){ - this.setNativeBorderRadius(config) - this.ctx.fill() - }else{ - console.log('config.border_width',config.border_width) - this.ctx.fillRect(this.compatibilitySize(config.x*this.scale),this.compatibilitySize(config.y*this.scale),this.compatibilitySize(parseFloat(config.w)*this.scale),this.compatibilitySize(parseFloat(config.h)*this.scale)) - } - resolve() - }) - }, - /** - * Draw image - * @param {Object} config - * @param {String} config.url 图片链接 - * @param {Number} config.x x坐标 - * @param {Number} config.y y坐标 - * @param {Number} config.w 图片宽度(px) - * @param {Number} config.h 图片高度(px) - * @param {Number} config.border_width 边大小 - * @param {Number} config.border_color 边颜色 - * @param {Number} config.is_radius 是否开启圆图(1.1.6及以下版本废弃,请使用border_radius) - * @param {Number} config.border_radius 圆角弧度 - */ - drawImage(config){ - return new Promise(async (resolve,reject)=>{ - if(config.url){ - let type = 0 // 1、network image 2、native image 3、base64 image - let image_url - let reg = /^https?/ig; - if(reg.test(config.url)){ - type = 1 - }else{ - if((config.url.indexOf("data:image/png;base64") != -1) || config.url.indexOf("data:image/jpeg;base64") != -1 || config.url.indexOf("data:image/gif;base64") != -1){ - type = 3 - }else{ - type = 2 - } - } - if(type == 1){ - // network image - await this.downLoadNetworkFile(config.url).then(res=>{ // two function - image_url = res - }).catch(err=>{ - reject(err) - return; - }) - }else if(type == 2){ - // native image - const imageInfoResult = await uni.getImageInfo({ - src: config.url - }); - try{ - if(imageInfoResult.length <= 1){ - reject(imageInfoResult[0].errMsg + ':404') - return - } - }catch(e){ - reject(e+':500') - return - } - let base64 = await this.urlToBase64({url:imageInfoResult[1].path}) - // #ifdef MP-WEIXIN - await this.base64ToNative({url:base64}).then(res=>{ - image_url = res - }).catch(err=>{ - reject(JSON.stringify(err)+":501") - return; - }) - // #endif - // #ifndef MP-WEIXIN - image_url = base64 - // #endif - - }else if(type == 3){ - // #ifdef MP-WEIXIN - await this.base64ToNative({url:config.url}).then(res=>{ - image_url = res - }).catch(err=>{ - reject(JSON.stringify(err)+":500") - return; - }) - // #endif - // #ifndef MP-WEIXIN - image_url = config.url - // #endif - }else{ - reject("Other Type Errors:101") - return - } - if(config.border_width){ - let border_radius = 0 - if(config.border_radius){ - let multiple = config.w / config.border_radius - border_radius = (parseFloat(config.w) + parseFloat(config.border_width)) / multiple - } - // drawRect - await this.drawRect({ - x:parseFloat(config.x) - parseFloat(config.border_width)/2, - y:parseFloat(config.y) - parseFloat(config.border_width)/2, - w:parseFloat(config.w) + parseFloat(config.border_width), - h:parseFloat(config.h) + parseFloat(config.border_width), - color:config.border_color, - border_radius:border_radius, - border_width:config.border_width, - is_radius:config.is_radius - }) - } - - - - if(config.border_radius){ - config.color = config.color?config.color:'rgba(0,0,0,0)' - - // 圆角有白边,+0.5的误差 - config.w = config.w + 0.3 - config.h = config.h + 0.3 - - this.setNativeBorderRadius(config) - }else if(config.is_radius){ - //已废弃 is_radius - this.ctx.setStrokeStyle("rgba(0,0,0,0)") - this.ctx.save() - this.ctx.beginPath() - this.ctx.arc(this.compatibilitySize(parseFloat(config.x)*this.scale+parseFloat(config.w)*this.scale/2), this.compatibilitySize(parseFloat(config.y)*this.scale+parseFloat(config.h)*this.scale/2), this.compatibilitySize(parseFloat(config.w)*this.scale/2), 0, 2 * Math.PI, false) - this.ctx.stroke(); - this.ctx.clip() - } - - await this.ctx.drawImage(image_url,this.compatibilitySize(parseFloat(config.x)*this.scale),this.compatibilitySize(parseFloat(config.y)*this.scale),this.compatibilitySize(parseFloat(config.w)*this.scale),this.compatibilitySize(parseFloat(config.h)*this.scale)) - this.ctx.restore() //Restore previously saved drawing context - resolve() - }else{ - let err_msg = "Links cannot be empty:101" - reject(err_msg) - } - }) - }, - /** - * base64 to native available path - * @param {Object} config - */ - base64ToNative(config){ - return new Promise((resolve,reject)=>{ - let fileName = new Date().getTime() - var filePath = `${wx.env.USER_DATA_PATH}/${fileName}_rCanvas.png` - wx.getFileSystemManager().writeFile({ - filePath: filePath, - data: config.url.replace(/^data:\S+\/\S+;base64,/, ''), - encoding: 'base64', - success: function() { - resolve(filePath) - }, - fail: function(error) { - reject(error) - } - }) - }) - }, - /** - * native url to base64 - * @param {Object} config - */ - urlToBase64(config){ - return new Promise(async (resolve,reject)=>{ - if (typeof window != 'undefined') { - await this.downLoadNetworkFile(config.url).then(res=>{ // two function - resolve(res) - }).catch(err=>{ - reject(err) - }) - }else if (typeof plus != 'undefined') { - plus.io.resolveLocalFileSystemURL(config.url,(obj)=>{ - obj.file((file)=>{ - let fileReader = new plus.io.FileReader() - fileReader.onload = (res)=>{ - resolve(res.target.result) - } - fileReader.onerror = (err)=>{ - reject(err) - } - fileReader.readAsDataURL(file) - }, (err)=>{ - reject(err) - }) - },(err)=>{ - reject(err) - }) - }else if(typeof wx != 'undefined'){ - wx.getFileSystemManager().readFile({ - filePath: config.url, - encoding: 'base64', - success: function(res) { - resolve('data:image/png;base64,' + res.data) - }, - fail: function(error) { - reject(error) - } - }) - } - }) - }, - setNativeBorderRadius(config){ - let border_radius = config.border_radius?(parseFloat(config.border_radius)*this.scale):(20*this.scale) - if ((parseFloat(config.w)*this.scale) < 2 * border_radius) border_radius = (parseFloat(config.w)*this.scale) / 2; - if ((parseFloat(config.h)*this.scale) < 2 * border_radius) border_radius = (parseFloat(config.h)*this.scale) / 2; - this.ctx.beginPath(); - this.ctx.moveTo(this.compatibilitySize((parseFloat(config.x)*this.scale) + border_radius), this.compatibilitySize((parseFloat(config.y)*this.scale))); - this.ctx.arcTo(this.compatibilitySize((parseFloat(config.x)*this.scale) + (parseFloat(config.w)*this.scale)), this.compatibilitySize((parseFloat(config.y)*this.scale)), this.compatibilitySize((parseFloat(config.x)*this.scale) + (parseFloat(config.w)*this.scale)), this.compatibilitySize((parseFloat(config.y)*this.scale) + (parseFloat(config.h)*this.scale)), this.compatibilitySize(border_radius)); - this.ctx.arcTo(this.compatibilitySize((parseFloat(config.x)*this.scale) + (parseFloat(config.w)*this.scale)), this.compatibilitySize((parseFloat(config.y)*this.scale) + (parseFloat(config.h)*this.scale)), this.compatibilitySize((parseFloat(config.x)*this.scale)), this.compatibilitySize((parseFloat(config.y)*this.scale) + (parseFloat(config.h)*this.scale)), this.compatibilitySize(border_radius)); - this.ctx.arcTo((this.compatibilitySize(parseFloat(config.x)*this.scale)), this.compatibilitySize((parseFloat(config.y)*this.scale) + (parseFloat(config.h)*this.scale)), this.compatibilitySize((parseFloat(config.x)*this.scale)), this.compatibilitySize((parseFloat(config.y)*this.scale)), this.compatibilitySize(border_radius)); - this.ctx.arcTo(this.compatibilitySize((parseFloat(config.x)*this.scale)), this.compatibilitySize((parseFloat(config.y)*this.scale)), this.compatibilitySize((parseFloat(config.x)*this.scale) + (parseFloat(config.w)*this.scale)), this.compatibilitySize((parseFloat(config.y)*this.scale)), this.compatibilitySize(border_radius)); - this.ctx.closePath(); - this.ctx.strokeStyle = config.color || config.border_color || 'rgba(0,0,0,0)'; // 设置绘制边框的颜色 - this.ctx.stroke(); - this.ctx.save() - this.ctx.clip(); - - }, - /** - * Download network file - * @param {Object} url : download url - */ - downLoadNetworkFile(url){ - return new Promise((resolve,reject)=>{ - uni.downloadFile({ - url, - success:(res)=>{ - if(res.statusCode == 200){ - resolve(res.tempFilePath) - }else{ - reject("Download Image Fail:102") - } - }, - fail:(err)=>{ - reject("Download Image Fail:101") - } - }) - }) - }, - /** - * Save image to natice - * @param {Object} filePath : native imageUrl - */ - saveImage(filePath){ - return new Promise((resolve,reject)=>{ - if(!filePath){ - reject("FilePath cannot be null:101") - return; - } - - // #ifdef H5 - var createA = document.createElement("a"); - createA.download = filePath; - createA.href = filePath; - document.body.appendChild(createA); - createA.click(); - createA.remove(); - resolve() - // #endif - - // #ifndef H5 - uni.saveImageToPhotosAlbum({ - filePath: filePath, - success:(res)=>{ - resolve(res) - }, - fail:(err)=>{ - reject(err) - } - }) - // #endif - }) - } - } -} diff --git a/components/r-canvas/r-canvas.vue b/components/r-canvas/r-canvas.vue deleted file mode 100644 index 5722790..0000000 --- a/components/r-canvas/r-canvas.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/components/t-color-picker/t-color-picker.vue b/components/t-color-picker/t-color-picker.vue deleted file mode 100644 index 10486a5..0000000 --- a/components/t-color-picker/t-color-picker.vue +++ /dev/null @@ -1,784 +0,0 @@ - - - - - diff --git a/config/uhalo.config.js b/config/uhalo.config.js index 735092d..4cc4e34 100644 --- a/config/uhalo.config.js +++ b/config/uhalo.config.js @@ -1,7 +1,7 @@ /** 应用基础配置 */ const UHaloBaseConfig = Object.freeze({ - /** 基础请求域名:你的Halo博客基础域名 */ + /** 基础请求域名:你的Halo博客基础域名,注意,域名后面不能带有斜杠【/】 */ BASE_API: "", // 示例: // BASE_API: "https://blog.xiaoxiaomo.cn", diff --git a/main.js b/main.js index 2139ec5..23e35b7 100644 --- a/main.js +++ b/main.js @@ -25,29 +25,7 @@ for (let fKey in AppFilters) { // 引用tmUI2.x框架 import tmVuetify from "./tm-vuetify"; Vue.use(tmVuetify); - -// i18n部分的配置 -// 引入语言包,注意路径 -import Chinese from "@/common/locales/zh.js"; -import English from "@/common/locales/en.js"; - -// 引入并使用vue-i18n -import VueI18n from "vue-i18n"; -Vue.use(VueI18n); - -// 构造i18n对象 -const i18n = new VueI18n({ - // 默认语言,这里的local属性,对应message中的zh、en属性 - locale: uni.getStorageSync("Default_Lang") || "zh", - // 引入语言文件 - messages: { - // 这里的属性名是任意的,您也可以把zh设置为cn等,只是后续切换语言时 - // 要标识这里的语言属性,如:this.$i18n.locale = zh|en|cn|xxx - zh: Chinese, - en: English, - }, -}); - + // 引入请求库 import { http @@ -61,13 +39,9 @@ Vue.use(ApiManager); import HaloTokenConfig from '@/config/uhalo.config.js' Vue.prototype.$baseApiUrl = HaloTokenConfig.BASE_API -// 由于微信小程序的运行机制问题,需声明如下一行,H5和APP非必填 -Vue.prototype._i18n = i18n; - Vue.config.productionTip = false; App.mpType = "app"; const app = new Vue({ - i18n, ...App, }); diff --git a/package.json b/package.json index ffb84a5..8fa2eee 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,6 @@ "url": "https://gitee.com/ialley-workshop-open/uni-halo/issues" }, "homepage": "https://uni-halo.925i.cn", - "devDependencies": { - "vue-i18n": "^9.1.10" - }, "dependencies": { "qs": "^6.12.1" } diff --git a/pages.json b/pages.json index 31d493b..3a9ec92 100644 --- a/pages.json +++ b/pages.json @@ -1,368 +1,375 @@ { - "pages": [ - { - "path": "pages/index/index", - "style": { - "navigationBarTitleText": "uni-halo", - "enablePullDownRefresh": false, - "navigationStyle": "custom" - } - }, - { - "path": "pages/tabbar/home/home", - "style": { - "navigationBarTitleText": "首页", - "enablePullDownRefresh": true, - "navigationStyle": "custom", - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "pages/tabbar/category/category", - "style": { - "navigationBarTitleText": "分类", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "pages/tabbar/gallery/gallery", - "style": { - "navigationBarTitleText": "图库", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "pages/tabbar/moments/moments", - "style": { - "navigationBarTitleText": "瞬间", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "pages/tabbar/about/about", - "style": { - "navigationBarTitleText": "关于", - "navigationStyle": "custom", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup", - "style": { - "disableScroll": true, - "app-plus": { - "backgroundColorTop": "transparent", - "background": "transparent", - "titleNView": false, - "scrollIndicator": false, - "popGesture": "none", - "animationType": "fade-in", - "animationDuration": 200 - } - } - } - ], - //此配置为小程序的分包加载机制。在5+App里始终为整包。 - "subPackages": [ - { - "root": "pagesA", - "pages": [ - { - "path": "start/start", - "style": { - "navigationBarTitleText": "uni-halo", - "enablePullDownRefresh": false, - "navigationStyle": "custom" - } - }, - { - "path": "article-detail/article-detail", - "style": { - "navigationBarTitleText": "内容详情", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "love/love", - "style": { - "navigationBarTitleText": "恋爱日记", - "navigationStyle": "custom", - "enablePullDownRefresh": false, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "love/list", - "style": { - "navigationBarTitleText": "恋爱清单", - "enablePullDownRefresh": false, - "navigationStyle": "custom" - } - }, - { - "path": "love/album", - "style": { - "navigationBarTitleText": "恋爱相册", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "love/journey", - "style": { - "navigationBarTitleText": "我们的故事", - "navigationStyle": "custom", - "enablePullDownRefresh": false - } - }, - { - "path": "archives/archives", - "style": { - "navigationBarTitleText": "归档", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "friend-links/friend-links", - "style": { - "navigationBarTitleText": "友情链接", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "articles/articles", - "style": { - "navigationBarTitleText": "内容搜索", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "category-detail/category-detail", - "style": { - "navigationBarTitleText": "分类详情", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "disclaimers/disclaimers", - "style": { - "navigationBarTitleText": "免责声明", - "enablePullDownRefresh": false - } - }, - { - "path": "contact/contact", - "style": { - "navigationBarTitleText": "联系博主", - "enablePullDownRefresh": false - } - }, - { - "path": "about/about", - "style": { - "navigationBarTitleText": "关于博客", - "enablePullDownRefresh": false - } - }, - { - "path": "setting/setting", - "style": { - "navigationBarTitleText": "设置", - "enablePullDownRefresh": false - } - }, - { - "path": "tags/tags", - "style": { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - }, - { - "path": "tag-detail/tag-detail", - "style": { - "navigationBarTitleText": "标签详情", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "submit-link/submit-link", - "style": { - "navigationBarTitleText": "友链提交", - "enablePullDownRefresh": false - } - }, - { - "path": "moment-detail/moment-detail", - "style": { - "navigationBarTitleText": "瞬间详情", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - } - }, - { - "path": "votes/votes", + "pages": [{ + "path": "pages/index/index", "style": { - "navigationBarTitleText": "投票列表", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } + "navigationBarTitleText": "uni-halo", + "enablePullDownRefresh": false, + "navigationStyle": "custom" } }, { - "path": "vote-detail/vote-detail", + "path": "pages/tabbar/home/home", "style": { - "navigationBarTitleText": "投票详情", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } + "navigationBarTitleText": "首页", + "enablePullDownRefresh": true, + "navigationStyle": "custom", + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "pages/tabbar/category/category", + "style": { + "navigationBarTitleText": "分类", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "pages/tabbar/gallery/gallery", + "style": { + "navigationBarTitleText": "图库", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "pages/tabbar/moments/moments", + "style": { + "navigationBarTitleText": "瞬间", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "pages/tabbar/about/about", + "style": { + "navigationBarTitleText": "关于", + "navigationStyle": "custom", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup", + "style": { + "disableScroll": true, + "app-plus": { + "backgroundColorTop": "transparent", + "background": "transparent", + "titleNView": false, + "scrollIndicator": false, + "popGesture": "none", + "animationType": "fade-in", + "animationDuration": 200 + } } } - ] - }, - { - "root": "pagesC", - "pages": [ - { - "path": "website/website", - "style": { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - } - ] - } - ], - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "uni-halo", - "navigationBarBackgroundColor": "#ffffff", - "backgroundColor": "#F8F8F8" - }, - "tabBar": { - "backgroundColor": "#fff", - "borderStyle": "white", - "color": "#303133", - "selectedColor": "#03a9f4", - "list": [ - { - "iconPath": "static/tabbar/select_home.png", - "selectedIconPath": "static/tabbar/select_home_active.png", - "pagePath": "pages/tabbar/home/home", - "text": "首页" - }, - { - "iconPath": "static/tabbar/select_category.png", - "selectedIconPath": "static/tabbar/select_category_active.png", - "pagePath": "pages/tabbar/category/category", - "text": "分类" - }, - { - "iconPath": "static/tabbar/select_gallery.png", - "selectedIconPath": "static/tabbar/select_gallery_active.png", - "pagePath": "pages/tabbar/gallery/gallery", - "text": "图库" - }, - { - "iconPath": "static/tabbar/select_links.png", - "selectedIconPath": "static/tabbar/select_links_active.png", - "pagePath": "pages/tabbar/moments/moments", - "text": "瞬间" - }, - { - "iconPath": "static/tabbar/select_mine.png", - "selectedIconPath": "static/tabbar/select_mine_active.png", - "pagePath": "pages/tabbar/about/about", - "text": "关于" - } - ] - } -} + ], + //此配置为小程序的分包加载机制。在5+App里始终为整包。 + "subPackages": [{ + "root": "pagesA", + "pages": [{ + "path": "start/start", + "style": { + "navigationBarTitleText": "uni-halo", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + }, + { + "path": "article-detail/article-detail", + "style": { + "navigationBarTitleText": "内容详情", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "love/love", + "style": { + "navigationBarTitleText": "恋爱日记", + "navigationStyle": "custom", + "enablePullDownRefresh": false, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "love/list", + "style": { + "navigationBarTitleText": "恋爱清单", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + }, + { + "path": "love/album", + "style": { + "navigationBarTitleText": "恋爱相册", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "love/journey", + "style": { + "navigationBarTitleText": "我们的故事", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } + }, + { + "path": "archives/archives", + "style": { + "navigationBarTitleText": "归档", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "friend-links/friend-links", + "style": { + "navigationBarTitleText": "友情链接", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "articles/articles", + "style": { + "navigationBarTitleText": "内容搜索", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "category-detail/category-detail", + "style": { + "navigationBarTitleText": "分类详情", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "disclaimers/disclaimers", + "style": { + "navigationBarTitleText": "免责声明", + "enablePullDownRefresh": false + } + }, + { + "path": "contact/contact", + "style": { + "navigationBarTitleText": "联系博主", + "enablePullDownRefresh": false + } + }, + { + "path": "about/about", + "style": { + "navigationBarTitleText": "关于博客", + "enablePullDownRefresh": false + } + }, + { + "path": "setting/setting", + "style": { + "navigationBarTitleText": "设置", + "enablePullDownRefresh": false + } + }, + { + "path": "tags/tags", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, + { + "path": "tag-detail/tag-detail", + "style": { + "navigationBarTitleText": "标签详情", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "submit-link/submit-link", + "style": { + "navigationBarTitleText": "友链提交", + "enablePullDownRefresh": false + } + }, + { + "path": "moment-detail/moment-detail", + "style": { + "navigationBarTitleText": "瞬间详情", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "votes/votes", + "style": { + "navigationBarTitleText": "投票列表", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "vote-detail/vote-detail", + "style": { + "navigationBarTitleText": "投票详情", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + }, + { + "path": "data-visual/data-visual", + "style": { + "navigationBarTitleText": "数据看板", + "enablePullDownRefresh": true, + "app-plus": { + "pullToRefresh": { + "color": "#03a9f4", + "style": "circle" + } + } + } + } + ] + }, + { + "root": "pagesC", + "pages": [{ + "path": "website/website", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }] + } + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "uni-halo", + "navigationBarBackgroundColor": "#ffffff", + "backgroundColor": "#F8F8F8" + }, + "tabBar": { + "backgroundColor": "#fff", + "borderStyle": "white", + "color": "#303133", + "selectedColor": "#03a9f4", + "list": [{ + "iconPath": "static/tabbar/select_home.png", + "selectedIconPath": "static/tabbar/select_home_active.png", + "pagePath": "pages/tabbar/home/home", + "text": "首页" + }, + { + "iconPath": "static/tabbar/select_category.png", + "selectedIconPath": "static/tabbar/select_category_active.png", + "pagePath": "pages/tabbar/category/category", + "text": "分类" + }, + { + "iconPath": "static/tabbar/select_gallery.png", + "selectedIconPath": "static/tabbar/select_gallery_active.png", + "pagePath": "pages/tabbar/gallery/gallery", + "text": "图库" + }, + { + "iconPath": "static/tabbar/select_links.png", + "selectedIconPath": "static/tabbar/select_links_active.png", + "pagePath": "pages/tabbar/moments/moments", + "text": "瞬间" + }, + { + "iconPath": "static/tabbar/select_mine.png", + "selectedIconPath": "static/tabbar/select_mine_active.png", + "pagePath": "pages/tabbar/about/about", + "text": "关于" + } + ] + } +} \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 9bb1d3c..c82eb1f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,40 +1,55 @@ \ No newline at end of file +.app-page { + width: 100vw; + height: 100vh; +} + diff --git a/pages/tabbar/about/about.vue b/pages/tabbar/about/about.vue index 544b8cf..2dd972d 100644 --- a/pages/tabbar/about/about.vue +++ b/pages/tabbar/about/about.vue @@ -190,11 +190,21 @@ _isWx = true; // #endif this.navList = [{ + key: 'data-visual', + title: '数据看板', + leftIcon: 'icon-chart-bar', + leftIconColor: 'light-blue', + rightText: '站点数据可视化', + path: '/pagesA/data-visual/data-visual', + isAdmin: false, + type: 'page', + show: await checkNeedPluginAvailable(NeedPluginIds.PluginDataStatistics) + },{ key: 'archives', title: this.calcAuditModeEnabled ? '内容归档' : '文章归档', leftIcon: 'halocoloricon-classify', leftIconColor: 'red', - rightText: this.calcAuditModeEnabled ? '已归档的内容' : '已归档的文章', + rightText: this.calcAuditModeEnabled ? '全部已归档内容' : '全部已归档文章', path: '/pagesA/archives/archives', isAdmin: false, type: 'page', @@ -214,7 +224,7 @@ title: '投票中心', leftIcon: 'icon-box', leftIconColor: 'red', - rightText: '查看当前的投票', + rightText: '查看和进行投票', path: '/pagesA/votes/votes', isAdmin: false, type: 'page', diff --git a/pagesA/article-detail/article-detail.vue b/pagesA/article-detail/article-detail.vue index bb09d91..3a7a55b 100644 --- a/pagesA/article-detail/article-detail.vue +++ b/pagesA/article-detail/article-detail.vue @@ -297,30 +297,7 @@ - - - + @@ -420,8 +397,7 @@ import commentItem from '@/components/comment-item/comment-item.vue'; import commentModal from '@/components/comment-modal/comment-modal.vue'; import ArticleVote from '@/components/article-vote/article-vote.vue'; import ArticleDouban from '@/components/article-douban/article-douban.vue'; - -import rCanvas from '@/components/r-canvas/r-canvas.vue'; + import barrage from '@/components/barrage/barrage.vue'; import { getAppConfigs } from '@/config/index.js'; import { upvote } from '@/utils/upvote.js'; @@ -449,8 +425,7 @@ export default { tmMore, mpHtml, commentList, - commentItem, - rCanvas, + commentItem, barrage, commentModal, ArticleVote, @@ -769,10 +744,7 @@ export default { this.poster.show = true; await this.handleCreatePoster(); setTimeout(() => { - this.poster.showCanvas = true; - // this.fnCreatePoster(res => { - // this.poster.res = res; - // }); + this.poster.showCanvas = true; this.$nextTick(() => { this.$refs.liuPoster.init(this.poster.configs); }); @@ -930,194 +902,7 @@ export default { ctx.lineTo(w, y); ctx.stroke(); y += 20; - }, - fnCreatePoster(callback) { - this.$nextTick(async () => { - const systemInfo = await uni.getSystemInfoSync(); - const _bloggerAvatar = this.$utils.checkAvatarUrl(this.bloggerInfo.avatar, true); - const _articleCover = this.$utils.checkThumbnailUrl(this.result.spec.cover, true); - // 初始化 - await this.$refs.rCanvas.init({ - canvas_id: 'rCanvas', - // canvas_width: systemInfo.windowWidth - uni.upx2px(76), - canvas_width: 337, - canvas_height: 460, - background_color: 'rgba(255,255,255,0)' - }); - // 画圆角背景 - await this.$refs.rCanvas - .fillRoundRect({ - x: 0, - y: 0, - w: 337, - h: 460, - radius: 12, - fill_color: '#fff' - }) - .catch((err_msg) => { - uni.showToast({ - title: err_msg, - icon: 'none' - }); - }); - // 博主信息 - await this.$refs.rCanvas - .drawImage({ - url: _bloggerAvatar, - x: 12, - y: 12, - w: 48, - h: 48, - border_radius: 24 - }) - .catch((err_msg) => { - uni.showToast({ - title: err_msg, - icon: 'none' - }); - }); - - await this.$refs.rCanvas - .drawText({ - text: this.bloggerInfo.nickname, - max_width: 0, - x: 70, - y: 30, - font_color: '#000', - font_size: 15 - }) - .catch((err_msg) => { - uni.showToast({ - title: err_msg, - icon: 'none' - }); - }); - await this.$refs.rCanvas - .drawText({ - text: this.bloggerInfo.description, - max_width: 0, - x: 70, - y: 52, - font_color: '#666', - font_size: 12 - }) - .catch((err_msg) => { - uni.showToast({ - title: err_msg, - icon: 'none' - }); - }); - // 文章封面图 - await this.$refs.rCanvas - .drawImage({ - url: _articleCover, - x: 12, - y: 75, - w: 312, - h: 180, - border_radius: 6 - }) - .catch((err_msg) => { - uni.showToast({ - title: err_msg, - icon: 'none' - }); - }); - - // 文章标题 - await this.$refs.rCanvas - .drawText({ - text: this.result.spec.title, - max_width: 312, - line_clamp: 1, - x: 12, - y: 285, - font_weight: 'bold', - font_color: '#333', - font_size: 14 - }) - .catch((err_msg) => { - uni.showToast({ - title: err_msg, - icon: 'none' - }); - }); - await this.$refs.rCanvas - .drawText({ - text: this.result?.status?.excerpt || '文章暂无摘要信息', - max_width: 312, - line_clamp: 2, - x: 12, - y: 310, - font_color: '#333', - font_size: 13, - line_height: 20 - }) - .catch((err_msg) => { - uni.showToast({ - title: err_msg, - icon: 'none' - }); - }); - - this.drawDashedLine(this.$refs.rCanvas.ctx, 14, 356, 332, 0.5, [8, 5, 5, 5], '#999'); - // 小程序信息 - const _qrCodeImageUrl = await this.qrCodeImageUrl(); - await this.$refs.rCanvas - .drawImage({ - url: this.$utils.checkImageUrl(_qrCodeImageUrl), - x: 20, - y: 360, - w: 80, - h: 80 - }) - .catch((err_msg) => { - uni.showToast({ - title: err_msg, - icon: 'none' - }); - }); - - await this.$refs.rCanvas - .drawText({ - text: '长按识别小程序', - x: 150, - y: 390, - font_color: '#333', - font_size: 15, - font_weight: 'bold', - line_height: 22 - }) - .catch((err_msg) => { - uni.showToast({ - title: err_msg, - icon: 'none' - }); - }); - await this.$refs.rCanvas - .drawText({ - text: '关注我,给你分享更多有趣的知识', - x: 115, - y: 425, - font_color: '#333', - font_size: 12, - line_height: 22 - }) - .catch((err_msg) => { - uni.showToast({ - title: err_msg, - icon: 'none' - }); - }); - // 生成海报 - await this.$refs.rCanvas.draw((res) => { - //res.tempFilePath:生成成功,返回base64图片 - // 保存图片 - this.poster.loading = false; - callback(res); - }); - }); - }, + }, fnOnPosterClose() { this.poster.show = false; this.poster.showCanvas = false; @@ -1129,24 +914,7 @@ export default { title: '提示', content: '保存到相册未授权,是否去授权?', success: (res) => { - if (res.confirm) { - // uni.authorize({ - // scope: 'scope.writePhotosAlbum', - // success() { - // uni.showToast({ - // icon: 'none', - // title: '授权成功,请重新保存' - // }); - // resolve(true); - // }, - // fail: (err) => { - // uni.showToast({ - // icon: 'none', - // title: '授权失败,请手动授权' - // }); - // resolve(false); - // } - // }); + if (res.confirm) { uni.openSetting({ success: (res) => { if (res.authSetting['scope.writePhotosAlbum'] === true) { @@ -1220,9 +988,7 @@ export default { // #endif }); }, - async fnSavePoster() { - // this.$refs.rCanvas.saveImage(this.poster.res.tempFilePath); - + async fnSavePoster() { // 检查授权 const authorize = await this.fnCheckAlbumAppAuthorize(); if (!authorize) return; diff --git a/pagesA/data-visual/data-visual.vue b/pagesA/data-visual/data-visual.vue new file mode 100644 index 0000000..dee6f2a --- /dev/null +++ b/pagesA/data-visual/data-visual.vue @@ -0,0 +1,528 @@ + + + + + diff --git a/static/login/login_bottom_bg.jpg b/static/login/login_bottom_bg.jpg deleted file mode 100644 index b389b56214820aa38d7f4bd7813706c1555fe5d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17085 zcmeHu2Ut@}u<)J~LhoIH&;<-6p@$+6x^xf_6-fgEA&E(7R=^6PB4Py*0Sne^SL_O6 zK|ry4RV>)`s)$}IZ%;z=_Se4ud*6Q-vS)T?c4l_A@7dFLqpu67hX#fO0t5j7fq$Uy zKE5X)kDCfWcsQ^H0LTLZq6x4NlF|`FfS1AmFp&|1a0W7}p9cdODFDX64E{t2RSIiE zxMDsR;QI4!hR-WN@oND9*6IUKU$%hBAx5POBm!}|KuDz1iBvMhoj59i%V!I6#WsLS zrc!7W3XSSQgfW>+b9Mp%TZ0VQSA!YQfq7kn9e@#2s1FTt2)3VB4%#_b7Q}3*EQsy! zvS5%w8C1-mY}_H4I1mh<&}*`1-;KUkKv`Of$@Fl5^t}eE(iC79pnQF|!5pA0FE6hk zudJY;tf8c+q@kmxtgNP^ucf7m@bqN1dvqN<{;O?6AUFhz!C~+OIe9!**%1;ousBmq3f?!Gp=CCukSeFWbp0+ra|@lAlT1e^ zQPCwj!LmH|&HcA5v9oUN?%7uU%i`Dpr|KjwdY8vN;Jn*2=X7WG!=6Cviu$>Gmp5H` z^nSy>=BwSk@u@lUR&3mV=Gx;Au0aWDx${?UI?!_c$wv)Ejuy=OqM~wotPV@;^wv@iHGp8{eCjeZqE3$;FwRB7c`#_g zpIcx(WJ2F9pp2F3)Bs~ZZ(MnZrHw^-NN9*fc}#hTMMeFeAtL)adgCf`6^gaGsv;#7 zwRB%=ALmgfnb)6wnMtcl?0D>6-?Vs~L&VKR$Gz`Ooeqe%&aGCdJTV^x5u(=O7mrRC zkWF=V;DWKtQh^>v*OjRR^hZT_r{`)9|8nh!^GuBnQpV5 zjOn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kfBGw!RhZf4-g8{#{CfU+uuIp^J+@O2lj7Gyp+Dfc3?Z1d6ZDb5?G^u)f!Tyo2Q zFlpzqB}+k(t;(a%$j(U}0Zxr~n&#iOYIm#SRclo==9SxNH{Pf@zum`9E@Q!~<2;4a ztH?$Z=!)B3>I8(Gw%os=;oM|BT8HJwglTj~_pOGjR$H&>1JN7KZ)*`Qv@7;x*7uxF z{X%~y3S6nLUyO12R^yG~8f`g2ESbG5z4GREg2st)5jFZRJKrw=%1+zNUe+!ydO$%Y z)@BG|>C;aiD`Q5RHeCC-GTgN^cJkgF-XUtkT|r?Ut_-JhLeJ*c2#uOUEp8N&>#O8R zmCBtV{29B$7B9jC#m}i&_*yvj!A_sB87GfK^)}8XmlTna*f4D)xv)O4_vZ8FlwGu{ o523#po{S$^V{RO^MbCwSPgJe0da}Gzk8{+yw=s96dEd?d0L26!=l}o! diff --git a/static/login/login_top2.jpg b/static/login/login_top2.jpg deleted file mode 100644 index 40d8d6d8a899f037f5076213ccf8680146ff56e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29842 zcmeFacU%-rvoJclOU^8yWR@l8oIx@y2$G`_mIaXvOU{T&k_-j}Bq&KlL;*n*1VltY zl86ctBuh?8yt9kxdBb_nJ>U8MxWD_f?o4%cb#--hbm@5Nb7LjZEH z2vFg3fI|e1?%*R34N#DfkdTs4kdji+l9Q3sGEh@cP%|*n(J|1`G15}t(~r|(<{ys` zN^){aDoPqEDjIq!Dk^&1fr|dH3hjS~!9gQHO9I3Lw_y+@0HuY%Xdwr~U?<5AS|F;R zl!Op`0tLn;7yyA15E2oSkdl#u2JqKH2mposETjP-1P~aM07^(qL_!FokOB*7VFa9T z2|{%fJ36FSq$Cl2N?xS~7dL}xlf9I*cT|riF;A-5^4JR6N9IWW!;8FHY32^vFAA`- zM|&;CF{@S4&3(QTYdU=Cg_j;>wDf;jzw@|tU~ zGh$766a;zbi;MBHO~x9e7?|j{+(q5xVG!1LNTWB+zg}pDym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y z=*(ymwEP zeN6s;l_n7fv`M8C6exBdHM_RGE%J-&ZyOaEk`@C|ymoLg-a`Boe9pr}RJds5 z-=XFx;T&kd(85W?sHpI$rsuq93KfWct`;LxxNQWAxjSuEt56gNhy}0!NlPW%f>xcwAl_GNsi%V=TXM7pjFUpG({0pIgKtCF)RQa?@_YIw_kWVgUHYn z1p!#^>8I}Oh+M>E0^l1RmaA2&-Z7d&ELiWo{O{p3X#Uaz>L@`7-XmX!X4Pt#9PwET zSd+ShQW*rD)aC~AeQMMO%xc~n{#FK*79b5tu&KVHvb;t)7a_}?8uue{HZ_QdK{Lb~ zHeNQi!91#g6|6kA+wdz@y9}X}snCm1&4k1&6$GOO7tqvifN4?PWlJz5TsS|$r*k8_ zwyeaTe$+;hf~dLtDrgdAvD9d4SR{z|hVElcu|XuKy1TiZDi{_Ou-;Cm@WTWxtZVS0 O1S_O#@c#e^fB)I@a@PR> diff --git a/uni_modules/lime-painter/changelog.md b/uni_modules/lime-painter/changelog.md deleted file mode 100644 index 588fa02..0000000 --- a/uni_modules/lime-painter/changelog.md +++ /dev/null @@ -1,225 +0,0 @@ -## 1.9.6.6(2024-09-25) -- fix: 修复background-position无效的问题 -## 1.9.6.5(2024-04-14) -- fix: 修复`nvue`无法生图的问题 -## 1.9.6.4(2024-03-10) -- fix: 修复代理ctx导致H5不能使用ctx.save -## 1.9.6.3(2024-03-08) -- fix: 修复支付宝真机无法使用的问题 -## 1.9.6.2(2024-02-22) -- fix: 修复使用render函数报错的问题 -## 1.9.6.1(2023-12-22) -- fix: 修复字节小程序非2d字体偏移 -- fix: 修复`canvasToTempFilePathSync`会触发两次的问题 -- fix: 修复`parser`图片没有宽度的问题 -## 1.9.6(2023-12-06) -- fix: 修复背景图受padding影响 -- fix: 修复因字节报错改了代理实现导致微信报错 -- 1.9.5.8(2023-11-16) -- fix: 修复margin问题 -- fix: 修复borderWidth问题 -- fix: 修复textBox问题 -- fix: 修复字节开发工具报`could not be cloned.`问题 -## 1.9.5.7(2023-07-27) -- fix: 去掉多余的方法 -- chore: 更新文档,增加自定义字体说明 -## 1.9.5.6(2023-07-21) -- feat: 有限的支持富文本 -- feat: H5和APP 增加 `hidpi` prop,主要用于大尺寸无法生成图片时用 -- fix: 修复 钉钉小程序 缺少 `measureText` 方法 -- chore: 由于微信小程序 pc 端的 canvas 2d 时不时抽风,故不使用canvas 2d -## 1.9.5.5(2023-06-27) -- fix: 修复把`emoji`表情字符拆分成多个字符的情况 -## 1.9.5.4(2023-06-05) -- fix: 修复因`canvasToTempFilePathSync`监听导致重复调用 -## 1.9.5.3(2023-05-23) -- fix: 因isPc错写成了isPC导致小程序PC不能生成图片 -## 1.9.5.2(2023-05-22) -- feat: 删除多余文件 -## 1.9.5.1(2023-05-22) -- fix: 修复 文字行数与`line-clamp`相同但不满一行时也加了省略号的问题 -## 1.9.5(2023-05-14) -- feat: 增加 `text-indent` 和 `calc` 方法 -- feat: 优化 布局时间 -## 1.9.4.4(2023-04-15) -- fix: 修复无法匹配负值 -- fix: 修复 Nvue IOS getImageInfo `useCORS` 为 undefined -## 1.9.4.3(2023-04-01) -- feat: 增加支持文字描边 `text-stroke: '5rpx #fff'` -## 1.9.4.2(2023-03-30) -- fix: 修复 支付宝小程序 isPC 在手机也为true的问题 -- feat: 由 微信开发工具 3060 版 无法获取图片尺寸,现 微信开发工具 3220 版 修复该问题,故还原上一版的获取图片方式。 -## 1.9.4.1(2023-03-28) -- fix: 修复固定高度不正确问题 -## 1.9.4(2023-03-17) -- fix: nvue ios getImageInfo缺少this报错 -- fix: pathType 非2d无效问题 -- fix: 修复 小米9se 可能会存在多次init 导致画面多次放大 -- fix: 修复 border 分开写 width style无效问题 -- fix: 修复 支付宝小程序IOS 再次进入不渲染的问题 -- fix: 修复 支付宝小程序安卓Zindex排序错乱问题 -- fix: 修复 微信开发工具 3060 版 无法获取图片的问题 -- feat: 把 for in 改为 forEach -- feat: 增加 hidden -- feat: 根节点 box-sizing 默认 `border-box` -- feat: 增加支持 `vw` `wh` -- chore: pathType 取消 默认值,因为字节开发工具不能显示 -- chore: 支付宝小程序开发工具不支持 生成图片 请以真机调试为准 -- bug: 企业微信 2.20.3无法使用 -## 1.9.3.5(2022-06-29) -- feat: justifyContent 增加 `space-around`、`space-between` -- feat: canvas 2d 也使用`getImageInfo` -- fix: 修复 `text`的 `text-decoration`错位 -## 1.9.3.4(2022-06-20) -- fix: 修复 因创建节点速度问题导致顺序出错。 -- fix: 修复 微信小程序 PC 无法显示本地图片 -- fix: 修复 flex-box 对齐问题 -- feat: 增加 `text-shadow` -- feat: 重写 `text` 对齐方式 -- chore: 更新文档 -## 1.9.3.3(2022-06-17) -- fix: 修复 支付宝小程序 canvas 2d 存在ctx.draw问题导致报错 -- fix: 修复 支付宝小程序 toDataURL 存在权限问题改用 `toTempFilePath` -- fix: 修复 支付宝小程序 image size 问题导致 `objectFit` 无效 -## 1.9.3.2(2022-06-14) -- fix: 修复 image 设置背景色不生效问题 -- fix: 修复 nvue 环境判断缺少参数问题 -## 1.9.3.1(2022-06-14) -- fix: 修复 bottom 定位不对问题 -- fix: 修复 因小数导致计算出错换行问题 -- feat: 增加 `useCORS` h5端图片跨域 在设置请求头无效果后试一下设置这个值 -- chore: 更新文档 -## 1.9.3(2022-06-13) -- feat: 增加 `zIndex` -- feat: 增加 `flex-box` 该功能处于原始阶段,非常简陋。 -- tips: QQ小程序 vue3 不支持, 为 uni 官方BUG -## 1.9.2.9(2022-06-10) -- fix: 修复`text-align`及`margin`居中问题 -## 1.9.2.8(2022-06-10) -- fix: 修复 Nvue `canvasToTempFilePathSync` 不生效问题 -## 1.9.2.7(2022-06-10) -- fix: 修复 margin及padding的bug -- fix: 修复 Nvue `isCanvasToTempFilePath` 不生效问题 -## 1.9.2.6(2022-06-09) -- fix: 修复 Nvue 不显示 -- feat: 增加支持字体渐变 -```html - -``` -## 1.9.2.5(2022-06-09) -- chore: 更变获取父级宽度的设定 -- chore: `pathType` 在canvas 2d 默认为 `url` -## 1.9.2.4(2022-06-08) -- fix: 修复 `pathType` 不生效问题 -## 1.9.2.3(2022-06-08) -- fix: 修复 `canvasToTempFilePath` 漏写 `success` 参数 -## 1.9.2.2(2022-06-07) -- chore: 更新文档 -## 1.9.2.1(2022-06-07) -- fix: 修复 vue3 赋值给this再传入导致image无法绘制 -- fix: 修复 `canvasToTempFilePathSync` 时机问题 -- feat: canvas 2d 更改图片生成方式 `toDataURL` -## 1.9.2(2022-05-30) -- fix: 修复 `canvasToTempFilePathSync` 在 vue3 下只生成一次 -## 1.9.1.7(2022-05-28) -- fix: 修复 `qrcode`显示不全问题 -## 1.9.1.6(2022-05-28) -- fix: 修复 `canvasToTempFilePathSync` 会重复多次问题 -- fix: 修复 `view` css `backgroundImage` 图片下载失败导致 子节点不渲染 -## 1.9.1.5(2022-05-27) -- fix: 修正支付宝小程序 canvas 2d版本号 2.7.15 -## 1.9.1.4(2022-05-22) -- fix: 修复字节小程序无法使用xml方式 -- fix: 修复字节小程序无法使用base64(非2D情况下工具上无法显示) -- fix: 修复支付宝小程序 `canvasToTempFilePath` 报错 -## 1.9.1.3(2022-04-29) -- fix: 修复vue3打包后uni对象为空后的报错 -## 1.9.1.2(2022-04-25) -- fix: 删除多余文件 -## 1.9.1.1(2022-04-25) -- fix: 修复图片不显示问题 -## 1.9.1(2022-04-12) -- fix: 因四舍五入导致有些机型错位 -- fix: 修复无views报错 -- chore: nvue下因ios无法读取插件内static文件,改由下载方式 -## 1.9.0(2022-03-20) -- fix: 因无法固定尺寸导致生成图片不全 -- fix: 特定情况下text判断无效 -- chore: 本地化APP Nvue webview -## 1.8.9(2022-02-20) -- fix: 修复 小程序下载最多10次并发的问题 -- fix: 修复 APP端无法获取本地图片 -- fix: 修复 APP Nvue端不执行问题 -- chore: 增加图片缓存机制 -## 1.8.8.8(2022-01-27) -- fix: 修复 主动调用尺寸问题 -## 1.8.8.6(2022-01-26) -- fix: 修复 nvue 下无宽度时获取父级宽度 -- fix: 修复 ios app 无法渲染问题 -## 1.8.8(2022-01-23) -- fix: 修复 主动调用时无节点问题 -- fix: 修复 `box-shadow` 颜色问题 -- fix: 修复 `transform:rotate` 角度位置问题 -- feat: 增加 `overflow:hidden` -## 1.8.7(2022-01-07) -- fix: 修复 image 方向为 `right` 时原始宽高问题 -- feat: 支持 view 设置背景图 `background-image: url(xxx)` -- chore: 去掉可选链 -## 1.8.6(2021-11-28) -- feat: 支持`view`对`inline-block`的子集使用`text-align` -## 1.8.5.5(2021-08-17) -- chore: 更新文档,删除 replace -- fix: 修复 text 值为 number时报错 -## 1.8.5.4(2021-08-16) -- fix: 字节小程序兼容 -## 1.8.5.3(2021-08-15) -- fix: 修复线性渐变与css现实效果不一致的问题 -- chore: 更新文档 -## 1.8.5.2(2021-08-13) -- chore: 增加`background-image`、`background-repeat` 能力,主要用于背景纹理的绘制,并不是代替`image`。例如:大面积的重复平铺的水印 -- 注意:这个功能H5暂时无法使用,因为[官方的API有BUG](https://ask.dcloud.net.cn/question/128793),待官方修复!!! -## 1.8.5.1(2021-08-10) -- fix: 修复因`margin`报错问题 -## 1.8.5(2021-08-09) -- chore: 增加margin支持`auto`,以达到居中效果 -## 1.8.4(2021-08-06) -- chore: 增加判断缓存文件条件 -- fix: 修复css 多余空格报错问题 -## 1.8.3(2021-08-04) -- tips: 1.6.x 以下的版本升级到1.8.x后要为每个元素都加上定位:position: 'absolute' -- fix: 修复只有一个view子元素时不计算高度的问题 -## 1.8.2(2021-08-03) -- fix: 修复 path-type 为 `url` 无效问题 -- fix: 修复 qrcode `text` 为空时报错问题 -- fix: 修复 image `src` 动态设置时不生效问题 -- feat: 增加 css 属性 `min-width` `max-width` -## 1.8.1(2021-08-02) -- fix: 修复无法加载本地图片 -## 1.8.0(2021-08-02) -- chore 文档更新 -- 使用旧版的同学不要升级! -## 1.8.0-beta(2021-07-30) -- ## 全新布局方式 不兼容旧版! -- chore: 布局方式变更 -- tips: 微信canvas 2d 不支持真机调试 -## 1.6.6(2021-07-09) -- chore: 统一命名规范,无须主动引入组件 -## 1.6.5(2021-06-08) -- chore: 去掉console -## 1.6.4(2021-06-07) -- fix: 修复 数字 为纯字符串时不转换的BUG -## 1.6.3(2021-06-06) -- fix: 修复 PC 端放大的BUG -## 1.6.2(2021-05-31) -- fix: 修复 报`adaptor is not a function`错误 -- fix: 修复 text 多行高度 -- fix: 优化 默认文字的基准线 -- feat: `@progress`事件,监听绘制进度 -## 1.6.1(2021-02-28) -- 删除多余节点 -## 1.6.0(2021-02-26) -- 调整为uni_modules目录规范 -- 修复:transform的rotate不能为负数问题 -- 新增:`pathType` 指定生成图片返回的路径类型,可选值有 `base64`、`url` diff --git a/uni_modules/lime-painter/components/common/relation.js b/uni_modules/lime-painter/components/common/relation.js deleted file mode 100644 index 6ed37e8..0000000 --- a/uni_modules/lime-painter/components/common/relation.js +++ /dev/null @@ -1,150 +0,0 @@ -const styles = (v ='') => v.split(';').filter(v => v && !/^[\n\s]+$/.test(v)).map(v => { - const key = v.slice(0, v.indexOf(':')) - const value = v.slice(v.indexOf(':')+1) - return { - [key - .replace(/-([a-z])/g, function() { return arguments[1].toUpperCase()}) - .replace(/\s+/g, '') - ]: value.replace(/^\s+/, '').replace(/\s+$/, '') || '' - } - }) -export function parent(parent) { - return { - provide() { - return { - [parent]: this - } - }, - data() { - return { - el: { - id: null, - css: {}, - views: [] - }, - } - }, - watch: { - css: { - handler(v) { - if(this.canvasId) { - this.el.css = (typeof v == 'object' ? v : v && Object.assign(...styles(v))) || {} - this.canvasWidth = this.el.css && this.el.css.width || this.canvasWidth - this.canvasHeight = this.el.css && this.el.css.height || this.canvasHeight - } - }, - immediate: true - } - } - } -} -export function children(parent, options = {}) { - const indexKey = options.indexKey || 'index' - return { - inject: { - [parent]: { - default: null - } - }, - watch: { - el: { - handler(v, o) { - if(JSON.stringify(v) != JSON.stringify(o)) - this.bindRelation() - }, - deep: true, - immediate: true - }, - src: { - handler(v, o) { - if(v != o) - this.bindRelation() - }, - immediate: true - }, - text: { - handler(v, o) { - if(v != o) this.bindRelation() - }, - immediate: true - }, - css: { - handler(v, o) { - if(v != o) - this.el.css = (typeof v == 'object' ? v : v && Object.assign(...styles(v))) || {} - }, - immediate: true - }, - replace: { - handler(v, o) { - if(JSON.stringify(v) != JSON.stringify(o)) - this.bindRelation() - }, - deep: true, - immediate: true - } - }, - created() { - if(!this._uid) { - this._uid = this._.uid - } - Object.defineProperty(this, 'parent', { - get: () => this[parent] || [], - }) - Object.defineProperty(this, 'index', { - get: () => { - this.bindRelation(); - const {parent: {el: {views=[]}={}}={}} = this - return views.indexOf(this.el) - }, - }); - this.el.type = this.type - if(this.uid) { - this.el.uid = this.uid - } - this.bindRelation() - }, - // #ifdef VUE3 - beforeUnmount() { - this.removeEl() - }, - // #endif - // #ifdef VUE2 - beforeDestroy() { - this.removeEl() - }, - // #endif - methods: { - removeEl() { - if (this.parent) { - this.parent.el.views = this.parent.el.views.filter( - (item) => item._uid !== this._uid - ); - } - }, - bindRelation() { - if(!this.el._uid) { - this.el._uid = this._uid - } - if(['text','qrcode'].includes(this.type)) { - this.el.text = this.$slots && this.$slots.default && this.$slots.default[0].text || `${this.text || ''}`.replace(/\\n/g, '\n') - } - if(this.type == 'image') { - this.el.src = this.src - } - if (!this.parent) { - return; - } - let views = this.parent.el.views || []; - if(views.indexOf(this.el) !== -1) { - this.parent.el.views = views.map(v => v._uid == this._uid ? this.el : v) - } else { - this.parent.el.views = [...views, this.el]; - } - } - }, - mounted() { - // this.bindRelation() - }, - } -} \ No newline at end of file diff --git a/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue b/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue deleted file mode 100644 index e24e3aa..0000000 --- a/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue b/uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue deleted file mode 100644 index a73e5ed..0000000 --- a/uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - - - diff --git a/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue b/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue deleted file mode 100644 index b332b02..0000000 --- a/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - - - diff --git a/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue b/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue deleted file mode 100644 index 94596e5..0000000 --- a/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - - - diff --git a/uni_modules/lime-painter/components/l-painter/l-painter.vue b/uni_modules/lime-painter/components/l-painter/l-painter.vue deleted file mode 100644 index 83926fd..0000000 --- a/uni_modules/lime-painter/components/l-painter/l-painter.vue +++ /dev/null @@ -1,461 +0,0 @@ - - - - diff --git a/uni_modules/lime-painter/components/l-painter/nvue.js b/uni_modules/lime-painter/components/l-painter/nvue.js deleted file mode 100644 index 25645fb..0000000 --- a/uni_modules/lime-painter/components/l-painter/nvue.js +++ /dev/null @@ -1,214 +0,0 @@ -// #ifdef APP-NVUE -import { - sleep, - getImageInfo, - isBase64, - networkReg -} from './utils'; -const dom = weex.requireModule('dom') -import { - version -} from '../../package.json' - -export default { - data() { - return { - tempFilePath: [], - isInitFile: false, - osName: uni.getSystemInfoSync().osName - } - }, - methods: { - getParentWeith() { - return new Promise(resolve => { - dom.getComponentRect(this.$refs.limepainter, (res) => { - this.parentWidth = Math.ceil(res.size.width) - this.canvasWidth = this.canvasWidth || this.parentWidth || 300 - this.canvasHeight = res.size.height || this.canvasHeight || 150 - resolve(res.size) - }) - }) - }, - onPageFinish() { - this.webview = this.$refs.webview - this.webview.evalJS(`init(${this.dpr})`) - }, - onMessage(e) { - const res = e.detail.data[0] || null; - if (res.event) { - if (res.event == 'inited') { - this.inited = true - } - if (res.event == 'fail') { - this.$emit('fail', res) - } - if (res.event == 'layoutChange') { - const data = typeof res.data == 'string' ? JSON.parse(res.data) : res.data - this.canvasWidth = Math.ceil(data.width); - this.canvasHeight = Math.ceil(data.height); - } - if (res.event == 'progressChange') { - this.progress = res.data * 1 - } - if (res.event == 'file') { - this.tempFilePath.push(res.data) - if (this.tempFilePath.length > 7) { - this.tempFilePath.shift() - } - return - } - if (res.event == 'success') { - if (res.data) { - this.tempFilePath.push(res.data) - if (this.tempFilePath.length > 8) { - this.tempFilePath.shift() - } - if (this.isCanvasToTempFilePath) { - this.setFilePath(this.tempFilePath.join(''), { - isEmit: true - }) - } - } else { - this.$emit('fail', 'canvas no data') - } - return - } - this.$emit(res.event, JSON.parse(res.data)); - } else if (res.file) { - this.file = res.data; - } else { - console.info(res[0]) - } - }, - getWebViewInited() { - if (this.inited) return Promise.resolve(this.inited); - return new Promise((resolve) => { - this.$watch( - 'inited', - async val => { - if (val) { - resolve(val) - } - }, { - immediate: true - } - ); - }) - }, - getTempFilePath() { - if (this.tempFilePath.length == 8) return Promise.resolve(this.tempFilePath) - return new Promise((resolve) => { - this.$watch( - 'tempFilePath', - async val => { - if (val.length == 8) { - resolve(val.join('')) - } - }, { - deep: true - } - ); - }) - }, - getWebViewDone() { - if (this.progress == 1) return Promise.resolve(this.progress); - return new Promise((resolve) => { - this.$watch( - 'progress', - async val => { - if (val == 1) { - this.$emit('done') - this.done = true - this.runTask() - resolve(val) - } - }, { - immediate: true - } - ); - }) - }, - async render(args) { - try { - await this.getSize(args) - const { - width - } = args.css || args - if (!width && this.parentWidth) { - Object.assign(args, { - width: this.parentWidth - }) - } - const newNode = await this.calcImage(args); - await this.getWebViewInited() - this.webview.evalJS(`source(${JSON.stringify(newNode)})`) - await this.getWebViewDone() - await sleep(this.afterDelay) - if (this.isCanvasToTempFilePath) { - const params = { - fileType: this.fileType, - quality: this.quality - } - this.webview.evalJS(`save(${JSON.stringify(params)})`) - } - return Promise.resolve() - } catch (e) { - this.$emit('fail', e) - } - }, - async calcImage(args) { - let node = JSON.parse(JSON.stringify(args)) - const urlReg = /url\((.+)\)/ - const { - backgroundImage - } = node.css || {} - const isBG = backgroundImage && urlReg.exec(backgroundImage)[1] - const url = node.url || node.src || isBG - if (['text', 'qrcode'].includes(node.type)) { - return node - } - if ((node.type === "image" || isBG) && url && !isBase64(url) && (this.osName == 'ios' || !networkReg - .test(url))) { - let { - path - } = await getImageInfo(url, true) - if (isBG) { - node.css.backgroundImage = `url(${path})` - } else { - node.src = path - } - } else if (node.views && node.views.length) { - for (let i = 0; i < node.views.length; i++) { - node.views[i] = await this.calcImage(node.views[i]) - } - } - return node - }, - async canvasToTempFilePath(args = {}) { - if (!this.inited) { - return this.$emit('fail', 'no init') - } - this.tempFilePath = [] - if (args.fileType == 'jpg') { - args.fileType = 'jpeg' - } - - this.webview.evalJS(`save(${JSON.stringify(args)})`) - try { - let tempFilePath = await this.getTempFilePath() - - tempFilePath = await this.setFilePath(tempFilePath, args) - args.success({ - errMsg: "canvasToTempFilePath:ok", - tempFilePath - }) - } catch (e) { - console.log('e', e) - args.fail({ - error: e - }) - } - } - } -} -// #endif \ No newline at end of file diff --git a/uni_modules/lime-painter/components/l-painter/painter.js b/uni_modules/lime-painter/components/l-painter/painter.js deleted file mode 100644 index a8e3483..0000000 --- a/uni_modules/lime-painter/components/l-painter/painter.js +++ /dev/null @@ -1 +0,0 @@ -var t=function(){return t=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=360&&(s-=360);s<0&&(s+=360);if(0===(s=Math.round(s)))return{x0:Math.round(e/2)+n,y0:i+r,x1:Math.round(e/2)+n,y1:r};if(180===s)return{x0:Math.round(e/2)+n,y0:r,x1:Math.round(e/2)+n,y1:i+r};if(90===s)return{x0:n,y0:Math.round(i/2)+r,x1:e+n,y1:Math.round(i/2)+r};if(270===s)return{x0:e+n,y0:Math.round(i/2)+r,x1:n,y1:Math.round(i/2)+r};var a=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(s===a)return{x0:n,y0:i+r,x1:e+n,y1:r};if(s===180-a)return{x0:n,y0:r,x1:e+n,y1:i+r};if(s===180+a)return{x0:e+n,y0:r,x1:n,y1:i+r};if(s===360-a)return{x0:e+n,y0:i+r,x1:n,y1:r};var h=0,c=0,f=0,l=0;if(s180-a&&s<180||s>180&&s<180+a||s>360-a){var d=s*Math.PI/180,u=s360-a?i/2:-i/2,p=Math.tan(d)*u,g=s180-a&&s<180?e/2-p:-e/2-p;h=-(f=p+(v=Math.pow(Math.sin(d),2)*g)),c=-(l=u+v/Math.tan(d))}if(s>a&&s<90||s>90&&s<90+a||s>180+a&&s<270||s>270&&s<360-a){var v;d=(90-s)*Math.PI/180,p=s>a&&s<90||s>90&&s<90+a?e/2:-e/2,u=Math.tan(d)*p,g=s>a&&s<90||s>270&&s<360-a?i/2-u:-i/2-u;h=-(f=p+(v=Math.pow(Math.sin(d),2)*g)/Math.tan(d)),c=-(l=u+v)}return h=Math.round(h+e/2)+n,c=Math.round(i/2-c)+r,f=Math.round(f+e/2)+n,l=Math.round(i/2-l)+r,{x0:h,y0:c,x1:f,y1:l}}(r,t,e,i,n),a=s.x0,h=s.y0,c=s.x1,f=s.y1,l=o.createLinearGradient(a,h,c,f),d=r.match(/linear-gradient\((.+)\)/)[1],u=R(d.substring(d.indexOf(",")+1)),p=0;pt.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(t){return"number"==typeof t}function D(t){return"auto"===t||null===t}function $(t){return/%$/.test(t)}var Y=p,U=u,N=d,X=g,_=y,q=w,G=m;function V(t){return t.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}))}function J(t,e){var i,n,o=function(t){var e=t.match(/([a-z]+)/)[1];return[e,V(t.split(e)[1])]}(t),s=o[0],a=o[1],h=e.split(" ");if(a)return(i={})[s+a]=e,i;if(h.length&&!a){var c=h[0],f=h[1],l=h[2],d=h[3];return(n={})[s+r[0]]=c,n[s+r[1]]=f||c,n[s+r[2]]=l||c,n[s+r[3]]=d||f||c,n}}function Q(t){t=t.trim();for(var e=new Array,i="+",n="",r=t.length,o=0;o0;)"("===t[a+=1]&&(s+=1),")"===t[a]&&(s-=1);n="".concat(Q(t.slice(o+1,a))),o=a}if(isNaN(Number(t[o]))&&"."!==t[o]||o===r-1){var h=parseFloat(n);switch(i){case"+":e.push(h);break;case"-":e.push(-h);break;case"*":e.push(e.pop()*h);break;case"/":e.push(e.pop()/h)}i=t[o],n=""}}for(var c=0;e.length;)c+=e.pop();return c}var Z,K=0,et=function(){function t(){F(this,"elements",[]),F(this,"afterElements",[]),F(this,"beforeElements",[]),F(this,"ids",[]),F(this,"width",0),F(this,"height",0),F(this,"top",0),F(this,"left",0),F(this,"pre",null),F(this,"offsetX",0),F(this,"offsetY",0),K++,this.id=K}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){if(!this.ids.includes(t.id)){this.ids.push(t.id),this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()}},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.includes(t.id)||(this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t))},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)this[this.key.height]&&(this.container[this.key.lineMaxHeight]=this[this.key.height]=i),this[this.key.width]+=this.getWidth(t.offsetSize);var n=Math.min(this.getWidth(this),!this.getWidth(this.container.contentSize)&&1/0);(this.container[this.key.lineMaxWidth]||0)1)return 0;var e=t.style.alignSelf,i=this.getHeight(this.container.contentSize),n=i-this.getHeight(t.offsetSize);return"flex-end"===e?n:"center"===e?n/2:"stretch"===e?(n&&t.name==d&&(t.style[this.key.width]=this.getWidth(t.offsetSize),t.style[this.key.height]=i,delete t.line,delete t.lines,t.getBoxWidthHeight()),0):0},r.layout=function(t,e){var i=this;this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements.forEach((function(t,e){i.setIndent(t);var n=i.elements[e-1],r=i.getOffsetY(t);t.style[i.key.top]=i[i.key.top]+r,t.style[i.key.left]=n?n.offsetSize[i.key.left]+i.getWidth(n.offsetSize):i[i.key.left],t.getBoxPosition()}))},n}(et),rt=p,ot=u,st=d,at=v,ht=y,ct=b,ft=w,lt=m,dt=0,ut={left:null,top:null,width:null,height:null},pt=new Map,gt=function(){function t(t,e,i,n){var o=this;F(this,"id",dt++),F(this,"style",{left:null,top:null,width:null,height:null}),F(this,"computedStyle",{}),F(this,"originStyle",{}),F(this,"children",{}),F(this,"layoutBox",A({},ut)),F(this,"contentSize",A({},ut)),F(this,"clientSize",A({},ut)),F(this,"borderSize",A({},ut)),F(this,"offsetSize",A({},ut)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.type||t.name,this.attributes=this.getAttributes(t);var s=function(t,e){var i,n=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],o=t.type,s=void 0===o?N:o,a=t.styles,h=void 0===a?{}:a,c=(e||{}).computedStyle,f=Object.assign({},S);if([U,Y,X].includes(s)&&!h.display&&(f.display=_),c)for(var l=0;l=0&&l<0,$=c>=0&&u<0;return i==a[0]&&(this[i].left=t.left+s+v+E+(D?2*-l:0),this[i].top=t.top+c+x+W+($?2*-u:0),this[i].width=t.width+(this[i].widthAdd?0:C),this[i].height=t.height+(this[i].heightAdd?0:H),this[i].widthAdd=C,this[i].heightAdd=H),i==a[1]&&(this[i].left=t.left+s+E+(D<0?-l:0),this[i].top=t.top+c+W+($?-u:0),this[i].width=t.width+v+w,this[i].height=t.height+x+S),i==a[2]&&(this[i].left=t.left+s+E/2+(D<0?-l:0),this[i].top=t.top+c+W/2+($?-u:0),this[i].width=t.width+v+w+E/2+F/2,this[i].height=t.height+x+S+T/2+W/2),i==a[3]&&(this[i].left=t.left+(D<0?-l:0),this[i].top=t.top+($?-u:0),this[i].width=t.width+v+w+E+F+s+l,this[i].height=t.height+x+S+T+W+u+c),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var r=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var o=e||{},s=o.border,h=(s=void 0===s?{}:s).borderWidth,c=void 0===h?0:h,f=o.borderTop,l=(f=void 0===f?{}:f).borderTopWidth,d=void 0===l?c:l,u=o.borderBottom,p=(u=void 0===u?{}:u).borderBottomWidth,g=void 0===p?c:p,v=o.borderRight,y=(v=void 0===v?{}:v).borderRightWidth,x=void 0===y?c:y,b=o.borderLeft,w=(b=void 0===b?{}:b).borderLeftWidth,m=void 0===w?c:w,S=o.padding,z=(S=void 0===S?{}:S).paddingTop,I=void 0===z?0:z,M=S.paddingRight,k=void 0===M?0:M,B=S.paddingBottom,W=void 0===B?0:B,P=S.paddingLeft,O=void 0===P?0:P;i||(t.width-=O+k+x+m),1!==i||n||(t.height-=I+W+d+g)}this.layoutBox&&(a.forEach((function(i){return r.layoutBox[i]=r.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,r=void 0===n?0:n,o=t.top,s=void 0===o?0:o,a=A({},this.contentSize,{left:r,top:s}),h=this.contentSize.top-this.offsetSize.top,c=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var f,l=C(this.root.fixedLine.elements);!(f=l()).done;){var d=f.value;d.setPosition(d,this.root.offsetSize),d.getBoxPosition()}}if(e)for(var u,p=C(e.elements);!(u=p()).done;){var g=u.value,v=A({},this.borderSize,{left:r,top:s});g.setPosition(g,v);var y=this.borderSize.top-this.offsetSize.top,x=this.borderSize.left-this.offsetSize.left;g.style.left+=r+x,g.style.top+=s+y,g.getBoxPosition()}if(i)for(var b,w=C(i);!(b=w()).done;){b.value.layout(a.top+h,a.left+c)}return this.layoutBoxUpdate(a,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&t.style.display==at},e.isFlex=function(t){return void 0===t&&(t=this),t&&t.style.display==ct},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&(!!t.parent&&(!(!t.parent||t.parent.style.display!==ct)||void 0))},e.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==ht},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return{ascent:r,descent:o,width:n,fontHeight:r+o||.7*e+1}},e.getParentSize=function(t,e){if(void 0===t&&(t=this),void 0===e&&(e=!1),t&&t.parent){if(t.parent.contentSize.width)return t.parent.contentSize;if(e)return this.getParentSize(t.parent,e)}return null},e.getBoxWidthHeight=function(){var t=this,e=this.name,i=this.computedStyle,n=this.attributes,r=this.parent,o=void 0===r?{}:r,s=this.ctx,a=this.getChildren(),h=i.left,c=void 0===h?0:h,f=i.top,l=void 0===f?0:f,d=i.bottom,u=i.right,p=i.width,g=void 0===p?0:p,v=i.minWidth,y=i.maxWidth,x=i.minHeight,b=i.maxHeight,w=i.height,m=void 0===w?0:w,S=i.fontSize,z=i.fontWeight,I=i.fontFamily,M=i.fontStyle,k=i.position;i.textIndent;var B=i.lineClamp,P=i.lineHeight,O=i.padding,T=void 0===O?{}:O,L=i.margin,R=void 0===L?{}:L,F=i.border,A=(F=void 0===F?{}:F).borderWidth,j=void 0===A?0:A,E=i.borderRight,C=(E=void 0===E?{}:E).borderRightWidth,H=void 0===C?j:C,Y=i.borderLeft,U=(Y=void 0===Y?{}:Y).borderLeftWidth,N=void 0===U?j:U,X=o.contentSize&&o.contentSize.width,_=o.contentSize&&o.contentSize.height;if($(g)&&X&&(g=W(g,X)),$(g)&&!X&&(g=null),$(m)&&_&&(m=W(m,_)),$(m)&&!_&&(m=null),$(v)&&X&&(v=W(v,X)),$(y)&&X&&(y=W(y,X)),$(x)&&_&&(x=W(x,_)),$(b)&&_&&(b=W(b,_)),i.padding&&X)for(var q in i.padding)Object.hasOwnProperty.call(T,q)&&(T[q]=W(T[q],X));var G=T.paddingRight,V=void 0===G?0:G,J=T.paddingLeft,Q=void 0===J?0:J;if(i.margin&&[R.marginLeft,R.marginRight].includes("auto"))if(g){var Z=X&&X-g-V-Q-N-H||0;R.marginLeft==R.marginRight?R.marginLeft=R.marginRight=Z/2:D(R.marginLeft)?R.marginLeft=Z:R.marginRight=Z}else R.marginLeft=R.marginRight=0;var K=R.marginRight,tt=void 0===K?0:K,it=R.marginLeft,at={width:g,height:m,left:0,top:0},ht=Q+V+N+H+(void 0===it?0:it)+tt;if(this.offsetWidth=ht,e==ot&&!this.attributes.widths){var ct=n.text||"";s.save(),s.setFonts({fontFamily:I,fontSize:S,fontWeight:z,fontStyle:M}),ct.length,"\n"==ct&&(ct="",this.isBr=!0),(""+ct).split("\n").map((function(e){var i=Array.from(e).map((function(e){var i=""+(/^[\u4e00-\u9fa5]+$/.test(e)?"cn":e)+I+S+z+M,n=pt.get(i);if(n)return{width:n,text:e};var r=t.measureText(e,S).width;return pt.set(i,r),{width:r,text:e}})),n=t.measureText(e,S),r=n.fontHeight,o=n.ascent,s=n.descent;t.attributes.fontHeight=r,t.attributes.ascent=o,t.attributes.descent=s,t.attributes.widths||(t.attributes.widths=[]),t.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e.width}),0)})})),s.restore()}if(e==rt&&null==g){var lt=n.width,dt=n.height;at.width=this.contrastSize(Math.round(lt*m/dt)||0,v,y),this.layoutBoxUpdate(at,i,0)}if(e==ot&&null==g){var ut=this.attributes.widths,gt=Math.max.apply(Math,ut.map((function(t){return t.total})));if(o&&X>0&&(gt>X||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed)gt=X;at.width=this.contrastSize(gt,v,y),this.layoutBoxUpdate(at,i,0)}if(e==ot&&(o.style.flex||!this.attributes.lines)){var vt=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e.width>at.width?(vt++,e.width):t+e.width}),0)})),vt=B&&vt>B?B:vt,this.attributes.lines=vt}if(e==rt&&null==m){var yt=n.width,xt=n.height;n.text,at.height=this.contrastSize(W(at.width*xt/yt)||0,x,b),this.layoutBoxUpdate(at,i,1)}e==ot&&null==m&&(P=W(P,S),at.height=this.contrastSize(W(this.attributes.lines*P),x,b),this.layoutBoxUpdate(at,i,1,!0)),!g&&o&&o.children&&X&&(!this.isFlex(o)||o.isFlexCalc)&&([st,ot].includes(e)&&this.isFlex()||e==st&&this.isBlock(this)&&this.isInFlow())&&(at.width=this.contrastSize(X-(o.isFlexCalc?0:ht),v,y),this.layoutBoxUpdate(at,i)),g&&!$(g)&&(at.width=this.contrastSize(g,v,y),this.layoutBoxUpdate(at,i,0)),m&&!$(m)&&(at.height=this.contrastSize(at.height,x,b),this.layoutBoxUpdate(at,i,1));var bt=0;if(a.length){var wt=null,mt=!1;a.forEach((function(e,n){e.getBoxWidthHeight();var r=a[n+1];if(r&&r.isInFlow()&&(e.next=r),!t.line||!t.line.ids.includes(e.id))if(e.isInFlow()&&!e.inFlexBox()){var o=t.getBoxState(wt,e);if(e.isBr)return mt=!0;t.line&&t.line.canIEnter(e)&&!o&&!mt?t.line.add(e):(mt=!1,(new et).bind(e)),wt=e}else e.inFlexBox()?t.line&&(t.line.canIEnter(e)||"nowrap"==i.flexWrap)?t.line.add(e):(new nt).bind(e):e.isFixed?t.root.fixedLine?t.root.fixedLine.fixedAdd(e):(new et).fixedBind(e):t.fixedLine?t.fixedLine.fixedAdd(e):(new et).fixedBind(e,1)})),this.lines&&(bt=this.lines.reduce((function(t,e){return t+e.height}),0))}var St=0,zt=0;if(!g&&(this.isAbsolute||this.isFixed)&&X){var It=k==ft?X:this.root.width,Mt=It-($(c)?W(c,It):c)-($(u)?W(u,It):u);St=i.left?Mt:this.lineMaxWidth}if(!m&&(null!=l?l:this.isAbsolute||this.isFixed&&_)){var kt=k==ft?_:this.root.height,Bt=kt-($(l)?W(l,kt):l)-($(d)?W(d,kt):d);zt=i.top?Bt:0}if(g&&!$(g)||at.width||(at.width=St||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?X||o.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,v,y),this.layoutBoxUpdate(at,i,0)),m||!bt&&!zt||(at.height=zt||this.contrastSize(bt,x,b),this.layoutBoxUpdate(at,i)),i.borderRadius&&this.borderSize&&this.borderSize.width)for(var q in i.borderRadius)Object.hasOwnProperty.call(i.borderRadius,q)&&(i.borderRadius[q]=W(i.borderRadius[q],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.root.contentSize=this.contentSize,this.getBoxPosition(),this.offsetSize},t}(),vt=function(){var t,e,i,n,r,o,s=[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28],a=[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177],h=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],c=[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],f=[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175],l=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],d=[],u=[],p=[],g=[],v=[],y=2;function x(t,e){var i;t>e&&(i=t,t=e,e=i),i=e,i*=e,i+=e,i>>=1,g[i+=t]=1}function b(t,i){var n;for(p[t+e*i]=1,n=-2;n<2;n++)p[t+n+e*(i-2)]=1,p[t-2+e*(i+n+1)]=1,p[t+2+e*(i+n)]=1,p[t+n+1+e*(i+2)]=1;for(n=0;n<2;n++)x(t-1,i+n),x(t+1,i-n),x(t-n,i-1),x(t+n,i+1)}function w(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var m=[];function S(t,e,i,n){var r,o,s;for(r=0;re&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,g[i+=t]}function I(t){var i,n,r,o;switch(t){case 0:for(n=0;n>1&1,i=0;i=5&&(i+=3+v[e]-5);for(e=3;et||3*v[e-3]>=4*v[e]||3*v[e+3]>=4*v[e])&&(i+=40);return i}function k(){var t,i,n,r,o,s=0,a=0;for(i=0;ie*e;)h-=e*e,c++;for(s+=10*c,t=0;t1)for(P=s[t],B=e-7;;){for(M=e-7;M>P-3&&(b(M,B),!(M6)for(P=a[t-7],W=17,M=0;M<6;M++)for(B=0;B<3;B++,W--)1&(W>11?t>>W-12:P>>W)?(p[5-M+e*(2-B+e-11)]=1,p[2-B+e-11+e*(5-M)]=1):(x(5-M,2-B+e-11),x(2-B+e-11,5-M));for(B=0;B=(M=r*(i+n)+n)-2&&(O=M-2,t>9&&O--),T=O,t>9){for(d[T+2]=0,d[T+3]=0;T--;)P=d[T],d[T+3]|=255&P<<4,d[T+2]=P>>4;d[2]|=255&O<<4,d[1]=O>>4,d[0]=64|O>>12}else{for(d[T+1]=0,d[T+2]=0;T--;)P=d[T],d[T+2]|=255&P<<4,d[T+1]=P>>4;d[1]|=255&O<<4,d[0]=64|O>>4}for(T=O+3-(t<10);T0;L--)m[L]=m[L]?m[L-1]^l[w(f[m[L]]+T)]:m[L-1];m[0]=l[w(f[m[0]]+T)]}for(T=0;T<=o;T++)m[T]=f[m[T]];for(W=M,B=0,T=0;T>=1)1&B&&(p[e-1-W+8*e]=1,W<6?p[8+e*W]=1:p[8+e*(W+1)]=1);for(W=0;W<7;W++,B>>=1)1&B&&(p[8+e*(e-7+W)]=1,W?p[6-W+8*e]=1:p[7+8*e]=1);return p}(v)},utf16to8:function(t){var e,i,n,r;for(e="",n=t.length,i=0;i=1&&r<=127?e+=t.charAt(i):r>2047?(e+=String.fromCharCode(224|r>>12&15),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|r>>0&63)):(e+=String.fromCharCode(192|r>>6&31),e+=String.fromCharCode(128|r>>0&63));return e},draw:function(t,i,n,r,o){i.drawView(n,r);var s=i.ctx,a=n.contentSize,h=a.width,c=a.height,f=a.left,l=a.top;r.borderRadius,r.backgroundColor;var d=r.color,u=void 0===d?"#000000":d;r.border,n.contentSize.left,n.borderSize.left,n.contentSize.top,n.borderSize.top;if(y=o||y,s){s.save(),i.setOpacity(r),i.setTransform(n,r);var p=Math.min(h,c);t=this.utf16to8(t);var g=this.getFrame(t),v=p/e;s.setFillStyle(u);for(var x=0;x=s||n==c&&o=s)&&(a=e.width/i.width);var f=i.width*a,l=i.height*a,d=r||[],u=d[0],p=d[1],g=O(u)?W(u,e.width):(e.width-f)*(P(u)?W(u,1):{left:0,center:.5,right:1}[u||"center"]),v=O(p)?W(p,e.height):(e.height-l)*(P(p)?W(p,1):{top:0,center:.5,bottom:1}[p||"center"]),y=function(t,e){return[(t-g)/a,(e-v)/a]},x=y(0,0),b=x[0],w=x[1],m=y(e.width,e.height),S=m[0],z=m[1],I=Math.max,M=Math.min;return{sx:I(b,0),sy:I(w,0),sw:M(S-b,i.width),sh:M(z-w,i.height),dx:I(g,0),dy:I(v,0),dw:M(f,e.width),dh:M(l,e.height)}}({objectFit:u,objectPosition:v},r.contentSize,t),o=i.sx,s=i.sy,a=i.sh,h=i.sw,c=i.dx,f=i.dy,l=i.dh,d=i.dw;I==n.MP_BAIDU?e.drawImage(t.src,c+m,f+S,d,l,o,s,h,a):e.drawImage(t.src,o,s,h,a,c+m,f+S,d,l)}else e.drawImage(t.src,m,S,b,w)},B=function(){e.restore(),L.drawView(r,o,!1,!0,!1),h(1)},T=function(t){k(t),B()},T(t),[2]}))}))}))];case 1:return h.sent(),[2]}}))}))},r.prototype.drawText=function(t,e,i,n){var r=this,o=this.ctx,s=e.borderSize,a=e.contentSize,h=e.left,c=e.top,f=a.width,l=a.height,d=a.left-s.left||0,u=a.top-s.top||0,p=i.color,g=i.lineHeight,v=i.fontSize,y=i.fontWeight,x=i.fontFamily,b=i.fontStyle,w=i.textIndent,m=void 0===w?0:w,S=i.textAlign,z=i.textStroke,I=i.verticalAlign,M=void 0===I?St:I,k=i.backgroundColor,P=i.lineClamp,O=i.backgroundClip,T=i.textShadow,L=i.textDecoration;if(m=B(m)?m:0,this.drawView(e,i,O!=xt),g=W(g,v),t){o.save(),h+=d,c+=u;var R=n.fontHeight,F=n.descent,A=void 0===F?0:F,j=n.ascent,E=A+(void 0===j?0:j);switch(o.setFonts({fontFamily:x,fontSize:v,fontWeight:y,fontStyle:b}),o.setTextBaseline(St),o.setTextAlign(S),O?this.setBackground(k,f,l,h,c):o.setFillStyle(p),S){case It:break;case Mt:h+=.5*f;break;case kt:h+=f}var C=n.lines*g,H=Math.ceil((l-C)/2);switch(H<0&&(H=0),M){case mt:break;case St:c+=H;break;case zt:c+=2*H}var D=(g-R)/2,$=g/2,Y=function(t){var e=o.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,r=e.actualBoundingBoxAscent;return M==mt?{fix:E?void 0===r?0:r:$-D/2,lineY:E?0:D-D/2}:M==St?{fix:E?$+n/4:$,lineY:E?0:D}:M==zt?{fix:E?g-n:$+D/2,lineY:E?2*D:D+D/2}:{fix:0,height:0,lineY:0}},U=function(t,e,i){var r=t;switch(S){case It:r+=i;break;case Mt:r=(t-=i/2)+i;break;case kt:r=t,t-=i}if(L){o.setLineWidth(v/13),o.beginPath();var s=.1*n.fontHeight;/\bunderline\b/.test(L)&&(o.moveTo(t,e+n.fontHeight+s),o.lineTo(r,e+n.fontHeight+s)),/\boverline\b/.test(L)&&(o.moveTo(t,e-s),o.lineTo(r,e-s)),/\bline-through\b/.test(L)&&(o.moveTo(t,e+.5*n.fontHeight),o.lineTo(r,e+.5*n.fontHeight)),o.closePath(),o.setStrokeStyle(p),o.stroke()}},N=function(t,e,i){var n=function(){o.setLineWidth(z.width),o.setStrokeStyle(z.color),o.strokeText(t,e,i)},s="outset";z&&z.type!==s?(o.save(),r.setShadow({boxShadow:T}),o.fillText(t,e,i),o.restore(),n()):z&&z.type==s?(o.save(),r.setShadow({boxShadow:T}),n(),o.restore(),o.save(),o.fillText(t,e,i),o.restore()):(r.setShadow({boxShadow:T}),o.fillText(t,e,i))};if(!n.widths||1==n.widths.length&&n.widths[0].total+m<=a.width){var X=Y(t),_=X.fix,q=void 0===_?0:_,G=X.lineY;return N(t,h+m,c+q),U(h+m,c+G,n&&n.widths&&n.widths[0].total||n.text),c+=g,o.restore(),void this.setBorder(e,i)}for(var V=c,J=h,Q="",Z=0,K=o.measureText("...").width,tt=n.widths,et=0;eta.width){Z>=P&&(Q+="…"),Z++,nt=0;var ct=Y(Q);q=ct.fix,G=ct.lineY;N(Q,J,c+q),U(J,c+G,nt),c+=g,Q=""}else if(rt==it.length-1){et!=tt.length-1&&Z==P&&K+ntV+l||Z>P)break}}o.restore()}},r.prototype.source=function(t){return e(this,void 0,void 0,(function(){var e,n,r,o,s=this;return i(this,(function(i){switch(i.label){case 0:if(this.node=null,e=+new Date,"{}"==JSON.stringify(t))return[2];if(t.styles=t.styles||t.css||{},!t.type)for(n in t.type=wt,t)["views","children","type","css","styles"].includes(n)||(t.styles[n]=t[n],delete t[n]);return t.styles.boxSizing||(t.styles.boxSizing="border-box"),[4,this.create(t)];case 1:return(r=i.sent())?(o=r.layout()||{},this.size=o,this.node=r,this.onEffectFinished().then((function(t){return s.lifecycle("onEffectSuccess",t)})).catch((function(t){return s.lifecycle("onEffectFail",t)})),this.performance&&console.log("布局用时:"+(+new Date-e)+"ms"),[2,this.size]):[2,console.warn("no node")]}}))}))},r.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},r.prototype.create=function(n,r){return e(this,void 0,void 0,(function(){function e(i,n,r){void 0===n&&(n={}),void 0===r&&(r=!0);var o=[];return i.forEach((function(i){var s=i.styles,a=void 0===s?{}:s,h=i.css,c=void 0===h?{}:h,f=i.children,l=void 0===f?[]:f,d=i.views,u=void 0===d?[]:d,p=i.text,g=void 0===p?"":p,v=i.type,y=void 0===v?"":v;!l&&u&&(i.children=l=u);var x={};x=t(t(r?t({},n):{},a),c);var b={},w={},m={};Object.keys(x).map((function(t){if(t.includes("padding")||t.includes("margin")){var e=J(t,x[t]);Object.keys(e).map((function(t){t.includes("Left")?w[t]=e[t]:t.includes("Right")?m[t]=e[t]:b[t]=e[t]}))}}));if(x.textIndent&&(w.textIndent=x.textIndent,delete n.textIndent),""!==g){var S=Array.from(g);S.forEach((function(t,e){var i=Object.assign({},x,b);0===e?Object.assign(i,w):e==S.length-1&&Object.assign(i,m),delete i.padding,delete i.margin,o.push({type:"text",text:t,styles:i})}))}if(y==yt||y==bt)o.push(i);else if("block"===a.display&&l.length>0){var z=e(l,x,!1);i.children=z,i.flattened=!0,o.push(i)}else if(l.length>0){z=e(l,x,r);o=o.concat(z)}})),o}var o,s,a,h,c,f,l,d,u,p,g,v,y,b,w,m,S,z,I,M,k,B,W,P;return i(this,(function(i){switch(i.label){case 0:if(!n)return[2];if(n.styles||(n.styles=n.css||{}),o=n.type,s=n.show,a=void 0===s||s,h=o==yt,c=[xt,bt].includes(o),f="textBox"==o,l=n.styles||{},d=l.backgroundImage,u=l.display,h&&!n.src&&!n.url)return[2];if(u==x||!a)return[2];if(c||f){if(p=n.children,g=n.views,!p&&g&&(n.children=p=g),!n.text&&(!p||p&&!p.length))return[2];p&&p.length&&!n.flattened&&(v=e(n.children||n.views),n.type="view",n.children=v)}if(!(h||n.type==wt&&d))return[3,4];y=h?n.src:"",b=/url\(['"]?(.*?)['"]?\)/.exec(d),d&&b&&b[1]&&(y=b[1]||""),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.getImageInfo(y)];case 2:return w=i.sent(),m=w.width,S=w.height,!(z=w.path)&&h?[2]:(z&&(n.attributes=Object.assign(n.attributes||{},{width:m,height:S,path:z,src:z,naturalSrc:y})),[3,4]);case 3:return I=i.sent(),n.type!=wt?[2]:(this.lifecycle("onEffectFail",t(t({},I),{src:y})),[3,4]);case 4:if(this.count+=1,M=new gt(n,r,this.root,this.ctx),!(k=n.children||n.views))return[3,8];B=0,i.label=5;case 5:return B0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=360&&(s-=360);s<0&&(s+=360);if(0===(s=Math.round(s)))return{x0:Math.round(e/2)+n,y0:i+r,x1:Math.round(e/2)+n,y1:r};if(180===s)return{x0:Math.round(e/2)+n,y0:r,x1:Math.round(e/2)+n,y1:i+r};if(90===s)return{x0:n,y0:Math.round(i/2)+r,x1:e+n,y1:Math.round(i/2)+r};if(270===s)return{x0:e+n,y0:Math.round(i/2)+r,x1:n,y1:Math.round(i/2)+r};var h=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(s===h)return{x0:n,y0:i+r,x1:e+n,y1:r};if(s===180-h)return{x0:n,y0:r,x1:e+n,y1:i+r};if(s===180+h)return{x0:e+n,y0:r,x1:n,y1:i+r};if(s===360-h)return{x0:e+n,y0:i+r,x1:n,y1:r};var a=0,l=0,d=0,c=0;if(s180-h&&s<180||s>180&&s<180+h||s>360-h){var f=s*Math.PI/180,u=s360-h?i/2:-i/2,p=Math.tan(f)*u,g=s180-h&&s<180?e/2-p:-e/2-p;a=-(d=p+(v=Math.pow(Math.sin(f),2)*g)),l=-(c=u+v/Math.tan(f))}if(s>h&&s<90||s>90&&s<90+h||s>180+h&&s<270||s>270&&s<360-h){var v;f=(90-s)*Math.PI/180,p=s>h&&s<90||s>90&&s<90+h?e/2:-e/2,u=Math.tan(f)*p,g=s>h&&s<90||s>270&&s<360-h?i/2-u:-i/2-u;a=-(d=p+(v=Math.pow(Math.sin(f),2)*g)/Math.tan(f)),l=-(c=u+v)}return a=Math.round(a+e/2)+n,l=Math.round(i/2-l)+r,d=Math.round(d+e/2)+n,c=Math.round(i/2-c)+r,{x0:a,y0:l,x1:d,y1:c}}(r,t,e,i,n),h=s.x0,a=s.y0,l=s.x1,d=s.y1,c=o.createLinearGradient(h,a,l,d),f=r.match(/linear-gradient\((.+)\)/)[1],u=R(f.substring(f.indexOf(",")+1)),p=0;pt.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function C(t){return"number"==typeof t}function D(t){return"auto"===t||null===t}function $(t){return/%$/.test(t)}var Y=p,U=u,N=f,X=g,_=y,q=w,G=m;function V(t){return t.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}))}function J(t,e){var i,n,o=function(t){var e=t.match(/([a-z]+)/)[1];return[e,V(t.split(e)[1])]}(t),s=o[0],h=o[1],a=e.split(" ");if(h)return(i={})[s+h]=e,i;if(a.length&&!h){var l=a[0],d=a[1],c=a[2],f=a[3];return(n={})[s+r[0]]=l,n[s+r[1]]=d||l,n[s+r[2]]=c||l,n[s+r[3]]=f||d||l,n}}function Q(t){t=t.trim();for(var e=new Array,i="+",n="",r=t.length,o=0;o0;)"("===t[h+=1]&&(s+=1),")"===t[h]&&(s-=1);n="".concat(Q(t.slice(o+1,h))),o=h}if(isNaN(Number(t[o]))&&"."!==t[o]||o===r-1){var a=parseFloat(n);switch(i){case"+":e.push(a);break;case"-":e.push(-a);break;case"*":e.push(e.pop()*a);break;case"/":e.push(e.pop()/a)}i=t[o],n=""}}for(var l=0;e.length;)l+=e.pop();return l}var Z,K=0,et=function(){function t(){F(this,"elements",[]),F(this,"afterElements",[]),F(this,"beforeElements",[]),F(this,"ids",[]),F(this,"width",0),F(this,"height",0),F(this,"top",0),F(this,"left",0),F(this,"pre",null),F(this,"offsetX",0),F(this,"offsetY",0),K++,this.id=K}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){if(!this.ids.includes(t.id)){this.ids.push(t.id),this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()}},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.includes(t.id)||(this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t))},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)this[this.key.height]&&(this.container[this.key.lineMaxHeight]=this[this.key.height]=i),this[this.key.width]+=this.getWidth(t.offsetSize);var n=Math.min(this.getWidth(this),!this.getWidth(this.container.contentSize)&&1/0);(this.container[this.key.lineMaxWidth]||0)1)return 0;var e=t.style.alignSelf,i=this.getHeight(this.container.contentSize),n=i-this.getHeight(t.offsetSize);return"flex-end"===e?n:"center"===e?n/2:"stretch"===e?(n&&t.name==f&&(t.style[this.key.width]=this.getWidth(t.offsetSize),t.style[this.key.height]=i,delete t.line,delete t.lines,t.getBoxWidthHeight()),0):0},r.layout=function(t,e){var i=this;this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements.forEach((function(t,e){i.setIndent(t);var n=i.elements[e-1],r=i.getOffsetY(t);t.style[i.key.top]=i[i.key.top]+r,t.style[i.key.left]=n?n.offsetSize[i.key.left]+i.getWidth(n.offsetSize):i[i.key.left],t.getBoxPosition()}))},n}(et),rt=p,ot=u,st=f,ht=v,at=y,lt=b,dt=w,ct=m,ft=0,ut={left:null,top:null,width:null,height:null},pt=new Map,gt=function(){function t(t,e,i,n){var o=this;F(this,"id",ft++),F(this,"style",{left:null,top:null,width:null,height:null}),F(this,"computedStyle",{}),F(this,"originStyle",{}),F(this,"children",{}),F(this,"layoutBox",A({},ut)),F(this,"contentSize",A({},ut)),F(this,"clientSize",A({},ut)),F(this,"borderSize",A({},ut)),F(this,"offsetSize",A({},ut)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.type||t.name,this.attributes=this.getAttributes(t);var s=function(t,e){var i,n=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],o=t.type,s=void 0===o?N:o,h=t.styles,a=void 0===h?{}:h,l=(e||{}).computedStyle,d=Object.assign({},S);if([U,Y,X].includes(s)&&!a.display&&(d.display=_),l)for(var c=0;c=0&&c<0,$=l>=0&&u<0;return i==h[0]&&(this[i].left=t.left+s+v+E+(D?2*-c:0),this[i].top=t.top+l+x+k+($?2*-u:0),this[i].width=t.width+(this[i].widthAdd?0:H),this[i].height=t.height+(this[i].heightAdd?0:C),this[i].widthAdd=H,this[i].heightAdd=C),i==h[1]&&(this[i].left=t.left+s+E+(D<0?-c:0),this[i].top=t.top+l+k+($?-u:0),this[i].width=t.width+v+w,this[i].height=t.height+x+S),i==h[2]&&(this[i].left=t.left+s+E/2+(D<0?-c:0),this[i].top=t.top+l+k/2+($?-u:0),this[i].width=t.width+v+w+E/2+F/2,this[i].height=t.height+x+S+T/2+k/2),i==h[3]&&(this[i].left=t.left+(D<0?-c:0),this[i].top=t.top+($?-u:0),this[i].width=t.width+v+w+E+F+s+c,this[i].height=t.height+x+S+T+k+u+l),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var r=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var o=e||{},s=o.border,a=(s=void 0===s?{}:s).borderWidth,l=void 0===a?0:a,d=o.borderTop,c=(d=void 0===d?{}:d).borderTopWidth,f=void 0===c?l:c,u=o.borderBottom,p=(u=void 0===u?{}:u).borderBottomWidth,g=void 0===p?l:p,v=o.borderRight,y=(v=void 0===v?{}:v).borderRightWidth,x=void 0===y?l:y,b=o.borderLeft,w=(b=void 0===b?{}:b).borderLeftWidth,m=void 0===w?l:w,S=o.padding,z=(S=void 0===S?{}:S).paddingTop,I=void 0===z?0:z,M=S.paddingRight,B=void 0===M?0:M,W=S.paddingBottom,k=void 0===W?0:W,P=S.paddingLeft,O=void 0===P?0:P;i||(t.width-=O+B+x+m),1!==i||n||(t.height-=I+k+f+g)}this.layoutBox&&(h.forEach((function(i){return r.layoutBox[i]=r.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,r=void 0===n?0:n,o=t.top,s=void 0===o?0:o,h=A({},this.contentSize,{left:r,top:s}),a=this.contentSize.top-this.offsetSize.top,l=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var d,c=H(this.root.fixedLine.elements);!(d=c()).done;){var f=d.value;f.setPosition(f,this.root.offsetSize),f.getBoxPosition()}}if(e)for(var u,p=H(e.elements);!(u=p()).done;){var g=u.value,v=A({},this.borderSize,{left:r,top:s});g.setPosition(g,v);var y=this.borderSize.top-this.offsetSize.top,x=this.borderSize.left-this.offsetSize.left;g.style.left+=r+x,g.style.top+=s+y,g.getBoxPosition()}if(i)for(var b,w=H(i);!(b=w()).done;){b.value.layout(h.top+a,h.left+l)}return this.layoutBoxUpdate(h,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&t.style.display==ht},e.isFlex=function(t){return void 0===t&&(t=this),t&&t.style.display==lt},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&(!!t.parent&&(!(!t.parent||t.parent.style.display!==lt)||void 0))},e.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==at},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return{ascent:r,descent:o,width:n,fontHeight:r+o||.7*e+1}},e.getParentSize=function(t,e){if(void 0===t&&(t=this),void 0===e&&(e=!1),t&&t.parent){if(t.parent.contentSize.width)return t.parent.contentSize;if(e)return this.getParentSize(t.parent,e)}return null},e.getBoxWidthHeight=function(){var t=this,e=this.name,i=this.computedStyle,n=this.attributes,r=this.parent,o=void 0===r?{}:r,s=this.ctx,h=this.getChildren(),a=i.left,l=void 0===a?0:a,d=i.top,c=void 0===d?0:d,f=i.bottom,u=i.right,p=i.width,g=void 0===p?0:p,v=i.minWidth,y=i.maxWidth,x=i.minHeight,b=i.maxHeight,w=i.height,m=void 0===w?0:w,S=i.fontSize,z=i.fontWeight,I=i.fontFamily,M=i.fontStyle,B=i.position;i.textIndent;var W=i.lineClamp,P=i.lineHeight,O=i.padding,T=void 0===O?{}:O,L=i.margin,R=void 0===L?{}:L,F=i.border,A=(F=void 0===F?{}:F).borderWidth,j=void 0===A?0:A,E=i.borderRight,H=(E=void 0===E?{}:E).borderRightWidth,C=void 0===H?j:H,Y=i.borderLeft,U=(Y=void 0===Y?{}:Y).borderLeftWidth,N=void 0===U?j:U,X=o.contentSize&&o.contentSize.width,_=o.contentSize&&o.contentSize.height;if($(g)&&X&&(g=k(g,X)),$(g)&&!X&&(g=null),$(m)&&_&&(m=k(m,_)),$(m)&&!_&&(m=null),$(v)&&X&&(v=k(v,X)),$(y)&&X&&(y=k(y,X)),$(x)&&_&&(x=k(x,_)),$(b)&&_&&(b=k(b,_)),i.padding&&X)for(var q in i.padding)Object.hasOwnProperty.call(T,q)&&(T[q]=k(T[q],X));var G=T.paddingRight,V=void 0===G?0:G,J=T.paddingLeft,Q=void 0===J?0:J;if(i.margin&&[R.marginLeft,R.marginRight].includes("auto"))if(g){var Z=X&&X-g-V-Q-N-C||0;R.marginLeft==R.marginRight?R.marginLeft=R.marginRight=Z/2:D(R.marginLeft)?R.marginLeft=Z:R.marginRight=Z}else R.marginLeft=R.marginRight=0;var K=R.marginRight,tt=void 0===K?0:K,it=R.marginLeft,ht={width:g,height:m,left:0,top:0},at=Q+V+N+C+(void 0===it?0:it)+tt;if(this.offsetWidth=at,e==ot&&!this.attributes.widths){var lt=n.text||"";s.save(),s.setFonts({fontFamily:I,fontSize:S,fontWeight:z,fontStyle:M}),lt.length,"\n"==lt&&(lt="",this.isBr=!0),(""+lt).split("\n").map((function(e){var i=Array.from(e).map((function(e){var i=""+(/^[\u4e00-\u9fa5]+$/.test(e)?"cn":e)+I+S+z+M,n=pt.get(i);if(n)return{width:n,text:e};var r=t.measureText(e,S).width;return pt.set(i,r),{width:r,text:e}})),n=t.measureText(e,S),r=n.fontHeight,o=n.ascent,s=n.descent;t.attributes.fontHeight=r,t.attributes.ascent=o,t.attributes.descent=s,t.attributes.widths||(t.attributes.widths=[]),t.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e.width}),0)})})),s.restore()}if(e==rt&&null==g){var ct=n.width,ft=n.height;ht.width=this.contrastSize(Math.round(ct*m/ft)||0,v,y),this.layoutBoxUpdate(ht,i,0)}if(e==ot&&null==g){var ut=this.attributes.widths,gt=Math.max.apply(Math,ut.map((function(t){return t.total})));if(o&&X>0&&(gt>X||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed)gt=X;ht.width=this.contrastSize(gt,v,y),this.layoutBoxUpdate(ht,i,0)}if(e==ot&&(o.style.flex||!this.attributes.lines)){var vt=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e.width>ht.width?(vt++,e.width):t+e.width}),0)})),vt=W&&vt>W?W:vt,this.attributes.lines=vt}if(e==rt&&null==m){var yt=n.width,xt=n.height;n.text,ht.height=this.contrastSize(k(ht.width*xt/yt)||0,x,b),this.layoutBoxUpdate(ht,i,1)}e==ot&&null==m&&(P=k(P,S),ht.height=this.contrastSize(k(this.attributes.lines*P),x,b),this.layoutBoxUpdate(ht,i,1,!0)),!g&&o&&o.children&&X&&(!this.isFlex(o)||o.isFlexCalc)&&([st,ot].includes(e)&&this.isFlex()||e==st&&this.isBlock(this)&&this.isInFlow())&&(ht.width=this.contrastSize(X-(o.isFlexCalc?0:at),v,y),this.layoutBoxUpdate(ht,i)),g&&!$(g)&&(ht.width=this.contrastSize(g,v,y),this.layoutBoxUpdate(ht,i,0)),m&&!$(m)&&(ht.height=this.contrastSize(ht.height,x,b),this.layoutBoxUpdate(ht,i,1));var bt=0;if(h.length){var wt=null,mt=!1;h.forEach((function(e,n){e.getBoxWidthHeight();var r=h[n+1];if(r&&r.isInFlow()&&(e.next=r),!t.line||!t.line.ids.includes(e.id))if(e.isInFlow()&&!e.inFlexBox()){var o=t.getBoxState(wt,e);if(e.isBr)return mt=!0;t.line&&t.line.canIEnter(e)&&!o&&!mt?t.line.add(e):(mt=!1,(new et).bind(e)),wt=e}else e.inFlexBox()?t.line&&(t.line.canIEnter(e)||"nowrap"==i.flexWrap)?t.line.add(e):(new nt).bind(e):e.isFixed?t.root.fixedLine?t.root.fixedLine.fixedAdd(e):(new et).fixedBind(e):t.fixedLine?t.fixedLine.fixedAdd(e):(new et).fixedBind(e,1)})),this.lines&&(bt=this.lines.reduce((function(t,e){return t+e.height}),0))}var St=0,zt=0;if(!g&&(this.isAbsolute||this.isFixed)&&X){var It=B==dt?X:this.root.width,Mt=It-($(l)?k(l,It):l)-($(u)?k(u,It):u);St=i.left?Mt:this.lineMaxWidth}if(!m&&(null!=c?c:this.isAbsolute||this.isFixed&&_)){var Bt=B==dt?_:this.root.height,Wt=Bt-($(c)?k(c,Bt):c)-($(f)?k(f,Bt):f);zt=i.top?Wt:0}if(g&&!$(g)||ht.width||(ht.width=St||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?X||o.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,v,y),this.layoutBoxUpdate(ht,i,0)),m||!bt&&!zt||(ht.height=zt||this.contrastSize(bt,x,b),this.layoutBoxUpdate(ht,i)),i.borderRadius&&this.borderSize&&this.borderSize.width)for(var q in i.borderRadius)Object.hasOwnProperty.call(i.borderRadius,q)&&(i.borderRadius[q]=k(i.borderRadius[q],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.root.contentSize=this.contentSize,this.getBoxPosition(),this.offsetSize},t}(),vt=p,yt=u,xt=g,bt=f,wt=d.TOP,mt=d.MIDDLE,St=d.BOTTOM,zt=c.LEFT,It=c.CENTER,Mt=c.RIGHT,Bt=function(){function r(t){var e,i,r=this;this.v="1.9.5.1",this.id=null,this.pixelRatio=1,this.width=0,this.height=0,this.sleep=1e3/30,this.count=0,this.isRate=!1,this.isDraw=!0,this.isCache=!0,this.fixed="",this.useCORS=!1,this.performance=!1,this.imageBus=[],this.createImage=function(t,e){return new Promise((function(i,n){var o=null;window||r.canvas.createImage?(o=r.canvas&&r.canvas.createImage?r.canvas.createImage():new Image,e&&o.setAttribute("crossOrigin","Anonymous"),o.src=t,o.onload=function(){i({width:o.naturalWidth||o.width,height:o.naturalHeight||o.height,path:o,src:this.src})},o.onerror=function(t){n(t)}):n({fail:"getImageInfo fail",src:t})}))},this.options=t,Object.assign(this,t),this.ctx=(e=t.context,i={get:function(t,i){if("setFonts"===i)return function(t){var i=t.fontFamily,r=void 0===i?"sans-serif":i,o=t.fontSize,s=void 0===o?14:o,h=t.fontWeight,a=void 0===h?"normal":h,l=t.fontStyle,d=void 0===l?"normal":l;I==n.MP_TOUTIAO&&(a="bold"==a?"bold":"",d="italic"==d?"italic":""),e.font="".concat(d," ").concat(a," ").concat(Math.round(s),"px ").concat(r)};if(!e.draw||!e.setFillStyle){if("setFillStyle"===i)return function(t){e.fillStyle=t};if("setStrokeStyle"===i)return function(t){e.strokeStyle=t};if("setLineWidth"===i)return function(t){e.lineWidth=t};if("setLineCap"===i)return function(t){e.lineCap=t};if("setFontSize"===i)return function(t){e.font="".concat(String(t),"px sans-serif")};if("setGlobalAlpha"===i)return function(t){e.globalAlpha=t};if("setLineJoin"===i)return function(t){e.lineJoin=t};if("setTextAlign"===i)return function(t){e.textAlign=t};if("setMiterLimit"===i)return function(t){e.miterLimit=t};if("setShadow"===i)return function(t,i,n,r){e.shadowOffsetX=t,e.shadowOffsetY=i,e.shadowBlur=n,e.shadowColor=r};if("setTextBaseline"===i)return function(t){e.textBaseline=t};if("createCircularGradient"===i)return function(){};if("draw"===i)return function(){};if("function"==typeof e[i])return function(){for(var t=[],n=0;n=s||n==l&&o=s)&&(h=e.width/i.width);var d=i.width*h,c=i.height*h,f=r||[],u=f[0],p=f[1],g=O(u)?k(u,e.width):(e.width-d)*(P(u)?k(u,1):{left:0,center:.5,right:1}[u||"center"]),v=O(p)?k(p,e.height):(e.height-c)*(P(p)?k(p,1):{top:0,center:.5,bottom:1}[p||"center"]),y=function(t,e){return[(t-g)/h,(e-v)/h]},x=y(0,0),b=x[0],w=x[1],m=y(e.width,e.height),S=m[0],z=m[1],I=Math.max,M=Math.min;return{sx:I(b,0),sy:I(w,0),sw:M(S-b,i.width),sh:M(z-w,i.height),dx:I(g,0),dy:I(v,0),dw:M(d,e.width),dh:M(c,e.height)}}({objectFit:u,objectPosition:v},r.contentSize,t),o=i.sx,s=i.sy,h=i.sh,a=i.sw,l=i.dx,d=i.dy,c=i.dh,f=i.dw;I==n.MP_BAIDU?e.drawImage(t.src,l+m,d+S,f,c,o,s,a,h):e.drawImage(t.src,o,s,a,h,l+m,d+S,f,c)}else e.drawImage(t.src,m,S,b,w)},W=function(){e.restore(),L.drawView(r,o,!1,!0,!1),a(1)},T=function(t){B(t),W()},T(t),[2]}))}))}))];case 1:return a.sent(),[2]}}))}))},r.prototype.drawText=function(t,e,i,n){var r=this,o=this.ctx,s=e.borderSize,h=e.contentSize,a=e.left,l=e.top,d=h.width,c=h.height,f=h.left-s.left||0,u=h.top-s.top||0,p=i.color,g=i.lineHeight,v=i.fontSize,y=i.fontWeight,x=i.fontFamily,b=i.fontStyle,w=i.textIndent,m=void 0===w?0:w,S=i.textAlign,z=i.textStroke,I=i.verticalAlign,M=void 0===I?mt:I,B=i.backgroundColor,P=i.lineClamp,O=i.backgroundClip,T=i.textShadow,L=i.textDecoration;if(m=W(m)?m:0,this.drawView(e,i,O!=yt),g=k(g,v),t){o.save(),a+=f,l+=u;var R=n.fontHeight,F=n.descent,A=void 0===F?0:F,j=n.ascent,E=A+(void 0===j?0:j);switch(o.setFonts({fontFamily:x,fontSize:v,fontWeight:y,fontStyle:b}),o.setTextBaseline(mt),o.setTextAlign(S),O?this.setBackground(B,d,c,a,l):o.setFillStyle(p),S){case zt:break;case It:a+=.5*d;break;case Mt:a+=d}var H=n.lines*g,C=Math.ceil((c-H)/2);switch(C<0&&(C=0),M){case wt:break;case mt:l+=C;break;case St:l+=2*C}var D=(g-R)/2,$=g/2,Y=function(t){var e=o.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,r=e.actualBoundingBoxAscent;return M==wt?{fix:E?void 0===r?0:r:$-D/2,lineY:E?0:D-D/2}:M==mt?{fix:E?$+n/4:$,lineY:E?0:D}:M==St?{fix:E?g-n:$+D/2,lineY:E?2*D:D+D/2}:{fix:0,height:0,lineY:0}},U=function(t,e,i){var r=t;switch(S){case zt:r+=i;break;case It:r=(t-=i/2)+i;break;case Mt:r=t,t-=i}if(L){o.setLineWidth(v/13),o.beginPath();var s=.1*n.fontHeight;/\bunderline\b/.test(L)&&(o.moveTo(t,e+n.fontHeight+s),o.lineTo(r,e+n.fontHeight+s)),/\boverline\b/.test(L)&&(o.moveTo(t,e-s),o.lineTo(r,e-s)),/\bline-through\b/.test(L)&&(o.moveTo(t,e+.5*n.fontHeight),o.lineTo(r,e+.5*n.fontHeight)),o.closePath(),o.setStrokeStyle(p),o.stroke()}},N=function(t,e,i){var n=function(){o.setLineWidth(z.width),o.setStrokeStyle(z.color),o.strokeText(t,e,i)},s="outset";z&&z.type!==s?(o.save(),r.setShadow({boxShadow:T}),o.fillText(t,e,i),o.restore(),n()):z&&z.type==s?(o.save(),r.setShadow({boxShadow:T}),n(),o.restore(),o.save(),o.fillText(t,e,i),o.restore()):(r.setShadow({boxShadow:T}),o.fillText(t,e,i))};if(!n.widths||1==n.widths.length&&n.widths[0].total+m<=h.width){var X=Y(t),_=X.fix,q=void 0===_?0:_,G=X.lineY;return N(t,a+m,l+q),U(a+m,l+G,n&&n.widths&&n.widths[0].total||n.text),l+=g,o.restore(),void this.setBorder(e,i)}for(var V=l,J=a,Q="",Z=0,K=o.measureText("...").width,tt=n.widths,et=0;eth.width){Z>=P&&(Q+="…"),Z++,nt=0;var lt=Y(Q);q=lt.fix,G=lt.lineY;N(Q,J,l+q),U(J,l+G,nt),l+=g,Q=""}else if(rt==it.length-1){et!=tt.length-1&&Z==P&&K+ntV+c||Z>P)break}}o.restore()}},r.prototype.source=function(t){return e(this,void 0,void 0,(function(){var e,n,r,o,s=this;return i(this,(function(i){switch(i.label){case 0:if(this.node=null,e=+new Date,"{}"==JSON.stringify(t))return[2];if(!t.type)for(n in t.type=bt,t.styles=t.styles||t.css||{},t)["views","children","type","css","styles"].includes(n)||(t.styles[n]=t[n],delete t[n]);return t.styles.boxSizing||(t.styles.boxSizing="border-box"),[4,this.create(t)];case 1:return(r=i.sent())?(o=r.layout()||{},this.size=o,this.node=r,this.onEffectFinished().then((function(t){return s.lifecycle("onEffectSuccess",t)})).catch((function(t){return s.lifecycle("onEffectFail",t)})),this.performance&&console.log("布局用时:"+(+new Date-e)+"ms"),[2,this.size]):[2,console.warn("no node")]}}))}))},r.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},r.prototype.create=function(n,r){return e(this,void 0,void 0,(function(){function e(i,n,r){void 0===n&&(n={}),void 0===r&&(r=!0);var o=[];return i.forEach((function(i){var s=i.styles,h=void 0===s?{}:s,a=i.children,l=void 0===a?[]:a,d=i.text,c=void 0===d?"":d,f=i.type,u=void 0===f?"":f,p={};p=t(r?t({},n):{},h);var g={},v={},y={};Object.keys(p).map((function(t){if(t.includes("padding")||t.includes("margin")){var e=J(t,p[t]);Object.keys(e).map((function(t){t.includes("Left")?v[t]=e[t]:t.includes("Right")?y[t]=e[t]:g[t]=e[t]}))}}));if(p.textIndent&&(v.textIndent=p.textIndent,delete n.textIndent),""!==c){var x=Array.from(c);x.forEach((function(t,e){var i=Object.assign({},p,g);0===e?Object.assign(i,v):e==x.length-1&&Object.assign(i,y),delete i.padding,delete i.margin,o.push({type:"text",text:t,styles:i})}))}if(u==vt||u==xt)o.push(i);else if("block"===h.display&&l.length>0){var b=e(l,p,!1);i.children=b,i.flattened=!0,o.push(i)}else if(l.length>0){b=e(l,p,r);o=o.concat(b)}})),o}var o,s,h,a,l,d,c,f,u,p,g,v,y,b,w,m,S,z,I,M,B;return i(this,(function(i){switch(i.label){case 0:if(!n)return[2];if(n.styles||(n.styles=n.css||{}),o=n.type,s=o==vt,h=[yt,xt].includes(o),a="textBox"==o,l=n.styles||{},d=l.backgroundImage,c=l.display,s&&!n.src&&!n.url)return[2];if(c==x)return[2];if(h||a){if(f=n.children,!n.text&&(!f||f&&!f.length))return[2];f&&f.length&&!n.flattened&&(u=e(n.children),n.type="view",n.children=u)}if(!(s||n.type==bt&&d))return[3,4];p=s?n.src:"",g=/url\(['"]?(.*?)['"]?\)/.exec(d),d&&g&&g[1]&&(p=g[1]||""),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.getImageInfo(p)];case 2:return v=i.sent(),y=v.width,b=v.height,!(w=v.path)&&s?[2]:(w&&(n.attributes=Object.assign(n.attributes||{},{width:y,height:b,path:w,src:w,naturalSrc:p})),[3,4]);case 3:return m=i.sent(),n.type!=bt?[2]:(this.lifecycle("onEffectFail",t(t({},m),{src:p})),[3,4]);case 4:if(this.count+=1,S=new gt(n,r,this.root,this.ctx),!(z=n.views||n.children))return[3,8];I=0,i.label=5;case 5:return I /^data:image\/(\w+);base64/.test(path); -export function sleep(delay) { - return new Promise(resolve => setTimeout(resolve, delay)) -} -let {platform, SDKVersion} = uni.getSystemInfoSync() -export const isPC = /windows|mac/.test(platform) -// 缓存图片 -let cache = {} -export function isNumber(value) { - return /^-?\d+(\.\d+)?$/.test(value); -} -export function toPx(value, baseSize, isDecimal = false) { - // 如果是数字 - if (typeof value === 'number') { - return value - } - // 如果是字符串数字 - if (isNumber(value)) { - return value * 1 - } - // 如果有单位 - if (typeof value === 'string') { - const reg = /^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g - const results = reg.exec(value); - if (!value || !results) { - return 0; - } - const unit = results[3]; - value = parseFloat(value); - let res = 0; - if (unit === 'rpx') { - res = uni.upx2px(value); - } else if (unit === 'px') { - res = value * 1; - } else if (unit === '%') { - res = value * toPx(baseSize) / 100; - } else if (unit === 'em') { - res = value * toPx(baseSize || 14); - } - return isDecimal ? res.toFixed(2) * 1 : Math.round(res); - } - return 0 -} - -// 计算版本 -export function compareVersion(v1, v2) { - v1 = v1.split('.') - v2 = v2.split('.') - const len = Math.max(v1.length, v2.length) - while (v1.length < len) { - v1.push('0') - } - while (v2.length < len) { - v2.push('0') - } - for (let i = 0; i < len; i++) { - const num1 = parseInt(v1[i], 10) - const num2 = parseInt(v2[i], 10) - - if (num1 > num2) { - return 1 - } else if (num1 < num2) { - return -1 - } - } - return 0 -} - -function gte(version) { - // #ifdef MP-ALIPAY - SDKVersion = my.SDKVersion - // #endif - return compareVersion(SDKVersion, version) >= 0; -} -export function canIUseCanvas2d() { - // #ifdef MP-WEIXIN - return gte('2.9.2'); - // #endif - // #ifdef MP-ALIPAY - return gte('2.7.15'); - // #endif - // #ifdef MP-TOUTIAO - return gte('1.78.0'); - // #endif - return false -} - -// #ifdef MP -export const prefix = () => { - // #ifdef MP-TOUTIAO - return tt - // #endif - // #ifdef MP-WEIXIN - return wx - // #endif - // #ifdef MP-BAIDU - return swan - // #endif - // #ifdef MP-ALIPAY - return my - // #endif - // #ifdef MP-QQ - return qq - // #endif - // #ifdef MP-360 - return qh - // #endif -} -// #endif - - - -/** - * base64转路径 - * @param {Object} base64 - */ -export function base64ToPath(base64) { - const [, format] = /^data:image\/(\w+);base64,/.exec(base64) || []; - - return new Promise((resolve, reject) => { - // #ifdef MP - const fs = uni.getFileSystemManager() - //自定义文件名 - if (!format) { - reject(new Error('ERROR_BASE64SRC_PARSE')) - } - const time = new Date().getTime(); - let pre = prefix() - // #ifdef MP-TOUTIAO - const filePath = `${pre.getEnvInfoSync().common.USER_DATA_PATH}/${time}.${format}` - // #endif - // #ifndef MP-TOUTIAO - const filePath = `${pre.env.USER_DATA_PATH}/${time}.${format}` - // #endif - fs.writeFile({ - filePath, - data: base64.split(',')[1], - encoding: 'base64', - success() { - resolve(filePath) - }, - fail(err) { - console.error(err) - reject(err) - } - }) - // #endif - - // #ifdef H5 - // mime类型 - let mimeString = base64.split(',')[0].split(':')[1].split(';')[0]; - //base64 解码 - let byteString = atob(base64.split(',')[1]); - //创建缓冲数组 - let arrayBuffer = new ArrayBuffer(byteString.length); - //创建视图 - let intArray = new Uint8Array(arrayBuffer); - for (let i = 0; i < byteString.length; i++) { - intArray[i] = byteString.charCodeAt(i); - } - resolve(URL.createObjectURL(new Blob([intArray], { - type: mimeString - }))) - // #endif - - // #ifdef APP-PLUS - const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now()) - bitmap.loadBase64Data(base64, () => { - if (!format) { - reject(new Error('ERROR_BASE64SRC_PARSE')) - } - const time = new Date().getTime(); - const filePath = `_doc/uniapp_temp/${time}.${format}` - bitmap.save(filePath, {}, - () => { - bitmap.clear() - resolve(filePath) - }, - (error) => { - bitmap.clear() - reject(error) - }) - }, (error) => { - bitmap.clear() - reject(error) - }) - // #endif - }) -} - -/** - * 路径转base64 - * @param {Object} string - */ -export function pathToBase64(path) { - if (/^data:/.test(path)) return path - return new Promise((resolve, reject) => { - // #ifdef H5 - let image = new Image(); - image.setAttribute("crossOrigin", 'Anonymous'); - image.onload = function() { - let canvas = document.createElement('canvas'); - canvas.width = this.naturalWidth; - canvas.height = this.naturalHeight; - canvas.getContext('2d').drawImage(image, 0, 0); - let result = canvas.toDataURL('image/png') - resolve(result); - canvas.height = canvas.width = 0 - } - image.src = path + '?v=' + Math.random() - image.onerror = (error) => { - reject(error); - }; - // #endif - - // #ifdef MP - if (uni.canIUse('getFileSystemManager')) { - uni.getFileSystemManager().readFile({ - filePath: path, - encoding: 'base64', - success: (res) => { - resolve('data:image/png;base64,' + res.data) - }, - fail: (error) => { - console.error({error, path}) - reject(error) - } - }) - } - // #endif - - // #ifdef APP-PLUS - plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), (entry) => { - entry.file((file) => { - const fileReader = new plus.io.FileReader() - fileReader.onload = (data) => { - resolve(data.target.result) - } - fileReader.onerror = (error) => { - reject(error) - } - fileReader.readAsDataURL(file) - }, reject) - }, reject) - // #endif - }) -} - - - -export function getImageInfo(path, useCORS) { - const isCanvas2D = this && this.canvas && this.canvas.createImage - return new Promise(async (resolve, reject) => { - // let time = +new Date() - let src = path.replace(/^@\//,'/') - if (cache[path] && cache[path].errMsg) { - resolve(cache[path]) - } else { - try { - // #ifdef MP || APP-PLUS - if (isBase64(path) && (isCanvas2D ? isPC : true)) { - src = await base64ToPath(path) - } - // #endif - // #ifdef H5 - if(useCORS) { - src = await pathToBase64(path) - } - // #endif - } catch (error) { - reject({ - ...error, - src - }) - } - // #ifndef APP-NVUE - if(isCanvas2D && !isPC) { - const img = this.canvas.createImage() - img.onload = function() { - const image = { - path: img, - width: img.width, - height: img.height - } - cache[path] = image - resolve(cache[path]) - } - img.onerror = function(err) { - reject({err,path}) - } - img.src = src - return - } - // #endif - uni.getImageInfo({ - src, - success: (image) => { - const localReg = /^\.|^\/(?=[^\/])/; - // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-TOUTIAO - image.path = localReg.test(src) ? `/${image.path}` : image.path; - // #endif - if(isCanvas2D) { - const img = this.canvas.createImage() - img.onload = function() { - image.path = img - cache[path] = image - resolve(cache[path]) - } - img.onerror = function(err) { - reject({err,path}) - } - img.src = src - return - } - // #ifdef APP-PLUS - // console.log('getImageInfo', +new Date() - time) - // ios 比较严格 可能需要设置跨域 - if(uni.getSystemInfoSync().osName == 'ios' && useCORS) { - pathToBase64(image.path).then(base64 => { - image.path = base64 - cache[path] = image - resolve(cache[path]) - }).catch(err => { - console.error({err, path}) - reject({err,path}) - }) - return - } - // #endif - cache[path] = image - resolve(cache[path]) - }, - fail(err) { - console.error({err, path}) - reject({err,path}) - } - }) - } - }) -} - - -// #ifdef APP-PLUS -const getLocalFilePath = (path) => { - if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path - .indexOf('_downloads') === 0) { - return path - } - if (path.indexOf('file://') === 0) { - return path - } - if (path.indexOf('/storage/emulated/0/') === 0) { - return path - } - if (path.indexOf('/') === 0) { - const localFilePath = plus.io.convertAbsoluteFileSystem(path) - if (localFilePath !== path) { - return localFilePath - } else { - path = path.substr(1) - } - } - return '_www/' + path -} -// #endif - - diff --git a/uni_modules/lime-painter/components/lime-painter/lime-painter.vue b/uni_modules/lime-painter/components/lime-painter/lime-painter.vue deleted file mode 100644 index f3b614b..0000000 --- a/uni_modules/lime-painter/components/lime-painter/lime-painter.vue +++ /dev/null @@ -1,235 +0,0 @@ - - - - - diff --git a/uni_modules/lime-painter/hybrid/html/index.html b/uni_modules/lime-painter/hybrid/html/index.html deleted file mode 100644 index fdf884e..0000000 --- a/uni_modules/lime-painter/hybrid/html/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/uni_modules/lime-painter/hybrid/html/painter.js b/uni_modules/lime-painter/hybrid/html/painter.js deleted file mode 100644 index de93edb..0000000 --- a/uni_modules/lime-painter/hybrid/html/painter.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Painter={})}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=360&&(s-=360);s<0&&(s+=360);if(0===(s=Math.round(s)))return{x0:Math.round(e/2)+n,y0:i+r,x1:Math.round(e/2)+n,y1:r};if(180===s)return{x0:Math.round(e/2)+n,y0:r,x1:Math.round(e/2)+n,y1:i+r};if(90===s)return{x0:n,y0:Math.round(i/2)+r,x1:e+n,y1:Math.round(i/2)+r};if(270===s)return{x0:e+n,y0:Math.round(i/2)+r,x1:n,y1:Math.round(i/2)+r};var a=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(s===a)return{x0:n,y0:i+r,x1:e+n,y1:r};if(s===180-a)return{x0:n,y0:r,x1:e+n,y1:i+r};if(s===180+a)return{x0:e+n,y0:r,x1:n,y1:i+r};if(s===360-a)return{x0:e+n,y0:i+r,x1:n,y1:r};var h=0,c=0,f=0,d=0;if(s180-a&&s<180||s>180&&s<180+a||s>360-a){var l=s*Math.PI/180,u=s360-a?i/2:-i/2,p=Math.tan(l)*u,g=s180-a&&s<180?e/2-p:-e/2-p;h=-(f=p+(v=Math.pow(Math.sin(l),2)*g)),c=-(d=u+v/Math.tan(l))}if(s>a&&s<90||s>90&&s<90+a||s>180+a&&s<270||s>270&&s<360-a){var v;l=(90-s)*Math.PI/180,p=s>a&&s<90||s>90&&s<90+a?e/2:-e/2,u=Math.tan(l)*p,g=s>a&&s<90||s>270&&s<360-a?i/2-u:-i/2-u;h=-(f=p+(v=Math.pow(Math.sin(l),2)*g)/Math.tan(l)),c=-(d=u+v)}return h=Math.round(h+e/2)+n,c=Math.round(i/2-c)+r,f=Math.round(f+e/2)+n,d=Math.round(i/2-d)+r,{x0:h,y0:c,x1:f,y1:d}}(r,t,e,i,n),a=s.x0,h=s.y0,c=s.x1,f=s.y1,d=o.createLinearGradient(a,h,c,f),l=r.match(/linear-gradient\((.+)\)/)[1],u=q(l.substring(l.indexOf(",")+1)),p=0;pt.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function K(t){return"number"==typeof t}function et(t){return"auto"===t||null===t}function it(t){return/%$/.test(t)}var nt=I,rt=z,ot=S,st=M,at=B,ht=O,ct=T;function ft(t){return t.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}))}function dt(t,e){var i,n,r=function(t){var e=t.match(/([a-z]+)/)[1];return[e,ft(t.split(e)[1])]}(t),o=r[0],s=r[1],a=e.split(" ");if(s)return(i={})[o+s]=e,i;if(a.length&&!s){var h=a[0],c=a[1],f=a[2],l=a[3];return(n={})[o+d[0]]=h,n[o+d[1]]=c||h,n[o+d[2]]=f||h,n[o+d[3]]=l||c||h,n}}function lt(t){t=t.trim();for(var e=new Array,i="+",n="",r=t.length,o=0;o0;)"("===t[a+=1]&&(s+=1),")"===t[a]&&(s-=1);n="".concat(lt(t.slice(o+1,a))),o=a}if(isNaN(Number(t[o]))&&"."!==t[o]||o===r-1){var h=parseFloat(n);switch(i){case"+":e.push(h);break;case"-":e.push(-h);break;case"*":e.push(e.pop()*h);break;case"/":e.push(e.pop()/h)}i=t[o],n=""}}for(var c=0;e.length;)c+=e.pop();return c}var ut,pt=0,gt=function(){function t(){G(this,"elements",[]),G(this,"afterElements",[]),G(this,"beforeElements",[]),G(this,"ids",[]),G(this,"width",0),G(this,"height",0),G(this,"top",0),G(this,"left",0),G(this,"pre",null),G(this,"offsetX",0),G(this,"offsetY",0),pt++,this.id=pt}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){if(!this.ids.includes(t.id)){this.ids.push(t.id),this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()}},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.includes(t.id)||(this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t))},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)this[this.key.height]&&(this.container[this.key.lineMaxHeight]=this[this.key.height]=i),this[this.key.width]+=this.getWidth(t.offsetSize);var n=Math.min(this.getWidth(this),!this.getWidth(this.container.contentSize)&&1/0);(this.container[this.key.lineMaxWidth]||0)1)return 0;var e=t.style.alignSelf,i=this.getHeight(this.container.contentSize),n=i-this.getHeight(t.offsetSize);return e===f?n:e===h?n/2:"stretch"===e?(n&&t.name==S&&(t.style[this.key.width]=this.getWidth(t.offsetSize),t.style[this.key.height]=i,delete t.line,delete t.lines,t.getBoxWidthHeight()),0):0},r.layout=function(t,e){var i=this;this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements.forEach((function(t,e){i.setIndent(t);var n=i.elements[e-1],r=i.getOffsetY(t);t.style[i.key.top]=i[i.key.top]+r,t.style[i.key.left]=n?n.offsetSize[i.key.left]+i.getWidth(n.offsetSize):i[i.key.left],t.getBoxPosition()}))},n}(gt),wt=I,mt=z,St=S,zt=k,It=B,Mt=P,kt=O,Bt=T,Wt=0,Pt={left:null,top:null,width:null,height:null},Ot=new Map,Tt=function(){function t(t,e,i,n){var r=this;G(this,"id",Wt++),G(this,"style",{left:null,top:null,width:null,height:null}),G(this,"computedStyle",{}),G(this,"originStyle",{}),G(this,"children",{}),G(this,"layoutBox",V({},Pt)),G(this,"contentSize",V({},Pt)),G(this,"clientSize",V({},Pt)),G(this,"borderSize",V({},Pt)),G(this,"offsetSize",V({},Pt)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.type||t.name,this.attributes=this.getAttributes(t);var o=function(t,e){var i,n=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],r=t.type,o=void 0===r?ot:r,s=t.styles,h=void 0===s?{}:s,c=(e||{}).computedStyle,f=Object.assign({},F);if([rt,nt,st].includes(o)&&!h.display&&(f.display=at),c)for(var l=0;l=0&&f<0,$=h>=0&&l<0;return i==y[0]&&(this[i].left=t.left+s+g+j+(D?2*-f:0),this[i].top=t.top+h+b+W+($?2*-l:0),this[i].width=t.width+(this[i].widthAdd?0:C),this[i].height=t.height+(this[i].heightAdd?0:H),this[i].widthAdd=C,this[i].heightAdd=H),i==y[1]&&(this[i].left=t.left+s+j+(D<0?-f:0),this[i].top=t.top+h+W+($?-l:0),this[i].width=t.width+g+w,this[i].height=t.height+b+S),i==y[2]&&(this[i].left=t.left+s+j/2+(D<0?-f:0),this[i].top=t.top+h+W/2+($?-l:0),this[i].width=t.width+g+w+j/2+F/2,this[i].height=t.height+b+S+T/2+W/2),i==y[3]&&(this[i].left=t.left+(D<0?-f:0),this[i].top=t.top+($?-l:0),this[i].width=t.width+g+w+j+F+s+f,this[i].height=t.height+b+S+T+W+l+h),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var r=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var o=e||{},s=o.border,a=(s=void 0===s?{}:s).borderWidth,h=void 0===a?0:a,c=o.borderTop,f=(c=void 0===c?{}:c).borderTopWidth,d=void 0===f?h:f,l=o.borderBottom,u=(l=void 0===l?{}:l).borderBottomWidth,p=void 0===u?h:u,g=o.borderRight,v=(g=void 0===g?{}:g).borderRightWidth,b=void 0===v?h:v,x=o.borderLeft,w=(x=void 0===x?{}:x).borderLeftWidth,m=void 0===w?h:w,S=o.padding,z=(S=void 0===S?{}:S).paddingTop,I=void 0===z?0:z,M=S.paddingRight,k=void 0===M?0:M,B=S.paddingBottom,W=void 0===B?0:B,P=S.paddingLeft,O=void 0===P?0:P;i||(t.width-=O+k+b+m),1!==i||n||(t.height-=I+W+d+p)}this.layoutBox&&(y.forEach((function(i){return r.layoutBox[i]=r.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,r=void 0===n?0:n,o=t.top,s=void 0===o?0:o,a=V({},this.contentSize,{left:r,top:s}),h=this.contentSize.top-this.offsetSize.top,c=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var f,d=Z(this.root.fixedLine.elements);!(f=d()).done;){var l=f.value;l.setPosition(l,this.root.offsetSize),l.getBoxPosition()}}if(e)for(var u,p=Z(e.elements);!(u=p()).done;){var g=u.value,v=V({},this.borderSize,{left:r,top:s});g.setPosition(g,v);var y=this.borderSize.top-this.offsetSize.top,b=this.borderSize.left-this.offsetSize.left;g.style.left+=r+b,g.style.top+=s+y,g.getBoxPosition()}if(i)for(var x,w=Z(i);!(x=w()).done;){x.value.layout(a.top+h,a.left+c)}return this.layoutBoxUpdate(a,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&t.style.display==zt},e.isFlex=function(t){return void 0===t&&(t=this),t&&t.style.display==Mt},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&(!!t.parent&&(!(!t.parent||t.parent.style.display!==Mt)||void 0))},e.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==It},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return{ascent:r,descent:o,width:n,fontHeight:r+o||.7*e+1}},e.getParentSize=function(t,e){if(void 0===t&&(t=this),void 0===e&&(e=!1),t&&t.parent){if(t.parent.contentSize.width)return t.parent.contentSize;if(e)return this.getParentSize(t.parent,e)}return null},e.getBoxWidthHeight=function(){var t=this,e=this.name,i=this.computedStyle,n=this.attributes,r=this.parent,o=void 0===r?{}:r,s=this.ctx,a=this.getChildren(),h=i.left,c=void 0===h?0:h,f=i.top,d=void 0===f?0:f,l=i.bottom,u=i.right,p=i.width,g=void 0===p?0:p,v=i.minWidth,y=i.maxWidth,b=i.minHeight,x=i.maxHeight,w=i.height,m=void 0===w?0:w,S=i.fontSize,z=i.fontWeight,I=i.fontFamily,M=i.fontStyle,k=i.position;i.textIndent;var B=i.lineClamp,W=i.lineHeight,P=i.padding,O=void 0===P?{}:P,T=i.margin,L=void 0===T?{}:T,R=i.border,F=(R=void 0===R?{}:R).borderWidth,A=void 0===F?0:F,E=i.borderRight,j=(E=void 0===E?{}:E).borderRightWidth,C=void 0===j?A:j,H=i.borderLeft,D=(H=void 0===H?{}:H).borderLeftWidth,$=void 0===D?A:D,U=o.contentSize&&o.contentSize.width,N=o.contentSize&&o.contentSize.height;if(it(g)&&U&&(g=Y(g,U)),it(g)&&!U&&(g=null),it(m)&&N&&(m=Y(m,N)),it(m)&&!N&&(m=null),it(v)&&U&&(v=Y(v,U)),it(y)&&U&&(y=Y(y,U)),it(b)&&N&&(b=Y(b,N)),it(x)&&N&&(x=Y(x,N)),i.padding&&U)for(var _ in i.padding)Object.hasOwnProperty.call(O,_)&&(O[_]=Y(O[_],U));var X=O.paddingRight,q=void 0===X?0:X,G=O.paddingLeft,V=void 0===G?0:G;if(i.margin&&[L.marginLeft,L.marginRight].includes("auto"))if(g){var J=U&&U-g-q-V-$-C||0;L.marginLeft==L.marginRight?L.marginLeft=L.marginRight=J/2:et(L.marginLeft)?L.marginLeft=J:L.marginRight=J}else L.marginLeft=L.marginRight=0;var Q=L.marginRight,Z=void 0===Q?0:Q,K=L.marginLeft,tt={width:g,height:m,left:0,top:0},nt=V+q+$+C+(void 0===K?0:K)+Z;if(this.offsetWidth=nt,e==mt&&!this.attributes.widths){var rt=n.text||"";s.save(),s.setFonts({fontFamily:I,fontSize:S,fontWeight:z,fontStyle:M}),rt.length,"\n"==rt&&(rt="",this.isBr=!0),(""+rt).split("\n").map((function(e){var i=Array.from(e).map((function(e){var i=""+(/^[\u4e00-\u9fa5]+$/.test(e)?"cn":e)+I+S+z+M,n=Ot.get(i);if(n)return{width:n,text:e};var r=t.measureText(e,S).width;return Ot.set(i,r),{width:r,text:e}})),n=t.measureText(e,S),r=n.fontHeight,o=n.ascent,s=n.descent;t.attributes.fontHeight=r,t.attributes.ascent=o,t.attributes.descent=s,t.attributes.widths||(t.attributes.widths=[]),t.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e.width}),0)})})),s.restore()}if(e==wt&&null==g){var ot=n.width,st=n.height;tt.width=this.contrastSize(Math.round(ot*m/st)||0,v,y),this.layoutBoxUpdate(tt,i,0)}if(e==mt&&null==g){var at=this.attributes.widths,ht=Math.max.apply(Math,at.map((function(t){return t.total})));if(o&&U>0&&(ht>U||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed)ht=U;tt.width=this.contrastSize(ht,v,y),this.layoutBoxUpdate(tt,i,0)}if(e==mt&&(o.style.flex||!this.attributes.lines)){var ct=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e.width>tt.width?(ct++,e.width):t+e.width}),0)})),ct=B&&ct>B?B:ct,this.attributes.lines=ct}if(e==wt&&null==m){var ft=n.width,dt=n.height;n.text,tt.height=this.contrastSize(Y(tt.width*dt/ft)||0,b,x),this.layoutBoxUpdate(tt,i,1)}e==mt&&null==m&&(W=Y(W,S),tt.height=this.contrastSize(Y(this.attributes.lines*W),b,x),this.layoutBoxUpdate(tt,i,1,!0)),!g&&o&&o.children&&U&&(!this.isFlex(o)||o.isFlexCalc)&&([St,mt].includes(e)&&this.isFlex()||e==St&&this.isBlock(this)&&this.isInFlow())&&(tt.width=this.contrastSize(U-(o.isFlexCalc?0:nt),v,y),this.layoutBoxUpdate(tt,i)),g&&!it(g)&&(tt.width=this.contrastSize(g,v,y),this.layoutBoxUpdate(tt,i,0)),m&&!it(m)&&(tt.height=this.contrastSize(tt.height,b,x),this.layoutBoxUpdate(tt,i,1));var lt=0;if(a.length){var ut=null,pt=!1;a.forEach((function(e,n){e.getBoxWidthHeight();var r=a[n+1];if(r&&r.isInFlow()&&(e.next=r),!t.line||!t.line.ids.includes(e.id))if(e.isInFlow()&&!e.inFlexBox()){var o=t.getBoxState(ut,e);if(e.isBr)return pt=!0;t.line&&t.line.canIEnter(e)&&!o&&!pt?t.line.add(e):(pt=!1,(new gt).bind(e)),ut=e}else e.inFlexBox()?t.line&&(t.line.canIEnter(e)||"nowrap"==i.flexWrap)?t.line.add(e):(new xt).bind(e):e.isFixed?t.root.fixedLine?t.root.fixedLine.fixedAdd(e):(new gt).fixedBind(e):t.fixedLine?t.fixedLine.fixedAdd(e):(new gt).fixedBind(e,1)})),this.lines&&(lt=this.lines.reduce((function(t,e){return t+e.height}),0))}var vt=0,yt=0;if(!g&&(this.isAbsolute||this.isFixed)&&U){var bt=k==kt?U:this.root.width,zt=bt-(it(c)?Y(c,bt):c)-(it(u)?Y(u,bt):u);vt=i.left?zt:this.lineMaxWidth}if(!m&&(null!=d?d:this.isAbsolute||this.isFixed&&N)){var It=k==kt?N:this.root.height,Mt=It-(it(d)?Y(d,It):d)-(it(l)?Y(l,It):l);yt=i.top?Mt:0}if(g&&!it(g)||tt.width||(tt.width=vt||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?U||o.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,v,y),this.layoutBoxUpdate(tt,i,0)),m||!lt&&!yt||(tt.height=yt||this.contrastSize(lt,b,x),this.layoutBoxUpdate(tt,i)),i.borderRadius&&this.borderSize&&this.borderSize.width)for(var _ in i.borderRadius)Object.hasOwnProperty.call(i.borderRadius,_)&&(i.borderRadius[_]=Y(i.borderRadius[_],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.root.contentSize=this.contentSize,this.getBoxPosition(),this.offsetSize},t}(),Lt=function(){var t,e,i,n,r,o,s=[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28],a=[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177],h=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],c=[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],f=[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175],d=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],l=[],u=[],p=[],g=[],v=[],y=2;function b(t,e){var i;t>e&&(i=t,t=e,e=i),i=e,i*=e,i+=e,i>>=1,g[i+=t]=1}function x(t,i){var n;for(p[t+e*i]=1,n=-2;n<2;n++)p[t+n+e*(i-2)]=1,p[t-2+e*(i+n+1)]=1,p[t+2+e*(i+n)]=1,p[t+n+1+e*(i+2)]=1;for(n=0;n<2;n++)b(t-1,i+n),b(t+1,i-n),b(t-n,i-1),b(t+n,i+1)}function w(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var m=[];function S(t,e,i,n){var r,o,s;for(r=0;re&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,g[i+=t]}function I(t){var i,n,r,o;switch(t){case 0:for(n=0;n>1&1,i=0;i=5&&(i+=3+v[e]-5);for(e=3;et||3*v[e-3]>=4*v[e]||3*v[e+3]>=4*v[e])&&(i+=40);return i}function k(){var t,i,n,r,o,s=0,a=0;for(i=0;ie*e;)h-=e*e,c++;for(s+=10*c,t=0;t1)for(P=s[t],B=e-7;;){for(M=e-7;M>P-3&&(x(M,B),!(M6)for(P=a[t-7],W=17,M=0;M<6;M++)for(B=0;B<3;B++,W--)1&(W>11?t>>W-12:P>>W)?(p[5-M+e*(2-B+e-11)]=1,p[2-B+e-11+e*(5-M)]=1):(b(5-M,2-B+e-11),b(2-B+e-11,5-M));for(B=0;B=(M=r*(i+n)+n)-2&&(O=M-2,t>9&&O--),T=O,t>9){for(l[T+2]=0,l[T+3]=0;T--;)P=l[T],l[T+3]|=255&P<<4,l[T+2]=P>>4;l[2]|=255&O<<4,l[1]=O>>4,l[0]=64|O>>12}else{for(l[T+1]=0,l[T+2]=0;T--;)P=l[T],l[T+2]|=255&P<<4,l[T+1]=P>>4;l[1]|=255&O<<4,l[0]=64|O>>4}for(T=O+3-(t<10);T0;L--)m[L]=m[L]?m[L-1]^d[w(f[m[L]]+T)]:m[L-1];m[0]=d[w(f[m[0]]+T)]}for(T=0;T<=o;T++)m[T]=f[m[T]];for(W=M,B=0,T=0;T>=1)1&B&&(p[e-1-W+8*e]=1,W<6?p[8+e*W]=1:p[8+e*(W+1)]=1);for(W=0;W<7;W++,B>>=1)1&B&&(p[8+e*(e-7+W)]=1,W?p[6-W+8*e]=1:p[7+8*e]=1);return p}(v)},utf16to8:function(t){var e,i,n,r;for(e="",n=t.length,i=0;i=1&&r<=127?e+=t.charAt(i):r>2047?(e+=String.fromCharCode(224|r>>12&15),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|r>>0&63)):(e+=String.fromCharCode(192|r>>6&31),e+=String.fromCharCode(128|r>>0&63));return e},draw:function(t,i,n,r,o){i.drawView(n,r);var s=i.ctx,a=n.contentSize,h=a.width,c=a.height,f=a.left,d=a.top;r.borderRadius,r.backgroundColor;var l=r.color,u=void 0===l?"#000000":l;r.border,n.contentSize.left,n.borderSize.left,n.contentSize.top,n.borderSize.top;if(y=o||y,s){s.save(),i.setOpacity(r),i.setTransform(n,r);var p=Math.min(h,c);t=this.utf16to8(t);var g=this.getFrame(t),v=p/e;s.setFillStyle(u);for(var b=0;b=s||n==c&&o=s)&&(a=e.width/i.width);var f=i.width*a,d=i.height*a,l=r||[],u=l[0],p=l[1],g=N(u)?Y(u,e.width):(e.width-f)*(U(u)?Y(u,1):{left:0,center:.5,right:1}[u||"center"]),v=N(p)?Y(p,e.height):(e.height-d)*(U(p)?Y(p,1):{top:0,center:.5,bottom:1}[p||"center"]),y=function(t,e){return[(t-g)/a,(e-v)/a]},b=y(0,0),x=b[0],w=b[1],m=y(e.width,e.height),S=m[0],z=m[1],I=Math.max,M=Math.min;return{sx:I(x,0),sy:I(w,0),sw:M(S-x,i.width),sh:M(z-w,i.height),dx:I(g,0),dy:I(v,0),dw:M(f,e.width),dh:M(d,e.height)}}({objectFit:u,objectPosition:v},e.contentSize,t),o=n.sx,s=n.sy,a=n.sh,h=n.sw,c=n.dx,f=n.dy,d=n.dh,l=n.dw;C==r.MP_BAIDU?i.drawImage(t.src,c+m,f+S,l,d,o,s,h,a):i.drawImage(t.src,o,s,h,a,c+m,f+S,l,d)}else i.drawImage(t.src,m,S,x,w)},k=function(){i.restore(),W.drawView(e,o,!1,!0,!1),h(1)},B=function(t){M(t),k()},B(t),[2]}))}))}))];case 1:return h.sent(),[2]}}))}))},t.prototype.drawText=function(t,e,i,n){var r=this,o=this.ctx,s=e.borderSize,a=e.contentSize,h=e.left,c=e.top,f=a.width,d=a.height,l=a.left-s.left||0,u=a.top-s.top||0,p=i.color,g=i.lineHeight,v=i.fontSize,y=i.fontWeight,b=i.fontFamily,x=i.fontStyle,w=i.textIndent,m=void 0===w?0:w,S=i.textAlign,z=i.textStroke,I=i.verticalAlign,M=void 0===I?Ct:I,k=i.backgroundColor,B=i.lineClamp,W=i.backgroundClip,P=i.textShadow,O=i.textDecoration;if(m=$(m)?m:0,this.drawView(e,i,W!=Ft),g=Y(g,v),t){o.save(),h+=l,c+=u;var T=n.fontHeight,L=n.descent,R=void 0===L?0:L,F=n.ascent,A=R+(void 0===F?0:F);switch(o.setFonts({fontFamily:b,fontSize:v,fontWeight:y,fontStyle:x}),o.setTextBaseline(Ct),o.setTextAlign(S),W?this.setBackground(k,f,d,h,c):o.setFillStyle(p),S){case Dt:break;case $t:h+=.5*f;break;case Yt:h+=f}var E=n.lines*g,j=Math.ceil((d-E)/2);switch(j<0&&(j=0),M){case jt:break;case Ct:c+=j;break;case Ht:c+=2*j}var C=(g-T)/2,H=g/2,D=function(t){var e=o.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,r=e.actualBoundingBoxAscent;return M==jt?{fix:A?void 0===r?0:r:H-C/2,lineY:A?0:C-C/2}:M==Ct?{fix:A?H+n/4:H,lineY:A?0:C}:M==Ht?{fix:A?g-n:H+C/2,lineY:A?2*C:C+C/2}:{fix:0,height:0,lineY:0}},U=function(t,e,i){var r=t;switch(S){case Dt:r+=i;break;case $t:r=(t-=i/2)+i;break;case Yt:r=t,t-=i}if(O){o.setLineWidth(v/13),o.beginPath();var s=.1*n.fontHeight;/\bunderline\b/.test(O)&&(o.moveTo(t,e+n.fontHeight+s),o.lineTo(r,e+n.fontHeight+s)),/\boverline\b/.test(O)&&(o.moveTo(t,e-s),o.lineTo(r,e-s)),/\bline-through\b/.test(O)&&(o.moveTo(t,e+.5*n.fontHeight),o.lineTo(r,e+.5*n.fontHeight)),o.closePath(),o.setStrokeStyle(p),o.stroke()}},N=function(t,e,i){var n=function(){o.setLineWidth(z.width),o.setStrokeStyle(z.color),o.strokeText(t,e,i)},s="outset";z&&z.type!==s?(o.save(),r.setShadow({boxShadow:P}),o.fillText(t,e,i),o.restore(),n()):z&&z.type==s?(o.save(),r.setShadow({boxShadow:P}),n(),o.restore(),o.save(),o.fillText(t,e,i),o.restore()):(r.setShadow({boxShadow:P}),o.fillText(t,e,i))};if(!n.widths||1==n.widths.length&&n.widths[0].total+m<=a.width){var _=D(t),X=_.fix,q=void 0===X?0:X,G=_.lineY;return N(t,h+m,c+q),U(h+m,c+G,n&&n.widths&&n.widths[0].total||n.text),c+=g,o.restore(),void this.setBorder(e,i)}for(var V=c,J=h,Q="",Z=0,K=o.measureText("...").width,tt=n.widths,et=0;eta.width){Z>=B&&(Q+="…"),Z++,nt=0;var ct=D(Q);q=ct.fix,G=ct.lineY;N(Q,J,c+q),U(J,c+G,nt),c+=g,Q=""}else if(rt==it.length-1){et!=tt.length-1&&Z==B&&K+ntV+d||Z>B)break}}o.restore()}},t.prototype.source=function(t){return i(this,void 0,void 0,(function(){var e,i,r,o,s=this;return n(this,(function(n){switch(n.label){case 0:if(this.node=null,e=+new Date,"{}"==JSON.stringify(t))return[2];if(t.styles=t.styles||t.css||{},!t.type)for(i in t.type=Et,t)["views","children","type","css","styles"].includes(i)||(t.styles[i]=t[i],delete t[i]);return t.styles.boxSizing||(t.styles.boxSizing="border-box"),[4,this.create(t)];case 1:return(r=n.sent())?(o=r.layout()||{},this.size=o,this.node=r,this.onEffectFinished().then((function(t){return s.lifecycle("onEffectSuccess",t)})).catch((function(t){return s.lifecycle("onEffectFail",t)})),this.performance&&console.log("布局用时:"+(+new Date-e)+"ms"),[2,this.size]):[2,console.warn("no node")]}}))}))},t.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},t.prototype.create=function(t,r){return i(this,void 0,void 0,(function(){function i(t,n,r){void 0===n&&(n={}),void 0===r&&(r=!0);var o=[];return t.forEach((function(t){var s=t.styles,a=void 0===s?{}:s,h=t.css,c=void 0===h?{}:h,f=t.children,d=void 0===f?[]:f,l=t.views,u=void 0===l?[]:l,p=t.text,g=void 0===p?"":p,v=t.type,y=void 0===v?"":v;!d&&u&&(t.children=d=u);var b={};b=e(e(r?e({},n):{},a),c);var x={},w={},m={};Object.keys(b).map((function(t){if(t.includes("padding")||t.includes("margin")){var e=dt(t,b[t]);Object.keys(e).map((function(t){t.includes("Left")?w[t]=e[t]:t.includes("Right")?m[t]=e[t]:x[t]=e[t]}))}}));if(b.textIndent&&(w.textIndent=b.textIndent,delete n.textIndent),""!==g){var S=Array.from(g);S.forEach((function(t,e){var i=Object.assign({},b,x);0===e?Object.assign(i,w):e==S.length-1&&Object.assign(i,m),delete i.padding,delete i.margin,o.push({type:"text",text:t,styles:i})}))}if(y==Rt||y==At)o.push(t);else if("block"===a.display&&d.length>0){var z=i(d,b,!1);t.children=z,t.flattened=!0,o.push(t)}else if(d.length>0){z=i(d,b,r);o=o.concat(z)}})),o}var o,s,a,h,c,f,d,l,u,p,g,v,y,b,x,w,m,S,z,I,M,k,B,P;return n(this,(function(n){switch(n.label){case 0:if(!t)return[2];if(t.styles||(t.styles=t.css||{}),o=t.type,s=t.show,a=void 0===s||s,h=o==Rt,c=[Ft,At].includes(o),f="textBox"==o,d=t.styles||{},l=d.backgroundImage,u=d.display,h&&!t.src&&!t.url)return[2];if(u==W||!a)return[2];if(c||f){if(p=t.children,g=t.views,!p&&g&&(t.children=p=g),!t.text&&(!p||p&&!p.length))return[2];p&&p.length&&!t.flattened&&(v=i(t.children||t.views),t.type="view",t.children=v)}if(!(h||t.type==Et&&l))return[3,4];y=h?t.src:"",b=/url\(['"]?(.*?)['"]?\)/.exec(l),l&&b&&b[1]&&(y=b[1]||""),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.getImageInfo(y)];case 2:return x=n.sent(),w=x.width,m=x.height,!(S=x.path)&&h?[2]:(S&&(t.attributes=Object.assign(t.attributes||{},{width:w,height:m,path:S,src:S,naturalSrc:y})),[3,4]);case 3:return z=n.sent(),t.type!=Et?[2]:(this.lifecycle("onEffectFail",e(e({},z),{src:y})),[3,4]);case 4:if(this.count+=1,I=new Tt(t,r,this.root,this.ctx),!(M=t.children||t.views))return[3,8];k=0,n.label=5;case 5:return k0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("navigateTo",{url:encodeURI(n)})},navigateBack:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.delta;r("navigateBack",{delta:parseInt(n)||1})},switchTab:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("switchTab",{url:encodeURI(n)})},reLaunch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("reLaunch",{url:encodeURI(n)})},redirectTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("redirectTo",{url:encodeURI(n)})},getEnv:function(e){o()?e({nvue:!0}):window.plus?e({plus:!0}):e({h5:!0})},postMessage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r("postMessage",e.data||{})}},d=/uni-app/i.test(navigator.userAgent),s=/Html5Plus/i.test(navigator.userAgent),w=/complete|loaded|interactive/;var u=window.my&&navigator.userAgent.indexOf("AlipayClient")>-1;var g=window.swan&&window.swan.webView&&/swan/i.test(navigator.userAgent);var c=window.qq&&window.qq.miniProgram&&/QQ/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var v=window.tt&&window.tt.miniProgram&&/toutiaomicroapp/i.test(navigator.userAgent);var m=window.wx&&window.wx.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var p=window.qa&&/quickapp/i.test(navigator.userAgent);var f=window.ks&&window.ks.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var l=window.tt&&window.tt.miniProgram&&/Lark|Feishu/i.test(navigator.userAgent);var _=window.jd&&window.jd.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);for(var E,b=function(){window.UniAppJSBridge=!0,document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady",{bubbles:!0,cancelable:!0}))},h=[function(e){if(d||s)return window.__dcloud_weex_postMessage||window.__dcloud_weex_?document.addEventListener("DOMContentLoaded",e):window.plus&&w.test(document.readyState)?setTimeout(e,0):document.addEventListener("plusready",e),a},function(e){if(m)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.wx.miniProgram},function(e){if(c)return window.QQJSBridge&&window.QQJSBridge.invoke?setTimeout(e,0):document.addEventListener("QQJSBridgeReady",e),window.qq.miniProgram},function(e){if(u){document.addEventListener("DOMContentLoaded",e);var n=window.my;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(g)return document.addEventListener("DOMContentLoaded",e),window.swan.webView},function(e){if(v)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(p){window.QaJSBridge&&window.QaJSBridge.invoke?setTimeout(e,0):document.addEventListener("QaJSBridgeReady",e);var n=window.qa;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(f)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.ks.miniProgram},function(e){if(l)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(_)return window.JDJSBridgeReady&&window.JDJSBridgeReady.invoke?setTimeout(e,0):document.addEventListener("JDJSBridgeReady",e),window.jd.miniProgram},function(e){return document.addEventListener("DOMContentLoaded",e),a}],y=0;y\s]+))?)*)\s*(\/?)>/; -var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/; -var 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 -// fixed by xxx 将 ins 标签从块级名单中移除 - -var block = makeMap('a,address,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,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,code,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('script,style'); -function HTMLParser(html, handler) { - var index; - var chars; - var match; - var stack = []; - var 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(']*>'), 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 = {}; - var items = str.split(','); - - for (var i = 0; i < items.length; i++) { - obj[items[i]] = true; - } - - return obj; -} - -function removeDOCTYPE(html) { - return html.replace(/<\?xml.*\?>\n/, '').replace(/\n/, '').replace(/\n/, ''); -} - -function parseAttrs(attrs) { - return attrs.reduce(function (pre, attr) { - var value = attr.value; - var name = attr.name; - if (pre[name]) { - pre[name] = pre[name] + " " + value; - } else { - pre[name] = value; - } - - return pre; - }, {}); -} -function convertStyleStringToJSON(styleString) { - var styles = styleString.split(";"); // 通过分号将样式字符串分割为多个样式声明 - var result = {}; - - styles.forEach(function(style) { - var styleParts = style.split(":"); // 通过冒号将样式声明分割为属性和值 - var property = styleParts[0].trim(); - var value = styleParts[1] && styleParts[1].trim(); - - if (property && value) { - result[property] = value; // 将属性和值添加到结果对象中 - } - }); - - return result; -} -function parseHtml(html) { - html = removeDOCTYPE(html); - var stacks = []; - var results = { - node: 'root', - children: [] - }; - HTMLParser(html, { - start: function start(tag, attrs, unary) { - var node = { - name: tag - }; - - if (attrs.length !== 0) { - node.attrs = parseAttrs(attrs); - node.styles = node.attrs.style ? convertStyleStringToJSON(node.attrs.style) : {} - } - - if(!node.type) { - if(inline[node.name] && node.name !== 'img' ) { - node.type = 'text'; - if(node.name == 'br') { - node.text = '\n' - } else if(node.name == 'strong'){ - node.styles.fontWeight = 'bold' - } - } else if(node.name == 'img'){ - node.type = 'image' - node.src = node.attrs.src - } else { - node.type = 'view' - if(['h1','h2','h3','h4','h5','h6'].includes(node.name)) { - node.styles.fontWeight = 'bold' - } - } - } - if (unary) { - var parent = stacks[0] || results; - - if (!parent.children) { - parent.children = []; - } - - parent.children.push(node); - } else { - stacks.unshift(node); - } - }, - end: function end(tag) { - var node = stacks.shift(); - if (node.name !== tag) console.error('invalid state: mismatch end tag'); - if (stacks.length === 0) { - results.children.push(node); - } else { - var parent = stacks[0]; - - if (!parent.children) { - parent.children = []; - } - parent.children.push(node); - } - const isTextBox = node.children && node.children.length > 1 && node.children.every(child => { - return ['text','image'].includes(child.type) - }) - if(isTextBox) { - node.type = 'textBox' - } - }, - chars: function chars(text) { - var node = { - type: 'text', - text: text - }; - - if (stacks.length === 0) { - results.children.push(node); - } else { - var parent = stacks[0]; - - if (!parent.children) { - parent.children = []; - } - - parent.children.push(node); - } - }, - comment: function comment(text) { - var node = { - node: 'comment', - text: text - }; - var parent = stacks[0]; - - if (!parent.children) { - parent.children = []; - } - - parent.children.push(node); - } - }); - return results.children; -} - -export default parseHtml; \ No newline at end of file diff --git a/uni_modules/lime-painter/readme.md b/uni_modules/lime-painter/readme.md deleted file mode 100644 index b05000c..0000000 --- a/uni_modules/lime-painter/readme.md +++ /dev/null @@ -1,961 +0,0 @@ -# Painter 画板 测试版 - -> uniapp 海报画板,更优雅的海报生成方案 -> [查看更多](https://limeui.qcoon.cn/#/painter) - -## 平台兼容 - -| H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ 小程序 | App | -| --- | ---------- | ------------ | ---------- | ---------- | --------- | --- | -| √ | √ | √ | 未测 | √ | √ | √ | - -## 安装 -在市场导入**[海报画板](https://ext.dcloud.net.cn/plugin?id=2389)uni_modules**版本的即可,无需`import` - -## 代码演示 - -### 插件demo -- lime-painter 为 demo -- 位于 uni_modules/lime-painter/components/lime-painter -- 导入插件后直接使用可查看demo -```vue - -``` - - -### 基本用法 - -- 插件提供 JSON 及 Template 的方式绘制海报 -- 参考 css 块状流布局模拟 css schema。 -- 另外flex布局还不是成完善,请谨慎使用,普通的流布局我觉得已经够用了。 - -#### 方式一 Template - -- 提供`l-painter-view`、`l-painter-text`、`l-painter-image`、`l-painter-qrcode`四种类型组件 -- 通过 `css` 属性绘制样式,与 style 使用方式保持一致。 -```html - - //如果使用Template出现顺序错乱,可使用`template` 等所有变量完成再显示 -