订单,提现功能调整
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
<view class="total" :style="'background-image: url(' + require('@/static/imgs/bonus_back.png') + ');'">
|
||||
<view class="total-left">
|
||||
<view class="total-value nowrap">{{total}}</view>
|
||||
<view class="total-text nowrap">账户余额</view>
|
||||
<view class="total-text nowrap">{{ type === 'balance' ? '账户余额': '已提现总金额'}}</view>
|
||||
</view>
|
||||
<view class="total-btn">提现</view>
|
||||
<view class="total-btn" @click="$Router.push({name: 'Withdraws'})">提现</view>
|
||||
</view>
|
||||
<!-- 账户记录 -->
|
||||
<view class="tabs">
|
||||
@@ -21,11 +21,21 @@
|
||||
<view class="logs">
|
||||
<block v-if="list.length > 0">
|
||||
<view class="log-flex" v-for="(item, index) in list" :key="index">
|
||||
<view class="text">
|
||||
<view class="type nowrap">{{item.remark || '-'}}</view>
|
||||
<view class="time nowrap">{{item.created_at}}</view>
|
||||
</view>
|
||||
<view class="price nowrap">{{item.amount}}</view>
|
||||
<block v-if="type === 'balance'">
|
||||
<view class="text">
|
||||
<view class="type nowrap">{{item.remark || '-'}}</view>
|
||||
<view class="time nowrap">{{item.created_at}}</view>
|
||||
</view>
|
||||
<view class="price nowrap">{{item.amount}}</view>
|
||||
</block>
|
||||
<block v-if="type === 'withdraws'">
|
||||
<view class="text">
|
||||
<view class="type nowrap"><text>[{{item.status.status_text}}]</text>{{item.title || '-'}}</view>
|
||||
<view class="remark nowrap" v-if="item.remark != null">{{item.remark || '-'}}</view>
|
||||
<view class="time nowrap">{{item.created_at}}</view>
|
||||
</view>
|
||||
<view class="price nowrap">{{item.amount}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
@@ -44,13 +54,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { balance } from '@/apis/interfaces/account.js'
|
||||
import { balance, withdrawsLog } from '@/apis/interfaces/account.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
type: 'balance',
|
||||
tabs: [
|
||||
{ name: '奖金收益明细', value: '' },
|
||||
{ name: '提现记录', value: '' },
|
||||
{ name: '奖金收益明细', value: 'balance' },
|
||||
{ name: '提现记录', value: 'withdraws' },
|
||||
],
|
||||
total : '0.00',
|
||||
list : [],
|
||||
@@ -62,24 +73,71 @@
|
||||
status : ''
|
||||
};
|
||||
},
|
||||
created() {
|
||||
onShow() {
|
||||
this.page = {
|
||||
current : 1,
|
||||
has_more: false,
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
onTabs(e){
|
||||
console.log(e)
|
||||
console.log('这里需要之后处理提现记录')
|
||||
if(e.value === this.type) return
|
||||
this.type = e.value
|
||||
this.page = {
|
||||
current : 1,
|
||||
has_more: false,
|
||||
}
|
||||
this.list = []
|
||||
this.total = '0.00'
|
||||
this.getList()
|
||||
},
|
||||
// 获取账户余额
|
||||
getList(){
|
||||
uni.showLoading({
|
||||
title:'加载中...',
|
||||
mask : true
|
||||
})
|
||||
if(this.type === 'balance') this.getBalance()
|
||||
if(this.type === 'withdraws')this.getWithdraws()
|
||||
},
|
||||
// 获取账户余额
|
||||
getBalance(){
|
||||
balance({
|
||||
page: this.page.current
|
||||
}).then(res => {
|
||||
let { balance, logs } = res;
|
||||
let atList = logs.page.current == 1 ? [] : this.list
|
||||
let atList = logs.page.current == 1 ? [] : this.list
|
||||
this.total = balance
|
||||
this.list = atList.concat(logs.data)
|
||||
this.page = logs.page
|
||||
this.pagesShow = false
|
||||
uni.hideLoading()
|
||||
}).catch(err => {
|
||||
this.errMsg(err)
|
||||
})
|
||||
},
|
||||
// 获取提现记录
|
||||
getWithdraws(){
|
||||
withdrawsLog({
|
||||
page: this.page.current
|
||||
}).then(res => {
|
||||
let { all, lists } = res;
|
||||
let atList = lists.page.current == 1 ? [] : this.list
|
||||
this.total = all;
|
||||
this.list = atList.concat(lists.data)
|
||||
this.page = lists.page
|
||||
this.pagesShow = false
|
||||
uni.hideLoading()
|
||||
}).catch(err => {
|
||||
this.errMsg(err)
|
||||
})
|
||||
},
|
||||
// 错误提示
|
||||
errMsg(err){
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -178,6 +236,14 @@
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
color: #666666;
|
||||
text{
|
||||
font-weight: normal;
|
||||
padding-right: 10rpx;
|
||||
color: $main-color;
|
||||
}
|
||||
}
|
||||
.remark{
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.time{
|
||||
font-size: 28rpx;
|
||||
|
||||
Reference in New Issue
Block a user