|
@@ -5,7 +5,7 @@
|
|
<view class="h-account" :style="{paddingTop:CustomBar+'px',backgroundImage: 'url('+account_bg+')'}">
|
|
<view class="h-account" :style="{paddingTop:CustomBar+'px',backgroundImage: 'url('+account_bg+')'}">
|
|
<view class="m-account">
|
|
<view class="m-account">
|
|
<view class="m-m money">
|
|
<view class="m-m money">
|
|
- <text class="m-t b">{{showIndexOfMoney}}</text>
|
|
|
|
|
|
+ <text class="m-t b">{{ userBeans }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="m-m title">
|
|
<view class="m-m title">
|
|
<text class="m-p">可用数量</text>
|
|
<text class="m-p">可用数量</text>
|
|
@@ -33,21 +33,21 @@
|
|
<scroll-view class="h-swiper-content" scroll-y :style="{paddingTop:CustomBar+234+'px'}">
|
|
<scroll-view class="h-swiper-content" scroll-y :style="{paddingTop:CustomBar+234+'px'}">
|
|
<!-- 空白页 -->
|
|
<!-- 空白页 -->
|
|
<view v-if="isEmpty" class="empty-account">
|
|
<view v-if="isEmpty" class="empty-account">
|
|
- <image class="empty-account-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6ADg5RAABQ9EmRCGk830.png" mode="aspectFit"></image>
|
|
|
|
|
|
+ <image class="empty-account-image" :src="StaticUrl+'icon/icon-empty-account.png'" mode="aspectFit"></image>
|
|
<text class="error-text">{{errorText}}</text>
|
|
<text class="error-text">{{errorText}}</text>
|
|
</view>
|
|
</view>
|
|
<!-- 余额明细列表 -->
|
|
<!-- 余额明细列表 -->
|
|
<view v-else class="list-account">
|
|
<view v-else class="list-account">
|
|
- <view v-for="(item,index) in accountList" :key="index" class="list-item">
|
|
|
|
|
|
+ <view v-for="(item,index) in beansList" :key="index" class="list-item">
|
|
<view class="list-t">
|
|
<view class="list-t">
|
|
- <view class="t-t">{{cheakType(item.balanceType)}}</view>
|
|
|
|
|
|
+ <view class="t-t">{{ item.beansType | BeansStatusFilter }}</view>
|
|
<view class="t-t bold" :style="{color:item.type == '1' ? '#ff2a2a' : '#15C47A'}">
|
|
<view class="t-t bold" :style="{color:item.type == '1' ? '#ff2a2a' : '#15C47A'}">
|
|
- <text class="txt">{{item.type =='1'? '+' : '-'}}</text>
|
|
|
|
- <text class="txt">¥{{item.amount}}</text>
|
|
|
|
|
|
+ <text class="txt">{{item.type == 1 ? '+' : '-'}}</text>
|
|
|
|
+ <text class="txt">¥{{item.num}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="list-b">
|
|
<view class="list-b">
|
|
- <view class="t-t">{{item.addDate}}</view>
|
|
|
|
|
|
+ <view class="t-t">{{item.addTime}}</view>
|
|
<view class="t-t">{{item.type =='1'? '收入' : '支出'}}</view>
|
|
<view class="t-t">{{item.type =='1'? '收入' : '支出'}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -76,6 +76,7 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return{
|
|
return{
|
|
|
|
+ StaticUrl:this.$Static,
|
|
nvabarData: { //顶部自定义导航
|
|
nvabarData: { //顶部自定义导航
|
|
showCapsule:1, // 是否显示左上角图标 1表示显示 0表示不显示,
|
|
showCapsule:1, // 是否显示左上角图标 1表示显示 0表示不显示,
|
|
showSearch: 0,
|
|
showSearch: 0,
|
|
@@ -87,18 +88,18 @@
|
|
account_bg:'https://img.caimei365.com/group1/M00/03/D0/Cmis21-PpUqAbubBAADf1kTyhjs098.png',
|
|
account_bg:'https://img.caimei365.com/group1/M00/03/D0/Cmis21-PpUqAbubBAADf1kTyhjs098.png',
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
CustomBar:this.CustomBar,// 顶部导航栏高度
|
|
CustomBar:this.CustomBar,// 顶部导航栏高度
|
|
- year: date.getFullYear(), //年
|
|
|
|
- month: date.getMonth()+1, //月
|
|
|
|
- userID: '', //用户ID
|
|
|
|
- pageNum:1, //页数
|
|
|
|
- pageSize:10, //加载条数
|
|
|
|
- balanceType: '', //查询余额类型
|
|
|
|
- showIndexOfMoney:20000,
|
|
|
|
- ableUserMoney:58656.65, //可用余额
|
|
|
|
- balanceTypeText:'', //根据类型显示文字
|
|
|
|
|
|
+ listQuery:{
|
|
|
|
+ year: date.getFullYear(), //年
|
|
|
|
+ month: date.getMonth()+1, //月
|
|
|
|
+ userId: '', //用户ID
|
|
|
|
+ pageNum:1, //页数
|
|
|
|
+ pageSize:10, //加载条数
|
|
|
|
+ type: 0, //查询余额类型
|
|
|
|
+ },
|
|
|
|
+ userBeans:0,
|
|
tabCurrentIndex: 0, //标签选择索引
|
|
tabCurrentIndex: 0, //标签选择索引
|
|
infoData: {selected: []}, //日期选择
|
|
infoData: {selected: []}, //日期选择
|
|
- accountList: [], //余额列表
|
|
|
|
|
|
+ beansList: [], //余额列表
|
|
isShowAccounExp:false, //控制明细说明文字显示
|
|
isShowAccounExp:false, //控制明细说明文字显示
|
|
isRefreshing:false,
|
|
isRefreshing:false,
|
|
isNomore:false,
|
|
isNomore:false,
|
|
@@ -115,86 +116,84 @@
|
|
{state: 2,text: '支出'},
|
|
{state: 2,text: '支出'},
|
|
],
|
|
],
|
|
isCheckObject:{
|
|
isCheckObject:{
|
|
- 0:['','本月没有任何余额收支记录'],
|
|
|
|
- 1:[1, '本月没有余额收入记录!'],
|
|
|
|
- 2:[2, '本月没有余额支出记录!'],
|
|
|
|
|
|
+ 0:['','本月没有采美豆收支记录'],
|
|
|
|
+ 1:[1, '本月没有采美豆收入记录!'],
|
|
|
|
+ 2:[2, '本月没有采美豆支出记录!'],
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
- this.getAccountInitData(this.tabCurrentIndex,this.year,this.month)
|
|
|
|
|
|
+ this.$api.getStorage().then((resolve) =>{
|
|
|
|
+ this.listQuery.userId =resolve.userId ? resolve.userId : 0
|
|
|
|
+ this.GetAccountInitData()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ filters: {
|
|
|
|
+ BeansStatusFilter: function(state){
|
|
|
|
+ let stateText = ''
|
|
|
|
+ let stateTextObject={
|
|
|
|
+ 1:'注册机构',
|
|
|
|
+ 2:'升级会员机构',
|
|
|
|
+ 3:'普通机构完善资料',
|
|
|
|
+ 4:'会员机构完善资料',
|
|
|
|
+ 5:'下单',
|
|
|
|
+ 6:'线上支付订单',
|
|
|
|
+ 7:'确认收货',
|
|
|
|
+ 8:'系统发放',
|
|
|
|
+ 9:'抵用退回',
|
|
|
|
+ 10:'抵用运费',
|
|
|
|
+ 11:'退款回收'
|
|
|
|
+ };
|
|
|
|
+ Object.keys(stateTextObject).forEach(function(key){
|
|
|
|
+ if(key == state){
|
|
|
|
+ stateText = stateTextObject[key]
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return stateText;
|
|
|
|
+},
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- getAccountInitData(index,year,month){//获取余额明细数据列表
|
|
|
|
|
|
+ GetAccountInitData(index){//获取余额明细数据列表
|
|
Object.keys(this.isCheckObject).forEach(key => {
|
|
Object.keys(this.isCheckObject).forEach(key => {
|
|
if (+key === +index) {
|
|
if (+key === +index) {
|
|
- this.balanceType = this.isCheckObject[key][0]
|
|
|
|
|
|
+ this.listQuery.type = this.isCheckObject[key][0]
|
|
this.errorText = this.isCheckObject[key][1]
|
|
this.errorText = this.isCheckObject[key][1]
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- this.$api.getStorage().then((resolve) =>{
|
|
|
|
- this.userID =resolve.userId ? resolve.userId : 0
|
|
|
|
- /**
|
|
|
|
- * @余额明细初始化加载 仅加载第一页码
|
|
|
|
- * @param:type(查询余额类型:0全部,1收入,2支出)
|
|
|
|
- * @param:year(查询年份)
|
|
|
|
- * @param:month(查询月份)
|
|
|
|
- * @param:index(页码数)
|
|
|
|
- * @param:pageSize(每页条数)
|
|
|
|
- * @param:userId(用户ID)
|
|
|
|
- */
|
|
|
|
- this.UserService.GetAccountInfo(
|
|
|
|
- {
|
|
|
|
- year:year,
|
|
|
|
- month:month,
|
|
|
|
- userId:this.userID,
|
|
|
|
- pageNum:1,
|
|
|
|
- pageSize:this.pageSize,
|
|
|
|
- type:this.balanceType,
|
|
|
|
- })
|
|
|
|
- .then(response =>{
|
|
|
|
- let infoData = response.data
|
|
|
|
- this.initAbleUserMoney(infoData.ableUserMoney)
|
|
|
|
- let resultsData = infoData.pageDate.results
|
|
|
|
- this.hasNextPage = infoData.pageDate.hasNextPage;
|
|
|
|
- if(resultsData && resultsData.length > 0){
|
|
|
|
- this.isEmpty = false;
|
|
|
|
- this.accountList = [...resultsData];
|
|
|
|
|
|
+ this.UserService.GetUserClubBeansList(this.listQuery).then(response =>{
|
|
|
|
+ let data = response.data
|
|
|
|
+ let list = data.pageInfo.list
|
|
|
|
+ this.userBeans = data.userBeans
|
|
|
|
+ this.hasNextPage = data.pageInfo.hasNextPage;
|
|
|
|
+ if(list && list.length > 0){
|
|
|
|
+ this.isEmpty = false;
|
|
|
|
+ this.beansList = [...list];
|
|
|
|
+ }else{
|
|
|
|
+ this.isEmpty = true
|
|
|
|
+ }
|
|
|
|
+ if(this.hasNextPage){
|
|
|
|
+ this.pullUpOn = false
|
|
|
|
+ this.nomoreText = '上拉显示更多'
|
|
|
|
+ }else{
|
|
|
|
+ if(this.beansList.length < 10){
|
|
|
|
+ this.pullUpOn = true
|
|
}else{
|
|
}else{
|
|
- this.isEmpty = true
|
|
|
|
- }
|
|
|
|
- if(this.hasNextPage){
|
|
|
|
this.pullUpOn = false
|
|
this.pullUpOn = false
|
|
- this.nomoreText = '上拉显示更多'
|
|
|
|
- }else{
|
|
|
|
- if(this.accountList.length < 2){
|
|
|
|
- this.pullUpOn = true
|
|
|
|
- }else{
|
|
|
|
- this.pullUpOn = false
|
|
|
|
- this.nomoreText = '已至底部'
|
|
|
|
- }
|
|
|
|
|
|
+ this.nomoreText = '已至底部'
|
|
}
|
|
}
|
|
- }).catch(error =>{
|
|
|
|
- this.$util.msg(error.msg,2000)
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ }
|
|
|
|
+ }).catch(error =>{
|
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- getOnReachBottomData(index,year,month){//上拉加载
|
|
|
|
- this.UserService.GetAccountInfo(
|
|
|
|
- {
|
|
|
|
- year:year,
|
|
|
|
- month:month,
|
|
|
|
- userId:this.userID,
|
|
|
|
- pageNum:this.pageNum+=1,
|
|
|
|
- pageSize:this.pageSize,
|
|
|
|
- type:this.balanceType,
|
|
|
|
- })
|
|
|
|
- .then(response =>{
|
|
|
|
- let infoData = response.data
|
|
|
|
- this.initAbleUserMoney(infoData.ableUserMoney)
|
|
|
|
- let resultsData = infoData.pageDate.results
|
|
|
|
- this.hasNextPage = infoData.pageDate.hasNextPage;
|
|
|
|
- this.accountList = this.accountList.concat(resultsData)
|
|
|
|
|
|
+ GetOnReachBottomData(index){//上拉加载
|
|
|
|
+ this.listQuery.pageNum += 1
|
|
|
|
+ this.UserService.GetUserClubBeansList(this.listQuery).then(response =>{
|
|
|
|
+ let data = response.data
|
|
|
|
+ let list = data.pageInfo.list
|
|
|
|
+ this.userBeans = data.userBeans
|
|
|
|
+ this.hasNextPage = data.pageInfo.hasNextPage;
|
|
|
|
+ this.beansList = this.beansList.concat(list)
|
|
this.pullFlag = false;// 防上拉暴滑
|
|
this.pullFlag = false;// 防上拉暴滑
|
|
setTimeout(()=>{this.pullFlag = true;},500)
|
|
setTimeout(()=>{this.pullFlag = true;},500)
|
|
if(this.hasNextPage){
|
|
if(this.hasNextPage){
|
|
@@ -209,36 +208,18 @@
|
|
this.$util.msg(error.msg,2000)
|
|
this.$util.msg(error.msg,2000)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- initAbleUserMoney(money){//拆分金额并转千分位格式显示
|
|
|
|
- if(money == 0){
|
|
|
|
- this.showIndexOfMoney ='0';
|
|
|
|
- this.smallMoney=".00"
|
|
|
|
- }else{
|
|
|
|
- this.ableUserMoney = this.$api.FormatMoney(money) ;
|
|
|
|
- let i = this.ableUserMoney.toString().lastIndexOf('.');
|
|
|
|
- if(i==-1){
|
|
|
|
- this.showIndexOfMoney=this.$api.FormatMoney( this.ableUserMoney)
|
|
|
|
- this.smallMoney=".00"
|
|
|
|
- }else{
|
|
|
|
- this.smallMoney = this.ableUserMoney.toString().substring(i);
|
|
|
|
- this.showIndexOfMoney= this.$api.FormatMoney(this.ableUserMoney.toString().substring(0,i))
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
tabClick(index){//tab点击
|
|
tabClick(index){//tab点击
|
|
this.tabCurrentIndex = index;
|
|
this.tabCurrentIndex = index;
|
|
|
|
+ this.listQuery.type = index;
|
|
this.pageNum = 1
|
|
this.pageNum = 1
|
|
- this.accountList = []
|
|
|
|
|
|
+ this.beansList = []
|
|
this.pullUpOn = true //隐藏
|
|
this.pullUpOn = true //隐藏
|
|
- this.getAccountInitData(this.tabCurrentIndex,this.year,this.month);
|
|
|
|
|
|
+ this.GetAccountInitData();
|
|
},
|
|
},
|
|
- bindDateChange: function(e) {
|
|
|
|
- this.date = e.target.value
|
|
|
|
- },
|
|
|
|
monthSwitch(e) {
|
|
monthSwitch(e) {
|
|
- this.year = e.year;
|
|
|
|
- this.month = e.month;
|
|
|
|
- this.getAccountInitData(this.tabCurrentIndex,this.year,this.month);
|
|
|
|
|
|
+ this.listQuery.year = e.year;
|
|
|
|
+ this.listQuery.month = e.month;
|
|
|
|
+ this.GetAccountInitData();
|
|
},
|
|
},
|
|
cheakType(type){
|
|
cheakType(type){
|
|
let typeTextHtml,
|
|
let typeTextHtml,
|
|
@@ -276,15 +257,16 @@
|
|
if(this.hasNextPage){
|
|
if(this.hasNextPage){
|
|
this.loadding = true
|
|
this.loadding = true
|
|
this.pullUpOn = true
|
|
this.pullUpOn = true
|
|
- this.getOnReachBottomData(this.tabCurrentIndex,this.year,this.month)
|
|
|
|
|
|
+ this.GetOnReachBottomData()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onPullDownRefresh() {//下拉刷新
|
|
onPullDownRefresh() {//下拉刷新
|
|
- this.getAccountInitData(this.tabCurrentIndex,this.year,this.month)
|
|
|
|
|
|
+ this.listQuery.pageNum = 1;
|
|
|
|
+ this.GetAccountInitData()
|
|
uni.stopPullDownRefresh()
|
|
uni.stopPullDownRefresh()
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- // this.accountList = []
|
|
|
|
|
|
+ // this.beansList = []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -570,8 +552,8 @@ page, .container{
|
|
background: $bg-color;
|
|
background: $bg-color;
|
|
min-height: 800rpx;
|
|
min-height: 800rpx;
|
|
&-image {
|
|
&-image {
|
|
- width: 160rpx;
|
|
|
|
- height: 158rpx;
|
|
|
|
|
|
+ width: 260rpx;
|
|
|
|
+ height: 260rpx;
|
|
}
|
|
}
|
|
.error-text{
|
|
.error-text{
|
|
font-size: $font-size-28;
|
|
font-size: $font-size-28;
|