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
b21995d2
authored
Aug 29, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
1e03b136
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
62 additions
and
16 deletions
+62
-16
src/api/common.ts
+6
-1
src/api/users.ts
+6
-0
src/pages/home/device/device_detail/index.tsx
+1
-0
src/pages/home/device/device_list/index.tsx
+11
-1
src/pages/home/tempaltes/film_detail.tsx
+18
-4
src/pages/home/tempaltes/film_edit.tsx
+1
-1
src/pages/home/user/index.tsx
+7
-5
src/pages/login/index.tsx
+10
-3
src/pages/system/wifi_list/index.tsx
+2
-1
No files found.
src/api/common.ts
View file @
b21995d2
import
{
FilmListItem
}
from
'@/conpoments/film_list_item'
import
{
ApiClient
}
from
'./client'
export
interface
IUpdateWifi
{
...
...
@@ -46,13 +47,17 @@ class UsersApi extends ApiClient {
/** 获取视片详情列表 */
getFilmDetailList
(
id
:
string
,
page
:
number
)
{
return
this
.
request
({
method
:
'GET'
,
url
:
`/template/get/equipment/list/
${
id
}
?p=
${
page
}
&c=
1
0`
})
return
this
.
request
({
method
:
'GET'
,
url
:
`/template/get/equipment/list/
${
id
}
?p=
${
page
}
&c=
5
0`
})
}
/** 获取视片详情 */
getFilmDetailInfo
(
id
:
string
)
{
return
this
.
request
({
method
:
'GET'
,
url
:
`/template/get/film/info/
${
id
}
`
})
}
/** 获取视片下设备列表详情 */
getFilmDeviceList
(
FilmId
:
string
)
{
return
this
.
request
({
url
:
`/template/get/equipment/list/
${
FilmId
}
`
,
data
:
{
p
:
1000
,
c
:
10
}
})
}
/** 获取我的视片列表 */
getMyFilmsList
(
page
:
number
)
{
...
...
src/api/users.ts
View file @
b21995d2
...
...
@@ -17,6 +17,12 @@ class UsersApi extends ApiClient {
data
:
{
userPhone
,
codeInfo
,
userTerminal
:
'APP'
}
})
}
getInfo
()
{
return
this
.
request
({
method
:
'GET'
,
url
:
'/user/get/info'
})
}
}
export
default
new
UsersApi
()
src/pages/home/device/device_detail/index.tsx
View file @
b21995d2
...
...
@@ -142,6 +142,7 @@ class DeviceDetail extends Component {
equipmentStyle
})
showMyToast
({
title
:
'修改成功~'
})
Taro
.
navigateBack
()
}
catch
(
error
)
{
// console.error(error)
showMyToast
({
result
:
error
,
title
:
'修改失败~'
})
...
...
src/pages/home/device/device_list/index.tsx
View file @
b21995d2
...
...
@@ -91,6 +91,10 @@ class MyDevice extends Component {
this
.
getDate
()
}
componentDidShow
()
{
this
.
page
=
1
this
.
getDate
()
}
async
getDate
()
{
this
.
cancelModal
()
this
.
props
.
getFilmListData
(
this
.
page
)
...
...
@@ -163,6 +167,10 @@ class MyDevice extends Component {
},
500
)
}
goDetail
(
equipmentId
)
{
Taro
.
navigateTo
({
url
:
`/pages/home/device/device_detail/index?equipmentId=
${
equipmentId
}
`
})
}
shouldComponentUpdate
(
nextProps
:
IProps
,
_nextState
)
{
const
{
list
}
=
this
.
props
const
{
list
:
_list
}
=
nextProps
...
...
@@ -203,7 +211,9 @@ class MyDevice extends Component {
}
]
}
>
<
DeviceItem
{
...
item
}
/>
<
View
onClick=
{
()
=>
this
.
goDetail
(
item
.
equipmentId
)
}
>
<
DeviceItem
{
...
item
}
/>
</
View
>
</
AtSwipeAction
>
))
}
</
ListView
>
...
...
src/pages/home/tempaltes/film_detail.tsx
View file @
b21995d2
...
...
@@ -2,6 +2,7 @@ import { ComponentClass } from 'react'
import
Taro
,
{
Component
,
Config
}
from
'@tarojs/taro'
import
{
View
,
Text
,
ScrollView
,
Button
}
from
'@tarojs/components'
import
DetailTop
from
'./conpoments/detail_top'
import
DeviceItem
from
'@/conpoments/device_item'
import
'./scss/film_detail.scss'
import
api
from
'@/api/index'
...
...
@@ -18,6 +19,7 @@ type PageState = {
filmInfo
:
any
filmId
:
string
filmList
:
any
[]
deviceList
:
any
[]
}
type
IProps
=
PageStateProps
&
PageDispatchProps
&
PageOwnProps
...
...
@@ -40,7 +42,8 @@ class FilmDetail extends Component {
page
:
1
,
count
:
0
,
filmInfo
:
{},
filmList
:
[]
filmList
:
[],
deviceList
:
[]
}
this
.
chengDevice
=
this
.
chengDevice
.
bind
(
this
)
this
.
goEdit
=
this
.
goEdit
.
bind
(
this
)
...
...
@@ -50,7 +53,6 @@ class FilmDetail extends Component {
this
.
getData
()
}
componentDidShow
()
{
console
.
log
(
231131
)
this
.
getData
()
}
async
getData
()
{
...
...
@@ -61,7 +63,7 @@ class FilmDetail extends Component {
api
.
common
.
getFilmDetailList
(
filmId
,
page
)
])
console
.
log
({
filmInfo
,
filmList
})
const
{
list
,
count
}
=
film
Info
const
{
list
,
count
}
=
film
List
this
.
setState
({
count
,
filmInfo
,
...
...
@@ -78,7 +80,12 @@ class FilmDetail extends Component {
const
url
=
`/pages/home/device/device_bind/index?filmId=
${
filmId
}
`
Taro
.
navigateTo
({
url
})
}
getFilmDeviceList
()
{
const
{
filmId
}
=
this
.
state
api
.
common
.
getFilmDeviceList
(
filmId
).
tnen
(
res
=>
{
console
})
}
goEdit
()
{
console
.
log
(
'chengDevice'
)
const
{
filmId
}
=
this
.
state
...
...
@@ -103,6 +110,13 @@ class FilmDetail extends Component {
<
DetailTop
{
...
filmInfo
}
/>
<
View
className=
"film-detail-list"
>
<
Text
>
投放设备(
{
filmList
.
length
}
)
</
Text
>
{
filmList
.
map
(
item
=>
{
return
(
<
View
key=
{
item
.
equipmentId
}
>
<
DeviceItem
{
...
item
}
/>
</
View
>
)
})
}
</
View
>
</
ScrollView
>
</
View
>
...
...
src/pages/home/tempaltes/film_edit.tsx
View file @
b21995d2
...
...
@@ -192,7 +192,7 @@ class FilmDetail extends Component {
</
View
>
</
ScrollView
>
{
/* {filmData[pageIndex]} */
}
{
pageIndex
}
{
/* {pageIndex} */
}
<
EditMenu
{
...
pageList
[
pageIndex
]}
setValue=
{
this
.
setValue
}
/>
</
View
>
<
View
className=
"film-detail-bottom-bar"
>
...
...
src/pages/home/user/index.tsx
View file @
b21995d2
import
{
ComponentClass
}
from
'react'
import
Taro
,
{
Component
,
Config
}
from
'@tarojs/taro'
import
{
View
,
Text
,
Image
,
ScrollView
,
Button
}
from
'@tarojs/components'
import
api
from
'@/api'
import
'./index.scss'
import
token
from
'@/common/token'
...
...
@@ -42,10 +42,12 @@ class User extends Component {
async
getUserInfo
()
{
if
(
process
.
env
.
TARO_ENV
!==
'rn'
)
{
try
{
const
{
userInfo
:
{
avatarUrl
,
nickName
}
}
=
await
Taro
.
getUserInfo
()
this
.
setState
({
avatarUrl
,
nickName
})
// const {
// userInfo: { avatarUrl, nickName }
// } = await Taro.getUserInfo()
// this.setState({ avatarUrl, nickName })
const
{
userName
,
userUrl
}
=
await
api
.
user
.
getInfo
()
this
.
setState
({
avatarUrl
:
userUrl
,
nickName
:
userName
})
}
catch
(
error
)
{
console
.
error
(
error
)
}
...
...
src/pages/login/index.tsx
View file @
b21995d2
...
...
@@ -45,10 +45,16 @@ class Login extends Component {
constructor
(
props
)
{
super
(
props
)
// this.state = {
// userPhone: '',
// checkCode: '',
// checked: false,
// getCodeTime: 0
// }
this
.
state
=
{
userPhone
:
''
,
checkCode
:
''
,
checked
:
fals
e
,
userPhone
:
'
15501259989
'
,
checkCode
:
'
123456
'
,
checked
:
tru
e
,
getCodeTime
:
0
}
}
...
...
@@ -141,6 +147,7 @@ class Login extends Component {
<
Input
type=
"number"
maxLength=
{
6
}
value=
{
checkCode
}
placeholder=
"请输入验证码"
onInput=
{
this
.
setCheckCode
}
className=
"login-check-code-input"
...
...
src/pages/system/wifi_list/index.tsx
View file @
b21995d2
...
...
@@ -136,7 +136,8 @@ class WifiList extends Component {
})
console
.
log
(
this
.
props
.
getFilmListData
(
1
),
this
.
props
)
showMyToast
({
title
:
'设备添加成功~'
})
Taro
.
redirectTo
({
url
:
`/pages/home/device/device_detail/index?equipmentId=
${
equipmentId
}
`
})
Taro
.
navigateBack
()
// 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