Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
Overview
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
fengzhaoyu
schedule
Commits
a08d618c
Commit
a08d618c
authored
May 14, 2020
by
fengzhaoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改上传图片没有添加上问题
parent
7bcbc03e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
13 deletions
+21
-13
index.js
pages/index/index.js
+1
-1
meetingDetail.js
pages/meetingDetail/meetingDetail.js
+8
-1
uploadFile.js
pages/meetingDetail/uploadFile.js
+8
-10
uploadFile.js
pages/uploadFile/uploadFile.js
+4
-1
No files found.
pages/index/index.js
View file @
a08d618c
...
...
@@ -885,7 +885,7 @@ create.Page({
maxClickCount
--
;
if
(
maxClickCount
==
0
)
{
dd
.
alert
({
content
:
"0.0.
29
"
content
:
"0.0.
30
"
});
maxClickCount
=
5
;
}
...
...
pages/meetingDetail/meetingDetail.js
View file @
a08d618c
...
...
@@ -1639,7 +1639,14 @@ create.Page({
// 上传oss文件
async
addOssFile
()
{
uploadOss
().
then
(
res
=>
{
dd
.
navigateTo
({
url
:
`./../uploadFile/uploadFile`
})
if
(
!!
res
)
{
this
.
store
.
data
.
fileInfos
=
res
this
.
update
()
dd
.
navigateTo
({
url
:
`./../uploadFile/uploadFile`
})
}
// dd.alert({
// content: JSON.stringify(res)
// })
})
},
...
...
pages/meetingDetail/uploadFile.js
View file @
a08d618c
...
...
@@ -34,7 +34,7 @@ function getOssImg() {
})
}
// 获取的图片上传到oss
function
sendOss
(
permisson
,
imgInfo
,
key
)
{
function
sendOss
(
permisson
,
imgInfo
,
key
,
fileName
)
{
return
new
Promise
(
resolve
=>
{
dd
.
uploadFile
({
headers
:
{
...
...
@@ -53,7 +53,12 @@ function sendOss(permisson, imgInfo, key) {
},
success
:
(
res
)
=>
{
console
.
log
(
JSON
.
stringify
(
res
))
resolve
(
imgInfo
)
resolve
([{
fileId
:
key
,
fileName
:
fileName
,
fileType
:
imgInfo
.
files
[
0
].
fileType
,
fileSize
:
imgInfo
.
files
[
0
].
size
}])
}
})
})
...
...
@@ -100,12 +105,5 @@ export async function uploadOss() {
const
imgInfo
=
await
getOssImg
()
const
key
=
await
new
Promise
((
resolve
)
=>
{
resolve
(
permisson
.
data
.
data
.
dir
+
timestamp
+
random
+
'.'
+
imgInfo
.
files
[
0
].
fileType
)
})
const
fileName
=
await
new
Promise
((
resolve
)
=>
{
resolve
(
timestamp
+
random
+
'.'
+
imgInfo
.
files
[
0
].
fileType
)
})
await
sendOss
(
permisson
,
imgInfo
,
key
)
pageStore
.
data
.
fileInfos
.
push
(...[{
fileId
:
key
,
fileName
:
fileName
,
fileType
:
imgInfo
.
files
[
0
].
fileType
,
fileSize
:
imgInfo
.
files
[
0
].
size
}]);
pageStore
.
update
()
return
await
sendOss
(
permisson
,
imgInfo
,
key
,
fileName
)
}
pages/uploadFile/uploadFile.js
View file @
a08d618c
...
...
@@ -36,7 +36,10 @@ create.Page({
},
100
),
//添加会议文件
add
()
{
uploadOss
()
uploadOss
().
then
(
res
=>
{
this
.
store
.
data
.
fileInfos
.
push
(...
res
)
this
.
update
();
})
// const data = {
// ddUserId: getApp().globalData.userid,
// type: 'add',
...
...
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