Commit 63474fe0 authored by Facius's avatar Facius

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

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