2022-08-08 09:17:43 +08:00
< template >
2023-02-13 15:43:06 +08:00
< view >
2023-02-15 08:54:28 +08:00
< view @touchend.stop.prevent = ' touchend ' @touchmove.stop.prevent = ' touchmove ' @touchstart.stop.prevent = ' onChange '
2023-02-13 15:43:06 +08:00
style = "display: flex;flex-direction: column;flex-wrap: wrap;z-index: 9999999999999999999999999 !important;"
: style = "{height:isShow.switchBar?`calc(${styles.height}rpx + ${styles.move}rpx )`: ` calc( ${styles.move}rpx + 150rpx)` }"
: class = "styles.open? 'serviceStation_body' :'seleServiceStation_body' " >
2023-02-15 08:54:28 +08:00
< view id = "switchBar" @tap.stop ="switchBar()" class = "switchBar" > < / view >
2023-02-13 15:43:06 +08:00
< view style = "flex: 1; overflow: hidden; width: 100%; " >
< view style = "" class = "information" >
< view class = "information_left" >
< image class = "ser_img" :src = "details.siteImages" mode = "widthFix" > < / image >
< view
style = "width: calc(100% - 80rpx);display: flex; flex-direction: column;justify-content: space-between;"
class = "serviceStation_text black_color" >
< view class = "ovf" > { { details . siteName } } < / view >
< view style = " " class = "ovf samall_text hui_color" > { { details . address } } < / view >
< / view >
2022-08-08 09:17:43 +08:00
< / view >
2023-02-13 15:43:06 +08:00
< view class = "information_right" >
< uni-icons type = "paperplane-filled" size = "20" > < / uni-icons >
< view class = "samall_text hui_color" >
{ { Number ( details . juli / 1000 ) . toFixed ( 2 ) } } km
< / view >
2022-08-08 09:17:43 +08:00
< / view >
< / view >
2023-02-13 15:43:06 +08:00
< view class = "oli_swiper" >
< view class = "oli_swiper_title" >
< view : style = "{borderBottom: seleIndex==index? '#FF6700 solid 3px':''}" @click ="seletitle(index)"
v - for = "(item,index) in details.oilSiteChannelDetailsVos" class = "oli_swiper_title_item" >
{ { item . channelCode | channelCode } } < / view >
<!-- < view : style = "{transform:`translateX( calc(${seleIndex} * 100%) )`,width:`calc(100% / ${details.oilSiteChannelDetailsVos.length})`}" class = "tiao" > < / view > -- >
< / view >
< swiper class = "swiper" next -margin = ' 480rpx ' :duration = "500" >
< swiper-item
v - for = "(item,index) in (details.oilSiteChannelDetailsVos[seleIndex].oilSitePriceDetailsVos==null?[]:details.oilSiteChannelDetailsVos[seleIndex].oilSitePriceDetailsVos)"
: key = 'index' >
< view class = "swiper-item" >
< view class = "swiper-item_oliType bag_text black_color" > { { item . oilProductCode } } < / view >
< view class = "bag_text hu_color " style = "text-align: start;" >
{ { moneyIntercept ( item . sitePrice ) } } / L
< / view >
< view class = "samall_text hui_color" style = "text-align: end;text-decoration: line-through;" >
{ { moneyIntercept ( item . oilSitePrice ) } } / L
< / view >
2022-09-09 14:53:48 +08:00
< / view >
2023-02-13 15:43:06 +08:00
< / swiper-item >
< / swiper >
< / view >
< view class = "serviceStation_footer" >
2023-02-15 08:54:28 +08:00
< view id = "Navigation" @tap.stop ="Navigation" style = "background-color: #8B583E;" class = "serviceStation_footer_butten" > 导航
2023-02-13 15:43:06 +08:00
< / view >
2023-02-15 08:54:28 +08:00
< view id = "jump" @tap.stop ="jump" style = "background-color: #FF6700;" class = "serviceStation_footer_butten" > 详情 < / view >
2022-09-09 14:53:48 +08:00
< / view >
2022-08-08 09:17:43 +08:00
< / view >
< / view >
< / view >
< / template >
< script >
export default {
data ( ) {
return {
2022-09-09 14:53:48 +08:00
touchData : null ,
styles : {
height : 700 ,
moveY : 0 ,
Y : 0 ,
move : 0 ,
open : false
2022-08-08 09:17:43 +08:00
} ,
2022-09-09 14:53:48 +08:00
seleIndex : 0 ,
2022-08-08 09:17:43 +08:00
isShow : {
switchBar : true
}
}
} ,
created ( ) {
console . log ( this . details , '***' ) ;
2023-02-13 15:43:06 +08:00
// this.$emit('dragMap', this.details, false)
2022-08-08 09:17:43 +08:00
} ,
mounted ( ) { } ,
props : {
details : {
type : Object ,
default : ( ) => {
return null
}
}
} ,
2022-09-09 14:53:48 +08:00
filters : {
channelCode ( e ) {
2022-08-08 09:17:43 +08:00
switch ( e ) {
case 'XOIL' :
return '星油'
case 'WJY' :
return '万金油'
case 'LV' :
2022-09-09 14:53:48 +08:00
return '其他'
2022-08-08 09:17:43 +08:00
case 'TY' :
return '团油'
case 'YDJY' :
return '一点加油(壳牌)'
}
}
} ,
2022-09-09 14:53:48 +08:00
watch : { } ,
2022-08-08 09:17:43 +08:00
methods : {
2022-09-09 14:53:48 +08:00
jump ( ) {
2022-08-08 09:17:43 +08:00
let obj = {
siteId : this . details . id ,
// siteCode: this.details.siteCode,
// siteChannel: this.details.siteChannel,
longitude : this . details . longitude ,
latitude : this . details . latitude ,
}
let itemS = JSON . stringify ( obj )
2022-09-09 14:53:48 +08:00
console . log ( itemS , this . details , '************' ) ;
2022-08-08 09:17:43 +08:00
// return
uni . navigateTo ( {
url : ` ../stationDetail/stationDetail?item= ${ itemS } &&types=map `
} )
} ,
2022-09-09 14:53:48 +08:00
Navigation ( ) {
2022-08-08 09:17:43 +08:00
console . log ( '组件导航' )
this . $emit ( 'openMapApp' )
} ,
2022-09-09 14:53:48 +08:00
touchcancel ( e ) {
console . log ( this . styles . yd , 'touchcancel滑动距离' )
console . log ( e , 'touchcancel' )
2022-08-08 09:17:43 +08:00
} ,
//监听鼠标滑动
2022-09-09 14:53:48 +08:00
touchmove ( e ) {
if ( this . isShow . switchBar && this . styles . Y - e . changedTouches [ 0 ] . clientY > 0 ) return
2022-08-08 09:17:43 +08:00
this . styles . moveY = e . changedTouches [ 0 ] . clientY ;
this . styles . move = this . styles . Y - this . styles . moveY ;
console . log ( this . styles . moveY )
} ,
//开始滑动
2022-09-09 14:53:48 +08:00
onChange ( e ) {
2023-02-15 08:54:28 +08:00
if ( e . target . id ) {
this [ e . target . id ] ( )
return
}
console . log ( e . target . id , '开始滑动' ) ;
2022-09-09 14:53:48 +08:00
this . $emit ( 'dragMap' , this . details , false )
2022-08-08 09:17:43 +08:00
// 这一行为记录滑动位置代码 this.styles.Y = e.changedTouches[0].clientY + this.styles.move;
2022-09-09 14:53:48 +08:00
this . styles . open = true ;
this . styles . Y = e . changedTouches [ 0 ] . clientY ;
2022-08-08 09:17:43 +08:00
} ,
// 滑动完成
2022-09-09 14:53:48 +08:00
touchend ( e ) {
2023-02-13 15:43:06 +08:00
console . log ( '滑动完成' ) ;
2022-08-08 09:17:43 +08:00
this . styles . open = false ;
2022-09-09 14:53:48 +08:00
if ( this . styles . move > 0 ) {
this . isShow . switchBar = true
} else if ( this . styles . move < 0 ) {
2022-08-08 09:17:43 +08:00
this . isShow . switchBar = false
}
this . styles . move = 0 ;
console . log ( 'touchend' )
2022-09-09 14:53:48 +08:00
setTimeout ( ( ) => {
this . $emit ( 'dragMap' , this . details , true )
} , 500 )
2022-08-08 09:17:43 +08:00
} ,
2022-09-09 14:53:48 +08:00
vtouchmove ( e ) {
this . styles . height -= 3 ;
console . log ( e , this . styles . height , 'vtouchmove' )
2022-08-08 09:17:43 +08:00
} ,
2022-09-09 14:53:48 +08:00
seletitle ( e ) {
2022-08-08 09:17:43 +08:00
this . seleIndex = e
} ,
2023-02-13 15:43:06 +08:00
switchBar ( e ) {
2022-09-09 14:53:48 +08:00
this . isShow . switchBar = ! this . isShow . switchBar
2023-02-13 15:43:06 +08:00
console . log ( this . isShow . switchBar , ']]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]' )
2022-08-08 09:17:43 +08:00
}
}
}
< / script >
< style scoped >
2022-09-09 14:53:48 +08:00
. an {
2022-08-08 09:17:43 +08:00
align - items : flex - end ;
}
2022-09-09 14:53:48 +08:00
. flex {
2022-08-08 09:17:43 +08:00
display : flex ;
}
2022-09-09 14:53:48 +08:00
. ac {
2022-08-08 09:17:43 +08:00
align - items : center ;
}
2022-09-09 14:53:48 +08:00
2022-08-08 09:17:43 +08:00
. ser _img {
width : 80 rpx ;
/* height: 80rpx; */
margin - right : 15 rpx ;
}
. serviceStation _footer _butten {
display : flex ;
align - items : center ;
justify - content : center ;
width : 240 rpx ;
height : 80 rpx ;
color : # FFFFFF ;
border - radius : 50 px ;
}
. serviceStation _footer {
display : flex ;
justify - content : center ;
gap : 26 rpx ;
/ * p o s i t i o n : a b s o l u t e ;
bottom : 40 rpx ; * /
width : 100 % ;
margin - top : 20 rpx ;
}
. bag _text {
font - size : 36 rpx ;
}
. swiper - item _oliType {
position : absolute ;
right : - 10 rpx ;
top : - 10 rpx ;
}
. swiper - item {
width : 200 rpx ! important ;
background : # F0F0F0 ;
border - radius : 10 px ;
height : 140 rpx ;
/* padding: 32rpx; */
position : relative ;
margin - top : 10 rpx ;
display : flex ;
flex - direction : column ;
justify - content : center ;
gap : 10 rpx ;
padding : 0 40 rpx ;
}
. hu _color {
color : # FF6700 ;
}
. swiper {
width : 100 % ;
height : 150 rpx ;
}
. oli _swiper {
margin - top : 40 rpx ;
}
2022-09-09 14:53:48 +08:00
. oli _swiper _title _item {
/* flex: 1; */
text - align : center ;
font - size : 28 rpx ;
/* width: min-intrinsic; */
padding - bottom : 5 px ;
}
. tiao {
background - color : # FF6700 ;
border - radius : 10 px ;
height : 5 rpx ;
position : absolute ;
bottom : 0 ;
left : 0 ;
transition : all .3 s ;
transform : scaleX ( 100 % ) ;
}
2022-08-08 09:17:43 +08:00
. oli _swiper _title {
/ *
border - bottom : # FF6700 solid ;
width : max - content ;
margin : 0 auto ;
* /
2022-09-09 14:53:48 +08:00
padding - bottom : 10 rpx ;
margin - bottom : 40 rpx ;
2022-08-08 09:17:43 +08:00
display : flex ;
justify - content : center ;
2022-09-09 14:53:48 +08:00
gap : 20 rpx ;
2022-08-08 09:17:43 +08:00
flex - wrap : nowrap ;
overflow : hidden ;
position : relative ;
}
. black _color {
color : # 666666 ;
}
. hui _color {
color : # BBBBBB ;
}
. samall _text {
font - size : 24 rpx ;
}
. serviceStation _text {
font - size : 28 rpx ;
}
. ovf {
width : 100 % ;
overflow : hidden ;
white - space : nowrap ;
text - overflow : ellipsis ;
}
. information _right {
width : 94 rpx ;
display : flex ;
flex - direction : column ;
gap : 10 rpx ;
justify - content : space - between ;
align - items : center ;
}
. information _left {
flex : 1 ;
overflow : hidden ;
display : flex ;
/ * f l e x - d i r e c t i o n : c o l u m n ;
justify - content : space - between ; * /
}
. information {
display : flex ;
padding : 0 30 rpx ;
gap : 20 rpx ;
margin - top : 30 rpx ;
overflow : hidden ;
max - height : 90 rpx ;
}
. switchBar {
width : 160 rpx ;
height : 10 rpx ;
background : # F0F0F0 ;
border - radius : 10 px ;
margin : 0 auto ;
}
2022-09-09 14:53:48 +08:00
. seleServiceStation _body {
2022-08-08 09:17:43 +08:00
height : 700 rpx ;
width : 750 rpx ;
background : # FFFFFF ;
border - radius : 20 px 20 px 0 px 0 px ;
padding : 16 rpx ;
transition : all .3 s ;
}
2022-09-09 14:53:48 +08:00
2022-08-08 09:17:43 +08:00
. serviceStation _body {
height : 700 rpx ;
width : 750 rpx ;
background : # FFFFFF ;
border - radius : 20 px 20 px 0 px 0 px ;
padding : 16 rpx ;
transition : all .3 s ;
}
< / style >