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
8068963f
Commit
8068963f
authored
May 21, 2020
by
zhangjianguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地区和我的收藏
parent
07d296de
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
583 additions
and
29 deletions
+583
-29
pages.json
pages.json
+14
-6
AddAddress.vue
pages/address/AddAddress.vue
+115
-0
address.vue
pages/address/address.vue
+112
-19
favorite.vue
pages/favorite/favorite.vue
+223
-0
index.vue
pages/foot/index/index.vue
+115
-0
user-center.vue
pages/user-center/user-center.vue
+4
-4
No files found.
pages.json
View file @
8068963f
...
...
@@ -6,9 +6,19 @@
{
"path"
:
"pages/index/index"
},
{
"path"
:
"pages/foot/index/index"
},
{
"path"
:
"pages/user-center/user-center"
},
{
"path"
:
"pages/favorite/favorite"
},
{
"path"
:
"pages/address/address"
},
{
"path"
:
"pages/cart/cart"
},
...
...
@@ -19,17 +29,15 @@
{
"path"
:
"pages/goods/goods"
},
{
"path"
:
"pages/address/AddAddress"
},
{
"path"
:
"pages/webbox/webbox"
},
{
"path"
:
"pages/goods/list"
},
{
"path"
:
"pages/address/address"
}
}
],
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
...
...
pages/address/AddAddress.vue
0 → 100644
View file @
8068963f
<
template
>
<view
class=
"AddaddressStyle"
:style=
"
{'height':contentHeight}">
<view
class=
"top"
>
<input
class=
"uni-input"
placeholder=
"自动获得焦点"
style=
"width: 70%;"
/>
<view
style=
"display: flex;align-items: center;justify-content: center;border: 1px solid #F4AAA6;width:160rpx ;height: 60rpx;"
>
<Text
style=
'color: #EA5A22;'
>
自动识别
</Text>
</view>
</view>
<view
class=
"addcenter"
>
<u-field
v-model=
"mobile"
label=
"收货人"
>
</u-field>
<view
style=
"width: 100%;height: 1px;background: #e4e7ed;"
/>
<u-field
v-model=
"mobile"
label=
"联系电话"
>
</u-field>
<view
style=
"width: 100%;height: 1px;background: #e4e7ed;"
/>
<view
class=
"addcenter_item"
>
<Text>
所在地区
</Text>
<view
style=
"display: flex;flex-direction: row;align-items: center;"
>
<Text
:style=
"
{'color':msg.address!=''? '#303133':'#9D9C9B'}">
{{
msg
.
address
!=
''
?
msg
.
address
:
'请选择'
}}
</Text>
<u-icon
name=
"arrow"
color=
"#B2B2B2"
size=
"30"
></u-icon>
</view>
</view>
<view
style=
"width: 100%;height: 1px;background: #e4e7ed;"
/>
<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: #e4e7ed;"
/>
<u-field
v-model=
"mobile"
label=
"详细地址"
>
</u-field>
</view>
<view
class=
"btn"
@
click=
"preserve"
>
<Text>
保存地址
</Text>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
(){
return
{
contentHeight
:
0
,
msg
:{
address
:
''
}
}
},
created
(){
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
'px'
;
},
methods
:{
preserve
(){
}
}
}
</
script
>
<
style
>
.AddaddressStyle
{
background
:
#f3f4f6
;
}
.AddaddressStyle
.top
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-between
;
padding
:
20
rpx
;
background
:
#fff
;
}
.AddaddressStyle
.addcenter
{
margin-top
:
40
rpx
;
background
:
#FFFFFF
;
}
.AddaddressStyle
.addcenter_item
{
width
:
100%
;
padding
:
20
rpx
28
rpx
;
color
:
#303133
;
font-size
:
28
rpx
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-between
;
}
.AddaddressStyle
.btn
{
width
:
94%
;
height
:
80
rpx
;
background
:
#EA554D
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
color
:
#fff
;
margin-left
:
3%
;
margin-top
:
46
rpx
;
border-radius
:
40
rpx
;
}
</
style
>
pages/address/address.vue
View file @
8068963f
...
...
@@ -14,16 +14,40 @@
<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
v-model=
"item.is_default==1?true:false"
shape=
"circle"
active-color=
"red"
>
<Text
:style=
"
{'color':item.is_default==1?'#F43F3B':'#c8c9cc' }">
{{
item
.
is_default
==
1
?
'已设为默认'
:
'设为默认'
}}
</Text>
</u-checkbox>
</u-checkbox-group>
<view
style=
"display: flex;flex-direction: row;"
>
<view>
<van-icon
name=
"chat"
color=
"red"
/>
<view
style=
"display: flex;flex-direction: row;align-items: center;"
>
<view
style=
"display: flex;flex-direction: row;align-items: center;"
@
click=
"btn_edit()"
>
<u-icon
name=
"edit"
color=
"#c8c9cc"
size=
"40"
></u-icon>
<Text
style=
'color:#c8c9cc;'
>
编辑
</Text>
</view>
<view
style=
"display: flex;flex-direction: row;align-items: center;margin: 0 30rpx"
@
click=
"btn_delete(item)"
>
<u-icon
name=
"delete"
color=
"#c8c9cc"
size=
"40"
></u-icon>
<Text
style=
'color:#c8c9cc;'
>
删除
</Text>
</view>
</view>
</view>
</view>
<view
class=
"bottom_btn"
>
<view
class=
"bottom_btn_item"
style=
"background: #EA554D;"
@
click=
"ManualAdd"
>
<u-icon
name=
"add-o"
color=
"#fff"
size=
"30"
></u-icon>
<Text
style=
'color:#fff;margin-left: 10rpx;'
>
手动添加
</Text>
</view>
<view
class=
"bottom_btn_item"
style=
"background: #5CBF39;"
@
click=
"automatic"
>
<u-icon
name=
"location"
color=
"#fff"
size=
"30"
></u-icon>
<Text
style=
'color:#fff;margin-left: 10rpx'
>
自动获取
</Text>
</view>
</view>
</scroll-view>
<!-- 删除的弹框 -->
<u-modal
v-model=
"showModal"
content=
"确实删除收货地址"
:show-cancel-button=
'true'
:show-title=
'false'
@
confirm=
"confirm"
></u-modal>
<u-toast
ref=
"uToast"
/>
<!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
-->
</view>
...
...
@@ -40,7 +64,9 @@
list
:
[],
showAuth
:
false
,
u
:
{},
contentHeight
:
0
contentHeight
:
0
,
showModal
:
false
,
deleteID
:
0
,
}
},
components
:{
...
...
@@ -50,7 +76,7 @@
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
'px'
;
},
onLoad
(){
console
.
log
(
wx
.
getStorageSync
(
"basedata"
))
this
.
u
=
wx
.
getStorageSync
(
"userinfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
...
...
@@ -63,19 +89,19 @@
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
},
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"
,
},
...
...
@@ -123,6 +149,54 @@
}
);
},
btn_edit
(){
},
btn_delete
(
item
){
this
.
deleteID
=
item
.
id
this
.
showModal
=
true
;
},
confirm
(){
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-destroy"
,
id
:
this
.
deleteID
,
},
},
(
res
)
=>
{
this
.
init
()
uni
.
hideNavigationBarLoading
()
}
);
},
automatic
(){
this
.
$refs
.
uToast
.
show
({
title
:
'暂无开发此功能'
,
})
},
ManualAdd
(){
//手动添加
uni
.
navigateTo
({
url
:
'/pages/address/AddAddress'
})
}
},
mounted
(){
...
...
@@ -156,4 +230,23 @@
align-items
:
center
;
justify-content
:
space-between
;
}
.addressStyle
.bottom_btn
{
width
:
94%
;
height
:
90
rpx
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-between
;
margin-left
:
3%
;
margin-top
:
30
rpx
;
}
.addressStyle
.bottom_btn
.bottom_btn_item
{
width
:
48%
;
height
:
80
rpx
;
border-radius
:
40
rpx
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
}
</
style
>
pages/favorite/favorite.vue
0 → 100644
View file @
8068963f
<
template
>
<view
class=
"favoriteStyle"
:style=
"
{'height':contentHeight}" v-if="!isloading">
<u-tabs
:list=
"list"
:is-scroll=
"false"
:current=
"current"
@
change=
"change"
active-color=
'#fa3534'
></u-tabs>
<template>
<view
v-show=
"current==0"
style=
"
height: calc(100vh - 50px);
width: calc(100vw - 20px);
margin-left: 10px;
overflow: hidden;
padding-top: 10px;
"
>
<scroll-view
:scroll-y=
"true"
:enable-back-to-top=
"true"
:enable-flex=
"true"
style=
"height: 100%; padding-bottom: 0px;"
>
<view
class=
"u-good-list"
>
<u-row
gutter=
"20"
>
<u-col
span=
"6"
v-for=
"(cx, ci) in goodslist"
:key=
"ci"
>
<view
class=
"good"
@
click=
"clickHandler(cx.goods.page_url)"
>
<view
class=
"good-img"
>
<image
mode=
"aspectFit"
:src=
"cx.goods.cover_pic"
style=
"width: 100%; height: 100%;"
/>
</view>
<view
class=
"good-name"
>
{{
cx
.
goods
.
name
}}
</view>
<view
class=
"good-info"
>
<view
class=
"price"
:style=
"
{ color: mainColor }">
{{
cx
.
goods
.
price_content
}}
</view>
<view
class=
"sell"
>
{{
cx
.
goods
.
sales
}}
</view>
<view
class=
"cart"
>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
/>
</view>
</view>
</view>
</u-col>
</u-row>
</view>
</scroll-view>
<u-empty
v-if=
"current==0&& goodslist.length==0"
text=
"没有任何收藏商品哦~"
mode=
"favor"
></u-empty>
</view>
<view
v-show=
"current==1"
style=
"
height: calc(100vh - 50px);
width: calc(100vw - 20px);
margin-left: 10px;
overflow: hidden;
padding-top: 10px;
"
>
<u-empty
v-if=
"current==1&& topiclist.length==0"
text=
"没有任何收藏主题哦~"
mode=
"favor"
></u-empty>
</view>
</
template
>
<!-- <auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth> -->
</view>
</template>
<
script
>
import
auth
from
"../../components/auth/index.vue"
;
export
default
{
data
()
{
return
{
loading
:
true
,
contentHeight
:
0
,
showAuth
:
false
,
list
:[
{
name
:
'商品'
},
{
name
:
'专题'
},
],
goodslist
:[],
topiclist
:[],
current
:
0
}
},
components
:{
auth
,
},
created
(){
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
'px'
;
this
.
init
()
},
onLoad
(){
this
.
u
=
wx
.
getStorageSync
(
"userinfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
};
this
.
showAuth
=
true
;
}
},
methods
:
{
change
(
index
)
{
this
.
current
=
index
;
if
(
index
==
1
){
// this.gettopic()
}
else
{
this
.
init
()
}
},
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/my-favorite-goods"
,
},
},
(
res
)
=>
{
uni
.
hideNavigationBarLoading
()
this
.
isloading
=
false
;
this
.
goodslist
=
res
.
data
.
list
}
);
},
gettopic
(){
//专题数据
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/my-favorite-topic"
,
},
},
(
res
)
=>
{
uni
.
hideNavigationBarLoading
()
this
.
isloading
=
false
;
this
.
topiclist
=
res
.
data
.
list
}
);
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"userinfo"
);
this
.
showAuth
=
false
},
clickHandler
(
url
)
{
uni
.
navigateTo
({
url
:
url
,
});
},
}
}
</
script
>
<
style
>
.favoriteStyle
{
background
:
#f3f4f6
;
}
.favoriteStyle
.u-good-list
.good
{
background
:
#fff
;
border-radius
:
10px
;
overflow
:
hidden
;
margin-bottom
:
10px
;
}
.favoriteStyle
.u-good-list
.good
.good-img
{
width
:
calc
(
50vw
-
15px
);
height
:
calc
(
50vw
-
15px
);
display
:
block
;
}
.favoriteStyle
.u-good-list
.good
.good-name
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
margin-bottom
:
3px
;
font-size
:
13px
;
margin
:
7px
10px
;
}
.favoriteStyle
.u-good-list
.good
.good-info
{
display
:
flex
;
margin
:
7px
10px
;
margin-top
:
0
;
align-items
:
flex-end
;
padding-bottom
:
5px
;
}
.favoriteStyle
.u-good-list
.good
.good-info
.price
{
font-size
:
14px
;
color
:
#ff4544
;
flex
:
1
;
}
.favoriteStyle
.u-good-list
.good
.good-info
.sell
{
font-size
:
11px
;
color
:
gray
;
flex
:
1
;
}
.favoriteStyle
.u-good-list
.good
.good-info
.cart
{
width
:
40
rpx
;
text-align
:
right
;
}
</
style
>
pages/foot/index/index.vue
0 → 100644
View file @
8068963f
<
template
>
<view
class=
"footStyle"
:style=
"
{'height':contentHeight}">
<view
class=
"footTop"
>
<view
class=
"footTop_c"
>
<view
class=
"footTop_item"
style=
"background: #EA554D;"
>
<Text
style=
'color: #fff;'
>
浏览记录
</Text>
</view>
<view
class=
"footTop_item"
@
click=
"billsummary"
>
<Text
style=
'color: #EA554D;'
>
账单总结
</Text>
</view>
</view>
<view
class=
"footTop_content"
>
</view>
</view>
<!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
-->
<view
class=
"loading"
v-show=
"loading"
>
<u-loading
mode=
"flower"
size=
"48"
>
>
</u-loading>
<Text
style=
'color: #fff;margin-top: 10rpx;'
>
加载中...
</Text>
</view>
</view>
</
template
>
<
script
>
import
auth
from
"../../../components/auth/index.vue"
;
export
default
{
data
()
{
return
{
isloading
:
true
,
loading
:
false
,
showAuth
:
false
,
contentHeight
:
0
,
list
:[
{
name
:
'浏览记录'
},
{
name
:
'账单总结'
},
]
}
},
components
:{
auth
},
created
(){
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
'px'
;
console
.
log
(
this
.
contentHeight
)
},
onLoad
(){
console
.
log
(
wx
.
getStorageSync
(
"basedata"
))
this
.
u
=
wx
.
getStorageSync
(
"userinfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
};
this
.
showAuth
=
true
;
}
},
methods
:
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"userinfo"
);
this
.
showAuth
=
false
},
billsummary
(){
console
.
log
(
'跳转菜单总结'
)
}
}
}
</
script
>
<
style
>
.footStyle
{
background
:
#f3f4f6
;
}
.footStyle
.footTop
{
width
:
100%
;
padding
:
20
rpx
10%
;
background
:
#fff
;
}
.footStyle
.footTop_c
{
width
:
100%
;
height
:
70
rpx
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
border-radius
:
35
rpx
;
border
:
1px
solid
#EA554D
;
}
.footStyle
.footTop_item
{
width
:
100%
;
height
:
70
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
border-radius
:
35
rpx
;
}
.loading
{
width
:
200
rpx
;
height
:
200
rpx
;
background
:
#000000
;
opacity
:
0.7
;
border-radius
:
10
rpx
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
position
:
relative
;
left
:
50%
;
top
:
30%
;
margin-left
:
-100
rpx
;
z-index
:
999
;
}
.footStyle
.footTop_content
{
width
:
100%
;
}
</
style
>
pages/user-center/user-center.vue
View file @
8068963f
...
...
@@ -11,12 +11,12 @@
<Text
style=
"color: #FFF;margin-left: 20rpx;font-size: 36rpx;"
@
click=
'login(user_info)'
>
{{
user_info
.
nickname
?
user_info
.
nickname
:
'立即登录'
}}
</Text>
</view>
<view
class=
"ReceiptAdder"
@
click=
"goUrl('/pages/address/address')"
>
<
van-icon
name=
"close"
/
>
<Text
style=
'color: #fff;font-size: 32;'
>
收货地址
</Text>
<
u-icon
name=
"location"
color=
"#fff"
size=
"40"
></u-icon
>
<Text
style=
'color: #fff;font-size: 32;
margin-left: 20rpx;
'
>
收货地址
</Text>
</view>
</view>
<view
class=
"footprint"
v-if=
'meueData.user_center.is_foot_bar_status==1'
>
<view
class=
"footprint_item"
@
click=
"goUrl()"
>
<view
class=
"footprint_item"
@
click=
"goUrl(
'/pages/favorite/favorite'
)"
>
<text>
{{
user_info
.
favorite
}}
</text>
<view
class=
"footprint_item_bottom"
>
<image
:src=
'meueData.user_center.foot_bar[0].icon_url'
style=
"width: 40rpx;height: 40rpx;"
></image>
...
...
@@ -24,7 +24,7 @@
</view>
</view>
<view
style=
"width: 1rpx;height: 60rpx;background: #000000;"
></view>
<view
class=
"footprint_item"
@
click=
"goUrl()"
>
<view
class=
"footprint_item"
@
click=
"goUrl(
'/pages/foot/index/index'
)"
>
<text>
{{
user_info
.
footprint
}}
</text>
<view
class=
"footprint_item_bottom"
>
<image
:src=
'meueData.user_center.foot_bar[1].icon_url'
style=
"width: 40rpx;height: 40rpx;"
></image>
...
...
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