特易招,招聘小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
1.9 KiB

4 months ago
  1. <template>
  2. <!-- 联系客服弹框 -->
  3. <uv-overlay :show="show" @click="close">
  4. <view class="warp">
  5. <view class="rect" @tap.stop>
  6. <view class="title">联系客服</view>
  7. <view class="center">确定拨打客服电话?</view>
  8. <view class="bottom">
  9. <view class="btn1"
  10. @click="close">
  11. 取消
  12. </view>
  13. <view class="btn2"
  14. @click="confirm">
  15. 确定
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </uv-overlay>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. show: false,
  27. phone:'',
  28. }
  29. },
  30. onLoad() {
  31. this.getCustomPhone()
  32. },
  33. methods: {
  34. getCustomPhone(){
  35. this.$api('customUser', {}, res => {
  36. this.phone = res.result.phone
  37. })
  38. },
  39. open() {
  40. this.show = true
  41. },
  42. close() {
  43. this.show = false
  44. },
  45. // 拨打电话
  46. confirm() {
  47. this.show = false
  48. uni.makePhoneCall({
  49. phoneNumber: this.phone,
  50. success() {
  51. console.log('安卓拨打成功');
  52. },
  53. fail() {
  54. console.log('安卓拨打失败');
  55. }
  56. })
  57. },
  58. }
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .warp {
  63. display: flex;
  64. align-items: center;
  65. justify-content: center;
  66. height: 100%;
  67. }
  68. .rect {
  69. width: 600rpx;
  70. height: 300rpx;
  71. background-color: #fff;
  72. border-radius: 20rpx;
  73. overflow: hidden;
  74. .title {
  75. padding: 10rpx 0 0 15rpx;
  76. background-color: $uni-color;
  77. color: #FFF;
  78. text-align: left;
  79. width: 100%;
  80. height: 18%;
  81. font-size: 36rpx;
  82. }
  83. .center {
  84. height: 40%;
  85. display: flex;
  86. justify-content: center;
  87. align-items: center;
  88. font-size: 36rpx;
  89. }
  90. .bottom {
  91. display: flex;
  92. justify-content: center;
  93. gap: 50rpx;
  94. view{
  95. height: 60rpx;
  96. line-height: 60rpx;
  97. padding: 0 50rpx;
  98. border-radius: 30rpx;
  99. }
  100. .btn1{
  101. background-color: #fff;
  102. }
  103. .btn2{
  104. background-color: $uni-color;
  105. color: #fff;
  106. }
  107. }
  108. }
  109. </style>