CommonVarUtils.java 2.33 KB
package com.wd.common.utils;


import com.wd.foundation.wdkit.utils.SpUtils;

/**
 * @Description: 保存全局变量
 * @Author: baozhaoxin
 * @CreateDate: 2022/9/2 16:13
 */
public class CommonVarUtils {
    /**
     * 页面彩蛋是否可以展示
     * 0-可以
     * 1-不可以
     * 默认0
     */
    public static String easterEggsCanShow = "0";

    /**
     * 隐私弹窗是否在展示
     * 0-未展示
     * 1-展示
     * 默认0
     */
    public static String agreepomentDialogIsShow = "0";

    /**
     * 升级弹窗是否在展示
     * 0-未正在展示
     * 1-正在展示
     * */
    public static String upgradeDialogIsShow = "0";

    /**
     * 彩蛋是否正在弹窗
     * */
    public static boolean isShowingEasterEggs;

    /**
     * 是否正在弹出口令弹窗
     * */
    public static boolean isShowingClipboardCodePop;
    /**
     * 首页定位弹窗是否在展示
     * */
    public static boolean isShowLocation;

    /**
     * 高德webapi key ,查询行政区划分的
     */
    public static final String GD_SDK_WEB_API_KEY = "bb1931dc343a2560b89036e72bdee077";

    /**
     * 是否显示分享弹出
     */
    public static boolean isShowShareDialog;
    /**
     * 图文详情页音频id
     * */
    public static String articleDetailMusicObjectId;
    /**
     * 音频详情页音频id
     * */
    public static String musicDetailMusicObjectId;

    /**
     * 首页弹窗管理
     * 是否有弹窗正弹出
     * from 来源
     * 1 口令弹窗
     * 2 首页彩蛋
     * 3不校验口令弹窗
     * */
    public static boolean hasPop(int from){
        //定位弹窗是否正在展示
        if(CommonVarUtils.isShowLocation){
            return true;
        }
        //正在展示彩蛋弹窗
        if(CommonVarUtils.isShowingEasterEggs){
            return true;
        }
        //正在展示升级弹窗
        if("1".equals(CommonVarUtils.upgradeDialogIsShow)){
            return true;
        }
        //正在展示口令弹窗
        if(3 != from && CommonVarUtils.isShowingClipboardCodePop){
            return true;
        }
        //隐私政策弹窗未关闭 或者未同意隐私政策
        if ("1".equals(CommonVarUtils.agreepomentDialogIsShow) || SpUtils.isFirstAgreementFlag()) {
            return true;
        }
        return false;
    }



}