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