pull/9/head
xiaozhiyong 2 years ago
parent e883da3fff
commit 0ad09f5917
  1. 69
      BagMoney/pages/oilCards/oilCards.vue

@ -6,19 +6,17 @@
</cu-custom> </cu-custom>
<view class="" v-show="accountStatus"> <view class="" v-show="accountStatus">
<view class="placeholder bg-main-oil"> <view class="placeholder bg-main-oil">
</view> </view>
<view class="move-top"> <view class="move-top">
<view class="flex radius margin my-shadow position-re"> <view class="flex radius margin my-shadow position-re">
<view class="basis-sm text-center padding bg-gradual-black"> <view class="basis-sm text-center padding bg-gradual-black">
我的油卡 我的油卡
</view> </view>
<view class="basis-lg padding bg-white"> <view class="basis-lg padding bg-white">
总余额<text class="text-red">{{userTotal.oilCardTotalPrice|moneyFormat}}</text><text class="cu-tag yu-tag-right position-ab sm">{{cardList.length>0?cardList.length:1}}</text> 总余额<text class="text-red">{{userTotal.oilCardTotalPrice|moneyFormat}}</text><text
class="cu-tag yu-tag-right position-ab sm">{{cardList.length>0?cardList.length:1}}</text>
</view> </view>
</view> </view>
<!-- <view class="flex radius margin my-shadow position-re"> <!-- <view class="flex radius margin my-shadow position-re">
<view class="basis-sm text-center padding bg-gradual-black"> <view class="basis-sm text-center padding bg-gradual-black">
自营公司油卡 自营公司油卡
@ -38,12 +36,10 @@
</view> </view>
</view> --> </view> -->
</view> </view>
</view> </view>
<view class=" margin-bottom-lg"> <view class=" margin-bottom-lg">
<swiper class="screen-swiper square-dot" @change="cardSwiper" :indicator-dots="true" :circular="true" :autoplay="false" <swiper class="screen-swiper square-dot" @change="cardSwiper" :indicator-dots="true" :circular="true"
interval="5000" duration="500"> :autoplay="false" interval="5000" duration="500">
<swiper-item v-for="(item,index) in cardList" :key="index" :class="cardCur==index?'cur':''"> <swiper-item v-for="(item,index) in cardList" :key="index" :class="cardCur==index?'cur':''">
<!-- <image :src="imgURL+ (item.type=='zs'?'card-zs.png':'card-other.png')" mode="aspectFill"> <!-- <image :src="imgURL+ (item.type=='zs'?'card-zs.png':'card-other.png')" mode="aspectFill">
</image> --> </image> -->
@ -58,16 +54,13 @@
<view class="text-red padding-bottom-sm text-bold text-lg"> <view class="text-red padding-bottom-sm text-bold text-lg">
共享企业余额 共享企业余额
</view> </view>
<text
<text class="text-grey">单日加油额度{{cardList[cardCur].orderAmountToplimit}}单日加油升数额度{{cardList[cardCur].orderVolumeToplimit}}L</text> class="text-grey">单日加油额度{{cardList[cardCur].orderAmountToplimit}}单日加油升数额度{{cardList[cardCur].orderVolumeToplimit}}L</text>
</view> </view>
<view class="text-center padding"> <view class="text-center padding">
<!-- <view class="text-red text-bold text-lg"> <!-- <view class="text-red text-bold text-lg">
{{userTotal.oilCardTotalPrice|moneyFormat}} {{userTotal.oilCardTotalPrice|moneyFormat}}
</view> --> </view> -->
<text class="">交易记录</text> <text class="">交易记录</text>
</view> </view>
</view> </view>
@ -75,7 +68,6 @@
<view class="cu-list menu" v-if="cardList[cardCur].historyList.length>0"> <view class="cu-list menu" v-if="cardList[cardCur].historyList.length>0">
<view class="cu-item" v-for="detail in cardList[cardCur].historyList" :key="detail.id"> <view class="cu-item" v-for="detail in cardList[cardCur].historyList" :key="detail.id">
<view class="content padding-tb-sm"> <view class="content padding-tb-sm">
<view class="text-gray text-sm"> <view class="text-gray text-sm">
{{detail.createTime}} {{detail.createTime}}
</view> </view>
@ -109,7 +101,7 @@
}, },
data() { data() {
return { return {
hideCard:[], hideCard: [],
loadStatus: 'load', loadStatus: 'load',
userTotal: {}, userTotal: {},
historyList: [], historyList: [],
@ -178,7 +170,7 @@
onReachBottom() { onReachBottom() {
if (this.cardList[this.cardCur].loadStatus == 'more') { if (this.cardList[this.cardCur].loadStatus == 'more') {
setTimeout(() => { setTimeout(() => {
this.getMoneyDetail(this.cardList[this.cardCur],this.cardCur) this.getMoneyDetail(this.cardList[this.cardCur], this.cardCur)
}, 100) }, 100)
} else { } else {
uni.showToast({ uni.showToast({
@ -213,13 +205,7 @@
oilCardType: card.oilCardType oilCardType: card.oilCardType
} }
} }
console.log('++++++++++++++')
console.log(data2)
console.log('++++++++++++++')
accountApi.getOilCardRecordByPage(data2).then(res => { accountApi.getOilCardRecordByPage(data2).then(res => {
console.log('++++++++++++++')
console.log(res)
console.log('++++++++++++++')
if (res.code == 20000) { if (res.code == 20000) {
if (res.data.list.length < 20) { if (res.data.list.length < 20) {
this.cardList[index].loadStatus = 'nomore' this.cardList[index].loadStatus = 'nomore'
@ -228,31 +214,32 @@
this.cardList[index].currentPage++ this.cardList[index].currentPage++
} }
// this.cardList[index].historyList = [] // this.cardList[index].historyList = []
if (this.cardList[index].currentPage !== 1) {
if(this.cardList[index].currentPage!==1){ this.cardList[index].historyList = this.cardList[index].historyList.concat(res.data
this.cardList[index].historyList = this.cardList[index].historyList.concat(res.data.list) .list)
} else{ } else {
this.cardList[index].historyList = res.data.list this.cardList[index].historyList = res.data.list
} }
} }
}) })
}, },
async getCards() { async getCards() {
await accountApi.getSyncDeductions().then(res => { await accountApi.getSyncDeductions().then(res => {
if (res.code == 20000) { if (res.code == 20000) {
this.hideCard = res.data.companyIds this.hideCard = res.data.companyIds
} }
}) })
await accountApi.getUserAccount().then(res => { await accountApi.getUserAccount().then(res => {
if (res.code == 20000) { if (res.code == 20000) {
if (res.data.length > 0) { if (res.data.length > 0) {
this.cardList = res.data this.cardList = res.data
this.cardList = this.cardList.filter(item=>!this.hideCard.includes(item.companyId)) this.cardList = this.cardList.filter(item => !this.hideCard.includes(item
.companyId))
this.cardList.forEach(item => { this.cardList.forEach(item => {
this.$set(item,'currentPage',1) this.$set(item, 'currentPage', 1)
this.$set(item,'loadStatus','more') this.$set(item, 'loadStatus', 'more')
this.$set(item,'historyList',[]) this.$set(item, 'historyList', [])
}) })
console.log(this.cardList) console.log(this.cardList)
setTimeout(() => { setTimeout(() => {
@ -332,10 +319,11 @@
</script> </script>
<style scoped> <style scoped>
.boxsingForCard{ .boxsingForCard {
position: relative; position: relative;
} }
.inCard{
.inCard {
position: absolute; position: absolute;
right: 11%; right: 11%;
bottom: 17%; bottom: 17%;
@ -343,11 +331,12 @@
height: 55rpx; height: 55rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 20rpx; border-radius: 20rpx;
color: red; color: red;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.tower-swiper .tower-item { .tower-swiper .tower-item {
transform: scale(calc(0.5 + var(--index) / 10)); transform: scale(calc(0.5 + var(--index) / 10));
margin-left: calc(var(--left) * 100upx - 150upx); margin-left: calc(var(--left) * 100upx - 150upx);

Loading…
Cancel
Save