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 {
settleRecommend: '',
navHeight: 0, //导航栏高度
rpxScreenHeight: 0,// 照相视框高度
safeHeight:0, // 安全高度
//拍照相关数据
photo: {
product: {
......@@ -165,6 +166,8 @@ export default {
this.globalData.navHeight = a.statusBarHeight / a.screenWidth * 750 + 90
this.globalData.rpxScreenHeight = a.screenHeight / a.screenWidth * 750
this.globalData.screenHeight = a.screenHeight
this.globalData.safeHeight = a.safeArea.bottom
console.log(a,'a')
} catch (a) {
}
},
......
......@@ -105,18 +105,10 @@ export default {
if (res && util.getToken()) {
that.goBackPage()
} else {
uni.showToast({
title: '授权失败,请重新授权',
icon: 'none'
});
this.setLoginStatus()
}
}).catch(res => {
uni.hideLoading()
uni.showToast({
title: res.message,
icon: 'none'
});
this.setLoginStatus()
})
},
......@@ -141,9 +133,13 @@ export default {
return login.signup(params);
}).then(res => {
uni.hideLoading()
if (util.getToken()) {
if (res && util.getToken()) {
that.goBackPage()
} else {
uni.showToast({
title: '授权失败,请重新授权',
icon: 'none'
});
this.setLoginStatus(false)
}
}).catch(res => {
......
<template>
<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="ph-pr-content">
<view v-for="(item,ikey) in dataItem.data"
:class="param[dataItem.type] === item.id ? 'select-item-view' : 'item-view'"
@click="itemClick(dataItem.type, item, ikey)" :key="item.id">
<text class="itemTitle">{{item.name}}</text>
</view>
</view>
</template>
</view>
<button class="ph-pr-button" type="primary" @click="handleClick" :disabled="!selectedAll"
:style="buttonStyle">下一步</button>
</view>
</template>
<script>
export default {
data() {
return {
classifyList: [],
systemList: [],
brandList: [],
param: {
classifyId: '',
systemId: '',
brandId: '',
},
brandName: '',
selectedAll: false,
}
},
computed: {
list() {
return [{
title: '请选择类别',
type: 'classifyId',
data: this.classifyList
},
{
title: '请选择系统',
type: 'systemId',
data: this.systemList
},
{
title: '请选择品牌',
type: 'brandId',
data: this.brandList
}
]
},
buttonStyle() {
return this.selectedAll ? 'color: #FFFFFF;background-color: #2272FF;' :
'color: #FFFFFF;background-color: #D1D4D4;'
}
},
onLoad(e) {
getApp().trackPage('选择产品页')
this.getRelationDictionaryV2()
},
onShareAppMessage(res) {
let shareObj = {
title: '',
path: '/pages/photo/product',
imageUrl: '',
success() {},
fail() {}
}
return shareObj
},
methods: {
getRelationDictionaryV2: function() {
this.$u.cloudApi.getRelationDictionaryV2().then(res => {
if (res && res.result) {
this.classifyList = res.result
this.param.classifyId = res.result[0].id
this.systemList = res.result[0].child
}
})
},
//选择 点击
itemClick: function(type, item, ikey) {
switch (type) {
case 'classifyId':
this.param = {
classifyId: item.id,
systemId: '',
brandId: ''
}
this.selectedAll = false
this.systemList = this.classifyList[ikey].child
this.brandList = []
break
case 'systemId':
this.param = {
classifyId: this.param.classifyId,
systemId: item.id,
brandId: ''
}
this.selectedAll = false
this.brandList = this.systemList[ikey].child
break
case 'brandId':
this.param.brandId = item.id
this.selectedAll = true
this.brandName = item.name
break
default:
break
}
},
// 点击下一步
handleClick() {
// 点击下一步设置全局拍照品牌品类
const globalData = getApp().globalData
if (!globalData.token) {
uni.navigateTo({
url:'/pages/login/wxlogin'
})
return
}
let keys = ['brandId', 'brandName', 'classifyId', 'systemId']
keys.map(key => {
globalData.photo.product[key] = this[key] || this.param[key]
})
uni.navigateTo({
url: '/pages/photo/list' +
'?brandId=' + this.param.brandId +
'&brand=' + this.brandName +
'&classifyId=' + this.param.classifyId +
'&systemId=' + this.param.systemId,
})
}
}
}
</script>
<style>
.backView {
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.topTitle {
margin-top: 50rpx;
padding-left: 30rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
}
.ph-pr-content {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
width: 100%;
padding: 22rpx 22rpx;
}
.ph-pr-arr {
width: 100%;
}
.item-view {
background-color: #FFFFFF;
/* width: 548rpx; */
margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%;
max-width: 33%; */
width: 222rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
border-radius: 12rpx;
font-size: 26rpx;
color: #666666;
}
.select-item-view {
background-color: #2272FF;
margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%;
max-width: 33%; */
width: 222rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
border-radius: 12rpx;
font-size: 26rpx;
color: #FFFFFF;
}
.ph-pr-button {
position: absolute;
bottom: 76rpx;
border-radius: 52rpx;
height: 104rpx;
font-size: 32rpx;
width: 600rpx;
line-height: 104rpx;
}
<template>
<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="ph-pr-content">
<view v-for="(item,ikey) in dataItem.data"
:class="param[dataItem.type] === item.id ? 'select-item-view' : 'item-view'"
@click="itemClick(dataItem.type, item, ikey)" :key="item.id">
<text class="itemTitle">{{item.name}}</text>
</view>
</view>
</template>
</view>
<u-button class="ph-pr-button" type="primary" shape="circle" @click="handleClick"
:hover-class="selectedAll ? '' : 'none'" :custom-style="buttonStyle">下一步</u-button>
</view>
</template>
<script>
export default {
data() {
return {
classifyList: [],
systemList: [],
brandList: [],
param: {
classifyId: '',
systemId: '',
brandId: '',
},
brandName: '',
selectedAll: false,
}
},
computed: {
list() {
return [{
title: '请选择类别',
type: 'classifyId',
data: this.classifyList
},
{
title: '请选择系统',
type: 'systemId',
data: this.systemList
},
{
title: '请选择品牌',
type: 'brandId',
data: this.brandList
}
]
},
buttonStyle() {
return this.selectedAll ? {
'color': '#FFFFFF',
'background-color': '#2272FF;',
'width': '600rpx',
'height': '104rpx'
} : {
'color': '#FFFFFF',
'background-color': '#D1D4D4;',
'width': '600rpx',
'height': '104rpx'
}
}
},
onLoad(e) {
getApp().trackPage('选择产品页')
this.getRelationDictionaryV2()
},
onShareAppMessage(res) {
let shareObj = {
title: '',
path: '/pages/photo/product',
imageUrl: '',
success() {},
fail() {}
}
return shareObj
},
methods: {
getRelationDictionaryV2: function() {
this.$u.cloudApi.getRelationDictionaryV2().then(res => {
if (res && res.result) {
this.classifyList = res.result
this.param.classifyId = res.result[0].id
this.systemList = res.result[0].child
}
})
},
//选择 点击
itemClick: function(type, item, ikey) {
switch (type) {
case 'classifyId':
this.param = {
classifyId: item.id,
systemId: '',
brandId: ''
}
this.selectedAll = false
this.systemList = this.classifyList[ikey].child
this.brandList = []
break
case 'systemId':
this.param = {
classifyId: this.param.classifyId,
systemId: item.id,
brandId: ''
}
this.selectedAll = false
this.brandList = this.systemList[ikey].child
break
case 'brandId':
this.param.brandId = item.id
this.selectedAll = true
this.brandName = item.name
break
default:
break
}
},
// 点击下一步
handleClick() {
// 点击下一步设置全局拍照品牌品类
if (!this.selectedAll) {
return
}
const globalData = getApp().globalData
if (!globalData.token) {
uni.navigateTo({
url: '/pages/login/wxlogin'
})
return
}
let keys = ['brandId', 'brandName', 'classifyId', 'systemId']
keys.map(key => {
globalData.photo.product[key] = this[key] || this.param[key]
})
uni.navigateTo({
url: '/pages/photo/list' +
'?brandId=' + this.param.brandId +
'&brand=' + this.brandName +
'&classifyId=' + this.param.classifyId +
'&systemId=' + this.param.systemId,
})
}
}
}
</script>
<style>
.backView {
background-color: #F4f5f7;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.topTitle {
margin-top: 50rpx;
padding-left: 30rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
}
.ph-pr-content {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
width: 100%;
padding: 22rpx 22rpx;
}
.ph-pr-arr {
width: 100%;
}
.item-view {
background-color: #FFFFFF;
/* width: 548rpx; */
margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%;
max-width: 33%; */
width: 222rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
border-radius: 12rpx;
font-size: 26rpx;
color: #666666;
}
.select-item-view {
background-color: #2272FF;
margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%;
max-width: 33%; */
width: 222rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
border-radius: 12rpx;
font-size: 26rpx;
color: #FFFFFF;
}
.ph-pr-button {
position: absolute;
bottom: 76rpx;
font-size: 32rpx;
}
</style>
<template>
<view class="backView">
<u-loading style="position: absolute;top: 50%;" :show="loading" size="36" mode="flower"></u-loading>
<view class="backView">
<u-loading style="position: fixed;top: 50%;" :show="loading" size="36" mode="flower"></u-loading>
<view class="topView">
<view :class="['topItemView', {'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)" v-for="(item,ikey) in dataList" :key="ikey">
<text
......@@ -12,15 +12,15 @@
<view class="right-view-title">拍照项有:</view>
<template v-for="(item,ikey) in rightList">
<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="">{{item.name}}</text>
<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> -->
</view>
<view class="rightImageView" v-if="item.imageList.length > 0 || item.images.length > 0">
<image class="rightImage" v-for="(image, index) in (item.imageList.length > 0 ? item.imageList : item.images)" :src="image" :key="image"
@click.stop="handleClickImage(item, index)" mode=""></image>
<view class="rightImageView" v-if="item.imageList.length > 0">
<image class="rightImage" v-for="(image, index) in item.imageList" :src="image" :key="image"
@click.stop="handleClickImage(item, index)" mode="aspectFill"></image>
</view>
</view>
</template>
......@@ -72,7 +72,7 @@
},
methods: {
getListData: function() {
getListData: function() {
this.loading = true
let that = this
this.$u.cloudApi.getGroupStandardV2({
......@@ -80,7 +80,7 @@
'classify_id': this.classifyId,
'system_id': this.systemId,
'brand_id': this.brandId
}).then(res => {
}).then(res => {
this.loading = false
if (res && res.result) {
that.handleData(res.result)
......@@ -93,17 +93,19 @@
const globalData = getApp().globalData
globalData.photo.productList = result
this.dataList = result
var item = result[0]
globalData.photo.waterSetting = item.userWatermark
this.rightList = item.list
if (result.length > 0) {
var item = result[0]
globalData.photo.waterSetting = item.userWatermark
this.rightList = item.list
}
},
//顶部点击
handleTopItemChange: function(ikey, item) {
this.activeTop = ikey
this.rightList = item.list
this.rightList = item.list
const photo = getApp().globalData.photo
photo.topIndex = ikey
photo.topIndex = ikey
photo.waterSetting = item.userWatermark
uni.pageScrollTo({
scrollTop: 0,
......@@ -114,7 +116,7 @@
// 点击图片
handleClickImage(item, index) {
uni.previewImage({
urls: item.imageList.length > 0 ? item.imageList : item.images,
urls: item.imageList,
current:index
})
},
......@@ -197,7 +199,8 @@
margin: 0rpx 30rpx 20rpx 30rpx;
padding: 36rpx 30rpx 18rpx 30rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
background-color: #FFFFFF;
min-height: 108rpx;
}
.ph-lst-item-index {
......@@ -210,28 +213,29 @@
text-align: center;
border-width: 1px;
border-style: solid;
margin-right: 10rpx;
margin-right: 10rpx;
margin-top: 4rpx;
}
.rightContentView {
display: flex;
align-items: center;
width: 100%;
font-size: 30rpx;
align-items: flex-start;
width: 100%;
font-size: 30rpx;
color: #2272FF;
/* flex-direction: column; */
/* border-left: 2rpx solid #F3F3F3; */
}
.rightContentView.active {
color: #666666;
border-color: #666666;
}
.rightContentView.active {
color: #666666;
border-color: #666666;
}
.ph-list-item-arrow {
position: absolute;
width: 56rpx;
height: 56rpx;
right: 30rpx;
width: 40rpx;
height: 40rpx;
right: 38rpx;
}
.rightContent {
......@@ -276,12 +280,11 @@
justify-content: center;
-webkit-flex: 1;
flex: 1;
background-color: #FFFFFF;
color: #999999;
}
.topItemView.active {
color: #2272FF;
background-color: #FFFFFF;
color: #999999;
}
.topItemView.active {
color: #2272FF;
}
.topItemTitle {
......
......@@ -7,6 +7,7 @@
<image class="btn" :src="btn_remake" @click="remakePhoto"></image>
<image class="btn" :src="btn_continue" @click="continuePhoto"></image>
</view>
<image class="btn finish" src="/static/photo/finish.png" @click="finishPhoto"></image>
</view>
</template>
......@@ -19,7 +20,7 @@
return {
protocolContent: '',
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: '',
images: [],
files: [],
......@@ -119,7 +120,12 @@
delta:1
})
},
finishPhoto(){
// 完成本项
uni.navigateBack({
delta:2
})
},
// 确认图片
continuePhoto() {
let self = this
......@@ -211,7 +217,7 @@
box-shadow: 0 0 1rpx 6rpx rgba(255,255,255,0.05);
background-color: #333333;
width: 100%;
padding:70rpx;
padding:70rpx 0;
position: fixed;
bottom: 0;
display: flex;
......@@ -223,4 +229,14 @@
height: 88rpx;
}
}
.btn{
display: block;
width: 232rpx;
height: 80rpx;
&.finish{
position: fixed;
top:30rpx;
right:30rpx;
}
}
</style>
<template>
<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="itemTitleView">
<text class="itemTitle">保存原图</text>
......@@ -24,7 +24,7 @@
<switch class="itemSwitch" :checked="item['enable']" @change="itemChange(item, ikey)" color="#007AFF" />
</view>
<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">
<text class="popTitle">设置自定义项</text>
<view class="inputBackView">
......@@ -48,12 +48,12 @@
<text class="popNoticeText u-m-t-20">示例:</text>
<text class="popNoticeText">工程队名称:蓝天工程队</text>
<view class="popBtnView">
<view class="popCancelBtn" @click="popCancelClick()">
<text class="popBtnText">取消</text>
</view>
<view class="popSaveBtn" @click="popSaveClick()">
<text class="popBtnText">保存</text>
</view>
<u-button :custom-style="customStyleCancel" hover-class="none" shape="circle" type="primary" @click="popCancelClick()">
取消
</u-button>
<u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="popSaveClick()">
保存
</u-button>
</view>
</view>
</u-popup>
......@@ -98,6 +98,21 @@
},
showTitleSwitch() {
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) {
......@@ -205,7 +220,12 @@
this.currenItem = {
'watemark_text': '',
'watemark_value': ''
}
}
},
handlePopClose() {
this.showTipLeft = false,
this.showTipRight = false
},
//自定义弹窗 保存
......@@ -395,10 +415,10 @@
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
justify-content: center;
}
.popCancelBtn {
/* .popCancelBtn {
background-color: #D1D4D4;
width: 280rpx;
height: 96rpx;
......@@ -407,9 +427,9 @@
display: flex;
align-items: center;
justify-content: center;
}
} */
.popSaveBtn {
/* .popSaveBtn {
background-color: #2272FF;
width: 280rpx;
height: 96rpx;
......@@ -418,11 +438,11 @@
display: flex;
align-items: center;
justify-content: center;
}
} */
.popBtnText {
/* .popBtnText {
font-size: 32rpx;
color: #FFFFFF;
font-weight: 600;
}
} */
</style>
<template>
<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-image @click="setCameraInfo('devicePosition')" class="icon" mode="aspectFit"
src="/static/photo/icon-switch.png"></cover-image>
......@@ -11,9 +11,10 @@
</cover-view>
</cover-view>
<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="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 u-m-t-10">维度:{{waterInfo.latitude || '正在获取中...'}}</cover-view>
<cover-view class="txt u-m-t-10">地址:{{waterInfo.address || '正在获取中...'}}</cover-view>
......@@ -28,9 +29,9 @@
</cover-view>
<canvas canvas-id="canvas" id="photoCanvas" class="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" />
<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">
</cover-image>
</view>
......@@ -58,7 +59,7 @@
'https://qn-static.banshouhui.com/live_mark.png'
],
},
standardShow: false,
standardShow: true,
cameraInfo: {
devicePosition: 'back',
flash: 'auto'
......@@ -79,12 +80,13 @@
camera: false, // 相机授权
location: false, // 位置授权
},
navHeight: 0,
navHeight: 130,
cameraWidth: 750,
cameraHeight: 1000, // (4 / 3 * 750) 图片比例4:3
ratio: 0,
cameraChange: true,
waterSetting:null,
cameraChange: false,
waterSetting: null,
shadowInitShow: true, // 第一次进入页面需显示弹窗
}
},
onLoad(e) {
......@@ -95,20 +97,21 @@
this.updateTime()
this.getLocation()
this.getMarkPath()
this.initData()
this.currentItem = photo.currentItem
},
computed: {
titleTxt(){
titleTxt() {
const waterSetting = this.waterSetting
let txt = ''
if(!waterSetting || !waterSetting.lower_right){
if (!waterSetting || !waterSetting.lower_right) {
return ''
}
txt = waterSetting.lower_right && waterSetting.lower_right.title_text || ''
console.log(txt,'title_text','waterSetting',waterSetting)
return txt
},
settingTxtArr(){
settingTxtArr() {
let arr = []
// 包含经纬度
const waterInfo = this.waterInfo
......@@ -132,32 +135,21 @@
}
}
})
console.log(settingTxtArr,'settingTxtArr')
return settingTxtArr
}
},
watch: {
'authSetting.camera'(val) {
if (val) {
// this.cameraChange = true
}
},
},
watch: {},
onShow() {
this.initData()
// this.standardShow = true
// this.cameraHeight = globalData.rpxScreenHeight
// uni.authorize({
// scope: 'scope.writePhotosAlbum',
// success() {
// console.log('userLocation')
// // uni.getLocation()
// }
// })
// 默认开启弹窗
this.standardShow = this.shadowInitShow
// this.initData()
},
methods: {
closeShadow() {
this.shadowInitShow = false
this.standardShow = false
},
goBack() {
uni.navigateBack({
delta: 1
......@@ -168,7 +160,6 @@
},
goPage(url) {
url = url || '/pages/photo/index';
console.log(url, 'url')
uni.navigateTo({
url: url
})
......@@ -195,15 +186,19 @@
break;
}
console.log(type, 'type', val, 'val')
this.cameraInfo[type] = val
},
initData() {
this.standardShow = true
const globalData = getApp().globalData
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.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
},
baiduLocation() {
......@@ -217,7 +212,7 @@
waterInfo.address = i
},
fail: function(err) {
console.log(err, 'err')
// console.log(err, 'err')
}
};
if (waterInfo.latitude && waterInfo.longitude) {
......@@ -232,7 +227,7 @@
const {
errMsg
} = e.detail
console.log(e.detail, 'e.detail')
// console.log(e.detail, 'e.detail')
if (errMsg !== 'insertCamera:fail auth deny') {
return
}
......@@ -247,7 +242,7 @@
success: function(res) {
waterInfo.longitude = parseFloat(res.longitude).toFixed(4)
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()
},
fail(err) {
......@@ -257,7 +252,7 @@
});
},
showSettingModal(type) {
console.log(type, 'showModal-type')
// console.log(type, 'showModal-type')
type = type || 'camera'
const self = this
let authSetting = {
......@@ -293,7 +288,6 @@
this.cameraChange = false
wx.openSetting({
success(res) {
console.log(res, 'res-setting')
const authSetting = res.authSetting
self.cameraChange = true
if (authSetting['scope.userLocation']) {
......@@ -301,7 +295,6 @@
self.authSetting.location = true
self.getLocation()
}
console.log(self.cameraChange, 'this.cameraChange')
if (res.authSetting['scope.camera']) {
self.authSetting.camera = true
}
......@@ -346,6 +339,8 @@
const waterSetting = this.waterSetting
const globalTempPath = getApp().globalData.photo.tempPath
const ratio = this.ratio
console.log(this.ratio,'this.ratio')
// const ratio = 0.5
let canvasWidth = this.cameraWidth * ratio
let canvasHeight = this.cameraHeight * ratio
const waterInfo = this.waterInfo
......@@ -360,27 +355,37 @@
let h = 1
//加入 水印文字
for (let i = settingTxtArr.length-1; i >=0; i--) {
txtHeight = 18
canvas.setFontSize(14)
for (let i = settingTxtArr.length - 1; i >= 0; i--) {
txtHeight = 20
canvas.setFontSize(16)
canvas.setFillStyle('#f2f2f2')
let txt = settingTxtArr[i]
if(txt.length>14){
canvas.fillText(txt.substr(0,14), 10, canvasHeight - txtHeight * h++);
canvas.fillText(txt.substr(14,14), 10, canvasHeight - txtHeight * h++);
}else{
canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
// if(txt.length>14){
// canvas.fillText(txt.substr(14,18), 10, canvasHeight - txtHeight * h++);
// canvas.fillText(txt.substr(0,18), 10, canvasHeight - txtHeight * h++);
// }else{
// 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
if(title){
txtHeight = 20
if (title) {
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.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)
}
......@@ -440,8 +445,7 @@
let hour = (d.getHours() < 10) ? ("0" + d.getHours()) : d.getHours();
let min = (d.getMinutes() < 10) ? ("0" + d.getMinutes()) : d.getMinutes();
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
},
......@@ -476,7 +480,8 @@
}
.camera-box {
position: relative;
position: absolute;
left:0;
width: 100%;
// height: 100vh;
z-index: 1;
......@@ -499,13 +504,19 @@
padding: 20rpx;
.txt {
margin-top:5rpx;
margin-top: 5rpx;
line-height: 40rpx;
white-space: normal;
font-size: 28rpx;
color: #fff;
.big{
&.big {
padding: 10rpx;
margin-bottom: 10rpx;
width: 430rpx;
line-height: 40rpx;
font-size: 32rpx;
background-color: rgba(34, 114, 255, 0.6);
}
}
}
......@@ -514,9 +525,11 @@
position: absolute;
left: 0;
right: 0;
bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
z-index: 5;
height: 160rpx;
box-sizing: border-box;
height: 200rpx;
display: flex;
justify-content: space-between;
padding: 20rpx 78rpx;
......@@ -550,6 +563,8 @@
.page-mask {
position: fixed;
bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
z-index: 1000;
width: 750rpx;
height: 100vh;
......@@ -565,6 +580,8 @@
.btn-close {
position: absolute;
bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
left: 0;
right: 0;
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) {
app.setUserData(res.data)
resolve(res);
} else {
uni.showModal({
title: '用户登录失败',
content: res.message,
showCancel: false
});
reject(res);
}
} 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