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
c61947f5
authored
Aug 27, 2019
by
hanjixin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据修改
parent
cfe737da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
21 deletions
+33
-21
src/pages/home/tempaltes/conpoments/edit_menu/index.tsx
+4
-4
src/pages/home/tempaltes/conpoments/menu-item/index.tsx
+20
-10
src/pages/home/tempaltes/film_edit.tsx
+9
-7
No files found.
src/pages/home/tempaltes/conpoments/edit_menu/index.tsx
View file @
c61947f5
import
{
ComponentClass
}
from
'react'
import
Taro
,
{
Component
}
from
'@tarojs/taro'
import
{
View
,
Input
,
Image
,
Button
}
from
'@tarojs/components'
import
{
View
}
from
'@tarojs/components'
import
{
AtAccordion
,
AtList
}
from
'taro-ui'
import
MenuItem
from
'../menu-item'
import
'./index.scss'
...
...
@@ -15,6 +15,7 @@ type PageOwnProps = {
pageIndex
:
number
open
:
boolean
activeIndex
:
number
setValue
:
()
=>
void
}
type
PageState
=
{}
...
...
@@ -43,9 +44,8 @@ class EditMenu extends Component {
})
}
render
()
{
const
{
schemaData
,
itemList
}
=
this
.
props
const
{
schemaData
,
itemList
,
setValue
}
=
this
.
props
const
activeIndex
=
this
.
state
.
activeIndex
console
.
log
(
'activeIndex'
,
activeIndex
)
return
(
<
View
className=
"edit-container"
>
<
View
className=
"temp-top-info"
>
{
itemList
}
</
View
>
...
...
@@ -60,7 +60,7 @@ class EditMenu extends Component {
key=
{
index
+
item
.
name
}
>
<
AtList
hasBorder=
{
false
}
>
<
MenuItem
item=
{
item
}
schemaData=
{
schemaData
}
isList=
{
false
}
/>
<
MenuItem
item=
{
item
}
schemaData=
{
schemaData
}
isList=
{
false
}
setValue=
{
setValue
}
/>
</
AtList
>
</
AtAccordion
>
)
...
...
src/pages/home/tempaltes/conpoments/menu-item/index.tsx
View file @
c61947f5
...
...
@@ -12,6 +12,7 @@ type PageOwnProps = {
item
:
any
schemaData
:
object
isList
:
boolean
setValue
:
()
=>
void
}
type
PageState
=
{}
...
...
@@ -25,12 +26,13 @@ interface MenuItem {
class
MenuItem
extends
Component
{
constructor
()
{
super
(
arguments
)
super
(
...
arguments
)
this
.
setState
({
isList
:
false
})
this
.
isSchemaIndex
=
this
.
isSchemaIndex
.
bind
(
this
)
this
.
checkType
=
this
.
checkType
.
bind
(
this
)
// this.inputValueChage = this.inputValueChage.bind(this)
}
isSchemaIndex
(
item
)
{
return
item
[
'schemaIndex'
]
?
item
[
'schemaIndex'
]
:
0
...
...
@@ -39,18 +41,26 @@ class MenuItem extends Component {
const
{
item
}
=
this
.
props
return
item
.
modelSchema
[
this
.
isSchemaIndex
(
item2
)][
key
].
type
}
listItem
(
item2
)
{}
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
()
{
const
{
item
,
schemaData
,
isList
,
setValue
}
=
this
.
props
const
mySet
=
setValue
?
setValue
:
e
=>
{
console
.
log
(
e
.
target
.
value
)
}
// let str: any = ''
const
{
item
,
schemaData
}
=
this
.
props
item
=
item
||
{
type
:
''
}
if
(
item
.
type
===
'text'
)
{
return
(
<
Input
className=
"menu-item-input"
value=
{
schemaData
[
item
.
dataKey
].
value
}
onInput=
{
mySet
}
/>
<
Input
className=
"menu-item-input"
value=
{
schemaData
[
item
.
dataKey
].
value
}
onInput=
{
this
.
inputValueChage
.
bind
(
this
,
item
.
dataKey
)
}
/>
)
}
else
if
(
item
.
type
===
'image'
)
{
return
(
...
...
src/pages/home/tempaltes/film_edit.tsx
View file @
c61947f5
...
...
@@ -44,7 +44,7 @@ class FilmDetail extends Component {
filmInfo
:
{},
filmData
:
{}
}
this
.
chengDevice
=
this
.
chengDevic
e
.
bind
(
this
)
this
.
setValue
=
this
.
setValu
e
.
bind
(
this
)
}
componentWillMount
()
{
...
...
@@ -75,12 +75,14 @@ class FilmDetail extends Component {
pageIndex
:
index
})
}
chengDevice
()
{
console
.
log
(
'chengDevice'
)
const
{
filmId
}
=
this
.
state
const
url
=
`/pages/home/device/device_bind/index?filmId=
${
filmId
}
`
Taro
.
navigateTo
({
url
})
setValue
(
schemaData
)
{
const
currentData
=
this
.
state
.
filmData
currentData
[
this
.
state
.
pageIndex
]
=
schemaData
this
.
setState
({
filmData
:
currentData
})
}
changeFilmName
=
({
target
})
=>
{
const
{
value
}
=
target
this
.
setState
({
createFilmName
:
value
})
...
...
@@ -133,7 +135,7 @@ class FilmDetail extends Component {
</
View
>
</
ScrollView
>
{
filmData
[
pageIndex
]
}
<
EditMenu
{
...
filmData
[
pageIndex
]}
/>
<
EditMenu
{
...
filmData
[
pageIndex
]}
setValue=
{
this
.
setValue
}
/>
</
View
>
<
View
className=
"film-detail-bottom-bar"
>
<
Button
type=
"primary"
className=
"film-detail-bottom-bar-btn"
>
...
...
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