<template>
  <web-view :src="url"></web-view>
</template>
 
<script setup>
import { ref } from 'vue'
import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'

const url = ref('')

onLoad((options) => {
  // 传入需要跳转的链接 使用web-view标签进行跳转
  url.value = decodeURIComponent(options.url)

  wx.showShareMenu({
    withShareTicket: true,
    menus: ['shareAppMessage', 'shareTimeline']
  })
  onShareAppMessage(() => {
    return {
      title: options?.title || '门墩儿 专注顶尖招聘',
      path: '/pages/addWebView/index?url=' + url.value
    }
  })
  onShareTimeline(() => {
    return {
      title: options?.title || '门墩儿 专注顶尖招聘',
      path: '/pages/addWebView/index?url=' + url.value
    }
  })
})

</script>