1
xuxy
2024-06-24 2e05e553f0caadf3d4ed9def5c922709f6ff942e
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
<template>
    <!-- 联系我们 -->
    <!--  -->
    <view class="contact-container">
        <!-- todo 图片 -->
        <!-- <image :src="env.httpBaseUri + '/schoolgo/images/contact.png'"></image> -->
        <image src="../../../static/imgs/footer/footer-brand-icon.png" mode="aspectFit" class="top-image"></image>
        <view class="container">
            <image @longpress="bc_code"
                :src="codeimg"
                mode="widthFix" class="code"></image>
            <view class="info">
                <view class="desc">长按保存客服二维码</view>
                <!-- <view class="main">
                    王老师 18767626544
                </view> -->
                <view class="main">
                    19709902289
                </view>
                <view class="desc">客服电话</view>
 
            </view>
        </view>
    </view>
</template>
 
<script>
    import env from '@/environments/index.js'
 
    export default {
        data() {
            return {
                codeimg:'https://xy-go.oss-cn-beijing.aliyuncs.com/7b/7b1be37bb6904696b1c7bb46dcff4b88go-kf.jpg'
            }
        },
        methods: {
            bc_code() {
                let that = this;
                //console.log('保存二维码')
                uni.downloadFile({ //获得二维码的临时地址
                    url: this.codeimg,
                    success: (res) => {
                        //console.log('获取url',res)
                        if (res.statusCode == 200) {
                            uni.saveImageToPhotosAlbum({
                                filePath: res.tempFilePath, //传入临时地址
                                success() {
                                    that.$message.showToast('保存成功') //封装的提示
                                },
                                fail() {
                                    that.$message.showToast('保存失败')
                                }
                            })
                        }
                    },
                    fail() {
                        that.$message.showToast('保存失败')
                    }
                })
            },
        }
    }
</script>
 
<style lang="scss" scoped>
    .contact-container {
        position: relative;
 
        .container {
            position: absolute;
            top: 278rpx;
            // width: 694rpx;
            left: 30rpx;
            right: 30rpx;
            min-height: 712rpx;
            background: #FFFFFF;
            border-radius: 20rpx;
 
            .code {
                margin-left: auto;
                margin-right: auto;
                margin-top: 54rpx;
                width: 592rpx;
                // height: 292rpx;
                margin-bottom: 32rpx;
                display: block;
            }
 
            .info {
                text-align: center;
 
                .desc {
                    font-weight: 400;
                    font-size: 28rpx;
                    color: #666666;
                    line-height: 40rpx;
                    font-style: normal;
                    margin-bottom: 20rpx;
                }
 
                .main {
                    font-weight: 600;
                    font-size: 36rpx;
                    color: #000000;
                    margin-bottom: 6rpx;
                }
            }
        }
 
        .top-image {
            width: 418rpx;
            height: 228rpx;
            position: absolute;
            top: 76rpx;
            left: 50%;
            transform: translateX(-50%);
 
        }
    }
</style>