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