Commit 5e8370c8 authored by Facius's avatar Facius

Merge branch 'dev-photo-v2' of https://git.banshouhui.com/heyinchen/take_order into dev-photo-v2

parents 5da8f3bf de223b82
...@@ -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 => {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</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="closeShadow"> <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">
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
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,
...@@ -106,7 +106,6 @@ ...@@ -106,7 +106,6 @@
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(){
...@@ -133,18 +132,11 @@ ...@@ -133,18 +132,11 @@
} }
} }
}) })
console.log(settingTxtArr,'settingTxtArr')
return settingTxtArr return settingTxtArr
} }
}, },
watch: { watch: {},
'authSetting.camera'(val) {
if (val) {
// this.cameraChange = true
}
},
},
onShow() { onShow() {
this.initData() this.initData()
// this.standardShow = true // this.standardShow = true
...@@ -173,7 +165,6 @@ ...@@ -173,7 +165,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
}) })
...@@ -200,12 +191,12 @@ ...@@ -200,12 +191,12 @@
break; break;
} }
console.log(type, 'type', val, 'val')
this.cameraInfo[type] = val this.cameraInfo[type] = val
}, },
initData() { initData() {
const globalData = getApp().globalData const globalData = getApp().globalData
this.navHeight = globalData.navHeight // this.navHeight = parseInt(globalData.navHeight)
console.log(globalData.navHeight,'globalData.navHeight')
this.ratio = globalData.screenHeight / globalData.rpxScreenHeight this.ratio = globalData.screenHeight / globalData.rpxScreenHeight
this.waterSetting = globalData.photo.waterSetting this.waterSetting = globalData.photo.waterSetting
if(this.shadowInitShow){ if(this.shadowInitShow){
...@@ -224,7 +215,7 @@ ...@@ -224,7 +215,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) {
...@@ -239,7 +230,7 @@ ...@@ -239,7 +230,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
} }
...@@ -254,7 +245,7 @@ ...@@ -254,7 +245,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) {
...@@ -264,7 +255,7 @@ ...@@ -264,7 +255,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 = {
...@@ -300,7 +291,6 @@ ...@@ -300,7 +291,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']) {
...@@ -308,7 +298,6 @@ ...@@ -308,7 +298,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
} }
...@@ -368,8 +357,8 @@ ...@@ -368,8 +357,8 @@
//加入 水印文字 //加入 水印文字
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){
...@@ -392,9 +381,9 @@ ...@@ -392,9 +381,9 @@
canvas.setFillStyle('#f2f2f2') canvas.setFillStyle('#f2f2f2')
// canvas.setTextAlign('center') // canvas.setTextAlign('center')
if(title.length>14){ if(title.length>14){
canvas.fillText(title.substr(14,14), 10, canvasHeight - txtHeight * h++); canvas.fillText(title.substr(14,14), 10, canvasHeight - txtHeight * h++ + 20);
} }
canvas.fillText(title.substr(0,14), 10, canvasHeight - txtHeight * h++ - titleHeight/2); 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){
//加入 水印图片 //加入 水印图片
...@@ -456,8 +445,7 @@ ...@@ -456,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
}, },
......
...@@ -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