Commit 0bf20de0 by lirandong

优化 目录

parent 606437a5
...@@ -10,7 +10,7 @@ const sassImporter = function (url) { ...@@ -10,7 +10,7 @@ const sassImporter = function (url) {
const reg = /^@styles\/(.*)/ const reg = /^@styles\/(.*)/
return { return {
file: reg.test(url) ? path.resolve(__dirname, '..', 'src/constants/styles', url.match(reg)[1]) : url file: reg.test(url) ? path.resolve(__dirname, '..', 'src/assets/styles', url.match(reg)[1]) : url
} }
} }
...@@ -29,10 +29,11 @@ const config = { ...@@ -29,10 +29,11 @@ const config = {
'@/': path.resolve(__dirname, '..', 'src'), '@/': path.resolve(__dirname, '..', 'src'),
'@/api': path.resolve(__dirname, '..', 'src/api'), '@/api': path.resolve(__dirname, '..', 'src/api'),
'@/pages': path.resolve(__dirname, '..', 'src/pages'), '@/pages': path.resolve(__dirname, '..', 'src/pages'),
'@/common': path.resolve(__dirname, '..', 'src/common'),
'@/actions': path.resolve(__dirname, '..', 'src/actions'), '@/actions': path.resolve(__dirname, '..', 'src/actions'),
'@/constants': path.resolve(__dirname, '..', 'src/constants'), '@/constants': path.resolve(__dirname, '..', 'src/constants'),
'@/conpoments': path.resolve(__dirname, '..', 'src/conpoments'), '@/conpoments': path.resolve(__dirname, '..', 'src/conpoments'),
'@styles': path.resolve(__dirname, '..', 'src/constants/styles'), '@styles': path.resolve(__dirname, '..', 'src/assets/styles'),
}, },
plugins: { plugins: {
babel: { babel: {
......
// import users from '@api/users' // import users from '@api/users'
// import { concatParam } from '@/utils/utils' // import { concatParam } from '@/utils/utils'
import { concatParam } from '../constants/utils' import { concatParam } from '../common/utils'
// import $config, { message, requestCode, tokens } from '@/config' // import $config, { message, requestCode, tokens } from '@/config'
import { axios, CancelTokenStatic, AxiosInstance } from 'taro-axios' import { axios, CancelTokenStatic, AxiosInstance } from 'taro-axios'
import { BASE_URL, FETCH_TIME_OUT, INTERFACE_REPEAT } from '../constants/counter' import { BASE_URL, FETCH_TIME_OUT, INTERFACE_REPEAT } from '../constants/counter'
import token from '../constants/token' import token from '../common/token'
const concatParamMethod = new Set(['post', 'put']) const concatParamMethod = new Set(['post', 'put'])
// let refreshTokenState = false // 刷新 token的状态 // let refreshTokenState = false // 刷新 token的状态
......
...@@ -61,6 +61,14 @@ class UsersApi extends ApiClient { ...@@ -61,6 +61,14 @@ class UsersApi extends ApiClient {
url: `/myequipment/del/info/${equipmentId}` url: `/myequipment/del/info/${equipmentId}`
}) })
} }
/** 删除设备 */
removeFilm(filmId: string) {
return this.request({
method: 'GET',
url: `/template/del/film/info/${filmId}`
})
}
} }
export default new UsersApi() export default new UsersApi()
...@@ -5,7 +5,7 @@ import { Provider } from '@tarojs/redux' ...@@ -5,7 +5,7 @@ import { Provider } from '@tarojs/redux'
import Index from './pages/index' import Index from './pages/index'
import configStore from './store' import configStore from './store'
import token from './constants/token' import token from './common/token'
import './app.scss' import './app.scss'
// import 'taro-ui/dist/style/index.scss' // import 'taro-ui/dist/style/index.scss'
...@@ -34,10 +34,11 @@ class App extends Component { ...@@ -34,10 +34,11 @@ class App extends Component {
*/ */
config: Config = { config: Config = {
pages: [ pages: [
'pages/home/user/index',
'pages/home/device/my_device/index',
'pages/home/device/index', 'pages/home/device/index',
'pages/home/device/add/index', 'pages/home/device/add/index',
'pages/home/device/my_film/index', 'pages/home/device/my_film/index',
'pages/home/user/index',
'pages/home/tempaltes/film_detail', 'pages/home/tempaltes/film_detail',
'pages/home/tempaltes/detail', 'pages/home/tempaltes/detail',
'pages/home/tempaltes/index', 'pages/home/tempaltes/index',
...@@ -56,20 +57,20 @@ class App extends Component { ...@@ -56,20 +57,20 @@ class App extends Component {
{ {
pagePath: 'pages/home/tempaltes/index', pagePath: 'pages/home/tempaltes/index',
text: '模板市场', text: '模板市场',
iconPath: './constants/images/market.png', iconPath: './assets/images/market.png',
selectedIconPath: './constants/images/market_ac.png' selectedIconPath: './assets/images/market_ac.png'
}, },
{ {
pagePath: 'pages/home/device/index', pagePath: 'pages/home/device/index',
text: '设备与视片', text: '设备与视片',
iconPath: './constants/images/device.png', iconPath: './assets/images/device.png',
selectedIconPath: './constants/images/device_ac.png' selectedIconPath: './assets/images/device_ac.png'
}, },
{ {
pagePath: 'pages/home/user/index', pagePath: 'pages/home/user/index',
text: '个人中心', text: '个人中心',
iconPath: './constants/images/personal.png', iconPath: './assets/images/personal.png',
selectedIconPath: './constants/images/personal_ac.png' selectedIconPath: './assets/images/personal_ac.png'
} }
] ]
} }
......
...@@ -31,7 +31,7 @@ export function checkPhone(phone) { ...@@ -31,7 +31,7 @@ export function checkPhone(phone) {
return /^1[3456789]\d{9}$/.test(phone.toString()) return /^1[3456789]\d{9}$/.test(phone.toString())
} }
export function myShowToast({ result, tips }: { result?: any; tips?: string }) { export function showMyToast({ result, tips }: { result?: any; tips?: string }) {
if (!result && !tips) return if (!result && !tips) return
Taro.showToast({ icon: 'none', title: result && result.msg ? result.msg : tips }) Taro.showToast({ icon: 'none', title: result && result.msg ? result.msg : tips })
} }
......
@import '@styles/var.scss';
.films-item-wrapper {
padding: 20px;
display: flex;
// margin-bottom: 40px;
flex-direction: row;
background-color: white;
}
.img-box {
width: 320px;
}
.films-item-img {
width: 100%;
height: 180px;
}
.films-item-info {
flex: 1;
display: flex;
padding-left: 20px;
flex-direction: column;
}
import { ComponentClass } from 'react'
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
import { IMilmListItme } from '@/pages/home/device/film_list'
import './index.scss'
type PageStateProps = {}
type PageDispatchProps = {}
interface PageOwnProps extends IMilmListItme {
// filmName: string
// templateUrl: string
// equipmentCount: string
onClick: () => void
}
type PageState = {
name: string
}
type IProps = PageStateProps & PageDispatchProps & PageOwnProps
interface FilmListItem {
props: IProps
state: PageState
}
class FilmListItem extends Component {
constructor(props) {
super(props)
this.state = {
name: '小红'
}
}
render() {
const { templateUrl, filmName, equipmentCount, onClick } = this.props
return (
<View className="films-item-wrapper" onClick={onClick}>
<View className="img-box">
<Image className="films-item-img" src={templateUrl} />
</View>
<View className="films-item-info">
<Text>{filmName}</Text>
<Text>播放设备数量:{equipmentCount}</Text>
</View>
</View>
)
}
}
export default FilmListItem as ComponentClass<PageOwnProps, PageState>
import { ComponentClass } from 'react'
import { View } from '@tarojs/components'
import Taro, { Component } from '@tarojs/taro'
import { getStatusBarHeight } from '../utils'
import './scss/pageView.scss'
type PageStateProps = {}
type PageDispatchProps = {}
type PageOwnProps = {
children: any
}
type PageState = {}
type IProps = PageStateProps & PageDispatchProps & PageOwnProps
interface PageView {
props: IProps
state: PageState
}
class PageView extends Component {
render() {
const StatusBarHeight = getStatusBarHeight()
return (
<View className="pageView" style={{ paddingTop: `${StatusBarHeight}px` }}>
{this.props.children}
</View>
)
}
}
export default PageView as ComponentClass<PageOwnProps, PageState>
.pageView {
width: 100%;
height: 100%;
box-sizing: border-box;
}
...@@ -2,8 +2,8 @@ import api from '@/api/index' ...@@ -2,8 +2,8 @@ import api from '@/api/index'
import { ComponentClass } from 'react' import { ComponentClass } from 'react'
import Taro, { Component, Config } from '@tarojs/taro' import Taro, { Component, Config } from '@tarojs/taro'
import { View, Text, Input, Button } from '@tarojs/components' import { View, Text, Input, Button } from '@tarojs/components'
import { showMyToast } from '@/common/utils'
import './index.scss' import './index.scss'
import { myShowToast } from '@/constants/utils'
type PageStateProps = {} type PageStateProps = {}
...@@ -44,10 +44,10 @@ class AddDevicePIN extends Component { ...@@ -44,10 +44,10 @@ class AddDevicePIN extends Component {
if (!PIN) return if (!PIN) return
try { try {
await api.common.addDevicePIN(PIN) await api.common.addDevicePIN(PIN)
myShowToast({ tips: '添加成功~' }) showMyToast({ tips: '添加成功~' })
// console.log({ res }) // console.log({ res })
} catch (error) { } catch (error) {
myShowToast({ result: error, tips: '添加失败~' }) showMyToast({ result: error, tips: '添加失败~' })
console.error(error) console.error(error)
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.my-device { .my-device {
width: 100%; width: 100%;
height: 1036px; height: 100%;
position: relative; position: relative;
} }
...@@ -19,20 +19,25 @@ ...@@ -19,20 +19,25 @@
background-color: $bgColor; background-color: $bgColor;
} }
.select-modal { .select-modal-wrapper {
top: 20%; top: 0;
left: 50%; left: 0;
width: 400px; width: 100%;
// height: 160px; height: 100%;
display: flex; display: flex;
position: absolute; position: absolute;
// margin-top: -150px;
margin-left: -200px;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
border: solid #ccc 1px; background-color: rgba($color: #000, $alpha: 0.7);
// background-color: rgba($color: #000, $alpha: 0.7); z-index: 2;
}
.select-modal {
width: 400px;
padding: 0 20px;
border-radius: 6px;
background-color: white;
} }
.select-item { .select-item {
......
...@@ -3,7 +3,7 @@ import { ComponentClass } from 'react' ...@@ -3,7 +3,7 @@ import { ComponentClass } from 'react'
import { AtSwipeAction } from 'taro-ui' import { AtSwipeAction } from 'taro-ui'
import Taro, { Component } from '@tarojs/taro' import Taro, { Component } from '@tarojs/taro'
import DeviceItem from '@/conpoments/device_item' import DeviceItem from '@/conpoments/device_item'
import { myShowToast } from '@/constants/utils' import { showMyToast } from '@/common/utils'
import { View, Text, ScrollView } from '@tarojs/components' import { View, Text, ScrollView } from '@tarojs/components'
import './index.scss' import './index.scss'
...@@ -28,9 +28,9 @@ type PageOwnProps = {} ...@@ -28,9 +28,9 @@ type PageOwnProps = {}
type PageState = { type PageState = {
page: number page: number
count: number count: number
deviceList: IDeviceItem[]
deviceCode: string deviceCode: string
showModal: boolean showModal: boolean
deviceList: IDeviceItem[]
} }
type IProps = PageStateProps & PageDispatchProps & PageOwnProps type IProps = PageStateProps & PageDispatchProps & PageOwnProps
...@@ -51,6 +51,7 @@ class MyDevice extends Component { ...@@ -51,6 +51,7 @@ class MyDevice extends Component {
showModal: false showModal: false
} }
this.scanCode = this.scanCode.bind(this) this.scanCode = this.scanCode.bind(this)
this.cancelModal = this.cancelModal.bind(this)
this.selectAddDevice = this.selectAddDevice.bind(this) this.selectAddDevice = this.selectAddDevice.bind(this)
} }
...@@ -87,14 +88,18 @@ class MyDevice extends Component { ...@@ -87,14 +88,18 @@ class MyDevice extends Component {
const { equipmentId } = item const { equipmentId } = item
if (text === '编辑') { if (text === '编辑') {
} else if (text === '删除') { } else if (text === '删除') {
try { Taro.showModal({ content: '确定要删除?' }).then(async ({ confirm }) => {
await api.common.removeDevice(equipmentId) if (confirm) {
this.getDate() try {
myShowToast({ tips: '删除成功~' }) await api.common.removeDevice(equipmentId)
} catch (error) { this.getDate()
console.error(error) showMyToast({ tips: '删除成功~' })
myShowToast({ result: error, tips: '失败成功~' }) } catch (error) {
} console.error(error)
showMyToast({ result: error, tips: '失败成功~' })
}
}
})
} }
} }
...@@ -107,10 +112,10 @@ class MyDevice extends Component { ...@@ -107,10 +112,10 @@ class MyDevice extends Component {
scanType: ['qrCode', 'barCode'] scanType: ['qrCode', 'barCode']
}) })
await api.common.addDeviceToken(result) await api.common.addDeviceToken(result)
myShowToast({ tips: '添加成功~' }) showMyToast({ tips: '添加成功~' })
this.getDate() this.getDate()
} catch (error) { } catch (error) {
myShowToast({ result: error, tips: '添加失败~' }) showMyToast({ result: error, tips: '添加失败~' })
console.error(error) console.error(error)
} }
} }
...@@ -165,12 +170,14 @@ class MyDevice extends Component { ...@@ -165,12 +170,14 @@ class MyDevice extends Component {
</AtModalContent> </AtModalContent>
</AtModal> */} </AtModal> */}
{showModal ? ( {showModal ? (
<View className="select-modal"> <View className="select-modal-wrapper" onClick={this.cancelModal}>
<View className="select-item" onClick={this.scanCode}> <View className="select-modal">
<Text>扫码添加设备</Text> <View className="select-item" onClick={this.scanCode}>
</View> <Text>扫码添加设备</Text>
<View className="select-item" onClick={() => this.selectItem('')}> </View>
<Text>输入PIN码添加设备</Text> <View className="select-item" onClick={() => this.selectItem('')}>
<Text>输入PIN码添加设备</Text>
</View>
</View> </View>
</View> </View>
) : null} ) : null}
......
import { ComponentClass } from 'react' import { ComponentClass } from 'react'
import Taro, { Component } from '@tarojs/taro' import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components' import { View, Text } from '@tarojs/components'
// import './Text1.less' import './index.scss'
type PageStateProps = {} type PageStateProps = {}
...@@ -15,33 +15,25 @@ type PageState = { ...@@ -15,33 +15,25 @@ type PageState = {
type IProps = PageStateProps & PageDispatchProps & PageOwnProps type IProps = PageStateProps & PageDispatchProps & PageOwnProps
interface Text1 { interface DeviceSelect {
props: IProps props: IProps
state: PageState state: PageState
} }
class Text1 extends Component { class DeviceSelect extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
name: '小红' name: '小红'
} }
} }
componentWillReceiveProps(nextProps) {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
render() { render() {
console.log('111111')
return ( return (
<View className="Text1"> <View className="DeviceSelect">
<Text>hello world</Text> <Text>hello world</Text>
</View> </View>
) )
} }
} }
export default Text1 as ComponentClass<PageOwnProps, PageState> export default DeviceSelect as ComponentClass<PageOwnProps, PageState>
...@@ -2,34 +2,10 @@ ...@@ -2,34 +2,10 @@
.films { .films {
width: 100%; width: 100%;
height: 1036px; height: 100%;
background-color: $bgColor; background-color: $bgColor;
} }
.films-item-wrapper {
padding: 20px;
display: flex;
margin-bottom: 40px;
flex-direction: row;
background-color: white;
}
.img-box {
width: 320px;
}
.films-item-img {
width: 100%;
height: 180px;
}
.films-item-info {
flex: 1;
display: flex;
padding-left: 20px;
flex-direction: column;
}
.scroll-view { .scroll-view {
height: 100%; height: 100%;
} }
import api from '@/api/index' import api from '@/api/index'
import { ComponentClass } from 'react' import { ComponentClass } from 'react'
import { AtSwipeAction } from 'taro-ui'
import Taro, { Component } from '@tarojs/taro' import Taro, { Component } from '@tarojs/taro'
import { showMyToast } from '@/common/utils'
import FilmListItem from '@/conpoments/film_list_item'
import { View, Text, ScrollView, Image } from '@tarojs/components' import { View, Text, ScrollView, Image } from '@tarojs/components'
import './index.scss' import './index.scss'
...@@ -11,10 +14,17 @@ type PageDispatchProps = {} ...@@ -11,10 +14,17 @@ type PageDispatchProps = {}
type PageOwnProps = {} type PageOwnProps = {}
type PageState = { export interface IMilmListItme {
filmId: string
filmName: string
templateUrl: string
equipmentCount: number
}
interface PageState {
page: number page: number
count: number count: number
flimListData: any[] flimListData: IMilmListItme[]
} }
type IProps = PageStateProps & PageDispatchProps & PageOwnProps type IProps = PageStateProps & PageDispatchProps & PageOwnProps
...@@ -35,6 +45,10 @@ class Films extends Component { ...@@ -35,6 +45,10 @@ class Films extends Component {
} }
async componentWillMount() { async componentWillMount() {
this.getData()
}
async getData() {
try { try {
const { page } = this.state const { page } = this.state
const { count, list } = await api.common.getMyFilmsList(page) const { count, list } = await api.common.getMyFilmsList(page)
...@@ -53,7 +67,22 @@ class Films extends Component { ...@@ -53,7 +67,22 @@ class Films extends Component {
return flimListData !== FD return flimListData !== FD
} }
goDetail({ filmId }: any) { async handleItem({ filmId }: IMilmListItme) {
Taro.showModal({ content: '确定要删除?' }).then(async ({ confirm }) => {
if (confirm) {
try {
await api.common.removeFilm(filmId)
this.getData()
showMyToast({ tips: '删除成功~' })
} catch (error) {
console.error(error)
showMyToast({ tips: '失败成功~' })
}
}
})
}
goDetail({ filmId }: IMilmListItme) {
Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${filmId}` }) Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${filmId}` })
} }
...@@ -63,19 +92,21 @@ class Films extends Component { ...@@ -63,19 +92,21 @@ class Films extends Component {
<View className="films"> <View className="films">
<ScrollView className="scroll-view" scrollY> <ScrollView className="scroll-view" scrollY>
{flimListData.map(item => ( {flimListData.map(item => (
<View <AtSwipeAction
className="films-item-wrapper" autoClose
key={item.filmId} key={item.filmId}
onClick={() => this.goDetail(item)} onClick={() => this.handleItem(item)}
options={[
{
text: '删除',
style: {
backgroundColor: '#FF4949'
}
}
]}
> >
<View className="img-box"> <FilmListItem onClick={() => this.goDetail(item)} {...item} />
<Image className="films-item-img" src={item.templateUrl} /> </AtSwipeAction>
</View>
<View className="films-item-info">
<Text>{item.filmName}</Text>
<Text>播放设备数量:{item.equipmentCount}</Text>
</View>
</View>
))} ))}
</ScrollView> </ScrollView>
</View> </View>
......
import FilmList from './film_list' import FilmList from './film_list'
import MyDevice from './my_device' import DeviceList from './device_list'
import { ComponentClass } from 'react' import { ComponentClass } from 'react'
import { AtTabs, AtTabsPane } from 'taro-ui' import { AtTabs, AtTabsPane } from 'taro-ui'
import Taro, { Component, Config } from '@tarojs/taro' import Taro, { Component, Config } from '@tarojs/taro'
import './index.scss' import './index.scss'
import { View } from '@tarojs/components'
type PageStateProps = {} type PageStateProps = {}
...@@ -14,6 +15,7 @@ type PageOwnProps = {} ...@@ -14,6 +15,7 @@ type PageOwnProps = {}
type PageState = { type PageState = {
current: number current: number
windowHeight: number
} }
type IProps = PageStateProps & PageDispatchProps & PageOwnProps type IProps = PageStateProps & PageDispatchProps & PageOwnProps
...@@ -31,8 +33,11 @@ class Device extends Component { ...@@ -31,8 +33,11 @@ class Device extends Component {
} }
constructor(props) { constructor(props) {
super(props) super(props)
const { windowHeight } = Taro.getSystemInfoSync()
this.state = { this.state = {
current: 1 current: 1,
windowHeight: windowHeight - 43
} }
} }
...@@ -41,19 +46,18 @@ class Device extends Component { ...@@ -41,19 +46,18 @@ class Device extends Component {
} }
render() { render() {
const { current } = this.state const { current, windowHeight } = this.state
return ( return (
<AtTabs <AtTabs current={current} tabList={tabList} onClick={this.changePage} swipeable={false}>
current={current} <AtTabsPane current={current} index={0}>
tabList={tabList} <View style={{ height: `${windowHeight}px` }}>
onClick={this.changePage} <FilmList />
className="at-tabs-wrapper" </View>
>
<AtTabsPane className="at-tabs-page" current={current} index={0}>
<FilmList />
</AtTabsPane> </AtTabsPane>
<AtTabsPane className="at-tabs-page" current={current} index={1}> <AtTabsPane className="at-tabs-page" current={current} index={1}>
<MyDevice /> <View style={{ height: `${windowHeight}px` }}>
<DeviceList />
</View>
</AtTabsPane> </AtTabsPane>
</AtTabs> </AtTabs>
) )
......
import { ComponentClass } from 'react' import { ComponentClass } from 'react'
import DeviceList from '../device_list' import DeviceList from '../device_list'
import Taro, { Component } from '@tarojs/taro' import Taro, { Component, Config } from '@tarojs/taro'
// import { View, Text } from '@tarojs/components' // import { View, Text } from '@tarojs/components'
import './index.scss' import './index.scss'
...@@ -20,6 +20,9 @@ interface MyDevice { ...@@ -20,6 +20,9 @@ interface MyDevice {
} }
class MyDevice extends Component { class MyDevice extends Component {
config: Config = {
navigationBarTitleText: '我的设备'
}
render() { render() {
return <DeviceList /> return <DeviceList />
} }
......
import { ComponentClass } from 'react' import { ComponentClass } from 'react'
import TempItem from './conpoments/temp_item/temp_item'
import Taro, { Component, Config } from '@tarojs/taro' import Taro, { Component, Config } from '@tarojs/taro'
import PageView from '@/constants/components/pageView' import TempItem from './conpoments/temp_item/temp_item'
import { View, Text, Input, ScrollView, Image } from '@tarojs/components' import { View, Text, Input, ScrollView, Image } from '@tarojs/components'
import './scss/index.scss' import './scss/index.scss'
import api from '@/api/index' import api from '@/api/index'
import token from '@/constants/token' import token from '@/common/token'
type PageStateProps = {} type PageStateProps = {}
......
...@@ -38,11 +38,15 @@ class User extends Component { ...@@ -38,11 +38,15 @@ class User extends Component {
} }
async getUserInfo() { async getUserInfo() {
if (process.env.TARO_ENV === 'weapp') { if (process.env.TARO_ENV !== 'rn') {
const { try {
userInfo: { avatarUrl, nickName } const {
} = await Taro.getUserInfo() userInfo: { avatarUrl, nickName }
this.setState({ avatarUrl, nickName }) } = await Taro.getUserInfo()
this.setState({ avatarUrl, nickName })
} catch (error) {
console.error(error)
}
} }
} }
...@@ -66,12 +70,15 @@ class User extends Component { ...@@ -66,12 +70,15 @@ class User extends Component {
</View> </View>
<View className="item-wrapper"> <View className="item-wrapper">
<View <View
onClick={() => this.goPage('/pages/home/device/my_film/index')}
className="item-view" className="item-view"
onClick={() => this.goPage('/pages/home/device/my_film/index')}
> >
<Text>我的视片</Text> <Text>我的视片</Text>
</View> </View>
<View className="item-view"> <View
className="item-view"
onClick={() => this.goPage('/pages/home/device/my_device/index')}
>
<Text>我的设备</Text> <Text>我的设备</Text>
</View> </View>
</View> </View>
......
...@@ -2,7 +2,7 @@ import Home from '../home/' ...@@ -2,7 +2,7 @@ import Home from '../home/'
import Login from '../login' import Login from '../login'
import { ComponentClass } from 'react' import { ComponentClass } from 'react'
import { View } from '@tarojs/components' import { View } from '@tarojs/components'
import token from '../../constants/token' import token from '../../common/token'
import Taro, { Component, Config } from '@tarojs/taro' import Taro, { Component, Config } from '@tarojs/taro'
class Index extends Component { class Index extends Component {
......
...@@ -2,9 +2,9 @@ import api from '../../api' ...@@ -2,9 +2,9 @@ import api from '../../api'
import { ComponentClass } from 'react' import { ComponentClass } from 'react'
import { CheckBox } from 'react-native' import { CheckBox } from 'react-native'
import { connect } from '@tarojs/redux' import { connect } from '@tarojs/redux'
import token from '../../constants/token' import token from '../../common/token'
import { HONE } from '../../constants/router' import { HONE } from '../../constants/router'
import { checkPhone, myShowToast } from '../../constants/utils' import { checkPhone, showMyToast } from '../../common/utils'
import Taro, { Component, Config } from '@tarojs/taro' import Taro, { Component, Config } from '@tarojs/taro'
import { View, Text, Input, Button, Checkbox, Label } from '@tarojs/components' import { View, Text, Input, Button, Checkbox, Label } from '@tarojs/components'
...@@ -83,7 +83,7 @@ class Login extends Component { ...@@ -83,7 +83,7 @@ class Login extends Component {
}, 1000) }, 1000)
} catch (error) { } catch (error) {
// console.warn('获取验证码失败~', error) // console.warn('获取验证码失败~', error)
myShowToast({ result: error, tips: '获取验证码失败~' }) showMyToast({ result: error, tips: '获取验证码失败~' })
} }
// Taro.hideLoading() // Taro.hideLoading()
} }
...@@ -102,7 +102,7 @@ class Login extends Component { ...@@ -102,7 +102,7 @@ class Login extends Component {
} }
} catch (error) { } catch (error) {
// console.warn('用户登录出错~', error) // console.warn('用户登录出错~', error)
myShowToast({ result: error, tips: '用户登录出错~' }) showMyToast({ result: error, tips: '用户登录出错~' })
} }
} }
......
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