Commit 22d855a6 by lirandong

修复参数错误问题

parent 4e92c456
......@@ -71,10 +71,10 @@ class UsersApi extends ApiClient {
}
/** 更改设备绑定显示 */
updateEquipmentBinding(filmIds: string[], filmId: string) {
updateEquipmentBinding(equipmentId: string[], filmId: string) {
return this.request({
url: `/template/update/equipment/binding/filmid`,
data: { equipmentId: filmId, filmId: filmIds }
data: { equipmentId, filmId }
})
}
}
......
......@@ -35,8 +35,8 @@ class App extends Component {
config: Config = {
pages: [
'pages/home/tempaltes/index',
'pages/home/device/index',
'pages/home/device/device_select/index',
'pages/home/device/index',
'pages/home/user/index',
'pages/home/device/my_device/index',
'pages/home/device/add/index',
......
......@@ -70,16 +70,16 @@ class DeviceSelect extends Component {
}
}
changeItem({ filmId }) {
if (this.state.checked.has(filmId)) {
this.state.checked.delete(filmId)
changeItem({ equipmentId }) {
if (this.state.checked.has(equipmentId)) {
this.state.checked.delete(equipmentId)
const newSet = this.state.checked
this.setState({
checked: new Set([...newSet])
})
} else {
this.setState({
checked: new Set([...this.state.checked, filmId])
checked: new Set([...this.state.checked, equipmentId])
})
}
// console.log({ item })
......@@ -87,7 +87,9 @@ class DeviceSelect extends Component {
async updateBind() {
const { checked, filmId } = this.state
if (!filmId) return
try {
// console.log({ filmId })
await api.common.updateEquipmentBinding([...checked], filmId)
showMyToast({ tips: '修改成功~' })
Taro.navigateBack()
......
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