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
5ab10fc4
Commit
5ab10fc4
authored
Apr 19, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取地图公共组件
parent
dcbabe22
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
11 deletions
+98
-11
classify.data.js
src/common/classify.data.js
+4
-1
XhLocation.vue
src/components/createCom/XhLocation.vue
+68
-0
complete.vue
src/pages/order/complete.vue
+26
-10
No files found.
src/common/classify.data.js
View file @
5ab10fc4
...
...
@@ -46,7 +46,10 @@ export default [{
"cat"
:
10
},
{
"fieldsTitle"
:
"阔腿裤"
,
"fieldsTitle"
:
"获取经纬度"
,
"fieldsName"
:
"location"
,
"fieldsType"
:
"location"
,
// "required": true,
"key"
:
"阔腿裤"
,
"icon"
:
"https://cdn.uviewui.com/uview/common/classify/1/6.jpg"
,
"cat"
:
10
...
...
src/components/createCom/XhLocation.vue
0 → 100644
View file @
5ab10fc4
<
template
>
<view
class=
"list u-flex u-row-between"
>
<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>
</
template
>
<
script
>
import
objMixin
from
'./objMixin'
export
default
{
name
:
'XhRadio'
,
components
:
{},
mixins
:
[
objMixin
],
props
:
{},
filters
:{},
data
()
{
return
{}
},
computed
:
{
valueTxt
()
{
let
str
=
''
const
dataValue
=
this
.
dataValue
if
(
dataValue
&&
dataValue
.
length
>
1
){
str
=
'经度:'
+
dataValue
[
0
]
+
','
+
'维度:'
+
dataValue
[
1
]
}
return
str
}
},
watch
:
{},
mounted
()
{},
methods
:
{
getLocation
()
{
let
self
=
this
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
>
<
style
lang=
"scss"
scoped
>
.list
{
display
:
flex
;
.txt
{
color
:
#666
;
padding
:
10rpx
;
&
.active
{
background-color
:
red
;
color
:
#fff
;
}
}
}
</
style
>
src/pages/order/complete.vue
View file @
5ab10fc4
...
...
@@ -22,28 +22,32 @@
<view
class=
"class-item"
:key=
"groupIndex"
>
<view
class=
"title"
>
{{
groupItem
.
groupName
}}
</view>
<view
class=
"class-bd"
>
<u-form-item
v-for=
"(item,itemIndex) in groupItem.item"
:key=
"itemIndex"
<u-form-item
:label=
"toLowerCase(item.fieldsType)!=='location' ? item.fieldsTitle : ''"
:required=
"item.required"
v-for=
"(item,itemIndex) in groupItem.item"
:key=
"itemIndex"
label-position=
"top"
:prop=
"item.fieldsName"
>
<view
class=
"label"
@
click=
"nextStep(item)"
>
<!--
<view
class=
"label"
@
click=
"nextStep(item)"
>
<text
class=
"required"
v-if=
"item.required"
>
*
</text>
{{
item
.
fieldsTitle
}}
</view>
</view>
-->
<template
v-if=
"item.fieldsType"
>
<xh-input
v-if=
"
item.fieldsType
==='input'"
:groupIndex=
"groupIndex"
<xh-input
v-if=
"
toLowerCase(item.fieldsType)
==='input'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-input>
<xh-radio
v-
if=
"item.fieldsType
==='radio'"
:groupIndex=
"groupIndex"
<xh-radio
v-
else-if=
"toLowerCase(item.fieldsType)
==='radio'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-radio>
<xh-checkbox
v-
if=
"item.fieldsType
==='checkbox'"
:groupIndex=
"groupIndex"
<xh-checkbox
v-
else-if=
"toLowerCase(item.fieldsType)
==='checkbox'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-checkbox>
<xh-select
v-
if=
"item.fieldsType
==='select'"
:groupIndex=
"groupIndex"
<xh-select
v-
else-if=
"toLowerCase(item.fieldsType)
==='select'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-select>
<xh-files
v-
if=
"item.fieldsType
==='file'"
:groupIndex=
"groupIndex"
<xh-files
v-
else-if=
"toLowerCase(item.fieldsType)
==='file'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-files>
<xh-location
v-else-if=
"toLowerCase(item.fieldsType)==='location'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-location>
</
template
>
</u-form-item>
</view>
...
...
@@ -62,6 +66,7 @@
import
XhCheckbox
from
'@/components/createCom/XhCheckbox.vue'
import
XhSelect
from
'@/components/createCom/XhSelect.vue'
import
XhFiles
from
'@/components/createCom/XhFiles.vue'
import
XhLocation
from
'@/components/createCom/XhLocation.vue'
// import XhRadio from '@/components/createCom/XhRadio.vue'
export
default
{
data
()
{
...
...
@@ -114,7 +119,8 @@
XhRadio
,
XhCheckbox
,
XhSelect
,
XhFiles
XhFiles
,
XhLocation
// formCom
},
created
()
{
...
...
@@ -149,7 +155,17 @@
// 下一步
console
.
log
(
item
,
'item'
)
},
fieldTypeStatus
(
type
){
let
typeArr
=
[
'input'
,
'radio'
,
'checkbox'
,
'select'
,
'file'
]
let
fieldsType
=
type
.
toLocaleLowerCase
()
let
flag
=
false
flag
=
typeArr
.
indexOf
(
fieldsType
)
>=
0
return
flag
},
toLowerCase
(
str
){
str
=
str
||
''
return
str
.
toLocaleLowerCase
()
},
// ------------------------- 以下方法为展示滚动切换 -------------------------
// 点击左边的栏目切换
async
swichMenu
(
index
)
{
...
...
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