完善余额功能

This commit is contained in:
2025-05-09 13:58:42 +08:00
parent 0b55863ba3
commit 2a32bd6fe5
309 changed files with 10732 additions and 5169 deletions

View File

@ -19,7 +19,7 @@
<view class="row-center balance u-relative" :style="{paddingTop: topSpace + 'px'}">
<view class="u-text-center w-full">
<view class="text-fff" style="font-size: 96rpx;">0</view>
<view class="text-fff" style="font-size: 96rpx;">{{ userInfo.user_integral }}</view>
<view class="text-fff nr">积分</view>
</view>
@ -34,15 +34,21 @@
<view class="u-p-b-40" style="margin-top: 132rpx;">
<view class="list bg-white br16 u-p-32">
<view class="lg">积分明细</view>
<view class="u-m-t-16">
<view class="u-m-b-16">
<view class="nr row-between">
<view>积分</view>
<view class="deduct">-2000</view>
<scroll-view scroll-y="true" style="height: 880rpx;" :refresher-enabled="true"
:refresher-triggered="isRefreshing"
@refresherrefresh="refreshCallback"
@scrolltolower="upCallback">
<view class="u-m-t-16">
<view class="u-m-b-16" v-for="(item, index) in lists" :key="index">
<view class="nr row-between">
<view>{{ item.source_type }}</view>
<view class="deduct">{{ item.change_amount }}</view>
</view>
<view class="date xs u-m-t-16">{{ item.change_amount }}</view>
</view>
<view class="date xs u-m-t-16">2022-12-24 16:32:44</view>
</view>
</view>
<loading-footer :status="loadingStatus"></loading-footer>
</scroll-view>
</view>
</view>
@ -50,6 +56,10 @@
</template>
<script>
import { getUser, getAccountLog } from '@/api/user'
import {loadingFun} from "@/utils/tools"
import { loadingType } from '@/utils/type'
export default {
data() {
return {
@ -58,7 +68,14 @@
bgImageHeight: 244 ,// 背景图高度单位px根据实际情况调整
selectIndex: 0,
backText: '',
topSpace: 0
topSpace: 0,
userInfo: {
user_integral: 0,
},
lists: [],
isRefreshing: false, // 控制刷新状态
loadingStatus: loadingType.LOADING,
page: 1
}
},
@ -67,29 +84,56 @@
this.statusBarHeight = systemInfo.statusBarHeight
// #ifdef MP-WEIXIN
this.topSpace = (80 - this.statusBarHeight)
this.topSpace = (80 - this.statusBarHeight)
// #endif
// #ifndef MP-WEIXIN
this.topSpace = (80 + 44)
this.topSpace = (80 + 44)
// #endif
this.getUserInfoFun()
this.upCallback()
},
methods: {
// 跳转个人信息
toProfile() {
uni.navigateTo({
url: '/pages/my/profile'
})
// 获取用户积分
getUserInfoFun() {
getUser().then(res => {
if (res.code == 1) {
this.userInfo = res.data
}
});
},
// 跳转我的钱包
toWallet() {
uni.navigateTo({
url: '/pages/my/wallet'
refreshCallback() {
this.isRefreshing = true;
this.page = 1
this.lists = []
this.loadingStatus = loadingType.LOADING
this.upCallback()
},
// 初始化数据
upCallback() {
let {
lists,
loadingStatus,
page
} = this;
loadingFun(getAccountLog, page, lists, loadingStatus, { source: 2, type: 0}).then(res => {
if(res) {
setTimeout(() => {
this.isRefreshing = false;
}, 500);
this.page = res.page;
this.lists = res.dataList
this.loadingStatus = res.status
}
})
}
},
},
computed: {
navBackground() {