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
b4bb3893
authored
Aug 28, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑 bug 修复
parent
c61947f5
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
303 additions
and
74 deletions
+303
-74
project.config.json
+2
-2
src/api/axios.ts
+8
-2
src/api/common.ts
+12
-1
src/api/files.ts
+17
-0
src/api/index.ts
+3
-1
src/pages/home/tempaltes/conpoments/edit_menu/index.tsx
+11
-6
src/pages/home/tempaltes/conpoments/list_item/index.scss
+0
-0
src/pages/home/tempaltes/conpoments/list_item/index.tsx
+129
-0
src/pages/home/tempaltes/conpoments/menu_item/index.scss
+9
-0
src/pages/home/tempaltes/conpoments/menu_item/index.tsx
+12
-40
src/pages/home/tempaltes/film_edit.tsx
+78
-20
src/pages/system/wifi_list/index.tsx
+21
-2
tslint.json
+1
-0
No files found.
project.config.json
View file @
b4bb3893
...
@@ -4,14 +4,14 @@
...
@@ -4,14 +4,14 @@
"description"
:
""
,
"description"
:
""
,
"appid"
:
"wxc3dfc37466838046"
,
"appid"
:
"wxc3dfc37466838046"
,
"setting"
:
{
"setting"
:
{
"urlCheck"
:
tru
e
,
"urlCheck"
:
fals
e
,
"es6"
:
false
,
"es6"
:
false
,
"postcss"
:
false
,
"postcss"
:
false
,
"minified"
:
false
,
"minified"
:
false
,
"newFeature"
:
true
,
"newFeature"
:
true
,
"coverView"
:
true
,
"autoAudits"
:
false
,
"autoAudits"
:
false
,
"checkInvalidKey"
:
true
,
"checkInvalidKey"
:
true
,
"coverView"
:
true
,
"checkSiteMap"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"babelSetting"
:
{
"babelSetting"
:
{
...
...
src/api/axios.ts
View file @
b4bb3893
...
@@ -68,13 +68,19 @@ $axios.interceptors.response.use(
...
@@ -68,13 +68,19 @@ $axios.interceptors.response.use(
FetchSet
.
delete
(
config
.
config
.
FetchKey
)
FetchSet
.
delete
(
config
.
config
.
FetchKey
)
// token过期处理
// token过期处理
const
{
data
}
=
config
const
{
data
}
=
config
const
{
code
}
=
data
const
{
code
,
msg
}
=
data
if
(
code
===
LOGIN_0003
)
{
if
(
code
===
LOGIN_0003
)
{
// 用户信息失效
// 用户信息失效
token
.
reset
()
token
.
reset
()
Taro
.
navigateTo
({
url
:
'/pages/login/index'
})
Taro
.
navigateTo
({
url
:
'/pages/login/index'
})
}
}
if
(
!!
code
&&
code
!==
'0'
)
return
Promise
.
reject
(
config
.
data
)
if
(
!!
code
&&
code
!==
'0'
)
{
Taro
.
showToast
({
title
:
msg
,
duration
:
2000
})
return
Promise
.
reject
(
config
.
data
)
}
return
data
return
data
},
},
async
(
error
:
any
)
=>
{
async
(
error
:
any
)
=>
{
...
...
src/api/common.ts
View file @
b4bb3893
...
@@ -16,6 +16,13 @@ export interface IUpdateDeviceInfo {
...
@@ -16,6 +16,13 @@ export interface IUpdateDeviceInfo {
equipmentStyle
:
'CROSSWISE'
|
'LENGTHWAYS'
equipmentStyle
:
'CROSSWISE'
|
'LENGTHWAYS'
}
}
export
interface
IUpdateFilmInfo
{
filmId
:
string
filmData
:
string
filmName
:
string
filmDescribe
:
string
}
class
UsersApi
extends
ApiClient
{
class
UsersApi
extends
ApiClient
{
/** 过去模板列表数据 */
/** 过去模板列表数据 */
getTempList
(
page
:
number
)
{
getTempList
(
page
:
number
)
{
...
@@ -64,6 +71,10 @@ class UsersApi extends ApiClient {
...
@@ -64,6 +71,10 @@ class UsersApi extends ApiClient {
url
:
`/myequipment/get/details/info/
${
equipmentId
}
`
url
:
`/myequipment/get/details/info/
${
equipmentId
}
`
})
})
}
}
/** 更新影片数据 */
updateFilmInfo
(
data
:
IUpdateFilmInfo
)
{
return
this
.
request
({
url
:
`/template/update/film/info`
,
data
})
}
/** 更新设备详情信息 */
/** 更新设备详情信息 */
updateDeviceInfo
(
data
:
IUpdateDeviceInfo
)
{
updateDeviceInfo
(
data
:
IUpdateDeviceInfo
)
{
...
@@ -95,7 +106,7 @@ class UsersApi extends ApiClient {
...
@@ -95,7 +106,7 @@ class UsersApi extends ApiClient {
})
})
}
}
/** 删除
设备
*/
/** 删除
视片
*/
removeFilm
(
filmId
:
string
)
{
removeFilm
(
filmId
:
string
)
{
return
this
.
request
({
return
this
.
request
({
method
:
'GET'
,
method
:
'GET'
,
...
...
src/api/files.ts
0 → 100644
View file @
b4bb3893
import
{
BASE_URL
,
FETCH_TIME_OUT
}
from
'@/common'
import
Taro
from
'@tarojs/taro'
class
Files
{
uploadFile
(
filePath
)
{
const
params
=
{
url
:
BASE_URL
+
'/common/upload/resource'
,
name
:
'resource'
,
filePath
:
filePath
}
return
Taro
.
uploadFile
(
params
)
}
downloadFile
(
params
)
{
return
Taro
.
downloadFile
(
params
)
}
}
export
default
new
Files
()
src/api/index.ts
View file @
b4bb3893
import
user
from
'./users'
import
user
from
'./users'
import
common
from
'./common'
import
common
from
'./common'
import
files
from
'./files'
export
default
{
export
default
{
user
,
user
,
common
common
,
files
}
}
src/pages/home/tempaltes/conpoments/edit_menu/index.tsx
View file @
b4bb3893
...
@@ -2,10 +2,12 @@ import { ComponentClass } from 'react'
...
@@ -2,10 +2,12 @@ import { ComponentClass } from 'react'
import
Taro
,
{
Component
}
from
'@tarojs/taro'
import
Taro
,
{
Component
}
from
'@tarojs/taro'
import
{
View
}
from
'@tarojs/components'
import
{
View
}
from
'@tarojs/components'
import
{
AtAccordion
,
AtList
}
from
'taro-ui'
import
{
AtAccordion
,
AtList
}
from
'taro-ui'
import
MenuItem
from
'../menu
-
item'
import
MenuItem
from
'../menu
_
item'
import
'./index.scss'
import
'./index.scss'
type
PageStateProps
=
{}
type
PageStateProps
=
{
activeIndex
:
number
}
type
PageDispatchProps
=
{}
type
PageDispatchProps
=
{}
...
@@ -18,7 +20,9 @@ type PageOwnProps = {
...
@@ -18,7 +20,9 @@ type PageOwnProps = {
setValue
:
()
=>
void
setValue
:
()
=>
void
}
}
type
PageState
=
{}
type
PageState
=
{
activeIndex
:
number
}
type
IProps
=
PageStateProps
&
PageDispatchProps
&
PageOwnProps
type
IProps
=
PageStateProps
&
PageDispatchProps
&
PageOwnProps
...
@@ -38,9 +42,10 @@ class EditMenu extends Component {
...
@@ -38,9 +42,10 @@ class EditMenu extends Component {
this
.
handleClick
=
this
.
handleClick
.
bind
(
this
)
this
.
handleClick
=
this
.
handleClick
.
bind
(
this
)
}
}
handleClick
(
value
)
{
handleClick
(
value
)
{
console
.
log
(
arguments
)
const
{
activeIndex
}
=
this
.
state
console
.
log
(
value
,
activeIndex
)
this
.
setState
({
this
.
setState
({
activeIndex
:
value
activeIndex
:
value
===
activeIndex
?
-
1
:
value
})
})
}
}
render
()
{
render
()
{
...
@@ -48,7 +53,7 @@ class EditMenu extends Component {
...
@@ -48,7 +53,7 @@ class EditMenu extends Component {
const
activeIndex
=
this
.
state
.
activeIndex
const
activeIndex
=
this
.
state
.
activeIndex
return
(
return
(
<
View
className=
"edit-container"
>
<
View
className=
"edit-container"
>
<
View
className=
"temp-top-info"
>
{
itemList
}
</
View
>
{
/* <View className="temp-top-info">{itemList}</View> */
}
{
itemList
.
map
((
item
,
index
)
=>
{
{
itemList
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
AtAccordion
<
AtAccordion
...
...
src/pages/home/tempaltes/conpoments/
menu-
item/index.scss
→
src/pages/home/tempaltes/conpoments/
list_
item/index.scss
View file @
b4bb3893
File moved
src/pages/home/tempaltes/conpoments/list_item/index.tsx
0 → 100644
View file @
b4bb3893
import
{
ComponentClass
}
from
'react'
import
Taro
,
{
Component
}
from
'@tarojs/taro'
import
{
View
,
Text
,
Image
,
Input
,
Button
}
from
'@tarojs/components'
import
api
from
'@/api/index'
import
'./index.scss'
type
PageStateProps
=
{}
type
PageDispatchProps
=
{}
type
PageOwnProps
=
{
item
:
any
objItem
:
any
schemaData
:
object
index
:
number
setValue
:
()
=>
void
}
type
PageState
=
{}
type
IProps
=
PageStateProps
&
PageDispatchProps
&
PageOwnProps
interface
ListItem
{
props
:
IProps
state
:
PageState
}
class
ListItem
extends
Component
{
constructor
()
{
super
(...
arguments
)
this
.
setState
({
isList
:
false
})
this
.
isSchemaIndex
=
this
.
isSchemaIndex
.
bind
(
this
)
this
.
checkType
=
this
.
checkType
.
bind
(
this
)
this
.
chooseImg
=
this
.
chooseImg
.
bind
(
this
)
// this.inputValueChage = this.inputValueChage.bind(this)
}
isSchemaIndex
(
item
)
{
return
item
[
'schemaIndex'
]
?
item
[
'schemaIndex'
]
:
0
}
checkType
(
item2
,
key
)
{
const
{
item
}
=
this
.
props
return
item
.
modelSchema
[
this
.
isSchemaIndex
(
item2
)][
key
].
type
}
chooseImg
(
key
)
{
const
{
setValue
,
schemaData
,
index
,
item
}
=
this
.
props
let
{
objItem
}
=
this
.
props
Taro
.
chooseImage
({
count
:
1
}).
then
(
res
=>
{
console
.
log
(
res
)
api
.
files
.
uploadFile
(
res
.
tempFilePaths
[
0
])
.
then
(
result
=>
{
console
.
log
(
JSON
.
parse
(
result
.
data
).
data
)
const
url
=
JSON
.
parse
(
result
.
data
).
data
let
currentSchemaData
=
JSON
.
parse
(
JSON
.
stringify
(
schemaData
))
currentSchemaData
[
item
.
dataKey
][
index
][
key
]
=
url
currentSchemaData
.
changeTime
=
Date
.
now
()
objItem
[
key
]
=
url
setValue
(
currentSchemaData
)
console
.
log
(
currentSchemaData
)
})
.
catch
(()
=>
{
Taro
.
showToast
({
title
:
'上传失败'
,
duration
:
2000
})
})
})
}
inputValueChage
(
dataKey
,
e
)
{
const
{
setValue
,
schemaData
}
=
this
.
props
const
newSchemaData
=
JSON
.
parse
(
JSON
.
stringify
(
schemaData
))
newSchemaData
[
dataKey
]
=
e
.
target
.
value
setValue
(
newSchemaData
)
console
.
log
(
arguments
,
'inputValueChage'
)
}
render
()
{
let
{
objItem
}
=
this
.
props
objItem
=
objItem
||
{}
console
.
log
(
'list_item render'
)
return
(
<
View
>
{
Object
.
keys
(
objItem
).
map
(
key
=>
{
let
ele
:
any
=
null
if
(
key
!==
'schemaIndex'
&&
key
!==
'index'
)
{
if
(
this
.
checkType
(
objItem
,
key
)
===
'image'
)
{
ele
=
(
<
View
>
<
Image
src=
{
objItem
[
key
]
}
/>
<
Button
onClick=
{
()
=>
{
this
.
chooseImg
(
key
)
}
}
>
更换图片
</
Button
>
</
View
>
)
}
if
(
this
.
checkType
(
objItem
,
key
)
===
'text'
)
{
ele
=
(
<
Input
className=
"menu-item-input"
value=
{
objItem
[
key
]
}
onInput=
{
this
.
inputValueChage
.
bind
(
this
,
key
)
}
/>
)
}
// ele = (
// <View>
// <View>
// 序号
//
{
index
}
//
{
key
}
// <Button>删除</Button>
// </View>
// </View>
// )
}
return
<
View
key=
{
key
}
>
{
ele
}
</
View
>
})
}
</
View
>
)
}
}
export
default
ListItem
as
ComponentClass
<
PageOwnProps
,
PageState
>
src/pages/home/tempaltes/conpoments/menu_item/index.scss
0 → 100644
View file @
b4bb3893
@import
'@styles/var.scss'
;
.menu-item
{
&
-input
{
border
:
1px
solid
#999
;
height
:
40px
;
margin
:
10px
5px
;
}
}
src/pages/home/tempaltes/conpoments/menu
-
item/index.tsx
→
src/pages/home/tempaltes/conpoments/menu
_
item/index.tsx
View file @
b4bb3893
import
{
ComponentClass
}
from
'react'
import
{
ComponentClass
}
from
'react'
import
Taro
,
{
Component
}
from
'@tarojs/taro'
import
Taro
,
{
Component
}
from
'@tarojs/taro'
import
{
View
,
Text
,
Image
,
Input
,
Button
}
from
'@tarojs/components'
import
{
View
,
Text
,
Image
,
Input
,
Button
}
from
'@tarojs/components'
import
ListItem
from
'../list_item'
import
'./index.scss'
import
'./index.scss'
type
PageStateProps
=
{}
type
PageStateProps
=
{}
...
@@ -45,12 +45,13 @@ class MenuItem extends Component {
...
@@ -45,12 +45,13 @@ class MenuItem extends Component {
inputValueChage
(
dataKey
,
e
)
{
inputValueChage
(
dataKey
,
e
)
{
const
{
setValue
,
schemaData
}
=
this
.
props
const
{
setValue
,
schemaData
}
=
this
.
props
const
newSchemaData
=
JSON
.
parse
(
JSON
.
stringify
(
schemaData
))
const
newSchemaData
=
JSON
.
parse
(
JSON
.
stringify
(
schemaData
))
newSchemaData
[
dataKey
]
=
e
.
target
.
value
newSchemaData
[
dataKey
]
[
'value'
]
=
e
.
target
.
value
setValue
(
newSchemaData
)
setValue
(
newSchemaData
)
console
.
log
(
arguments
,
'inputValueChage'
)
console
.
log
(
arguments
,
'inputValueChage'
)
}
}
render
()
{
render
()
{
const
{
item
,
schemaData
}
=
this
.
props
const
{
schemaData
,
setValue
}
=
this
.
props
let
{
item
}
=
this
.
props
item
=
item
||
{
item
=
item
||
{
type
:
''
type
:
''
}
}
...
@@ -73,45 +74,16 @@ class MenuItem extends Component {
...
@@ -73,45 +74,16 @@ class MenuItem extends Component {
return
(
return
(
<
View
>
<
View
>
{
schemaData
[
item
.
dataKey
].
map
((
item2
,
index
)
=>
{
{
schemaData
[
item
.
dataKey
].
map
((
item2
,
index
)
=>
{
const
item2Back
=
item2
//
const item2Back = item2
return
(
return
(
<
View
key=
{
index
+
123
}
>
<
View
key=
{
item
.
dataKey
}
>
{
Object
.
keys
(
item2
).
map
(
key
=>
{
<
ListItem
// const newKey = key
item=
{
item
}
return
key
!==
'schemaIndex'
&&
key
!==
'index'
?
(
objItem=
{
item2
}
<
View
key=
{
key
}
>
<
View
>
序号
{
index
}
{
key
}
<
Button
>
删除
</
Button
>
</
View
>
{
/* <View>{this.checkType(item2Back, newKey)}</View> */
}
{
/* <View>
{item.modelSchema[this.isSchemaIndex(item2)][key].type === 'text' ? (
<Input className="menu-item-input" value={item2[key]} />
) : null}
</View> */
}
{
/* item.modelSchema[this.isSchemaIndex(item2)][key].type ? (
<View>
<Image src={item2[key]} />
<Button>上传图片</Button>
</View>
) : null */
}
{
/* <MenuItem
item={item.modelSchema[this.isSchemaIndex(item2)][key]}
schemaData=
{
schemaData
}
schemaData=
{
schemaData
}
isList={false}
setValue=
{
setValue
}
/> */
}
index=
{
index
}
</
View
>
/>
)
:
(
''
)
// if ()
{
//
}
else
{
// return <View key=
{
key
}
>
121321
<
/View
>
//
}
})
}
</
View
>
</
View
>
)
)
})
}
})
}
...
...
src/pages/home/tempaltes/film_edit.tsx
View file @
b4bb3893
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
,
ScrollView
,
Button
,
Image
}
from
'@tarojs/components'
import
{
View
,
Text
,
ScrollView
,
Button
,
Image
,
Input
}
from
'@tarojs/components'
import
EditMenu
from
'./conpoments/edit_menu'
import
EditMenu
from
'./conpoments/edit_menu'
import
'./scss/film_edit.scss'
import
'./scss/film_edit.scss'
...
@@ -16,9 +16,10 @@ type PageState = {
...
@@ -16,9 +16,10 @@ type PageState = {
page
:
number
page
:
number
count
:
number
count
:
number
filmInfo
:
any
filmInfo
:
any
pageIndex
:
any
filmId
:
string
filmId
:
string
filmData
:
any
filmData
:
any
pageIn
dex
:
number
pageIn
fo
:
{}
}
}
type
IProps
=
PageStateProps
&
PageDispatchProps
&
PageOwnProps
type
IProps
=
PageStateProps
&
PageDispatchProps
&
PageOwnProps
...
@@ -34,17 +35,21 @@ class FilmDetail extends Component {
...
@@ -34,17 +35,21 @@ class FilmDetail extends Component {
}
}
constructor
()
{
constructor
()
{
super
()
super
(
...
arguments
)
const
filmId
=
this
.
$router
.
params
.
filmId
||
'32263ed8295746c99ab66282c26fbc65'
const
filmId
=
this
.
$router
.
params
.
filmId
||
'32263ed8295746c99ab66282c26fbc65'
this
.
state
=
{
this
.
state
=
{
filmId
,
filmId
,
page
:
1
,
page
:
0
,
count
:
0
,
count
:
0
,
pageIndex
:
0
,
pageIndex
:
0
,
filmInfo
:
{},
filmInfo
:
{},
filmData
:
{}
filmData
:
{},
pageInfo
:
{
pageIndex
:
0
}
}
}
this
.
setValue
=
this
.
setValue
.
bind
(
this
)
this
.
setValue
=
this
.
setValue
.
bind
(
this
)
this
.
updateFilm
=
this
.
updateFilm
.
bind
(
this
)
}
}
componentWillMount
()
{
componentWillMount
()
{
...
@@ -58,9 +63,9 @@ class FilmDetail extends Component {
...
@@ -58,9 +63,9 @@ class FilmDetail extends Component {
console
.
log
({
filmInfo
})
console
.
log
({
filmInfo
})
const
{
list
,
count
}
=
filmInfo
const
{
list
,
count
}
=
filmInfo
const
filmData
=
const
filmData
=
JSON
.
parse
(
filmInfo
.
filmData
)
&&
JSON
.
parse
(
filmInfo
.
filmData
)
.
pageList
JSON
.
parse
(
filmInfo
.
filmData
)
&&
JSON
.
parse
(
filmInfo
.
filmData
)
?
JSON
.
parse
(
filmInfo
.
filmData
)
.
pageList
?
JSON
.
parse
(
filmInfo
.
filmData
)
:
[]
:
{}
this
.
setState
({
this
.
setState
({
count
,
count
,
filmInfo
,
filmInfo
,
...
@@ -71,26 +76,70 @@ class FilmDetail extends Component {
...
@@ -71,26 +76,70 @@ class FilmDetail extends Component {
}
}
}
}
changePage
(
index
)
{
changePage
(
index
)
{
console
.
log
(
index
,
'changePage'
)
const
pageIndex
=
index
this
.
setState
({
this
.
setState
({
pageIndex
:
index
filmInfo
:
{
filmName
:
this
.
state
.
filmInfo
.
filmName
,
filmDescribe
:
this
.
state
.
filmInfo
.
filmDescribe
},
pageIndex
:
pageIndex
})
}
updateFilm
()
{
const
{
filmDescribe
,
filmId
,
filmName
}
=
this
.
state
.
filmInfo
console
.
log
(
filmId
,
'filmId'
,
this
.
state
.
filmInfo
)
let
filmDatas
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
state
.
filmData
))
// filmDatas.pageList = this.state.filmData.pageList
api
.
common
.
updateFilmInfo
({
filmDescribe
,
filmId
:
this
.
$router
.
params
.
filmId
,
filmName
,
filmData
:
JSON
.
stringify
(
filmDatas
)
})
.
then
(()
=>
{
Taro
.
showToast
({
title
:
'成功'
,
icon
:
'success'
,
duration
:
1000
})
Taro
.
navigateBack
()
})
})
}
}
setValue
(
schemaData
)
{
setValue
(
schemaData
)
{
const
currentData
=
this
.
state
.
filmData
let
currentData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
state
.
filmData
))
currentData
[
this
.
state
.
pageIndex
]
=
schemaData
JSON
.
parse
(
JSON
.
stringify
(
this
.
state
.
filmData
))
currentData
.
pageList
[
this
.
state
.
pageIndex
].
schemaData
=
schemaData
console
.
log
(
schemaData
)
this
.
setState
({
this
.
setState
({
filmData
:
currentData
filmData
:
currentData
,
filmInfo
:
{
filmName
:
this
.
state
.
filmInfo
.
filmName
,
filmDescribe
:
this
.
state
.
filmInfo
.
filmDescribe
}
})
})
}
}
changeFilmName
=
({
target
})
=>
{
changeFilmName
=
({
target
})
=>
{
const
{
value
}
=
target
const
{
value
}
=
target
this
.
setState
({
createFilmName
:
value
})
console
.
log
(
this
.
state
.
filmData
)
this
.
setState
({
filmInfo
:
{
filmName
:
value
,
filmDescribe
:
this
.
state
.
filmInfo
.
filmDescribe
}
})
}
}
changeDescribeName
=
({
target
})
=>
{
changeDescribeName
=
({
target
})
=>
{
const
{
value
}
=
target
const
{
value
}
=
target
this
.
setState
({
createFilmDescribe
:
value
})
this
.
setState
({
filmInfo
:
{
filmDescribe
:
value
,
filmName
:
this
.
state
.
filmInfo
.
filmName
}
})
}
}
shouldComponentUpdate
(
_nextProps
:
IProps
,
_nextState
:
PageState
)
{
shouldComponentUpdate
(
_nextProps
:
IProps
,
_nextState
:
PageState
)
{
const
{
filmInfo
}
=
this
.
state
const
{
filmInfo
}
=
this
.
state
...
@@ -102,6 +151,8 @@ class FilmDetail extends Component {
...
@@ -102,6 +151,8 @@ class FilmDetail extends Component {
const
{
filmInfo
,
filmData
,
pageIndex
}
=
this
.
state
const
{
filmInfo
,
filmData
,
pageIndex
}
=
this
.
state
filmInfo
.
templateName
=
filmInfo
.
filmName
filmInfo
.
templateName
=
filmInfo
.
filmName
filmInfo
.
templateDescribe
=
filmInfo
.
filmDescribe
filmInfo
.
templateDescribe
=
filmInfo
.
filmDescribe
const
pageList
=
filmData
.
pageList
console
.
log
(
'film-edit render'
)
return
(
return
(
<
View
className=
"film-detail"
>
<
View
className=
"film-detail"
>
<
View
className=
"film-detail-scroll"
>
<
View
className=
"film-detail-scroll"
>
...
@@ -117,16 +168,22 @@ class FilmDetail extends Component {
...
@@ -117,16 +168,22 @@ class FilmDetail extends Component {
<
Input
<
Input
placeholder=
"请输入视片描述"
placeholder=
"请输入视片描述"
className=
"film-info-input"
className=
"film-info-input"
value=
{
filmInfo
.
film
Nam
e
}
value=
{
filmInfo
.
film
Describ
e
}
onInput=
{
this
.
changeDescribeName
}
onInput=
{
this
.
changeDescribeName
}
/>
/>
</
View
>
</
View
>
<
ScrollView
className=
"film-detail-scroll-view"
scrollX
>
<
ScrollView
className=
"film-detail-scroll-view"
scrollX
>
<
View
className=
"page-container"
>
<
View
className=
"page-container"
>
{
filmData
.
map
((
item
,
index
)
=>
{
{
pageList
.
map
((
item
,
index
)
=>
{
// const name = item.name
// const name = item.name
return
(
return
(
<
View
key=
{
index
}
className=
"page-item"
>
<
View
key=
{
index
+
item
.
name
}
className=
"page-item"
onClick=
{
()
=>
{
this
.
changePage
(
index
)
}
}
>
<
Image
src=
{
item
.
thumb
}
className=
"page-thumb"
/>
<
Image
src=
{
item
.
thumb
}
className=
"page-thumb"
/>
<
View
>
{
item
.
name
}
</
View
>
<
View
>
{
item
.
name
}
</
View
>
</
View
>
</
View
>
...
@@ -134,14 +191,15 @@ class FilmDetail extends Component {
...
@@ -134,14 +191,15 @@ class FilmDetail extends Component {
})
}
})
}
</
View
>
</
View
>
</
ScrollView
>
</
ScrollView
>
{
filmData
[
pageIndex
]
}
{
/* {filmData[pageIndex]} */
}
<
EditMenu
{
...
filmData
[
pageIndex
]}
setValue=
{
this
.
setValue
}
/>
{
pageIndex
}
<
EditMenu
{
...
pageList
[
pageIndex
]}
setValue=
{
this
.
setValue
}
/>
</
View
>
</
View
>
<
View
className=
"film-detail-bottom-bar"
>
<
View
className=
"film-detail-bottom-bar"
>
<
Button
type=
"primary"
className=
"film-detail-bottom-bar-btn"
>
<
Button
type=
"primary"
className=
"film-detail-bottom-bar-btn"
>
预览视片
预览视片
</
Button
>
</
Button
>
<
Button
type=
"primary"
className=
"film-detail-bottom-bar-btn"
>
<
Button
type=
"primary"
className=
"film-detail-bottom-bar-btn"
onClick=
{
this
.
updateFilm
}
>
更改并同步到设备
更改并同步到设备
</
Button
>
</
Button
>
</
View
>
</
View
>
...
...
src/pages/system/wifi_list/index.tsx
View file @
b4bb3893
...
@@ -4,6 +4,8 @@ import Modal from '@/conpoments/modal'
...
@@ -4,6 +4,8 @@ import Modal from '@/conpoments/modal'
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
,
ScrollView
,
Input
,
Button
}
from
'@tarojs/components'
import
{
View
,
Text
,
ScrollView
,
Input
,
Button
}
from
'@tarojs/components'
import
{
connect
}
from
'@tarojs/redux'
import
{
getFilmList
}
from
'@/actions/asyncCounter'
import
'./index.scss'
import
'./index.scss'
import
{
showMyToast
}
from
'@/common/utils'
import
{
showMyToast
}
from
'@/common/utils'
...
@@ -15,9 +17,14 @@ export interface IWifiListItem {
...
@@ -15,9 +17,14 @@ export interface IWifiListItem {
type
:
'OPEN'
|
'WPA'
|
'WPA_EAP'
type
:
'OPEN'
|
'WPA'
|
'WPA_EAP'
}
}
type
PageStateProps
=
{}
type
PageStateProps
=
{
list
:
any
[]
count
:
number
}
type
PageDispatchProps
=
{}
type
PageDispatchProps
=
{
getFilmListData
:
(
page
:
number
)
=>
void
}
type
PageOwnProps
=
{}
type
PageOwnProps
=
{}
...
@@ -33,6 +40,17 @@ interface WifiList {
...
@@ -33,6 +40,17 @@ interface WifiList {
state
:
PageState
state
:
PageState
}
}
@
connect
(
({
counter
})
=>
{
const
{
list
,
count
}
=
counter
.
filmData
return
{
list
,
count
}
},
dispacth
=>
({
getFilmListData
(
page
:
number
)
{
dispacth
(
getFilmList
(
page
))
}
})
)
class
WifiList
extends
Component
{
class
WifiList
extends
Component
{
config
:
Config
=
{
config
:
Config
=
{
navigationBarTitleText
:
'WLAN'
navigationBarTitleText
:
'WLAN'
...
@@ -116,6 +134,7 @@ class WifiList extends Component {
...
@@ -116,6 +134,7 @@ class WifiList extends Component {
equipmentWifiIdentity
:
''
,
equipmentWifiIdentity
:
''
,
equipmentWifiPassword
:
password
equipmentWifiPassword
:
password
})
})
console
.
log
(
this
.
props
.
getFilmListData
(
1
),
this
.
props
)
showMyToast
({
title
:
'设备添加成功~'
})
showMyToast
({
title
:
'设备添加成功~'
})
Taro
.
redirectTo
({
url
:
`/pages/home/device/device_detail/index?equipmentId=
${
equipmentId
}
`
})
Taro
.
redirectTo
({
url
:
`/pages/home/device/device_detail/index?equipmentId=
${
equipmentId
}
`
})
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
tslint.json
View file @
b4bb3893
{
{
"extends"
:
[
"tslint:recommended"
,
"tslint-react"
],
"extends"
:
[
"tslint:recommended"
,
"tslint-react"
],
"rules"
:
{
"rules"
:
{
"prefer-const"
:
false
,
"arrow-parens"
:
false
,
"arrow-parens"
:
false
,
"arrow-return-shorthand"
:
[
false
],
"arrow-return-shorthand"
:
[
false
],
"comment-format"
:
[
true
,
"check-space"
],
"comment-format"
:
[
true
,
"check-space"
],
...
...
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