Commit 64ca950b authored by 李俊赕's avatar 李俊赕

take-init

parent dc9669ef
<template>
<view>
<image class="pic" :src="images[0]" mode="aspectFill"></image>
<image class="pic" :src="images[0]" mode="aspectFill" @click="showPreviewFn"></image>
</view>
</template>
......@@ -8,7 +8,8 @@
export default {
data() {
return {
protocolContent:''
protocolContent:'',
images:[]
}
},
onLoad(e) {
......@@ -16,7 +17,7 @@
if(e.img){
this.images = [e.img]
}
console.log(this.images,'this.images')
},
methods: {
......
......@@ -11,9 +11,10 @@
<cover-image class="liveWatermarkNormal" mode="aspectFit" :src="liveWaterMarkImage"></cover-image>
</camera>
<cover-view class="bottomView">
<cover-image class="backIcon" :src="icon_arrow_down" mode="" @click="goBack"></cover-image>
<!--cover-image class='switchIcon' :src='icon_switch_white' @click="switchClick()"> </cover-image-->
<cover-image class='takeIcon' :src='icon_take' @click="takePhoto()"> </cover-image>
<cover-image class="backIcon resultIcon" v-if="restultImage" :src="restultImage" mode="" @click="goPage"></cover-image>
<!--cover-image class='flashIcon' :src='icon_light_on_white' @click="flashClick()"> </cover-image-->
</cover-view>
<canvas v-show='showImage' canvas-id="canvas" :style="{'width':canvasWidth+'px','height': canvasHeight + 'px'}"></canvas>
......@@ -70,13 +71,17 @@
goPage(){
// 进入图片预览页
},
goBack(){
uni.navigateBack({
delta: 2
});
},
getSystemInfo() {
// 获取设备信息
try {
const res = uni.getSystemInfoSync();
this.canvasWidth = res.windowWidth*2
this.canvasHeight = res.windowHeight*2
console.log(res.windowWidth, 'res.windowWidth', res.windowHeight, 'res.windowHeight')
} catch (e) {
// error
}
......@@ -96,9 +101,6 @@
success: function(res) {
that.longitude = '经度:' + res.longitude
that.latitude = '纬度:' + res.latitude
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
console.log('当前位置的地址:' + res.address);
}
});
},
......@@ -110,13 +112,11 @@
url: this.icon_live_mark, //仅为示例,并非真实的资源
success: (res) => {
if (res.statusCode === 200) {
console.log('水印图片 下载成功')
that.markPath = res.tempFilePath
console.log('markPath:' + that.markPath)
}
},
fail() {
console.log('水印图片 下载失败')
// console.log('水印图片 下载失败')
}
})
......@@ -128,9 +128,7 @@
this.ctx.takePhoto({
quality: 'high',
success: (res) => {
console.log('拍照成功')
console.log(res)
//this.imageChange(res)
this.getImageInfo(res.tempImagePath)
......@@ -148,7 +146,6 @@
uni.getImageInfo({
src: tempImagePath,
success(res) {
console.log('获取图片信息成功')
that.width = res.width + 'px';
that.height = res.height + 'px';
......@@ -163,10 +160,8 @@
title: '数据处理中...',
icon: 'loading'
})
console.log('绘制画布')
let canvasWidth = this.canvasWidth
let canvasHeight = this.canvasHeight
console.log(canvasWidth,'canvasWidth',canvasHeight,'canvasHeight')
this.showImage = true
//将原图画到canvas上面
this.canvas = uni.createCanvasContext("canvas", this)
......@@ -211,11 +206,11 @@
canvasId: 'canvas',
success: (res) => {
self.saveToLocal(res.tempFilePath)
console.log(res.tempFilePath, 'res.tempFilePath-canvasImage')
// this.$emit('canvasImage', res.tempFilePath);
// if (this.showPreview) {
this.restultImage = res.tempFilePath
self.showPreviewFn(res.tempFilePath);
// this.restultImage = res.tempFilePath
// self.showPreviewFn(res.tempFilePath);
// }
},
fail: (res) => {
......@@ -240,15 +235,17 @@
uni.saveImageToPhotosAlbum({
filePath: tempImagePath,
success() {
console.log('保存本地相册 成功')
uni.showToast({
icon:'none',
title:'已将照片保存到本地相册'
})
let timer = setTimeout(()=>{
that.goBack()
},0)
},
fail() {
console.log('保存本地相册 失败')
// console.log('保存本地相册 失败')
uni.showToast({
icon:'none',
title:'保存本地相册失败'
......@@ -348,7 +345,7 @@
z-index: 6;
}
.backIcon.resultIcon {
.backIcon {
background-color: #FFFFFF;
width: 54rpx;
height: 54rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment