parent
3403d6bbae
commit
2bbce67b29
@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>护工管理</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/h5/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/h5/static/js/chunk-vendors.ec1e34c0.js></script><script src=/h5/static/js/index.acd4f5d7.js></script></body></html>
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/h5/static/index.883130ca.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/h5/static/js/chunk-vendors.6295c31d.js></script><script src=/h5/static/js/index.173d8d01.js></script></body></html>
|
||||
|
Before Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 6.2 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["package-packagevideo-pages-videoinfo-videoinfo"],{"08bb":function(t,e,n){"use strict";n("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={name:"topnav",props:{title:{type:String,default:""},hasHome:{type:String,default:"home"}},data:function(){return{}},methods:{toback:function(){uni.navigateBack({delta:0})},tohome:function(){this.$emit("tohome")}}};e.default=i},1304:function(t,e,n){"use strict";n.r(e);var i=n("08bb"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},"26d8":function(t,e,n){var i=n("c86c");e=i(!1),e.push([t.i,"uni-page-body[data-v-a0ee2c06]{padding-top:%?160?%}.content[data-v-a0ee2c06]{padding:%?20?%}.videotitle[data-v-a0ee2c06]{margin-top:%?20?%}",""]),t.exports=e},"4f4f":function(t,e,n){"use strict";var i=n("7192"),a=n.n(i);a.a},5214:function(t,e,n){"use strict";var i=n("9b83"),a=n.n(i);a.a},"6ab8":function(t,e,n){"use strict";n("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("8f30"),a={data:function(){return{item:{},host:""}},onLoad:function(t){this.loadInfo(t.id),this.host=i.HOST},methods:{tohome:function(){uni.navigateTo({url:"../../../../pages/index/index"})},loadInfo:function(t){var e=this;i.request({bindThis:e,api:"manager/get-video/"+t,customLoading:!1,utilSuccess:function(t){e.item=t},utilFail:function(t){}})}}};e.default=a},7192:function(t,e,n){var i=n("8f3c");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("967d").default;a("23d72763",i,!0,{sourceMap:!1,shadowMode:!1})},"76b5":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));var i={topnav:n("bd9e").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("topnav",{attrs:{title:"视频详情"},on:{tohome:function(e){arguments[0]=e=t.$handleEvent(e),t.tohome.apply(void 0,arguments)}}}),n("v-uni-view",{staticClass:"content"},[n("v-uni-video",{staticStyle:{width:"720rpx",height:"330rpx"},attrs:{src:t.host+t.item.video,poster:t.host+t.item.poster,"object-fit":"fill"}}),n("v-uni-view",{staticClass:"videotitle"},[t._v(t._s(t.item.title))])],1)],1)},o=[]},"8f3c":function(t,e,n){var i=n("c86c");e=i(!1),e.push([t.i,".icon-home[data-v-2198d501]{padding-left:%?55?%;font-size:%?42?%}.nav[data-v-2198d501]{height:%?160?%;background-image:linear-gradient(130deg,#52d5a6,#43c9cf);display:flex;align-items:center;padding:%?0?% %?30?%;padding-top:%?48?%;position:fixed;box-sizing:border-box;top:%?0?%;left:0;width:100%;overflow:hidden;z-index:9999;justify-content:space-between}.nav .navLeft[data-v-2198d501]{display:flex}.nav .navTitle[data-v-2198d501]{font-family:SourceHanSansCN-Medium;font-size:%?36?%;color:#fff;letter-spacing:%?0.37?%;line-height:%?50?%;margin-left:%?40?%;font-weight:600}.nav .navLeft .icon-fanhui[data-v-2198d501]{color:#fff;font-size:%?45?%}.navRight[data-v-2198d501]{display:flex;align-items:center}",""]),t.exports=e},"9b83":function(t,e,n){var i=n("26d8");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("967d").default;a("5e72b9e9",i,!0,{sourceMap:!1,shadowMode:!1})},bd9e:function(t,e,n){"use strict";n.r(e);var i=n("d6ee"),a=n("1304");for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("4f4f");var d=n("828b"),c=Object(d["a"])(a["default"],i["b"],i["c"],!1,null,"2198d501",null,!1,i["a"],void 0);e["default"]=c.exports},ca9b:function(t,e,n){"use strict";n.r(e);var i=n("6ab8"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},cd27:function(t,e,n){"use strict";n.r(e);var i=n("76b5"),a=n("ca9b");for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("5214");var d=n("828b"),c=Object(d["a"])(a["default"],i["b"],i["c"],!1,null,"a0ee2c06",null,!1,i["a"],void 0);e["default"]=c.exports},d6ee:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("v-uni-view",{staticClass:"nav"},[n("v-uni-view",{staticClass:"navLeft"},[n("v-uni-view",{staticClass:"back",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toback.apply(void 0,arguments)}}},[n("v-uni-text",{staticClass:"iconfont icon-fanhui"})],1),n("v-uni-view",{staticClass:"navTitle"},[t._v(t._s(t.title))])],1),n("v-uni-view",{staticClass:"navRight"},[t._t("default"),"home"==t.hasHome?n("v-uni-text",{staticClass:"iconfont icon-home iconTop",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.tohome.apply(void 0,arguments)}}}):t._e()],2)],1)],1)},a=[]}}]);
|
||||
@ -1 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["package-packagevideo-pages-videoinfo-videoinfo"],{"0dfb":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));var i={topnav:n("1928").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("topnav",{attrs:{title:"视频详情"},on:{tohome:function(e){arguments[0]=e=t.$handleEvent(e),t.tohome.apply(void 0,arguments)}}}),n("v-uni-view",{staticClass:"content"},[n("v-uni-video",{staticStyle:{width:"720rpx",height:"330rpx"},attrs:{src:t.host+t.item.video,poster:t.host+t.item.poster,"object-fit":"fill"}}),n("v-uni-view",{staticClass:"videotitle"},[t._v(t._s(t.item.title))])],1)],1)},o=[]},1928:function(t,e,n){"use strict";n.r(e);var i=n("61ce"),a=n("c135");for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("fe5f");var f=n("f0c5"),c=Object(f["a"])(a["default"],i["b"],i["c"],!1,null,"2198d501",null,!1,i["a"],void 0);e["default"]=c.exports},"282f":function(t,e,n){var i=n("52f1");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("fcad02c6",i,!0,{sourceMap:!1,shadowMode:!1})},"4c0d":function(t,e,n){var i=n("a6fb");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("627b5d4e",i,!0,{sourceMap:!1,shadowMode:!1})},"52f1":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,".icon-home[data-v-2198d501]{padding-left:%?55?%;font-size:%?42?%}.nav[data-v-2198d501]{height:%?160?%;background-image:linear-gradient(130deg,#52d5a6,#43c9cf);display:flex;align-items:center;padding:%?0?% %?30?%;padding-top:%?48?%;position:fixed;box-sizing:border-box;top:%?0?%;left:0;width:100%;overflow:hidden;z-index:9999;justify-content:space-between}.nav .navLeft[data-v-2198d501]{display:flex}.nav .navTitle[data-v-2198d501]{font-family:SourceHanSansCN-Medium;font-size:%?36?%;color:#fff;letter-spacing:%?0.37?%;line-height:%?50?%;margin-left:%?40?%;font-weight:600}.nav .navLeft .icon-fanhui[data-v-2198d501]{color:#fff;font-size:%?45?%}.navRight[data-v-2198d501]{display:flex;align-items:center}",""]),t.exports=e},"61ce":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("v-uni-view",{staticClass:"nav"},[n("v-uni-view",{staticClass:"navLeft"},[n("v-uni-view",{staticClass:"back",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toback.apply(void 0,arguments)}}},[n("v-uni-text",{staticClass:"iconfont icon-fanhui"})],1),n("v-uni-view",{staticClass:"navTitle"},[t._v(t._s(t.title))])],1),n("v-uni-view",{staticClass:"navRight"},[t._t("default"),"home"==t.hasHome?n("v-uni-text",{staticClass:"iconfont icon-home iconTop",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.tohome.apply(void 0,arguments)}}}):t._e()],2)],1)],1)},a=[]},"7d75":function(t,e,n){"use strict";var i=n("4c0d"),a=n.n(i);a.a},"94e5":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("21db"),a={data:function(){return{item:{},host:""}},onLoad:function(t){this.loadInfo(t.id),this.host=i.HOST},methods:{tohome:function(){uni.navigateTo({url:"../../../../pages/index/index"})},loadInfo:function(t){var e=this;i.request({bindThis:e,api:"manager/get-video/"+t,customLoading:!1,utilSuccess:function(t){e.item=t},utilFail:function(t){}})}}};e.default=a},a6fb:function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,"uni-page-body[data-v-a0ee2c06]{padding-top:%?160?%}.content[data-v-a0ee2c06]{padding:%?20?%}.videotitle[data-v-a0ee2c06]{margin-top:%?20?%}",""]),t.exports=e},ae23:function(t,e,n){"use strict";n.r(e);var i=n("0dfb"),a=n("e023");for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("7d75");var f=n("f0c5"),c=Object(f["a"])(a["default"],i["b"],i["c"],!1,null,"a0ee2c06",null,!1,i["a"],void 0);e["default"]=c.exports},bf47:function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={name:"topnav",props:{title:{type:String,default:""},hasHome:{type:String,default:"home"}},data:function(){return{}},methods:{toback:function(){uni.navigateBack({delta:0})},tohome:function(){this.$emit("tohome")}}};e.default=i},c135:function(t,e,n){"use strict";n.r(e);var i=n("bf47"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},e023:function(t,e,n){"use strict";n.r(e);var i=n("94e5"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},fe5f:function(t,e,n){"use strict";var i=n("282f"),a=n.n(i);a.a}}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,275 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<title></title>
|
||||
<style type="text/css">
|
||||
html,
|
||||
body,
|
||||
canvas {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
background-color: transparent;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<canvas id="lime-signature"></canvas>
|
||||
<script type="text/javascript" src="./uni.webview.1.5.3.js"></script>
|
||||
<script type="text/javascript" src="./signature.js"></script>
|
||||
<script>
|
||||
var signature = null;
|
||||
var timer = null;
|
||||
var isStart = false;
|
||||
var options = null
|
||||
console.log = function(...args) {
|
||||
postMessage(args);
|
||||
};
|
||||
// function stringify(key, value) {
|
||||
// if (typeof value === 'object' && value !== null) {
|
||||
// if (cache.indexOf(value) !== -1) {
|
||||
// return;
|
||||
// }
|
||||
// cache.push(value);
|
||||
// }
|
||||
// return value;
|
||||
// };
|
||||
function checkAndEmitEmptyStatus() {
|
||||
setTimeout(() => {
|
||||
if (signature) {
|
||||
const isEmpty = signature.isEmpty()
|
||||
emit({
|
||||
isEmpty
|
||||
});
|
||||
}
|
||||
}, 0)
|
||||
}
|
||||
|
||||
|
||||
function emit(event, data) {
|
||||
postMessage({
|
||||
event,
|
||||
data: typeof data !== "object" && data !== null ? data : JSON.stringify(data),
|
||||
});
|
||||
// cache = [];
|
||||
}
|
||||
|
||||
function postMessage(data) {
|
||||
uni.postMessage({
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
function update(v = {}) {
|
||||
if (signature) {
|
||||
options = v
|
||||
signature.pen.setOption(v);
|
||||
} else {
|
||||
signature = new Signature.Signature({
|
||||
el: "lime-signature"
|
||||
});
|
||||
canvasEl = signature.canvas.get("el");
|
||||
options = v
|
||||
signature.pen.setOption(v)
|
||||
const width = signature.canvas.get("width");
|
||||
const height = signature.canvas.get("height");
|
||||
canvasEl.addEventListener('touchend', checkAndEmitEmptyStatus)
|
||||
emit({
|
||||
changeSize: {
|
||||
width,
|
||||
height
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function clear() {
|
||||
signature.clear()
|
||||
checkAndEmitEmptyStatus()
|
||||
}
|
||||
|
||||
function undo() {
|
||||
signature.undo()
|
||||
checkAndEmitEmptyStatus()
|
||||
}
|
||||
|
||||
function redo() {
|
||||
signature.redo()
|
||||
checkAndEmitEmptyStatus()
|
||||
}
|
||||
|
||||
function isEmpty() {
|
||||
const isEmpty = signature.isEmpty()
|
||||
emit({
|
||||
isEmpty
|
||||
});
|
||||
}
|
||||
|
||||
function isTransparent(color) {
|
||||
// 判断颜色是否为 transparent
|
||||
if (color === 'transparent') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 判断颜色是否为 rgba 的 a 为 0
|
||||
if (color.startsWith('rgba')) {
|
||||
const regex = /\d+(\.\d+)?/g;
|
||||
const matches = color.match(regex);
|
||||
if (matches !== null) {
|
||||
const alpha = parseFloat(matches[3]);
|
||||
if (alpha === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function mask(param) {
|
||||
clearTimeout(timer);
|
||||
let {
|
||||
destWidth = 0, destHeight = 0
|
||||
} = param
|
||||
let width = this.signature.canvas.get('width')
|
||||
let height = this.signature.canvas.get('height')
|
||||
let canvas = document.createElement('canvas')
|
||||
const ctx = canvas.getContext('2d');
|
||||
const pixelRatio = signature.canvas.get('pixelRatio')
|
||||
canvas.width = width * pixelRatio
|
||||
canvas.height = height * pixelRatio
|
||||
|
||||
this.signature.pen.getMaskedImageData((imageData) => {
|
||||
ctx.putImageData(imageData, 0, 0);
|
||||
if (destWidth && destHeight) {
|
||||
const _canvas = document.createElement('canvas')
|
||||
_canvas.width = destWidth
|
||||
_canvas.height = destHeight
|
||||
const _context = _canvas.getContext('2d')
|
||||
_context.drawImage(canvas, 0, 0, destWidth, destHeight)
|
||||
canvas.remove()
|
||||
canvas = _canvas
|
||||
}
|
||||
const path = canvas.toDataURL();
|
||||
canvas.remove()
|
||||
if (typeof path == "string") {
|
||||
const index = Math.ceil(path.length / 8);
|
||||
for (var i = 0; i < 8; i++) {
|
||||
if (i == 7) {
|
||||
emit({
|
||||
"success": path.substr(i * index, index)
|
||||
});
|
||||
} else {
|
||||
emit({
|
||||
"file": path.substr(i * index, index)
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.error("canvas no data");
|
||||
emit({
|
||||
"fail": "canvas no data"
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function save(param) {
|
||||
// delete param.success;
|
||||
// delete param.fail;
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
let {
|
||||
fileType = 'png', quality = 1, n, destWidth = 0, destHeight = 0
|
||||
} = param
|
||||
const type = `image/${fileType}`.replace(/jpg/, 'jpeg');
|
||||
const {
|
||||
backgroundColor,
|
||||
landscape,
|
||||
boundingBox
|
||||
} = options
|
||||
const flag = backgroundColor || landscape || boundingBox || destWidth && destHeight
|
||||
let path = canvasEl.toDataURL(!flag && type, !flag && quality)
|
||||
if (flag) {
|
||||
let canvas = document.createElement('canvas')
|
||||
const pixelRatio = signature.canvas.get('pixelRatio')
|
||||
let width = signature.canvas.get('width')
|
||||
let height = signature.canvas.get('height')
|
||||
let x = 0
|
||||
let y = 0
|
||||
|
||||
const next = () => {
|
||||
const size = [width, height]
|
||||
if (landscape) {
|
||||
size.reverse()
|
||||
}
|
||||
canvas.width = size[0] * pixelRatio
|
||||
canvas.height = size[1] * pixelRatio
|
||||
const param = [x, y, width, height, 0, 0, width, height].map(item => item * pixelRatio)
|
||||
const context = canvas.getContext('2d')
|
||||
// context.scale(pixelRatio, pixelRatio)
|
||||
if (landscape) {
|
||||
context.translate(0, width * pixelRatio)
|
||||
context.rotate(-Math.PI / 2)
|
||||
}
|
||||
if (backgroundColor && !isTransparent(backgroundColor)) {
|
||||
context.fillStyle = backgroundColor
|
||||
context.fillRect(0, 0, width * pixelRatio, height * pixelRatio)
|
||||
}
|
||||
const drawImage = () => {
|
||||
|
||||
}
|
||||
// param
|
||||
context.drawImage(signature.canvas.get('el'), ...param)
|
||||
if (destWidth && destHeight) {
|
||||
const _canvas = document.createElement('canvas')
|
||||
_canvas.width = destWidth
|
||||
_canvas.height = destHeight
|
||||
const _context = _canvas.getContext('2d')
|
||||
_context.drawImage(canvas, 0, 0, destWidth, destHeight)
|
||||
canvas.remove()
|
||||
canvas = _canvas
|
||||
}
|
||||
path = canvas.toDataURL(type, quality)
|
||||
canvas.remove()
|
||||
}
|
||||
if (boundingBox) {
|
||||
const res = signature.getContentBoundingBox()
|
||||
width = res.width
|
||||
height = res.height
|
||||
x = res.startX
|
||||
y = res.startY
|
||||
next()
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
if (typeof path == "string") {
|
||||
const index = Math.ceil(path.length / 8);
|
||||
for (var i = 0; i < 8; i++) {
|
||||
if (i == 7) {
|
||||
emit({
|
||||
"success": path.substr(i * index, index)
|
||||
});
|
||||
} else {
|
||||
emit({
|
||||
"file": path.substr(i * index, index)
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.error("canvas no data");
|
||||
emit({
|
||||
"fail": "canvas no data"
|
||||
});
|
||||
}
|
||||
}, 30);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue