Commit 79192f5e by hank

修复日程bug

parent 0b9ea683
......@@ -87,7 +87,7 @@ class App extends Component {
},
{
pagePath: 'pages/home/film/index',
text: '视片',
text: '视片及日程',
iconPath: './assets/images/film.png',
selectedIconPath: './assets/images/film_ac.png'
},
......
......@@ -43,6 +43,7 @@ class ScheduleItem extends Component {
render() {
let { templateUrl, filmName, templateDescribe, templateShow, isList, time } = this.props
templateUrl = templateUrl || ''
console.log(templateShow, this.props)
let time2 = this.state.time
return (
<View className="films-item">
......
......@@ -113,7 +113,7 @@ class DeviceSelect extends Component {
})
Taro.setStorage({
key: 'schedule-add-device',
data: JSON.stringify([...list])
data: JSON.stringify([...checkedArr])
})
Taro.navigateBack()
}
......
......@@ -66,16 +66,21 @@ class Films extends Component {
checked: new Set(),
showTemplate: 'HORIZONTAL'
})
}
async componentWillMount() {
Taro.getStorage({ key: 'schedule-add-films' })
.then(res => {
console.log(res.data)
console.log(res.data, 'schedule-add-films')
let arr = JSON.parse(res.data).map(item => {
return item.filmId
})
console.log(Taro.getStorageSync('schedule-type-state'))
this.setState(
{
checked: new Set(arr),
showTemplate: JSON.parse(res.data)[0]['templateShow'] || 'HORIZONTAL'
showTemplate:
JSON.parse(res.data)[0]['templateShow'] || Taro.getStorageSync('schedule-type-state')
},
() => {
this.page = 1
......@@ -89,11 +94,8 @@ class Films extends Component {
checked: new Set(),
showTemplate: 'HORIZONTAL'
})
})
}
async componentWillMount() {
this.getData()
})
}
componentDidShow() {
this.getData()
......@@ -149,6 +151,10 @@ class Films extends Component {
showMyToast({ title: '不可选择不同版型的视片~' })
return
}
Taro.setStorage({
key: 'schedule-type-state',
data: state
})
this.setState(
{
showTemplate: state
......
......@@ -28,6 +28,8 @@
position: fixed;
bottom: 0;
display: flex;
text-align: center;
justify-content: center;
.bottom-btn-item {
width: 50%;
......
......@@ -141,13 +141,24 @@ class ScheduleAdd extends Component {
filmList: myFilmList
})
}
deleteAction() {
async deleteAction() {
const { id } = this.$router.params
Taro.showModal({ content: '确定要删除?' }).then(async ({ confirm }) => {
if (confirm) {
try {
api.common.deleteSchedule(id).then(() => {
showMyToast({
title: '删除成功'
})
setTimeout(() => {
Taro.navigateBack()
}, 500)
})
} catch (error) {
console.error(error)
showMyToast({ title: '失败' })
}
}
})
}
enter() {
......
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