修改报错

This commit is contained in:
asd 2020-10-22 11:13:54 +08:00
parent 9a16a98f39
commit ed00c1d3f4
3 changed files with 75 additions and 16 deletions

View File

@ -592,6 +592,36 @@ export async function getquhaolist() {
return res.data return res.data
} }
/**
*
*/
export async function getzonelist():Promise<any>{
const res=await get("timezones")
// console.log(res)
return res.data
}
/**
*
*/
export async function editsystemsetting(e?: any): Promise<boolean> {
let newdata={}
newdata=e
const res = await put(`member/${store.state.userinfo.memberid}`,newdata);
console.log(res)
if(res.code == 0){
message.success("修改成功")
return true;
}else{
message.error(res.msg);
return false;
}
}
/**
*
*/
/** /**
* *

View File

@ -20,21 +20,22 @@
</div> </div>
<template v-slot:overlay> <template v-slot:overlay>
<a-menu> <a-menu>
<a-menu-item key="0"> <!-- 时区 -->
<a-menu-item v-for="(i,j) in zonelist" :key="j" @click="zonechange(i.zoneid)">
<div class="selitem"> <div class="selitem">
<span>时区1</span> <span>{{i.city}}{{i.gmt}}</span>
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item key="1"> <!-- <a-menu-item key="1">
<div class="selitem"> <div class="selitem">
<span>时区2</span> <span>时区2a</span>
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item key="3"> <a-menu-item key="3">
<div class="selitem"> <div class="selitem">
<span>时区3</span> <span>时区3a</span>
</div> </div>
</a-menu-item> </a-menu-item> -->
</a-menu> </a-menu>
</template> </template>
</a-dropdown> </a-dropdown>
@ -47,19 +48,20 @@
</div> </div>
<template v-slot:overlay> <template v-slot:overlay>
<a-menu> <a-menu>
<!-- 货币 -->
<a-menu-item key="0"> <a-menu-item key="0">
<div class="selitem"> <div class="selitem">
<span>时区1</span> <span>时区1b</span>
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item key="1"> <a-menu-item key="1">
<div class="selitem"> <div class="selitem">
<span>时区2</span> <span>时区2b</span>
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item key="3"> <a-menu-item key="3">
<div class="selitem"> <div class="selitem">
<span>时区3</span> <span>时区3b</span>
</div> </div>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
@ -73,19 +75,20 @@
</div> </div>
<template v-slot:overlay> <template v-slot:overlay>
<a-menu> <a-menu>
<!-- 语言 -->
<a-menu-item key="0"> <a-menu-item key="0">
<div class="selitem"> <div class="selitem">
<span>时区1</span> <span>时区1c</span>
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item key="1"> <a-menu-item key="1">
<div class="selitem"> <div class="selitem">
<span>时区2</span> <span>时区2cc</span>
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item key="3"> <a-menu-item key="3">
<div class="selitem"> <div class="selitem">
<span>时区3</span> <span>时区3c</span>
</div> </div>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
@ -174,9 +177,10 @@
} }
</style> </style>
<script lang="ts"> <script lang="ts">
import { editsystemsetting, getzonelist } from '@/api';
import router from '@/router'; import router from '@/router';
import store from '@/store'; import store from '@/store';
import { computed, defineComponent, ref } from 'vue'; import { computed, defineComponent, onMounted, ref } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
export default defineComponent({ export default defineComponent({
@ -191,6 +195,15 @@ export default defineComponent({
const routes = useRoute(); const routes = useRoute();
console.log(routes.path); console.log(routes.path);
const types = ref(props.type) const types = ref(props.type)
const zonelist=ref<any>([{
city: "中途岛",
gmt: "GMT-11:00",
id: "Pacific/Midway",
zoneid: 1
}])
const selectedzone=ref([])
const currencylist=ref([])
console.log(types.value) console.log(types.value)
interface Nav{ interface Nav{
name: string; name: string;
@ -228,11 +241,27 @@ export default defineComponent({
} }
} }
onMounted(async () => {
zonelist.value=await getzonelist()
// console.log(zonelist.value)
// currencylist.value=await getcurrencys()
})
function zonechange(e?: any){
// console.log(e,1002)
editsystemsetting({zoneid:e})
}
return { return {
nav, nav,
types, types,
navto, navto,
userinfo userinfo,
zonelist,
zonechange,
selectedzone,
currencylist
} }
} }
}) })

View File

@ -188,7 +188,7 @@ export default defineComponent({
onMounted(async ()=>{ onMounted(async ()=>{
quhaolist.value=await getquhaolist() quhaolist.value=await getquhaolist()
console.log(quhaolist.value,"listsssss") // console.log(quhaolist.value,"listsssss")
}) })