customer-wiget.vue 2.9 KB

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