From 0c9b00f333f9baaffa9140fd1808a26e0af8416b Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期四, 05 九月 2024 17:19:07 +0800
Subject: [PATCH] 一些错误更改
---
src/pages/mine/index.vue | 264 ++++++++++++++++++++++++----------------------------
1 files changed, 124 insertions(+), 140 deletions(-)
diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue
index e915b68..84c9e81 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,9 +79,8 @@
<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="navTap" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
+ <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">
<view class="nav-title">
<view :class="'iconfont ' + item.icon"></view>
@@ -90,13 +94,13 @@
</view>
</view>
<view class="nav-box" v-else>
- <view @tap="navTap" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
+ <view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
v-for="(item, index) in navList1" :key="item.name">
<view class="nav-title">
<view :class="'iconfont ' + item.icon"></view>
{{ item.name }}
</view>
-
+
<view class="nav-icon">
<view v-if="item.num || item.num === 0">{{ item.num }}</view>
<view class="iconfont iconarrow"></view>
@@ -109,196 +113,176 @@
</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: function() {
- uni.navigateTo({
- url: '/mine/setting/index'
- });
- }
- }
+ // {
+ // icon: 'icon-huabanfuben',
+ // name: '宸ヤ汉鎵撳崱璁板綍',
+ // cb: function() {
+ // uni.navigateTo({
+ // url: '/pages/company/index'
+ // });
+ // }
+ // },
],
navList1: [{
- icon: 'icon-dingdan',
- name: '鎴戠殑璁㈠崟',
- num: 0,
+ icon: 'icon-wanshanxinxi',
+ name: '瀹屽杽璧勬枡',
cb: function() {
uni.navigateTo({
- url: '/pages/collect/collect'
+ url: '/pages/mine/apply'
});
}
},
-
+ {
+ icon: 'icon-dingdan',
+ name: '鎴戠殑宸ヤ綔',
+ cb: this.toMyWork
+ },
{
icon: 'icon-fuwutuandui',
- name: '鏈嶅姟涓績',
- cb: function() {
- uni.navigateTo({
- url: '/pages/webview/webview?targetUrl=' + encodeURIComponent(l +
- '/service/index')
- });
- }
+ name: '宸ヤ綔璁板綍',
+ cb: this.toMyRecord
},
- {
- icon: 'icon-huabanfuben',
- name: '鐢ㄦ埛璁剧疆',
- cb: function() {
- uni.navigateTo({
- url: '/mine/setting/index'
- });
- }
- }
],
- 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') {
+ 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: function() {
- this.resourceBanner();
- this.isLogin = true;
- },
- onShareAppMessage: function() {
- return {
- title: '姣忔棩绛惧埌棰嗛潚璞嗭紝鐖嗘濂界墿0鍏冨緱>>',
- imageUrl: 'https://qiniu-image.qtshe.com/early1024/share_qiandao.png',
- path: '/pages/index/index?pt=8'
- };
+ // 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;
},
methods: {
tologin() {
- uni.navigateTo({
- url: '/pages/login/index'
- })
+ if (this.isLogin) {
+ uni.navigateTo({
+ url: '/pages/mine/mine'
+ })
+ } else {
+ uni.navigateTo({
+ url: '/pages/login/index'
+ })
+ }
},
toOrder() {
+ if (!this.userInfo.userCompany) {
+ this.$util.showToast({
+ title: '璇峰厛瀹屽杽浼佷笟璧勬枡锛�'
+ })
+ return
+ }
uni.navigateTo({
url: '/pages/order/order'
})
},
toRelease() {
+ if (!this.userInfo.userCompany) {
+ this.$util.showToast({
+ title: '璇峰厛瀹屽杽浼佷笟璧勬枡锛�'
+ })
+ return
+ }
uni.navigateTo({
url: '/pages/release/index'
})
},
- toEnterprise(){
+ toEnterprise() {
uni.navigateTo({
url: '/pages/enterprise/index'
})
},
- checkToken: function(t) {},
-
- loginOutInit: function() {},
-
- getQtbaoMoney: function() {},
-
- checkNumber: function(t) {},
-
- getSignInfo: function(t) {},
-
- changRole: function() {
+ toWorkerRecord() {
+ if (!this.userInfo.userCompany) {
+ this.$util.showToast({
+ title: '璇峰厛瀹屽杽浼佷笟璧勬枡锛�'
+ })
+ return
+ }
+ uni.navigateTo({
+ url: '/pages/company/index'
+ });
+ },
+ toMyWork() {
+ if (!this.userInfo.userWorker) {
+ this.$util.showToast({
+ title: '璇峰厛瀹屽杽璧勬枡锛�'
+ })
+ return
+ }
+ uni.navigateTo({
+ url: '/pages/order/myorder'
+ });
+ },
+ toMyRecord(){
+ if (!this.userInfo.userWorker) {
+ this.$util.showToast({
+ title: '璇峰厛瀹屽杽璧勬枡锛�'
+ })
+ return
+ }
+ uni.navigateTo({
+ url: '/pages/checkin/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') {
+ if (this.userInfo.userWorker) {
+ this.balance = this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, this.userInfo.userWorker
+ .yiTiXianJine)
+ }
+ } else {
+ if (this.userInfo.userCompany) {
+ 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