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
555741c7
Commit
555741c7
authored
May 19, 2020
by
zhangjianguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人中心页面和收货地址的初始页面
parent
2190ac56
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
417 additions
and
29 deletions
+417
-29
address.vue
pages/address/address.vue
+159
-0
cart.vue
pages/cart/cart.vue
+2
-6
user-center.vue
pages/user-center/user-center.vue
+256
-23
No files found.
pages/address/address.vue
0 → 100644
View file @
555741c7
<
template
>
<view
class=
"addressStyle"
v-if=
"!isloading"
:style=
"
{'height':contentHeight}">
<scroll-view
:scroll-y=
"true"
:enable-back-to-top=
"true"
:enable-flex=
"true"
:style=
"
{ height: '100%' }">
<view
v-for=
"(item, index) in list"
:key=
"index"
class=
"addresbox"
>
<view
class=
"addresclo"
>
<Text>
收件人:
{{
item
.
name
}}
</Text>
<Text>
{{
item
.
mobile
}}
</Text>
</view>
<Text>
收货地址:
{{
item
.
address
}}
</Text>
<view
style=
"width: 100%;height: 2rpx;background: #EEEEEE;margin-top: 15rpx;"
></view>
<view
class=
"addresclo"
>
<u-checkbox-group
@
change=
'isdefault(item)'
>
<u-checkbox
v-model=
"item.is_default==1?true:false"
shape=
"circle"
active-color=
"red"
>
{{
item
.
is_default
==
1
?
'已设为默认'
:
'设为默认'
}}
</u-checkbox>
</u-checkbox-group>
<view
style=
"display: flex;flex-direction: row;"
>
<view>
<van-icon
name=
"chat"
color=
"red"
/>
</view>
</view>
</view>
</view>
</scroll-view>
<!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
-->
</view>
</
template
>
<
script
>
import
auth
from
"../../components/auth/index.vue"
;
export
default
{
data
()
{
return
{
loading
:
true
,
list
:
[],
showAuth
:
false
,
u
:
{},
contentHeight
:
0
}
},
components
:{
auth
},
created
(){
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
'px'
;
},
onLoad
(){
this
.
u
=
wx
.
getStorageSync
(
"userinfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
};
this
.
showAuth
=
true
;
}
},
methods
:
{
init
(){
this
.
loading
=
false
;
uni
.
showNavigationBarLoading
();
this
.
request
(
{
url
:
""
,
header
:{
'X-Access-Token'
:
'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ'
,
'X-App-Platform'
:
'wxapp'
,
'X-App-Version'
:
'4.2.47'
,
'X-Form-Id-List'
:
JSON
.
stringify
([]),
'X-Requested-With'
:
'XMLHttpRequest'
,
'X-User-Id'
:
21269
},
data
:
{
r
:
"api/user/address"
,
},
},
(
res
)
=>
{
uni
.
hideNavigationBarLoading
()
this
.
isloading
=
false
;
this
.
list
=
res
.
data
.
list
}
);
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"userinfo"
);
this
.
showAuth
=
false
},
isdefault
(
item
){
//默认地址
uni
.
showNavigationBarLoading
();
this
.
request
(
{
url
:
""
,
method
:
"POST"
,
header
:{
'content-type'
:
'application/x-www-form-urlencoded'
,
'X-Access-Token'
:
'Tc8G75W5llGY_UPwlHBscYEPs1a32cDJ'
,
'X-App-Platform'
:
'wxapp'
,
'X-App-Version'
:
'4.2.47'
,
'X-Form-Id-List'
:
JSON
.
stringify
([{
"value"
:
"873015dc76a242cc8c7ae1c25cdbdf4c"
,
"type"
:
0
,
"remains"
:
1
,
"expires_at"
:
"2020-05-25 19:03:25"
}]),
'X-Requested-With'
:
'XMLHttpRequest'
,
'X-User-Id'
:
21269
,
},
data
:
{
r
:
"api/user/address-default"
,
id
:
item
.
id
,
is_default
:
item
.
is_default
==
1
?
0
:
1
,
},
},
(
res
)
=>
{
this
.
init
()
uni
.
hideNavigationBarLoading
()
}
);
},
},
mounted
(){
this
.
init
();
}
}
</
script
>
<
style
>
.addressStyle
{
background
:
#f3f4f6
;
}
.addressStyle
.addresbox
{
width
:
94%
;
margin-left
:
3%
;
border-radius
:
10
rpx
;
background
:
#fff
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
space-around
;
padding
:
0
20
rpx
;
margin-top
:
30
rpx
;
}
.addressStyle
.addresclo
{
display
:
flex
;
flex-direction
:
row
;
width
:
100%
;
padding
:
20
rpx
0
;
align-items
:
center
;
justify-content
:
space-between
;
}
</
style
>
pages/cart/cart.vue
View file @
555741c7
...
...
@@ -6,12 +6,8 @@
<Text
@
click=
'edit'
v-if=
'editType==true'
class=
'grid-text_r'
>
完成
</Text>
</view>
<view
style=
"width: 100%;height: 30rpx;background: #F7F7F7;margin: 20rpx 0;"
></view>
<view
v-if=
"list.length==0"
style=
"width: 100%;height: 400rpx;display: flex;flex-direction: column;justify-content: center;align-items: center;"
>
<view
style=
"width: 180rpx;height: 180rpx;border-radius: 50%;background: #DFDFE9;display: flex;align-items: center;justify-content: center;"
>
<image
src=
'../../static/images/icon/Shopping.png'
style=
'width:60rpx ;height: 60rpx;'
></image>
</view>
<Text
style=
'margin-top: 20rpx;color: #939393;'
>
购物车还是空的哦
</Text>
</view>
<u-empty
v-if=
"list.length==0"
text=
"购物车还是空的哦"
mode=
"car"
></u-empty>
<view
style=
"padding: 25rpx;border-bottom: 1rpx solid #E4E4E4;"
v-if=
"list.length>0"
>
<u-checkbox-group
@
change=
'SelectAll'
>
<u-checkbox
v-model=
"allchecked"
shape=
"circle"
active-color=
"red"
>
赞羊严选
</u-checkbox>
...
...
pages/user-center/user-center.vue
View file @
555741c7
This diff is collapsed.
Click to expand it.
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