FollowPopup.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="add_follow">
  3. <view class="close_area"><button class="close_btn" @click="closePopup">关闭</button></view>
  4. <view class="info_alter">
  5. <text v-show="follow_linkurl">点击二维码添加客服</text>
  6. <text v-show="!follow_linkurl">长按二维码添加客服</text>
  7. </view>
  8. <view class="qr_code_area" @click="followLinkurl">
  9. <image :src="followQrcode" class="qr_code" mode="" show-menu-by-longpress> </image>
  10. </view>
  11. <view class="rule_info">
  12. <view class="">报单规则:</view>
  13. <view class="">1、预约报单需要添加客服人员</view>
  14. <view class="">2、添加完客服人员后填写小程序当前登录手机号以绑定账号</view>
  15. <view class="">3、开始预约报单</view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. props: {
  22. //关闭弹窗
  23. closePopup: {
  24. type: Function,
  25. required: true,
  26. },
  27. },
  28. data() {
  29. return {
  30. follow_linkurl: this.$checkAccess.getFollowLinkUrl(),
  31. followQrcode: this.$checkAccess.getFollowQrcode(),
  32. };
  33. },
  34. methods: {
  35. // 去往webview
  36. followLinkurl() {
  37. // 获取登录标识
  38. let userInfo = uni.getStorageSync("userInfo");
  39. // 如果不存在的话
  40. if (!userInfo) return "";
  41. // 未添加好友
  42. if (!userInfo.follow_linkurl) return "";
  43. // 获取Url
  44. let url = userInfo.follow_linkurl;
  45. // 没有路径,不跳转
  46. if (!url) return;
  47. // 判断是不是小程序链接
  48. if (url.includes("http")) {
  49. // 转码
  50. let link_url = encodeURIComponent(url);
  51. // 跳转到webview
  52. uni.redirectTo({
  53. url: `/pages/webview/index?link_url=${link_url}`,
  54. });
  55. } else {
  56. // 跳转到webview
  57. uni.navigateTo({
  58. url: url,
  59. });
  60. }
  61. },
  62. },
  63. };
  64. </script>
  65. <style lang="less" scoped>
  66. .add_follow {
  67. display: block;
  68. color: #ffffff;
  69. width: 700rpx;
  70. height: 800rpx;
  71. margin: 0 auto;
  72. font-size: 26rpx;
  73. border-radius: 40rpx;
  74. background: linear-gradient(to bottom, #ff0091 0%, #2c82ff 100%);
  75. .close_area {
  76. height: 80rpx;
  77. display: block;
  78. line-height: 80rpx;
  79. .close_btn {
  80. color: #ffffff;
  81. float: right;
  82. width: 80rpx;
  83. height: 80rpx;
  84. font-size: 26rpx;
  85. text-align: center;
  86. line-height: 80rpx;
  87. padding: 0rpx 0rpx;
  88. border: 0rpx solid transparent;
  89. background-color: transparent;
  90. }
  91. .close_btn::after {
  92. border: 0rpx solid transparent;
  93. }
  94. }
  95. .info_alter {
  96. display: block;
  97. height: 100rpx;
  98. font-size: 42rpx;
  99. font-weight: bold;
  100. text-align: center;
  101. line-height: 100rpx;
  102. }
  103. .qr_code_area {
  104. display: block;
  105. width: 300rpx;
  106. height: 300rpx;
  107. margin: 30rpx auto;
  108. .qr_code {
  109. float: left;
  110. width: 300rpx;
  111. height: 300rpx;
  112. }
  113. }
  114. .save_btn {
  115. color: #333333;
  116. display: block;
  117. width: 260rpx;
  118. height: 80rpx;
  119. font-size: 26rpx;
  120. text-align: center;
  121. line-height: 80rpx;
  122. padding: 0rpx 0rpx;
  123. margin: 40rpx auto;
  124. border-radius: 40rpx;
  125. background-color: #ffffff;
  126. border: 0rpx solid transparent;
  127. }
  128. .rule_info {
  129. width: 600rpx;
  130. display: block;
  131. font-size: 26rpx;
  132. margin: 20rpx auto;
  133. overflow: hidden;
  134. line-height: 40rpx;
  135. }
  136. }
  137. </style>