<template>
  <div class="member-banner">
    <cr-image
      src="@/assets/images/maxMember/member-benefit.png"
      width="100%"
      height="auto"
      @click="jumpToCardBag"
    />
  </div>
</template>
<script>
import { isApp, isWxMp } from '@/service/validation.service';
// import mpBridge from '@/service/mp';
// import localStorage from '@/service/localStorage.service';
export default {
  props: {
    vccJumpUrl: String
  },
  data() {
    return {};
  },
  methods: {
    jumpToCardBag() {
      // const token = localStorage.get('vccToken');
      // const registerFrom = localStorage.get('registerFrom');
      // const appChannel = localStorage.get('appChannel');
      // this.vccJumpUrl = this.vccJumpUrl.replace(/{registerFrom}/, registerFrom);
      // this.vccJumpUrl = this.vccJumpUrl.replace(/{token}/, token);
      // this.vccJumpUrl = this.vccJumpUrl.replace(/{appChannel}/, appChannel);
      // this.vccJumpUrl = this.vccJumpUrl.replace(/{appName}/, appChannel);
      // window.location.href = this.vccJumpUrl;
      if (isApp) {
        this.$bridge.openNewUrl({
          data: {
            newUrl: this.vccJumpUrl
          }
        });
      } else if (isWxMp) {
        return;
      }
    }
  }
};
</script>

<style lang="less" scoped>
.member-banner {
  margin: @padding-sm auto;
}
</style>
