<template>
  <view class='weapp'>
    <wx-open-launch-weapp
      id="launch-btn"
      ref="launchBtn"
      :username="username"
      :path="path"
      @ready="handleReadyFn"
      @launch="handleLaunchFn"
      @error="handleErrorFn"
    >
      <script type="text/wxtag-template">
        <div class="btn" style="width: 295px;height:36px;line-height:36px;font-size:14px;color: #ffffff;border-radius: 100px;text-align: center;font-weight:500;background: #23D321;">线上云赛</div>
      </script>
    </wx-open-launch-weapp>
  </view>
</template>

<script>
export default {
  props: {
    username: {
      type: String,
      default: 'gh_512687a191f5'
    },
    path: {
      type: String,
      default: '/pages/index/index'
    }
  },
  data() {
    return {}
  },

  onLoad() {},

  onShow() {},

  methods: {
    handleErrorFn(e) {
      if (e.isTrusted == false) {
        this.$mHelper.toast('打开失败');
      }
    },
    handleLaunchFn(e) {

    },
    handleReadyFn() {
    },
  }

}
</script>

<style lang="scss" scoped>
.weapp {
  text-align: center;
}
</style>
