铝交易,微信公众号
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.

164 lines
3.4 KiB

4 months ago
2 months ago
2 months ago
2 months ago
3 months ago
2 months ago
2 months ago
3 months ago
3 months ago
2 months ago
4 months ago
2 months ago
2 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">{{ $t('components.contactCustomerService') }}</view>
  7. <view class="center">{{ $t('components.confirmCallCustomerService') }}?</view>
  8. <view class="bottom">
  9. <view>
  10. <uv-button type="info" shape="circle" :text="$t('components.cancel')"
  11. :custom-style="customStyle1" @click="close"></uv-button>
  12. </view>
  13. <view>
  14. <uv-button type="info" shape="circle" :text="$t('components.confirmD')"
  15. :custom-style="customStyle2" @click="confirm"></uv-button>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </uv-overlay>
  21. </template>
  22. <script>
  23. import {
  24. mapState
  25. } from 'vuex'
  26. export default {
  27. data() {
  28. return {
  29. show: false,
  30. phone: '',
  31. }
  32. },
  33. computed: {
  34. customStyle1() {
  35. return {
  36. height: '60rpx',
  37. background: '#FFF',
  38. color: '#000000',
  39. fontSize: '36rpx',
  40. borderRadius: '40rpx', //圆角
  41. // nvue中必须是下方的写法
  42. 'border-top-right-radius': '40rpx',
  43. 'border-bottom-left-radius': '40rpx',
  44. 'border-bottom-right-radius': '40rpx',
  45. 'width': '150rpx',
  46. }
  47. },
  48. customStyle2() {
  49. return {
  50. height: '60rpx',
  51. background: '#1f1c39',
  52. color: '#FFF',
  53. fontSize: '34px',
  54. borderRadius: '40rpx', //圆角
  55. // nvue中必须是下方的写法
  56. 'border-top-right-radius': '40rpx',
  57. 'border-bottom-left-radius': '40rpx',
  58. 'border-bottom-right-radius': '40rpx',
  59. 'width': '150rpx',
  60. }
  61. },
  62. ...mapState(['customerPhone']),
  63. },
  64. mounted() {
  65. // this.getCustomPhone()
  66. },
  67. methods: {
  68. getCustomPhone() {
  69. this.$api('getImagePhoneOther', res => {
  70. console.log(res)
  71. this.phone = res.result.phone
  72. })
  73. },
  74. open() {
  75. this.show = true
  76. },
  77. close() {
  78. this.show = false
  79. },
  80. // 拨打电话
  81. confirm() {
  82. var that = this;
  83. this.show = false
  84. uni.makePhoneCall({
  85. phoneNumber: that.customerPhone,
  86. })
  87. return
  88. // console.log('拨打电话', that.customerPhone)
  89. // const res = uni.getSystemInfoSync();
  90. // // ios系统默认有个模态框
  91. // if (res.platform == 'ios') {
  92. // uni.makePhoneCall({
  93. // phoneNumber: that.customerPhone,
  94. // success() {
  95. // console.log('ios拨打成功');
  96. // },
  97. // fail() {
  98. // console.log('ios拨打失败');
  99. // }
  100. // })
  101. // } else {
  102. // //安卓手机手动设置一个showActionSheet
  103. // uni.showActionSheet({
  104. // itemList: [that.customerPhone, '呼叫'],
  105. // success: function(res) {
  106. // if (res.tapIndex == 1) {
  107. // uni.makePhoneCall({
  108. // phoneNumber: that.customerPhone,
  109. // })
  110. // }
  111. // }
  112. // })
  113. // }
  114. },
  115. }
  116. }
  117. </script>
  118. <style scoped lang="scss">
  119. .warp {
  120. display: flex;
  121. align-items: center;
  122. justify-content: center;
  123. height: 100%;
  124. }
  125. .rect {
  126. width: 600rpx;
  127. height: 300rpx;
  128. background-color: #fff;
  129. border-radius: 20rpx;
  130. overflow: hidden;
  131. .title {
  132. padding: 20rpx 0 10rpx 20rpx;
  133. background-color: $uni-color;
  134. color: #FFF;
  135. text-align: left;
  136. width: 100%;
  137. height: 18%;
  138. font-size: 36rpx;
  139. }
  140. .center {
  141. height: 40%;
  142. display: flex;
  143. justify-content: center;
  144. align-items: center;
  145. font-size: 36rpx;
  146. }
  147. .bottom {
  148. display: flex;
  149. justify-content: center;
  150. gap: 50rpx;
  151. }
  152. }
  153. </style>