Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-merchant-data
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit addc99e3
authored
Jul 01, 2019
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
图片上传
1 parent
90f19a5f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
93 deletions
src/views/customer/businessDetails/index.vue
src/views/customer/businessDetails/index.vue
View file @
addc99e
...
@@ -59,33 +59,7 @@
...
@@ -59,33 +59,7 @@
alt=
""
alt=
""
@
click=
"handleImg()"
@
click=
"handleImg()"
>
>
<!--
<gl-upload
<input
v-if=
"isEdit"
type=
"file"
id=
"id"
name=
"image"
class=
"getImgUrl_file"
@
change=
"shangc($event)"
accept=
"image/jpg,image/jpeg,image/png"
>
id=
"upload"
v-if=
"isEdit"
class=
"upload-demo"
name=
"file"
:action=
"uploadAction"
:limit=
"2"
:before-upload=
"beforeUpload"
:on-success=
"handleSuccess"
:on-error=
"handleError"
:on-remove=
"handleRemove"
:file-list=
"fileList"
>
<gl-button
size=
"small"
>
上传图片
</gl-button>
</gl-upload>
-->
<!--
<input
v-if=
"isEdit"
type=
"file"
id=
"id"
name=
"image"
class=
"getImgUrl_file"
@
change=
"shangc($event)"
accept=
"image/jpg,image/jpeg,image/png"
>
-->
<!--
<form
id=
"uploadForm"
enctype=
"application/x-www-form-urlencoded"
>
<input
type=
"file"
id=
"id"
name=
"image"
class=
"getImgUrl_file"
accept=
"image/jpg,image/jpeg,image/png"
>
<button
id=
"upload"
type=
"button"
@
click=
"aa($event)"
>
upload
</button>
</form>
-->
<!--
<form
v-if=
"isEdit"
method=
"post"
action=
"http://gfs.test.glsx.com.cn/file/upstring"
>
<input
type=
"file"
id=
"id"
name=
"image"
class=
"getImgUrl_file"
@
change=
"shangc($event)"
accept=
"image/jpg,image/jpeg,image/png"
>
<input
name=
"systemSign"
value=
"mechantData"
><br>
<input
name=
"files"
v-model=
"fileImg"
><br>
<input
type=
"submit"
value=
"登录"
>
</form>
-->
</span>
</span>
<gl-select
<gl-select
v-else-if=
"i.name == 'merchantChannelName' && isEdit"
v-else-if=
"i.name == 'merchantChannelName' && isEdit"
...
@@ -184,6 +158,7 @@
...
@@ -184,6 +158,7 @@
import
VueAMap
from
'vue-amap'
import
VueAMap
from
'vue-amap'
import
Vue
from
'vue'
import
Vue
from
'vue'
import
axios
from
'axios'
import
axios
from
'axios'
import
qs
from
'qs'
import
{
businessManagenMethods
,
bizMethods
,
request
}
from
'@/api'
import
{
businessManagenMethods
,
bizMethods
,
request
}
from
'@/api'
import
notice
from
'@/common/notice'
import
notice
from
'@/common/notice'
var
marker
=
[]
var
marker
=
[]
...
@@ -221,7 +196,7 @@ export default {
...
@@ -221,7 +196,7 @@ export default {
editOptions
:
[
'address'
,
'contactor'
,
'contactPhone'
,
'phone'
,
'email'
],
editOptions
:
[
'address'
,
'contactor'
,
'contactPhone'
,
'phone'
,
'email'
],
channelList
:
[],
channelList
:
[],
fileInfo
:
{
fileType
:
''
,
fileBase
:
''
},
fileInfo
:
{
fileType
:
''
,
fileBase
:
''
},
fileImg
:
''
,
//
fileImg: '',
List
:
[
List
:
[
{
{
name
:
'merchantName'
,
name
:
'merchantName'
,
...
@@ -445,13 +420,13 @@ export default {
...
@@ -445,13 +420,13 @@ export default {
}
}
// 保存
// 保存
if
(
!
isCancel
&&
this
.
isEdit
)
{
if
(
!
isCancel
&&
this
.
isEdit
)
{
console
.
log
(
'调保存接口--'
)
// console.log('调保存接口--')
console
.
log
(
this
.
merchantInfo
)
// console.log(this.merchantInfo)
this
.
merchantInfo
.
merchantPortrait
=
this
.
List
[
9
].
value
const
params
=
this
.
$deep_clone
(
this
.
merchantInfo
)
const
params
=
this
.
$deep_clone
(
this
.
merchantInfo
)
// params.merchantChannel = params.merchantId
delete
params
.
merchantChannelName
delete
params
.
merchantChannelName
params
.
method
=
bizMethods
.
MerchantModify
params
.
method
=
bizMethods
.
MerchantModify
console
.
log
(
params
)
//
console.log(params)
request
.
req
(
params
).
then
(
res
=>
{
request
.
req
(
params
).
then
(
res
=>
{
this
.
isEdit
=
!
this
.
isEdit
this
.
isEdit
=
!
this
.
isEdit
notice
.
okTips
()
notice
.
okTips
()
...
@@ -462,6 +437,7 @@ export default {
...
@@ -462,6 +437,7 @@ export default {
// this.getAddress(this.merchantInfo.lng, this.merchantInfo.lat)
// this.getAddress(this.merchantInfo.lng, this.merchantInfo.lat)
if
(
isCancel
)
{
if
(
isCancel
)
{
this
.
merchantInfo
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
tempMerchantInfo
))
this
.
merchantInfo
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
tempMerchantInfo
))
this
.
List
[
9
].
value
=
this
.
merchantInfo
.
merchantPortrait
if
(
!
this
.
merchantInfo
.
lng
&&
!
this
.
merchantInfo
.
lat
)
{
if
(
!
this
.
merchantInfo
.
lng
&&
!
this
.
merchantInfo
.
lat
)
{
marker
&&
amapManager
.
_map
.
remove
(
marker
)
marker
&&
amapManager
.
_map
.
remove
(
marker
)
this
.
hasLocation
=
false
this
.
hasLocation
=
false
...
@@ -640,18 +616,15 @@ export default {
...
@@ -640,18 +616,15 @@ export default {
},
},
shangc
(
e
)
{
shangc
(
e
)
{
// const _this = this
// const _this = this
console
.
log
(
e
)
//
console.log(e)
const
files
=
document
.
getElementById
(
'id'
).
files
[
0
]
const
files
=
document
.
getElementById
(
'id'
).
files
[
0
]
const
name
=
document
.
getElementById
(
'id'
).
files
[
0
].
name
const
name
=
files
?
document
.
getElementById
(
'id'
).
files
[
0
].
name
:
''
const
arr
=
name
.
split
(
'.'
)
const
arr
=
name
.
split
(
'.'
)
// this.fileInfo.name = arr[0]
// console.log(arr)
// this.fileInfo.fileType = document.getElementById('id').files[0].name
this
.
fileInfo
.
fileType
=
arr
[
1
]
this
.
fileInfo
.
fileType
=
arr
[
1
]
let
fileSize
=
0
let
fileSize
=
files
.
size
// const fileMaxSize = 10240 // 1M
// const fileMaxSize = 10240 // 1M
if
(
files
)
{
if
(
files
)
{
console
.
log
(
files
)
//
console.log(files)
fileSize
=
files
.
size
fileSize
=
files
.
size
if
(
fileSize
>
5
*
1024
*
1024
)
{
if
(
fileSize
>
5
*
1024
*
1024
)
{
alert
(
'文件大小不能大于5M!'
)
alert
(
'文件大小不能大于5M!'
)
...
@@ -680,63 +653,20 @@ export default {
...
@@ -680,63 +653,20 @@ export default {
// console.log(this.fileInfo.fileType)
// console.log(this.fileInfo.fileType)
// console.log(this.fileInfo.fileBase)
// console.log(this.fileInfo.fileBase)
const
fileParams
=
this
.
fileInfo
.
fileType
+
'@'
+
this
.
fileInfo
.
fileBase
const
fileParams
=
this
.
fileInfo
.
fileType
+
'@'
+
this
.
fileInfo
.
fileBase
this
.
fileImg
=
this
.
fileInfo
.
fileType
+
'@'
+
this
.
fileInfo
.
fileBase
axios
.
post
(
'http://gfs.test.glsx.com.cn/file/upstring'
,
qs
.
stringify
({
const
aa
=
{
systemSign
:
'mechantData'
,
systemSign
:
'mechantData'
,
files
:
fileParams
files
:
fileParams
}),
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
}
console
.
log
(
aa
)
}).
then
(
res
=>
{
// const fileTemp = JSON.stringify(aa)
this
.
merchantInfo
.
merchantPortrait
=
res
.
data
.
url
// console.log(fileTemp)
this
.
List
[
9
].
value
=
res
.
data
.
url
// var formData = new FormData()
}).
catch
(
err
=>
{
// formData.append('systemSign', 'mechantData')
notice
.
errorTips
(
err
)
// formData.append('files', fileParams)
})
// axios({
// method: 'post',
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// },
// // transformRequest: [function(data) {
// // console.log('---------')
// // data = JSON.stringify(data)
// // return data
// // }],
// url: 'http://gfs.test.glsx.com.cn/file/upstring',
// data: aa,
// // dataType: 'json', // jsonp会把请求类型强制转换为get请求
// // contentType: false,
// processData: false
// })
// axios.post('http://gfs.test.glsx.com.cn/file/upstring', formData,
// {
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// }
// // requestType: 'jsonString'
// }).then(res => {
// console.log(res)
// }).catch(err => {
// console.log(err)
// })
// axios({
// method: 'post',
// url: 'http://gfs.test.glsx.com.cn/file/upstring',
// data: aa,
// // headers: {
// // 'content-type': 'application/x-www-form-urlencoded'
// // },
// transformRequest: [function(data) {
// console.log(data)
// data = JSON.stringify(data)
// console.log(data)
// return data
// }]
// // requestType: 'jsonString'
// }).then(res => {
// console.log(res)
// }).catch(err => {
// console.log(err)
// })
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment