cyl/dev
jscyl13849007907 1 year ago
parent 9096408b33
commit ffe688c644

@ -50,3 +50,12 @@ export function checkTokenApi(data) {
method: "get",
});
}
// 修改昵称和性别
export function updateUserNameAndSex(data) {
return request({
url: "/yishoudan/user/updateUserNameAndSex",
method: "put",
data: setqs(data),
});
}

@ -331,7 +331,7 @@
{{ item.name }}
</li>
</ul>
<div class="model-obj-copy">
<div class="model-obj-copy g_flex_row_between">
<div class="filter" :class="[filterStatus == 0 ? '' : 'nobd']" style="border-radius: 6px;overflow: hidden;">
<div class="filter-title" :style="{ top: filterStatus == 0 ? '-32px' : '-21px' }">
<span>
@ -356,7 +356,11 @@
</span>
</span>
</div>
</div>
<div class="g_fs_14 clear-obj" style="cursor: pointer;" @click="clearFilter"
v-show="filterObj.price || filterObj.price || filterObj.gender || filterObj.age || filterObj.specialactive.length"
>
清除
</div>
</div>
</div>
@ -1340,6 +1344,20 @@ export default {
// this.isspinning = true;
console.log('newdata',newdata);
try {
if(newdata == 'clear'){
newdata = {
pageNum: this.formvalue.pageNum, // 使
pageSize: 8,
district: '',
monthlyPayStr:'',
ageStr: '',
jobRequestLabelIds: '',
aliasName: '',
isScroll: 0,
sortTag: 0
};
this.formvalue = [];
}else{
newdata = {
district: "",
monthlyPayStr: "",
@ -1352,6 +1370,8 @@ export default {
isScroll: newdata && newdata.isScroll == 1 ? 1 : 0,
sortTag: this.sortTag
};
}
if(this.formvalue && this.formvalue.length > 0){
for (var k in this.formvalue) {
if (Array.isArray(this.formvalue[k])) {
newdata[k] = this.formvalue[k].length > 0 ? this.formvalue[k].join() : "";
@ -1359,6 +1379,8 @@ export default {
newdata[k] = this.formvalue[k];
}
}
}
if (this.isLogin) {
const { data } = await JobListApi(newdata);
if (data.status === 200) {
@ -2275,6 +2297,19 @@ export default {
},
handleToggle(e){
this.isToggle = !this.isToggle
},
clearFilter(){
this.filterObj = {
price: "", //
gender: "", //
specialactive: [], //
monthlyPayStr:'',
jobRequestLabelIds:'',
sex:'',
jobCategoryLabelIds:''
};
this.getJobList('clear');
}
},
};
@ -3791,4 +3826,9 @@ p {
.top-obj:active {
background-color: #1890ffdd;
}
.clear-obj{
&:hover{
color: #1890ff;
}
}
</style>

@ -27,7 +27,7 @@
</a-form-item>
<a-form-item style="margin-top: -5px;">
<a-button type="primary" style="height: 32px;overflow: hidden;margin-left: 55.38px;">更新基本信息</a-button>
<a-button type="primary" html-type="submit" style="height: 32px;overflow: hidden;margin-left: 55.38px;">更新基本信息</a-button>
</a-form-item>
</a-form>
</div>
@ -56,7 +56,7 @@
</template>
<script>
import { getPhoneCodeApi } from '@/api/login.js'
import { getPhoneCodeApi,updateUserNameAndSex,checkTokenApi } from '@/api/login.js'
import { setUserTelApi } from '../../../../api/userinfo'
import timmer from '../../../Login/components/countback.vue'
@ -103,11 +103,12 @@ export default {
'userinfo.tel'(value) {
// setTimeout(()=>{
console.log(value)
console.log(this.userinfo)
if (this.userinfo.tel) {
this.istelshow = true
// console.log(this.istelshow);
}
// this.form.user = this.userinfo.
this.isShow = true
// },200)
@ -128,6 +129,13 @@ export default {
// console.log(this.istelshow);
this.isShow = true
}
console.log('0000000000000000',JSON.parse(localStorage.getItem('LOGIN_DATA')))
let _data = JSON.parse(localStorage.getItem('LOGIN_DATA'))
this.form = {
user: _data.user.userName,
sex: Number(_data.user.sex)
}
},
//
methods: {
@ -165,6 +173,27 @@ export default {
console.log(data)
}
},
handleSubmit(){
if(!this.form.user){
this.$message.warning('请输入用户名')
return false;
}
updateUserNameAndSex({
userName:this.form.user,
sex: this.form.sex
}).then(res=>{
console.log(res)
this.$message.success('更新成功')
checkTokenApi().then((res) => {
console.log(res.data);
localStorage.setItem("LOGIN_DATA", JSON.stringify(res.data.data));
window.location.reload();
});
})
},
},
}
</script>

Loading…
Cancel
Save