Commit 63474fe0 authored by Facius's avatar Facius

大图预览页不再单独做成一个页面

parent 539511b9
......@@ -153,9 +153,9 @@
{
"path": "pages/photo/detail",
"style": {
"navigationBarTitleText": "图片展示",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7",
"navigationBarTitleText": "图片展示",
"navigationBarBackgroundColor": "#333333",
"navigationBarTextStyle": "#FFFFFF",
"disableScroll": true
}
},
......
<template>
<view class="backView">
<!-- <view class="topView">
text class="topTitle">示范照片 ({{currentNumber}}/{{totalNumber}})</text
</view> -->
<view class="topView">
<!--text class="topTitle">示范照片 ({{currentNumber}}/{{totalNumber}})</text-->
</view>
<view class="wrap">
<u-swiper
@click="imageClick"
@change="changeSwipter"
img-mode="aspectFit"
bg-color="#000000"
height="100%"
:list="swiperList"
bg-color="#333333"
:height="600" :list="swiperList"
:autoplay="false"
:circular='false'
mode="dot"
:current="done_count"
></u-swiper>
</view>
<!-- <view class="bottomView">
<view class="bottomView">
<image class="takeView" :src="icon_gotake" mode="" @click="takeClick"></image>
<image class="backIcon" :src="icon_arrow_down" mode="" @click="backClick"></image>
</view> -->
</view>
</view>
</template>
......@@ -44,12 +43,12 @@
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',
// ifFirst:true,
// last_done_count:0,
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,
swiperList:[],
// windowHeight:0,
windowHeight:0,
title:''
}
},
......@@ -80,14 +79,14 @@
this.initData(e)
},
// onShow(){
onShow(){
// if(this.isFirst == false){
// this.checkDoneCount()
// }
if(this.isFirst == false){
this.checkDoneCount()
}
// },
},
methods: {
initData: function (e) {
......@@ -101,11 +100,11 @@
}
if(e && e.current_count){
this.done_count = Math.max(e.current_count - 1, 0)
this.done_count = e.current_count
}
if(e && e.current_count){
this.current_count = e.current_count
this.current_count = Math.max(e.current_count - 1, 0)
}
if(e && e.images){
......@@ -115,14 +114,16 @@
if(e && e.title){
this.title = e.title
if(this.title.length>5){
this.title = this.title.substr(0,5) + '...'
if(this.title.length>6){
this.title = this.title.substr(0,6) + '...'
}
}
uni.setNavigationBarTitle({
title: this.title + '(' + this.current_count + '/'+ this.image_count + ')'
title: this.title + ' (' + this.current_count + '/'+ this.image_count + ')'
})
uni.setNavigationBarColor({
......@@ -131,75 +132,75 @@
})
},
// //检查已拍照数量
// checkDoneCount: function (){
//检查已拍照数量
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){
// console.log('已拍完 所有数量照片')
// uni.showToast({
// icon:'none',
// title:'已拍完此项照片'
// })
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){
console.log('已拍完 所有数量照片')
uni.showToast({
icon:'none',
title:'已拍完此项照片'
})
// setTimeout(function() {
// uni.navigateBack({
setTimeout(function() {
uni.navigateBack({
// })
// }, 2000);
})
}, 2000);
// }else{
}else{
// if(this.done_count != this.last_done_count ){
// console.log('没有拍完 所有数量照片')
// this.last_done_count = this.done_count
// this.current_count = currPage.data.done_count + 1
// this.current_image = this.images[currPage.data.done_count]
// console.log('没有拍完 所有数量照片 current_count:'+this.current_count)
// console.log('没有拍完 所有数量照片 current_image:'+this.current_image)
// uni.setNavigationBarTitle({
// title: this.title + '(' + this.current_count + '/'+ this.image_count + ')'
// })
if(this.done_count != this.last_done_count ){
console.log('没有拍完 所有数量照片')
this.last_done_count = this.done_count
this.current_count = currPage.data.done_count + 1
this.current_image = this.images[currPage.data.done_count]
console.log('没有拍完 所有数量照片 current_count:'+this.current_count)
console.log('没有拍完 所有数量照片 current_image:'+this.current_image)
uni.setNavigationBarTitle({
title: this.title + ' (' + this.current_count + '/'+ this.image_count + ')'
})
// }
}
// }
}
// },
},
//照片预览
imageClick: function (index) {
let currentImg = this.images[index]
uni.previewImage({
urls: this.images,
urls: [currentImg],
current:index
})
},
changeSwipter(index){
let txt = this.title + '(' + (index + 1) + '/'+ this.image_count + ')'
let txt = '走线照片 (' + (index + 1) + '/'+ this.image_count + ')'
uni.setNavigationBarTitle({
title: txt
})
},
// //拍照 点击
// takeClick: function () {
// this.isFirst = false
// uni.navigateTo({
// url:'/pages/photo/try'
// })
// },
//拍照 点击
takeClick: function () {
this.isFirst = false
uni.navigateTo({
url:'/pages/photo/try'
})
},
// //返回 点击
// backClick: function () {
// uni.navigateBack({
//返回 点击
backClick: function () {
uni.navigateBack({
// })
// },
})
},
}
......@@ -209,13 +210,12 @@
<style>
.wrap {
width:100%;
/* height:calc(100vh - 600rpx); */
height: 100%;
background-color:#000000;
height:calc(100vh - 600rpx);
background-color:#333;
/* padding:0 40rpx; */
}
.backView{
background-color: #F4F5F7;
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
......@@ -226,11 +226,7 @@
align-items: center;
}
.u-swiper-wrap {
height: 100%;
}
/*.topView{
.topView{
background-color: #333333;
width: 100%;
height: 12%;
......@@ -295,5 +291,5 @@
left: 60rpx;
bottom: 50rpx;
}
*/
</style>
......@@ -100,17 +100,6 @@
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
},
......@@ -127,13 +116,17 @@
// 点击图片
handleClickImage(item, image, index) {
uni.navigateTo({
url: '/pages/photo/detail' +
'?current_image=' + image +
'&image_count=' + item.images.length +
'&current_count=' + (index + 1) +
'&images=' + JSON.stringify(item.images) +
'&title=' + item.name,
// uni.navigateTo({
// url: '/pages/photo/detail' +
// '?current_image=' + image +
// '&image_count=' + item.images.length +
// '&current_count=' + (index + 1) +
// '&images=' + JSON.stringify(item.images) +
// '&title=' + item.name,
// })
uni.previewImage({
urls: item.images,
current:index
})
},
......
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