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
d5c7b72b
authored
Aug 23, 2019
by
lirandong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时提交
parent
63b2ae5d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
150 additions
and
3 deletions
+150
-3
src/api/common.ts
+7
-0
src/app.tsx
+2
-1
src/assets/styles/var.scss
+2
-1
src/pages/home/device/device_detail/index.scss
+17
-0
src/pages/home/device/device_detail/index.tsx
+119
-0
src/pages/home/device/device_list/index.tsx
+2
-0
src/pages/system/wifi_list/index.scss
+1
-1
No files found.
src/api/common.ts
View file @
d5c7b72b
...
...
@@ -48,6 +48,13 @@ class UsersApi extends ApiClient {
getMyDeviceList
(
page
:
number
)
{
return
this
.
request
({
url
:
'/myequipment/get/list'
,
data
:
{
p
:
page
,
c
:
10
}
})
}
/** 获取设备详情 */
getDeviceDetail
(
equipmentId
:
string
)
{
return
this
.
request
({
method
:
'GET'
,
url
:
`/myequipment/get/details/info/
${
equipmentId
}
`
})
}
/** 添加新设备-PIN */
addDevicePIN
(
pin
:
string
)
{
...
...
src/app.tsx
View file @
d5c7b72b
...
...
@@ -34,9 +34,10 @@ class App extends Component {
*/
config
:
Config
=
{
pages
:
[
'pages/home/tempaltes/index'
,
'pages/home/device/index'
,
'pages/home/device/device_detail/index'
,
'pages/system/wifi_list/index'
,
'pages/home/tempaltes/index'
,
'pages/home/device/device_bind/index'
,
'pages/home/user/index'
,
'pages/home/device/my_device/index'
,
...
...
src/assets/styles/var.scss
View file @
d5c7b72b
...
...
@@ -6,7 +6,8 @@ $text-color: #323233;
$input-color
:
#323233
;
$primary-color
:
#1989fa
;
$border-color
:
#ccc
;
$text-colot
:
#ccc
;
$text-color
:
#ccc
;
$primary-text-color
:
#333
;
@mixin
border-bottom
{
border-style
:
solid
;
...
...
src/pages/home/device/device_detail/index.scss
0 → 100644
View file @
d5c7b72b
@import
'@styles/var.scss'
;
.device-detail
{
padding
:
40px
40px
0
;
@include
eject
(
box-sizing
,
border-box
);
&
-item
{
display
:
flex
;
flex-direction
:
column
;
.item-text
{
padding
:
20px
0
;
color
:
$primary-text-color
;
}
}
}
src/pages/home/device/device_detail/index.tsx
0 → 100644
View file @
d5c7b72b
import
api
from
'@/api/index'
import
{
ComponentClass
}
from
'react'
import
Taro
,
{
Component
,
Config
}
from
'@tarojs/taro'
import
{
View
,
Text
,
Input
,
Image
,
ScrollView
,
Button
}
from
'@tarojs/components'
import
'./index.scss'
type
PageStateProps
=
{}
type
PageDispatchProps
=
{}
type
PageOwnProps
=
{}
interface
IInfo
{
filmId
?:
any
filmName
?:
any
clientId
:
string
equipmentId
:
string
clientSecret
:
string
equipmentUrl
:
string
equipmentName
:
string
equipmentState
:
string
}
type
PageState
=
{
filmId
?:
any
filmName
?:
any
clientId
:
string
equipmentId
:
string
clientSecret
:
string
equipmentUrl
:
string
equipmentName
:
string
equipmentState
:
string
}
type
IProps
=
PageStateProps
&
PageDispatchProps
&
PageOwnProps
interface
DeviceDetail
{
props
:
IProps
state
:
PageState
}
class
DeviceDetail
extends
Component
{
config
:
Config
=
{
navigationBarTitleText
:
'设备详情'
}
private
equipmentId
:
string
constructor
(
props
:
any
)
{
super
(
props
)
this
.
equipmentId
=
this
.
$router
.
params
.
equipmentId
||
'd73cc4ec13394a8ab5de7b8ce7f99fac'
// console.log(this.equipmentId)
this
.
state
=
{
clientId
:
''
,
equipmentId
:
''
,
clientSecret
:
''
,
equipmentUrl
:
''
,
equipmentName
:
''
,
equipmentState
:
''
}
}
componentWillMount
()
{
this
.
getData
()
}
async
getData
()
{
try
{
const
res
=
await
api
.
common
.
getDeviceDetail
(
this
.
equipmentId
)
const
{
clientId
,
equipmentId
,
clientSecret
,
equipmentUrl
,
equipmentName
,
equipmentState
}
=
res
this
.
setState
({
clientId
,
equipmentId
,
clientSecret
,
equipmentUrl
,
equipmentName
,
equipmentState
})
console
.
log
({
res
})
}
catch
(
error
)
{
console
.
error
(
error
)
}
}
render
()
{
const
{
equipmentName
,
equipmentUrl
}
=
this
.
state
return
(
<
ScrollView
className=
"device-detail"
scrollY
>
{
/* <Text>hello world</Text> */
}
<
View
className=
"device-detail-item"
>
<
Text
className=
"item-text"
>
设备名称
</
Text
>
<
Input
value=
{
equipmentName
}
placeholder=
"请输入设备名称"
/>
</
View
>
<
View
className=
"device-detail-item"
>
<
Text
className=
"item-text"
>
设备图片
</
Text
>
<
Image
src=
{
equipmentUrl
}
/>
</
View
>
<
View
className=
"device-detail-item"
>
<
Text
className=
"item-text"
>
屏幕板式
</
Text
>
{
/* <Image src="" /> */
}
</
View
>
<
View
className=
"device-detail-item"
>
<
Text
className=
"item-text"
>
屏幕分辨率
</
Text
>
<
Input
placeholder=
"宽 * 高"
/>
</
View
>
<
Button
type=
"primary"
>
确实
</
Button
>
</
ScrollView
>
)
}
}
export
default
DeviceDetail
as
ComponentClass
<
PageOwnProps
,
PageState
>
src/pages/home/device/device_list/index.tsx
View file @
d5c7b72b
...
...
@@ -113,6 +113,8 @@ class MyDevice extends Component {
const
{
text
}
=
info
const
{
equipmentId
}
=
item
if
(
text
===
'编辑'
)
{
// console.log('')
Taro
.
navigateTo
({
url
:
`/pages/home/device/device_detail/index?equipmentId=
${
equipmentId
}
`
})
}
else
if
(
text
===
'删除'
)
{
Taro
.
showModal
({
content
:
'确定要删除?'
}).
then
(
async
({
confirm
})
=>
{
if
(
confirm
)
{
...
...
src/pages/system/wifi_list/index.scss
View file @
d5c7b72b
...
...
@@ -26,7 +26,7 @@
width
:
100%
;
padding
:
20px
0
;
font-size
:
24px
;
color
:
$text-colo
t
;
color
:
$text-colo
r
;
border
:
0
solid
$border-color
;
border-bottom-width
:
1px
;
...
...
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