popupDataexport.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <div class="popupDataexport">
  3. <van-popup v-model="show">
  4. <div class="warm">
  5. <div class="close" @click="show = false"></div>
  6. <div class="content_box">
  7. <p class="title">温馨提示</p>
  8. <div class="text_box">
  9. 您选择的数据超过了导出数据最大值<span class="blue">20,000</span
  10. >,请优化条件后导出。您也可联系客服:<span
  11. @click="call_phone('400-108-6670')"
  12. >400-108-6670</span
  13. >,或添加<span class="blue">客服微信</span>进行定制化导出。
  14. </div>
  15. <div class="qr_box">
  16. <img :src="img" alt="" />
  17. </div>
  18. <div class="desc">客服微信</div>
  19. <div class="btn_box">
  20. <div class="btn">
  21. <div
  22. :class="choose ? 'choosed' : 'nochoose'"
  23. @click="btnClick"
  24. ></div>
  25. </div>
  26. <p class="text">后续不再提醒</p>
  27. </div>
  28. </div>
  29. <div class="footer" @click="next">
  30. <span>继续导出20000条</span>
  31. </div>
  32. </div>
  33. </van-popup>
  34. </div>
  35. </template>
  36. <script>
  37. import { Popup } from 'vant'
  38. import { mapState, mapActions } from 'vuex'
  39. import { callPhone } from '@/utils/callFn'
  40. import { debounce } from 'lodash'
  41. import { setDontPromptAgain, getDontPromptAgain } from '@/api/modules'
  42. export default {
  43. name: 'popupDataexport',
  44. components: {
  45. [Popup.name]: Popup
  46. },
  47. props: {},
  48. computed: {
  49. ...mapState('user', ['power'])
  50. },
  51. data() {
  52. return {
  53. show: false,
  54. choose: false,
  55. img: '',
  56. isPrompt: true
  57. }
  58. },
  59. created() {
  60. getDontPromptAgain().then((res) => {
  61. if (!res) {
  62. return
  63. }
  64. this.isPrompt = res.isPrompt
  65. })
  66. },
  67. mounted() {
  68. this.getQRimg()
  69. },
  70. methods: {
  71. ...mapActions('user', ['getPower']),
  72. btnClick() {
  73. this.choose = !this.choose
  74. this.setDontPrompt()
  75. },
  76. setDontPrompt: debounce(function () {
  77. if (this.choose) {
  78. setDontPromptAgain({ status: 1 }).then((res) => {
  79. this.isPrompt = false
  80. })
  81. } else {
  82. setDontPromptAgain({ status: 0 }).then((res) => {
  83. this.isPrompt = true
  84. })
  85. }
  86. }, 300),
  87. call_phone(tel) {
  88. if (this.$envs.inApp || this.$envs.inWX) {
  89. callPhone(tel)
  90. }
  91. },
  92. next() {
  93. this.$emit('next', { choose: this.choose })
  94. },
  95. async getQRimg() {
  96. if (this.power) {
  97. if (this.power.customers && this.power.customers.length > 0) {
  98. let customer = this.power.customers
  99. customer.forEach((e) => {
  100. if (e.remark === '客户经理') {
  101. this.img = e.wxer
  102. }
  103. })
  104. if (this.img == '') {
  105. this.img = customer[0].wxer
  106. }
  107. }
  108. } else {
  109. await this.getPower()
  110. this.getQRimg()
  111. }
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .popupDataexport {
  118. .van-popup {
  119. background-color: rgba(0, 0, 0, 0);
  120. }
  121. .warm {
  122. width: 303px;
  123. height: 445px;
  124. background-color: #fff;
  125. border-radius: 8px;
  126. position: relative;
  127. .close {
  128. width: 20px;
  129. height: 20px;
  130. display: block;
  131. position: absolute;
  132. right: 8px;
  133. top: 8px;
  134. z-index: 2;
  135. background-image: url(@/assets/image/dataExport/close.png);
  136. background-size: contain;
  137. }
  138. .content_box {
  139. padding: 24px 30px 16px 30px;
  140. .title {
  141. font-size: 18px;
  142. font-weight: 400;
  143. line-height: 26px;
  144. text-align: center;
  145. color: #171826;
  146. }
  147. .text_box {
  148. font-size: 14px;
  149. font-weight: 400;
  150. line-height: 20px;
  151. color: #5f5e64;
  152. margin-top: 8px;
  153. .blue {
  154. color: #2abed1;
  155. }
  156. }
  157. .qr_box {
  158. border: 1px solid #0000001a;
  159. border-radius: 8px;
  160. width: 141px;
  161. height: 141px;
  162. display: flex;
  163. justify-content: center;
  164. align-items: center;
  165. margin: auto;
  166. margin-top: 24px;
  167. img {
  168. width: 134px;
  169. height: 134px;
  170. }
  171. }
  172. .desc {
  173. text-align: center;
  174. font-size: 14px;
  175. font-weight: 400;
  176. line-height: 20px;
  177. color: #1b1a2a;
  178. margin-top: 12px;
  179. }
  180. }
  181. .btn_box {
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. margin-top: 24px;
  186. .btn {
  187. width: 24px;
  188. height: 24px;
  189. justify-content: center;
  190. display: flex;
  191. align-items: center;
  192. }
  193. .choosed {
  194. width: 24px;
  195. height: 24px;
  196. background-image: url('@/assets/image/dataExport/choose_right.png');
  197. background-size: contain;
  198. }
  199. .nochoose {
  200. width: 18px;
  201. height: 18px;
  202. border-radius: 50%;
  203. border: 1px solid #0000001a;
  204. }
  205. .text {
  206. font-size: 12px;
  207. font-weight: 400;
  208. line-height: 18px;
  209. color: #9b9ca3;
  210. margin-left: 4px;
  211. }
  212. }
  213. .footer {
  214. border-top: 1px solid #0000001a;
  215. display: flex;
  216. justify-content: center;
  217. align-items: center;
  218. color: #2abed1;
  219. font-size: 18px;
  220. height: 45px;
  221. }
  222. }
  223. }
  224. </style>