<template>
  <view>
    <web-view :src="url"></web-view>
  </view>
</template>

<script>
import baseConfig from '@/config/env'

export default {
  data() {
    return {
      url: ''
    }
  },
  onLoad: function (options) {
    console.log(baseConfig.webviewBaseUrl)
    const officialAccounts = {
      default: {
        url: '/app/introduce',
        name: '介绍'
      },
      userAgreement: {
        url: '/app/userAgreement',
        name: '用户协议'
      }
    }
    const item = officialAccounts[options?.type] || officialAccounts['default']
    this.url = baseConfig.webviewBaseUrl + item['url']
    console.log(this.url)
    uni.setNavigationBarTitle({
      title: item['name']
    })
  }
}
</script>
