Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
李俊赕
self-support
Commits
6ebba4ea
Commit
6ebba4ea
authored
May 17, 2021
by
郭晓清
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.banshouhui.com/lijundan/self-support
parents
44dc4851
33ac4cab
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
10 deletions
+39
-10
App.vue
src/App.vue
+17
-1
XhFiles.vue
src/components/createCom/XhFiles.vue
+1
-1
index.vue
src/components/take/index.vue
+3
-3
task.js
src/components/upload/task.js
+18
-5
icon-flash-off.png
src/static/photo/icon-flash-off.png
+0
-0
icon-flash-torch.png
src/static/photo/icon-flash-torch.png
+0
-0
No files found.
src/App.vue
View file @
6ebba4ea
...
@@ -86,17 +86,33 @@ export default {
...
@@ -86,17 +86,33 @@ export default {
},
},
onShow
:
async
function
()
{
onShow
:
async
function
()
{
// 应用启动,或从后台进入前台显示
// 应用启动,或从后台进入前台显示
this
.
handleImageTask
()
},
},
onHide
:
function
()
{
onHide
:
function
()
{
// 应用从前台进入后台
// 应用从前台进入后台
},
},
watch
:
{
watch
:
{
uploadTask
:
function
(
newValue
,
oldValue
)
{
uploadTask
:
function
(
newValue
,
oldValue
)
{
console
.
log
(
"oldValue, newValue"
,
oldValue
,
newValue
)
if
(
newValue
.
length
>
0
)
upload
.
uploadImageTask
(
this
)
if
(
newValue
.
length
>
0
)
upload
.
uploadImageTask
(
this
)
}
}
},
},
methods
:
{
methods
:
{
// 处理上传图片队列数据
handleImageTask
()
{
if
(
this
.
uploadTask
.
length
>
0
)
{
upload
.
uploadImageTask
(
this
)
}
else
{
// 定时清理缓存在本地的文件
const
result
=
uni
.
getStorageSync
(
'delImg'
)
if
(
result
.
length
>
0
)
{
for
(
let
i
of
result
)
{
uni
.
removeSavedFile
({
filePath
:
i
})
}
uni
.
setStorageSync
(
'delImg'
,
[])
}
}
},
getSystemInfo
()
{
getSystemInfo
()
{
try
{
try
{
let
a
=
wx
.
getSystemInfoSync
();
let
a
=
wx
.
getSystemInfoSync
();
...
...
src/components/createCom/XhFiles.vue
View file @
6ebba4ea
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
import
arrMixin
from
'./arrMixin'
import
arrMixin
from
'./arrMixin'
import
baseFile
from
'@/components/upload/index'
;
import
baseFile
from
'@/components/upload/index'
;
import
takePhoto
from
'@/components/take/index.vue'
import
takePhoto
from
'@/components/take/index.vue'
import
uploader
from
'@/plugins/uploader/index.js'
//
import uploader from '@/plugins/uploader/index.js'
export
default
{
export
default
{
name
:
'XhFiles'
,
name
:
'XhFiles'
,
...
...
src/components/take/index.vue
View file @
6ebba4ea
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<cover-image
@
click=
"setCameraInfo('devicePosition')"
class=
"icon"
mode=
"aspectFit"
<cover-image
@
click=
"setCameraInfo('devicePosition')"
class=
"icon"
mode=
"aspectFit"
src=
"/static/photo/icon-switch.png"
></cover-image>
src=
"/static/photo/icon-switch.png"
></cover-image>
<cover-image
@
click=
"setCameraInfo('flash')"
class=
"icon"
mode=
"aspectFit"
<cover-image
@
click=
"setCameraInfo('flash')"
class=
"icon"
mode=
"aspectFit"
:src=
"'/static/photo/icon-
light
-' + cameraInfo.flash +'.png'"
></cover-image>
:src=
"'/static/photo/icon-
flash
-' + cameraInfo.flash +'.png'"
></cover-image>
<cover-image
v-if=
"currentItem.partnerCompanyId"
@
click=
"changeType(3)"
class=
"icon"
mode=
"aspectFit"
<cover-image
v-if=
"currentItem.partnerCompanyId"
@
click=
"changeType(3)"
class=
"icon"
mode=
"aspectFit"
src=
"/static/photo/icon-setting.png"
></cover-image>
src=
"/static/photo/icon-setting.png"
></cover-image>
</cover-view>
</cover-view>
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
standardShow
:
false
,
standardShow
:
false
,
cameraInfo
:
{
cameraInfo
:
{
devicePosition
:
'back'
,
devicePosition
:
'back'
,
flash
:
'
auto
'
flash
:
'
off
'
},
},
waterInfo
:
{
waterInfo
:
{
longitude
:
''
,
// 经度
longitude
:
''
,
// 经度
...
@@ -222,7 +222,7 @@
...
@@ -222,7 +222,7 @@
val
=
val
===
'back'
?
'front'
:
'back'
val
=
val
===
'back'
?
'front'
:
'back'
break
;
break
;
case
'flash'
:
case
'flash'
:
val
=
val
===
'
auto'
?
'on'
:
(
val
===
'on'
?
'off'
:
'auto'
)
val
=
val
===
'
off'
?
'torch'
:
'off'
break
;
break
;
defalut
:
defalut
:
...
...
src/components/upload/task.js
View file @
6ebba4ea
...
@@ -7,7 +7,6 @@ export default {
...
@@ -7,7 +7,6 @@ export default {
*/
*/
async
uploadImageTask
(
that
)
{
async
uploadImageTask
(
that
)
{
const
uploadTask
=
that
.
uploadTask
const
uploadTask
=
that
.
uploadTask
console
.
log
(
"uploadTask"
,
uploadTask
)
const
options
=
{
const
options
=
{
files
:
uploadTask
,
// 必填 临时文件路径 格式: [{path: "图片地址"}]
files
:
uploadTask
,
// 必填 临时文件路径 格式: [{path: "图片地址"}]
...
@@ -15,13 +14,27 @@ export default {
...
@@ -15,13 +14,27 @@ export default {
maxSize
:
300000
,
//(默认 无 说明:上传的文件最大字节数限制,默认不限制)
maxSize
:
300000
,
//(默认 无 说明:上传的文件最大字节数限制,默认不限制)
onEachUpdate
:
res
=>
{
onEachUpdate
:
res
=>
{
console
.
log
(
"上传成功返回:"
,
res
);
console
.
log
(
"上传成功返回:"
,
res
);
const
newTask
=
uploadTask
.
filter
(
v
=>
v
.
key
!==
res
.
key
)
// that.$u.vuex('uploadTask', newTask)
},
},
Update
:
res
=>
{
Update
:
res
=>
{
console
.
log
(
"上传进度返回:"
,
res
);
console
.
log
(
"上传进度返回:"
,
res
);
}
}
}
}
uploader
.
qnFileUpload
(
options
)
const
result
=
await
uploader
.
qnFileUpload
(
options
)
},
if
(
result
)
{
// 匹配已上传完成的图片,更新缓存数据
let
newTask
=
[]
let
delImg
=
[]
uploadTask
.
forEach
(
v
=>
{
if
(
result
.
includes
(
`/
${
v
.
key
}
`
))
{
// 删除已上传的图片
delImg
.
push
(
v
.
path
)
}
else
{
// 未上传的重新存储
newTask
.
push
(
v
)
}
})
uni
.
setStorageSync
(
'delImg'
,
delImg
)
// 已上传完的图片,会在启动系统的时候做一次清理
that
.
$u
.
vuex
(
'uploadTask'
,
newTask
)
}
}
}
}
\ No newline at end of file
src/static/photo/icon-flash-off.png
0 → 100644
View file @
6ebba4ea
1.36 KB
src/static/photo/icon-flash-torch.png
0 → 100644
View file @
6ebba4ea
1 KB
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