Commit e68b8f16 authored by 李俊赕's avatar 李俊赕

photo-detail

parent f928f1a6
......@@ -3,8 +3,17 @@
<view class="topView">
<!--text class="topTitle">示范照片 ({{currentNumber}}/{{totalNumber}})</text-->
</view>
<view class="centerBackView">
<image class="photoImage" @click="imageClick(current_image)" :src="current_image" mode="aspectFill"></image>
<view class="wrap">
<u-swiper
@click="imageClick"
@change="changeSwipter"
img-mode="scaleToFill"
bg-color="#333333"
:height="600" :list="swiperList"
:autoplay="false"
:circular='false'
mode="dot"
></u-swiper>
</view>
<view class="bottomView">
<image class="takeView" :src="icon_gotake" mode="" @click="takeClick"></image>
......@@ -14,9 +23,20 @@
</template>
<script>
import uSwiper from '@/uview-ui/components/u-swiper/u-swiper'
export default {
components:{
uSwiper
},
data() {
return {
// background: ['color1', 'color2', 'color3'],
// indicatorDots: true,
// autoplay: true,
// interval: 2000,
// duration: 500,
image_count:1,
current_count:1,
current_image:'',
......@@ -26,8 +46,32 @@
icon_arrow_down:'https://qn-static.banshouhui.com/arrow_down.png',
ifFirst:true,
last_done_count:0,
swiperList:[],
windowHeight:0,
}
},
watch:{
images(val){
let list = val.map(img=>{
return {
image:img
}
})
this.swiperList = list
// console.log(this.swiperList,'this.swiperList')
}
},
computed:{
// swiperList(){
// console.log(this.images,'this.images')
// let list = this.images.map(img=>{
// return {
// image:img
// }
// })
// return list
// }
},
onLoad(e) {
this.initData(e)
},
......@@ -57,9 +101,7 @@
}
if(e && e.images){
this.images = JSON.parse(e.images)
console.log('images:')
console.log(this.images)
this.images = [].concat(JSON.parse(e.images))
}
uni.setNavigationBarTitle({
......@@ -75,8 +117,6 @@
//检查已拍照数量
checkDoneCount: function (){
let pages = getCurrentPages();
let currPage = pages[pages.length-1];
this.done_count = currPage.data.done_count
......@@ -115,12 +155,19 @@
},
//照片预览
imageClick: function (image) {
imageClick: function (index) {
let currentImg = this.images[index]
uni.previewImage({
urls: [image]
urls: [currentImg],
current:index
})
},
changeSwipter(index){
let txt = '走线照片 (' + (index + 1) + '/'+ this.image_count + ')'
uni.setNavigationBarTitle({
title: txt
})
},
//拍照 点击
takeClick: function () {
this.isFirst = false
......@@ -142,6 +189,12 @@
</script>
<style>
.wrap {
width:100%;
height:calc(100vh - 600rpx);
background-color:#333;
/* padding:0 40rpx; */
}
.backView{
background-color: #FAFAFA;
position: absolute;
......
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