修改bug

parent 16b39adc
......@@ -35,3 +35,6 @@ export const getCityNameByCodeApi = code => instance.post(`/dict/dictProvinceCit
// 专业目录
export const getMajorTreeApi = () => instance.post(`/dict/major/tree`);
// 用户申诉
export const appeal = params => instance.post(`/user/appeal`,params);
......@@ -18,41 +18,35 @@
<view class="content">
<view class="name">
<view class="t1">账户申述</view>
<textarea v-model="value" placeholder="请填写申述理由" />
<textarea v-model="reason" placeholder="请填写申述理由" />
</view>
</view>
<view class="btn-wrap flex-center">
<button class="bottom-btn" @tap="nextStep">提交</button>
<button class="bottom-btn" @tap="appealFn">提交</button>
</view>
</div>
</template>
<script setup>
import { ref } from "vue";
import { getLoginUserApi } from "@/api/user.js";
onLoad(() => {
});
onShow(() => {
getLoginUserApiFn();
});
function getLoginUserApiFn() {
getLoginUserApi().then(user => {
// if (user.code == 200 && user.data) {
// const { avatarPath, name, phone, position } = user.data;
// params.avatarPath = avatarPath;
// params.name = name;
// params.phone = phone;
// params.position = position;
// if (step.value !== 2) {
// if (name) {
// step.value = 3;
// }
// }
// }
import { appeal } from "@/api/user.js";
const reason = ref("");
onLoad(() => {});
const appealFn = () => {
appeal({ appealMessage: reason.value }).then(res => {
if (res.code === 200) {
xma.showToast({
title: res.message,
icon: "none",
duration: 1900
});
setTimeout(() => {
xma.reLaunch({
url: "/pages/login/index"
});
}, 2000);
}
});
}
const nextStep = () => {
};
</script>
......@@ -226,8 +220,8 @@ const nextStep = () => {
padding: 16rpx 0;
background-color: #ffffff;
border-top: 2rpx solid rgb(31 35 41 / 15%);
.bottom-btn{
background: #1F86FF;
.bottom-btn {
background: #1f86ff;
width: 622rpx;
height: 80rpx;
line-height: 80rpx;
......
......@@ -32,9 +32,37 @@
<!-- 筛选导航 -->
<view v-if="!maskType" class="select-nav" :style="{ top: '0px' }" catchtouchmove="{{true}}">
<view class="recommend">推荐</view>
<view class="select-item">
<!-- <view class="select-item">
<text :class="{ active: maskType == 'address' }" @tap="openMask('address')">贵州省</text>
<text :class="{ active: maskType == 'other' }" @tap="openMask('other')">更多筛选</text>
</view> -->
<view class="filter-other flex-between">
<wd-col-picker
label="选择地址"
v-model="valueCity"
:columns="columnsCity"
:column-change="columnChangeCity"
@confirm="handleConfirmCity"
label-key="name"
value-key="code"
use-default-slot
>
<view class="item">{{ cityText }} <view class="arrow"></view> </view>
</wd-col-picker>
<view class="filter-opstion">
<wd-col-picker
v-model="majorValue"
:columns="majorOpstion"
value-key="name"
label-key="name"
:column-change="columnChangeMajor"
@confirm="handleConfirmMajor"
use-default-slot
>
<view class="item">{{ majorText || "全部" }} <view class="arrow"></view> </view>
</wd-col-picker>
</view>
<view class="item" :class="{ active: maskType == 'other' }" @tap="openMask('other')">更多筛选<view class="arrow"></view></view>
</view>
</view>
<!-- 蒙版弹框 -->
......@@ -43,12 +71,12 @@
<view class="select-nav" :style="{ top: '0px' }" catchtouchmove="{{true}}" @tap.stop>
<view class="recommend">推荐</view>
<view class="select-item">
<text :class="{ active: maskType == 'address' }" @tap="openMask('address')">贵州省</text>
<!-- <text :class="{ active: maskType == 'address' }" @tap="openMask('address')">贵州省</text> -->
<text :class="{ active: maskType == 'other' }" @tap="openMask('other')">更多筛选</text>
</view>
</view>
<!-- 区域弹窗 -->
<view
<!-- <view
@click.stop=""
catchtap="preventD"
class="screen-pop address screen-pop-padding {{regionPop? 'screen-pop-tion':''}} "
......@@ -83,7 +111,7 @@
</scroll-view>
</view>
</view>
</view>
</view> -->
<!-- 筛选弹窗 -->
<view
@click.stop=""
......@@ -220,7 +248,8 @@ import postionCard1 from "@/components/postionCard1/index.vue";
import { getEumData } from "@/utils/utils.js";
import { getToken } from "@/utils/token";
import evn from "@/utils/config.js";
import { getLoginUserApi } from "@/api/user";
import { getLoginUserApi, getMajorTreeApi } from "@/api/user";
import _ from "lodash";
/* 轮播 */
const swiperList = ref([]);
let swiperListData = [];
......@@ -243,16 +272,19 @@ let salary = ref([
{ text: "50k以上", min: 50000, max: 100000 }
]);
onLoad(() => {
getColumnsCity();
dictJobType();
getTreeData();
initOtherData();
});
onShow(() => {
getLoginUserApi().then(res => {
uni.setStorageSync("userInfo", res.data);
});
getTreeData();
dictJobType();
reset().then(res => {
getListData();
});
initOtherData();
xma.xh.getMenuButtonBoundingClientRect({
success(res) {
contentHeight.value = (res.top + res.bottom) / 2 + 25 + "px";
......@@ -265,6 +297,28 @@ onReachBottom(e => {
getListData();
});
const columnChangeCity = ({ resolve, selectedItem, finish }) => {
if (selectedItem.children?.length) {
resolve(selectedItem.children);
} else {
finish();
}
};
const handleConfirmCity = ({ value, selectedItems }) => {
const textIndex = _.compact(value).length - 1;
if (textIndex === -1) {
cityText.value = "全国";
} else {
cityText.value = selectedItems[textIndex].name;
}
const [provinceCode1, cityCode1, districtCode1] = value;
provinceCode = provinceCode1 || ""
cityCode = cityCode1 || "";
districtCode = districtCode1 || ""
getListData();
};
// 获取数据
getBannerListApi(1).then(res => {
swiperListData = res.data;
......@@ -328,6 +382,62 @@ const openMask = type => {
cityCode = "520100";
}
};
// 城市筛选
const valueCity = ref([]);
const cityText = ref("全国");
const columnsCity = ref([]);
const getColumnsCity = () => {
getTreeListApi().then(res => {
// 给说有子选项都添加全部
res.data.forEach(v => {
v.children.unshift({
code: "",
name: "全部"
});
v.children.forEach(vv => {
if (vv.children?.length) {
vv.children.unshift({
code: "",
name: "全部"
});
}
});
});
res.data.unshift({
code: "",
name: "全国"
});
columnsCity.value.push(res.data);
});
};
/* 专业筛选 */
const majorValue = ref([]);
const majorOpstion = ref([]);
const columnChangeMajor = ({ selectedItem, resolve, finish }) => {
if (selectedItem.children) {
resolve(selectedItem.children);
} else {
finish();
}
};
const handleConfirmMajor = ({ value }) => {
majorText.value = value[1];
majorName = value[0] + '-' + value[1];
getListData()
};
const majorText = ref("");
getMajorTreeApi().then(res => {
if (res.code === 200) {
majorOpstion.value.push(
Object.keys(res.data).map(key => ({
name: key,
children: res.data[key]
}))
);
}
});
// 省市区
let regionPop = false; //区域
let regionNav = "贵州省"; //选中区域
......@@ -358,45 +468,30 @@ const getTreeData = () => {
});
};
// 选择市
const bindCityList = (code, name) => {
for (let i = 0; i < cityData.value.length; i++) {
if (cityData.value[i].code == code) {
let _children = cityData.value[i].children;
regionData.value = _children;
cityId.value = code;
}
}
cityCode = code;
};
// 选择区
const bindRegionList = code => {
regionId.value = code;
maskType.value = null;
if (code === -1) {
districtCode = null;
} else {
districtCode = code;
}
pageNo = 1;
positionListData.value = [];
getListData();
// let _regionNav;
// if (name == "全部") {
// for (let i = 0; i < cityData.length; i++) {
// if (cityId.value == cityData[i].code) {
// _regionNav = cityData[i].name;
// }
// }
// } else {
// pageNo = 1;
// regionNav = name;
// regionId.value = code;
// districtCode = code;
// getListData();
// }
// console.log(code);
};
// // 选择市
// const bindCityList = (code, name) => {
// for (let i = 0; i < cityData.value.length; i++) {
// if (cityData.value[i].code == code) {
// let _children = cityData.value[i].children;
// regionData.value = _children;
// cityId.value = code;
// }
// }
// cityCode = code;
// };
// // 选择区
// const bindRegionList = code => {
// regionId.value = code;
// maskType.value = null;
// if (code === -1) {
// districtCode = null;
// } else {
// districtCode = code;
// }
// pageNo = 1;
// positionListData.value = [];
// getListData();
// };
// 职业类型筛选
const positionType = ref([]);
const sortNav = ref("职位类型");
......@@ -452,6 +547,9 @@ const bindScreenEducationList = (text, code) => {
const keyword = ref("");
let pageNo = 1,
pageSize = 10,
provinceCode = null,
cityCode = null,
majorName = null,
districtCode = null,
minSalary = null,
maxSalary = null,
......@@ -517,7 +615,6 @@ const reset = () => {
pageNo = 1;
pageSize = 10;
keyword.value = "";
districtCode = null;
minSalary = null;
maxSalary = null;
educationRequirement = null;
......@@ -555,7 +652,7 @@ const confirm = e => {
const confirmParameters = () => {
pageNo = 1;
positionListData.value = [];
getListData()
getListData();
};
const getListData = () => {
......@@ -563,6 +660,9 @@ const getListData = () => {
pageNo: pageNo,
pageSize: pageSize,
keyword: keyword.value || null,
provinceCode: provinceCode || null,
cityCode: cityCode || null,
majorName:majorName || null,
districtCode: districtCode || null,
minSalary: minSalary || null,
maxSalary: maxSalary || null,
......@@ -571,6 +671,7 @@ const getListData = () => {
identityRequirement: identityRequirement || null,
jobTypePid: jobTypePid || null
};
console.log("data", data);
getjobListApi(data).then(res => {
if (res.code == 200) {
positionListData.value = [...positionListData.value, ...res.data];
......@@ -740,6 +841,36 @@ const getListData = () => {
height: 80rpx;
padding: 0 32rpx;
background-color: #ffffff;
.filter-other {
gap: 16rpx;
.item {
/* display: flex;
align-items: flex-end; */
position: relative;
max-width: 120rpx;
padding: 12rpx 18rpx;
overflow: hidden;
font-size: 24rpx;
font-weight: normal;
line-height: 24rpx;
color: #ffffff;
text-overflow: ellipsis;
white-space: nowrap;
background: linear-gradient(180deg, #3570ff -3%, #29a5ff 100%);
border-radius: 8rpx;
.arrow {
position: absolute;
right: 6rpx;
bottom: 12rpx;
width: 0;
height: 0;
margin-left: 4rpx;
border-color: #ffffff;
border-width: 4rpx;
transform: rotateZ(0deg);
}
}
}
.recommend {
position: relative;
font-size: 36rpx;
......
......@@ -87,19 +87,19 @@ const navList = [
url: "/pages/login/index",
text: "退出登录"
},
{
icon: new URL("@/static/image/user/loginout.png", import.meta.url).href,
url: "/pages/test",
text: "测试页面"
},
{
icon: new URL("@/static/image/user/loginout.png", import.meta.url).href,
url: "/pages/login/test",
fn: () => {
removeToken();
},
text: "退出登录(去测试登录)"
}
// {
// icon: new URL("@/static/image/user/loginout.png", import.meta.url).href,
// url: "/pages/test",
// text: "测试页面"
// },
// {
// icon: new URL("@/static/image/user/loginout.png", import.meta.url).href,
// url: "/pages/login/test",
// fn: () => {
// removeToken();
// },
// text: "退出登录(去测试登录)"
// }
];
/* 个人信息 */
const realName = ref("");
......
import axios from "axios";
import { getToken } from "./token";
// const baseURL = "https://lygsh-api.wjzpgz.com/";
const baseURL = "http://192.168.11.48:8080/";
const baseURL = "https://lygsh-api.wjzpgz.com/";
// const baseURL = "http://192.168.11.48:8080/";
// 创建一个 axios 实例
const instance = axios.create({
baseURL, // 设置基础 URL
......@@ -36,13 +36,14 @@ instance.interceptors.request.use(
// 响应拦截器
instance.interceptors.response.use(
response => {
if (response.data.code === 4 || response.data.code === 8) {
let { code, message } = response.data;
if (code === 4 || code === 8) {
uni.showToast({
title: response.data.message,
title: message,
icon: "none"
});
}
if (response.data.code === 9) {
if (code === 9) {
const path = getCurrentPages()[0].$page.path
if(path === '/pages/user/resume/essentialInformation/index') return
uni.showModal({
......@@ -58,6 +59,21 @@ instance.interceptors.response.use(
}
}
});
} else if (code === 13) {
uni.showModal({
title: '您的帐号已失效',
content: '由于您超过1月未登录现已将您的账号禁用您可完成申述后继续使用',
showCancel: true,
confirmText: '立即申述',
success: function (confirm) {
if (confirm.confirm) {
xma.navigateTo({
url: '/pages/postionList/appeal/index'
})
}
}
});
}
uni.hideLoading()
// 在这里可以对响应数据进行预处理
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment