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
a9a9045b
authored
Nov 12, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
ade8068a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
10 deletions
+45
-10
.prettierrc
+6
-0
.vscode/.prettierrc
+6
-0
.vscode/settings.json
+4
-5
src/pages/home/film/schedule_add/components/films/index.tsx
+11
-4
src/pages/home/film/schedule_add/index.tsx
+18
-1
No files found.
.prettierrc
0 → 100644
View file @
a9a9045b
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"semi": false
}
.vscode/.prettierrc
0 → 100644
View file @
a9a9045b
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"semi": false
}
.vscode/settings.json
View file @
a9a9045b
{
{
"editor.formatOnSave"
:
true
,
"editor.formatOnSave"
:
true
,
"
prettier.stylelintIntegration"
:
true
,
"
[javascript,typescript]"
:
{
"prettier.tabWidth"
:
2
,
"editor.formatOnSave"
:
true
"prettier.singleQuote"
:
true
,
}
,
"typescript.tsdk"
:
"node_modules/typescript/lib"
,
"typescript.tsdk"
:
"node_modules/typescript/lib"
,
"prettier.printWidth"
:
100
,
"prettier.configPath"
:
"./.prettierrc"
"prettier.semi"
:
false
}
}
src/pages/home/film/schedule_add/components/films/index.tsx
View file @
a9a9045b
...
@@ -228,7 +228,9 @@ class Films extends Component {
...
@@ -228,7 +228,9 @@ class Films extends Component {
className=
{
className=
{
showTemplate
===
'HORIZONTAL'
showTemplate
===
'HORIZONTAL'
?
'type-tab-item type-tab-item-active'
?
'type-tab-item type-tab-item-active'
:
'type-tab-item'
}
>
:
'type-tab-item'
}
>
横版
横版
</
Text
>
</
Text
>
<
Text
<
Text
...
@@ -236,7 +238,9 @@ class Films extends Component {
...
@@ -236,7 +238,9 @@ class Films extends Component {
this
.
typeChange
(
'VERTICAL'
)
this
.
typeChange
(
'VERTICAL'
)
}
}
}
}
className=
{
className=
{
showTemplate
===
'VERTICAL'
?
'type-tab-item type-tab-item-active'
:
'type-tab-item'
}
>
showTemplate
===
'VERTICAL'
?
'type-tab-item type-tab-item-active'
:
'type-tab-item'
}
>
竖版
竖版
</
Text
>
</
Text
>
<
Text
<
Text
...
@@ -244,7 +248,9 @@ class Films extends Component {
...
@@ -244,7 +248,9 @@ class Films extends Component {
this
.
typeChange
(
'OTHER'
)
this
.
typeChange
(
'OTHER'
)
}
}
}
}
className=
{
className=
{
showTemplate
===
'OTHER'
?
'type-tab-item type-tab-item-active'
:
'type-tab-item'
}
>
showTemplate
===
'OTHER'
?
'type-tab-item type-tab-item-active'
:
'type-tab-item'
}
>
异形屏
异形屏
</
Text
>
</
Text
>
</
View
>
</
View
>
...
@@ -254,7 +260,8 @@ class Films extends Component {
...
@@ -254,7 +260,8 @@ class Films extends Component {
height=
{
myHeight
}
height=
{
myHeight
}
dataListLength=
{
list
.
length
}
dataListLength=
{
list
.
length
}
pullingUp=
{
done
=>
this
.
onScrollToLower
(
done
)
}
pullingUp=
{
done
=>
this
.
onScrollToLower
(
done
)
}
pullingDown=
{
done
=>
this
.
onDownRefresh
(
done
)
}
>
pullingDown=
{
done
=>
this
.
onDownRefresh
(
done
)
}
>
{
list
.
map
(
item
=>
(
{
list
.
map
(
item
=>
(
<
View
key=
{
item
.
filmId
}
>
<
View
key=
{
item
.
filmId
}
>
<
Label
className=
"films-bind-item"
onClick=
{
()
=>
this
.
changeItem
(
item
)
}
>
<
Label
className=
"films-bind-item"
onClick=
{
()
=>
this
.
changeItem
(
item
)
}
>
...
...
src/pages/home/film/schedule_add/index.tsx
View file @
a9a9045b
import
api
from
'@/api/index'
import
api
from
'@/api/index'
import
{
ComponentClass
}
from
'react'
import
{
ComponentClass
}
from
'react'
import
{
connect
}
from
'@tarojs/redux'
import
{
View
,
Text
,
Input
,
Button
}
from
'@tarojs/components'
import
{
View
,
Text
,
Input
,
Button
}
from
'@tarojs/components'
import
{
showMyToast
}
from
'@/common/utils'
import
{
showMyToast
}
from
'@/common/utils'
import
Taro
,
{
Component
,
Config
}
from
'@tarojs/taro'
import
Taro
,
{
Component
,
Config
}
from
'@tarojs/taro'
...
@@ -166,6 +165,18 @@ class ScheduleAdd extends Component {
...
@@ -166,6 +165,18 @@ class ScheduleAdd extends Component {
})
})
}
}
enter
()
{
enter
()
{
function
isRepeat
(
arr
)
{
let
hash
=
{}
for
(
let
i
of
arr
)
{
// console.log(i)
if
(
hash
[
i
[
'time'
]])
{
return
true
}
// 不存在该元素,则赋值为true,可以赋任意值,相应的修改if判断条件即可
hash
[
i
[
'time'
]]
=
true
}
return
false
}
const
{
deviceList
,
filmList
,
scheduleName
,
id
}
=
this
.
state
const
{
deviceList
,
filmList
,
scheduleName
,
id
}
=
this
.
state
let
equipmentsIds
:
any
=
[]
let
equipmentsIds
:
any
=
[]
let
equipmentTopicList
:
any
=
[]
let
equipmentTopicList
:
any
=
[]
...
@@ -182,6 +193,12 @@ class ScheduleAdd extends Component {
...
@@ -182,6 +193,12 @@ class ScheduleAdd extends Component {
})
})
return
return
}
}
if
(
isRepeat
(
filmList
))
{
showMyToast
({
title
:
'影片时间重复'
})
return
}
deviceList
.
map
((
item
:
any
)
=>
{
deviceList
.
map
((
item
:
any
)
=>
{
equipmentsIds
.
push
(
item
.
equipmentId
)
equipmentsIds
.
push
(
item
.
equipmentId
)
...
...
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