123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- /*
- * @Author: Rindy
- * @Date: 2021-04-25 16:49:05
- * @LastEditors: Rindy
- * @LastEditTime: 2021-09-15 11:31:00
- * @Description: 注释
- */
- /**
- * 配置对象
- */
- const lang_zh = {
- 'common.about': '约',
- 'common.meter': '米',
- 'cad.input': '请输入名称',
- 'model.enter': '入户门',
- }
- const config = {
- num: null,
- dom: null,
- /**
- * 运行环境
- */
- env: __ENV__,
- /**
- * SDK版本号
- */
- version: __VERSION__,
- lang: 'zh',
- langs: {},
- /**
- * SDK展示模式
- */
- view: true,
- /**
- * 移动端模式
- */
- mobile: false,
- /**
- * 部署方式,本地版为local
- */
- deploy: '',
- /**
- * 区域
- */
- region: '',
- /**
- * 服务器地址
- */
- server: '', //'https://www.4dkankan.com/',
- /**
- * 场景资源地址
- */
- resource: 'https://4dkk.4dage.com/',
- /**
- * 显示SDK信息
- */
- showSDKInfo: true,
- /**
- * 是否使用场景控制快捷键
- */
- useShortcutKeys: false,
- /**
- * statistics
- */
- useStatistics: true,
- /**
- * 是否需要用户鉴权
- */
- useAuth: false,
- /**
- * 抗锯齿
- */
- antialias: true,
- /**
- * 全景关联设置
- */
- link: {
- onAction: null,
- target: 'self',
- },
- /**
- * 模型设置
- */
- model: {
- /**
- * 模型名称
- */
- name: '',
- },
- /**
- * 场景设置
- */
- scene: {
- /**
- * 图片质量
- */
- quality: null,
- /**
- * 自定义marker图片地址
- */
- markerURL: null,
- /**
- * 自定义marker透明的
- */
- markerOpacity: null,
- /**
- * 自定义当前点位颜色
- */
- pathEndColor: null,
- },
- vr: {
- markerHeight: null,
- },
- tag: {
- showIn: null,
- },
- /**
- * 获取服务器资源
- */
- getServerURL(path) {
- return this.server + path
- },
- /**
- * 获取场景资源地址
- * @param {String} path 资源路径
- */
- getResourceURL(path) {
- return this.resource + path
- },
- /**
- * 获取场景图片地址
- * @param {*} path 图片路径
- */
- getResourceImageURL(path) {
- return this.getResourceURL(`scene_view_data/${this.num}/images/${path}`)
- },
- /**
- * 获取场景数据地址
- * @param {*} path 数据路径
- */
- getResourceDataURL(path) {
- return this.getResourceURL(`scene_view_data/${this.num}/data/${path}`)
- },
- i18n(key) {
- if (this.langs[this.lang] && this.langs[this.lang][key]) {
- return this.langs[this.lang][key]
- }
- if (!this.langs['zh']) {
- this.langs['zh'] = lang_zh
- }
- return this.langs['zh'][key] || ''
- },
- /**
- * 是否加载热点
- */
- isLoadTags: true,
- }
- export const merge = function (options) {
- if (typeof options != 'object') {
- return
- }
- for (let key in config) {
- if (['env', 'version', 'num'].indexOf(key) != -1) {
- continue
- }
- if (!options.hasOwnProperty(key)) {
- options[key] = config[key]
- }
- }
- return options
- }
- export default config
|