混凝土运输管理微信小程序、替班
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.

120 lines
2.1 KiB

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