Commit 495e2482 authored by 李超鹏's avatar 李超鹏

Merge remote-tracking branch 'origin/dev-photo-v2' into dev-photo-v2

parents a1cd1203 e3a33888
...@@ -101,6 +101,7 @@ export default { ...@@ -101,6 +101,7 @@ export default {
settleRecommend: '', settleRecommend: '',
navHeight: 0, //导航栏高度 navHeight: 0, //导航栏高度
rpxScreenHeight: 0,// 照相视框高度 rpxScreenHeight: 0,// 照相视框高度
safeHeight:0, // 安全高度
//拍照相关数据 //拍照相关数据
photo: { photo: {
product: { product: {
...@@ -165,6 +166,8 @@ export default { ...@@ -165,6 +166,8 @@ export default {
this.globalData.navHeight = a.statusBarHeight / a.screenWidth * 750 + 90 this.globalData.navHeight = a.statusBarHeight / a.screenWidth * 750 + 90
this.globalData.rpxScreenHeight = a.screenHeight / a.screenWidth * 750 this.globalData.rpxScreenHeight = a.screenHeight / a.screenWidth * 750
this.globalData.screenHeight = a.screenHeight this.globalData.screenHeight = a.screenHeight
this.globalData.safeHeight = a.safeArea.bottom
console.log(a,'a')
} catch (a) { } catch (a) {
} }
}, },
......
...@@ -105,18 +105,10 @@ export default { ...@@ -105,18 +105,10 @@ export default {
if (res && util.getToken()) { if (res && util.getToken()) {
that.goBackPage() that.goBackPage()
} else { } else {
uni.showToast({
title: '授权失败,请重新授权',
icon: 'none'
});
this.setLoginStatus() this.setLoginStatus()
} }
}).catch(res => { }).catch(res => {
uni.hideLoading() uni.hideLoading()
uni.showToast({
title: res.message,
icon: 'none'
});
this.setLoginStatus() this.setLoginStatus()
}) })
}, },
...@@ -141,9 +133,13 @@ export default { ...@@ -141,9 +133,13 @@ export default {
return login.signup(params); return login.signup(params);
}).then(res => { }).then(res => {
uni.hideLoading() uni.hideLoading()
if (util.getToken()) { if (res && util.getToken()) {
that.goBackPage() that.goBackPage()
} else { } else {
uni.showToast({
title: '授权失败,请重新授权',
icon: 'none'
});
this.setLoginStatus(false) this.setLoginStatus(false)
} }
}).catch(res => { }).catch(res => {
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
</view> </view>
</template> </template>
</view> </view>
<button class="ph-pr-button" type="primary" @click="handleClick" :disabled="!selectedAll" <u-button class="ph-pr-button" type="primary" shape="circle" @click="handleClick"
:style="buttonStyle">下一步</button> :hover-class="selectedAll ? '' : 'none'" :custom-style="buttonStyle">下一步</u-button>
</view> </view>
</template> </template>
...@@ -53,8 +53,17 @@ ...@@ -53,8 +53,17 @@
] ]
}, },
buttonStyle() { buttonStyle() {
return this.selectedAll ? 'color: #FFFFFF;background-color: #2272FF;' : return this.selectedAll ? {
'color: #FFFFFF;background-color: #D1D4D4;' 'color': '#FFFFFF',
'background-color': '#2272FF;',
'width': '600rpx',
'height': '104rpx'
} : {
'color': '#FFFFFF',
'background-color': '#D1D4D4;',
'width': '600rpx',
'height': '104rpx'
}
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -120,10 +129,13 @@ ...@@ -120,10 +129,13 @@
// 点击下一步 // 点击下一步
handleClick() { handleClick() {
// 点击下一步设置全局拍照品牌品类 // 点击下一步设置全局拍照品牌品类
if (!this.selectedAll) {
return
}
const globalData = getApp().globalData const globalData = getApp().globalData
if (!globalData.token) { if (!globalData.token) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/login/wxlogin' url: '/pages/login/wxlogin'
}) })
return return
} }
...@@ -145,7 +157,7 @@ ...@@ -145,7 +157,7 @@
<style> <style>
.backView { .backView {
background-color: #FAFAFA; background-color: #F4f5f7;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
...@@ -216,10 +228,6 @@ ...@@ -216,10 +228,6 @@
.ph-pr-button { .ph-pr-button {
position: absolute; position: absolute;
bottom: 76rpx; bottom: 76rpx;
border-radius: 52rpx;
height: 104rpx;
font-size: 32rpx; font-size: 32rpx;
width: 600rpx;
line-height: 104rpx;
} }
</style> </style>
<template> <template>
<view class="backView"> <view class="backView">
<u-loading style="position: absolute;top: 50%;" :show="loading" size="36" mode="flower"></u-loading> <u-loading style="position: fixed;top: 50%;" :show="loading" size="36" mode="flower"></u-loading>
<view class="topView"> <view class="topView">
<view :class="['topItemView', {'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)" v-for="(item,ikey) in dataList" :key="ikey"> <view :class="['topItemView', {'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)" v-for="(item,ikey) in dataList" :key="ikey">
<text <text
...@@ -12,15 +12,15 @@ ...@@ -12,15 +12,15 @@
<view class="right-view-title">拍照项有:</view> <view class="right-view-title">拍照项有:</view>
<template v-for="(item,ikey) in rightList"> <template v-for="(item,ikey) in rightList">
<view class="rightItemView" @click="rightItemClick(item,ikey)" :key="ikey"> <view class="rightItemView" @click="rightItemClick(item,ikey)" :key="ikey">
<view :class="['rightContentView', {'active':item.imageList.length > 0 || item.images.length > 0}]"> <view :class="['rightContentView', {'active':item.imageList.length > 0}]">
<text class="ph-lst-item-index">{{ ikey + 1 }}</text> <text class="ph-lst-item-index">{{ ikey + 1 }}</text>
<text class="">{{item.name}}</text> <text class="">{{item.name}}</text>
<image class="ph-list-item-arrow" src="/static/photo/arrow.png"></image> <image class="ph-list-item-arrow" src="/static/photo/arrow.png"></image>
<!-- <text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text> --> <!-- <text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text> -->
</view> </view>
<view class="rightImageView" v-if="item.imageList.length > 0 || item.images.length > 0"> <view class="rightImageView" v-if="item.imageList.length > 0">
<image class="rightImage" v-for="(image, index) in (item.imageList.length > 0 ? item.imageList : item.images)" :src="image" :key="image" <image class="rightImage" v-for="(image, index) in item.imageList" :src="image" :key="image"
@click.stop="handleClickImage(item, index)" mode=""></image> @click.stop="handleClickImage(item, index)" mode="aspectFill"></image>
</view> </view>
</view> </view>
</template> </template>
...@@ -93,9 +93,11 @@ ...@@ -93,9 +93,11 @@
const globalData = getApp().globalData const globalData = getApp().globalData
globalData.photo.productList = result globalData.photo.productList = result
this.dataList = result this.dataList = result
if (result.length > 0) {
var item = result[0] var item = result[0]
globalData.photo.waterSetting = item.userWatermark globalData.photo.waterSetting = item.userWatermark
this.rightList = item.list this.rightList = item.list
}
}, },
//顶部点击 //顶部点击
...@@ -114,7 +116,7 @@ ...@@ -114,7 +116,7 @@
// 点击图片 // 点击图片
handleClickImage(item, index) { handleClickImage(item, index) {
uni.previewImage({ uni.previewImage({
urls: item.imageList.length > 0 ? item.imageList : item.images, urls: item.imageList,
current:index current:index
}) })
}, },
...@@ -198,6 +200,7 @@ ...@@ -198,6 +200,7 @@
padding: 36rpx 30rpx 18rpx 30rpx; padding: 36rpx 30rpx 18rpx 30rpx;
border-radius: 12rpx; border-radius: 12rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
min-height: 108rpx;
} }
.ph-lst-item-index { .ph-lst-item-index {
...@@ -211,11 +214,12 @@ ...@@ -211,11 +214,12 @@
border-width: 1px; border-width: 1px;
border-style: solid; border-style: solid;
margin-right: 10rpx; margin-right: 10rpx;
margin-top: 4rpx;
} }
.rightContentView { .rightContentView {
display: flex; display: flex;
align-items: center; align-items: flex-start;
width: 100%; width: 100%;
font-size: 30rpx; font-size: 30rpx;
color: #2272FF; color: #2272FF;
...@@ -229,9 +233,9 @@ ...@@ -229,9 +233,9 @@
.ph-list-item-arrow { .ph-list-item-arrow {
position: absolute; position: absolute;
width: 56rpx; width: 40rpx;
height: 56rpx; height: 40rpx;
right: 30rpx; right: 38rpx;
} }
.rightContent { .rightContent {
...@@ -278,7 +282,6 @@ ...@@ -278,7 +282,6 @@
flex: 1; flex: 1;
background-color: #FFFFFF; background-color: #FFFFFF;
color: #999999; color: #999999;
} }
.topItemView.active { .topItemView.active {
color: #2272FF; color: #2272FF;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<image class="btn" :src="btn_remake" @click="remakePhoto"></image> <image class="btn" :src="btn_remake" @click="remakePhoto"></image>
<image class="btn" :src="btn_continue" @click="continuePhoto"></image> <image class="btn" :src="btn_continue" @click="continuePhoto"></image>
</view> </view>
<image class="btn finish" src="/static/photo/finish.png" @click="finishPhoto"></image>
</view> </view>
</template> </template>
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
return { return {
protocolContent: '', protocolContent: '',
btn_remake: 'https://qn-static.banshouhui.com/take_order/photo/remake.png', btn_remake: 'https://qn-static.banshouhui.com/take_order/photo/remake.png',
btn_continue: 'https://qn-static.banshouhui.com/take_order/photo/continue.png', btn_continue: '/static/photo/continue.png',
standardId: '', standardId: '',
images: [], images: [],
files: [], files: [],
...@@ -119,7 +120,12 @@ ...@@ -119,7 +120,12 @@
delta:1 delta:1
}) })
}, },
finishPhoto(){
// 完成本项
uni.navigateBack({
delta:2
})
},
// 确认图片 // 确认图片
continuePhoto() { continuePhoto() {
let self = this let self = this
...@@ -211,7 +217,7 @@ ...@@ -211,7 +217,7 @@
box-shadow: 0 0 1rpx 6rpx rgba(255,255,255,0.05); box-shadow: 0 0 1rpx 6rpx rgba(255,255,255,0.05);
background-color: #333333; background-color: #333333;
width: 100%; width: 100%;
padding:70rpx; padding:70rpx 0;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
display: flex; display: flex;
...@@ -223,4 +229,14 @@ ...@@ -223,4 +229,14 @@
height: 88rpx; height: 88rpx;
} }
} }
.btn{
display: block;
width: 232rpx;
height: 80rpx;
&.finish{
position: fixed;
top:30rpx;
right:30rpx;
}
}
</style> </style>
<template> <template>
<view class="backView"> <view class="backView">
<u-loading style="position: absolute;top: 50%;" :show="loading" size="36" mode="flower"></u-loading> <u-loading style="position: fixed;top: 50%;" :show="loading" size="36" mode="flower"></u-loading>
<view class="itemView firstItem"> <view class="itemView firstItem">
<view class="itemTitleView"> <view class="itemTitleView">
<text class="itemTitle">保存原图</text> <text class="itemTitle">保存原图</text>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<switch class="itemSwitch" :checked="item['enable']" @change="itemChange(item, ikey)" color="#007AFF" /> <switch class="itemSwitch" :checked="item['enable']" @change="itemChange(item, ikey)" color="#007AFF" />
</view> </view>
<u-popup border-radius="10" v-model="isPopShow" safe-area-inset-bottom :mask-close-able="false" mode="center" <u-popup border-radius="10" v-model="isPopShow" safe-area-inset-bottom :mask-close-able="false" mode="center"
width="690rp" height="600rpx"> width="690rpx" height="600rpx" @close="handlePopClose">
<view class="popCenterView"> <view class="popCenterView">
<text class="popTitle">设置自定义项</text> <text class="popTitle">设置自定义项</text>
<view class="inputBackView"> <view class="inputBackView">
...@@ -48,12 +48,12 @@ ...@@ -48,12 +48,12 @@
<text class="popNoticeText u-m-t-20">示例:</text> <text class="popNoticeText u-m-t-20">示例:</text>
<text class="popNoticeText">工程队名称:蓝天工程队</text> <text class="popNoticeText">工程队名称:蓝天工程队</text>
<view class="popBtnView"> <view class="popBtnView">
<view class="popCancelBtn" @click="popCancelClick()"> <u-button :custom-style="customStyleCancel" hover-class="none" shape="circle" type="primary" @click="popCancelClick()">
<text class="popBtnText">取消</text> 取消
</view> </u-button>
<view class="popSaveBtn" @click="popSaveClick()"> <u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="popSaveClick()">
<text class="popBtnText">保存</text> 保存
</view> </u-button>
</view> </view>
</view> </view>
</u-popup> </u-popup>
...@@ -98,6 +98,21 @@ ...@@ -98,6 +98,21 @@
}, },
showTitleSwitch() { showTitleSwitch() {
return this.result['lower_right'].hasOwnProperty('title_text') return this.result['lower_right'].hasOwnProperty('title_text')
},
customStyleCancel() {
return {
'background-color': '#D1D4D4',
'width': '280rpx',
'height': '96rpx'
}
},
customStyleSave() {
return {
'background-color': '##2272FF',
'width': '280rpx',
'height': '96rpx',
'margin-left': '50rpx'
}
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -208,6 +223,11 @@ ...@@ -208,6 +223,11 @@
} }
}, },
handlePopClose() {
this.showTipLeft = false,
this.showTipRight = false
},
//自定义弹窗 保存 //自定义弹窗 保存
popSaveClick: function() { popSaveClick: function() {
if (this.currenItem['watemark_text'] && this.currenItem['watemark_value']) { if (this.currenItem['watemark_text'] && this.currenItem['watemark_value']) {
...@@ -395,10 +415,10 @@ ...@@ -395,10 +415,10 @@
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: center;
} }
.popCancelBtn { /* .popCancelBtn {
background-color: #D1D4D4; background-color: #D1D4D4;
width: 280rpx; width: 280rpx;
height: 96rpx; height: 96rpx;
...@@ -407,9 +427,9 @@ ...@@ -407,9 +427,9 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} } */
.popSaveBtn { /* .popSaveBtn {
background-color: #2272FF; background-color: #2272FF;
width: 280rpx; width: 280rpx;
height: 96rpx; height: 96rpx;
...@@ -418,11 +438,11 @@ ...@@ -418,11 +438,11 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} } */
.popBtnText { /* .popBtnText {
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #FFFFFF;
font-weight: 600; font-weight: 600;
} } */
</style> </style>
<template> <template>
<view class="camera-container"> <view class="camera-container">
<cover-view class="header-box" :style="{'height':navHeight + 'rpx'}"> <cover-view class="header-box" :style="{'height':navHeight/2 + 'px'}">
<cover-view class="inner"> <cover-view class="inner">
<cover-image @click="setCameraInfo('devicePosition')" class="icon" mode="aspectFit" <cover-image @click="setCameraInfo('devicePosition')" class="icon" mode="aspectFit"
src="/static/photo/icon-switch.png"></cover-image> src="/static/photo/icon-switch.png"></cover-image>
...@@ -11,9 +11,10 @@ ...@@ -11,9 +11,10 @@
</cover-view> </cover-view>
</cover-view> </cover-view>
<camera class="camera-box" v-if="cameraChange&&!standardShow" :device-position="cameraInfo.devicePosition" <camera class="camera-box" v-if="cameraChange&&!standardShow" :device-position="cameraInfo.devicePosition"
:flash="cameraInfo.flash" :style="{'height':cameraHeight + 'rpx'}" @error="cameraError"> :flash="cameraInfo.flash" :style="{'height':cameraHeight/2 + 'px','top':parseInt(navHeight/2) + 'px'}"
@error="cameraError">
<cover-view class="mark-box"> <cover-view class="mark-box">
<cover-view class="txt big" >{{titleTxt}}</cover-view> <cover-view class="txt big" v-if="titleTxt">{{titleTxt}}</cover-view>
<cover-view class="txt" v-for="(txt,index) in settingTxtArr" :key="index">{{txt || '获取中'}}</cover-view> <cover-view class="txt" v-for="(txt,index) in settingTxtArr" :key="index">{{txt || '获取中'}}</cover-view>
<!-- <cover-view class="txt u-m-t-10">维度:{{waterInfo.latitude || '正在获取中...'}}</cover-view> <!-- <cover-view class="txt u-m-t-10">维度:{{waterInfo.latitude || '正在获取中...'}}</cover-view>
<cover-view class="txt u-m-t-10">地址:{{waterInfo.address || '正在获取中...'}}</cover-view> <cover-view class="txt u-m-t-10">地址:{{waterInfo.address || '正在获取中...'}}</cover-view>
...@@ -28,9 +29,9 @@ ...@@ -28,9 +29,9 @@
</cover-view> </cover-view>
<canvas canvas-id="canvas" id="photoCanvas" class="canvas" <canvas canvas-id="canvas" id="photoCanvas" class="canvas"
:style="{'width':750 + 'rpx','height': cameraHeight + 'rpx'}"></canvas> :style="{'width':750 + 'rpx','height': cameraHeight + 'rpx'}"></canvas>
<view v-if="standardShow" class="page-mask" :z-index="10000"> <view v-show="standardShow" class="page-mask" :z-index="10000">
<photo-standard :currentItem="currentItem" /> <photo-standard :currentItem="currentItem" />
<view class="btn-close" @click="standardShow = false"> <view class="btn-close" @click="closeShadow">
<image class="icon icon-close" mode="aspectFit" src="/static/photo/icon-close.png"> <image class="icon icon-close" mode="aspectFit" src="/static/photo/icon-close.png">
</cover-image> </cover-image>
</view> </view>
...@@ -58,7 +59,7 @@ ...@@ -58,7 +59,7 @@
'https://qn-static.banshouhui.com/live_mark.png' 'https://qn-static.banshouhui.com/live_mark.png'
], ],
}, },
standardShow: false, standardShow: true,
cameraInfo: { cameraInfo: {
devicePosition: 'back', devicePosition: 'back',
flash: 'auto' flash: 'auto'
...@@ -79,12 +80,13 @@ ...@@ -79,12 +80,13 @@
camera: false, // 相机授权 camera: false, // 相机授权
location: false, // 位置授权 location: false, // 位置授权
}, },
navHeight: 0, navHeight: 130,
cameraWidth: 750, cameraWidth: 750,
cameraHeight: 1000, // (4 / 3 * 750) 图片比例4:3 cameraHeight: 1000, // (4 / 3 * 750) 图片比例4:3
ratio: 0, ratio: 0,
cameraChange: true, cameraChange: false,
waterSetting:null, waterSetting: null,
shadowInitShow: true, // 第一次进入页面需显示弹窗
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -95,20 +97,21 @@ ...@@ -95,20 +97,21 @@
this.updateTime() this.updateTime()
this.getLocation() this.getLocation()
this.getMarkPath() this.getMarkPath()
this.initData()
this.currentItem = photo.currentItem this.currentItem = photo.currentItem
}, },
computed: { computed: {
titleTxt(){ titleTxt() {
const waterSetting = this.waterSetting const waterSetting = this.waterSetting
let txt = '' let txt = ''
if(!waterSetting || !waterSetting.lower_right){ if (!waterSetting || !waterSetting.lower_right) {
return '' return ''
} }
txt = waterSetting.lower_right && waterSetting.lower_right.title_text || '' txt = waterSetting.lower_right && waterSetting.lower_right.title_text || ''
console.log(txt,'title_text','waterSetting',waterSetting)
return txt return txt
}, },
settingTxtArr(){ settingTxtArr() {
let arr = [] let arr = []
// 包含经纬度 // 包含经纬度
const waterInfo = this.waterInfo const waterInfo = this.waterInfo
...@@ -132,32 +135,21 @@ ...@@ -132,32 +135,21 @@
} }
} }
}) })
console.log(settingTxtArr,'settingTxtArr')
return settingTxtArr return settingTxtArr
} }
}, },
watch: { watch: {},
'authSetting.camera'(val) {
if (val) {
// this.cameraChange = true
}
},
},
onShow() { onShow() {
this.initData() // 默认开启弹窗
// this.standardShow = true this.standardShow = this.shadowInitShow
// this.initData()
// this.cameraHeight = globalData.rpxScreenHeight
// uni.authorize({
// scope: 'scope.writePhotosAlbum',
// success() {
// console.log('userLocation')
// // uni.getLocation()
// }
// })
}, },
methods: { methods: {
closeShadow() {
this.shadowInitShow = false
this.standardShow = false
},
goBack() { goBack() {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
...@@ -168,7 +160,6 @@ ...@@ -168,7 +160,6 @@
}, },
goPage(url) { goPage(url) {
url = url || '/pages/photo/index'; url = url || '/pages/photo/index';
console.log(url, 'url')
uni.navigateTo({ uni.navigateTo({
url: url url: url
}) })
...@@ -195,15 +186,19 @@ ...@@ -195,15 +186,19 @@
break; break;
} }
console.log(type, 'type', val, 'val')
this.cameraInfo[type] = val this.cameraInfo[type] = val
}, },
initData() { initData() {
this.standardShow = true
const globalData = getApp().globalData const globalData = getApp().globalData
this.navHeight = globalData.navHeight this.navHeight = globalData.navHeight
this.cameraHeight = parseInt(globalData.safeHeight*2 - globalData.navHeight - 200) ;
console.log(globalData.safeHeight,'globalData.safeHeight')
console.log(this.cameraHeight,'this.cameraHeight')
console.log(globalData.navHeight,'globalData.navHeight')
this.ratio = globalData.screenHeight / globalData.rpxScreenHeight this.ratio = globalData.screenHeight / globalData.rpxScreenHeight
this.waterSetting = getApp().globalData.photo.waterSetting console.log(globalData.screenHeight,globalData.rpxScreenHeight,this.ratio)
this.cameraChange = true
this.waterSetting = globalData.photo.waterSetting
// this.cameraHeight = globalData.rpxScreenHeight // this.cameraHeight = globalData.rpxScreenHeight
}, },
baiduLocation() { baiduLocation() {
...@@ -217,7 +212,7 @@ ...@@ -217,7 +212,7 @@
waterInfo.address = i waterInfo.address = i
}, },
fail: function(err) { fail: function(err) {
console.log(err, 'err') // console.log(err, 'err')
} }
}; };
if (waterInfo.latitude && waterInfo.longitude) { if (waterInfo.latitude && waterInfo.longitude) {
...@@ -232,7 +227,7 @@ ...@@ -232,7 +227,7 @@
const { const {
errMsg errMsg
} = e.detail } = e.detail
console.log(e.detail, 'e.detail') // console.log(e.detail, 'e.detail')
if (errMsg !== 'insertCamera:fail auth deny') { if (errMsg !== 'insertCamera:fail auth deny') {
return return
} }
...@@ -247,7 +242,7 @@ ...@@ -247,7 +242,7 @@
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)
console.log(waterInfo.longitude, 'that.longitude', waterInfo.latitude, 'that.latitude') // console.log(waterInfo.longitude, 'that.longitude', waterInfo.latitude, 'that.latitude')
that.baiduLocation() that.baiduLocation()
}, },
fail(err) { fail(err) {
...@@ -257,7 +252,7 @@ ...@@ -257,7 +252,7 @@
}); });
}, },
showSettingModal(type) { showSettingModal(type) {
console.log(type, 'showModal-type') // console.log(type, 'showModal-type')
type = type || 'camera' type = type || 'camera'
const self = this const self = this
let authSetting = { let authSetting = {
...@@ -293,7 +288,6 @@ ...@@ -293,7 +288,6 @@
this.cameraChange = false this.cameraChange = false
wx.openSetting({ wx.openSetting({
success(res) { success(res) {
console.log(res, 'res-setting')
const authSetting = res.authSetting const authSetting = res.authSetting
self.cameraChange = true self.cameraChange = true
if (authSetting['scope.userLocation']) { if (authSetting['scope.userLocation']) {
...@@ -301,7 +295,6 @@ ...@@ -301,7 +295,6 @@
self.authSetting.location = true self.authSetting.location = true
self.getLocation() self.getLocation()
} }
console.log(self.cameraChange, 'this.cameraChange')
if (res.authSetting['scope.camera']) { if (res.authSetting['scope.camera']) {
self.authSetting.camera = true self.authSetting.camera = true
} }
...@@ -346,6 +339,8 @@ ...@@ -346,6 +339,8 @@
const waterSetting = this.waterSetting const waterSetting = this.waterSetting
const globalTempPath = getApp().globalData.photo.tempPath const globalTempPath = getApp().globalData.photo.tempPath
const ratio = this.ratio const ratio = this.ratio
console.log(this.ratio,'this.ratio')
// const ratio = 0.5
let canvasWidth = this.cameraWidth * ratio let canvasWidth = this.cameraWidth * ratio
let canvasHeight = this.cameraHeight * ratio let canvasHeight = this.cameraHeight * ratio
const waterInfo = this.waterInfo const waterInfo = this.waterInfo
...@@ -360,27 +355,37 @@ ...@@ -360,27 +355,37 @@
let h = 1 let h = 1
//加入 水印文字 //加入 水印文字
for (let i = settingTxtArr.length-1; i >=0; i--) { for (let i = settingTxtArr.length - 1; i >= 0; i--) {
txtHeight = 18 txtHeight = 20
canvas.setFontSize(14) canvas.setFontSize(16)
canvas.setFillStyle('#f2f2f2') canvas.setFillStyle('#f2f2f2')
let txt = settingTxtArr[i] let txt = settingTxtArr[i]
if(txt.length>14){ // if(txt.length>14){
canvas.fillText(txt.substr(0,14), 10, canvasHeight - txtHeight * h++); // canvas.fillText(txt.substr(14,18), 10, canvasHeight - txtHeight * h++);
canvas.fillText(txt.substr(14,14), 10, canvasHeight - txtHeight * h++); // canvas.fillText(txt.substr(0,18), 10, canvasHeight - txtHeight * h++);
}else{ // }else{
// canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
// }
canvas.fillText(txt, 10, canvasHeight - txtHeight * h++); canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
// canvas.fillText(txt, 10, canvasHeight - txtHeight * h++); // canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
} }
const title = this.titleTxt const title = this.titleTxt
if(title){ if (title) {
txtHeight = 20 canvas.save()
let titleHeight = title.length > 14 ? 60 : 30
let rectWidth = title.length > 14 ? 215 : title.length*10
canvas.setFillStyle('rgba(34, 114, 255, 0.6)')
canvas.fillRect(10, canvasHeight - txtHeight * h - titleHeight, 215, titleHeight)
canvas.restore()
canvas.setFontSize(20) canvas.setFontSize(20)
canvas.setFillStyle('#f2f2f2') canvas.setFillStyle('#f2f2f2')
canvas.fillText(title, 10, canvasHeight - txtHeight * h++); // canvas.setTextAlign('center')
if (title.length > 14) {
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 && this.waterSetting.mid_text){ 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)
} }
...@@ -440,8 +445,7 @@ ...@@ -440,8 +445,7 @@
let hour = (d.getHours() < 10) ? ("0" + d.getHours()) : d.getHours(); let hour = (d.getHours() < 10) ? ("0" + d.getHours()) : d.getHours();
let min = (d.getMinutes() < 10) ? ("0" + d.getMinutes()) : d.getMinutes(); let min = (d.getMinutes() < 10) ? ("0" + d.getMinutes()) : d.getMinutes();
let sec = (d.getSeconds() < 10) ? ("0" + d.getSeconds()) : d.getSeconds(); let sec = (d.getSeconds() < 10) ? ("0" + d.getSeconds()) : d.getSeconds();
let now = year + "年" + month + "月" + date + "日 " + hour + ":" + min + ":" + sec + "(星期" + days[day] + let now = year + "年" + month + "月" + date + "日 " + hour + ":" + min + ":" + sec;
")";
return now return now
}, },
...@@ -476,7 +480,8 @@ ...@@ -476,7 +480,8 @@
} }
.camera-box { .camera-box {
position: relative; position: absolute;
left:0;
width: 100%; width: 100%;
// height: 100vh; // height: 100vh;
z-index: 1; z-index: 1;
...@@ -499,13 +504,19 @@ ...@@ -499,13 +504,19 @@
padding: 20rpx; padding: 20rpx;
.txt { .txt {
margin-top:5rpx; margin-top: 5rpx;
line-height: 40rpx; line-height: 40rpx;
white-space: normal; white-space: normal;
font-size: 28rpx; font-size: 28rpx;
color: #fff; color: #fff;
.big{
&.big {
padding: 10rpx;
margin-bottom: 10rpx;
width: 430rpx;
line-height: 40rpx;
font-size: 32rpx; font-size: 32rpx;
background-color: rgba(34, 114, 255, 0.6);
} }
} }
} }
...@@ -514,9 +525,11 @@ ...@@ -514,9 +525,11 @@
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
z-index: 5; z-index: 5;
height: 160rpx; box-sizing: border-box;
height: 200rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 20rpx 78rpx; padding: 20rpx 78rpx;
...@@ -550,6 +563,8 @@ ...@@ -550,6 +563,8 @@
.page-mask { .page-mask {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
z-index: 1000; z-index: 1000;
width: 750rpx; width: 750rpx;
height: 100vh; height: 100vh;
...@@ -565,6 +580,8 @@ ...@@ -565,6 +580,8 @@
.btn-close { .btn-close {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
left: 0; left: 0;
right: 0; right: 0;
height: 200rpx; height: 200rpx;
......
take-order/static/photo/arrow.png

4.86 KB | W: | H:

take-order/static/photo/arrow.png

3.61 KB | W: | H:

take-order/static/photo/arrow.png
take-order/static/photo/arrow.png
take-order/static/photo/arrow.png
take-order/static/photo/arrow.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -35,11 +35,6 @@ function authorization(data) { ...@@ -35,11 +35,6 @@ function authorization(data) {
app.setUserData(res.data) app.setUserData(res.data)
resolve(res); resolve(res);
} else { } else {
uni.showModal({
title: '用户登录失败',
content: res.message,
showCancel: false
});
reject(res); reject(res);
} }
} else { } else {
......
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