Commit 8d86221b by lirandong

fix

parent 45ac19a1
......@@ -14,9 +14,7 @@ import token from './constants/token'
/** 初始化 tokne */
!(async () => {
await token.init()
console.log('1111')
Taro.render(<App />, document.getElementById('app'))
console.log('done')
})()
const store = configStore()
......@@ -31,8 +29,8 @@ class App extends Component {
config: Config = {
pages: [
'pages/index/index',
'pages/login/index',
'pages/home/index',
// 'pages/login/index',
// 'pages/home/index',
'pages/home/device/index',
'pages/home/tempaltes/index',
'pages/home/user/index'
......@@ -43,47 +41,28 @@ class App extends Component {
navigationBarTitleText: 'Taro Demo',
navigationBarBackgroundColor: '#fff'
},
// tabBar: {
// list: [
// {
// pagePath: 'pages/home/tempaltes/index',
// text: '模板市场',
// iconPath: './constants/images/market.png',
// selectedIconPath: './constants/images/market_ac.png'
// },
// {
// pagePath: 'pages/home/device/index',
// text: '设备与视片',
// iconPath: './constants/images/device.png',
// selectedIconPath: './constants/images/device_ac.png'
// },
// {
// pagePath: 'pages/home/user/index',
// text: '个人中心',
// iconPath: './constants/images/personal.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
tabBar: {
list: [
{
pagePath: 'pages/home/tempaltes/index',
text: '模板市场',
iconPath: './constants/images/market.png',
selectedIconPath: './constants/images/market_ac.png'
},
{
pagePath: 'pages/home/device/index',
text: '设备与视片',
iconPath: './constants/images/device.png',
selectedIconPath: './constants/images/device_ac.png'
},
{
pagePath: 'pages/home/user/index',
text: '个人中心',
iconPath: './constants/images/personal.png',
selectedIconPath: './constants/images/personal_ac.png'
}
]
}
}
// 在 App 类中的 render() 函数没有实际作用
......
......@@ -10,7 +10,7 @@ export function concatParam(data: any): string {
export const MyStorage = {
async getItem({ key }) {
if (Taro.getEnv() === Taro.ENV_TYPE.RN) {
if (process.env.TARO_ENV === 'rn') {
const data = await AsyncStorage.getItem(key)
return Promise.resolve({ data })
} else {
......@@ -19,7 +19,7 @@ export const MyStorage = {
},
setItem({ key, data }: Taro.setStorage.Param) {
if (Taro.getEnv() === Taro.ENV_TYPE.RN) {
if (process.env.TARO_ENV === 'rn') {
return AsyncStorage.setItem(key, data)
} else {
return Taro.setStorage({ key, data })
......
......@@ -11,9 +11,10 @@ class Index extends Component {
}
render() {
const isLogin = token.isLogon()
return <View />
// const isLogin = token.isLogon()
// 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