|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<!-- 在线客服 -->
|
|
<!-- 在线客服 -->
|
|
|
- <view v-if="!(params.type === 'chat' && !isMpWeiXin)" class="diy-service" :style="{ right: `${itemStyle.right}%`, bottom: `${itemStyle.bottom}%` }">
|
|
|
|
|
|
|
+ <view v-if="!(params.type === 'chat' && !isMpWeiXin)" class="diy-service" :style="{ '--right': `${right}px`, '--bottom': `${bottom}px` }">
|
|
|
<!-- 拨打电话 -->
|
|
<!-- 拨打电话 -->
|
|
|
<block v-if="params.type === 'phone'">
|
|
<block v-if="params.type === 'phone'">
|
|
|
<view class="service-icon" @click="onMakePhoneCall">
|
|
<view class="service-icon" @click="onMakePhoneCall">
|
|
@@ -19,6 +19,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ const rpx = uni.getSystemInfoSync().windowWidth / 750
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -40,6 +42,14 @@
|
|
|
isShow: true
|
|
isShow: true
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ right() {
|
|
|
|
|
+ return 2 * this.itemStyle.right * rpx
|
|
|
|
|
+ },
|
|
|
|
|
+ bottom() {
|
|
|
|
|
+ return 2 * this.itemStyle.bottom * rpx
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
created() {
|
|
created() {
|
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
@@ -71,6 +81,9 @@
|
|
|
.diy-service {
|
|
.diy-service {
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
z-index: 999;
|
|
z-index: 999;
|
|
|
|
|
+ right: calc(var(--window-right) + var(--right));
|
|
|
|
|
+ bottom: calc(constant(safe-area-inset-bottom) + var(--window-bottom) + var(--bottom));
|
|
|
|
|
+ bottom: calc(env(safe-area-inset-bottom) + var(--window-bottom) + var(--bottom));
|
|
|
|
|
|
|
|
.service-icon {
|
|
.service-icon {
|
|
|
padding: 10rpx;
|
|
padding: 10rpx;
|
|
@@ -79,6 +92,8 @@
|
|
|
display: block;
|
|
display: block;
|
|
|
width: 90rpx;
|
|
width: 90rpx;
|
|
|
height: 90rpx;
|
|
height: 90rpx;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|