import Vue from 'vue' import api from '@/api/api.js' import utils from './utils/utils.js' import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 const type = 'prod' // 环境配置 const config = { dev : { baseUrl : 'http://augcl.natapp1.cc/travel-api/api', }, prod : { baseUrl : 'https://traveladmin.augcl.com/travel-api/api', } } // 默认配置 const defaultConfig = { mapKey : 'SNGBZ-K6AKJ-5X2FI-XYKCM-DEZXZ-FGBA3', aliOss : { url : 'https://tennis-oss.xzaiyp.top/', config : { //桶的地址 region: 'oss-cn-guangzhou', //id accessKeyId:'LTAI5tNycA46YTwm383dRvMV', //密钥 accessKeySecret:'tAdbYQCmdur6jbZ8hjvgB7T1Z52mIG', //桶的名字 bucket: 'zhuoqiu-image', endpoint:'oss-cn-guangzhou.aliyuncs.com', } }, dict : { course : {//申遗历程 title : '申遗历程', api : 'queryArticleById', }, Inheritance : {//遗产概况 title : '文化遗产', api : 'querySpotById', }, tell : {//遗产讲述 title : '遗产讲述', collectType : 0, subTitle : '讲解现场', payType : 1, screen : true, roleId : 0, showRoleLevel : true, }, travel : {//达人同游 title : '达人同游', collectType : 1, subTitle : '同游现场', payType : 2, roleId : 1, }, path : {//遗产路径 title : '遗产路径', collectType : 2, payType : 0, }, follow : {//我要跟拍 title : '我要跟拍', collectType : 3, subTitle : '跟拍现场', payType : 3, roleId : 2, }, experience : {//非遗体验 title : '非遗体验', collectType : 4, payType : 4, api : 'queryExperienceById', }, Study : {//我要研学 title : '我要研学', collectType : 5, payType : 5, }, good : {//文创好物 title : '文创好物', collectType : 6, }, } } uni.$uv.setConfig({ // 修改$uv.config对象的属性 config: { // 修改默认单位为rpx,相当于执行 uni.$uv.config.unit = 'rpx' unit: 'rpx' }, }) Vue.prototype.$config = utils.deepMergeObject(defaultConfig, config[type]) Vue.prototype.$api = api export default Vue.prototype.$config