customer-wiget.nvue 3.0 KB

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