From a2ddd3bec584b6eb91ab8845353fdb40c9b37ebe Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期一, 02 九月 2024 17:22:17 +0800
Subject: [PATCH] 初步完成

---
 src/pages/mine/index.vue |  162 +++++++++++++++++------------------------------------
 1 files changed, 53 insertions(+), 109 deletions(-)

diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue
index 0384180..317d6d9 100644
--- a/src/pages/mine/index.vue
+++ b/src/pages/mine/index.vue
@@ -3,9 +3,8 @@
 		<view class="header">
 			<view class="header-img">
 				<view class="header-image-left" @click='tologin'>
-					<image lazyLoad @tap="chooseImage" data-ptpid="4c7f-1f6c-b145-b80f"
-						:src="avatarUrl + '?imageView2/0/w/180'" v-if="avatarUrl"></image>
-					<view class="header-name">{{ userName || (isLogin ? '鏆傛棤灏忎富淇℃伅' : '鐧诲綍寮�鍚禋閽变箣鏃呭摝') }}</view>
+					<up-avatar :src="userInfo.avatar" shape="circle" size='60'></up-avatar>
+					<view class="header-name">{{ userInfo.nickname || (isLogin ? '鏆傛棤灏忎富淇℃伅' : '鐧诲綍寮�鍚禋閽变箣鏃呭摝') }}</view>
 				</view>
 				<view @tap="changRole" class="header-image-right chuany-flex chuany-align-center chuany-justify-center"
 					data-ptpid="e758-138d-b914-343f">
@@ -15,7 +14,7 @@
 			</view>
 			<view class="num-box">
 				<view @tap="goWallet" class="num-item" data-ptpid="ef57-17f4-bbea-280f">
-					<view class="num-bold">{{ money }}鍏�</view>
+					<view class="num-bold">{{ balance }}鍏�</view>
 					<view class="num-text">
 						<text class="c-m-r-10">{{ identity=='enterprise' ? '浼佷笟浣欓' : '绔嬪嵆鎻愮幇' }}</text>
 						<up-icon name="arrow-right-double"></up-icon>
@@ -47,12 +46,18 @@
 							鎴戠殑浼佷笟
 						</view>
 					</view>
-					<view class="tool_item" @click="toPage('/otherPages/member/sendCompany/sendCompany')">
+					<view class="tool_item" @click="toWorkerRecord">
+						<image src="@/static/image/record.png" mode="aspectFit" class="item_img"></image>
+						<view class="tool_label">
+							鎵撳崱璁板綍
+						</view>
+					</view>
+					<!-- <view class="tool_item" @click="toPage('/otherPages/member/sendCompany/sendCompany')">
 						<image src="@/static/image/server.png" mode="aspectFit" class="item_img"></image>
 						<view class="tool_label">
 							鏈嶅姟涓績
 						</view>
-					</view>
+					</view> -->
 				</view>
 			</view>
 		</view>
@@ -74,7 +79,6 @@
                 <view class="text">宸插畬鎴�</view>
             </view>
         </view> -->
-		<inner-banner className="mg32" :list="bannerList" ptpId="1ab7-1b95-8e0e-3b22"></inner-banner>
 		<view class="nav-box" v-if="identity=='enterprise'">
 			<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
 				v-for="(item, index) in navList" :key="item.name">
@@ -109,45 +113,22 @@
 </template>
 
 <script>
-	var n = ['https://qiniu-image.qtshe.com/719defaultAvatar1.png', 'https://qiniu-image.qtshe.com/719defaultAvatar2.png',
-		'https://qiniu-image.qtshe.com/719defaultAvatar3.png'
-	];
 	var app = getApp();
 	export default {
 
 		data() {
 			return {
 				identity: '',
-				money: '0.00',
-				score: 0,
-				perfectResume: false,
-				bannerList: [],
 				navList: [
-					//            {
-					//                icon: 'iconmy_collect_normal',
-					//                name: '鎴戠殑鏀惰棌',
-					//                num: 0,
-					//                cb: function () {
-					//                    uni.navigateTo({
-					//                        url: '/pages/collect/collect'
-					//                    });
-					//                }
-					//            },
-
-					//            {
-					//                icon: 'iconmy_new_normal',
-					//                name: '鏈嶅姟涓績',
-					//                cb: function () {
-					// 	uni.navigateTo({
-					// 		url: '/pages/webview/webview?targetUrl=' + encodeURIComponent(l + '/service/index')
-					// 	});
-					// }
-					//            },
-					// {
+					// 	{
 					// 	icon: 'icon-huabanfuben',
-					// 	name: '鐢ㄦ埛璁剧疆',
-					// 	cb: this.pushImg
-					// }
+					// 	name: '宸ヤ汉鎵撳崱璁板綍',
+					// 	cb: function() {
+					// 		uni.navigateTo({
+					// 			url: '/pages/company/index'
+					// 		});
+					// 	}
+					// },
 				],
 				navList1: [{
 						icon: 'icon-dingdan',
@@ -158,7 +139,6 @@
 							});
 						}
 					},
-
 					{
 						icon: 'icon-fuwutuandui',
 						name: '宸ヤ綔璁板綍',
@@ -168,48 +148,37 @@
 							});
 						}
 					},
