Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
wmsMin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
04c1abcd
authored
Dec 07, 2021
by
liangjianmin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
js
parent
dca65964
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
9 deletions
manifest.json
pages/home/index.vue
pages/scan/confirm.vue
util/api.js
manifest.json
View file @
04c1abcd
...
...
@@ -50,7 +50,7 @@
"quickapp"
:
{},
/*
小程序特有相关
*/
"mp-weixin"
:
{
"appid"
:
"wx
47674efb6eef06e1
"
,
"appid"
:
"wx
61a41a064fa2fb3c
"
,
"setting"
:
{
"urlCheck"
:
false
,
"es6"
:
true
,
...
...
pages/home/index.vue
View file @
04c1abcd
...
...
@@ -71,7 +71,7 @@ export default {
fail
:
function
(
res
)
{
console
.
log
(
res
);
uni
.
showToast
({
title
:
'
上传
失败'
,
title
:
'
扫码
失败'
,
icon
:
'none'
});
}
...
...
pages/scan/confirm.vue
View file @
04c1abcd
...
...
@@ -59,32 +59,37 @@ export default {
chooseImageChange
()
{
var
self
=
this
;
var
time
=
parseInt
(
new
Date
().
getTime
()
/
1000
);
uni
.
chooseImage
({
count
:
4
,
sourceType
:
[
'album'
,
'camera'
],
success
:
chooseImageRes
=>
{
uni
.
showLoading
({
title
:
'上传中...'
});
const
tempFilePaths
=
chooseImageRes
.
tempFilePaths
;
let
maxNum
=
tempFilePaths
.
length
*
1
+
self
.
attachAddress
.
length
*
1
;
if
(
maxNum
>
4
)
{
uni
.
hideLoading
();
uni
.
showToast
({
title
:
'图片不超过4张'
});
return
false
;
}
for
(
let
i
=
0
;
i
<
tempFilePaths
.
length
;
i
++
)
{
console
.
log
(
tempFilePaths
[
i
]);
uni
.
uploadFile
({
url
:
'https://api.ichunt.com/oss/upload'
,
filePath
:
tempFilePaths
[
i
],
name
:
'upload'
,
formData
:
{
source
:
'1'
,
pf
:
20
,
k1
:
time
,
k2
:
w_md5
.
hex_md5_32
(
w_md5
.
hex_md5_32
(
String
(
time
))
+
'fh6y5t4rr351d2c3bryi'
)
},
success
:
uploadFileRes
=>
{
uni
.
hideLoading
();
var
data
=
JSON
.
parse
(
uploadFileRes
.
data
);
console
.
log
(
data
);
if
(
data
.
code
===
200
)
{
self
.
attachAddress
.
push
(
data
.
data
[
0
]);
}
else
{
...
...
@@ -94,6 +99,7 @@ export default {
}
},
fail
:
error
=>
{
uni
.
hideLoading
();
console
.
log
(
error
);
}
});
...
...
@@ -123,7 +129,7 @@ export default {
},
2000
);
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
title
:
res
.
err_
msg
,
icon
:
'none'
});
}
...
...
util/api.js
View file @
04c1abcd
//
const API_BASE = 'https://api.ichunt.com';
const
API_BASE
=
'http://supplyapi.liexin.com'
const
API_BASE
=
'https://api.ichunt.com'
;
//
const API_BASE = 'http://supplyapi.liexin.com'
const
API
=
{
/**
* 上传数据
...
...
@@ -16,7 +16,7 @@ const API = {
/**
* 上传文件
* */
upload
:
API_BASE
+
'/oss/upload'
,
upload
:
API_BASE
+
'/oss/upload'
}
...
...
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