Commit e9ecbd54 authored by 华国豪's avatar 华国豪 🙄

‘上传图片#’

parent 25bf02be
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
<div class="short-line"></div> <div class="short-line"></div>
<div class="english-title">Trip characteristics</div> <div class="english-title">Trip characteristics</div>
</div> </div>
<div v-html="feature.featureHtml"></div> <div v-html="feature.featureHtml" id="gernalCanvas"></div>
</div> </div>
<div id="teamacitvy"> </div> <div id="teamacitvy"> </div>
</div> </div>
...@@ -642,16 +642,16 @@ ...@@ -642,16 +642,16 @@
}, },
methods: { methods: {
gernalFeature(){ gernalFeature(){
console.log(document.querySelector("#gernalCanvas").querySelectorAll('img')) let tcid = this.$route.query.tcid;
document.querySelector("#gernalCanvas").querySelectorAll('img').forEach(x => { document.querySelector("#gernalCanvas").querySelectorAll('img').forEach(x => {
if(x.src.indexOf('http')!=-1){ if(x.src.indexOf('http')!=-1){
x.setAttribute('crossOrigin','anonymous') x.setAttribute('crossOrigin','anonymous')
} }
}); });
let cName='' let cName=''
if(showType==4){ if(this.showType==4){
cName='.feature-box' cName='.feature-box'
}else if(showType==5){ }else if(this.showType==5){
cName='.travle_page' cName='.travle_page'
} }
if(cName!=''){ if(cName!=''){
...@@ -669,7 +669,13 @@ ...@@ -669,7 +669,13 @@
context.imageSmoothingEnabled = false context.imageSmoothingEnabled = false
var image = new Image(); var image = new Image();
image.src = canvas.toDataURL("image/png"); image.src = canvas.toDataURL("image/png");
document.body.appendChild(image) // document.body.appendChild(image)
let msg = {
myfile: image
}
this.uploadImg(tcid,msg, res=>{
console.log(res)
}, null)
} }
}); });
}); });
......
...@@ -115,13 +115,14 @@ export default { ...@@ -115,13 +115,14 @@ export default {
Vue.prototype.domainManager = function () { Vue.prototype.domainManager = function () {
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主域名
// 127.0.0.12
// domainUrl = "http://192.168.2.88"; //王悦主域名 // domainUrl = "http://192.168.2.88"; //王悦主域名
// domainUrl = "http://127.0.0.1"; //214主域名 // domainUrl = "http://127.0.0.1"; //214主域名
// domainUrl = "http://192.168.2.16:8083"; //王悦主域名 // domainUrl = "http://192.168.2.16:8083"; //王悦主域名
// domainUrl = "http://127.0.0.1"; //214主域名 // domainUrl = "http://127.0.0.1"; //214主域名
// domainUrl = "http://192.168.2.65:8025"; //吴春主域名 // domainUrl = "http://192.168.2.65:8025"; //吴春主域名
domainUrl = "http://192.168.2.106:8082"; //罗超主域名 // domainUrl = "http://192.168.2.106:8082"; //罗超主域名
if (locationName.indexOf('oytour')!==-1) { if (locationName.indexOf('oytour')!==-1) {
domainUrl = "https://reborn.oytour.com"; domainUrl = "https://reborn.oytour.com";
}else if (locationName.indexOf('viitto')!==-1) { }else if (locationName.indexOf('viitto')!==-1) {
...@@ -147,7 +148,8 @@ export default { ...@@ -147,7 +148,8 @@ export default {
//google地图Url //google地图Url
GoogleMapUrl: "http://ditu.google.cn/maps/api/js?key=AIzaSyAZ5MIfzicStzKbIkbI3RcBBeZBjQFKsp0&sensor=false&language=zh-CN", GoogleMapUrl: "http://ditu.google.cn/maps/api/js?key=AIzaSyAZ5MIfzicStzKbIkbI3RcBBeZBjQFKsp0&sensor=false&language=zh-CN",
//google地图图片地址 //google地图图片地址
GoogleMapImageUrl: "http://super.oytour.com" GoogleMapImageUrl: "http://super.oytour.com",
Upload: "http://Upload.oytour.com"
}; };
return obj; return obj;
}, },
...@@ -213,6 +215,19 @@ export default { ...@@ -213,6 +215,19 @@ export default {
window.open('http://' + URL, '_blank'); window.open('http://' + URL, '_blank');
} }
} }
Vue.prototype.uploadImg = function (tcID, msg, successCall, faildCall) {
var apiurl = this.domainManager().Upload + '/Upload?fileType=1&fileLimit=5&&filePath=Freature/TCID' + tcID;
let postData = msg
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
}).then(res => {
successCall(res);
}, faildCall)
}
//HTTP提交数据 //HTTP提交数据
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall) { Vue.prototype.apipost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
......
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