full_screen.js 1.04 KB
// components/userqy_pop_up/userqy_pop_up.js
Component({
  /**
   * 页面的初始数据
   */
  data: {
    control: 1,
	is_full_screen_show:0,  //全屏显示
	sec_show:3,    //倒计时的秒数
	full_ad:null,  //全屏广告
  },
  
  properties: {
  
  },
  ready: function () {
   
  },
 
  methods: {
    close_full_screen(){
    	this.setData({is_full_screen_show:0});
    },
    //跳转到满屏广告的链接
    go_full_ad(){
    	if(!full_ad) return false;
    	if(!full_ad.ad_weapplink) return false;
    	getApp().goto(full_ad.ad_weapplink);
    },
    
    get_the_full_screen(){
    	var th=this;
    	//获取全屏的广告
    	getApp().request.promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + o.stoid,{
    		data: { enabled: 1 }
    	}).then(res=>{
             //判断是不是有全屏广告 	
    		 if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
    			 th.setData({
    				 is_full_screen_show:1,
    				 full_ad:res.data.data.pageData[0]
    			 })
    		 }				
    	})
    }

  },
  

 
  
  
})