<template>
  <view>

  </view>
</template>

<script>
  import {
    strToParams
  } from '@/utils/tools';
  import {
    wxMnpLogin
  } from '@/utils/login'
  export default {
    data() {
      return {
        scene: null
      };
    },
    onLoad(e) {
      const scene = strToParams(decodeURIComponent(e.scene))
      this.scene = scene
      // 优先存储 invite_code
      if (scene.i) {
        uni.setStorageSync('INVITE_CODE', scene.i)
      }
      // 产品详细页
      if (scene.p) {
        uni.redirectTo({
          url: '/pages/product_details/index?skuId=' + scene.product
        })
      }
      // 扫码下单
      if (scene.o) {
        uni.redirectTo({
          url: '/pageB/select_product/com_order?id=' + scene.o
        })
      }
      // 默认跳转首页
      else {
        uni.switchTab({
          url: '/pages/index/index'
        })
      }
    }
  }
</script>
