Commit 19990dc6 authored by Facius's avatar Facius

大图预览

parent 41b4fb7c
......@@ -153,9 +153,9 @@
{
"path": "pages/photo/detail",
"style": {
"navigationBarTitleText": "图片展示",
"navigationBarBackgroundColor": "#333333",
"navigationBarTextStyle": "#FFFFFF",
"navigationBarTitleText": "图片展示",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7",
"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="#333333"
:height="600" :list="swiperList"
bg-color="#000000"
height="100%"
: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>
......@@ -43,12 +44,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:''
}
},
......@@ -79,14 +80,14 @@
this.initData(e)
},
onShow(){
// onShow(){
if(this.isFirst == false){
this.checkDoneCount()
}
// if(this.isFirst == false){
// this.checkDoneCount()
// }
},
// },
methods: {
initData: function (e) {
......@@ -114,16 +115,14 @@
if(e && e.title){
this.title = e.title
if(this.title.length>6){
this.title = this.title.substr(0,6) + '...'
if(this.title.length>5){
this.title = this.title.substr(0,5) + '...'
}
}
uni.setNavigationBarTitle({
title: this.title + ' (' + this.current_count + '/'+ this.image_count + ')'
title: this.title + '(' + this.current_count + '/'+ this.image_count + ')'
})
uni.setNavigationBarColor({
......@@ -132,75 +131,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: [currentImg],
urls: this.images,
current:index
})
},
changeSwipter(index){
let txt = '走线照片 (' + (index + 1) + '/'+ this.image_count + ')'
let txt = this.title + '(' + (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({
})
},
// })
// },
}
......@@ -210,12 +209,13 @@
<style>
.wrap {
width:100%;
height:calc(100vh - 600rpx);
background-color:#333;
/* height:calc(100vh - 600rpx); */
height: 100%;
background-color:#000000;
/* padding:0 40rpx; */
}
.backView{
background-color: #FAFAFA;
background-color: #F4F5F7;
position: absolute;
top: 0;
left: 0;
......@@ -226,7 +226,11 @@
align-items: center;
}
.topView{
.u-swiper-wrap {
height: 100%;
}
/*.topView{
background-color: #333333;
width: 100%;
height: 12%;
......@@ -291,5 +295,5 @@
left: 60rpx;
bottom: 50rpx;
}
*/
</style>
......@@ -11,7 +11,7 @@
<view class="right-view-title">拍照项有:</view>
<template v-for="(item,ikey) in rightList">
<view class="rightItemView" @click="rightItemClick(item,ikey)" :key="ikey">
<view class="['rightContentView', item.images.length > 0 ? 'gray666Color' : 'rightTitle']">
<view :class="['rightContentView', item.images.length > 0 ? 'gray666Color' : 'rightTitle']">
<text class="ph-lst-item-index">{{ ikey + 1 }}</text>
<text class="">{{item.name}} ({{item.image_count}}张)</text>
<image class="ph-list-item-arrow" src="/static/photo/arrow.png"></image>
......@@ -100,19 +100,19 @@
this.dataList = res.result
this.dataList.forEach(item => {
// this.dataList.forEach(item => {
item.list.forEach(subItem => {
subItem.isClicked = false
})
// item.list.forEach(subItem => {
// subItem.isClicked = false
// })
})
// })
console.log('添加 新字段 后的数组:')
console.log(this.dataList)
var item = res.result[0]
this.rightList = item.list
this.rightList = item.list
},
//顶部点击
......@@ -130,7 +130,7 @@
uni.navigateTo({
url: '/pages/photo/detail' +
'?current_image=' + image +
'&image_count=' + item.image_count +
'&image_count=' + item.images.length +
'&current_count=' + (index + 1) +
'&images=' + JSON.stringify(item.images) +
'&title=' + item.name,
......@@ -139,25 +139,24 @@
//右侧点击
rightItemClick: function(item, ikey) {
// // for (let i = 0; i < this.rightList.length; i++) {
// // var subItem = this.rightList[i]
// // if(i == ikey){
// // subItem.isClicked = true
// // }
// // }
// // item.clickable = true
// for (let i = 0; i < this.rightList.length; i++) {
// var subItem = this.rightList[i]
// if(i == ikey){
// subItem.isClicked = true
// }
// }
// item.clickable = true
// this.$set(this.rightList[ikey],'clickable',true)
// var current_image = item.images[0]
// var current_count = 1
// uni.navigateTo({
// url:'/pages/photo/detail'
// +'?current_image=' + current_image
// +'&image_count=' + item.image_count
// +'&current_count=' + current_count
// +'&images=' + JSON.stringify(item.images)
// +'&title=' + item.name,
// })
uni.navigateTo({
url:'/pages/photo/standard'
// +'?current_image=' + current_image
// +'&image_count=' + item.image_count
// +'&current_count=' + current_count
// +'&images=' + JSON.stringify(item.images)
// +'&title=' + item.name,
})
},
......@@ -174,7 +173,8 @@
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
align-items: center;
height: 100%;
}
.centerBackView {
......@@ -209,8 +209,8 @@
width: 100%;
display: flex;
flex-direction: column;
margin-top: 100rpx;
margin-bottom: 50rpx;
padding-top: 100rpx;
padding-bottom: 50rpx;
}
.right-view-title {
......
......@@ -5,7 +5,7 @@
<swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay"
:previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
:style="{
height: height + 'rpx'
height: heightString
}">
<swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index">
<view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[uCurrent != index ? 'u-list-scale' : '']" :style="{
......@@ -207,6 +207,9 @@
// 因为uni的swiper组件的current参数只接受Number类型,这里做一个转换
elCurrent() {
return Number(this.current);
},
heightString() {
return typeof this.height === 'number' && this.height !== 0 ? (this.height + 'rpx') : this.height
}
},
methods: {
......
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