From 683b173a047e8e9823b2c2965223f555119016fa Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 2 Nov 2020 10:36:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=88=91=E8=BF=98?= =?UTF-8?q?=E4=BC=9A=E8=AF=B4=E6=8F=90=E4=BA=A4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 2 +- src/views/mine/Archives.vue | 58 +++++++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 22 deletions(-) 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);