package com.mints.goodmoney.common

import android.os.Environment
import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.manager.UserManager
import com.mints.library.utils.CommonUtils

object Constant {

    /**
     * 首次弹出权限声明
     */
    const val LOAN_PERMISSION_FLAG = "loan_permission_flag"

    /**
     * 获取TAGNAME
     */
    const val TAG_NAME = "SUN"

    /**
     * app名称
     */
    const val MINTS_APP_NAME = "好赚钱"

    /**
     * 应用包名
     */
    const val MINTS_PKG_NAME = "com.mints.goodmoney"

    /**
     * 退出广播tag
     */
    const val ACTION_EXIT_APP = "package.exit"

    /**
     * 是否首次使用(安装后才是首次使用)
     */
    const val FIRST_USE_KEY = "app_first_use"

    /**
     * 默认的加密向量
     */
    const val DEFAULT_CHANNEL_SECRET = "mail.gs.com@2x222$#bbb#2"

    /**
     * 自定义版本控制，为升级后做预操作
     */
    const val CUSTOM_VERSION = "custom_version"

    /**
     * 是否第一次打开app的标示的key,在SplashActivity界面使用
     */
    const val ISFIRSTENTER = "isfirstenter"

    /**
     * 存储地址 /storage/emulated/0/test/
     */
    var ICASH_PATH = Environment.getExternalStorageDirectory().path + "/money/" + "apk/"

    /**
     * app应用首页 0-主页 1-横屏视频 2-pan 3-friends 4-我
     */
    const val FRAGMENT_CLICK_MAIN = 0
    const val FRAGMENT_CLICK_PAN = 1
    const val FRAGMENT_CLICK_CHANNEL = 2
    const val FRAGMENT_CLICK_FRIENDS = 3
    const val FRAGMENT_CLICK_MY = 4

    // 协议地址
    var REGISTER_URL = BuildConfig.MainIp + "gm/register.html"//服务协议
    var PRIVACY_URL = BuildConfig.MainIp + "gm/privacy.html"//隐私协议


    /**
     * 奖励标识
     */
    const val MAIN_CUR_COIN = "main_cur_coin" //当前金币展示
    const val MAIN_EXTRA_ID = "main_extra_id" //额外ID
    const val MAIN_CARRIER_TYPE = "main_carrier_type" //载体


    const val LOGIN_FLAG = "login_flag" //登录标识


    // 载体
    const val CARRIER_VERSUS_VIDEO = "CHALLENGE_VEDIO" //任务-视频
    const val CARRIER_CHALLENGE_TURN = "CHALLENGE_TURN" //大转盘
    const val CARRIER_SIGNIN_HOMEPAGE_CARD = "SIGNIN_HOMEPAGE_CARD" //签到翻倍
    const val CARRIER_SIGNIN_HOMEPAGE_AWARD = "SIGNIN_HOMEPAGE_AWARD" //签到奖励
    const val CARRIER_HOMEVEDIO_BIG = "HOMEVEDIO_BIG" //首页大红包
    const val CARRIER_HOMEVEDIO_SMALL = "HOMEVEDIO_SMALL" //首页小红包
    const val CARRIER_OFFLINE_DOUBLE = "OFFLINE_DOUBLE" //离线收益
    const val CARRIER_CHALLENGE_CARD = "CHALLENGE_CARD" //刮刮乐
    const val CARRIER_GAME = "GAME" //游戏
    const val CARRIER_HOMEWATER = "HOMEWATER" //喝水
    const val CARRIER_WALK = "WALK" //走路
    const val CARRIER_WALK_BUBBLE = "WALK_BUBBLE" //走路汽泡
    const val CARRIER_NEW_USER = "CARRIER_NEW_USER" //新用户红包
    const val CARRIER_GAME_ONLINE = "GAME_ONLINE" //跳转猎豹
    const val CARRIER_ZHANGYUE = "ZHANGYUE" //阅读书城
    const val CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE = "CHALLENGE_SHAREFRIEND_DOUBLE" //邀请好友翻倍
    const val CARRIER_HOMEVEDIO = "HOMEVEDIO" //首页红包
    const val CARRIER_HOMEVEDIO_DOUBLE = "HOMEVEDIO_DOUBLE" //首页红包翻倍
    const val CARRIER_SMALLHOMEVEDIO = "SMALLHOMEVEDIO" //首页红包
    const val CARRIER_SMALLHOMEVEDIO_DOUBLE = "SMALLHOMEVEDIO_DOUBLE" //首页红包翻倍

    const val SHAREFRIEND_COMPLETE_1 = "SHAREFRIEND_COMPLETE_1" //邀请任务1
    const val SHAREFRIEND_COMPLETE_2 = "SHAREFRIEND_COMPLETE_2" //邀请任务2
    const val SHAREFRIEND_COMPLETE_3 = "SHAREFRIEND_COMPLETE_3" //邀请任务3
    const val SHAREFRIEND_COMPLETE_4 = "SHAREFRIEND_COMPLETE_4" //邀请任务4
    const val SHAREFRIEND_COMPLETE_5 = "SHAREFRIEND_COMPLETE_5" //邀请任务5
    const val SHAREFRIEND_COMPLETE_6 = "SHAREFRIEND_COMPLETE_6" //邀请任务6
    const val CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友


    const val AD_SOURCE_CSJ = "CSJ"
    const val AD_SOURCE_YLH = "YLH"

    // 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重
    const val EVENT_TYPE_ZERO = "0"
    const val EVENT_TYPE_ONE = "1"
    const val EVENT_TYPE_TWO = "2"
    const val EVENT_TYPE_THREE = "3"
    const val EVENT_TYPE_FOUR = "4"

    const val ADTYPE_VEDIO = "VEDIO" //视频广告增加积分

    // 穿山甲激励视频id
    const val CSJ_VEDIO_APPIP = "csj_vedio_appip"


    // 视频广告类型
    const val CSJ_VEDIO_AD = "CSJ_VEDIO_AD"
    const val YLH_VEDIO_AD = "YLH_VEDIO_AD"


    // 游戏类型
    const val EVENT_TYPE_CLICK = "CLICK"
    const val EVENT_TYPE_TIME = "TIME"
    const val EVENT_TYPE_ADCLICK = "GAME_AD_CLICK"
    const val EVENT_TYPE_GAMEINFO = "GAMEINFO"

    // 热门活动类型
    const val HOT_ACTIVITY_WATER = "water"
    const val HOT_ACTIVITY_WALK = "walk"
    const val HOT_ACTIVITY_CARD = "card"
    const val HOT_ACTIVITY_BXM = "bianxianmao"
    const val HOT_ACTIVITY_H5 = "h5"

    // 打开激活
    const val FIRST_DEVICE_FLAG = "first_device_flag"

    // share
    const val SHARE_TITLE = "当下流行的赚钱模式，边看边玩边赚钱"
    var SHARE_CONTENT = "邀请码【${UserManager.getInstance().codeID}】，共享新模式，快来加入跟我一起赚钱吧"
    var SHARE_URL: String = BuildConfig.MainIp + "share/shareFriend.html?ruid=" + UserManager.getInstance().getUserID() + "&channel=" + CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")

    // 首页视频时长 单位-秒
    const val MAIN_VEDIO_TIME = "main_vedio_time"

    // 首页视频时长 单位-秒
    const val CHANNEL_SHARE = "share_goodmoney"
}