Commit 02fbc1f4 authored by 李俊赕's avatar 李俊赕

add-standard

parent 131a7f15
<template>
<view class="standard-box" >
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item class="swiper-item" key="swiper1">
<view class="title">
拍照要求
</view>
<view class="txt-box">
<view class="txt">
1.充电桩必须通电,可看到电源指示灯亮
</view>
<view class="txt tips">
注意:人桩合影必须上传至少两张相片,一张
</view>
</view>
</swiper-item>
<swiper-item class="swiper-item" v-for="(item, index) in tabs" :key="index">
{{item.title}}
<cover-image bindtap="previewImage(item,index)" class="icon" mode="aspectFit" :src="src"></cover-image>
</swiper-item>
</swiper>
<view class="tab-box">
<u-tabs-swiper bg-color="transparent" inactive-color="#999"
ref="uTabs" :list="list" :current="current"
@change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view>
</view>
</template>
<script>
export default {
props:{
item:{
type:'Object',
detault:()=>{
return null
}
}
},
data() {
return {
list: [{
name: '十年'
}, {
name: '青春'
}, {
name: '之约'
}],
tabs:[{
title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就111111111111',
},{
title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就222222',
},{
title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就333333',
},],
// 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
current: 0, // tabs组件的current值,表示当前活动的tab选项
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
height:0,
}
},
onLoad(e) {
// getApp().trackPage('照片预览页')
// console.log(e, 'e')
// if (e.img) {
// this.images = [e.img]
// }
// console.log(this.images, 'this.images')
},
mounted(){
this.getSwiperHeight()
},
methods: {
getSwiperHeight(){
const globalData = getApp().globalData
this.height = globalData.screenHeight*2 - globalData.navHeight - 200
console.log(this.height,'height')
console.log(globalData.screenHeight,'globalData.screenHeight')
},
previewImage(index){
uni.previewImage({
current:index,
urls:[],
})
},
// tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
},
// swiper-item左右移动,通知tabs的滑块跟随移动
transition(e) {
console.log(e.detail,'e.detail-transition')
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
// swiper滑动结束,分别设置tabs和swiper的状态
animationfinish(e) {
console.log(e.detail,'e.detail-animationfinish')
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
// scroll-view到底部加载更多
onreachBottom() {
}
}
}
</script>
<style lang="scss">
.standard-box{
position: absolute;
left:0;right:0;
/* height: calc(100vh - 240rpx); */
bottom:240rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.swiper-box{
width: 690rpx;
min-height: 690rpx;
margin-bottom: 150rpx;
border-radius: 12rpx;
background-color: #fff;
}
.tab-box{
position: absolute;
bottom:0;
left:30rpx;
right:30rpx;
}
.swiper-item{
box-sizing: border-box;
// width:690rpx;
padding:30rpx;
.title{
margin-top:20rpx;
font-weight: bold;
line-height: 50rpx;
color:#333;
font-size: 36rpx;
}
.txt-box{
max-height: 560rpx;
overflow: auto;
}
.txt{
padding-top:26rpx;
line-height: 34rpx;
color:#666;
font-size: 28rpx;
&.tips{
padding-bottom:26rpx;
color:#D73400
}
}
}
/* .pic {
display: block;
width: 100%;
height: auto;
}
.scroll-view_H {
white-space: nowrap;
width: 750rpx;
height: 300rpx;
}
.view-content {
display: flex;
} */
</style>
...@@ -140,14 +140,14 @@ ...@@ -140,14 +140,14 @@
"navigationBarTextStyle": "#FFFFFF", "navigationBarTextStyle": "#FFFFFF",
"disableScroll": true "disableScroll": true
} }
},{ // },{
"path": "pages/photo/standard", // "path": "pages/photo/standard",
"style": { // "style": {
"navigationBarTitleText": "拍照规范", // "navigationBarTitleText": "拍照规范",
"navigationBarBackgroundColor": "#333333", // "navigationBarBackgroundColor": "#333333",
"navigationBarTextStyle": "#FFFFFF", // "navigationBarTextStyle": "#FFFFFF",
"disableScroll": true // "disableScroll": true
} // }
}, },
{ {
......
<template> <template>
<view class="standard-box"> <view class="standard-box" >
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"> <swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<!-- <swiper-item class="swiper-item" key="swiper1"> <swiper-item class="swiper-item" key="swiper1">
<view class="title"> <view class="title">
拍照要求 拍照要求
</view> </view>
...@@ -13,24 +13,29 @@ ...@@ -13,24 +13,29 @@
注意:人桩合影必须上传至少两张相片,一张 注意:人桩合影必须上传至少两张相片,一张
</view> </view>
</view> </view>
</swiper-item> --> </swiper-item>
<swiper-item class="swiper-item" v-for="(src, index) in tabs" :key="index"> <swiper-item class="swiper-item" v-for="(item, index) in tabs" :key="index">
{{item.title}}
<cover-image bindtap="previewImage(item,index)" class="icon" mode="aspectFit" :src="src"></cover-image> <cover-image bindtap="previewImage(item,index)" class="icon" mode="aspectFit" :src="src"></cover-image>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="tab-box"> <view class="tab-box">
<u-tabs-swiper bg-color="transparent" inactive-color="#fff" ref="uTabs" :list="list" :current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper> <u-tabs-swiper bg-color="transparent" inactive-color="#999"
ref="uTabs" :list="list" :current="current"
@change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name:'photo-standard'
props:{ props:{
item:{ item:{
type:'Object', type:'Object',
detault:()=>{ detault:()=>{
return {} return null
} }
} }
}, },
...@@ -42,8 +47,6 @@ ...@@ -42,8 +47,6 @@
name: '青春' name: '青春'
}, { }, {
name: '之约' name: '之约'
}, {
name: '之约1'
}], }],
tabs:[{ tabs:[{
title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就111111111111', title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就111111111111',
...@@ -88,12 +91,14 @@ ...@@ -88,12 +91,14 @@
}, },
// swiper-item左右移动,通知tabs的滑块跟随移动 // swiper-item左右移动,通知tabs的滑块跟随移动
transition(e) { transition(e) {
console.log(e.detail,'e.detail-transition')
let dx = e.detail.dx; let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx); this.$refs.uTabs.setDx(dx);
}, },
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态 // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
// swiper滑动结束,分别设置tabs和swiper的状态 // swiper滑动结束,分别设置tabs和swiper的状态
animationfinish(e) { animationfinish(e) {
console.log(e.detail,'e.detail-animationfinish')
let current = e.detail.current; let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current); this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current; this.swiperCurrent = current;
......
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG", // ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI" ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
}); });
import standard from './standard' import standard from '@/components/photo/standard.vue'
export default { export default {
components:{ components:{
standard, standard:standard,
}, },
data() { data() {
return { return {
......
{
"name": "getGroupStandardV2",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"user-common": {
"version": "file:../common/user-common"
}
}
}
{
"name": "saveImage",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"user-common": {
"version": "file:../common/user-common"
}
}
}
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