zhangwei
2024-08-27 71d2e42ae642cecb5e8f6776c702cd20bafe6c01
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
<template>
    <view>
        <view class='chuany-flex camera-fill chuany-justify-center chuany-align-center'>
            <fui-upload immediate :url="`${apiBaseUrl}api/UpFile/UpdateFile`" ref="uploadB" max='1' @success="success"
                @error="error" @complete="complete" width="300" height="300">
                <image v-if="src" :src="src" mode="widthFix" style="width: 300rpx;height: 300rpx;"></image>
                <fui-icon v-else name="camera-fill"></fui-icon>
            </fui-upload>
        </view>
        <view class="c-m-30 c-p-t-20 c-p-b-20">
            为了保证打卡的正确性,‌建议在公司门口或进入办公室的门口再打卡。‌同时,‌确保照片的清晰、‌明亮,‌面部可见。
        </view>
        <view class="c-p-20">
            <view class="chuany-flex chuany-justify-between c-p-t-20">
                <view class="chuany-flex chuany-flex-direction chuany-align-center textclo chuany-font24 step_item"
                    v-for="(item,index) in 4">
                    <up-avatar shape="square" size="38" src="https://uview-plus.jiangruyi.com/album/1.jpg"
                        @click="previewImage"></up-avatar>
                    <view class="line line-active" v-if="index!==3">
 
                    </view>
                    <up-icon name="checkmark-circle-fill" color="#2979ff" size="22"></up-icon>
                    <text>已打卡</text>
                    <text>10:00</text>
                </view>
 
            </view>
        </view>
        <view class="tabbtns">
            <up-button color='#fece01' class="text-69" text="确认打卡" @click="enroll"></up-button>
        </view>
    </view>
</template>
 
<script>
    import {
        apiBaseUrl
    } from '@/common/setting/constVarsHelper.js';
    export default {
        data() {
            return {
                src: ''
            }
        },
        onLoad(option) {
            let {
                orderid
            } = option
            this.$api.getDaka({
                orderId: orederid
            }).then(res => {
                console.log(res, '打卡');
            })
        },
        methods: {
            openCamera() {
                console.log('-----------------')
                // 拍照和相册
                uni.chooseImage({
                    count: 1,
                    sizeType: ["original", "compressed"],
                    sourceType: ["camera"],
                    success: (res) => {
                        const {
                            tempFilePaths
                        } = res;
                        console.log(tempFilePaths);
                    },
                });
 
            },
            success(e) {
                //e.res 为服务器返回数据
                //上传成功回调,处理服务器返回数据【此处根据实际返回数据进行处理】
                let res = JSON.parse(e.res.data.replace(/\ufeff/g, "") || "{}")
                console.log(res.data);
                if (res.data.url) {
                    enterpriseInfo.businessLicense = res.data.url
                    enterpriseInfo.suppliername = res.data.info.name //企业名称
                    enterpriseInfo.regtime = res.data.info.setDate //注册时间
                    enterpriseInfo.address = res.data.info.address //联系地址
                    enterpriseInfo.suppliercode = res.data.info.regNum //企业注册号
                    enterpriseInfo.contact = res.data.info.person //联系人
                }
            },
            error() {
 
            },
            complete(e) {
                if (e.action == 'delete') {
                    // 删除处理
                }
                console.log(e, '删除')
            },
            previewImage() {
                uni.previewImage({
                    urls: ['https://uview-plus.jiangruyi.com/album/1.jpg']
                })
            }
        }
    }
</script>
 
<style lang="scss">
    .camera-fill {
        width: 400rpx;
        height: 400rpx;
        margin: 20rpx auto;
        border-radius: 20rpx;
    }
 
    .step_item {
        position: relative;
        /* width: 144rpx; */
        display: flex;
 
        .line {
            position: absolute;
            top: 92rpx;
            left: 52rpx;
            content: "";
            height: 4rpx;
            width: 192rpx;
            background-color: #e9e8e8;
        }
 
        .line-active {
            background-color: #2979ff;
        }
    }
</style>