Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
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
viitto
mallapp
Commits
523ed85a
Commit
523ed85a
authored
Jul 29, 2020
by
黄媛媛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地址的智能识别
parent
f7cf2a11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
12 deletions
+85
-12
AddAddress.vue
pages/address/AddAddress.vue
+84
-12
zh-address-parse.min.js
pages/address/zh-address-parse.min.js
+1
-0
No files found.
pages/address/AddAddress.vue
View file @
523ed85a
...
@@ -28,18 +28,32 @@
...
@@ -28,18 +28,32 @@
</view>
</view>
</view>
</view>
<view
style=
"width: 100%;height: 1px;background: #f5f5f5;"
/>
<view
style=
"width: 100%;height: 1px;background: #f5f5f5;"
/>
<!-- TODO 定位地址 -->
<view
class=
"addcenter_item2"
style=
"align-items: flex-start;"
>
<!--
<view
class=
"addcenter_item"
>
<Text>
定位地址
</Text>
<view
style=
"display: flex;flex-direction: row;align-items: center;"
>
<Text
style=
'#303133'
>
{{
msg
.
address
}}
</Text>
<u-icon
name=
"arrow"
color=
"#B2B2B2"
size=
"30"
></u-icon>
</view>
</view>
-->
<view
style=
"width: 100%;height: 1px;background: #f5f5f5;"
/>
<view
class=
"addcenter_item2"
>
<Text>
详细地址
</Text>
<Text>
详细地址
</Text>
<input
class=
"uni-input inputM"
v-model=
"msg.Address"
/>
<textarea
style=
"height: 50px;"
class=
"inputM"
v-model=
"msg.Address"
/>
</view>
</view>
<!-- 智能识别 -->
<view
class=
"smart"
>
<view>
<span>
智能识别
</span>
<textarea
placeholder=
"请粘贴或输入你的地址"
placeholder-style=
"font-size:13px"
:value=
"identifyinput"
@
input=
'identifybtn'
class=
"inputsmart"
/>
<view
style=
"display: flex;flex-direction: row;justify-content: flex-end;"
>
<view
class=
"btn_smart"
:style=
"
{'background':mainColor}" @click="addidentify">
<Text>
识别
</Text>
</view>
</view>
</view>
</view>
</view>
</view>
<view
class=
"btn"
@
click=
"preserve"
:style=
"
{'background':mainColor}">
<view
class=
"btn"
@
click=
"preserve"
:style=
"
{'background':mainColor}">
...
@@ -53,7 +67,7 @@
...
@@ -53,7 +67,7 @@
<
script
>
<
script
>
import
pickerAddress
from
'./liudx-pickerAddress/index.vue'
import
pickerAddress
from
'./liudx-pickerAddress/index.vue'
import
AddressParse
from
'./zh-address-parse.min.js'
export
default
{
export
default
{
components
:
{
components
:
{
pickerAddress
pickerAddress
...
@@ -75,6 +89,7 @@
...
@@ -75,6 +89,7 @@
address
:
''
,
address
:
''
,
Pickershwo
:
false
,
Pickershwo
:
false
,
addressShow
:
false
,
addressShow
:
false
,
identifyinput
:
''
,
}
}
},
},
...
@@ -161,6 +176,39 @@
...
@@ -161,6 +176,39 @@
}
}
},
},
identifybtn
(
val
){
this
.
identifyinput
=
val
.
detail
.
value
},
addidentify
(){
let
parseResult
=
AddressParse
(
this
.
identifyinput
,
0
)
console
.
log
(
parseResult
)
this
.
msg
.
Name
=
parseResult
.
name
;
this
.
msg
.
Mobile
=
parseResult
.
phone
;
this
.
msg
.
Address
=
parseResult
.
detail
;
let
nameList
=
[
parseResult
.
province
,
parseResult
.
city
,
parseResult
.
area
];
this
.
getDestination
(
nameList
);
},
getDestination
(
nameList
)
{
this
.
request2
(
{
url
:
'/api/AppletUser/GetDestinationListByNames'
,
data
:
{
area
:
nameList
}
},
res
=>
{
console
.
log
(
'res'
,
res
);
this
.
msg
.
Province
=
res
.
data
[
0
].
ID
;
this
.
msg
.
City
=
res
.
data
[
1
].
ID
;
this
.
msg
.
District
=
res
.
data
[
2
].
ID
;
this
.
address
=
nameList
[
0
]
+
','
+
nameList
[
1
]
+
','
+
nameList
[
2
]
}
);
},
}
}
}
}
</
script
>
</
script
>
...
@@ -215,9 +263,33 @@
...
@@ -215,9 +263,33 @@
margin-top
:
46
rpx
;
margin-top
:
46
rpx
;
border-radius
:
40
rpx
;
border-radius
:
40
rpx
;
}
}
.AddaddressStyle
.btn_smart
{
width
:
60px
;
height
:
50
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
color
:
#fff
;
margin-top
:
10
rpx
;
border-radius
:
25
rpx
;
}
.AddaddressStyle
.inputM
{
.AddaddressStyle
.inputM
{
margin-left
:
20
rpx
;
margin-left
:
20
rpx
;
width
:
70%
;
width
:
70%
;
text-align
:
right
;
text-align
:
right
;
}
}
.AddaddressStyle
.inputsmart
{
width
:
100%
;
height
:
100px
;
margin-top
:
10px
;
}
.AddaddressStyle
.smart
{
width
:
100%
;
padding
:
20
rpx
28
rpx
;
background
:
#FFFFFF
;
margin-top
:
20px
;
}
</
style
>
</
style
>
pages/address/zh-address-parse.min.js
0 → 100644
View file @
523ed85a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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