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,
"prettier.stylelintIntegration": true,
"prettier.tabWidth": 2,
"prettier.singleQuote": true,
"[javascript,typescript]": {
"editor.formatOnSave": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"prettier.printWidth": 100,
"prettier.semi": false
"prettier.configPath": "./.prettierrc"
}
......@@ -228,7 +228,9 @@ class Films extends Component {
className={
showTemplate === 'HORIZONTAL'
? 'type-tab-item type-tab-item-active'
: 'type-tab-item'} >
: 'type-tab-item'
}
>
横版
</Text>
<Text
......@@ -236,7 +238,9 @@ class Films extends Component {
this.typeChange('VERTICAL')
}}
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
......@@ -244,7 +248,9 @@ class Films extends Component {
this.typeChange('OTHER')
}}
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>
</View>
......@@ -254,7 +260,8 @@ class Films extends Component {
height={myHeight}
dataListLength={list.length}
pullingUp={done => this.onScrollToLower(done)}
pullingDown={done => this.onDownRefresh(done)} >
pullingDown={done => this.onDownRefresh(done)}
>
{list.map(item => (
<View key={item.filmId}>
<Label className="films-bind-item" onClick={() => this.changeItem(item)}>
......
import api from '@/api/index'
import { ComponentClass } from 'react'
import { connect } from '@tarojs/redux'
import { View, Text, Input, Button } from '@tarojs/components'
import { showMyToast } from '@/common/utils'
import Taro, { Component, Config } from '@tarojs/taro'
......@@ -166,6 +165,18 @@ class ScheduleAdd extends Component {
})
}
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
let equipmentsIds: any = []
let equipmentTopicList: any = []
......@@ -182,6 +193,12 @@ class ScheduleAdd extends Component {
})
return
}
if (isRepeat(filmList)) {
showMyToast({
title: '影片时间重复'
})
return
}
deviceList.map((item: any) => {
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