vislite 0.1.0 → 0.2.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTHORS.txt +6 -6
- package/CHANGELOG +24 -1
- package/LICENSE +20 -20
- package/README.md +53 -38
- package/lib/Canvas/index.umd.js +135 -46
- package/lib/Canvas/index.umd.min.js +7 -3
- package/lib/Cardinal/index.umd.js +6 -2
- package/lib/Cardinal/index.umd.min.js +6 -2
- package/lib/Eoap/index.umd.js +9 -5
- package/lib/Eoap/index.umd.min.js +6 -2
- package/lib/Hermite/index.umd.js +6 -2
- package/lib/Hermite/index.umd.min.js +6 -2
- package/lib/Matrix4/index.umd.js +6 -2
- package/lib/Matrix4/index.umd.min.js +6 -2
- package/lib/Mercator/index.umd.js +42 -0
- package/lib/Mercator/index.umd.min.js +15 -0
- package/lib/OralCanvas/index.es.js +124 -44
- package/lib/OralCanvas/index.es.min.js +7 -3
- package/lib/OralWebGL/index.es.js +567 -0
- package/lib/OralWebGL/index.es.min.js +15 -0
- package/lib/SVG/index.umd.js +16 -5
- package/lib/SVG/index.umd.min.js +7 -3
- package/lib/WebGL/index.umd.js +626 -0
- package/lib/WebGL/index.umd.min.js +15 -0
- package/lib/animation/index.umd.js +6 -2
- package/lib/animation/index.umd.min.js +6 -2
- package/lib/getLoopColors/index.umd.js +6 -2
- package/lib/getLoopColors/index.umd.min.js +6 -2
- package/lib/index.umd.js +1514 -863
- package/lib/index.umd.min.js +7 -3
- package/lib/rotate/index.umd.js +6 -2
- package/lib/rotate/index.umd.min.js +6 -2
- package/lib/ruler/index.umd.js +6 -2
- package/lib/ruler/index.umd.min.js +6 -2
- package/lib/viewHandler/index.umd.js +129 -0
- package/lib/viewHandler/index.umd.min.js +15 -0
- package/miniprogram/ui-canvas/index.js +18 -3
- package/miniprogram/ui-canvas/index.json +4 -4
- package/miniprogram/ui-canvas/index.wxml +4 -4
- package/miniprogram/ui-canvas/index.wxss +5 -5
- package/package/Canvas/index.ts +1 -1
- package/package/Cardinal/index.ts +2 -2
- package/package/Eoap/index.ts +2 -2
- package/package/Hermite/index.ts +2 -2
- package/package/Matrix4/index.ts +2 -2
- package/package/Mercator/index.ts +3 -0
- package/package/OralCanvas/index.ts +1 -1
- package/package/OralWebGL/index.ts +2 -0
- package/package/SVG/index.ts +2 -2
- package/package/WebGL/index.ts +2 -0
- package/package/animation/index.ts +2 -2
- package/package/getLoopColors/index.ts +2 -2
- package/package/index.ts +32 -9
- package/package/rotate/index.ts +2 -2
- package/package/ruler/index.ts +2 -2
- package/package/viewHandler/index.ts +3 -0
- package/package.json +11 -2
- package/src/Canvas.ts +10 -1
- package/src/Eoap.ts +5 -5
- package/src/Matrix4/index.ts +76 -76
- package/src/Matrix4/move.ts +12 -12
- package/src/Matrix4/rotate.ts +15 -15
- package/src/Matrix4/scale.ts +11 -11
- package/src/Matrix4/transform.ts +64 -64
- package/src/Mercator.ts +27 -0
- package/src/SVG.ts +1 -1
- package/src/WebGL.ts +53 -0
- package/src/animation.ts +99 -99
- package/src/common/assemble.ts +23 -0
- package/src/common/canvas/arc.ts +50 -50
- package/src/common/canvas/config.ts +7 -6
- package/src/common/canvas/index.ts +29 -28
- package/src/common/canvas/painter.ts +51 -8
- package/src/common/canvas/texts.ts +19 -0
- package/src/common/setStyle.ts +5 -5
- package/src/common/svg/config.ts +127 -126
- package/src/common/svg/index.ts +13 -3
- package/src/common/svg/tool.ts +43 -42
- package/src/common/webgl/buffer.ts +80 -0
- package/src/common/webgl/doDraw.ts +97 -0
- package/src/common/webgl/getColorFactory.ts +27 -0
- package/src/common/webgl/getShader.ts +62 -0
- package/src/common/webgl/getTexture.ts +12 -0
- package/src/common/webgl/getWebGLContext.ts +28 -0
- package/src/common/webgl/index.ts +212 -0
- package/src/common/webgl/shader.ts +76 -0
- package/src/common/webgl/texture.ts +99 -0
- package/src/getLoopColors.ts +42 -42
- package/src/interpolation/Cardinal.ts +91 -91
- package/src/interpolation/Hermite.ts +65 -65
- package/src/rotate.ts +7 -7
- package/src/ruler.ts +99 -99
- package/src/viewHandler.ts +140 -0
- package/types/Canvas.d.ts +220 -283
- package/types/CanvasConfig.d.ts +81 -0
- package/types/Cardinal.d.ts +13 -13
- package/types/Hermite.d.ts +18 -18
- package/types/Map.d.ts +10 -0
- package/types/Matrix4.d.ts +42 -42
- package/types/Object3D.d.ts +106 -0
- package/types/SVG.d.ts +210 -264
- package/types/SVGConfig.d.ts +59 -0
- package/types/Scene3D.d.ts +7 -0
- package/types/WebGL.d.ts +29 -0
- package/types/animation.d.ts +6 -6
- package/types/getLoopColors.d.ts +2 -2
- package/types/index.d.ts +70 -26
- package/types/rotate.d.ts +2 -2
- package/types/ruler.d.ts +2 -2
- package/types/viewHandler.d.ts +13 -0
- package/uni-app/ui-canvas.vue +94 -20
- package/types/Eoap.d.ts +0 -10
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export default interface SVGConfigType {
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 填充色或图案,默认"#000"
|
|
5
|
+
*/
|
|
6
|
+
fillStyle?: string
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 轮廓色或图案,默认"#000"
|
|
10
|
+
*/
|
|
11
|
+
strokeStyle?: string
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 线条宽度,默认1(单位px)
|
|
15
|
+
*/
|
|
16
|
+
lineWidth?: number
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 文字水平对齐方式,默认"left"左对齐(还有"center"居中和"right"右对齐)
|
|
20
|
+
*/
|
|
21
|
+
textAlign?: string
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 文字垂直对齐方式,默认"middle"垂直居中(还有"top"上对齐和"bottom"下对齐)
|
|
25
|
+
*/
|
|
26
|
+
textBaseline?: string
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 设置线条虚线,默认为[]表示使用实线绘制
|
|
30
|
+
*
|
|
31
|
+
* 值应该是一个数组,格式:[实线长,虚线长,实线长 ...],数组长度任意,会自动循环
|
|
32
|
+
*/
|
|
33
|
+
lineDash?: Array<number>
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 文字大小,默认16
|
|
37
|
+
*/
|
|
38
|
+
"fontSize"?: number
|
|
39
|
+
"font-size"?: number // 向下兼容
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 字体,默认"sans-serif"
|
|
43
|
+
*/
|
|
44
|
+
"fontFamily"?: string
|
|
45
|
+
"font-family"?: string // 向下兼容
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 圆弧开始端闭合方式,默认"butt"直线闭合(还有"round"圆帽闭合,"-round"反圆帽闭合)
|
|
49
|
+
*/
|
|
50
|
+
"arcStartCap"?: string
|
|
51
|
+
"arc-start-cap"?: string // 向下兼容
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 圆弧结束端闭合方式,默认"butt"直线闭合(还有"round"圆帽闭合,"-round"反圆帽闭合)
|
|
55
|
+
*/
|
|
56
|
+
"arcEndCap"?: string
|
|
57
|
+
"arc-end-cap"?: string // 向下兼容
|
|
58
|
+
|
|
59
|
+
}
|
package/types/WebGL.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Object3DType from './Object3D'
|
|
2
|
+
import Matrix4Type from './Matrix4'
|
|
3
|
+
|
|
4
|
+
export default interface WebGLType {
|
|
5
|
+
|
|
6
|
+
matrix(initMatrix4?: number[]): Matrix4Type
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 使用模型数据绘制
|
|
10
|
+
* @param object3D 记录着的模型数据
|
|
11
|
+
*/
|
|
12
|
+
render(object3D: Object3DType): void
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 重新绘制
|
|
16
|
+
*/
|
|
17
|
+
review(): this
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 返回变换矩阵
|
|
21
|
+
*/
|
|
22
|
+
getMatrix(): Matrix4Type
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 返回所有的Object3D内容
|
|
26
|
+
*/
|
|
27
|
+
getObject3D(): Object3DType[]
|
|
28
|
+
|
|
29
|
+
}
|
package/types/animation.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
interface animationFun {
|
|
2
|
-
(deep: number): void
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export default interface animationType {
|
|
6
|
-
(doback: animationFun, duration?: number, callback?: animationFun): Function
|
|
1
|
+
interface animationFun {
|
|
2
|
+
(deep: number): void
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export default interface animationType {
|
|
6
|
+
(doback: animationFun, duration?: number, callback?: animationFun): Function
|
|
7
7
|
}
|
package/types/getLoopColors.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default interface getLoopColorsType {
|
|
2
|
-
(num: number, alpha?: number): string[]
|
|
1
|
+
export default interface getLoopColorsType {
|
|
2
|
+
(num: number, alpha?: number): string[]
|
|
3
3
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,58 +1,102 @@
|
|
|
1
|
-
import Matrix4Type from './Matrix4'
|
|
2
|
-
import CanvasType from './Canvas'
|
|
3
|
-
import SVGType from './SVG'
|
|
4
|
-
import EoapType from './Eoap'
|
|
5
|
-
import HermiteType from './Hermite'
|
|
6
1
|
import CardinalType from './Cardinal'
|
|
2
|
+
import HermiteType from './Hermite'
|
|
3
|
+
|
|
4
|
+
import Matrix4Type from './Matrix4'
|
|
7
5
|
import rotateType from './rotate'
|
|
8
|
-
|
|
6
|
+
|
|
9
7
|
import getLoopColorsType from './getLoopColors'
|
|
8
|
+
import animationType from './animation'
|
|
10
9
|
import rulerType from './ruler'
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
import SVGType from './SVG'
|
|
12
|
+
import CanvasType from './Canvas'
|
|
13
|
+
import WebGLType from './WebGL'
|
|
14
|
+
|
|
15
|
+
import MapType from './Map'
|
|
15
16
|
|
|
17
|
+
import viewHandlerType from './viewHandler'
|
|
18
|
+
|
|
19
|
+
// 插值
|
|
16
20
|
interface NewCardinalType extends CardinalType {
|
|
17
21
|
new(t?: number): this
|
|
18
22
|
}
|
|
19
|
-
|
|
20
|
-
interface NewEoapType extends EoapType {
|
|
21
|
-
new(scale?: number, center?: number[]): this
|
|
22
|
-
}
|
|
23
|
-
|
|
24
23
|
interface NewHermiteType extends HermiteType {
|
|
25
|
-
new(u
|
|
24
|
+
new(u?: number): this
|
|
26
25
|
}
|
|
27
26
|
|
|
27
|
+
// 变换
|
|
28
28
|
interface NewMatrix4Type extends Matrix4Type {
|
|
29
29
|
new(initMatrix4?: number[]): this
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
// 画笔
|
|
32
33
|
interface NewSVGType extends SVGType {
|
|
33
34
|
new(el: HTMLElement | null): this
|
|
34
35
|
}
|
|
36
|
+
interface NewCanvasType extends CanvasType {
|
|
37
|
+
new(el: HTMLElement | null): this
|
|
38
|
+
}
|
|
39
|
+
interface NewWebGLType extends WebGLType {
|
|
40
|
+
new(el: HTMLElement | null): this
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 投影
|
|
44
|
+
interface NewEoapType extends MapType {
|
|
45
|
+
new(scale?: number, center?: number[]): this
|
|
46
|
+
}
|
|
47
|
+
interface NewMercatorType extends MapType {
|
|
48
|
+
new(scale?: number, center?: number[]): this
|
|
49
|
+
}
|
|
35
50
|
|
|
36
51
|
export default class VISLite {
|
|
52
|
+
|
|
53
|
+
// 插值
|
|
54
|
+
static Cardinal: NewCardinalType
|
|
55
|
+
static Hermite: NewHermiteType
|
|
56
|
+
|
|
57
|
+
// 变换
|
|
37
58
|
static Matrix4: NewMatrix4Type
|
|
38
|
-
static Canvas: NewCanvasType
|
|
39
|
-
static SVG: NewSVGType
|
|
40
|
-
static Eoap: NewEoapType
|
|
41
59
|
static rotate: rotateType
|
|
42
|
-
|
|
43
|
-
|
|
60
|
+
|
|
61
|
+
// 工具
|
|
44
62
|
static getLoopColors: getLoopColorsType
|
|
45
63
|
static animation: animationType
|
|
46
64
|
static ruler: rulerType
|
|
65
|
+
|
|
66
|
+
// 画笔
|
|
67
|
+
static SVG: NewSVGType
|
|
68
|
+
static Canvas: NewCanvasType
|
|
69
|
+
static WebGL: NewWebGLType
|
|
70
|
+
|
|
71
|
+
// 投影
|
|
72
|
+
static Eoap: NewEoapType
|
|
73
|
+
static Mercator: NewMercatorType
|
|
74
|
+
|
|
75
|
+
// 辅助
|
|
76
|
+
static viewHandler: viewHandlerType
|
|
47
77
|
}
|
|
48
78
|
|
|
79
|
+
// 插值
|
|
80
|
+
export let Cardinal: NewCardinalType
|
|
81
|
+
export let Hermite: NewHermiteType
|
|
82
|
+
|
|
83
|
+
// 变换
|
|
49
84
|
export let Matrix4: NewMatrix4Type
|
|
50
|
-
export let Canvas: NewCanvasType
|
|
51
|
-
export let SVG: NewSVGType
|
|
52
|
-
export let Eoap: NewEoapType
|
|
53
85
|
export let rotate: rotateType
|
|
54
|
-
|
|
55
|
-
|
|
86
|
+
|
|
87
|
+
// 工具
|
|
56
88
|
export let getLoopColors: getLoopColorsType
|
|
57
89
|
export let animation: animationType
|
|
58
|
-
export let ruler: rulerType
|
|
90
|
+
export let ruler: rulerType
|
|
91
|
+
|
|
92
|
+
// 画笔
|
|
93
|
+
export let SVG: NewSVGType
|
|
94
|
+
export let Canvas: NewCanvasType
|
|
95
|
+
export let WebGL: NewWebGLType
|
|
96
|
+
|
|
97
|
+
// 投影
|
|
98
|
+
export let Eoap: NewEoapType
|
|
99
|
+
export let Mercator: NewMercatorType
|
|
100
|
+
|
|
101
|
+
// 辅助
|
|
102
|
+
export let viewHandler: viewHandlerType
|
package/types/rotate.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default interface rotateType {
|
|
2
|
-
(cx: number, cy: number, deg: number, x: number, y: number): number[]
|
|
1
|
+
export default interface rotateType {
|
|
2
|
+
(cx: number, cy: number, deg: number, x: number, y: number): number[]
|
|
3
3
|
}
|
package/types/ruler.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default interface rulerType {
|
|
2
|
-
(maxValue: number, minValue: number, num: number): number[]
|
|
1
|
+
export default interface rulerType {
|
|
2
|
+
(maxValue: number, minValue: number, num: number): number[]
|
|
3
3
|
}
|
package/uni-app/ui-canvas.vue
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view>
|
|
2
|
+
<view :class="cover || isH5 ? 'cover-view' : 'normal-view'">
|
|
3
|
+
<view :class="'view-img view-' + uniqueid" @touchstart="doitstart">
|
|
4
|
+
<image
|
|
5
|
+
:style="{ width: width + 'px', height: height + 'px' }"
|
|
6
|
+
:src="viewImg"
|
|
7
|
+
></image>
|
|
8
|
+
</view>
|
|
9
|
+
|
|
3
10
|
<!-- #ifdef MP-ALIPAY -->
|
|
4
11
|
<canvas
|
|
12
|
+
class="painter"
|
|
5
13
|
:id="'painter-' + uniqueid"
|
|
6
14
|
@touchstart="doitstart"
|
|
7
15
|
:style="{ width: width + 'px', height: height + 'px' }"
|
|
@@ -14,6 +22,7 @@
|
|
|
14
22
|
<!-- #endif -->
|
|
15
23
|
<!-- #ifdef MP-WEIXIN -->
|
|
16
24
|
<canvas
|
|
25
|
+
class="painter"
|
|
17
26
|
canvas-id="painter"
|
|
18
27
|
@touchstart="doitstart"
|
|
19
28
|
:style="{ width: width + 'px', height: height + 'px' }"
|
|
@@ -26,6 +35,7 @@
|
|
|
26
35
|
<!-- #endif -->
|
|
27
36
|
<!-- #ifndef MP-WEIXIN||MP-ALIPAY -->
|
|
28
37
|
<canvas
|
|
38
|
+
class="painter"
|
|
29
39
|
:canvas-id="'painter-' + uniqueid"
|
|
30
40
|
@touchstart="doitstart"
|
|
31
41
|
:style="{ width: width + 'px', height: height + 'px' }"
|
|
@@ -45,6 +55,13 @@ export default {
|
|
|
45
55
|
return {
|
|
46
56
|
uniqueid: (Math.random() * 10000).toFixed(0),
|
|
47
57
|
help: {},
|
|
58
|
+
viewImg: "",
|
|
59
|
+
// #ifdef H5
|
|
60
|
+
isH5: true
|
|
61
|
+
// #endif
|
|
62
|
+
// #ifndef H5
|
|
63
|
+
isH5: false
|
|
64
|
+
// #endif
|
|
48
65
|
};
|
|
49
66
|
},
|
|
50
67
|
props: {
|
|
@@ -58,19 +75,25 @@ export default {
|
|
|
58
75
|
},
|
|
59
76
|
touchstart: {
|
|
60
77
|
type: Function,
|
|
61
|
-
default: () => {},
|
|
78
|
+
default: () => { },
|
|
62
79
|
},
|
|
80
|
+
cover: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: true
|
|
83
|
+
}
|
|
63
84
|
},
|
|
64
85
|
methods: {
|
|
65
86
|
fetch() {
|
|
66
87
|
// #ifdef MP-WEIXIN
|
|
67
88
|
let painter = uni.createCanvasContext("painter", this);
|
|
68
89
|
let region = uni.createCanvasContext("region", this);
|
|
90
|
+
let painterid = "painter";
|
|
69
91
|
let regionid = "region";
|
|
70
92
|
// #endif
|
|
71
93
|
// #ifndef MP-WEIXIN
|
|
72
94
|
let painter = uni.createCanvasContext("painter-" + this.uniqueid, this);
|
|
73
95
|
let region = uni.createCanvasContext("region-" + this.uniqueid, this);
|
|
96
|
+
let painterid = "painter-" + this.uniqueid;
|
|
74
97
|
let regionid = "region-" + this.uniqueid;
|
|
75
98
|
// #endif
|
|
76
99
|
|
|
@@ -114,34 +137,76 @@ export default {
|
|
|
114
137
|
this.help.instance.draw = () => {
|
|
115
138
|
painter.draw();
|
|
116
139
|
region.draw();
|
|
140
|
+
|
|
141
|
+
// 如果不使用原生渲染
|
|
142
|
+
if (!this.cover && !this.isH5) {
|
|
143
|
+
uni.canvasToTempFilePath({
|
|
144
|
+
canvasId: painterid,
|
|
145
|
+
success: (e) => {
|
|
146
|
+
this.viewImg = e.tempFilePath;
|
|
147
|
+
}
|
|
148
|
+
}, this);
|
|
149
|
+
}
|
|
150
|
+
|
|
117
151
|
};
|
|
118
152
|
return new Promise((resolve, reject) => {
|
|
153
|
+
this.help.instance.toDataURL = () => {
|
|
154
|
+
return new Promise((resolveUrl) => {
|
|
155
|
+
uni.canvasToTempFilePath(
|
|
156
|
+
{
|
|
157
|
+
canvasId: painterid,
|
|
158
|
+
success: function (e) {
|
|
159
|
+
resolveUrl(e.tempFilePath);
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
this
|
|
163
|
+
);
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
|
|
119
167
|
resolve(this.help.instance);
|
|
120
168
|
});
|
|
121
169
|
},
|
|
122
170
|
doit(event, doback) {
|
|
123
171
|
let doRun = (x, y) => {
|
|
124
172
|
this.help.instance.getRegion(x, y).then((regionName) => {
|
|
125
|
-
|
|
173
|
+
// 兼容旧语法
|
|
174
|
+
if (doback) doback(regionName);
|
|
175
|
+
|
|
176
|
+
this.$emit("dotouchstart", {
|
|
177
|
+
name: regionName,
|
|
178
|
+
x: x,
|
|
179
|
+
y: y,
|
|
180
|
+
});
|
|
126
181
|
});
|
|
127
182
|
};
|
|
128
183
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
184
|
+
if (this.cover || this.isH5) {
|
|
185
|
+
|
|
186
|
+
// #ifdef MP-ALIPAY
|
|
187
|
+
uni
|
|
188
|
+
.createSelectorQuery()
|
|
189
|
+
.selectViewport()
|
|
190
|
+
.scrollOffset()
|
|
191
|
+
.exec((ret) => {
|
|
192
|
+
let x = event.touches[0].x + ret[0].scrollLeft;
|
|
193
|
+
let y = event.touches[0].y + ret[0].scrollTop;
|
|
194
|
+
doRun(x, y);
|
|
195
|
+
});
|
|
196
|
+
// #endif
|
|
197
|
+
// #ifndef MP-ALIPAY
|
|
198
|
+
let x = event.touches[0].x;
|
|
199
|
+
let y = event.touches[0].y;
|
|
200
|
+
doRun(x, y);
|
|
201
|
+
// #endif
|
|
202
|
+
|
|
203
|
+
} else {
|
|
204
|
+
|
|
205
|
+
uni.createSelectorQuery().in(this).select('.view-' + this.uniqueid).boundingClientRect(data => {
|
|
206
|
+
doRun(event.touches[0].pageX - data.left, event.touches[0].pageY - data.top);
|
|
207
|
+
}).exec()
|
|
208
|
+
|
|
209
|
+
}
|
|
145
210
|
},
|
|
146
211
|
doitstart(event) {
|
|
147
212
|
this.doit(event, this.touchstart);
|
|
@@ -150,10 +215,19 @@ export default {
|
|
|
150
215
|
};
|
|
151
216
|
</script>
|
|
152
217
|
|
|
153
|
-
<style lang="
|
|
218
|
+
<style lang="css" scoped>
|
|
154
219
|
/* 辅助的区域不应该可以看见 */
|
|
155
220
|
.region {
|
|
156
221
|
position: fixed;
|
|
157
222
|
left: 50000px;
|
|
158
223
|
}
|
|
224
|
+
|
|
225
|
+
.cover-view .view-img {
|
|
226
|
+
display: none;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.normal-view .painter {
|
|
230
|
+
position: fixed;
|
|
231
|
+
left: 50000px;
|
|
232
|
+
}
|
|
159
233
|
</style>
|