zhangwei
2024-09-11 4eef04aa662cf4f8fbde60ca99c0011b6203c558
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<template>
    <view class="full-page">
        <view class="content">
            <view class="balance">
                <view class="header chuany-flex chuany-justify-between chuany-align-center">
                    <view class="left">
                        <view class="c-p-b-16">
                            {{identity=='enterprise'?"企业余额(元)":'收入余额(元)'}}
                        </view>
                        <text class="chuany-font50 fs-weight__500">{{balance}}</text>
                    </view>
                    <view class="right">
                        <up-button type="warning" size="small" shape="circle" @click="goMoney" v-if="identity!=='enterprise'"
                            text="提现"></up-button>
                    </view>
                </view>
            </view>
 
            <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>
                        </view>
                        <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="" 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>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        onLoad() {
            let that = this
            that.identity = this.$db.get('identity')
        },
        data() {
            return {
                identity: '',
                imcomeInfo: null,
                pageIndex: 1,
                pageSize: 20,
                balance: '0.00'
            }
        },
        onLoad() {
            let that = this
            this.userInfo = this.$db.get('userInfo') ? JSON.parse(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'
                        }
                    }
                }
            });
            this.PostMyTiXianDetailListPage()
        },
        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>
 
<style lang="scss">
    .content {
        width: 100%;
        height: 390rpx;
        background-color: #fed244;
        box-sizing: border-box;
        padding: 50rpx 22rpx 0 22rpx;
 
        .balance {
            width: 100%;
            height: 100%;
            box-sizing: border-box;
            background-color: #fff;
            border-radius: 20rpx 20rpx 0 0;
            padding: 30rpx;
 
            .header {
                width: 100%;
                height: 85%;
                box-sizing: border-box;
                border: 1px solid #eeeff4;
                border-radius: 15rpx;
                padding: 25rpx;
                background-image: linear-gradient(to bottom, #f4f5fc, #ffffff);
 
                .left {}
 
                .right {
                    width: 130rpx;
                }
            }
        }
    }
 
    // @import './mine.scss';
 
    .money_bag {
        background: #fff;
        border-radius: 16rpx;
        margin-top: 30rpx;
        // padding: 20rpx 30rpx;
        position: relative;
        // top: 25rpx;
        z-index: 2;
    }
 
    .tool_wrap {
        .tool_title {
            padding: 30rpx;
            border-bottom: 2rpx solid #eee;
 
            .title {
                color: #333;
                font-size: 32rpx;
                font-weight: 700;
            }
 
            .title_right {
                color: #939499;
            }
        }
 
        .tool_content {
            padding: 30rpx 0;
        }
    }
</style>