Commit e9c32caa authored by 李超鹏's avatar 李超鹏

拍照工具3.1优化

parent 7fa811c8
......@@ -2,7 +2,7 @@
<view class="backView">
<view class="ph-pr-arr" v-for="(dataItem, index) in list" :key="index">
<template v-if="dataItem.data.length > 0">
<view class="topTitle"><text>{{ dataItem.title }}</text></view>
<view class="topTitle"><text class="topFont">{{ dataItem.title }}</text><text>(不同系统对应不同模板)</text></view>
<view class="ph-pr-content">
<view v-for="(item,ikey) in dataItem.data"
:class="param[dataItem.type] === item.id ? 'select-item-view' : 'item-view'"
......@@ -189,6 +189,8 @@
.topTitle {
margin-top: 50rpx;
padding-left: 30rpx;
}
.topFont{
font-size: 36rpx;
font-weight: bold;
color: #333333;
......
......@@ -45,7 +45,7 @@
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
import standard from '@/components/photo/standard.vue'
import standard from '@/components/photo/standard.vue'
import cache from '../../common/cache.js'
export default {
components: {
......@@ -60,7 +60,7 @@
'https://qn-static.banshouhui.com/live_mark.png'
],
},
standardShow: true,
standardShow: false,
cameraInfo: {
devicePosition: 'back',
flash: 'off'
......@@ -87,7 +87,7 @@
ratio: 0,
cameraChange: false,
waterSetting: null,
shadowInitShow: true, // 第一次进入页面需显示弹窗
shadowInitShow: false, // 第一次进入页面需显示弹窗
}
},
onLoad(e) {
......@@ -95,17 +95,17 @@
getApp().trackPage('拍照页')
// this.ctx = uni.createCameraContext();
this.updateTime()
const locationData = cache.getCache('locationData')
const validityTime = 60000
if (Date.now() - locationData.locationTime < validityTime) { // 1分钟内不重复请求位置信息
this.waterInfo.latitude = locationData.waterInfo.latitude
this.waterInfo.longitude = locationData.waterInfo.longitude
this.baiduLocation()
} else {
this.getLocation()
}
const locationData = cache.getCache('locationData')
const validityTime = 60000
if (Date.now() - locationData.locationTime < validityTime) { // 1分钟内不重复请求位置信息
this.waterInfo.latitude = locationData.waterInfo.latitude
this.waterInfo.longitude = locationData.waterInfo.longitude
this.baiduLocation()
} else {
this.getLocation()
}
this.getMarkPath()
this.initData()
......@@ -152,7 +152,7 @@
watch: {},
onShow() {
// 默认开启弹窗
const photo = getApp().globalData.photo
const photo = getApp().globalData.photo
this.waterSetting = photo.waterSetting
this.standardShow = this.shadowInitShow
this.cameraChange = true
......@@ -222,7 +222,7 @@
// console.log(this.cameraHeight,'this.cameraHeight')
// console.log(globalData.navHeight,'globalData.navHeight')
this.ratio = globalData.screenHeight / globalData.rpxScreenHeight
// console.log(globalData.screenHeight,globalData.rpxScreenHeight,this.ratio)
// console.log(globalData.screenHeight,globalData.rpxScreenHeight,this.ratio)
this.waterSetting = globalData.photo.waterSetting
// this.cameraHeight = globalData.rpxScreenHeight
},
......@@ -266,15 +266,15 @@
type: 'gcj02',
success: function(res) {
waterInfo.longitude = parseFloat(res.longitude).toFixed(4)
waterInfo.latitude = parseFloat(res.latitude).toFixed(3)
const data = {
waterInfo: {
latitude: waterInfo.latitude,
longitude: waterInfo.longitude
},
locationTime: Date.now()
}
waterInfo.latitude = parseFloat(res.latitude).toFixed(3)
const data = {
waterInfo: {
latitude: waterInfo.latitude,
longitude: waterInfo.longitude
},
locationTime: Date.now()
}
cache.setCache('locationData', data)
that.baiduLocation()
},
......@@ -420,7 +420,7 @@
canvas.fillText(title.substr(14, 14), 10, canvasHeight - txtHeight * h++ + 20);
}
canvas.fillText(title.substr(0, 14), 10, canvasHeight - txtHeight * h++ - titleHeight / 2 + 10);
}
}
if (this.waterSetting) { // if (this.waterSetting && this.waterSetting.mid_text) {
//加入 水印图片
canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
......@@ -435,7 +435,7 @@
success: (res) => {
this.tempImgs.mixWater = res.tempFilePath
globalTempPath.origin = this.tempImgs.origin
globalTempPath.mixWater = res.tempFilePath
globalTempPath.mixWater = res.tempFilePath
this.goPage('/pages/photo/preview')
let timer = setTimeout(()=>{
this.goPage('/pages/photo/preview')
......
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