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
{
ComponentClass
}
from
'react'
import
Taro
,
{
Component
}
from
'@tarojs/taro'
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
{
AtAccordion
,
AtList
}
from
'taro-ui'
import
MenuItem
from
'../menu-item'
import
MenuItem
from
'../menu-item'
import
'./index.scss'
import
'./index.scss'
...
@@ -15,6 +15,7 @@ type PageOwnProps = {
...
@@ -15,6 +15,7 @@ type PageOwnProps = {
pageIndex
:
number
pageIndex
:
number
open
:
boolean
open
:
boolean
activeIndex
:
number
activeIndex
:
number
setValue
:
()
=>
void
}
}
type
PageState
=
{}
type
PageState
=
{}
...
@@ -43,9 +44,8 @@ class EditMenu extends Component {
...
@@ -43,9 +44,8 @@ class EditMenu extends Component {
})
})
}
}
render
()
{
render
()
{
const
{
schemaData
,
itemList
}
=
this
.
props
const
{
schemaData
,
itemList
,
setValue
}
=
this
.
props
const
activeIndex
=
this
.
state
.
activeIndex
const
activeIndex
=
this
.
state
.
activeIndex
console
.
log
(
'activeIndex'
,
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
>
...
@@ -60,7 +60,7 @@ class EditMenu extends Component {
...
@@ -60,7 +60,7 @@ class EditMenu extends Component {
key=
{
index
+
item
.
name
}
key=
{
index
+
item
.
name
}
>
>
<
AtList
hasBorder=
{
false
}
>
<
AtList
hasBorder=
{
false
}
>
<
MenuItem
item=
{
item
}
schemaData=
{
schemaData
}
isList=
{
false
}
/>
<
MenuItem
item=
{
item
}
schemaData=
{
schemaData
}
isList=
{
false
}
setValue=
{
setValue
}
/>
</
AtList
>
</
AtList
>
</
AtAccordion
>
</
AtAccordion
>
)
)
...
...
src/pages/home/tempaltes/conpoments/menu-item/index.tsx
View file @
c61947f5
...
@@ -12,6 +12,7 @@ type PageOwnProps = {
...
@@ -12,6 +12,7 @@ type PageOwnProps = {
item
:
any
item
:
any
schemaData
:
object
schemaData
:
object
isList
:
boolean
isList
:
boolean
setValue
:
()
=>
void
}
}
type
PageState
=
{}
type
PageState
=
{}
...
@@ -25,12 +26,13 @@ interface MenuItem {
...
@@ -25,12 +26,13 @@ interface MenuItem {
class
MenuItem
extends
Component
{
class
MenuItem
extends
Component
{
constructor
()
{
constructor
()
{
super
(
arguments
)
super
(
...
arguments
)
this
.
setState
({
this
.
setState
({
isList
:
false
isList
:
false
})
})
this
.
isSchemaIndex
=
this
.
isSchemaIndex
.
bind
(
this
)
this
.
isSchemaIndex
=
this
.
isSchemaIndex
.
bind
(
this
)
this
.
checkType
=
this
.
checkType
.
bind
(
this
)
this
.
checkType
=
this
.
checkType
.
bind
(
this
)
// this.inputValueChage = this.inputValueChage.bind(this)
}
}
isSchemaIndex
(
item
)
{
isSchemaIndex
(
item
)
{
return
item
[
'schemaIndex'
]
?
item
[
'schemaIndex'
]
:
0
return
item
[
'schemaIndex'
]
?
item
[
'schemaIndex'
]
:
0
...
@@ -39,18 +41,26 @@ class MenuItem extends Component {
...
@@ -39,18 +41,26 @@ class MenuItem extends Component {
const
{
item
}
=
this
.
props
const
{
item
}
=
this
.
props
return
item
.
modelSchema
[
this
.
isSchemaIndex
(
item2
)][
key
].
type
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
()
{
render
()
{
const
{
item
,
schemaData
,
isList
,
setValue
}
=
this
.
props
const
{
item
,
schemaData
}
=
this
.
props
const
mySet
=
setValue
item
=
item
||
{
?
setValue
type
:
''
:
e
=>
{
}
console
.
log
(
e
.
target
.
value
)
}
// let str: any = ''
if
(
item
.
type
===
'text'
)
{
if
(
item
.
type
===
'text'
)
{
return
(
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'
)
{
}
else
if
(
item
.
type
===
'image'
)
{
return
(
return
(
...
...
src/pages/home/tempaltes/film_edit.tsx
View file @
c61947f5
...
@@ -44,7 +44,7 @@ class FilmDetail extends Component {
...
@@ -44,7 +44,7 @@ class FilmDetail extends Component {
filmInfo
:
{},
filmInfo
:
{},
filmData
:
{}
filmData
:
{}
}
}
this
.
chengDevice
=
this
.
chengDevic
e
.
bind
(
this
)
this
.
setValue
=
this
.
setValu
e
.
bind
(
this
)
}
}
componentWillMount
()
{
componentWillMount
()
{
...
@@ -75,12 +75,14 @@ class FilmDetail extends Component {
...
@@ -75,12 +75,14 @@ class FilmDetail extends Component {
pageIndex
:
index
pageIndex
:
index
})
})
}
}
chengDevice
()
{
setValue
(
schemaData
)
{
console
.
log
(
'chengDevice'
)
const
currentData
=
this
.
state
.
filmData
const
{
filmId
}
=
this
.
state
currentData
[
this
.
state
.
pageIndex
]
=
schemaData
const
url
=
`/pages/home/device/device_bind/index?filmId=
${
filmId
}
`
this
.
setState
({
Taro
.
navigateTo
({
url
})
filmData
:
currentData
})
}
}
changeFilmName
=
({
target
})
=>
{
changeFilmName
=
({
target
})
=>
{
const
{
value
}
=
target
const
{
value
}
=
target
this
.
setState
({
createFilmName
:
value
})
this
.
setState
({
createFilmName
:
value
})
...
@@ -133,7 +135,7 @@ class FilmDetail extends Component {
...
@@ -133,7 +135,7 @@ class FilmDetail extends Component {
</
View
>
</
View
>
</
ScrollView
>
</
ScrollView
>
{
filmData
[
pageIndex
]
}
{
filmData
[
pageIndex
]
}
<
EditMenu
{
...
filmData
[
pageIndex
]}
/>
<
EditMenu
{
...
filmData
[
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"
>
...
...
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