Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jd-vx-app
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
Administrator
jd-vx-app
Commits
41644b7a
Commit
41644b7a
authored
Apr 25, 2022
by
肖健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序内扫码完善
parent
7f6de3a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
5 deletions
+48
-5
custom-tarbar.vue
common/wxcomponents/custom-tarbar/custom-tarbar.vue
+48
-5
No files found.
common/wxcomponents/custom-tarbar/custom-tarbar.vue
View file @
41644b7a
...
...
@@ -78,6 +78,7 @@ export default {
onLoad
()
{},
methods
:
{
setSelected
(
index
)
{
const
that
=
this
if
(
index
!=
2
)
{
uni
.
navigateTo
({
url
:
this
.
tabBar
.
list
[
index
].
pagePath
,
...
...
@@ -85,18 +86,60 @@ export default {
}
else
{
//扫码
// 允许从相机和相册扫码
uni
.
navigateTo
({
url
:
'/pagesB/pages/move-car/scan'
,
});
//
uni.navigateTo({
//
url: '/pagesB/pages/move-car/scan',
//
});
uni
.
scanCode
({
success
:
function
(
res
)
{
console
.
log
(
'条码类型:'
+
res
.
scanType
);
console
.
log
(
'条码内容:'
+
res
.
result
);
let
path
=
res
.
path
if
(
path
)
{
let
xcxIndexPath
=
uni
.
getStorageSync
(
'xcxIndexPath'
)
if
(
xcxIndexPath
)
{
xcxIndexPath
=
path
.
replace
(
xcxIndexPath
,
''
).
replace
(
"?"
,
''
)
if
(
xcxIndexPath
.
indexOf
(
'scene'
)
>=
0
)
{
let
scene
=
xcxIndexPath
.
replace
(
'scene='
,
''
)
let
param
=
{
code
:
scene
}
let
opts
=
{
url
:
'/app/index/check/move/code'
,
method
:
'post'
}
that
.
http
.
httpTokenRequest
(
opts
,
param
).
then
(
res
=>
{
console
.
info
(
res
)
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
data
.
bindFlag
)
{
that
.
gotoMoveCar
(
scene
)
}
else
{
that
.
gotoBindMoveCar
(
scene
)
}
}
})
}
}
}
else
{
uni
.
showToast
({
title
:
'扫码失败'
,
icon
:
'none'
,
})
}
}
});
}
this
.
$forceUpdate
();
},
//跳转到挪车页面
gotoMoveCar
(
s
)
{
let
that
=
this
;
uni
.
navigateTo
({
url
:
'/pagesB/pages/move-car/oneMoveCar?scene='
+
s
});
},
//跳转到绑定页面
gotoBindMoveCar
(
s
)
{
let
that
=
this
;
uni
.
navigateTo
({
url
:
'/pagesB/pages/move-car/scan?moveCode='
+
s
});
},
}
};
...
...
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