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
d0e2b415
authored
Sep 20, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix editbug
parent
e967bfc7
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
135 additions
and
51 deletions
+135
-51
project.config.json
+26
-27
src/assets/styles/var.scss
+0
-0
src/common/index.ts
+2
-2
src/conpoments/film_list_item/index.tsx
+2
-1
src/pages/home/tempaltes/conpoments/detail_top/index.tsx
+2
-1
src/pages/home/tempaltes/conpoments/edit_menu/index.tsx
+3
-1
src/pages/home/tempaltes/conpoments/home_item/index.tsx
+2
-1
src/pages/home/tempaltes/conpoments/list_item/index.scss
+1
-1
src/pages/home/tempaltes/conpoments/list_item/index.tsx
+14
-1
src/pages/home/tempaltes/conpoments/menu_item/index.scss
+20
-1
src/pages/home/tempaltes/conpoments/menu_item/index.tsx
+41
-2
src/pages/home/tempaltes/conpoments/temp_item/index.tsx
+2
-1
src/pages/home/tempaltes/film_edit.tsx
+17
-10
src/pages/home/tempaltes/scss/film_edit.scss
+3
-2
No files found.
project.config.json
View file @
d0e2b415
{
"miniprogramRoot"
:
"dist/"
,
"projectname"
:
"taroDemo"
,
"description"
:
""
,
"appid"
:
"wx9dd4033f37a9fa9f"
,
"setting"
:
{
"urlCheck"
:
false
,
"es6"
:
false
,
"postcss"
:
false
,
"minified"
:
false
,
"newFeature"
:
true
,
"autoAudits"
:
false
,
"checkInvalidKey"
:
true
,
"coverView"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"babelSetting"
:
{
"ignore"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
}
},
"compileType"
:
"miniprogram"
,
"simulatorType"
:
"wechat"
,
"simulatorPluginLibVersion"
:
{},
"condition"
:
{}
}
\ No newline at end of file
"miniprogramRoot"
:
"dist/"
,
"projectname"
:
"taroDemo"
,
"description"
:
""
,
"appid"
:
"wxc3dfc37466838046"
,
"setting"
:
{
"urlCheck"
:
false
,
"es6"
:
false
,
"postcss"
:
false
,
"minified"
:
false
,
"newFeature"
:
true
,
"autoAudits"
:
false
,
"checkInvalidKey"
:
true
,
"coverView"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"babelSetting"
:
{
"ignore"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
}
},
"compileType"
:
"miniprogram"
,
"simulatorType"
:
"wechat"
,
"simulatorPluginLibVersion"
:
{},
"condition"
:
{}
}
src/assets/styles/var.scss
View file @
d0e2b415
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/common/index.ts
View file @
d0e2b415
export
const
FETCH_TIME_OUT
=
5000
//
export const BASE_URL = 'https://server.bdideal.com'
export
const
BASE_URL
=
'http://172.16.4.219:8090'
export
const
BASE_URL
=
'https://server.bdideal.com'
//
export const BASE_URL = 'http://172.16.4.219:8090'
/** 蓝牙的服务 uuid */
export
const
BLE_SERVICE_ID
=
'000088A0-0000-1000-8000-00805F9B34FB'
...
...
src/conpoments/film_list_item/index.tsx
View file @
d0e2b415
...
...
@@ -24,7 +24,8 @@ interface FilmListItem {
class
FilmListItem
extends
Component
{
render
()
{
const
{
templateUrl
,
filmName
,
equipmentCount
,
onClick
}
=
this
.
props
let
{
templateUrl
,
filmName
,
equipmentCount
,
onClick
}
=
this
.
props
templateUrl
=
templateUrl
||
''
return
(
<
View
className=
"films-item"
onClick=
{
()
=>
onClick
&&
onClick
()
}
>
<
View
className=
"films-item-img-box"
>
...
...
src/pages/home/tempaltes/conpoments/detail_top/index.tsx
View file @
d0e2b415
...
...
@@ -25,7 +25,8 @@ interface DerailTop {
class
DerailTop
extends
Component
{
render
()
{
const
{
templateUrl
,
templateName
,
templateDescribe
}
=
this
.
props
let
{
templateUrl
,
templateName
,
templateDescribe
}
=
this
.
props
templateUrl
=
templateUrl
||
''
return
(
<
View
className=
"derail-top"
>
<
View
className=
"temp-top-info"
>
...
...
src/pages/home/tempaltes/conpoments/edit_menu/index.tsx
View file @
d0e2b415
...
...
@@ -49,8 +49,9 @@ class EditMenu extends Component {
})
}
render
()
{
cons
t
{
schemaData
,
itemList
,
setValue
}
=
this
.
props
le
t
{
schemaData
,
itemList
,
setValue
}
=
this
.
props
const
activeIndex
=
this
.
state
.
activeIndex
itemList
=
itemList
||
[]
return
(
<
View
className=
"edit-container"
>
{
/* <View className="temp-top-info">{itemList}</View> */
}
...
...
@@ -61,6 +62,7 @@ class EditMenu extends Component {
onClick=
{
()
=>
{
this
.
handleClick
(
index
)
}
}
isAnimation=
{
false
}
title=
{
item
.
name
}
key=
{
index
+
item
.
name
}
>
...
...
src/pages/home/tempaltes/conpoments/home_item/index.tsx
View file @
d0e2b415
...
...
@@ -34,7 +34,8 @@ class HomeItem extends Component {
}
render
()
{
const
{
templateInfo
,
typeName
}
=
this
.
props
let
{
templateInfo
,
typeName
}
=
this
.
props
templateInfo
=
templateInfo
||
[]
return
(
<
View
className=
"home-item"
>
<
ScrollView
scrollY
>
...
...
src/pages/home/tempaltes/conpoments/list_item/index.scss
View file @
d0e2b415
...
...
@@ -3,7 +3,7 @@
.menu-item
{
&
-input
{
border
:
1px
solid
#999
;
height
:
4
0px
;
height
:
6
0px
;
margin
:
10px
5px
;
}
}
src/pages/home/tempaltes/conpoments/list_item/index.tsx
View file @
d0e2b415
...
...
@@ -41,8 +41,20 @@ class ListItem extends Component {
}
checkType
(
item2
,
key
)
{
const
{
item
}
=
this
.
props
console
.
log
(
item
.
modelSchema
[
this
.
isSchemaIndex
(
item2
)],
key
)
if
(
key
===
'index'
||
key
===
'schemaIndex'
)
{
return
''
}
return
item
.
modelSchema
[
this
.
isSchemaIndex
(
item2
)][
key
].
type
}
checkPlaceHolder
(
item2
,
key
)
{
const
{
item
}
=
this
.
props
console
.
log
(
item
.
modelSchema
[
this
.
isSchemaIndex
(
item2
)],
key
)
if
(
key
===
'index'
||
key
===
'schemaIndex'
)
{
return
''
}
return
item
.
modelSchema
[
this
.
isSchemaIndex
(
item2
)][
key
].
description
}
chooseImg
(
key
)
{
const
{
setValue
,
schemaData
,
index
,
item
}
=
this
.
props
...
...
@@ -84,7 +96,7 @@ class ListItem extends Component {
<
View
>
{
Object
.
keys
(
objItem
).
map
(
key
=>
{
let
ele
:
any
=
null
console
.
log
(
key
,
'+++++++++++++++++++++'
,
objItem
)
if
(
key
!==
'schemaIndex'
&&
key
!==
'index'
)
{
if
(
this
.
checkType
(
objItem
,
key
)
===
'image'
)
{
ele
=
(
...
...
@@ -105,6 +117,7 @@ class ListItem extends Component {
<
Input
className=
"menu-item-input"
value=
{
objItem
[
key
]
}
placeholder=
{
this
.
checkPlaceHolder
(
objItem
,
key
)
}
onInput=
{
this
.
inputValueChage
.
bind
(
this
,
key
)
}
/>
)
...
...
src/pages/home/tempaltes/conpoments/menu_item/index.scss
View file @
d0e2b415
...
...
@@ -3,7 +3,26 @@
.menu-item
{
&
-input
{
border
:
1px
solid
#999
;
height
:
4
0px
;
height
:
6
0px
;
margin
:
10px
5px
;
}
}
.list-item-container
{
padding
:
20px
;
border
:
1px
solid
#999
;
margin
:
20px
;
.list-item-title
{
display
:
flex
;
justify-content
:
space-between
;
.list-item-index
{
color
:
#333
;
}
.list-item-del
{
color
:
red
;
}
}
}
src/pages/home/tempaltes/conpoments/menu_item/index.tsx
View file @
d0e2b415
...
...
@@ -62,9 +62,30 @@ class MenuItem extends Component {
})
})
}
removeItem
(
index
,
key
)
{
// schemaData[item.dataKey]
let
{
schemaData
,
setValue
}
=
this
.
props
let
newSchemaData
=
JSON
.
parse
(
JSON
.
stringify
(
schemaData
))
newSchemaData
[
key
].
splice
(
index
,
1
)
setValue
(
newSchemaData
)
// console.log()
}
addItem
()
{
// schemaData[item.dataKey]
let
{
schemaData
,
setValue
,
item
}
=
this
.
props
let
newSchemaData
=
JSON
.
parse
(
JSON
.
stringify
(
schemaData
))
let
keys
=
Object
.
keys
(
item
.
modelSchema
[
0
])
let
obj
=
{}
keys
.
map
(
item2
=>
{
obj
[
item2
]
=
''
})
newSchemaData
[
item
.
dataKey
].
push
(
obj
)
setValue
(
newSchemaData
)
// console.log()
}
inputValueChage
(
dataKey
,
e
)
{
const
{
setValue
,
schemaData
}
=
this
.
props
cons
t
newSchemaData
=
JSON
.
parse
(
JSON
.
stringify
(
schemaData
))
le
t
newSchemaData
=
JSON
.
parse
(
JSON
.
stringify
(
schemaData
))
newSchemaData
[
dataKey
][
'value'
]
=
e
.
target
.
value
setValue
(
newSchemaData
)
console
.
log
(
arguments
,
'inputValueChage'
)
...
...
@@ -102,7 +123,18 @@ class MenuItem extends Component {
{
schemaData
[
item
.
dataKey
].
map
((
item2
,
index
)
=>
{
// const item2Back = item2
return
(
<
View
key=
{
item
.
dataKey
}
>
<
View
className=
"list-item-container"
key=
{
item
.
dataKey
}
>
<
View
className=
"list-item-title"
>
<
Text
className=
"list-item-index"
>
第
{
index
+
1
}
项
</
Text
>
<
Text
className=
"list-item-del"
onClick=
{
()
=>
{
this
.
removeItem
(
index
,
item
.
dataKey
)
}
}
>
删除
</
Text
>
</
View
>
<
ListItem
item=
{
item
}
objItem=
{
item2
}
...
...
@@ -113,6 +145,13 @@ class MenuItem extends Component {
</
View
>
)
})
}
<
Button
onClick=
{
()
=>
{
this
.
addItem
()
}
}
>
添加子项
</
Button
>
</
View
>
)
}
else
{
...
...
src/pages/home/tempaltes/conpoments/temp_item/index.tsx
View file @
d0e2b415
...
...
@@ -29,7 +29,7 @@ class TempItem extends Component {
}
render
()
{
cons
t
{
le
t
{
templateName
,
templateUrl
:
url
,
filmName
,
...
...
@@ -38,6 +38,7 @@ class TempItem extends Component {
filmCount
,
templateEnvironment
}
=
this
.
props
url
=
url
||
''
return
(
<
View
className=
"temp-item"
onClick=
{
this
.
goDetail
}
>
{
templateEnvironment
===
'自有设备'
?
<
View
className=
"tips"
>
建议内部设备
</
View
>
:
null
}
...
...
src/pages/home/tempaltes/film_edit.tsx
View file @
d0e2b415
...
...
@@ -108,12 +108,19 @@ class FilmDetail extends Component {
console
.
log
(
index
,
'changePage'
)
const
pageIndex
=
index
this
.
setState
({
filmInfo
:
{
filmName
:
this
.
state
.
filmInfo
.
filmName
,
filmDescribe
:
this
.
state
.
filmInfo
.
filmDescribe
},
//
filmInfo: {
//
filmName: this.state.filmInfo.filmName,
//
filmDescribe: this.state.filmInfo.filmDescribe
//
},
pageIndex
:
pageIndex
})
// this.setState({
// filmInfo: {
// filmName: this.state.filmInfo.filmName,
// filmDescribe: this.state.filmInfo.filmDescribe
// },
// pageIndex: pageIndex
// })
}
updateFilm
()
{
const
{
filmDescribe
,
filmId
,
filmName
}
=
this
.
state
.
filmInfo
...
...
@@ -170,17 +177,17 @@ class FilmDetail extends Component {
}
})
}
shouldComponentUpdate
(
_nextProps
:
IProps
,
_nextState
:
PageState
)
{
const
{
filmInfo
}
=
this
.
state
const
{
filmInfo
:
_filmInfo
}
=
_nextState
return
filmInfo
!==
_filmInfo
}
//
shouldComponentUpdate(_nextProps: IProps, _nextState: PageState) {
//
const { filmInfo } = this.state
//
const { filmInfo: _filmInfo } = _nextState
//
return filmInfo !== _filmInfo
//
}
render
()
{
const
{
filmInfo
,
filmData
,
pageIndex
}
=
this
.
state
filmInfo
.
templateName
=
filmInfo
.
filmName
filmInfo
.
templateDescribe
=
filmInfo
.
filmDescribe
const
pageList
=
filmData
.
pageList
const
pageList
=
filmData
.
pageList
||
[]
console
.
log
(
'film-edit render'
,
pageList
)
return
(
<
View
className=
"film-detail"
>
...
...
src/pages/home/tempaltes/scss/film_edit.scss
View file @
d0e2b415
...
...
@@ -19,7 +19,8 @@
.page-container
{
display
:
flex
;
padding
:
20px
20px
50px
20px
;
padding
:
20px
20px
90px
20px
;
height
:
300px
;
.page-item
{
margin-right
:
30px
;
...
...
@@ -43,7 +44,7 @@
overflow
:
hidden
;
&
-view
{
height
:
2
4
0px
;
height
:
2
8
0px
;
}
}
...
...
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