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
f92a566c
Commit
f92a566c
authored
May 27, 2020
by
zhangjianguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
余额
parent
29d5b80b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
242 additions
and
12 deletions
+242
-12
balance.vue
pages/balance/balance.vue
+229
-0
index.vue
pages/foot/index/index.vue
+5
-4
user-center.vue
pages/user-center/user-center.vue
+8
-8
No files found.
pages/balance/balance.vue
0 → 100644
View file @
f92a566c
<
template
>
<view
class=
"balanceStyle"
:style=
"
{'height':contentHeight}" >
<view
:style=
"
{'backgroundImage':'url('+(g.setting.bj_pic_url.url?g.setting.bj_pic_url.url:'')+')',backgroundSize: 'cover'}" class="balance_top" >
<Text
style=
'margin-top:50rpx ;color: #fff;;font-size: 24rpx;'
>
账户余额(元)
</Text>
<Text
style=
'margin-top:50rpx ;color: #fff;;font-size: 36px;'
>
{{
g
.
balance
}}
</Text>
<view
class=
"recharge"
>
<Text
style=
'color: #fff;;font-size: 28rpx;'
>
充值
</Text>
</view>
<!-- TODO 暂无余额说明 -->
<u-icon
name=
"question-o"
color=
"#fff"
class=
'explain'
size=
"36"
></u-icon>
</view>
<view
class=
"timechoice"
>
<view
style=
"width: 50%;display: flex;flex-direction: row;align-items: center;justify-content: space-between;"
>
<u-icon
name=
"arrow-left"
color=
"#909399"
size=
"36"
@
click=
'fun_date(-1)'
></u-icon>
<Text>
{{
date
}}
</Text>
<u-icon
name=
"arrow"
color=
"#909399"
size=
"36"
@
click=
'fun_date(1)'
></u-icon>
</view>
</view>
<view>
<!-- TODO logs列表 -->
</view>
<!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
-->
<view
class=
"loading"
v-if=
"load"
>
<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
{
pageTitle
:
"余额记录"
,
load
:
false
,
showAuth
:
false
,
contentHeight
:
0
,
mainColor
:
""
,
u
:{},
g
:{},
date
:
''
,
date2
:
''
,
logsList
:[],
}
},
components
:{
auth
},
mounted
()
{
let
currentPages
=
getCurrentPages
();
let
u
=
"/"
+
currentPages
[
currentPages
.
length
-
1
].
route
;
let
pages
=
uni
.
getStorageSync
(
"basedata"
)
?
uni
.
getStorageSync
(
"basedata"
).
bar_title
:
[];
pages
.
forEach
((
x
)
=>
{
if
(
x
.
value
==
u
)
{
this
.
pageTitle
=
x
.
new_name
?
x
.
new_name
:
x
.
name
;
}
});
uni
.
setNavigationBarTitle
({
title
:
this
.
pageTitle
,
});
},
onLoad
(){
this
.
u
=
uni
.
getStorageSync
(
"userinfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
};
this
.
showAuth
=
true
;
}
},
created
(){
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
'px'
;
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
let
date1
=
new
Date
();
let
time1
=
date1
.
getFullYear
()
+
"年"
+
(
date1
.
getMonth
()
+
1
)
+
'月'
let
time2
=
date1
.
getFullYear
()
+
"-"
+
(
date1
.
getMonth
()
+
1
)
this
.
date
=
time1
this
.
date2
=
time2
this
.
balancedata
()
this
.
getlogs
()
},
methods
:
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"userinfo"
);
this
.
showAuth
=
false
},
balancedata
(){
uni
.
showNavigationBarLoading
();
let
h
=
this
.
apiheader
()
this
.
request
(
{
url
:
""
,
header
:
h
,
data
:
{
r
:
"api/balance/index"
,
}
},
res
=>
{
uni
.
hideNavigationBarLoading
()
this
.
g
=
res
.
data
;
}
);
},
getlogs
(){
this
.
load
=
true
uni
.
showNavigationBarLoading
();
let
h
=
this
.
apiheader
()
this
.
request
(
{
url
:
""
,
header
:
h
,
data
:
{
r
:
"api/balance/logs"
,
date
:
this
.
date2
,
}
},
res
=>
{
this
.
load
=
false
}
);
},
fun_date
(
num
){
let
date
=
this
.
date
;
let
date2
=
this
.
date2
;
let
currentDate
=
new
Date
(
date2
);
if
(
num
==-
1
){
let
lastDate
=
currentDate
.
setMonth
(
currentDate
.
getMonth
()
-
1
);
// 输出日期格式为毫秒形式1551398400000
lastDate
=
new
Date
(
lastDate
);
let
lastYear
=
lastDate
.
getFullYear
();
let
lastMonth
=
this
.
checkMonth
(
lastDate
.
getMonth
()
+
1
);
// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
lastDate
=
lastYear
+
'年'
+
lastMonth
+
'月'
;
let
lastDate2
=
lastYear
+
'-'
+
lastMonth
;
this
.
date
=
lastDate
;
this
.
date2
=
lastDate2
;
this
.
getlogs
()
}
else
if
(
num
==
1
){
let
nextDate
=
currentDate
.
setMonth
(
currentDate
.
getMonth
()
+
1
);
// 输出日期格式为毫秒形式1556668800000
nextDate
=
new
Date
(
nextDate
);
let
nextYear
=
nextDate
.
getFullYear
();
let
nextMonth
=
this
.
checkMonth
(
nextDate
.
getMonth
()
+
1
);
// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
nextDate
=
nextYear
+
'年'
+
nextMonth
+
'月'
;
let
nextDate2
=
nextYear
+
'-'
+
nextMonth
;
this
.
date
=
nextDate
;
this
.
date2
=
nextDate2
;
this
.
getlogs
()
}
},
checkMonth
(
i
)
{
if
(
i
<
10
){
i
=
"0"
+
i
;
}
return
i
;
}
}
}
</
script
>
<
style
>
.balanceStyle
{
background
:
#f3f4f6
;
width
:
100%
;
}
.balanceStyle
.balance_top
{
width
:
100%
;
height
:
215px
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
position
:
relative
;
}
.balanceStyle
.recharge
{
width
:
90px
;
height
:
30px
;
text-align
:
center
;
line-height
:
30px
;
border-radius
:
15px
;
border
:
1px
solid
#FFFFFF
;
margin-top
:
60
rpx
;
}
.balanceStyle
.explain
{
position
:
absolute
;
right
:
20
rpx
;
top
:
20
rpx
}
.balanceStyle
.timechoice
{
width
:
100%
;
height
:
50px
;
background
:
#FFFFFF
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.balanceStyle
.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
:
fixed
;
left
:
50%
;
top
:
30%
;
margin-left
:
-100
rpx
;
z-index
:
999
;
}
</
style
>
pages/foot/index/index.vue
View file @
f92a566c
...
...
@@ -74,7 +74,7 @@
</view>
<!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
-->
<view
class=
"loading"
v-show=
"loading"
>
<u-loading
mode=
"flower"
size=
"48"
>
>
</u-loading>
<u-loading
mode=
"flower"
size=
"48"
></u-loading>
<Text
style=
'color: #fff;margin-top: 10rpx;'
>
加载中...
</Text>
</view>
<w-picker
...
...
@@ -156,7 +156,8 @@
goodId
:
''
,
showModal
:
false
,
index
:
0
,
ci
:
0
ci
:
0
,
u
:{},
}
},
components
:{
...
...
@@ -172,8 +173,8 @@
mounted
()
{
let
currentPages
=
getCurrentPages
();
let
u
=
"/"
+
currentPages
[
currentPages
.
length
-
1
].
route
;
let
pages
=
wx
.
getStorageSync
(
"basedata"
)
?
wx
.
getStorageSync
(
"basedata"
).
bar_title
let
pages
=
uni
.
getStorageSync
(
"basedata"
)
?
uni
.
getStorageSync
(
"basedata"
).
bar_title
:
[];
pages
.
forEach
((
x
)
=>
{
if
(
x
.
value
==
u
)
{
...
...
pages/user-center/user-center.vue
View file @
f92a566c
...
...
@@ -34,34 +34,34 @@
</view>
<view
class=
"account_bar"
v-if=
"meueData.user_center.is_account_status==1"
>
<view
class=
"account_bar_item"
>
<view
class=
"account_bar_item"
v-if=
"meueData.user_center.account_bar.integral.status==1"
>
<Text
:style=
"
{'color':secondary}">
{{
user_info
.
integral
}}
</Text>
<view
class=
"footprint_item_bottom"
>
<image
:src=
'meueData.user_center.account_bar.integral.icon'
style=
"width: 26rpx;height: 26rpx;"
></image>
<Text
style=
'margin-left: 10rpx;'
>
{{
meueData
.
user_center
.
account_bar
.
integral
.
text
}}
</Text>
</view>
</view>
<view
style=
"width: 1px;height: 60rpx;background: #f5f5f5;"
></view>
<view
class=
"account_bar_item"
>
<view
style=
"width: 1px;height: 60rpx;background: #f5f5f5;"
v-if=
"meueData.user_center.account_bar.integral.status==1"
></view>
<view
class=
"account_bar_item"
v-if=
"meueData.user_center.account_bar.balance.status==1"
@
click=
"goUrl('/pages/balance/balance')"
>
<Text
:style=
"
{'color':secondary}">
{{
user_info
.
balance
}}
</Text>
<view
class=
"footprint_item_bottom"
>
<image
:src=
'meueData.user_center.account_bar.balance.icon'
style=
"width: 26rpx;height: 26rpx;"
></image>
<Text
style=
'margin-left: 10rpx;'
>
{{
meueData
.
user_center
.
account_bar
.
balance
.
text
}}
</Text>
</view>
</view>
<view
style=
"width: 1px;height: 60rpx;background: #f5f5f5;"
></view>
<view
style=
"width: 1px;height: 60rpx;background: #f5f5f5;"
v-if=
"meueData.user_center.account_bar.balance.status==1"
></view>
<view
class=
"account_bar_item"
>
<view
class=
"account_bar_item"
v-if=
"meueData.user_center.account_bar.coupon.status==1"
>
<Text
:style=
"
{'color':secondary}">
{{
user_info
.
coupon
}}
</Text>
<view
class=
"footprint_item_bottom"
>
<image
:src=
'meueData.user_center.account_bar.coupon.icon'
style=
"width: 26rpx;height: 26rpx;"
></image>
<Text
style=
'margin-left: 10rpx;'
>
{{
meueData
.
user_center
.
account_bar
.
coupon
.
text
}}
</Text>
</view>
</view>
<view
style=
"width: 1px;height: 60rpx;background: #f5f5f5;"
></view>
<view
style=
"width: 1px;height: 60rpx;background: #f5f5f5;"
v-if=
"meueData.user_center.account_bar.coupon.status==1"
></view>
<view
class=
"account_bar_item"
>
<view
class=
"account_bar_item"
v-if=
"meueData.user_center.account_bar.card.status==1"
>
<Text
:style=
"
{'color':secondary}">
{{
user_info
.
card
}}
</Text>
<view
class=
"footprint_item_bottom"
>
<image
:src=
'meueData.user_center.account_bar.card.icon'
style=
"width: 26rpx;height: 26rpx;"
></image>
...
...
@@ -333,7 +333,7 @@
position
:
absolute
;
right
:
-10
rpx
;
top
:
-10
rpx
;
padding
:
0
7
rpx
;
padding
:
0
12
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
...
...
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