Commit 8d86221b by lirandong

fix

parent 45ac19a1
...@@ -14,9 +14,7 @@ import token from './constants/token' ...@@ -14,9 +14,7 @@ import token from './constants/token'
/** 初始化 tokne */ /** 初始化 tokne */
!(async () => { !(async () => {
await token.init() await token.init()
console.log('1111')
Taro.render(<App />, document.getElementById('app')) Taro.render(<App />, document.getElementById('app'))
console.log('done')
})() })()
const store = configStore() const store = configStore()
...@@ -31,8 +29,8 @@ class App extends Component { ...@@ -31,8 +29,8 @@ class App extends Component {
config: Config = { config: Config = {
pages: [ pages: [
'pages/index/index', 'pages/index/index',
'pages/login/index', // 'pages/login/index',
'pages/home/index', // 'pages/home/index',
'pages/home/device/index', 'pages/home/device/index',
'pages/home/tempaltes/index', 'pages/home/tempaltes/index',
'pages/home/user/index' 'pages/home/user/index'
...@@ -43,47 +41,28 @@ class App extends Component { ...@@ -43,47 +41,28 @@ class App extends Component {
navigationBarTitleText: 'Taro Demo', navigationBarTitleText: 'Taro Demo',
navigationBarBackgroundColor: '#fff' navigationBarBackgroundColor: '#fff'
}, },
// tabBar: { tabBar: {
// list: [ list: [
// { {
// pagePath: 'pages/home/tempaltes/index', pagePath: 'pages/home/tempaltes/index',
// text: '模板市场', text: '模板市场',
// iconPath: './constants/images/market.png', iconPath: './constants/images/market.png',
// selectedIconPath: './constants/images/market_ac.png' selectedIconPath: './constants/images/market_ac.png'
// }, },
// { {
// pagePath: 'pages/home/device/index', pagePath: 'pages/home/device/index',
// text: '设备与视片', text: '设备与视片',
// iconPath: './constants/images/device.png', iconPath: './constants/images/device.png',
// selectedIconPath: './constants/images/device_ac.png' selectedIconPath: './constants/images/device_ac.png'
// }, },
// { {
// pagePath: 'pages/home/user/index', pagePath: 'pages/home/user/index',
// text: '个人中心', text: '个人中心',
// iconPath: './constants/images/personal.png', iconPath: './constants/images/personal.png',
// selectedIconPath: './constants/images/personal_ac.png' selectedIconPath: './constants/images/personal_ac.png'
// } }
// ] ]
// } }
tabBar:
process.env.TARO_ENV !== 'rn'
? {
list: [
{
pagePath: 'pages/home/tempaltes/index',
text: '模板市场'
},
{
pagePath: 'pages/home/device/index',
text: '设备与视片'
},
{
pagePath: 'pages/home/user/index',
text: '个人中心'
}
]
}
: undefined
} }
// 在 App 类中的 render() 函数没有实际作用 // 在 App 类中的 render() 函数没有实际作用
......
...@@ -10,7 +10,7 @@ export function concatParam(data: any): string { ...@@ -10,7 +10,7 @@ export function concatParam(data: any): string {
export const MyStorage = { export const MyStorage = {
async getItem({ key }) { async getItem({ key }) {
if (Taro.getEnv() === Taro.ENV_TYPE.RN) { if (process.env.TARO_ENV === 'rn') {
const data = await AsyncStorage.getItem(key) const data = await AsyncStorage.getItem(key)
return Promise.resolve({ data }) return Promise.resolve({ data })
} else { } else {
...@@ -19,7 +19,7 @@ export const MyStorage = { ...@@ -19,7 +19,7 @@ export const MyStorage = {
}, },
setItem({ key, data }: Taro.setStorage.Param) { setItem({ key, data }: Taro.setStorage.Param) {
if (Taro.getEnv() === Taro.ENV_TYPE.RN) { if (process.env.TARO_ENV === 'rn') {
return AsyncStorage.setItem(key, data) return AsyncStorage.setItem(key, data)
} else { } else {
return Taro.setStorage({ key, data }) return Taro.setStorage({ key, data })
......
...@@ -11,9 +11,10 @@ class Index extends Component { ...@@ -11,9 +11,10 @@ class Index extends Component {
} }
render() { render() {
const isLogin = token.isLogon() return <View />
// const isLogin = token.isLogon()
// console.log({ isLogin }) // console.log({ isLogin })
return <View style={{ height: '100%', width: '100%' }}>{isLogin ? <Home /> : <Login />}</View> // return <View style={{ height: '100%', width: '100%' }}>{isLogin ? <Home /> : <Login />}</View>
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment