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
72eccfed
Commit
72eccfed
authored
Aug 16, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 收货地址-交互
parent
c4649082
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
133 additions
and
19 deletions
+133
-19
XhParts.vue
src/components/createCom/XhParts.vue
+1
-1
w-address.vue
src/components/w-address/w-address.vue
+21
-7
index.vue
src/pages/mine/address/index.vue
+94
-9
application.vue
src/pages/parts/application.vue
+17
-2
No files found.
src/components/createCom/XhParts.vue
View file @
72eccfed
...
@@ -95,7 +95,7 @@ export default {
...
@@ -95,7 +95,7 @@ export default {
},
},
partsChange
(
val
,
index
)
{
partsChange
(
val
,
index
)
{
this
.
$set
(
this
.
lists
[
index
],
'quantity'
,
val
)
this
.
$set
(
this
.
lists
[
index
],
'quantity'
,
val
)
this
.
valueChange
(
this
.
lists
)
this
.
valueChange
(
JSON
.
stringify
(
this
.
lists
)
)
},
},
minusValue
(
val
,
index
)
{
minusValue
(
val
,
index
)
{
if
(
val
===
0
)
{
if
(
val
===
0
)
{
...
...
src/components/w-address/w-address.vue
View file @
72eccfed
<
template
>
<
template
>
<view
class=
"item"
@
click=
"$u.throttle(editSite, 500)"
>
<view
class=
"item"
>
<view
class=
"userinfo u-flex"
>
<view
class=
"userinfo u-flex"
@
click=
"$u.throttle(selectSite, 500)"
>
<view
class=
"name"
>
{{
formatName
}}
</view>
<view
class=
"name"
>
{{
formatName
}}
</view>
<view
class=
"mobile"
>
{{
formatMobile
}}
</view>
<view
class=
"mobile"
>
{{
formatMobile
}}
</view>
</view>
</view>
<view
class=
"siteinfo u-flex u-row-between u-col-top"
>
<view
class=
"siteinfo u-flex u-row-between u-col-top"
>
<view
class=
"txt"
>
{{
formatAddress
}}
</view>
<view
class=
"txt"
@
click=
"$u.throttle(selectSite, 500)"
>
{{
formatAddress
}}
</view>
<u-icon
custom-prefix=
"wxh"
name=
"pen"
size=
"32"
></u-icon>
<u-icon
custom-prefix=
"wxh"
name=
"pen"
size=
"32"
@
click=
"$u.throttle(editSite, 500)"
></u-icon>
</view>
</view>
<view
class=
"default"
v-show=
"isDefault"
>
<view
class=
"u-flex u-row-between default"
v-show=
"isDefault"
>
<u-icon
name=
"checkmark-circle"
color=
"#2272FF"
size=
"32"
></u-icon>
<view
@
click=
"$u.throttle(setDefault, 500)"
>
<text
class=
"txt"
>
默认地址
</text>
<u-icon
name=
"checkmark-circle"
color=
"#2272FF"
size=
"32"
></u-icon>
<text
class=
"txt"
>
默认地址
</text>
</view>
<view
@
click=
"$u.throttle(remove, 500)"
>
<text
class=
"txt"
>
删除
</text>
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -84,9 +89,18 @@ export default {
...
@@ -84,9 +89,18 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
selectSite
()
{
this
.
$emit
(
'select-site'
,
this
.
info
)
},
editSite
()
{
editSite
()
{
this
.
$emit
(
'edit-site'
,
this
.
info
)
this
.
$emit
(
'edit-site'
,
this
.
info
)
},
},
setDefault
()
{
this
.
$emit
(
'set-default'
,
this
.
info
)
},
remove
()
{
this
.
$emit
(
'remove'
,
this
.
info
)
}
}
}
};
};
</
script
>
</
script
>
...
...
src/pages/mine/address/index.vue
View file @
72eccfed
<
template
>
<
template
>
<view
class=
"address-wrap"
>
<view
class=
"
u-flex
address-wrap"
>
<w-navbar
title=
"收货地址"
></w-navbar>
<w-navbar
title=
"收货地址"
></w-navbar>
<view
class=
"body"
v-if=
"hasAdderss"
>
<view
class=
"lists"
>
<w-address
@
editSite=
"toAddSite"
:info=
"info"
:is-default=
"true"
/>
<view
class=
"body"
>
<w-address
@
editSite=
"toEditSite"
@
selectSite=
"selectSite"
@
setDefault=
"setDefault"
@
remove=
"remove"
:info=
"info"
:is-default=
"true"
/>
</view>
</view>
<view
class=
"addSite"
@
tap=
"toAddSite"
>
<view
class=
"add"
>
新建收货地址
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -21,6 +29,7 @@ export default {
...
@@ -21,6 +29,7 @@ export default {
address
:
''
,
address
:
''
,
region
:
[],
region
:
[],
},
},
type
:
''
};
};
},
},
computed
:
{
computed
:
{
...
@@ -37,9 +46,17 @@ export default {
...
@@ -37,9 +46,17 @@ export default {
address
:
this
.
address
,
address
:
this
.
address
,
region
:
this
.
region
||
[],
region
:
this
.
region
||
[],
}
}
},
submitBtn
()
{
return
{
color
:
'#FFFFFF'
,
backgroundColor
:
'#2272FF'
}
}
}
},
},
onLoad
()
{
onLoad
(
options
)
{
if
(
options
)
this
.
type
=
options
.
type
getApp
().
trackPage
(
'我的收获地址页'
)
getApp
().
trackPage
(
'我的收获地址页'
)
},
},
onShow
()
{
onShow
()
{
...
@@ -69,16 +86,57 @@ export default {
...
@@ -69,16 +86,57 @@ export default {
}
}
})
})
},
},
toAddSite
(
title
){
toAddSite
()
{
const
region
=
this
.
info
.
region
.
join
(
'-'
)
this
.
$u
.
route
({
url
:
'pages/mine/address/addSite'
,
params
:
{
type
:
'add'
}
})
},
setDefault
(
val
)
{
console
.
log
(
"val"
,
val
)
},
remove
(
val
)
{
uni
.
showModal
({
title
:
'温馨提示'
,
content
:
'确定要删除该收货地址?'
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
console
.
log
(
"delete"
)
}
}
})
},
selectSite
(
val
)
{
if
(
this
.
type
===
'parts'
)
{
let
pages
=
getCurrentPages
();
let
prevPage
=
pages
[
pages
.
length
-
2
];
//上一个页面
let
address
=
val
.
region
.
join
(
""
)
+
val
.
address
let
site
=
{
name
:
val
.
name
,
mobile
:
val
.
mobile
,
address
:
address
,
region
:
val
.
region
}
prevPage
.
$vm
.
updateSite
(
site
)
this
.
$u
.
route
({
type
:
'back'
})
}
else
{
this
.
toEditSite
(
val
)
}
},
toEditSite
(
val
){
const
region
=
val
.
region
.
join
(
'-'
)
this
.
$u
.
route
({
this
.
$u
.
route
({
url
:
'pages/mine/address/addSite'
,
url
:
'pages/mine/address/addSite'
,
params
:
{
params
:
{
type
:
'edit'
,
type
:
'edit'
,
region
:
region
,
region
:
region
,
name
:
this
.
info
.
name
,
name
:
val
.
name
,
mobile
:
this
.
info
.
mobile
,
mobile
:
val
.
mobile
,
address
:
this
.
info
.
address
,
address
:
val
.
address
,
}
}
})
})
}
}
...
@@ -89,6 +147,13 @@ export default {
...
@@ -89,6 +147,13 @@ export default {
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.address-wrap
{
.address-wrap
{
background-color
:
#F4F5F7
;
background-color
:
#F4F5F7
;
flex-direction
:column
;
height
:
100vh
;
.lists
{
width
:
100%
;
flex
:
1
;
overflow-y
:auto
;
}
}
}
.body
{
.body
{
padding
:
30rpx
;
padding
:
30rpx
;
...
@@ -96,4 +161,24 @@ export default {
...
@@ -96,4 +161,24 @@ export default {
border-radius
:
12rpx
;
border-radius
:
12rpx
;
background-color
:
#FFFFFF
;
background-color
:
#FFFFFF
;
}
}
.addSite
{
display
:
flex
;
justify-content
:
space-around
;
width
:
600rpx
;
height
:
100rpx
;
line-height
:
100rpx
;
margin
:
50rpx
0
;
background-color
:
#2272FF
;
border-radius
:
60rpx
;
font-size
:
30rpx
;
.add
{
display
:
flex
;
align-items
:
center
;
color
:
#ffffff
;
.icon
{
margin-right
:
10rpx
;
}
}
}
</
style
>
</
style
>
src/pages/parts/application.vue
View file @
72eccfed
...
@@ -35,9 +35,12 @@
...
@@ -35,9 +35,12 @@
</view>
</view>
</view>
</view>
<view
class=
"card address"
>
<view
class=
"card address"
>
<view
class=
"title"
>
收件信息
</view>
<view
class=
"u-flex u-row-between"
>
<view
class=
"title"
>
收件信息
</view>
<view
class=
"more"
@
click=
"toAddress"
>
更多地址>
</view>
</view>
<view
class=
"body"
>
<view
class=
"body"
>
<w-address
:info=
"addressInfo"
@
editSite=
"editSite"
/>
<w-address
:info=
"addressInfo"
@
editSite=
"editSite"
@
selectSite=
"editSite"
/>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -140,6 +143,14 @@ export default {
...
@@ -140,6 +143,14 @@ export default {
}
}
})
})
},
},
toAddress
()
{
this
.
$u
.
route
({
url
:
"pages/mine/address/index"
,
params
:
{
type
:
'parts'
}
})
},
updateSite
(
site
)
{
updateSite
(
site
)
{
this
.
addressInfo
=
site
this
.
addressInfo
=
site
},
},
...
@@ -296,6 +307,10 @@ export default {
...
@@ -296,6 +307,10 @@ export default {
font-weight
:
bold
;
font-weight
:
bold
;
color
:
#333333
;
color
:
#333333
;
}
}
.more
{
color
:
#2272FF
;
font-size
:
28rpx
;
}
.body
{
.body
{
.list
{
.list
{
.sold-out
{
.sold-out
{
...
...
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