提交 371f63fa 编写于 作者: 杨广俊's avatar 杨广俊

test1

上级 d64e61e7
/**
* Created by Anndy Yang on 18/03/18.
*/
Date.prototype.format = function(fmt) {
var o = {
'M+': this.getMonth() + 1, // 月份
......@@ -54,6 +55,8 @@ export function parseTime(time, cFormat) {
return time_str
}
export function formatTime(time, option) {
time = +time * 1000
const d = new Date(time)
......@@ -125,7 +128,7 @@ export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId
containerHeightId = 'appContainerId', innerHeightId = 'elTableId'){
if (!p_getElm(refHeightId) || !p_getElm(containerHeightId) || !p_getElm(innerHeightId)) {
// window.onresize = null
logger.warn('No certain dom id!!!');
console.warn('No certain dom id!!!');
}
let containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 50
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
......@@ -212,6 +215,20 @@ function getUrlParmByCode(paramList) {
return ''
}
export function deepCopy(obj) {
var result = Array.isArray(obj) ? [] : {};
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === 'object') {
result[key] = deepCopy(obj[key]); //递归复制
} else {
result[key] = obj[key];
}
}
}
return result;
}
export function pageJumpUrl(){
let url = {
pageListUrl : 'https://test1-contents.yunqueyi.com/content_list',
......@@ -221,56 +238,42 @@ export function pageJumpUrl(){
return url;
}
/*
oriData : 原数据
sortField : 排序字段
orderType : 排序类型 1.升序 -1.降序
*/
export function sortParmData(oriData, sortField, orderType) {
if ( orderType !== 1 && orderType !== -1) orderType = 1
oriData.sort( (a, b) => {
return (a[sortField] - b[sortField]) * orderType
})
return oriData
}
//跳转个人评价页面
export function jumpEvaluatPage(){
return evaluatPageUrl
}
// dev地址
// const baseUrl = 'http://192.168.140.14:10201/'
const baseUrl = 'http://10.177.10.149:8080/'
// const baseUrl = 'http://192.168.140.14:10201/'
// const baseUrl = 'https://dev-sc.yunqueyi.com/'
const baseUrl = 'https://dev-sc.yunqueyi.com/'
const apiUrl = 'https://dev-api.yunqueyi.com/'
const evaluatPageUrl = 'https://dev-phome.yunqueyi.com/gpr/#/home'
export const jumpWebPageUrl = 'https://dev-phome.yunqueyi.com/appl/#/'
// // test1地址
// const baseUrl = 'https://test1-sc.yunqueyi.com/'
// const baseUrl = 'https://test1-sc.yunqueyi.com/'
// const apiUrl = 'https://test1-api.yunqueyi.com/'
// const evaluatPageUrl = 'http://10.177.10.225:9001/#/home' || 'https://test1-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://test1-phome.yunqueyi.com/appl/#/'
// const evaluatPageUrl = 'https://test1-phome.yunqueyi.com/gpr/#/home'
// const baseUrl = 'https://uat-sc.yunqueyi.com/'
// // uat地址
// const baseUrl = 'https://uat-sc.yunqueyi.com/'
// const apiUrl = 'https://uat-api.yunqueyi.com/'
// const evaluatPageUrl = 'https://uat-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://uat-phome.yunqueyi.com/appl/#/'
// // pro地址
// const baseUrl = 'https://sc.yunqueyi.com/'
// const baseUrl = 'https://sc.yunqueyi.com/'
// const apiUrl = 'https://api.yunqueyi.com/'
// const evaluatPageUrl = 'https://phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://phome.yunqueyi.com/appl/#/'
// 获取BaseUrl
// 为每个URL添加应用校验密钥
export function getBaseUrl(url,str) {
return baseUrl + url
}
export function getApiUrl(url) {
return apiUrl + url
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册