<template>
    <div>
        <web-view :src="webviewurl" @message="messageChanged"></web-view>
    </div>
</template>
<script setup lang="ts">
    const webviewurl = ref('https://dm.yujin.shuziyunyao.com/trainpage/pages/amap-draw/index');

    const messageChanged = (e: any) => {
        console.log('message changed', e);
        // 数组最后一项
        const lastItem = e.detail.data[e.detail.data.length - 1];
        uni.$emit('mapAreaData', lastItem);
    };
    onLoad((options: any) => {
       webviewurl.value += `?drawId=${options.drawId}&unit=${options.unit}`;
    });
</script>