Commit eeb22045 authored by youjie's avatar youjie

意见调查

parent 41c4aff3
...@@ -109,12 +109,12 @@ ...@@ -109,12 +109,12 @@
} }
function clickCheckbox(i,index,index2,ID) { function clickCheckbox(i,index,ID) {
const checkbox = document.getElementById(`my_checkbox${i}`); const checkbox = document.getElementById(`my_checkbox${i}`);
checkbox.click() checkbox.click()
let findIndex = dataList[index].IsCheckS.findIndex(item=>item==ID) let findIndex = dataList[index].IsCheckS.findIndex(item=>item==ID)
if(findIndex==-1) { if(checkbox.checked) {
dataList[index].IsCheckS.push(ID) if(findIndex==-1)dataList[index].IsCheckS.push(ID)
}else{ }else{
dataList[index].IsCheckS = dataList[index].IsCheckS.filter(item=>item!=ID) dataList[index].IsCheckS = dataList[index].IsCheckS.filter(item=>item!=ID)
} }
...@@ -265,9 +265,6 @@ ...@@ -265,9 +265,6 @@
if (res.resultCode === 1) { if (res.resultCode === 1) {
let data = res.data let data = res.data
data.map(item => { data.map(item => {
if (item.SurveyType === 2) {
item.IsCheckS = false
}
if (item.SurveyType === 3) { if (item.SurveyType === 3) {
item.IsCheckS = [] item.IsCheckS = []
} }
...@@ -277,6 +274,7 @@ ...@@ -277,6 +274,7 @@
}) })
dataListAll = data dataListAll = data
dataList = data dataList = data
// 外卖版
if(localStorage.TakeoutVersion==1){ if(localStorage.TakeoutVersion==1){
getSurveyDetails() getSurveyDetails()
}else{ }else{
...@@ -435,7 +433,7 @@ ...@@ -435,7 +433,7 @@
let MultipleList = [] let MultipleList = []
if (item.SurveyOptionsList.length > 0) item.SurveyOptionsList.forEach((radio, index) => { if (item.SurveyOptionsList.length > 0) item.SurveyOptionsList.forEach((radio, index) => {
MultipleList.push( MultipleList.push(
`<div><input type="checkbox" value="${radio.ID}" name="my_checkbox${i+1}" id="my_checkbox${i+1}${index+1}"/><span onclick="clickCheckbox(${i+1}${index+1},${i},${index},${radio.ID})">${radio.OptionsName}</span></div>` `<div><input type="checkbox" value="${radio.ID}" name="my_checkbox${i+1}" id="my_checkbox${i+1}${index+1}"/><span onclick="clickCheckbox(${i+1}${index+1},${i},${radio.ID})">${radio.OptionsName}</span></div>`
) )
}) })
if (MultipleList.length > 0) { if (MultipleList.length > 0) {
......
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 to comment