-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
71 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ module.exports = { | |
presets: [ | ||
['taro', { | ||
framework: 'react', | ||
ts: true | ||
}] | ||
] | ||
ts: true, | ||
}], | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
module.exports = { | ||
env: { | ||
NODE_ENV: '"development"' | ||
NODE_ENV: '"development"', | ||
}, | ||
defineConstants: { | ||
}, | ||
mini: {}, | ||
h5: {} | ||
h5: {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default definePageConfig({ | ||
navigationBarTitleText: '首页' | ||
navigationBarTitleText: '首页', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default definePageConfig({ | ||
navigationBarTitleText: '登录' | ||
navigationBarTitleText: '登录', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
import { View, Button } from '@tarojs/components' | ||
import { Button, View } from '@tarojs/components' | ||
import history from 'taro-history' | ||
import Taro from '@tarojs/taro' | ||
import { ACCESS_TOKEN_KEY } from '../const' | ||
|
||
|
||
const Index = () => { | ||
return ( | ||
function Index() { | ||
return ( | ||
<View className='index'> | ||
<Button onClick={() => { | ||
Taro.showLoading({ | ||
title: '正在登录', | ||
mask: true, | ||
}) | ||
|
||
setTimeout(() => { | ||
Taro.hideLoading() | ||
Taro.showToast({title: '登录成功', mask: true }) | ||
Taro.showToast({ title: '登录成功', mask: true }) | ||
Taro.setStorageSync(ACCESS_TOKEN_KEY, '123') | ||
setTimeout(() => { | ||
history.reLaunch('index/index') | ||
}, 1000); | ||
}, 2000); | ||
}, 1000) | ||
}, 2000) | ||
}} | ||
>点击登录</Button> | ||
</View> | ||
) | ||
|
||
) | ||
} | ||
|
||
export default Index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default definePageConfig({ | ||
navigationBarTitleText: '订单详情' | ||
navigationBarTitleText: '订单详情', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
import { useState } from 'react' | ||
import { View, Button, Text } from '@tarojs/components' | ||
import { Button, Text, View } from '@tarojs/components' | ||
import history, { getParams } from 'taro-history' | ||
import Taro from '@tarojs/taro' | ||
|
||
|
||
const OrderDetail = () => { | ||
const [count, setCount] = useState(0) | ||
const {order_id} = getParams<{order_id: string }>() | ||
return ( | ||
function OrderDetail() { | ||
const { order_id } = getParams<{ order_id: string }>() | ||
return ( | ||
<View className='index'> | ||
<Button onClick={() => { | ||
console.log(Taro) | ||
history.push('index/index') | ||
}} | ||
>跳到首页</Button> | ||
<Button onClick={() => setCount(c => c + 1)}>-</Button> | ||
<Button onClick={() => setCount(c => c - 1)}>+</Button> | ||
<Text> order:id: {order_id}</Text> | ||
</View> | ||
) | ||
|
||
) | ||
} | ||
|
||
export default OrderDetail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default definePageConfig({ | ||
navigationBarTitleText: '订单搜索' | ||
navigationBarTitleText: '订单搜索', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
import { View, Button, Text, Input } from '@tarojs/components' | ||
import { Button, Input, Text, View } from '@tarojs/components' | ||
import { useState } from 'react' | ||
import history, { getParams } from 'taro-history' | ||
|
||
|
||
const Order = () => { | ||
function Order() { | ||
const [q, setQ] = useState('优衣库') | ||
const {order_id} = getParams<{order_id: string }>() | ||
return ( | ||
const { order_id } = getParams<{ order_id: string }>() | ||
return ( | ||
<View className='index'> | ||
<Button onClick={history.pushBind('index/index')}>跳到首页</Button> | ||
<Button onClick={() => { | ||
history.push('order/detail', { order_id: 'xxx123'}) | ||
history.push('order/detail', { order_id: 'xxx123' }) | ||
}} | ||
>跳到详情</Button> | ||
<Button onClick={history.pushBind('order/search', { q: q || '优衣库' })}>跳到搜索</Button> | ||
<Input value={q} onInput={e => setQ(e.detail.value)} placeholder='请输入搜索内容' /> | ||
<Text> order:id: {order_id}</Text> | ||
</View> | ||
) | ||
|
||
) | ||
} | ||
|
||
export default Order |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default definePageConfig({ | ||
navigationBarTitleText: '订单详情' | ||
navigationBarTitleText: '订单详情', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters