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

拍照工具3.1优化

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