风险测评小程序前端代码仓库
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.

118 lines
2.3 KiB

  1. <template>
  2. <uv-popup
  3. ref="popup"
  4. :overlayOpacity="0"
  5. mode="center"
  6. bgColor="none"
  7. >
  8. <view class="popup__view">
  9. <image class="bg" src="@/pages_order/static/service/bg-popup-phone.png" mode="widthFix"></image>
  10. <view class="flex flex-column content">
  11. <text class="title">电话咨询</text>
  12. <view class="flex phone">
  13. <view class="flex icon" @click="onCall">
  14. <image class="img" src="@/pages_order/static/service/icon-phone.png" mode="widthFix"></image>
  15. </view>
  16. <view>{{ phone }}</view>
  17. </view>
  18. <button class="btn" @click="onCopy()">复制手机号</button>
  19. </view>
  20. </view>
  21. </uv-popup>
  22. </template>
  23. <script>
  24. import { mapState } from 'vuex'
  25. import utils from '@/utils/utils.js'
  26. export default {
  27. data() {
  28. return {
  29. phone: '',
  30. }
  31. },
  32. computed : {
  33. ...mapState(['configList'])
  34. },
  35. methods: {
  36. open() {
  37. this.phone = this.configList.customer_service_phone
  38. this.$refs.popup.open();
  39. },
  40. close() {
  41. this.$refs.popup.close();
  42. },
  43. onCall() {
  44. uni.makePhoneCall({
  45. phoneNumber: this.phone,
  46. success() {
  47. console.log('安卓拨打成功');
  48. },
  49. fail() {
  50. console.log('安卓拨打失败');
  51. }
  52. })
  53. },
  54. onCopy() {
  55. utils.copyText(this.phone)
  56. },
  57. },
  58. }
  59. </script>
  60. <style scoped lang="scss">
  61. .popup__view {
  62. position: relative;
  63. width: 684rpx;
  64. min-height: 701rpx;
  65. background: #FFFFFF;
  66. border-radius: 16rpx;
  67. }
  68. .bg {
  69. width: 100%;
  70. height: auto;
  71. }
  72. .content {
  73. position: absolute;
  74. top: 0;
  75. left: 0;
  76. width: 100%;
  77. height: 100%;
  78. padding: 69rpx 0;
  79. box-sizing: border-box;
  80. justify-content: space-between;
  81. }
  82. .title {
  83. font-size: 32rpx;
  84. font-weight: 600;
  85. color: #000000;
  86. }
  87. .phone {
  88. margin: 238rpx 0 122rpx 0;
  89. column-gap: 21rpx;
  90. font-size: 32rpx;
  91. font-weight: 600;
  92. color: #000000;
  93. .icon {
  94. width: 60rpx;
  95. height: 60rpx;
  96. .img {
  97. width: 100%;
  98. height: 100%;
  99. }
  100. }
  101. }
  102. .btn {
  103. padding: 29rpx 202rpx;
  104. font-size: 30rpx;
  105. color: #FFFFFF;
  106. background: #014FA2;
  107. border-radius: 50rpx;
  108. }
  109. </style>