Commit 081b4268 by hank

优化视片item

parent 9d89c930
......@@ -31,5 +31,18 @@
font-size: 22px;
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 = {}
interface PageOwnProps extends IMilmListItme {
onClick?: () => void
isChoose?: boolean
updateTime?: string
onSetting?: () => void
}
type PageState = {}
......@@ -25,7 +27,7 @@ interface FilmListItem {
class FilmListItem extends Component {
render() {
let { templateUrl, filmName, equipmentCount, onClick, isChoose } = this.props
let { templateUrl, filmName, updateTime, onClick, isChoose, onSetting } = this.props
templateUrl = templateUrl || ''
return (
<View className="films-item" onClick={() => onClick && onClick()}>
......@@ -34,8 +36,18 @@ class FilmListItem extends Component {
</View>
<View className="films-item-info">
<Text className="films-item-info-name">{filmName}</Text>
{isChoose ? null : <Text className="films-item-info-count">{updateTime}</Text>}
{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>
......
......@@ -82,6 +82,9 @@ class Films extends Component {
goDetail({ filmId }: IMilmListItme) {
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) {
this.page = 1
......@@ -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>
))}
</ListView>
......
......@@ -102,7 +102,9 @@ class Films extends Component {
}
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') {
Taro.hideTabBar().then(() => {
this.setState({
......@@ -116,8 +118,6 @@ class Films extends Component {
chooseItem: item
})
}
// Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${item.filmId}` })
}
ActionSheetHandleCancel() {
this.setState({
......@@ -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>
))}
</ListView>
......
......@@ -227,33 +227,10 @@ class DeviceSelect extends Component {
showMyToast({
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 {
Taro.setStorage({
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