Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
Project
Project
Details
Activity
Releases
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
和慭琛
take_order
Commits
c867ae69
Commit
c867ae69
authored
Dec 28, 2020
by
和慭琛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序上传图片覆盖后台图片问题
parent
8ad2fcb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
4 deletions
+47
-4
detail.vue
take-order/pages/take/detail.vue
+3
-1
finish.vue
take-order/pages/take/finish.vue
+44
-3
No files found.
take-order/pages/take/detail.vue
View file @
c867ae69
...
@@ -201,7 +201,9 @@
...
@@ -201,7 +201,9 @@
onShareAppMessage
(
res
)
{
onShareAppMessage
(
res
)
{
let
shareObj
=
{
let
shareObj
=
{
title
:
''
,
title
:
''
,
path
:
'/pages/index/index'
,
path
:
'/pages/index/index'
+
'?orderId='
+
this
.
orderId
+
'&toWhere=detail'
,
imageUrl
:
''
,
imageUrl
:
''
,
success
(){},
success
(){},
fail
(){}
fail
(){}
...
...
take-order/pages/take/finish.vue
View file @
c867ae69
...
@@ -399,7 +399,25 @@
...
@@ -399,7 +399,25 @@
photoArray
.
forEach
(
item
=>
{
photoArray
.
forEach
(
item
=>
{
var
imageURL
=
getApp
().
globalData
.
domain_Name
+
'/wxh-sts-rest'
+
item
var
imageURL
=
getApp
().
globalData
.
domain_Name
+
'/wxh-sts-rest'
+
item
this
.
photoList
.
push
(
imageURL
)
console
.
log
(
'原有的图片路径拼接:'
+
imageURL
)
uni
.
getImageInfo
({
src
:
imageURL
,
//服务器返回的图片地址
success
:
res
=>
{
this
.
photoList
.
push
(
res
.
path
)
this
.
photo_tempFilePaths
.
push
(
res
.
path
)
console
.
log
(
'原有图片:'
)
console
.
log
(
'photoList数组个数:'
+
this
.
photoList
.
length
)
console
.
log
(
'photo_tempFilePaths数组个数:'
+
this
.
photo_tempFilePaths
.
length
)
},
fail
:
function
(
res
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'URL图片格式不正确'
})
}
})
//this.photoList.push(imageURL)
})
})
// console.log('之前填写过的 照片数组:')
// console.log('之前填写过的 照片数组:')
...
@@ -870,8 +888,17 @@
...
@@ -870,8 +888,17 @@
//获取照片信息
//获取照片信息
getImageInfo
:
function
(
res
)
{
getImageInfo
:
function
(
res
)
{
console
.
log
(
'获取照片信息'
)
console
.
log
(
'photo_tempFilePaths数组个数:'
+
this
.
photo_tempFilePaths
.
length
)
if
(
this
.
photo_tempFilePaths
&&
this
.
photo_tempFilePaths
.
length
>
0
){
res
.
tempFilePaths
.
forEach
(
item
=>
{
this
.
photo_tempFilePaths
.
push
(
item
)
})
}
else
{
this
.
photo_tempFilePaths
=
res
.
tempFilePaths
}
this
.
photo_tempFilePaths
=
res
.
tempFilePaths
//this.photo_tempFilePaths.push(res.tempFilePaths)
//this.photo_tempFilePaths.push(res.tempFilePaths)
let
that
=
this
let
that
=
this
...
@@ -904,6 +931,20 @@
...
@@ -904,6 +931,20 @@
async
photoUpload
(){
async
photoUpload
(){
let
that
=
this
let
that
=
this
console
.
log
(
'照片上传'
)
console
.
log
(
'photo_tempFilePaths数组个数:'
+
this
.
photo_tempFilePaths
.
length
)
this
.
photo_tempFilePaths
.
forEach
(
item
=>
{
console
.
log
(
'每张照片的路径:'
)
console
.
log
(
item
)
})
//return
// console.log('照片上传 数量 :')
// console.log('照片上传 数量 :')
// console.log(this.photo_tempFilePaths.length)
// console.log(this.photo_tempFilePaths.length)
// console.log(this.photo_tempFilePaths)
// console.log(this.photo_tempFilePaths)
...
@@ -923,7 +964,6 @@
...
@@ -923,7 +964,6 @@
//新增images参数
//新增images参数
for
(
let
i
=
0
;
i
<
this
.
photo_tempFilePaths
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
photo_tempFilePaths
.
length
;
i
++
)
{
uni
.
uploadFile
({
uni
.
uploadFile
({
url
:
getApp
().
globalData
.
domain_Name
url
:
getApp
().
globalData
.
domain_Name
...
@@ -986,6 +1026,7 @@
...
@@ -986,6 +1026,7 @@
icon
:
'none'
,
icon
:
'none'
,
title
:
'照片上传失败'
title
:
'照片上传失败'
})
})
console
.
log
(
res
)
}
}
});
});
}
}
...
...
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