Commit 1d0dec53 by 胡悦

Merge branch 'v1.0.1' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.1

2 parents ab4e2ffd 9095c8d0
......@@ -65,7 +65,7 @@
<canvas
class="board-canvas"
:canvas-id="canvasId"
disable-scroll="true"
:disable-scroll="drawStatus"
@touchstart="touchStart"
@touchmove="touchMove"
@touchend="touchEnd"
......@@ -113,7 +113,7 @@ export default {
mode: "pen", //操作模式
currentColor: "red", //当前画笔颜色
bgColor: "#fff", //画板背景颜色
lineWidth: 20, //画笔粗细 px
lineWidth: 3, //画笔粗细 px
lastRect: {}, //运动轨迹最后一个方形
lastCircle: {}, //运动轨迹最后一个圆形
//工具箱
......@@ -225,12 +225,17 @@ export default {
this.drawContext = uni.createCanvasContext(this.canvasId, this);
this.initBoard();
},
watch: {
'drawImage' (n) {
if (n) this.initBoard()
}
},
methods: {
colorShowHandel () {
this.colorShow = !this.colorShow;
},
chooseTools (item) {
console.log(item);
// console.log(item);
this.colorShow = false;
if (item.key == "back") {
//撤回
......@@ -497,7 +502,7 @@ export default {
x,
y
} = e.touches[0]
console.log("开始touch");
// console.log("开始touch");
switch (this.mode) {
case "pen":
this.penBegin(x, y)
......@@ -541,7 +546,7 @@ export default {
} = e.touches[0]
this.lastX = x;
this.lastY = y;
console.log("touch移动");
// console.log("touch移动");
switch (this.mode) {
case "pen":
this.drawPen(x, y)
......@@ -580,7 +585,7 @@ export default {
x,
y
} = e.changedTouches[0]
console.log("touch结束");
// console.log("touch结束");
switch (this.mode) {
case "pen":
this.lineEnd()
......@@ -678,7 +683,7 @@ export default {
//选择画笔颜色
colorPickTapHandler (obj) {
console.log('我点击的颜色:' + JSON.stringify(obj));
// console.log('我点击的颜色:' + JSON.stringify(obj));
this.colorShow = false;
this.tools.forEach(item => {
item.active = false;
......@@ -701,16 +706,16 @@ export default {
uni.canvasToTempFilePath({
canvasId: this.canvasId,
success: function (res) {
console.log('回调参数:' + JSON.stringify(res));
// console.log('回调参数:' + JSON.stringify(res));
// 在H5平台下,tempFilePath 为 base64
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function (res) {
console.log('成功回调参数:' + JSON.stringify(res));
// console.log('成功回调参数:' + JSON.stringify(res));
that.$emit("dowmloadSuc", JSON.stringify(res))
},
fail: function (res) {
console.log('失败回调参数:' + JSON.stringify(res));
// console.log('失败回调参数:' + JSON.stringify(res));
that.$emit("dowmloadErr", JSON.stringify(res))
}
});
......@@ -727,7 +732,7 @@ export default {
uni.canvasToTempFilePath({
canvasId: this.canvasId,
success: function (res) {
console.log(res);
// console.log(res);
that.$emit("saveImage", res.tempFilePath)
}
}, this)
......@@ -798,13 +803,12 @@ export default {
} else {
this.isLandScape = false
}
console.log(this.isLandScape);
// console.log(this.isLandScape);
let imageInfoObj = (await uni.getImageInfo({
src: this.drawImage
}))[1] || {};
console.log(imageInfoObj);
// console.log(imageInfoObj);
this.aspectRatio = imageInfoObj.width / imageInfoObj.height;
if (this.isUnderBkg) {
this.bgColor = "rgba(0,0,0,0)"
......@@ -814,9 +818,8 @@ export default {
this.drawContext.setLineCap('round') // 让线条圆润
this.drawContext.strokeStyle = this.currentColor; //设置画笔颜色
this.drawContext.setLineWidth(this.lineWidth); //设置画笔粗细
//设置背景
this.$nextTick(() => {
this.penWidthChange()
this.drawContext.setLineWidth(this.lineWidth)
this.fillBackground();
})
}
......
......@@ -19,7 +19,7 @@
:maxlength="i.maxlength"
/>
</template>
<template>
<template v-else>
<view class="select">
<uni-icons
class="arrow"
......@@ -42,7 +42,7 @@
:drawImage="i.detailUrl"
:isUnderBkg="true"
:canvasId="`c-1-${index}`"
drawStatus
:drawStatus="penSwitch"
></wnCanvas>
</view>
</template>
......@@ -53,7 +53,8 @@
<script type='text/ecmascript-6'>
export default {
props: {
views: Array
views: Array,
penSwitch: Boolean
},
name: 'Media_1',
data () {
......@@ -89,7 +90,7 @@ export default {
mounted () {
},
methods: {
}
}
</script>
......@@ -111,6 +112,7 @@ export default {
overflow: hidden;
position: relative;
z-index: 1;
min-height: calc(100vh - 272rpx);
.title {
font-weight: 500;
font-size: 48rpx;
......@@ -122,6 +124,7 @@ export default {
display: flex;
flex-wrap: wrap;
gap: 28rpx 0;
padding: 30rpx 0;
&-item {
flex: 50%;
display: flex;
......@@ -150,13 +153,18 @@ export default {
.select {
display: flex;
align-items: center;
.arrow{
.arrow {
margin-left: auto;
}
}
}
}
}
.view {
position: relative;
z-index: 2;
margin-top: 36rpx;
}
}
}
</style>
\ No newline at end of file
......@@ -19,7 +19,7 @@
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
drawStatus
:drawStatus="penSwitch"
:canvasId="`c-2-${index}`"
></wnCanvas>
</view>
......@@ -34,7 +34,8 @@ import Tabs from './Tabs.vue'
export default {
components: { Tabs },
props: {
views: Array
views: Array,
penSwitch: Boolean
},
name: 'Media_2',
data () {
......
<template>
<view class="layout">
<view class="bg">
<glsx-image src="media/bg-5.png" />
</view>
<view class="content">
<view class="canvas-box">
<template v-for="(i,index) in views">
<view
:key="index"
v-show="viewIndex == index"
>
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-3-${index}`"
></wnCanvas>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
views: Array,
penSwitch: Boolean
},
name: 'Media_3',
data () {
return {
viewIndex: 0
}
},
mounted () {
},
methods: {
changeView (index) {
console.log()
this.viewIndex = index
},
}
}
</script>
<style scoped lang='scss'>
.layout {
padding-top: 146rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 368rpx;
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="layout">
<view class="bg">
<glsx-image src="media/bg-4.png" />
</view>
<view class="content">
<view class="title">问界·汽车产品三包凭证</view>
<tabs
:list="views"
@tabclick="changeView"
/>
<view class="canvas-box">
<template v-for="(i,index) in views">
<view
:key="index"
v-show="viewIndex == index"
>
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-4-${index}`"
></wnCanvas>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import Tabs from './Tabs.vue'
export default {
components: { Tabs },
props: {
views: Array,
penSwitch: Boolean
},
name: 'Media_4',
data () {
return {
viewIndex: 0
}
},
mounted () {
},
methods: {
changeView (index) {
console.log()
this.viewIndex = index
},
}
}
</script>
<style scoped lang='scss'>
.layout {
padding-top: 146rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 368rpx;
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="layout">
<view class="bg">
<glsx-image src="media/bg-5.png" />
</view>
<view class="content">
<view class="canvas-box">
<template v-for="(i,index) in views">
<view
:key="index"
v-show="viewIndex == index"
>
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-5-${index}`"
></wnCanvas>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
views: Array,
penSwitch: Boolean
},
name: 'Media_5',
data () {
return {
viewIndex: 0
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.layout {
padding-top: 146rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 368rpx;
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
}
}
</style>
\ No newline at end of file
......@@ -76,12 +76,12 @@ export default {
icon: 'tool/4.png'
},
{
id: 5,
id: 6,
label: '历史成交',
icon: 'tool/5.png'
},
{
id: 6,
id: 5,
label: '质保升级',
icon: 'tool/6.png'
}
......@@ -103,8 +103,7 @@ export default {
.tool-box {
position: fixed;
right: 40rpx;
top: 50%;
transform: translateY(-50%);
top: 5%;
z-index: 998;
width: 128rpx;
.btn {
......@@ -130,6 +129,7 @@ export default {
.hideIcon {
height: 0;
overflow: hidden;
opacity: 0;
.icon {
height: 0;
margin-bottom: 0;
......
......@@ -24,15 +24,27 @@
@finish="open"
/>
<view :class="['view',{showView:id == 1}]">
<media_1 :views="mediaList" />
<media_1 :views="mediaList" :penSwitch="type != 'preview' && drawStatus" />
</view>
<view :class="['view',{showView:id == 2}]">
<media_2 :views="mediaList" />
<media_2 :views="mediaList" :penSwitch="type != 'preview' && drawStatus" />
</view>
<view :class="['view',{showView:id == 3}]">
<media_3 :views="mediaList" :penSwitch="type != 'preview' && drawStatus" />
</view>
<view :class="['view',{showView:id == 4}]">
<media_4 :views="mediaList" :penSwitch="type != 'preview' && drawStatus" />
</view>
<view :class="['view',{showView:id == 5}]">
<media_5 :views="mediaList" :penSwitch="type != 'preview' && drawStatus" />
</view>
<view :class="['view',{showView:id == 6}]">
<media_6 :views="mediaList" />
</view>
<pay-pop ref="pay"></pay-pop>
<view class="pen-box">
<glsx-image src="media" />
</view>
</view>
</template>
<script>
......@@ -41,15 +53,20 @@ import ToolBox from './components/ToolBox.vue'
import myClick from "@/mixin/click";
import Media_1 from './components/Media_1.vue'
import Media_2 from './components/Media_2.vue'
import Media_3 from './components/Media_3.vue'
import Media_4 from './components/Media_4.vue'
import Media_5 from './components/Media_5.vue'
import Media_6 from './components/Media_6.vue'
import GlsxImage from '../../components/GlsxImage.vue';
export default {
components: { ToolBox, payPop, Media_1, Media_2,Media_6 },
components: { ToolBox, payPop, Media_1, Media_2, Media_3, Media_4, Media_5, Media_6, GlsxImage },
mixins: [myClick],
data () {
return {
type: 'preview',
id: '',
mediaList: []
mediaList: [],
drawStatus:false
};
},
onLoad (options) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!