-					// {
-					// 	icon: 'icon-huabanfuben',
-					// 	name: '鐢ㄦ埛璁剧疆',
-					// 	cb: function() {
-
-					// 	}
-					// }
 				],
-				userApplyStatistics: {
-					allCount: 0,
-					hasApplyCount: 0,
-					applyOngoingCount: 0,
-					applySuccessCount: 0
-				},
-				isDialog: false,
-				signInfo: {
-					attendanceNumber: '',
-					attendanceIntegralList: '',
-					attendanceTotal: '',
-					beansList: ''
-				},
-				beansList: [5, 5, 5, 5, 50, 5, 100],
-				attendance: false,
-				userName: '',
-				avatarUrl: 'https://qiniu-image.qtshe.com/719defaultAvatar2.png',
 				isLogin: false,
+				userInfo: {},
+				balance: '0.00'
 			};
 		},
 		onLoad: function() {
+
+
+		},
+		onShow: function() {
 			let that = this
-			uni.hideShareMenu();
+			this.userInfo = this.$db.get('userInfo') ? JSON.parse(this.$db.get('userInfo')) : {}
+			this.token = this.$db.get('userToken') ? this.$db.get('userToken') : ''
 			uni.getStorage({
 				key: 'identity',
 				success: function(res) {
 					that.identity = res.data
+					if (res.data == 'worker') {
+						that.balance = that.$common.moneySub(that.userInfo.userWorker.tiXianZonge, that
+							.userInfo.userWorker.yiTiXianJine)
+					} else {
+						console.log(that.identity, that.userInfo.userWorker.tiXianZonge,
+							'userInfo.userWorker.tiXianZonge');
+						that.balance = that.userInfo.userCompany.chongZhiYue ? that.userInfo.userCompany
+							.chongZhiYue : '0.00'
+					}
 				}
 			});
-		},
-		onShow: function() {
-			this.resourceBanner();
-
-			this.token = this.$db.get('userToken') ? this.$db.get('userToken') : ''
+			// this.userInfo = this.$db.get('userInfo') ? JSON.parse(this.$db.get('userInfo')) : {}
+			// this.token = this.$db.get('userToken') ? this.$db.get('userToken') : ''
 			this.isLogin = this.token ? true : false;
 		},
 		onShareAppMessage: function() {
@@ -257,59 +226,34 @@
 					url: '/pages/enterprise/index'
 				})
 			},
-			checkToken: function(t) {},
-
-			loginOutInit: function() {},
-
-			getQtbaoMoney: function() {},
-
-			checkNumber: function(t) {},
-
-			getSignInfo: function(t) {},
-
-			changRole: function() {
+			toWorkerRecord() {
+				uni.navigateTo({
+					url: '/pages/company/index'
+				});
+			},
+			changRole() {
 				this.identity = this.identity === 'enterprise' ? 'worker' : 'enterprise'
 				console.log(this.identity, 'this.identity');
 				uni.setStorage({
 					key: 'identity',
 					data: this.identity,
 				});
+				if (this.identity == 'worker') {
+					this.balance = this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, this.userInfo.userWorker
+						.yiTiXianJine)
+				} else {
+					this.balance = this.userInfo.userCompany.chongZhiYue ? this.userInfo.userCompany.chongZhiYue :
+						'0.00'
+				}
 			},
-
-			handleReset: function() {},
-
-			resourceBanner: function() {},
-
-			navTap: function(t) {},
-
-			loginSuccess: function() {},
-
-			chooseImage: function(t) {},
-
-			getImage: function(t) {},
-
-			goWallet: function() {
+			goWallet() {
 				uni.navigateTo({
 					url: '/pages/wallet/index',
-					fail: function(err) {
+					fail(err) {
 						console.log(err);
 					}
 				});
 			},
-
-			skipToQtsbean: function() {},
-
-			gotoMyJob: function(t) {},
-
-			// 璺宠浆鍒扮畝鍘嗗畬鍠勯〉闈�
-			skipToResume: function() {
-				uni.navigateTo({
-					url: '/mine/resume/resume',
-					fail: function(err) {
-						console.log(err);
-					}
-				});
-			}
 		}
 	};
 </script>

--
Gitblit v1.9.1