1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import { Component } from 'react'
- import tool from './common/tool'
- import Taro, { getCurrentInstance } from '@tarojs/taro'
- import './app.less'
- class App extends Component {
- $instance = getCurrentInstance()
- componentDidMount () { }
- componentDidShow () {
- }
- onLaunch () {
-
-
-
- Taro.setKeepScreenOn({
- keepScreenOn: true
- })
-
- let params = this.$instance.router.params
- if (params.scene) {
- let _scene = decodeURIComponent(params.scene)
- const arr = _scene.split("=");
- const result1 = arr[1].split("&")[0];
- const result2 = arr[2];
- Taro.setStorageSync('channel_name', result1)
- Taro.setStorageSync('source_name', result2)
- }
- let item = params
- if (params.c) {
- Taro.setStorageSync('channel_name', item.c)
- }
- if (params.s) {
- Taro.setStorageSync('source_name', item.s)
- }
- console.log('app启动');
- if (!Taro.getStorageSync('session_key')) {
- tool.toLogin();
- }else{
- tool.reportLogin()
- }
- Taro.setKeepScreenOn({
- keepScreenOn: true
- })
- }
- componentDidHide () { }
- render () {
-
- return this.props.children
- }
- }
- export default App
|