Commit 2047524b authored by 华国豪's avatar 华国豪 🙄

1

parent a9b60058
let locationName = window.location.hostname;
if (locationName.indexOf('oytour') !== -1) {
domainUrl = "http://reborn.oytour.com";
} else if (locationName.indexOf('viitto') !== -1) {
domainUrl = "https://test.viitto.com";
}
let ViittoFileUrl = locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://imgfile.oytour.com" : 'http://192.168.2.214:8130'
var tripUtils = {
TypeKey: {
traffic: "1",
......@@ -329,6 +336,7 @@ var tripUtils = {
//行程-【交通对象】
trafficObj: function () {
console.log(ViittoFileUrl)
return {
ID: 0,
ConfigId: 0,
......@@ -346,7 +354,7 @@ var tripUtils = {
//行程介绍
trafficIntroduce: {
IntroduceTitle: "", //行程介绍标题
IntroduceImage: this.domainManager().ViittoFileUrl+"/Upload/DefalutImage/DMC/defaultairline.png", //行程介绍图片
IntroduceImage: ViittoFileUrl+"/Upload/DefalutImage/DMC/defaultairline.png", //行程介绍图片
IntroduceDetail: "", //行程介绍详细信息
}
};
......
......@@ -11,7 +11,7 @@ export default {
install(Vue, options) {
Vue.prototype.MsgBus = MsgBus;
Vue.prototype.md5 = md5;
Vue.prototype.orderBy=function(source, orders, type) {
Vue.prototype.orderBy = function (source, orders, type) {
if (
source instanceof Array &&
orders instanceof Array &&
......@@ -23,7 +23,7 @@ export default {
var totalSum = {};
function grouporder(source, orders, totalSum) {
source.sort(function(a, b) {
source.sort(function (a, b) {
var convertA = a[orders[0]];
var convertB = b[orders[0]];
if (typeof convertA == "string" && typeof convertB == "string") {
......@@ -77,25 +77,27 @@ export default {
return source;
}
},
Vue.prototype.calcPageSize=function(itemHeight){
let yuHeight=itemHeight
Vue.prototype.calcPageSize = function (itemHeight) {
let yuHeight = itemHeight
try {
let obj=null
document.querySelectorAll('.frame-box').forEach(x=>{
if(x.style.display!='none'){
obj=x
let obj = null
document.querySelectorAll('.frame-box').forEach(x => {
if (x.style.display != 'none') {
obj = x
}
})
let dom=obj.offsetHeight
yuHeight=dom-(obj.querySelector('.v-table-header')?obj.querySelector('.v-table-header').offsetHeight:39)-50//减去面包屑,减去表格头部,减去分页,减去偏量
let dom = obj.offsetHeight
yuHeight = dom - (obj.querySelector('.v-table-header') ? obj.querySelector('.v-table-header').offsetHeight : 39) - 50 //减去面包屑,减去表格头部,减去分页,减去偏量
//减去其它同级元素
obj.childNodes[0].childNodes.forEach(x=>{
if(x.className && x.className.indexOf('v-table-views')==-1){
yuHeight-=x.offsetHeight?x.offsetHeight:0
obj.childNodes[0].childNodes.forEach(x => {
if (x.className && x.className.indexOf('v-table-views') == -1) {
yuHeight -= x.offsetHeight ? x.offsetHeight : 0
}
})
} catch (error) {console.log(error)}
return Math.floor(yuHeight/itemHeight)
} catch (error) {
console.log(error)
}
return Math.floor(yuHeight / itemHeight)
}
Vue.prototype.random_string = function (len) {
len = len || 32;
......@@ -116,10 +118,9 @@ export default {
let domainUrl = '';
let locationName = window.location.hostname;
domainUrl = "http://192.168.2.214:8082"; //214主域名
if (locationName.indexOf('oytour')!==-1) {
if (locationName.indexOf('oytour') !== -1) {
domainUrl = "http://reborn.oytour.com";
}
else if (locationName.indexOf('viitto')!==-1) {
} else if (locationName.indexOf('viitto') !== -1) {
domainUrl = "https://test.viitto.com";
}
var obj = {
......@@ -144,9 +145,9 @@ export default {
//google地图图片地址
GoogleMapImageUrl: "http://super.oytour.com",
//上传站点
UploadUrl: locationName.indexOf('oytour') !== -1||locationName.indexOf('viitto')!==-1 ? "http://upload.oytour.com" : "http://192.168.2.214:8120",
UploadUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://upload.oytour.com" : "http://192.168.2.214:8120",
//文件站点
ViittoFileUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto')!==-1 ? "http://imgfile.oytour.com" : 'http://192.168.2.214:8130'
ViittoFileUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://imgfile.oytour.com" : 'http://192.168.2.214:8130'
};
return obj;
},
......@@ -216,7 +217,7 @@ export default {
Vue.prototype.uploadImg = function (tcID, msg, successCall, faildCall) {
var apiurl = this.domainManager().Upload + '/Upload/UploadBase64?fileType=1&fileLimit=5&&filePath=Freature/TCID' + tcID;
this.$http.post(apiurl, msg, {
datatype:"jsonP",
datatype: "jsonP",
}).then(res => {
successCall(res);
}, faildCall)
......@@ -317,7 +318,7 @@ export default {
Vue.prototype.getLocalStorage = function () {
var localStorageData = window.localStorage["userInfo"];
if (localStorageData !== undefined && localStorageData!='undefined') {
if (localStorageData !== undefined && localStorageData != 'undefined') {
return JSON.parse(localStorageData);
} else {
return null;
......@@ -358,7 +359,7 @@ export default {
})
let url = '';
if(fileurl)
if (fileurl)
url = fileurl
else
url = oss.signatureUrl(objectKey);
......@@ -447,8 +448,7 @@ export default {
}
},
//上传文件到本地服务器
Vue.prototype.UploadSelfFile=function(path,files,successCall)
{
Vue.prototype.UploadSelfFile = function (path, files, successCall) {
if (files && files.length > 0) {
let nameList = new Array()
for (let index = 0; index < files.length; index++) {
......@@ -460,7 +460,7 @@ export default {
let fileName = nameList[index]
fileName = path + fileName + "." + files[index].name.split('.').pop()
var formData = new FormData();
var uploadUrl=that.domainManager().UploadUrl+"/Upload?filePath="+path;
var uploadUrl = that.domainManager().UploadUrl + "/Upload?filePath=" + path;
formData.append("myfile", files[index]);
that.$http.post(uploadUrl, formData, {})
.then(res => {
......@@ -468,17 +468,19 @@ export default {
})
}
}).catch(function (err) {
console.log("上传文件出错"+err);
console.log("上传文件出错" + err);
});
}
}
Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this;
var uploadUrl=that.domainManager().UploadUrl+"/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath="+path;
var uploadUrl = that.domainManager().UploadUrl + "/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath=" + path;
var formData = new FormData();
formData.append("myfile", files[0]);
that.$http.post(uploadUrl, formData,{'Content-Type':'multipart/form-data'})
that.$http.post(uploadUrl, formData, {
'Content-Type': 'multipart/form-data'
})
.then(res => {
successCall(res);
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment