Commit d3e1c2c7 by 李伟康

commit 提交

1 parent ea4b8522
...@@ -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)
...@@ -799,12 +804,12 @@ export default { ...@@ -799,12 +804,12 @@ export default {
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)"
......
...@@ -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"
...@@ -111,6 +111,7 @@ export default { ...@@ -111,6 +111,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;
...@@ -157,6 +158,11 @@ export default { ...@@ -157,6 +158,11 @@ export default {
} }
} }
} }
.view{
position: relative;
z-index: 2;
margin-top: 36rpx;
}
} }
} }
</style> </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-2.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
:canvasId="`c-3-${index}`"
></wnCanvas>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
views: Array
},
name: 'Media_2',
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
: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
},
name: 'Media_2',
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-2.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
:canvasId="`c-5-${index}`"
></wnCanvas>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
views: Array
},
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
...@@ -29,6 +29,15 @@ ...@@ -29,6 +29,15 @@
<view :class="['view',{showView:id == 2}]"> <view :class="['view',{showView:id == 2}]">
<media_2 :views="mediaList" /> <media_2 :views="mediaList" />
</view> </view>
<view :class="['view',{showView:id == 3}]">
<media_3 :views="mediaList" />
</view>
<view :class="['view',{showView:id == 4}]">
<media_4 :views="mediaList" />
</view>
<view :class="['view',{showView:id == 5}]">
<media_5 :views="mediaList" />
</view>
<view :class="['view',{showView:id == 6}]"> <view :class="['view',{showView:id == 6}]">
<media_6 :views="mediaList" /> <media_6 :views="mediaList" />
</view> </view>
...@@ -41,9 +50,12 @@ import ToolBox from './components/ToolBox.vue' ...@@ -41,9 +50,12 @@ 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'
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 },
mixins: [myClick], mixins: [myClick],
data () { data () {
return { return {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!