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

photo-detail

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