Commit a9a9045b by hank

fix bug

parent ade8068a
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"semi": false
}
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"semi": false
}
{ {
"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
} }
...@@ -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)}>
......
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment