Commit 081b4268 by hank

优化视片item

parent 9d89c930
...@@ -31,5 +31,18 @@ ...@@ -31,5 +31,18 @@
font-size: 22px; font-size: 22px;
color: #666; color: #666;
} }
&-setting {
margin-top: 10px;
width: 300px;
text-align: right;
height: 40px;
}
&-setting-img {
vertical-align: top;
width: 40px;
height: 40px;
}
} }
} }
...@@ -12,6 +12,8 @@ type PageDispatchProps = {} ...@@ -12,6 +12,8 @@ type PageDispatchProps = {}
interface PageOwnProps extends IMilmListItme { interface PageOwnProps extends IMilmListItme {
onClick?: () => void onClick?: () => void
isChoose?: boolean isChoose?: boolean
updateTime?: string
onSetting?: () => void
} }
type PageState = {} type PageState = {}
...@@ -25,7 +27,7 @@ interface FilmListItem { ...@@ -25,7 +27,7 @@ interface FilmListItem {
class FilmListItem extends Component { class FilmListItem extends Component {
render() { render() {
let { templateUrl, filmName, equipmentCount, onClick, isChoose } = this.props let { templateUrl, filmName, updateTime, onClick, isChoose, onSetting } = this.props
templateUrl = templateUrl || '' templateUrl = templateUrl || ''
return ( return (
<View className="films-item" onClick={() => onClick && onClick()}> <View className="films-item" onClick={() => onClick && onClick()}>
...@@ -34,8 +36,18 @@ class FilmListItem extends Component { ...@@ -34,8 +36,18 @@ class FilmListItem extends Component {
</View> </View>
<View className="films-item-info"> <View className="films-item-info">
<Text className="films-item-info-name">{filmName}</Text> <Text className="films-item-info-name">{filmName}</Text>
{isChoose ? null : <Text className="films-item-info-count">{updateTime}</Text>}
{isChoose ? null : ( {isChoose ? null : (
<Text className="films-item-info-count">播放设备数量:{equipmentCount}</Text> <View className="films-item-info-setting">
管理
<Image
className="films-item-info-setting-img"
onClick={() => {
onSetting && onSetting()
}}
src="https://visual-clouds.oss-cn-beijing.aliyuncs.com/miniprogram/manager.png"
/>
</View>
)} )}
</View> </View>
</View> </View>
......
...@@ -82,6 +82,9 @@ class Films extends Component { ...@@ -82,6 +82,9 @@ class Films extends Component {
goDetail({ filmId }: IMilmListItme) { goDetail({ filmId }: IMilmListItme) {
Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${filmId}` }) Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${filmId}` })
} }
onSetting({ filmId }: IMilmListItme) {
Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${filmId}` })
}
async onDownRefresh(done: any) { async onDownRefresh(done: any) {
this.page = 1 this.page = 1
...@@ -128,7 +131,13 @@ class Films extends Component { ...@@ -128,7 +131,13 @@ class Films extends Component {
} }
]} ]}
> >
<FilmListItem onClick={() => this.goDetail(item)} {...item} /> <FilmListItem
onClick={() => this.goDetail(item)}
{...item}
onSetting={() => {
this.onSetting(item)
}}
/>
</AtSwipeAction> </AtSwipeAction>
))} ))}
</ListView> </ListView>
......
...@@ -102,7 +102,9 @@ class Films extends Component { ...@@ -102,7 +102,9 @@ class Films extends Component {
} }
goDetail(item: IMilmListItme) { goDetail(item: IMilmListItme) {
console.log(item) // Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${item.filmId}` })
}
onSetting(item) {
if (process.env.TARO_ENV !== 'rn') { if (process.env.TARO_ENV !== 'rn') {
Taro.hideTabBar().then(() => { Taro.hideTabBar().then(() => {
this.setState({ this.setState({
...@@ -116,8 +118,6 @@ class Films extends Component { ...@@ -116,8 +118,6 @@ class Films extends Component {
chooseItem: item chooseItem: item
}) })
} }
// Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${item.filmId}` })
} }
ActionSheetHandleCancel() { ActionSheetHandleCancel() {
this.setState({ this.setState({
...@@ -238,7 +238,7 @@ class Films extends Component { ...@@ -238,7 +238,7 @@ class Films extends Component {
} }
]} ]}
> >
<FilmListItem onClick={() => this.goDetail(item)} {...item} /> <FilmListItem onClick={() => this.goDetail(item)} {...item} onSetting={() => {this.onSetting(item)}}/>
</AtSwipeAction> </AtSwipeAction>
))} ))}
</ListView> </ListView>
......
...@@ -227,33 +227,10 @@ class DeviceSelect extends Component { ...@@ -227,33 +227,10 @@ class DeviceSelect extends Component {
showMyToast({ showMyToast({
title: '绑定成功' title: '绑定成功'
}) })
Taro.navigateBack() Taro.reLaunch({
url: '/pages/home/film/index'
})
}) })
// let obj = {
// calendarName: 'DEFAULstring',
// filmInfos: [
// {
// filmId: fId,
// time: '00:00'
// }
// ],
// equipmentsIds: equipmentsIds,
// equipmentTopicList: equipmentTopicList,
// calendarType: 'DEFAUL',
// calendarId: ''
// }
// if (!cId) {
// console.log('createSchedule')
// delete obj.calendarId
// api.common.createSchedule(obj).then(() => {
// Taro.navigateBack()
// })
// } else {
// obj.calendarId = cId
// api.common.updateSchedule(obj).then(() => {
// Taro.navigateBack()
// })
// }
} else { } else {
Taro.setStorage({ Taro.setStorage({
key: 'schedule-add-device', key: 'schedule-add-device',
......
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