修改报错

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

@ -565,7 +565,7 @@ export async function addcomment(data?:any):Promise<void> {
code: number;
msg: string;
}
export async function checkuser(data?:any){
export async function checkuser(data?: any) {
const newdata={number:""}
newdata.number=data.phone
const res = await get<CheckuserRule>('checkUser',newdata);
@ -592,6 +592,36 @@ export async function getquhaolist() {
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>
<template v-slot:overlay>
<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">
<span>时区1</span>
<span>{{i.city}}{{i.gmt}}</span>
</div>
</a-menu-item>
<a-menu-item key="1">
<!-- <a-menu-item key="1">
<div class="selitem">
<span>时区2</span>
<span>时区2a</span>
</div>
</a-menu-item>
<a-menu-item key="3">
<div class="selitem">
<span>时区3</span>
<span>时区3a</span>
</div>
</a-menu-item>
</a-menu-item> -->
</a-menu>
</template>
</a-dropdown>
@ -47,19 +48,20 @@
</div>
<template v-slot:overlay>
<a-menu>
<!-- 货币 -->
<a-menu-item key="0">
<div class="selitem">
<span>时区1</span>
<span>时区1b</span>
</div>
</a-menu-item>
<a-menu-item key="1">
<div class="selitem">
<span>时区2</span>
<span>时区2b</span>
</div>
</a-menu-item>
<a-menu-item key="3">
<div class="selitem">
<span>时区3</span>
<span>时区3b</span>
</div>
</a-menu-item>
</a-menu>
@ -73,19 +75,20 @@
</div>
<template v-slot:overlay>
<a-menu>
<!-- 语言 -->
<a-menu-item key="0">
<div class="selitem">
<span>时区1</span>
<span>时区1c</span>
</div>
</a-menu-item>
<a-menu-item key="1">
<div class="selitem">
<span>时区2</span>
<span>时区2cc</span>
</div>
</a-menu-item>
<a-menu-item key="3">
<div class="selitem">
<span>时区3</span>
<span>时区3c</span>
</div>
</a-menu-item>
</a-menu>
@ -174,9 +177,10 @@
}
</style>
<script lang="ts">
import { editsystemsetting, getzonelist } from '@/api';
import router from '@/router';
import store from '@/store';
import { computed, defineComponent, ref } from 'vue';
import { computed, defineComponent, onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
export default defineComponent({
@ -191,6 +195,15 @@ export default defineComponent({
const routes = useRoute();
console.log(routes.path);
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)
interface Nav{
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 {
nav,
types,
navto,
userinfo
userinfo,
zonelist,
zonechange,
selectedzone,
currencylist
}
}
})

View File

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