From 2d43a1df3f5ba42710e6d21c27d1e13bdb8dfd56 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期一, 24 三月 2025 09:23:08 +0800
Subject: [PATCH] -

---
 src/pages/wallet/index.vue |  114 +++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 99 insertions(+), 15 deletions(-)

diff --git a/src/pages/wallet/index.vue b/src/pages/wallet/index.vue
index 770b8f7..c6d989e 100644
--- a/src/pages/wallet/index.vue
+++ b/src/pages/wallet/index.vue
@@ -7,26 +7,32 @@
 						<view class="c-p-b-16">
 							{{identity=='enterprise'?"浼佷笟浣欓锛堝厓锛�":'鏀跺叆浣欓锛堝厓锛�'}}
 						</view>
-						<text class="chuany-font50 fs-weight__500">12.88</text>
+						<text class="chuany-font50 fs-weight__500">{{balance}}</text>
 					</view>
 					<view class="right">
-						<up-button type="warning" size="small" shape="circle" :text="identity=='enterprise'?'鍏呭��':'鎻愮幇'"></up-button>
+						<up-button type="warning" size="small" shape="circle" @click="goMoney" v-if="identity!=='enterprise'"
+							text="鎻愮幇"></up-button>
 					</view>
 				</view>
 			</view>
 
-			<view class="money_bag">
+			<view class="money_bag" v-if="identity=='worker'">
 				<view class="tool_wrap">
 					<view class="tool_title chuany-flex chuany-justify-between">
 						<view class="title">
-							<text>鏀跺叆鏄庣粏</text>
+							<text>宸ヨ祫鏄庣粏</text>
 						</view>
-						<view class="chuany-flex title_right">
+						<view class="chuany-flex title_right" @click="toIncome">
 							<text class="c-m-r-10">鍏ㄩ儴</text>
 							<up-icon name="arrow-right"></up-icon>
 						</view>
 					</view>
-					<view class="tool_content">
+					<view class="" v-if="imcomeInfo&&imcomeInfo.length>0">
+						<up-cell :value="`${item.yiTiXianJine} 鍏僠" :title="item.zhiChuShouRuName" :label="item.remark"
+							:key="index" v-for="(item,index) in imcomeInfo"></up-cell>
+					</view>
+
+					<view class="tool_content" v-else>
 						<up-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
 						</up-empty>
 					</view>
@@ -37,18 +43,94 @@
 </template>
 
 <script>
+	import {
+		mapActions,
+		mapGetters,
+		mapMutations
+	} from 'vuex'
 	export default {
-		onLoad() {
-			let that = this
-			that.identity = this.$db.get('identity')
-		},
 		data() {
 			return {
-				identity: ''
+				// identity: '',
+				imcomeInfo: null,
+				pageIndex: 1,
+				pageSize: 20,
+				// balance: '0.00'
+			}
+		},
+		onLoad() {
+			let that = this
+			// that.identity = this.$db.get('identity')
+			// this.userInfo = this.$db.get('userInfo') || {}
+			// uni.getStorage({
+			// 	key: 'identity',
+			// 	success: function(res) {
+			// 		that.identity = res.data
+			// 		if (res.data == 'worker') {
+			// 			if (that.userInfo.userWorker) {
+			// 				that.balance = that.$common.moneySub(that.userInfo.userWorker.tiXianZonge, that.userInfo.userWorker.yiTiXianJine)
+			// 			}
+			// 		} else {
+			// 			if (that.userInfo.userCompany) {
+			// 				that.balance = that.userInfo.userCompany.chongZhiYue ? that.userInfo.userCompany.chongZhiYue : '0.00'
+			// 			}
+			// 		}
+			// 	}
+			// });
+		},
+		onShow(){
+			this.PostMyTiXianDetailListPage()
+		},
+		computed:{
+			...mapGetters(['userInfo', 'identity']),
+			
+			balance() {
+				if (this.identity == 'worker') {
+					if (this.userInfo.userWorker) {
+						return this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, this.userInfo
+							.userWorker
+							.yiTiXianJine)
+					} else {
+						return '0.00'
+					}
+				} else {
+					if (this.userInfo.userCompany) {
+						return this.userInfo.userCompany.chongZhiYue ? this.userInfo.userCompany
+							.chongZhiYue :
+							'0.00'
+					} else {
+						return '0.00'
+					}
+				}
 			}
 		},
 		methods: {
-
+			PostMyTiXianDetailListPage() {
+				let obj = {
+					pageIndex: this.pageIndex,
+					pageSize: this.pageSize
+				}
+				this.$api.PostMyTiXianDetailListPage(obj).then(res => {
+					this.imcomeInfo = res.data.items
+					console.log(res, this.imcomeInfo, '==============');
+				})
+			},
+			toIncome() {
+				uni.navigateTo({
+					url: '/pages/income/income'
+				})
+			},
+			goMoney() {
+				if (this.identity == 'enterprise') {
+					// uni.navigateTo({
+					// 	url: '/pages/wallet/withdrawal'
+					// })
+				} else {
+					uni.navigateTo({
+						url: '/pages/wallet/recharge'
+					})
+				}
+			}
 		}
 	}
 </script>
@@ -87,7 +169,7 @@
 		}
 	}
 
-	@import './mine.scss';
+	// @import './mine.scss';
 
 	.money_bag {
 		background: #fff;
@@ -103,13 +185,15 @@
 		.tool_title {
 			padding: 30rpx;
 			border-bottom: 2rpx solid #eee;
+
 			.title {
 				color: #333;
 				font-size: 32rpx;
 				font-weight: 700;
 			}
-			.title_right{
-				color:#939499;
+
+			.title_right {
+				color: #939499;
 			}
 		}
 

--
Gitblit v1.9.1