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
4ba29899
Commit
4ba29899
authored
Apr 20, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二维码扫描组件
parent
780a01e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
32 deletions
+15
-32
XhScan.vue
src/components/createCom/XhScan.vue
+15
-32
No files found.
src/components/createCom/XhScan.vue
View file @
4ba29899
...
@@ -3,27 +3,20 @@
...
@@ -3,27 +3,20 @@
<view
class=
"u-flex"
>
<view
class=
"u-flex"
>
请输入:
<u-input
class=
"u-flex-1"
v-model=
"dataValue"
@
input=
"valueChange"
type=
"text"
/>
请输入:
<u-input
class=
"u-flex-1"
v-model=
"dataValue"
@
input=
"valueChange"
type=
"text"
/>
</view>
</view>
<view
class=
"u-flex"
@
click=
"
getScan('')
"
>
<view
class=
"u-flex"
@
click=
"
scanCode
"
>
<view
class=
"txt u-flex-1"
>
扫描二维码(仅挚达充电桩可扫描)
</view>
<view
class=
"txt u-flex-1"
>
扫描二维码(仅挚达充电桩可扫描)
</view>
<u-icon
name=
"arrow-right"
color=
"#666"
size=
"28"
></u-icon>
<u-icon
name=
"arrow-right"
color=
"#666"
size=
"28"
></u-icon>
</view>
</view>
<!--
<view
class=
"list u-flex u-row-between"
>
<text
class=
"required"
v-if=
"item.required"
>
*
</text>
<view
class=
"u-m-r-20"
>
{{
item
.
fieldsTitle
}}
</view>
<view
class=
"u-flex-1"
>
{{
valueTxt
||
''
}}
</view>
<u-button
type=
"primary"
size=
"mini"
@
click=
"$u.debounce(getLocation,1000)"
>
默认按钮
</u-button>
</view>
-->
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
objMixin
from
'./obj
Mixin'
import
stringMixin
from
'./string
Mixin'
export
default
{
export
default
{
name
:
'XhScan'
,
name
:
'XhScan'
,
components
:
{},
components
:
{},
mixins
:
[
obj
Mixin
],
mixins
:
[
string
Mixin
],
props
:
{},
props
:
{},
filters
:{},
filters
:{},
data
()
{
data
()
{
...
@@ -42,33 +35,23 @@
...
@@ -42,33 +35,23 @@
watch
:
{},
watch
:
{},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
getScan
(
type
){
scanCode
(
type
){
const
self
=
this
// qrCode 二维码;barCode 条形码
let
scanType
=
type
&&
[
type
]
||
[
'qrCode'
]
uni
.
scanCode
({
uni
.
scanCode
({
scanType
:
[
'barCode'
]
,
// scanType: scanType
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
console
.
log
(
'条码类型:'
+
res
.
scanType
);
self
.
dataValue
=
res
.
result
console
.
log
(
'条码内容:'
+
res
.
result
);
self
.
valueChange
(
res
.
result
)
// console.log('条码类型:' + res.scanType);
// console.log('条码内容:' + res.result);
}
}
});
});
},
},
getLocation
()
{
// setValue(txt) {
let
self
=
this
// this.valueChange(this.dataValue)
const
dataValue
=
this
.
dataValue
||
[]
// }
const
waterInfo
=
this
.
waterInfo
uni
.
getLocation
({
type
:
'gcj02'
,
success
:
function
(
res
)
{
dataValue
.
push
(
res
.
longitude
)
dataValue
.
push
(
res
.
latitude
)
self
.
dataValue
=
dataValue
self
.
setValue
(
dataValue
)
},
fail
(
err
)
{}
});
},
setValue
(
txt
)
{
this
.
valueChange
(
this
.
dataValue
)
}
}
}
}
}
</
script
>
</
script
>
...
...
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