jiangping
2023-08-25 282e032b5771da13d224214d3b0b71f3efde9a42
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
<template>
    <view class="index">
        <web-view v-if="show" @onPostMessage="onMessage" :src="'https://dmtest.ahapp.net/doumeeplant_h5/#/appletLogin?code=' + code"></web-view>
        <!-- <myTabbar :index="0" /> -->
    </view>
</template>
 
<script>
    // import myTabbar from "@/components/myTabber.vue"    
    export default {
        // components: {
        //     myTabbar
        // },
        data() {
            return {
                code: '',
                show: false
            }
        },
        onLoad() {
            var that = this
            uni.login({
                provider: 'weixin',
                success: function (loginRes) {
                    // console.log(loginRes);
                    that.code = loginRes.code
                    that.show = true
                }
            });
        },
        methods: {
            onMessage(e) {
                console.log('12345654321')
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .index {
        width: 100vw;
        height: 100vh;
    }
</style>