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

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

@ -331,7 +331,7 @@
{{ item.name }} {{ item.name }}
</li> </li>
</ul> </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" :class="[filterStatus == 0 ? '' : 'nobd']" style="border-radius: 6px;overflow: hidden;">
<div class="filter-title" :style="{ top: filterStatus == 0 ? '-32px' : '-21px' }"> <div class="filter-title" :style="{ top: filterStatus == 0 ? '-32px' : '-21px' }">
<span> <span>
@ -356,7 +356,11 @@
</span> </span>
</span> </span>
</div> </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> </div>
</div> </div>
@ -1340,6 +1344,20 @@ export default {
// this.isspinning = true; // this.isspinning = true;
console.log('newdata',newdata); console.log('newdata',newdata);
try { try {
if(newdata == 'clear'){
newdata = {
pageNum: this.formvalue.pageNum, // 使
pageSize: 8,
district: '',
monthlyPayStr:'',
ageStr: '',
jobRequestLabelIds: '',
aliasName: '',
isScroll: 0,
sortTag: 0
};
this.formvalue = [];
}else{
newdata = { newdata = {
district: "", district: "",
monthlyPayStr: "", monthlyPayStr: "",
@ -1352,6 +1370,8 @@ export default {
isScroll: newdata && newdata.isScroll == 1 ? 1 : 0, isScroll: newdata && newdata.isScroll == 1 ? 1 : 0,
sortTag: this.sortTag sortTag: this.sortTag
}; };
}
if(this.formvalue && this.formvalue.length > 0){
for (var k in this.formvalue) { for (var k in this.formvalue) {
if (Array.isArray(this.formvalue[k])) { if (Array.isArray(this.formvalue[k])) {
newdata[k] = this.formvalue[k].length > 0 ? this.formvalue[k].join() : ""; newdata[k] = this.formvalue[k].length > 0 ? this.formvalue[k].join() : "";
@ -1359,6 +1379,8 @@ export default {
newdata[k] = this.formvalue[k]; newdata[k] = this.formvalue[k];
} }
} }
}
if (this.isLogin) { if (this.isLogin) {
const { data } = await JobListApi(newdata); const { data } = await JobListApi(newdata);
if (data.status === 200) { if (data.status === 200) {
@ -2275,6 +2297,19 @@ export default {
}, },
handleToggle(e){ handleToggle(e){
this.isToggle = !this.isToggle 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 { .top-obj:active {
background-color: #1890ffdd; background-color: #1890ffdd;
} }
.clear-obj{
&:hover{
color: #1890ff;
}
}
</style> </style>

@ -27,7 +27,7 @@
</a-form-item> </a-form-item>
<a-form-item style="margin-top: -5px;"> <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-item>
</a-form> </a-form>
</div> </div>
@ -56,7 +56,7 @@
</template> </template>
<script> <script>
import { getPhoneCodeApi } from '@/api/login.js' import { getPhoneCodeApi,updateUserNameAndSex,checkTokenApi } from '@/api/login.js'
import { setUserTelApi } from '../../../../api/userinfo' import { setUserTelApi } from '../../../../api/userinfo'
import timmer from '../../../Login/components/countback.vue' import timmer from '../../../Login/components/countback.vue'
@ -103,11 +103,12 @@ export default {
'userinfo.tel'(value) { 'userinfo.tel'(value) {
// setTimeout(()=>{ // setTimeout(()=>{
console.log(value) console.log(value)
console.log(this.userinfo)
if (this.userinfo.tel) { if (this.userinfo.tel) {
this.istelshow = true this.istelshow = true
// console.log(this.istelshow); // console.log(this.istelshow);
} }
// this.form.user = this.userinfo.
this.isShow = true this.isShow = true
// },200) // },200)
@ -128,6 +129,13 @@ export default {
// console.log(this.istelshow); // console.log(this.istelshow);
this.isShow = true 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: { methods: {
@ -165,6 +173,27 @@ export default {
console.log(data) 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> </script>

Loading…
Cancel
Save