customer-wiget.nvue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <u-popup :show="isShow" :zIndex="20" mode="center" bgColor="transparent">
  3. <view class="pop-body fx-h fx-bc">
  4. <view class="top-bg">
  5. <image class='image' src="/static/img/tip-bg.png"></image>
  6. <text class="text">联系客服</text>
  7. </view>
  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. <u-icon @tap="tapCancel" name="close-circle" size="35" color="#fff"></u-icon>
  19. </view>
  20. </view>
  21. </u-popup>
  22. </template>
  23. <style lang="scss">
  24. .pop-body {
  25. position: relative;
  26. .top-bg {
  27. position: absolute;
  28. top: -9vw;
  29. z-index: 1;
  30. .image {
  31. width: 450rpx;
  32. height: 135rpx;
  33. }
  34. .text {
  35. position: absolute;
  36. width: 100%;
  37. height: 100%;
  38. top: 0;
  39. left: 0;
  40. font-size: 32rpx;
  41. color: #734227;
  42. text-align: center;
  43. line-height: 16vw;
  44. }
  45. }
  46. .inner {
  47. padding: 20px;
  48. width: 600rpx;
  49. position: relative;
  50. background: #fff;
  51. border-radius: 20rpx;
  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. }
  96. }
  97. </style>
  98. <script>
  99. import Request from '@/library/Request.js'
  100. var swH = 0;
  101. export default {
  102. name: 'ui-customer',
  103. props: {},
  104. data() {
  105. return {
  106. isShow: false,
  107. wxName: ""
  108. }
  109. },
  110. methods: {
  111. tapCancel: function() {
  112. this.isShow = false;
  113. },
  114. open() {
  115. uni.showLoading({
  116. title: '获取数据中..'
  117. });
  118. console.log(Request, 'Request')
  119. Request
  120. .post("indexGuLx")
  121. .then(res => {
  122. uni.hideLoading();
  123. if (res.code == 200) {
  124. this.wxName = res.data.wxname;
  125. this.isShow = true;
  126. } else {
  127. this.utils.Tip(res.msg);
  128. }
  129. })
  130. .catch((res) => {
  131. console.log(res);
  132. uni.hideLoading();
  133. uni.showModal({
  134. title: '系统提示',
  135. content: '加载失败,返回在尝试',
  136. showCancel: false
  137. });
  138. });
  139. },
  140. tapCopy() {
  141. uni.setClipboardData({
  142. data: value,
  143. showToast: true
  144. });
  145. }
  146. }
  147. }
  148. </script>