|
|
@ -1,8 +1,19 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="phone" v-if="phone" @click.stop="callPhone"> |
|
|
|
|
|
<image src="/static/image/home/phone.png" mode="widthFix"></image> |
|
|
|
|
|
{{ title || '联系' + ta[sexName] }} |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<view> |
|
|
|
|
|
<!-- 普通模式 --> |
|
|
|
|
|
<view v-if="!showModel" class="phone" v-show="phone" @click.stop="callPhone"> |
|
|
|
|
|
<image src="/static/image/home/phone.png" mode="widthFix"></image> |
|
|
|
|
|
{{ title || '联系' + ta[sexName] }} |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 悬浮窗模式 --> |
|
|
|
|
|
<view v-else v-show="phone" class="phone-modal" @click.stop="callPhone"> |
|
|
|
|
|
<view class="phone-modal-content"> |
|
|
|
|
|
<image src="/static/image/home/phone.png" mode="widthFix"></image> |
|
|
|
|
|
<text class="phone-modal-text">{{ title || '联系' + ta[sexName] }}</text> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
@ -11,7 +22,37 @@ |
|
|
import { mapState } from 'vuex' |
|
|
import { mapState } from 'vuex' |
|
|
export default { |
|
|
export default { |
|
|
mixins: [mixinsSex, rewardedVideoAdMixin], |
|
|
mixins: [mixinsSex, rewardedVideoAdMixin], |
|
|
props: ['phone', 'title', 'sexName', 'type', 'phoneTitle', 'pid'], |
|
|
|
|
|
|
|
|
props: { |
|
|
|
|
|
phone: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: '' |
|
|
|
|
|
}, |
|
|
|
|
|
title: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: '' |
|
|
|
|
|
}, |
|
|
|
|
|
sexName: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: '' |
|
|
|
|
|
}, |
|
|
|
|
|
type: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: '' |
|
|
|
|
|
}, |
|
|
|
|
|
phoneTitle: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: '' |
|
|
|
|
|
}, |
|
|
|
|
|
pid: { |
|
|
|
|
|
type: [String, Number], |
|
|
|
|
|
default: '' |
|
|
|
|
|
}, |
|
|
|
|
|
// 显示模式:false-普通模式,true-悬浮窗模式 |
|
|
|
|
|
showModel: { |
|
|
|
|
|
type: Boolean, |
|
|
|
|
|
default: false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
// 视频广告相关数据已移至混入中 |
|
|
// 视频广告相关数据已移至混入中 |
|
|
@ -117,6 +158,7 @@ |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
<style scoped lang="scss"> |
|
|
|
|
|
// 普通模式样式 |
|
|
.phone { |
|
|
.phone { |
|
|
background-color: rgba($uni-color, 0.2); |
|
|
background-color: rgba($uni-color, 0.2); |
|
|
color: $uni-color; |
|
|
color: $uni-color; |
|
|
@ -130,4 +172,73 @@ |
|
|
height: 20rpx; |
|
|
height: 20rpx; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 悬浮窗模式样式 |
|
|
|
|
|
.phone-modal { |
|
|
|
|
|
position: fixed; |
|
|
|
|
|
bottom: calc(140rpx + env(safe-area-inset-bottom)); |
|
|
|
|
|
right: 30rpx; |
|
|
|
|
|
z-index: 999; |
|
|
|
|
|
|
|
|
|
|
|
.phone-modal-content { |
|
|
|
|
|
background: linear-gradient(135deg, $uni-color 0%, rgba($uni-color, 0.8) 100%); |
|
|
|
|
|
color: #ffffff; |
|
|
|
|
|
padding: 20rpx 30rpx; |
|
|
|
|
|
border-radius: 50rpx; |
|
|
|
|
|
box-shadow: 0 8rpx 24rpx rgba($uni-color, 0.3); |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
min-width: 160rpx; |
|
|
|
|
|
transition: all 0.3s ease; |
|
|
|
|
|
|
|
|
|
|
|
&:active { |
|
|
|
|
|
transform: scale(0.95); |
|
|
|
|
|
box-shadow: 0 4rpx 12rpx rgba($uni-color, 0.4); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
image { |
|
|
|
|
|
width: 28rpx; |
|
|
|
|
|
height: 28rpx; |
|
|
|
|
|
margin-right: 12rpx; |
|
|
|
|
|
filter: brightness(0) invert(1); // 将图标变为白色 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.phone-modal-text { |
|
|
|
|
|
font-size: 28rpx; |
|
|
|
|
|
font-weight: 500; |
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 悬浮窗呼吸动画效果 |
|
|
|
|
|
&::before { |
|
|
|
|
|
content: ''; |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
top: -10rpx; |
|
|
|
|
|
left: -10rpx; |
|
|
|
|
|
right: -10rpx; |
|
|
|
|
|
bottom: -10rpx; |
|
|
|
|
|
background: rgba($uni-color, 0.2); |
|
|
|
|
|
border-radius: 60rpx; |
|
|
|
|
|
animation: pulse 2s infinite; |
|
|
|
|
|
z-index: -1; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 呼吸动画 |
|
|
|
|
|
@keyframes pulse { |
|
|
|
|
|
0% { |
|
|
|
|
|
transform: scale(1); |
|
|
|
|
|
opacity: 0.7; |
|
|
|
|
|
} |
|
|
|
|
|
50% { |
|
|
|
|
|
transform: scale(1.1); |
|
|
|
|
|
opacity: 0.3; |
|
|
|
|
|
} |
|
|
|
|
|
100% { |
|
|
|
|
|
transform: scale(1); |
|
|
|
|
|
opacity: 0.7; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |