123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- Vue.component('popup-data-export', {
- delimiters: ['@@', '@@'],
- template: `
- <div class="popupDataexport">
- <van-popup v-model="show">
- <div class="warm">
- <div class="close" @click="show = false"></div>
- <div class="content_box">
- <p class="title">温馨提示</p>
- <div class="text_box">您选择的数据超过了导出数据最大值<span class="blue">20,000</span>,请优化条件后导出。您也可联系客服:<span @click="callPhone('400-108-6670')">400-108-6670</span>,或添加<span class="blue">客服微信</span>进行定制化导出。</div>
- <div class="qr_box">
- <img :src="img" alt="">
- </div>
- <div class="desc">客服微信</div>
- <div class="btn_box">
- <div class="btn"><div :class="choose?'choosed':'nochoose'" @click="btnClick"></div></div>
- <p class="text">后续不再提醒</p>
- </div>
- </div>
- <div class="footer" @click="next">
- <span>继续导出20000条</span>
- </div>
- </div>
- </van-popup>
- </div>
- `,
- props: {
- },
- data: function () {
- return {
- show: false,
- choose:false,
- img:'',
- isPrompt:true
- }
- } ,
- created (){
- let this_ = this
- this.getqr()
- $.ajax({
- type: 'POST',
- url:this_.isWX ? '/front/dataExport/getDontPromptAgain' : '/jyapp/front/dataExport/getDontPromptAgain',
- success: function (res) {
- if(!res){return}
- this_.isPrompt = res.isPrompt
- },
- error: function (error) {
- }
- })
- },
- mounted () {
- },
- computed: {
- isWX () {
- if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
- return true
- }else{
- return false
- }
- }
- },
- methods: {
- getqr () {
- let _this = this
- $.ajax({
- type: 'POST',
- url: '/bigmember/use/isAdd?t=' + Date.now(),
- success: function (res) {
- if(!res.data){return}
- if(res.data.customers&&res.data.customers.length>0){
- let list = res.data.customers
- list.forEach(e => {
- if(e.remark === '客户经理'){
- _this.img = e.wxer
- }
- })
- if(_this.img == ''){
- _this.img = customer[0].wxer
- }
- }
- },
- error: function (error) {
- }
- })
- },
- btnClick(){
- this.choose = !this.choose
- this.setDontPrompt()
- },
- next(){
- this.$emit('next',{choose:this.choose})
- },
- setDontPrompt: debounce_(function(){
- let this_ = this
- let url_ = this.isWX ? '/front/dataExport/setDontPromptAgain' : '/jyapp/front/dataExport/setDontPromptAgain'
- if(this.choose){
- $.ajax({
- type: 'POST',
- url: url_,
- data: {status:1},
- contentType: 'application/x-www-form-urlencoded',
- success: function (res) {
- this_.isPrompt = true
- },
- error: function (error) {
- }
- })
- }else{
- $.ajax({
- type: 'POST',
- url: url_,
- data: {status:0},
- contentType: 'application/x-www-form-urlencoded',
- success: function (res) {
- this_.isPrompt = false
- },
- error: function (error) {
- }
- })
- }
- },300),
- callPhone: function (tel) {
- if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) { // 微信
- location.href = 'tel:' + tel
- } else {
- try {
- JyObj.callPhone(tel);
- } catch (error) {
- console.log(error)
- }
- }
- },
- }
- })
- function debounce_ (func, delay, immediate){
- var timer = null;
- delay = delay || 200
- return function() {
- var context = this;
- var args = arguments;
- if(timer) clearTimeout(timer);
- if(immediate){
- var doNow = !timer;
- timer = setTimeout(function(){
- timer = null;
- },delay);
- if(doNow){
- func.apply(context,args);
- }
- }else{
- timer = setTimeout(function(){
- func.apply(context,args);
- },delay);
- }
- }
- }
|