|
|
@@ -10,18 +10,18 @@
|
|
|
</view>
|
|
|
<view class="wallet-header_balance">
|
|
|
<text class="font18 mr10" style="vertical-align: top">¥</text>
|
|
|
- <text style="font-size: 32px; line-height: 32px;font-weight: 600;">{{ (user?.balance || 0).toFixed(2) }}
|
|
|
+ <text style="font-size: 32px; line-height: 32px;font-weight: 600;">{{ (account.balance || 0).toFixed(2) }}
|
|
|
</text>
|
|
|
</view>
|
|
|
<view class="wallet-header_pounds">
|
|
|
<view>
|
|
|
<text>充值余额:</text>
|
|
|
- <text>112.34</text>
|
|
|
+ <text>{{ account.rechargeBalance.toFixed(2) }}</text>
|
|
|
</view>
|
|
|
|
|
|
<view>
|
|
|
<text>赠款余额:</text>
|
|
|
- <text>20.00</text>
|
|
|
+ <text>{{ account.grantsBalance.toFixed(2) }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -30,15 +30,23 @@
|
|
|
<uv-tabs :list="tabs" @click="handleTabClick"></uv-tabs>
|
|
|
<uv-list>
|
|
|
<uv-list-item
|
|
|
- clickable show-arrow v-for="(item,index) in dataList" :key="index">
|
|
|
+ clickable show-arrow v-for="(item,index) in dataList" :key="index" @click="handleClickDetail(item)">
|
|
|
<template #default>
|
|
|
-
|
|
|
+ <view class="wallet-item">
|
|
|
+ <view class="wallet-item_header">
|
|
|
+ <view class="flex">
|
|
|
+ <text class="wallet-item_header-type">{{ fmtDictName('WalletDetail.type', item.type) }}</text>
|
|
|
+ <text class="wallet-item_header-status">{{ fmtDictName('WalletDetail.status', item.status) }}</text>
|
|
|
+ </view>
|
|
|
+ <text class="wallet-item_header-amt">{{ (item.amount/100).toFixed(2) }}元</text>
|
|
|
+ </view>
|
|
|
+ <view class="wallet-item_body">
|
|
|
+ <text class="wallet-item_body-order">{{ item.orderNo}}</text>
|
|
|
+ <text class="wallet-item_body-time">{{ fmtDateTime(item.transactionTime) }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
</uv-list-item>
|
|
|
- <uv-list-item title="列表文字" note="列表描述信息"></uv-list-item>
|
|
|
- <uv-list-item title="列表文字" note="列表描述信息"></uv-list-item>
|
|
|
- <uv-list-item title="列表文字" note="列表描述信息"></uv-list-item>
|
|
|
- <uv-list-item title="列表文字" note="列表描述信息"></uv-list-item>
|
|
|
</uv-list>
|
|
|
</view>
|
|
|
|
|
|
@@ -59,8 +67,10 @@ import {onPullDownRefresh, onReachBottom, onShow} from "@dcloudio/uni-app";
|
|
|
import {ref} from "vue";
|
|
|
import {rpxToPx} from "@/utils/device";
|
|
|
import {body, get} from "@/utils/https";
|
|
|
+import {checkLogin} from "@/utils/auth";
|
|
|
+import {fmtDictName,fmtDateTime} from "@/utils/common";
|
|
|
|
|
|
-const user = ref();
|
|
|
+const account = ref();
|
|
|
|
|
|
const dataList = ref([])
|
|
|
const tab = ref(0);
|
|
|
@@ -102,23 +112,16 @@ const scrollViewHeight = ref(0);
|
|
|
|
|
|
onShow(() => {
|
|
|
// infiniteScroller.refresh();
|
|
|
- loadData();
|
|
|
- if (getApp<any>().globalData.user) {
|
|
|
- user.value = getApp<any>().globalData.user;
|
|
|
- }
|
|
|
+ checkLogin().then(() => {
|
|
|
+ loadData();
|
|
|
+ })
|
|
|
})
|
|
|
|
|
|
onReachBottom(() => {
|
|
|
- // if(tab.value!==2){
|
|
|
- // infiniteScroller.next();
|
|
|
- // }
|
|
|
loadData();
|
|
|
});
|
|
|
|
|
|
onPullDownRefresh(() => {
|
|
|
- // if(tab.value!==2){
|
|
|
- // infiniteScroller.refresh();
|
|
|
- // }
|
|
|
loadData();
|
|
|
});
|
|
|
|
|
|
@@ -128,29 +131,26 @@ const to = (url: string) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const handleTabClick = (e:any) => {
|
|
|
- let {name,value,index} = e
|
|
|
+const handleTabClick = (e: any) => {
|
|
|
+ let {name, value, index} = e
|
|
|
tab.value = index;
|
|
|
console.log(index)
|
|
|
loadData();
|
|
|
}
|
|
|
|
|
|
const loadData = () => {
|
|
|
- if (!user) return;
|
|
|
- get(`/account/walletDetail`, {type: tab.value}).then((list: any) => {
|
|
|
+ get(`/account/balance`).then(res => {
|
|
|
+ account.value = res;
|
|
|
+ })
|
|
|
+ get(`/account/walletDetailList`, {type: tab.value}).then((list: any) => {
|
|
|
dataList.value = list;
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const detail = (index: number) => {
|
|
|
- if (!dataList.value) {
|
|
|
- return;
|
|
|
- }
|
|
|
-/* if (dataList.value[index].type === 3) {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages-order/detail/index?id=${dataList.value[index]?.orderNo}`,
|
|
|
- });
|
|
|
- }*/
|
|
|
+const handleClickDetail = (walletDetail: any) => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages-order/detail/index?id=${walletDetail.id}&type=${walletDetail.type}&orderNo=${walletDetail.orderNo}`,
|
|
|
+ });
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
@@ -213,8 +213,50 @@ const detail = (index: number) => {
|
|
|
}
|
|
|
|
|
|
.wallet-body {
|
|
|
+ margin: 20rpx 20rpx 60rpx 20rpx;
|
|
|
+
|
|
|
+
|
|
|
+ .wallet-item{
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ padding: 14rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ margin: 10rpx 16prx 10rpx 10rpx;
|
|
|
+
|
|
|
+
|
|
|
+ &_header{
|
|
|
+ display: inline-flex;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ &-type{
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ &-status{
|
|
|
+ font-size: 13px;
|
|
|
+ margin-left: 6px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-amt{
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 17px;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- margin-bottom: 60rpx;
|
|
|
+ &_body{
|
|
|
+ padding: 10rpx 0;
|
|
|
+ display: inline-flex;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ &-order,&-time{
|
|
|
+ font-size:12px ;
|
|
|
+ color:$uni-color-subtitle
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.wallet-bottom {
|
|
|
@@ -225,6 +267,8 @@ const detail = (index: number) => {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
</style>
|