customer-wiget.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <uv-popup ref='openKf' :zIndex="20" mode="center" bgColor="transparent">
  3. <view class="top-bg">
  4. <image class='image' src="/static/img/tip-bg.png"></image>
  5. <text class="text">联系客服</text>
  6. </view>
  7. <view class="pop-body fx-h fx-bc">
  8. <view class="inner fx-h fx-bc">
  9. <text class="title">已为您定制专属客服</text>
  10. <image src="/static/img/kfu.png" class="kfu-icon"></image>
  11. <view class="wx">客服VX:{{ wxName }}</view>
  12. <view class="btns fx-r fx-bc">
  13. <text class="n-btn ihover" @tap="tapCancel">取消</text>
  14. <text class="copy-btn ihover" @tap="tapCopy">复制微信</text>
  15. </view>
  16. </view>
  17. <view class="m-close">
  18. <uv-icon @tap="tapCancel" name="close-circle" size="35" color="#fff"></uv-icon>
  19. </view>
  20. </view>
  21. </uv-popup>
  22. </template>
  23. <style lang="scss">
  24. .top-bg {
  25. position: relative;
  26. text-align: center;
  27. z-index: 100;
  28. margin-bottom: -80rpx;
  29. .image {
  30. width: 60vw;
  31. height: 18vw;
  32. }
  33. .text {
  34. position: absolute;
  35. width: 100%;
  36. height: 100%;
  37. top: 0;
  38. left: 0;
  39. font-size: 32rpx;
  40. color: #734227;
  41. text-align: center;
  42. line-height: 16vw;
  43. }
  44. }
  45. .pop-body {
  46. position: relative;
  47. .inner {
  48. padding: 20px;
  49. width: 80vw;
  50. position: relative;
  51. background: #fff;
  52. border-radius: 20rpx;
  53. .title {
  54. font-size: 32rpx;
  55. color: #333333;
  56. margin-bottom: 20rpx;
  57. padding-top: 20rpx;
  58. }
  59. .wx {
  60. font-size: 32rpx;
  61. color: #333333;
  62. margin-top: 20rpx;
  63. }
  64. .kfu-icon {
  65. width: 180rpx;
  66. height: 143rpx;
  67. }
  68. .btns {
  69. margin-top: 30rpx;
  70. .n-btn {
  71. border-radius: 10rpx;
  72. border: 2rpx solid #DFC77C;
  73. font-size: 32rpx;
  74. color: #625120;
  75. padding: 0 80rpx;
  76. margin-right: 40rpx;
  77. height: 80rpx;
  78. line-height: 80rpx;
  79. }
  80. .copy-btn {
  81. background: linear-gradient(-90deg, #D4BA6C 0%, #F9E8A5 100%);
  82. border-radius: 10px;
  83. font-size: 32rpx;
  84. color: #625120;
  85. padding: 0 80rpx;
  86. height: 80rpx;
  87. line-height: 80rpx;
  88. }
  89. }
  90. }
  91. .m-close {
  92. margin-top: 60rpx;
  93. }
  94. }
  95. </style>
  96. <script>
  97. import Request from '@/library/Request.js'
  98. var swH = 0;
  99. export default {
  100. name: 'ui-customer',
  101. props: {},
  102. data() {
  103. return {
  104. isShow: false,
  105. wxName: ""
  106. }
  107. },
  108. methods: {
  109. tapCancel: function() {
  110. this.$refs.openKf.close()
  111. },
  112. open() {
  113. const that = this;
  114. uni.showLoading({
  115. title: '获取数据中..'
  116. });
  117. console.log(Request, 'Request')
  118. Request
  119. .post("indexGuLx")
  120. .then(res => {
  121. uni.hideLoading();
  122. if (res.code == 200) {
  123. that.wxName = res.data.wxname;
  124. that.$refs.openKf.open()
  125. } else {
  126. that.utils.Tip(res.msg);
  127. }
  128. })
  129. .catch((res) => {
  130. console.log(res);
  131. uni.hideLoading();
  132. uni.showModal({
  133. title: '系统提示',
  134. content: '加载失败,返回在尝试',
  135. showCancel: false
  136. });
  137. });
  138. },
  139. tapCopy() {
  140. uni.setClipboardData({
  141. data: value,
  142. showToast: true
  143. });
  144. }
  145. }
  146. }
  147. </script>