Commit 733b1ddb authored by 和慭琛's avatar 和慭琛

BUG修改

parent 32558250
......@@ -15,10 +15,10 @@
//https://system.dev.banshouhui.com
//正式环境
domain_Name: 'https://system.banshouhui.com',
//domain_Name: 'https://system.banshouhui.com',
//测试环境
//domain_Name: 'https://system.dev.banshouhui.com',
domain_Name: 'https://system.dev.banshouhui.com',
//http://192.168.0.208:8192
//小青本地环境
......
......@@ -6,7 +6,16 @@
*/
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "下单"
}
},
{
"path": "pages/photo/product",
"style": {
......@@ -50,13 +59,7 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "下单"
}
},
{
......@@ -123,6 +126,13 @@
"navigationBarTitleText": "下载APP"
}
},
{
"path": "pages/take/index",
"style": {
"navigationBarTitleText": "接单"
}
},
{
......
......@@ -24,6 +24,8 @@
images:[],
icon_gotake:'https://qn-static.banshouhui.com/gotake.png',
icon_arrow_down:'https://qn-static.banshouhui.com/arrow_down.png',
ifFirst:true,
last_done_count:0,
}
},
onLoad(e) {
......@@ -31,7 +33,11 @@
},
onShow(){
this.checkDoneCount()
if(this.isFirst == false){
this.checkDoneCount()
}
},
methods: {
......@@ -68,8 +74,12 @@
//检查已拍照数量
checkDoneCount: function (){
let pages = getCurrentPages();
let currPage = pages[pages.length-1];
this.done_count = currPage.data.done_count
console.log('是否清除:')
//console.log(currPage.data.isClean)
if (currPage.data.done_count == this.image_count){
......@@ -87,9 +97,19 @@
}else{
console.log('没有拍完 所有数量照片')
this.current_count = currPage.data.done_count
this.current_image = this.images[currPage.data.done_count]
if(this.done_count != this.last_done_count ){
this.last_done_count = this.done_count
console.log('没有拍完 所有数量照片')
this.current_count = currPage.data.done_count + 1
this.current_image = this.images[currPage.data.done_count + 1]
uni.setNavigationBarTitle({
title: '走线照片 (' + this.current_count + '/'+ this.image_count + ')'
})
}
}
},
......@@ -103,6 +123,7 @@
//拍照 点击
takeClick: function () {
this.isFirst = false
uni.navigateTo({
url:'/pages/photo/try'
})
......
......@@ -7,7 +7,7 @@
</view>
</view>
<view class="rightView">
<view class="rightItemView" @click="rightItemClick(item,ikey)" v-for="(item,ikey) in rightList":key="ikey">
<view :class=" item.isClicked == true ? 'rightItemView FAbackColor' : 'rightItemView' " @click="rightItemClick(item,ikey)" v-for="(item,ikey) in rightList":key="ikey">
<view :class=" item.images ? 'rightContentView width_50' : 'rightContentView width_100' ">
<text class="rightTitle u-m-t-30 u-m-l-30">{{item.name}} ({{item.image_count}}张)</text>
<text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text>
......@@ -64,6 +64,12 @@
},
onShow() {
console.log('onShow 里的rightList:')
console.log(this.rightList)
},
methods: {
getListData: function (){
......@@ -85,7 +91,20 @@
},
handleData: function (res){
this.dataList = res.result
this.dataList.forEach(item => {
item.list.forEach(subItem => {
subItem.isClicked = false
})
})
console.log('添加 新字段 后的数组:')
console.log(this.dataList)
var item = res.result[0]
this.rightList = item.list
},
......@@ -98,8 +117,20 @@
//右侧点击
rightItemClick: function (item,ikey) {
var current_image = item.images[ikey]
var current_count = ikey + 1
// for (let i = 0; i < this.rightList.length; i++) {
// var subItem = this.rightList[i]
// if(i == ikey){
// subItem.isClicked = true
// }
// }
item.isClicked = true
console.log('点击事件 里的rightList:')
console.log(this.rightList)
var current_image = item.images[0]
var current_count = 1
uni.navigateTo({
url:'/pages/photo/detail'
+'?current_image=' + current_image
......@@ -180,6 +211,14 @@
border-left: 2rpx solid #F3F3F3;
}
.rightActiveContentView{
background-color: #4CD964;
display: flex;
flex-direction: column;
border-left: 2rpx solid #F3F3F3;
}
.width_50{
width: 480rpx;
}
......@@ -200,7 +239,6 @@
}
.rightImageView{
background-color: #FFFFFF;
width: 300rpx;
height: 320rpx;
display: flex;
......@@ -253,6 +291,9 @@
padding-left: 30rpx;
}
.greenBackColor{
background-color: #4CD964;
}
......
......@@ -3,10 +3,10 @@
<view class="">
<camera device-position="back" flash="off" style='width:100%; height:100vh;'>
<cover-view class="locationView">
<cover-view class="locationText u-m-l-20 u-m-t-30">经度:{{longitude}}</cover-view>
<cover-view class="locationText u-m-l-20 u-m-t-10">维度:{{latitude}}</cover-view>
<cover-view class="locationText u-m-l-20 u-m-t-10">地址:{{address}}</cover-view>
<cover-view class="locationText u-m-l-20 u-m-t-10">时间:{{date}}</cover-view>
<cover-view class="locationText u-m-l-20 u-m-t-30">{{longitude}}</cover-view>
<cover-view class="locationText u-m-l-20 u-m-t-10">{{latitude}}</cover-view>
<cover-view class="locationText u-m-l-20 u-m-t-10">{{address}}</cover-view>
<cover-view class="locationText u-m-l-20 u-m-t-10">{{date}}</cover-view>
</cover-view>
<cover-image class="liveWatermarkNormal" mode="aspectFit" :src="liveWaterMarkImage"></cover-image>
</camera>
......@@ -14,7 +14,7 @@
<cover-image class="backIcon" :src="icon_arrow_down" mode="" @click="goBack"></cover-image>
<!--cover-image class='switchIcon' :src='icon_switch_white' @click="switchClick()"> </cover-image-->
<cover-image class='takeIcon' :src='icon_take' @click="takePhoto()"> </cover-image>
<!--cover-image class='flashIcon' :src='icon_light_on_white' @click="flashClick()"> </cover-image-->
</cover-view>
<canvas v-show='showImage' canvas-id="canvas" :style="{'width':canvasWidth+'px','height': canvasHeight + 'px'}"></canvas>
......@@ -26,13 +26,7 @@
</template>
<script>
let r = require("../../libs/bmap-wx.min.js");
let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak:"lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
export default {
data() {
return {
title: '',
......@@ -41,10 +35,10 @@
image: "",
showImage: false,
canvas: null,
longitude: '正在获取中...',
latitude: '正在获取中...',
address: '正在获取中...',
date: '正在获取中...',
longitude: '经度:正在获取中...',
latitude: '纬度:正在获取中...',
address: '地址:正在获取中...',
date: '时间:正在获取中...',
icon_location: 'https://qn-static.banshouhui.com/take_order/icon/location.png',
scale: "4_3",
icon_take: 'https://qn-static.banshouhui.com/take.png',
......@@ -56,9 +50,9 @@
width: '',
height: '',
markPath: '',
canvasWidth: 0,
canvasHeight: 0,
restuleImage: '',
canvasWidth:0,
canvasHeight:0,
restuleImage:'',
}
},
onLoad(e) {
......@@ -67,7 +61,6 @@
this.getLocation()
this.getMarkPath()
this.getSystemInfo()
// this.baiduLocation()
uni.setNavigationBarColor({
frontColor: '#FFFFFF',
backgroundColor: '#333333',
......@@ -75,47 +68,25 @@
//this.address = ''
},
methods: {
baiduLocation() {
let a = this,
t = function() {
let t = {
success: function(res) {
let e = res.wxMarkerData[0];
let i = e.address;
a.address = i
// a.setData({
// addressValue: i
// }), o.globalData.addressValue = i, a.initWatermarkBoxHeightAndWidth();
},
fail: function(a) {
console.log(a,'a')
// n.error(a), console.log(a);
}
};
if (a.latitude && a.longitude) {
let e = a.latitude + "," + a.longitude;
// // let e = "113.88308" + ',' + "22.55329"
// let e = "22.55329" + ',' + "113.88308"
t.location = e;
}
h.regeocoding(t);
};
t()
},
goPage() {
goPage(){
// 进入图片预览页
},
goBack() {
goBack(){
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
prevPage.$vm.done_count ++;
uni.navigateBack({
delta: 1
delta: 2
});
},
getSystemInfo() {
// 获取设备信息
try {
const res = uni.getSystemInfoSync();
this.canvasWidth = res.windowWidth * 2
this.canvasHeight = res.windowHeight * 2
this.canvasWidth = res.windowWidth*2
this.canvasHeight = res.windowHeight*2
} catch (e) {
// error
}
......@@ -133,9 +104,8 @@
uni.getLocation({
type: 'wgs84',
success: function(res) {
that.longitude = res.longitude
that.latitude = res.latitude
that.baiduLocation()
that.longitude = '经度:' + res.longitude
that.latitude = '纬度:' + res.latitude
}
});
},
......@@ -163,8 +133,11 @@
this.ctx.takePhoto({
quality: 'high',
success: (res) => {
that.drawCanvas(res.tempImagePath)
// this.getImageInfo(res.tempImagePath)
console.log(res)
//this.imageChange(res)
this.getImageInfo(res.tempImagePath)
//this.saveToLocal(res.tempImagePath)
}
});
},
......@@ -187,7 +160,7 @@
},
//第三步: 绘制画布
drawCanvas: function(tempImagePath) {
drawCanvas: function(tempImagePath, res) {
uni.showLoading({
title: '数据处理中...',
icon: 'loading'
......@@ -205,13 +178,13 @@
this.canvas.setFontSize(28)
this.canvas.setFillStyle('#f2f2f2')
let h = 1
let txtHeight = 36
this.canvas.fillText('维度: ' + this.latitude, 20, canvasHeight - txtHeight * h++);
this.canvas.fillText('经度: ' + this.longitude, 20, canvasHeight - txtHeight * h++);
this.canvas.fillText('地址: ' + this.address, 20, canvasHeight - txtHeight * h++);
this.canvas.fillText('时间: ' + this.date, 20, canvasHeight - txtHeight * h++);
let txtHeight=36
this.canvas.fillText('经度' + this.longitude, 20, canvasHeight - txtHeight * h++);
this.canvas.fillText('维度' + this.latitude, 20, canvasHeight - txtHeight * h++);
this.canvas.fillText('地址' + this.address, 20, canvasHeight - txtHeight * h++);
this.canvas.fillText('时间' + this.date, 20, canvasHeight - txtHeight * h++);
//加入 水印图片
this.canvas.drawImage(this.markPath, canvasWidth / 2 - 200, canvasHeight / 2 - 50, 400, 100)
this.canvas.drawImage(this.markPath, canvasWidth/2-200, canvasHeight/2 - 50, 400, 100)
this.canvasImage()
// this.canvas.draw()
......@@ -238,19 +211,18 @@
canvasId: 'canvas',
success: (res) => {
self.saveToLocal(res.tempFilePath)
// this.$emit('canvasImage', res.tempFilePath);
// if (this.showPreview) {
// this.restultImage = res.tempFilePath
// this.restultImage = res.tempFilePath
// self.showPreviewFn(res.tempFilePath);
// }
},
fail: (res) => {
uni.hideLoading();
console.log(res);
},
complete: () => {
// uni.hideLoading();
uni.hideLoading();
}
}, this);
}, 500);
......@@ -264,24 +236,24 @@
},
//第五步: 保存到本地相册
saveToLocal(tempImagePath) {
let that = this
let that = this
uni.saveImageToPhotosAlbum({
filePath: tempImagePath,
success() {
uni.hideLoading();
uni.showToast({
title: '已将照片保存到本地相册'
icon:'none',
title:'已将照片保存到本地相册'
})
let timer = setTimeout(() => {
let timer = setTimeout(()=>{
that.goBack()
}, 0)
},0)
},
fail() {
// console.log('保存本地相册 失败')
uni.showToast({
icon: 'none',
title: '保存本地相册失败'
icon:'none',
title:'保存本地相册失败'
})
}
})
......@@ -386,7 +358,7 @@
position: fixed;
left: 60rpx;
bottom: 50rpx;
border: 2rpx solid #aaa;
border:2rpx solid #aaa;
}
.showCanvas {
......
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