@ -0,0 +1,159 @@ | |||
<template> | |||
<!-- 联系客服弹框 --> | |||
<uv-overlay :show="show" @click="close"> | |||
<view class="warp"> | |||
<view class="rect" @tap.stop> | |||
<view class="title">联系客服</view> | |||
<view class="center">确定拨打客服电话?</view> | |||
<view class="bottom"> | |||
<view> | |||
<uv-button type="info" shape="circle" text="取消" :custom-style="customStyle1" | |||
@click="close"></uv-button> | |||
</view> | |||
<view> | |||
<uv-button type="info" shape="circle" text="确定" :custom-style="customStyle2" | |||
@click="confirm"></uv-button> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
</uv-overlay> | |||
</template> | |||
<script> | |||
export default { | |||
data() { | |||
return { | |||
show: false, | |||
phone:'', | |||
} | |||
}, | |||
computed: { | |||
customStyle1() { | |||
return { | |||
height: '60rpx', | |||
background: '#FFF', | |||
color: '#000000', | |||
fontSize: '36rpx', | |||
borderRadius: '40rpx', //圆角 | |||
// nvue中必须是下方的写法 | |||
'border-top-right-radius': '40rpx', | |||
'border-bottom-left-radius': '40rpx', | |||
'border-bottom-right-radius': '40rpx', | |||
'width': '150rpx', | |||
} | |||
}, | |||
customStyle2() { | |||
return { | |||
height: '60rpx', | |||
background: '#1f1c39', | |||
color: '#FFF', | |||
fontSize: '34px', | |||
borderRadius: '40rpx', //圆角 | |||
// nvue中必须是下方的写法 | |||
'border-top-right-radius': '40rpx', | |||
'border-bottom-left-radius': '40rpx', | |||
'border-bottom-right-radius': '40rpx', | |||
'width': '150rpx', | |||
} | |||
} | |||
}, | |||
mounted() { | |||
this.getCustomPhone() | |||
}, | |||
methods: { | |||
getCustomPhone(){ | |||
this.$api('customUser', {}, res => { | |||
this.phone = res.result.phone | |||
}) | |||
}, | |||
open() { | |||
this.show = true | |||
}, | |||
close() { | |||
this.show = false | |||
}, | |||
// 拨打电话 | |||
confirm() { | |||
this.show = false | |||
let phone = this.phone; // 需要拨打的电话号码 | |||
// console.log('拨打电话', phone) | |||
const res = uni.getSystemInfoSync(); | |||
// ios系统默认有个模态框 | |||
if (res.platform == 'ios') { | |||
uni.makePhoneCall({ | |||
phoneNumber: phone, | |||
success() { | |||
console.log('ios拨打成功'); | |||
}, | |||
fail() { | |||
console.log('ios拨打失败'); | |||
} | |||
}) | |||
} else { | |||
//安卓手机手动设置一个showActionSheet | |||
uni.showActionSheet({ | |||
itemList: [phone, '呼叫'], | |||
success: function(res) { | |||
if (res.tapIndex == 1) { | |||
uni.makePhoneCall({ | |||
phoneNumber: phone, | |||
success() { | |||
console.log('安卓拨打成功'); | |||
}, | |||
fail() { | |||
console.log('安卓拨打失败'); | |||
} | |||
}) | |||
} | |||
} | |||
}) | |||
} | |||
}, | |||
} | |||
} | |||
</script> | |||
<style scoped lang="scss"> | |||
.warp { | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
height: 100%; | |||
} | |||
.rect { | |||
width: 600rpx; | |||
height: 300rpx; | |||
background-color: #fff; | |||
border-radius: 20rpx; | |||
overflow: hidden; | |||
.title { | |||
padding: 20rpx 0 10rpx 20rpx; | |||
background-color: $uni-color; | |||
color: #FFF; | |||
text-align: left; | |||
width: 100%; | |||
height: 18%; | |||
font-size: 36rpx; | |||
} | |||
.center { | |||
height: 40%; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
font-size: 36rpx; | |||
} | |||
.bottom { | |||
display: flex; | |||
justify-content: center; | |||
gap: 50rpx; | |||
} | |||
} | |||
</style> |
@ -0,0 +1 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" width="27.303" height="26.753" viewBox="0 0 27.303 26.753"><defs><style>.a{fill:#fff;}</style></defs><g transform="translate(-1.696 -1.596)"><g transform="translate(1 1.188)"><path class="a" d="M612.57,205.321a5.04,5.04,0,1,0,4.556-5.483,5.028,5.028,0,0,0-4.556,5.483Zm2.4-.22a2.643,2.643,0,1,1,2.875,2.388,2.641,2.641,0,0,1-2.875-2.388Zm0,0" transform="translate(-603.184 -190.963)"/><path class="a" d="M621.335,194.136a5.119,5.119,0,0,1-7.211.754,5.951,5.951,0,0,1-.644-.613A12.12,12.12,0,0,0,611,195.6a5.139,5.139,0,0,1-3.6,6.3,4.581,4.581,0,0,1-.927.157,11.29,11.29,0,0,0-.346,3.974,5.3,5.3,0,0,1,3.582,2.215,6.121,6.121,0,0,1,.314,5.608,8.143,8.143,0,0,0,3.393,2.105,5.37,5.37,0,0,1,4.116-2.8,5.224,5.224,0,0,1,5.074,2.278,11.663,11.663,0,0,0,2.8-1.885,5.125,5.125,0,0,1,1.838-7.006,5.292,5.292,0,0,1,1.869-.644,11.376,11.376,0,0,0-.456-4.179,5.123,5.123,0,0,1-4.257-6,11.149,11.149,0,0,0-3.063-1.587Zm5.09,1.775a2.967,2.967,0,0,0,1.524,3.629,2.4,2.4,0,0,0,1.053.173l.927-.031.33.864a10.59,10.59,0,0,1,.738,6.3l-.11.628h-1.225c-1.4-.157-2.953,1.7-3.11,3.095a2.715,2.715,0,0,0,.566,2.2l.566.817-.676.911a14.4,14.4,0,0,1-4.414,2.765l-1.1.456a3.321,3.321,0,0,0-3.409-2.859,3.2,3.2,0,0,0-3.189,3.267l-1.288-.314a9.052,9.052,0,0,1-5.655-3.5l-.628-.676.534-.44c.738-.848.283-2.969-.314-3.943a2.813,2.813,0,0,0-2.4-1.21l-.848.094-.189-1.115a12.6,12.6,0,0,1,.534-6.692l.346-.974,1.037.141a2.552,2.552,0,0,0,2.875-2.2,2.487,2.487,0,0,0-.267-1.539l-.534-.644.8-.66a12.956,12.956,0,0,1,4.681-2.686l.99-.3.5.911a2.566,2.566,0,0,0,4.54-.079l.456-.927,1.005.251a11.675,11.675,0,0,1,5,2.781l.707.6Z" transform="translate(-603.184 -190.963)"/></g></g></svg> |
@ -0,0 +1 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="26.736" height="24.295" viewBox="0 0 26.736 24.295"><defs><style>.a{fill:#fff;}.b{clip-path:url(#a);}</style><clipPath id="a"><rect class="a" width="26.736" height="24.295"/></clipPath></defs><g transform="translate(-321 -56)"><path class="a" d="M387.107,56.56a11.615,11.615,0,1,1-3.787,22.6,1.01,1.01,0,0,1,.658-1.909,9.592,9.592,0,1,0-5.637-5.169,1.01,1.01,0,1,1-1.845.823A11.62,11.62,0,0,1,387.107,56.56Zm0,0" transform="translate(-52.477 -0.539)"/><path class="a" d="M947.629,336.7q-.029.039,0-3.992a20.352,20.352,0,0,0,0-3.077,3.535,3.535,0,1,1,0,7.07Zm0,0" transform="translate(-603.439 -263.506)"/><g transform="translate(321 56)"><g class="b" transform="translate(0 0)"><path class="a" d="M569.167,575.388h2.02a2.525,2.525,0,0,1,0,5.05h-2.02a2.525,2.525,0,0,1,0-5.05Zm0,0" transform="translate(-557.557 -556.178)"/><path class="a" d="M324.415,336.7q1.953,0,0-3.992a20.584,20.584,0,0,1,0-3.077,3.535,3.535,0,1,0,0,7.07Zm0,0" transform="translate(-320.884 -319.506)"/></g></g><path class="a" d="M503.28,408.067a1.01,1.01,0,0,1,1.428.044,7.067,7.067,0,0,0,10.107.206,1.01,1.01,0,0,1,1.416,1.441,9.09,9.09,0,0,1-13-.265,1.01,1.01,0,0,1,.045-1.427Zm0,0" transform="translate(-175.232 -338.781)"/></g></svg> |