Commit 2cb5a458 authored by 和慭琛's avatar 和慭琛

准备提测版

parent 8134a94e
......@@ -5,7 +5,15 @@
},
*/
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/photo/product",
"style": {
"navigationBarTitleText": "选择产品"
}
},
{
"path": "pages/photo/try",
"style": {
......@@ -13,12 +21,7 @@
}
},
{
"path": "pages/photo/product",
"style": {
"navigationBarTitleText": "选择产品"
}
},
{
"path": "pages/photo/detail",
......
......@@ -20,6 +20,8 @@
image_count:1,
current_count:1,
current_image:'',
done_count:0,
images:[],
icon_gotake:'https://qn-static.banshouhui.com/gotake.png',
icon_arrow_down:'https://qn-static.banshouhui.com/arrow_down.png',
}
......@@ -27,6 +29,11 @@
onLoad(e) {
this.initData(e)
},
onShow(){
this.checkDoneCount()
},
methods: {
initData: function (e) {
......@@ -43,6 +50,12 @@
this.current_count = e.current_count
}
if(e && e.images){
this.images = JSON.parse(e.images)
console.log('images:')
console.log(this.images)
}
uni.setNavigationBarTitle({
title: '走线照片 (' + this.current_count + '/'+ this.image_count + ')'
})
......@@ -53,6 +66,34 @@
})
},
//检查已拍照数量
checkDoneCount: function (){
let pages = getCurrentPages();
let currPage = pages[pages.length-1];
console.log('是否清除:')
//console.log(currPage.data.isClean)
if (currPage.data.done_count == this.image_count){
console.log('已拍完 所有数量照片')
uni.showToast({
icon:'none',
title:'已拍完所有照片'
})
setTimeout(function() {
uni.navigateBack({
})
}, 2000);
}else{
console.log('没有拍完 所有数量照片')
this.current_count = currPage.data.done_count
this.current_image = this.images[currPage.data.done_count]
}
},
//照片预览
imageClick: function (image) {
uni.previewImage({
......
......@@ -99,11 +99,13 @@
//右侧点击
rightItemClick: function (item,ikey) {
var current_image = item.images[ikey]
var current_count = ikey + 1
uni.navigateTo({
url:'/pages/photo/detail'
+'?current_image=' + current_image
+'&image_count=' + item.image_count
+'&current_count=' + ikey,
+'&current_count=' + current_count
+'&images=' + JSON.stringify(item.images) ,
})
},
......
......@@ -153,15 +153,36 @@
this.canvas.draw()
//加入 水印文字
this.canvas.setFontSize(18)
this.canvas.setFillStyle('#8a2929')
this.canvas.setFontSize(12)
this.canvas.setFillStyle('#FFFFFF')
//this.canvas.rotate(30 * Math.PI / 180);
let textToWidth = res.width * 0.5;
let textToHeight = res.height * 0.3;
this.canvas.fillText('我是水印', 100, 100)
//let textToWidth = res.width * 0.5;
//let textToHeight = res.height * 0.3;
var currentHeight = res.height-20
//加入 水印图片
this.canvas.drawImage(this.markPath, 0, 0, res.width / 3, res.height / 3)
//时间
var date = '时间:' + this.date
this.canvas.fillText(date, 20, currentHeight)
//地址
currentHeight = currentHeight - 20
var address = '地址:' + this.address
this.canvas.fillText(address, 20, currentHeight)
//纬度
currentHeight = currentHeight - 20
var latitude = '纬度:' + this.latitude
this.canvas.fillText(latitude, 20, currentHeight)
//经度
currentHeight = currentHeight - 20
var longitude = '经度:' + this.longitude
this.canvas.fillText(longitude, 20, currentHeight)
//加入 水印图片
let mark_x = res.width / 4
let mark_y = res.height / 2
this.canvas.drawImage(this.markPath, mark_x, mark_y, 180, 45)
this.canvas.draw()
......@@ -199,10 +220,10 @@
setTimeout(function() {
that.saveToLocal(ress.tempFilePath)
uni.previewImage({
urls: [ress.tempFilePath],
current:0
});
// uni.previewImage({
// urls: [ress.tempFilePath],
// current:0
// });
......@@ -228,13 +249,24 @@
//第五步: 保存到本地相册
saveToLocal(tempImagePath) {
let that = this
uni.saveImageToPhotosAlbum({
filePath:tempImagePath,
success() {
console.log('保存本地相册 成功')
uni.showToast({
icon:'none',
title:'已将照片保存到本地相册'
})
that.goBack()
},
fail() {
console.log('保存本地相册 失败')
uni.showToast({
icon:'none',
title:'保存本地相册失败'
})
that.goBack()
}
})
},
......@@ -242,6 +274,13 @@
//第六步 返回上层界面
goBack: function(){
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
prevPage.$vm.done_count ++;
uni.navigateBack({
})
},
//获取当前时间
......
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