Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
SuperMan
Commits
ae89bd60
Commit
ae89bd60
authored
Mar 04, 2019
by
华国豪
🙄
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/luochao/superman
parents
cbc3bea0
a6e4d558
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
89 deletions
+97
-89
confirmationOrderDownLoad.vue
src/components/confirmationOrderDownLoad.vue
+72
-72
signature.vue
src/components/signature.vue
+0
-1
index.js
src/plug/index.js
+25
-16
No files found.
src/components/confirmationOrderDownLoad.vue
View file @
ae89bd60
...
...
@@ -651,86 +651,86 @@
let
UploadUrl
=
this
.
domainManager
().
UploadUrl
let
_this
=
this
if
(
this
.
showType
>=
4
)
{
// 判断是否为行程特色
$
.
ajax
({
//调用是否已经存在文件夹接口判断是否进行上传图片操作
url
:
UploadUrl
+
'/Upload/GetImage?filePath=Feature/'
+
tcid
,
type
:
"POST"
,
datatype
:
"jsonP"
,
success
:
function
(
data
)
{
let
msg
=
JSON
.
parse
(
data
)
if
(
msg
.
ResultCode
)
{
// 已经存在文件 直接调用下载
var
apiurl
=
this
.
domainManager
().
UploadUrl
+
'/Upload/GetImage?filePath=Feature/'
+
tcid
;
this
.
$http
.
post
(
apiurl
).
then
(
res
=>
{
let
msg
=
res
if
(
msg
.
ResultCode
)
{
// 已经存在文件 直接调用下载
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
}
else
if
(
document
.
querySelector
(
"#gernalCanvas"
))
{
// 不存在图片保存图片后下载
if
(
document
.
querySelector
(
"#gernalCanvas"
).
querySelectorAll
(
'img'
).
length
===
0
)
{
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
}
else
if
(
document
.
querySelector
(
"#gernalCanvas"
))
{
// 不存在图片保存图片后下载
if
(
document
.
querySelector
(
"#gernalCanvas"
).
querySelectorAll
(
'img'
).
length
===
0
)
{
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
return
}
document
.
querySelector
(
"#gernalCanvas"
).
querySelectorAll
(
'img'
).
forEach
(
x
=>
{
let
src
=
x
.
src
src
=
src
.
replace
(
'https:'
,
'http:'
)
if
(
src
.
indexOf
(
'http'
)
!=
-
1
)
{
x
.
setAttribute
(
'crossOrigin'
,
'anonymous'
)
}
x
.
src
=
src
});
let
cName
=
''
if
(
_this
.
showType
==
4
)
{
cName
=
'.feature-box'
}
else
if
(
_this
.
showType
>
4
)
{
cName
=
'.travle_page'
return
}
document
.
querySelector
(
"#gernalCanvas"
).
querySelectorAll
(
'img'
).
forEach
(
x
=>
{
let
src
=
x
.
src
src
=
src
.
replace
(
'https:'
,
'http:'
)
if
(
src
.
indexOf
(
'http'
)
!=
-
1
)
{
x
.
setAttribute
(
'crossOrigin'
,
'anonymous'
)
}
if
(
cName
!=
''
)
{
let
allNum
=
1
document
.
querySelectorAll
(
cName
).
forEach
((
x
,
index
)
=>
{
html2Canvas
(
x
,
{
useCORS
:
true
,
scale
:
0.7
,
backgroundColor
:
'#FFFFFF'
,
}).
then
((
canvas
)
=>
{
if
(
canvas
)
{
var
context
=
canvas
.
getContext
(
'2d'
)
context
.
mozImageSmoothingEnabled
=
false
context
.
webkitImageSmoothingEnabled
=
false
context
.
msImageSmoothingEnabled
=
false
context
.
imageSmoothingEnabled
=
false
var
image
=
new
Image
();
image
.
src
=
canvas
.
toDataURL
(
"image/png"
);
$
.
ajax
({
url
:
UploadUrl
+
'/Upload/UploadBase64?fileType=1&fileLimit=5&&filePath=Feature/'
+
tcid
,
type
:
"POST"
,
data
:
{
myfile
:
image
.
src
,
fileIndex
:
index
},
datatype
:
"jsonP"
,
success
:
function
(
data
)
{
//console.log("上传成功",data);
},
error
:
function
()
{
//console.log("上传失败");
}
});
if
(
allNum
!==
document
.
querySelectorAll
(
cName
).
length
)
{
allNum
+=
1
}
else
{
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
x
.
src
=
src
});
let
cName
=
''
if
(
_this
.
showType
==
4
)
{
cName
=
'.feature-box'
}
else
if
(
_this
.
showType
>
4
)
{
cName
=
'.travle_page'
}
if
(
cName
!=
''
)
{
let
allNum
=
1
document
.
querySelectorAll
(
cName
).
forEach
((
x
,
index
)
=>
{
html2Canvas
(
x
,
{
useCORS
:
true
,
scale
:
0.7
,
backgroundColor
:
'#FFFFFF'
,
}).
then
((
canvas
)
=>
{
if
(
canvas
)
{
var
context
=
canvas
.
getContext
(
'2d'
)
context
.
mozImageSmoothingEnabled
=
false
context
.
webkitImageSmoothingEnabled
=
false
context
.
msImageSmoothingEnabled
=
false
context
.
imageSmoothingEnabled
=
false
var
image
=
new
Image
();
image
.
src
=
canvas
.
toDataURL
(
"image/png"
);
// this.uploadImg(tcid,{myfile: image.src,fileIndex: index},res=>{
// console.log(res)
// },err=>{
// console.log(err)
// })
// return
$
.
ajax
({
url
:
UploadUrl
+
'/Upload/UploadBase64?fileType=1&fileLimit=5&&filePath=Feature/'
+
tcid
,
type
:
"POST"
,
data
:
{
myfile
:
image
.
src
,
fileIndex
:
index
},
datatype
:
"jsonP"
,
success
:
function
(
data
)
{
//console.log("上传成功",data);
},
error
:
function
()
{
//console.log("上传失败");
}
});
if
(
allNum
!==
document
.
querySelectorAll
(
cName
).
length
)
{
allNum
+=
1
}
else
{
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
}
}
);
}
});
}
}
else
{
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
});
}
}
,
error
:
function
()
{
// console.log("上传失败");
}
else
{
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
}
});
},
null
)
return
}
else
{
this
.
ToWord
(
this
.
orderMsg
.
startDate
+
this
.
orderMsg
.
lineteamName
+
this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
}
...
...
src/components/signature.vue
View file @
ae89bd60
...
...
@@ -34,7 +34,6 @@
let
newUrl
=
url
.
substring
(
url
.
indexOf
(
"="
)
+
1
);
return
newUrl
;
}
import
axios
from
"axios"
;
export
default
{
name
:
"signature"
,
data
(){
...
...
src/plug/index.js
View file @
ae89bd60
...
...
@@ -116,13 +116,6 @@ export default {
let
domainUrl
=
''
;
let
locationName
=
window
.
location
.
hostname
;
domainUrl
=
"http://127.0.0.1"
;
//214主域名
// 127.0.0.12
// domainUrl = "http://192.168.2.88"; //王悦主域名
// domainUrl = "http://127.0.0.1"; //214主域名
// domainUrl = "http://192.168.2.16:8083"; //王悦主域名
// domainUrl = "http://127.0.0.1"; //214主域名
// domainUrl = "http://192.168.2.65:8025"; //吴春主域名
// domainUrl = "http://192.168.2.106:8082"; //罗超主域名
if
(
locationName
.
indexOf
(
'oytour'
)
!==-
1
)
{
domainUrl
=
"https://reborn.oytour.com"
;
}
else
if
(
locationName
.
indexOf
(
'viitto'
)
!==-
1
)
{
...
...
@@ -150,9 +143,9 @@ export default {
//google地图图片地址
GoogleMapImageUrl
:
"http://super.oytour.com"
,
//上传站点
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==-
1
?
"http://upload.oytour.com"
:
"http://1
92.168.2.214
:8120"
,
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==-
1
?
"http://upload.oytour.com"
:
"http://1
27.0.0.1
:8120"
,
//文件站点
ViittoFileUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==-
1
?
"http://imgfile.oytour.com"
:
'http://1
92.168.2.214
:8130'
ViittoFileUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==-
1
?
"http://imgfile.oytour.com"
:
'http://1
27.0.0.1
:8130'
};
return
obj
;
},
...
...
@@ -215,17 +208,33 @@ export default {
//打开新窗口连接
Vue
.
prototype
.
OpenNewUrl
=
function
(
URL
)
{
if
(
URL
!=
''
)
{
window
.
open
(
'http://'
+
URL
,
'_blank'
);
if
(
URL
.
indexOf
(
"https"
)
!=-
1
){
var
str
=
'http://'
+
URL
.
substring
(
8
);
window
.
open
(
str
,
'_blank'
);
}
else
if
(
URL
.
indexOf
(
"http"
)
!=-
1
)
{
var
str
=
'http://'
+
URL
.
substring
(
7
);
window
.
open
(
str
,
'_blank'
);
}
else
{
window
.
open
(
"http://"
+
URL
,
'_blank'
);
}
}
}
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"
,
}).
then
(
res
=>
{
successCall
(
res
);
},
faildCall
)
var
apiurl
=
this
.
domainManager
().
UploadUrl
+
'/Upload/UploadBase64Two?fileType=1&fileLimit=5&&filePath=Freature/'
+
tcID
;
console
.
log
(
"msg"
,
msg
);
this
.
$http
.
post
(
apiurl
,{
FileIndex
:
msg
.
FileIndex
,
MyFile
:
msg
.
MyFile
},{
headers
:
{
"Content-Type"
:
"application/x-www-form-urlencoded;"
},
}).
then
(
function
(
res
){
console
.
log
(
res
)
})
}
//HTTP提交数据
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment