Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client-taro
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4431debd
authored
Dec 20, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化首页流程
parent
84b10206
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
92 additions
and
10 deletions
+92
-10
src/common/index.ts
+4
-4
src/pages/home/device/index.scss
+9
-0
src/pages/home/device/index.tsx
+37
-2
src/pages/home/tempaltes/collection.tsx
+3
-0
src/pages/home/tempaltes/scss/detail.scss
+25
-0
src/pages/home/tempaltes/scss/index.scss
+1
-0
src/pages/login/index.tsx
+2
-2
src/pages/system/wifi_list/index.tsx
+11
-2
No files found.
src/common/index.ts
View file @
4431debd
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 */
...
...
src/pages/home/device/index.scss
View file @
4431debd
@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 {
...
...
src/pages/home/device/index.tsx
View file @
4431debd
...
...
@@ -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` }}>
...
...
src/pages/home/tempaltes/collection.tsx
View file @
4431debd
...
...
@@ -84,6 +84,9 @@ class Collection extends Component {
}
componentDidShow
()
{
this
.
isShow
=
true
this
.
setState
({
templateId
:
''
})
this
.
getData
()
}
componentDidHide
()
{
...
...
src/pages/home/tempaltes/scss/detail.scss
View file @
4431debd
@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;
...
...
src/pages/home/tempaltes/scss/index.scss
View file @
4431debd
...
...
@@ -77,6 +77,7 @@
height
:
100%
;
padding
:
20px
0
;
padding-left
:
0
;
padding-bottom
:
0
;
@include
eject
(
box-sizing
,
border-box
);
...
...
src/pages/login/index.tsx
View file @
4431debd
...
...
@@ -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') {
...
...
src/pages/system/wifi_list/index.tsx
View file @
4431debd
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment