Commit 4431debd by hank

优化首页流程

parent 84b10206
export const FETCH_TIME_OUT = 5000
// export const BASE_URL = 'https://server.bdideal.com'
// export const WEBVIEW_URL = 'https://visual.bdideal.com'
export const BASE_URL = 'https://dev-server.bdideal.com'
export const WEBVIEW_URL = 'https://dev-visual.bdideal.com'
export const BASE_URL = 'https://server.bdideal.com'
export const WEBVIEW_URL = 'https://visual.bdideal.com'
// export const BASE_URL = 'https://dev-server.bdideal.com'
// export const WEBVIEW_URL = 'https://dev-visual.bdideal.com'
// export const WEBVIEW_URL = 'http://127.0.0.1:8080'
/** 蓝牙的服务 uuid */
......
@import '@styles/var.scss';
@import '~taro-ui/dist/style/components/modal.scss';
.at-modal__content {
padding: 52px 24px !important;
min-height: 0 !important;
max-height: 840px;
color: #666;
}
// @import '~taro-ui/dist/style/components/tabs.scss';
// .at-tabs__item-underline {
......
......@@ -2,7 +2,7 @@ import ShopList from './shop_list'
import DeviceList from './device_list'
import DeviceGroup from './group_list'
import { ComponentClass } from 'react'
import { AtTabs, AtTabsPane } from 'taro-ui'
import { AtTabs, AtTabsPane, AtModal } from 'taro-ui'
import Taro, { Component, Config } from '@tarojs/taro'
import './index.scss'
......@@ -17,6 +17,7 @@ type PageOwnProps = {}
type PageState = {
current: number
windowHeight: number
id: string
}
type IProps = PageStateProps & PageDispatchProps & PageOwnProps
......@@ -36,22 +37,56 @@ class Device extends Component {
super(props)
const { windowHeight } = Taro.getSystemInfoSync()
const id = Taro.getStorageSync('isAdd')
console.log(id, this.$router.params.id, 'isAdd')
this.state = {
current: 0,
id: '',
windowHeight: windowHeight
}
}
componentDidShow() {
const id = Taro.getStorageSync('isAdd')
console.log(id, this.$router.params.id, 'isAdd')
this.setState({
id: this.$router.params.id || id
})
}
changePage = value => {
this.setState({ current: value })
}
render() {
const { current, windowHeight } = this.state
const { current, windowHeight, id } = this.state
return (
<View style={`height: ${windowHeight}px;`}>
<DeviceList height={windowHeight} />
<AtModal
isOpened={!!id}
content="设备已添加成功~去模板市场逛一逛吧~"
confirmText="确认"
onClose={() => {
Taro.removeStorage({ key: 'isAdd' })
this.setState({
id: ''
})
}}
onCancel={() => {
Taro.removeStorage({ key: 'isAdd' })
this.setState({
id: ''
})
}}
onConfirm={() => {
Taro.removeStorage({ key: 'isAdd' })
this.setState({
id: ''
})
}}
/>
</View>
// <AtTabs current={current} tabList={tabList} onClick={this.changePage} swipeable={false}>
// <AtTabsPane current={current} index={0}>
// <View style={{ height: `${windowHeight}px` }}>
......
......@@ -84,6 +84,9 @@ class Collection extends Component {
}
componentDidShow() {
this.isShow = true
this.setState({
templateId: ''
})
this.getData()
}
componentDidHide() {
......
@import '@styles/var.scss';
@import '@styles/common.scss';
@keyframes sliderUp {
0% {
transform: translateY(1000px);
}
100% {
transform: translateY(0);
}
}
@keyframes sliderDown {
0% {
transform: translateY(0);
}
100% {
transform: translateY(1000px);
}
}
.temp-detail {
width: 100vw;
display: flex;
......@@ -13,8 +33,13 @@
height: 100vh;
z-index: 1000;
.slider-down {
animation: sliderDown 300ms ease-in-out !important;
}
&-scroll {
height: calc(100vh - 116px);
animation: sliderUp 300ms ease-in-out;
flex: 1;
overflow: hidden;
// padding-top: 90px;
......
......@@ -77,6 +77,7 @@
height: 100%;
padding: 20px 0;
padding-left: 0;
padding-bottom: 0;
@include eject(box-sizing, border-box);
......
......@@ -128,9 +128,9 @@ class Login extends Component {
content: '您已获得3个月会员资格,可以使用全部精美模板。'
}).then(() => {
if (process.env.TARO_ENV !== 'rn') {
Taro.switchTab({ url: '/pages/home/tempaltes/index' })
Taro.switchTab({ url: '/pages/home/device/index' })
} else {
Taro.redirectTo({ url: '/pages/home/tempaltes/index' })
Taro.redirectTo({ url: '/pages/home/device/index' })
}
})
// if (process.env.TARO_ENV !== 'rn') {
......
......@@ -240,8 +240,17 @@ class WifiList extends Component {
})
Taro.hideLoading()
// console.log(this.props.getFilmListData(1), this.props)
showMyToast({ title: '设备添加成功~' })
Taro.navigateBack()
// showMyToast({ title: '设备已添加成功~,去模板市场逛一逛吧~' })
Taro.setStorage({
key: 'isAdd',
data: '1'
}).then(() => {
setTimeout(() => {
// Taro.navigateBack()
Taro.redirectTo({ url: `/pages/home/device/index?id=${equipmentId}` })
}, 1000)
})
// Taro.redirectTo({ url: `/pages/home/device/device_detail/index?equipmentId=${equipmentId}` })
} catch (error) {
console.error(error)
......
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