Commit 22d855a6 by lirandong

修复参数错误问题

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