Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
ybf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
xulili
ybf
Commits
1e373745
Commit
1e373745
authored
5 years ago
by
xd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片地址
parent
fe81399e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
24 deletions
+43
-24
voucher.js
wx_application/src/api/sidebar/voucher.js
+8
-0
counterEdit.vue
wx_application/src/views/counter/counterEdit.vue
+35
-24
No files found.
wx_application/src/api/sidebar/voucher.js
View file @
1e373745
...
...
@@ -16,3 +16,11 @@ export function editStore(data) {
data
})
}
// 上传图片
export
function
uploadPic
(
data
)
{
return
requestCF
({
url
:
'/admin/auth/util/saveImg'
,
method
:
'post'
,
data
})
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
wx_application/src/views/counter/counterEdit.vue
View file @
1e373745
...
...
@@ -50,7 +50,7 @@
<
script
>
import
{
quillEditor
,
Quill
}
from
"vue-quill-editor"
;
import
{
container
,
ImageExtend
,
QuillWatch
}
from
"quill-image-extend-module"
;
import
{
editStore
}
from
"@/api/sidebar/voucher"
;
import
{
editStore
,
uploadPic
}
from
"@/api/sidebar/voucher"
;
import
"quill/dist/quill.core.css"
;
import
"quill/dist/quill.snow.css"
;
import
"quill/dist/quill.bubble.css"
;
...
...
@@ -128,38 +128,49 @@ export default {
return
true
},
async
afterRead
(
file
)
{
this
.
addForm
.
logo
=
await
this
.
getImgUrl
(
file
.
file
)
//使用上传的方法。file.file
// this.addForm.logo = await this.getImgUrl(file.file)//使用上传的方法。file.file
this
.
addForm
.
logo
=
this
.
getImgUrl
(
file
.
file
)
},
async
getImgUrl
(
file
)
{
// async getImgUrl(file) {
// let params = new FormData()
// params.append('file', file)
// let url = 'http://139.155.48.151:8084/admin/auth/util/saveImg'
// const img = await axios.post(url, params)
// let urls = img.data.data.imgPath
// console.log(urls,'urls')
// return urls
// },
getImgUrl
(
file
)
{
let
params
=
new
FormData
()
params
.
append
(
'file'
,
file
)
let
url
=
'http://139.155.48.151:8084/admin/auth/util/saveImg'
const
img
=
await
axios
.
post
(
url
,
params
)
let
urls
=
img
.
data
.
data
.
imgPath
console
.
log
(
urls
,
'urls'
)
return
urls
uploadPic
(
params
).
then
(
res
=>
{
console
.
log
(
res
,
'文件'
);
return
res
.
data
.
imgPath
})
},
deleteLogo
(
file
)
{
this
.
addForm
.
logo
=
''
},
async
handleSave
()
{
handleBannerList
()
{
let
list
=
[]
let
carousel
=
'http://139.155.48.151/img/39e948a1-83ae-4769-bd8b-cbdca065a17a.jpeg,http://139.155.48.151/img/1f10d588-13bf-4436-98f0-88bebe557f6f.jpg'
this
.
addForm
.
oyStallCode
=
1
let
lists
=
''
await
this
.
bannerList
.
forEach
(
async
item
=>
{
let
img
=
await
this
.
getImgUrl
(
item
.
file
)
console
.
log
(
img
,
'imggggg'
)
let
carousel
=
''
this
.
bannerList
.
forEach
(
item
=>
{
console
.
log
(
item
.
file
,
'item'
);
let
img
=
this
.
getImgUrl
(
item
.
file
)
console
.
log
(
img
,
'img'
)
list
.
push
(
img
)
lists
=
list
.
toString
()
})
console
.
log
(
carousel
,
'carousel111'
)
console
.
log
(
lists
,
'lists'
)
editStore
(
Object
.
assign
(
this
.
addForm
,{
carousel
})).
then
(
res
=>
{
console
.
log
(
res
,
'res'
)
carousel
=
list
.
toString
()
console
.
log
(
carousel
,
'carousel1'
);
return
carousel
})
},
handleSave
()
{
this
.
addForm
.
oyStallCode
=
1
const
carousel
=
this
.
handleBannerList
()
console
.
log
(
carousel
,
'carouse2'
)
// editStore(Object.assign(this.addForm,{ carousel })).then( res => {
// console.log(res,'res')
// })
},
deleteBanner
(
file
)
{
...
...
This diff is collapsed.
Click to expand it.
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