Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
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
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
9009778b
Commit
9009778b
authored
Aug 09, 2024
by
刘玉宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adderss
parent
b490ef64
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
32 deletions
+72
-32
address.js
src/api/address.js
+37
-0
addressEdit.vue
src/pages/address/addressEdit.vue
+3
-3
addressList.vue
src/pages/address/addressList.vue
+32
-29
No files found.
src/api/address.js
0 → 100644
View file @
9009778b
import
{
request
}
from
'../utils/request'
;
export
function
groupBuyList
()
{
return
request
({
url
:
'/sgyrdd/category/groupBuyList'
,
method
:
'GET'
,
});
}
// 新增收货地址
export
async
function
addAddress
()
{
return
request
({
url
:
'/sgyrdd/useraddr/add'
,
method
:
'GET'
,
});
}
// 修改收货地址
export
async
function
updateAddress
()
{
return
request
({
url
:
'/sgyrdd/useraddr/update'
,
method
:
'GET'
,
});
}
// 删除收货地址
export
async
function
deleteAddress
(
addrId
)
{
return
request
({
url
:
`/sgyrdd/useraddr/delete/
${
addrId
}
`
,
method
:
'GET'
,
});
}
// 查询收货地址列表
export
async
function
getAddressList
()
{
return
request
({
url
:
'/sgyrdd/useraddr/list'
,
method
:
'GET'
,
});
}
src/pages/address/addressEdit.vue
View file @
9009778b
...
...
@@ -108,10 +108,10 @@ function fieldNotEmpty(val) {
return
false
;
}
}
const
submit
=
async
()
=>
{
const
res
=
await
addAddress
(
model
.
value
);
const
submit
=
async
()
=>
{
const
res
=
await
addAddress
(
model
.
value
);
console
.
log
(
res
);
}
}
;
function
handleSubmit
()
{
form
.
value
.
validate
()
...
...
src/pages/address/addressList.vue
View file @
9009778b
...
...
@@ -7,41 +7,21 @@
<img
src=
"@/static/address/address.png"
/>
<wd-button
type=
"error"
block
class=
"addBtn"
@
tap=
"addNewAddress"
>
新增地址
</wd-button>
</view>
<view
class=
"full_list"
v-else
>
<view
class=
"additem"
>
<view
class=
"additem_l"
>
<view
class=
"address"
>
这是地址这是地址这是地址这是地址这是地 址这是地址这是地址
</view>
<view
class=
"info"
>
<view
class=
"name"
>
这是姓名
</view>
<view
class=
"phone"
>
123456789258
</view>
</view>
<view
class=
"address_status"
>
<view
v-if=
"mainAddFlag"
class=
"box active"
>
<wd-icon
name=
"check-circle-filled"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
默认
</view>
</view>
<view
v-else
class=
"box"
>
<wd-icon
name=
"circle1"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
默认
</view>
</view>
</view>
</view>
<view
class=
"additem_r"
>
<wd-icon
name=
"edit-outline"
size=
"14px"
@
tap=
"editAddress"
></wd-icon>
</view>
</view>
<view
class=
"additem"
>
<view
class=
"additem"
v-for=
"(item, index) in addressList"
:key=
"index"
>
<view
class=
"additem_l"
>
<view
class=
"address"
>
这是地址这是地址这是地址这是地址这是地 址这是地址这是地址
</view>
<view
class=
"address"
>
{{
item
.
addr
}}
</view>
<view
class=
"info"
>
<view
class=
"name"
>
这是姓名
</view>
<view
class=
"phone"
>
123456789258
</view>
<view
class=
"name"
>
{{
item
.
receiver
}}
</view>
<view
class=
"phone"
>
{{
item
.
mobile
}}
</view>
</view>
<view
class=
"address_status"
>
<view
v-if=
"
mainAddFlag
"
class=
"box active"
>
<view
v-if=
"
item.commonAddr === 1
"
class=
"box active"
>
<wd-icon
name=
"check-circle-filled"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
默认
</view>
</view>
<view
v-else
class=
"box"
>
<wd-icon
name=
"circle1"
size=
"12px"
></wd-icon>
<view
class=
"txt"
>
默认
</view>
...
...
@@ -52,6 +32,7 @@
<wd-icon
name=
"edit-outline"
size=
"14px"
@
tap=
"editAddress"
></wd-icon>
</view>
</view>
<wd-button
type=
"error"
block
class=
"addBtn"
@
tap=
"addNewAddress"
>
新增地址
</wd-button>
</view>
</view>
...
...
@@ -60,9 +41,23 @@
<
script
setup
>
import
Header
from
'@/pages/order/components/Header/index.vue'
;
const
fileDomain
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
import
{
getAddressList
,
deleteAddress
}
from
'@/api/address'
;
const
isAdressEmpty
=
ref
(
false
);
const
mainAddFlag
=
ref
(
false
);
const
addressList
=
ref
([]);
const
getAddressListData
=
async
()
=>
{
const
{
data
:
res
}
=
await
getAddressList
();
console
.
log
(
res
);
if
(
res
)
{
addressList
.
value
=
res
;
res
.
length
===
0
?
(
isAdressEmpty
.
value
=
true
)
:
(
isAdressEmpty
.
value
=
false
);
}
};
getAddressListData
();
const
addNewAddress
=
()
=>
{
xma
.
navigateTo
({
url
:
'/pages/address/addressEdit?new=true'
});
...
...
@@ -97,6 +92,7 @@ page {
.full_list
{
margin-top
:
20rpx
;
.additem
{
width
:
710rpx
;
padding
:
20rpx
;
...
...
@@ -109,17 +105,20 @@ page {
font-family
:
Source
Han
Sans
;
font-variation-settings
:
'opsz'
auto
;
font-feature-settings
:
'kern'
on
;
.additem_l
{
width
:
600rpx
;
display
:
flex
;
flex-direction
:
column
;
}
.additem_r
{
flex
:
1
;
padding-top
:
30rpx
;
box-sizing
:
border-box
;
text-align
:
right
;
}
.address
{
font-size
:
24rpx
;
font-weight
:
500
;
...
...
@@ -136,6 +135,7 @@ page {
color
:
#abaaaa
;
display
:
flex
;
margin-bottom
:
30rpx
;
.phone
{
margin-left
:
10rpx
;
}
...
...
@@ -146,11 +146,13 @@ page {
display
:
flex
;
font-size
:
18rpx
;
align-items
:
center
;
.txt
{
margin-left
:
5rpx
;
color
:
#abaaaa
;
}
}
.box.active
{
color
:
#fa5151
;
}
...
...
@@ -172,12 +174,13 @@ page {
.empty_list
{
margin-top
:
20rpx
;
img
{
width
:
566rpx
;
height
:
566rpx
;
margin
:
40rpx
auto
60rpx
;
display
:
block
;
border
:
1px
dashed
rgb
(
182
,
182
,
182
);
//
border: 1px dashed rgb(182, 182, 182);
}
.addBtn
{
...
...
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