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