Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
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
wangxuelai
wechatapp.shangjiadao.com
Commits
7100a624
Commit
7100a624
authored
Dec 09, 2019
by
lvtz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wxl-develop' of git.server:wangxuelai/wechatapp.shangjiadao.com into guide_lvtz
parents
25504edd
7ea5ae6f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
21 deletions
+40
-21
index.js
business/pages/commenteditor/index.js
+17
-10
index.js
src/pages/clockeditor/index.js
+22
-11
index.js
src/pages/invitationcard/index.js
+1
-0
No files found.
business/pages/commenteditor/index.js
View file @
7100a624
...
...
@@ -143,6 +143,7 @@ Page({
scoreTempArr
:
[],
imgInfoList
:[],
tempFilesImgs
:[],
// 标记图片返回的本地图片
uploadVideoTask
:
{},
},
chooseAverageScore
()
{
...
...
@@ -274,6 +275,11 @@ Page({
audioStorage
:
{
}
})
for
(
let
i
in
this
.
data
.
uploadVideoTask
)
{
if
(
this
.
data
.
uploadVideoTask
[
i
])
{
this
.
data
.
uploadVideoTask
[
i
].
abort
();
}
}
clearInterval
(
this
.
data
.
voiceInterval
);
},
onPullDownRefresh
:
function
()
{
// Do something when pull down.
...
...
@@ -1328,7 +1334,11 @@ Page({
const
{
dataset
}
=
e
.
currentTarget
;
const
imageBox
=
this
.
data
.
imageBox
;
let
currentIndex
=
this
.
data
.
currentIndex
-
1
;
imageBox
.
splice
(
dataset
.
index
,
1
)
if
(
imageBox
[
dataset
.
index
].
type
==
'video'
)
{
this
.
data
.
uploadVideoTask
[
imageBox
[
dataset
.
index
].
src
].
abort
();
delete
this
.
data
.
uploadVideoTask
[
imageBox
[
dataset
.
index
].
src
];
}
imageBox
.
splice
(
dataset
.
index
,
1
);
this
.
setData
({
imageBox
,
currentIndex
...
...
@@ -1415,8 +1425,9 @@ Page({
}
let
imageBox
=
this
.
data
.
imageBox
let
videoInsertIndex
=
imageBox
.
filter
(
ele
=>
ele
.
type
==
'video'
).
length
;
filename
=
`
${
access
.
dir
}${
getRandomFilename
(
tempFilePath
)}
`
;
imageBox
.
splice
(
videoInsertIndex
,
0
,
{
src
:
tempFilePath
,
src
:
filename
,
status
:
'resolving'
,
type
:
'video'
,
size
:
size
,
...
...
@@ -1425,8 +1436,7 @@ Page({
that
.
setData
({
imageBox
})
filename
=
`
${
access
.
dir
}${
getRandomFilename
(
tempFilePath
)}
`
;
that
.
uploadVideoTask
=
wx
.
uploadFile
({
that
.
data
.
uploadVideoTask
[
filename
]
=
wx
.
uploadFile
({
url
:
access
.
host
,
formData
:
{
key
:
filename
,
...
...
@@ -1450,17 +1460,14 @@ Page({
})
}
else
{
that
.
setData
({
videostatus
:
'fail'
})
[
`imageBox[
${
videoInsertIndex
}
].status`
]:
'fail'
,
})
;
}
},
fail
()
{
that
.
setData
({
videostatus
:
'fail'
})
}
})
that
.
uploadVideoTask
.
onProgressUpdate
((
res
)
=>
{
that
.
data
.
uploadVideoTask
[
filename
]
.
onProgressUpdate
((
res
)
=>
{
imageBox
[
videoInsertIndex
].
videoprogress
=
res
.
progress
>
95
?
95
:
res
.
progress
;
that
.
setData
({
imageBox
:
imageBox
...
...
src/pages/clockeditor/index.js
View file @
7100a624
...
...
@@ -148,6 +148,8 @@ Page({
loginCode
:
''
,
contentQualified
:
false
,
// 所输入内容是否合格
getmobiledialogshow
:
false
,
uploadVideoTask
:
{
},
},
onLoad
:
function
(
options
)
{
// Do some initialize when page load.
this
.
innerAudioContext
=
wx
.
createInnerAudioContext
();
...
...
@@ -239,8 +241,10 @@ Page({
audioStorage
:
{
}
})
if
(
this
.
uploadVideoTask
)
{
this
.
uploadVideoTask
.
abort
();
for
(
let
i
in
this
.
data
.
uploadVideoTask
)
{
if
(
this
.
data
.
uploadVideoTask
[
i
])
{
this
.
data
.
uploadVideoTask
[
i
].
abort
();
}
}
clearInterval
(
this
.
data
.
voiceInterval
);
},
...
...
@@ -484,6 +488,10 @@ Page({
const
{
dataset
}
=
e
.
currentTarget
;
const
imageBox
=
this
.
data
.
imageBox
;
let
currentIndex
=
this
.
data
.
currentIndex
-
1
;
if
(
imageBox
[
dataset
.
index
].
type
==
'video'
)
{
this
.
data
.
uploadVideoTask
[
imageBox
[
dataset
.
index
].
src
].
abort
();
delete
this
.
data
.
uploadVideoTask
[
imageBox
[
dataset
.
index
].
src
];
}
imageBox
.
splice
(
dataset
.
index
,
1
)
this
.
setData
({
imageBox
,
...
...
@@ -509,6 +517,7 @@ Page({
let
failVideos
=
imageBox
.
filter
(
ele
=>
(
ele
.
status
==
'fail'
&&
ele
.
type
==
'video'
));
let
fullfilledImages
=
imageBox
.
filter
(
ele
=>
ele
.
status
==
'fullfilled'
);
let
notUploadedImagesAndVideo
=
imageBox
.
filter
(
ele
=>
(
ele
.
status
==
'resolving'
||
ele
.
status
==
'pending'
));
console
.
log
(
notUploadedImagesAndVideo
,
'notUploadedImagesAndVideo'
);
if
(
notUploadedImagesAndVideo
.
length
>
0
)
{
wx
.
showToast
({
title
:
'您的打卡内容尚未全部上传,请稍后...'
,
...
...
@@ -516,7 +525,8 @@ Page({
})
return
;
}
if
(
failImages
.
length
>
0
||
this
.
data
.
videostatus
==
'fail'
)
{
// if (failImages.length > 0 || this.data.videostatus == 'fail') {
if
(
failImages
.
length
>
0
)
{
let
text
=
''
;
text
=
failImages
.
length
>
0
?
text
+
`有
${
failImages
.
length
}
个图片上传失败,`
:
text
;
text
=
failVideos
.
length
>
0
?
text
+
`
${
failVideos
.
length
}
视频上传失败,`
:
text
;
...
...
@@ -813,8 +823,9 @@ Page({
}
let
imageBox
=
this
.
data
.
imageBox
let
videoInsertIndex
=
imageBox
.
filter
(
ele
=>
ele
.
type
==
'video'
).
length
;
filename
=
`
${
access
.
dir
}${
getRandomFilename
(
tempFilePath
)}
`
;
imageBox
.
splice
(
videoInsertIndex
,
0
,
{
src
:
tempFilePath
,
src
:
filename
,
status
:
'resolving'
,
type
:
'video'
,
size
:
size
,
...
...
@@ -823,8 +834,7 @@ Page({
that
.
setData
({
imageBox
})
filename
=
`
${
access
.
dir
}${
getRandomFilename
(
tempFilePath
)}
`
;
that
.
uploadVideoTask
=
wx
.
uploadFile
({
that
.
data
.
uploadVideoTask
[
`
${
filename
}
`
]
=
wx
.
uploadFile
({
url
:
access
.
host
,
formData
:
{
key
:
filename
,
...
...
@@ -852,17 +862,18 @@ Page({
})
}
else
{
that
.
setData
({
videostatus
:
'fail'
[
`imageBox[
${
videoInsertIndex
}
].status`
]
:
'fail'
})
}
},
fail
(
e
)
{
that
.
setData
({
videostatus
:
'fail'
})
// console.log('失败');
// that.setData({
// [`imageBox[${videoInsertIndex}].status`]: 'fail'
// })
}
})
that
.
uploadVideoTask
.
onProgressUpdate
((
res
)
=>
{
that
.
data
.
uploadVideoTask
[
`
${
filename
}
`
]
.
onProgressUpdate
((
res
)
=>
{
imageBox
[
videoInsertIndex
].
videoprogress
=
res
.
progress
>
95
?
95
:
res
.
progress
;
that
.
setData
({
imageBox
:
imageBox
...
...
src/pages/invitationcard/index.js
View file @
7100a624
...
...
@@ -282,6 +282,7 @@ Page({
},
generatePoster
(
e
)
{
const
{
dataset
}
=
e
.
currentTarget
;
console
.
log
(
this
.
data
.
posterBox
);
if
(
this
.
data
.
posterBox
[
this
.
data
.
currentIndex
])
{
wx
.
previewImage
({
current
:
this
.
data
.
posterBox
[
this
.
data
.
currentIndex
],
// 当前显示图片的链接,不填则默认为 urls 的第一张
...
...
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