
import browser from "../utils/browser"

const config = {
  
    /**
     * 静态资源路径
     */
    staticURL: process.env.VUE_APP_STATIC_DIR,
    projectNum: browser.urlQueryValue('m') || 'HUS000011347353956009021440',
    sceneNum: browser.urlQueryValue('s') || 'fcb_jF0IN4ODQ',
    hengdaNum: browser.urlQueryValue('h') || '6017118343179540233',
    isView: browser.urlQueryValue('canView') || '0',
    intranet: process.env.VUE_APP_INNERNET,
    CDN: process.env.VUE_APP_CDN,
    client_code: process.env.VUE_APP_CLIENT_CODE,
    panoSetting:{
      angle_of_view:{
        viewSettings:[
                {
                  sceneName:"",
                  hlookat:"",
                  vlookat:"",
                  fov:"",
                  fovmin:"",
                  fovmax:"",
                  vlookatmin:"",
                  vlookatmax:"",
                  keepView:""
                }
            ]
        },
      
        hotspot:{
            "scene_2714214b9d86af1c":{
              link:[
                    {
                      ath: "29.67632725773",
                      atv: "14.842309070323",
                      hotspotTitle: "erer",
                      iconType: "system",
                      imgPath: "https://chuanvr.cn/vrimages/def_material/1609325861896b0h.png",
                      isDynamic: "0",
                      isNewWindow: "1",
                      isShowSpotName: "",
                      link: "http://tetet",
                      name: "schp_z35sqjjbmy",
                      thumbPath: "https://chuanvr.cn/vrimages/def_material/1609325861896b0h.png",
                    }
                ],
            }
        }
    },

    /**
     * 版本号,保存发布时自动增加
     */
    version: Date.now(),

    /**
     * 获取静态资源地址
     * @param {params} args 资源地址
     */
    getStaticResource(...args) {
        return [this.staticURL, ...args].join('')
    },

    /**
     * 编码HTML
     * @param {*} str 
     */
    html_encode(str){
      var s = "";
      if (str.length == 0) return "";
      s = str.replace(/\'/g, "&#39;");
      s = s.replace(/\"/g, "&quot;");
      s = s.replace(/\(/g, "（");
      s = s.replace(/\)/g, "）");
      s = s.replace(/,/g, "，");
      return s;
    },

    /**
     * 获取krpano对象
     *  @param {*} obj 
     */
    getKrpano(obj){
        if(typeof(obj)=="undefined"||obj==null) obj="krpanoSWFObject";
        var krpano = document.getElementById(obj);
        return krpano;
      }
};

export default config