diff --git a/src/api/index.ts b/src/api/index.ts index 02251d1..1d327b1 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -746,7 +746,7 @@ export async function putmember(data: any): Promise{ mtongue: data.mtongue, email: data.email, interest: JSON.stringify(data.interest), - willsay: JSON.stringify(data.willsayValue), + willsay: JSON.stringify(data.willsay), birthday: data.birthday, zoneid: data.zoneid, currency: data.currencyValue, diff --git a/src/views/mine/Archives.vue b/src/views/mine/Archives.vue index 288e8d6..6414209 100644 --- a/src/views/mine/Archives.vue +++ b/src/views/mine/Archives.vue @@ -118,10 +118,9 @@ v-for="(item, index) in chiveslist[1]" :key="index" - :value="item.languageid" + :value="item.name" > {{ item.name }} - {{ item.languageid }}
@@ -781,28 +780,45 @@ export default defineComponent({ // console.log(toRaw(formData.value).willsay[i]) // } const uesrinfo = toRaw(formData.value); - for (let m = 0; m < toRaw(chiveslist.value).length; m++) { - for (const i in uesrinfo.willsayValue) { - // console.log(toRaw(formData.value).willsayValue[i]) + // for (let m = 0; m < toRaw(chiveslist.value).length; m++) { + // for (const i in uesrinfo.willsayValue) { + // // console.log(toRaw(formData.value).willsayValue[i]) - if (typeof uesrinfo.willsay[i].name == "string") { - // console.log(toRaw(chiveslist.value)) - if ( - uesrinfo.willsay[i].name == - toRaw(chiveslist.value)[m].name - ) { - uesrinfo.willsayValue[i].name = toRaw( - chiveslist.value - )[m].languageid; - } - } else { - uesrinfo.willsayValue[i].name = - uesrinfo.willsay[i].name; + // if (typeof uesrinfo.willsay[i].name == "string") { + // // console.log(toRaw(chiveslist.value)) + // if ( + // uesrinfo.willsay[i].name == + // toRaw(chiveslist.value)[m].name + // ) { + // uesrinfo.willsayValue[i].name = toRaw( + // chiveslist.value + // )[m].languageid; + // } + // } else { + // uesrinfo.willsayValue[i].name = + // uesrinfo.willsay[i].name; + // } + + // uesrinfo.willsayValue[i].level = uesrinfo.willsay[i].level; + // } + // } + + for(const i in uesrinfo.willsay){ + for(const j in chiveslist.value[1]){ + if(uesrinfo.willsay[i].name == chiveslist.value[1][j].name){ + uesrinfo.willsay[i].name = chiveslist.value[1][j].languageid } - - uesrinfo.willsayValue[i].level = uesrinfo.willsay[i].level; + console.log(uesrinfo.willsay[i].name, chiveslist.value[1][j].name) } } + const arr: any = {}; + for(const i in uesrinfo.willsay){ + // const a: any = {}; + arr[uesrinfo.willsay[i].name] = uesrinfo.willsay[i].level + // arr.push(a); + // arr.push({uesrinfo.willsay[i].name}) + } + uesrinfo.willsay = arr; console.log(uesrinfo); // console.log(toRaw(formData.value)); @@ -839,7 +855,7 @@ export default defineComponent({ if((zonelist.value[i].city + zonelist.value[i].gmt) == uesrinfo.zoneStr){ uesrinfo.zoneid = zonelist.value[i].zoneid } - console.log(zonelist.value[i].city + zonelist.value[i].gmt, uesrinfo.zoneStr) + // console.log(zonelist.value[i].city + zonelist.value[i].gmt, uesrinfo.zoneStr) } if (reg.test(userinfo.value.email)) { putmember(uesrinfo);