<template>
  <div class="pageDetail">
    <yx-navbar :isBack="true" :title="title"></yx-navbar>
    <iframe class="iframe" v-if="src" :src="src" frameborder="0"></iframe>
  </div>
</template>
<script>
import Cookies from 'js-cookie'
import {setToken} from "@/util";
import {appDetail} from "@/common/api";
export default {
  data() {
    return {
      title: '详情',
      src: '',
    }
  },
  onLoad(options) {
    this.title = options.title
    appDetail({appId: options.id}).then(res => {
      let {createUserId, appName} = res.data
      let token = Cookies.get('congress')
      let userInfo = this.$store.state.$userInfo
      this.src = `${window._CONFIG.APP_READY}?path=miniapp&appid=${options.id}&token=${token}#/newbi/auth`
      window.$sensors.track('appPreview', {
        tenant_id: userInfo.tenantId, // 租户id
        attr1: appName, // 应用名称
        attr2: options.id, // 应用id
        attr3: createUserId, // 创建人id
      });
    })
  }
}
</script>
<style>
</style>