Merge branch 'main' into bin
This commit is contained in:
@@ -46,10 +46,10 @@
|
||||
<view class="card-companyName">{{ job.companyName }}</view>
|
||||
<view class="card-tags">
|
||||
<view class="tag">
|
||||
<dict-Label dictType="education" :value="job.education"></dict-Label>
|
||||
{{job.education == '不限' ? '学历不限' : job.education}}
|
||||
</view>
|
||||
<view class="tag">
|
||||
<dict-Label dictType="experience" :value="job.experience"></dict-Label>
|
||||
{{job.experience == '不限' ? '经验不限' : job.experience}}
|
||||
</view>
|
||||
<view class="tag">
|
||||
{{ vacanciesTo(job.vacancies) }}
|
||||
@@ -129,7 +129,7 @@ function parseDateTime(datetimeStr) {
|
||||
}
|
||||
|
||||
function nextDetail(job) {
|
||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}&dataType=${job.dataType}`);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@ export default {
|
||||
// baseUrl: 'https://fw.rc.qingdao.gov.cn/rgpp-api/api', // 内网
|
||||
baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试
|
||||
// baseUrl: 'http://192.168.3.29:8081',
|
||||
// sseAI+
|
||||
// StreamBaseURl: 'http://39.98.44.136:8000',
|
||||
StreamBaseURl: 'https://qd.zhaopinzao8dian.com/ai',
|
||||
// StreamBaseURl: 'https://qd.zhaopinzao8dian.com/ai/test',
|
||||
// baseUrl: 'http://10.213.6.207:19010/api',
|
||||
// 语音转文字
|
||||
// vioceBaseURl: 'ws://39.98.44.136:8080/speech-recognition',
|
||||
vioceBaseURl: 'wss://qd.zhaopinzao8dian.com/api/speech-recognition',
|
||||
|
||||
1
main.js
1
main.js
@@ -20,6 +20,7 @@ import renderCompanyCollectionRecord from '@/components/renderCompanyCollectionR
|
||||
import renderJobViewRecord from '@/components/renderJobViewRecord/renderJobViewRecord.vue';
|
||||
// import Tabbar from '@/components/tabbar/midell-box.vue'
|
||||
// 自动导入 directives 目录下所有指令
|
||||
console.log(lightAppJssdk)
|
||||
const directives = import.meta.glob('./directives/*.js', {
|
||||
eager: true
|
||||
});
|
||||
|
||||
@@ -41,8 +41,6 @@ onReachBottom(() => {
|
||||
getJobList();
|
||||
});
|
||||
|
||||
|
||||
|
||||
function getJobList(type = 'add') {
|
||||
if (type === 'refresh') {
|
||||
pageState.page = 1;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
</view>
|
||||
<scroll-view scroll-y class="main-scroll" @scrolltolower="getJobList('add')">
|
||||
<view class="one-cards">
|
||||
<view class="mian">
|
||||
<renderJobViewRecord
|
||||
:list="pageState.list"
|
||||
v-if="pageState.list.length"
|
||||
@@ -33,7 +32,7 @@
|
||||
></renderJobViewRecord>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
<!-- <loadmore ref="loadmoreRef"></loadmore> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
@@ -11,21 +11,31 @@
|
||||
<view class="button-click" :class="{ active: type === 1 }" @click="changeType(1)">公司企业</view>
|
||||
</view>
|
||||
<view class="coll-main">
|
||||
<swiper class="swiper" :current="type" @change="changeSwiperType">
|
||||
<swiper-item class="list">
|
||||
<swiper class="swiper" :disable-touch="disableTouch" :current="type" @change="changeSwiperType">
|
||||
<swiper-item
|
||||
class="list"
|
||||
@touchstart.passive="handleTouchStart"
|
||||
@touchmove.passive="handleTouchMove"
|
||||
@touchend="disableTouch = false"
|
||||
>
|
||||
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
|
||||
<view class="mian">
|
||||
<renderJobCollectionRecord
|
||||
<renderJobCollectionRecord
|
||||
v-if="pageState.list.length"
|
||||
:list="pageState.list"
|
||||
:longitude="longitudeVal"
|
||||
:latitude="latitudeVal">
|
||||
</renderJobCollectionRecord>
|
||||
:latitude="latitudeVal"
|
||||
></renderJobCollectionRecord>
|
||||
<empty v-else pdTop="200"></empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item class="list">
|
||||
<swiper-item
|
||||
class="list"
|
||||
@touchstart.passive="handleTouchStart"
|
||||
@touchmove.passive="handleTouchMove"
|
||||
@touchend="disableTouch = false"
|
||||
>
|
||||
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLowerCompany">
|
||||
<view class="mian">
|
||||
<renderCompanyCollectionRecord
|
||||
@@ -69,14 +79,79 @@ const pageCompanyState = reactive({
|
||||
pageSize: 10,
|
||||
});
|
||||
|
||||
const disableTouch = ref(false);
|
||||
const startPointX = ref(0);
|
||||
const totalPage = 2;
|
||||
const THRESHOLD = 5;
|
||||
|
||||
onShow(() => {
|
||||
getJobList();
|
||||
getCompanyList();
|
||||
});
|
||||
|
||||
function handleTouchStart(e) {
|
||||
// 确保有触摸点
|
||||
if (e.touches.length > 0) {
|
||||
startPointX.value = e.touches[0].clientX;
|
||||
disableTouch.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function handleTouchMove(e) {
|
||||
if (e.touches.length === 0) return;
|
||||
|
||||
const currentX = e.touches[0].clientX;
|
||||
const diffX = currentX - startPointX.value;
|
||||
|
||||
if (type.value === 0) {
|
||||
if (diffX > THRESHOLD) {
|
||||
disableTouch.value = true;
|
||||
} else {
|
||||
disableTouch.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (type.value === totalPage - 1) {
|
||||
if (diffX < -THRESHOLD) {
|
||||
disableTouch.value = true;
|
||||
} else {
|
||||
disableTouch.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
disableTouch.value = false;
|
||||
}
|
||||
|
||||
function changeSwiperType(e) {
|
||||
const newIndex = e.detail.current;
|
||||
const lastIndex = type.value;
|
||||
|
||||
const isSwipingRight = newIndex < lastIndex;
|
||||
const isSwipingLeft = newIndex > lastIndex;
|
||||
|
||||
if (lastIndex === 0 && isSwipingRight) {
|
||||
disableTouch.value = true;
|
||||
type.value = 0;
|
||||
setTimeout(() => {
|
||||
disableTouch.value = false;
|
||||
}, 50);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastIndex === totalPage - 1 && isSwipingLeft) {
|
||||
disableTouch.value = true;
|
||||
type.value = lastIndex;
|
||||
|
||||
setTimeout(() => {
|
||||
disableTouch.value = false;
|
||||
}, 50);
|
||||
return;
|
||||
}
|
||||
|
||||
const current = e.detail.current;
|
||||
type.value = current;
|
||||
disableTouch.value = false;
|
||||
}
|
||||
|
||||
function changeType(e) {
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
<image src="@/static/icon/companyIcon.png" mode=""></image>
|
||||
</view>
|
||||
<view class="companyinfo-right">
|
||||
<view class="row1 line_2">{{ fairInfo?.zphmc }}</view>
|
||||
<view class="row1 line_2" @tap="$api.copyText(fairInfo.zphmc)">{{ fairInfo?.zphmc }}</view>
|
||||
<view class="row2">
|
||||
<text>{{ fairInfo.jbf }}</text>
|
||||
<text @tap="$api.copyText(fairInfo.jbf)">{{ fairInfo.jbf }}</text>
|
||||
<!-- <convert-distance
|
||||
:alat="fairInfo.latitude"
|
||||
:along="fairInfo.longitude"
|
||||
@@ -27,7 +27,9 @@
|
||||
<image class="location-img" src="/static/icon/mapLine.png"></image>
|
||||
<view class="location-info">
|
||||
<view class="info">
|
||||
<text class="info-title">{{ fairInfo.zphdz }}</text>
|
||||
<text class="info-title line_1" @tap="$api.copyText(fairInfo.zphdz)">
|
||||
{{ fairInfo.zphdz }}
|
||||
</text>
|
||||
<!-- <text class="info-text">位置</text> -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -122,23 +124,23 @@ const pageState = reactive({
|
||||
const hasnext = ref(true);
|
||||
|
||||
const zphId = ref('');
|
||||
const pageOptions = ref({})
|
||||
const pageOptions = ref({});
|
||||
|
||||
onLoad((options) => {
|
||||
zphId.value = options.jobFairId
|
||||
pageOptions.value = options
|
||||
zphId.value = options.jobFairId;
|
||||
pageOptions.value = options;
|
||||
getJobFairInfo(options.jobFairId, options.jobFairName);
|
||||
getCompanyList('refresh');
|
||||
});
|
||||
|
||||
function getJobFairInfo(id,name) {
|
||||
function getJobFairInfo(id, name) {
|
||||
$api.createRequest(`/app/internal/jobFairThirdPart/${id}`).then((resData) => {
|
||||
fairInfo.value = resData.data;
|
||||
hasAppointment();
|
||||
});
|
||||
}
|
||||
function getCompanyList(type='add') {
|
||||
const { jobFairId,jobFairName} = pageOptions.value
|
||||
function getCompanyList(type = 'add') {
|
||||
const { jobFairId, jobFairName } = pageOptions.value;
|
||||
if (type === 'refresh') {
|
||||
pageState.current = 1;
|
||||
pageState.maxPage = 1;
|
||||
@@ -150,24 +152,26 @@ function getCompanyList(type='add') {
|
||||
current: pageState.current,
|
||||
pageSize: pageState.pageSize,
|
||||
};
|
||||
$api.createRequest(`/app/internal/companyThirdPart/?zphID=${jobFairId}&zphmc=${jobFairName}`,params ).then((resData) => {
|
||||
const { rows, total } = resData;
|
||||
if (type === 'add') {
|
||||
const str = pageState.pageSize * (pageState.current - 1);
|
||||
const end = pageState.list.length;
|
||||
const reslist = rows;
|
||||
pageState.list.splice(str, end, ...reslist);
|
||||
} else {
|
||||
pageState.list = rows;
|
||||
$api.createRequest(`/app/internal/companyThirdPart/?zphID=${jobFairId}&zphmc=${jobFairName}`, params).then(
|
||||
(resData) => {
|
||||
const { rows, total } = resData;
|
||||
if (type === 'add') {
|
||||
const str = pageState.pageSize * (pageState.current - 1);
|
||||
const end = pageState.list.length;
|
||||
const reslist = rows;
|
||||
pageState.list.splice(str, end, ...reslist);
|
||||
} else {
|
||||
pageState.list = rows;
|
||||
}
|
||||
pageState.total = resData.total;
|
||||
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
||||
}
|
||||
pageState.total = resData.total;
|
||||
pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
const hasAppointment = () => {
|
||||
const isTimePassed = (timeStr) => {
|
||||
if(!timeStr) return false
|
||||
if (!timeStr) return false;
|
||||
const targetTime = new Date(timeStr.replace(/-/g, '/')).getTime(); // 兼容格式
|
||||
const now = Date.now();
|
||||
return now < targetTime;
|
||||
|
||||
@@ -1,241 +1,212 @@
|
||||
<template>
|
||||
<AppLayout title="我的简历" title-color="#FFFFFF" back-gorund-color="#F4F4F4">
|
||||
<template #headerleft>
|
||||
<view class="btn">
|
||||
<image src="@/static/icon/back-white.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
<view v-if="userInfo.resumeOcrStatus && showNotice" class="notice-line" :class="userInfo.resumeOcrStatus?.includes('成功')?'green':'blue'">
|
||||
<image v-if="userInfo.resumeOcrStatus?.includes('成功')" class="icon" src="@/static/icon/notice-green.png" />
|
||||
<image v-else class="icon" src="@/static/icon/notice-blue.png" />
|
||||
<view class="text">{{userInfo.resumeOcrStatus}}</view>
|
||||
<image @click="closeNotice" v-if="userInfo.resumeOcrStatus?.includes('成功')" class="close" src="@/static/icon/close-green.png" />
|
||||
<image @click="closeNotice" v-else class="close" src="@/static/icon/close-blue.png" />
|
||||
</view>
|
||||
<view class="mys-container">
|
||||
<!-- 个人信息 -->
|
||||
<view
|
||||
class="card-top"
|
||||
style="margin-top: 12rpx; padding: 0; background: none"
|
||||
>
|
||||
<view class="mys-tops btn-feel">
|
||||
<view class="tops-left">
|
||||
<view class="name">
|
||||
<text>{{ userInfo.name || "编辑用户名" }}</text>
|
||||
<view class="edit-icon mar_le10">
|
||||
<image
|
||||
class="button-click"
|
||||
src="@/static/icon/edit1.png"
|
||||
@click="navTo('/packageA/pages/personalInfo/personalInfo')"
|
||||
></image>
|
||||
</view>
|
||||
<AppLayout title="我的简历" title-color="#FFFFFF" back-gorund-color="#F4F4F4">
|
||||
<template #headerleft>
|
||||
<view class="btn">
|
||||
<image src="@/static/icon/back-white.png" @click="navBack"></image>
|
||||
</view>
|
||||
<view class="subName">
|
||||
<dict-Label
|
||||
class="mar_ri10"
|
||||
dictType="sex"
|
||||
:value="userInfo.sex"
|
||||
></dict-Label>
|
||||
<text class="mar_ri10">{{ userInfo.age }}岁</text>
|
||||
<dict-Label
|
||||
class="mar_ri10"
|
||||
dictType="education"
|
||||
:value="userInfo.education"
|
||||
></dict-Label>
|
||||
<dict-Label
|
||||
class="mar_ri10"
|
||||
dictType="affiliation"
|
||||
:value="userInfo.politicalAffiliation"
|
||||
></dict-Label>
|
||||
</view>
|
||||
<view class="subName">{{ userInfo.phone }}</view>
|
||||
</view>
|
||||
<view class="tops-right">
|
||||
<view class="right-imghead">
|
||||
<image v-if="userInfo.avatar" :src="userInfo.avatar"></image>
|
||||
<image
|
||||
v-else-if="userInfo.sex == '0'"
|
||||
src="@/static/icon/boy.png"
|
||||
></image>
|
||||
<image v-else src="@/static/icon/girl.png"></image>
|
||||
</view>
|
||||
<view class="right-sex">
|
||||
<image
|
||||
v-if="userInfo.sex === '0'"
|
||||
src="@/static/icon/boy1.png"
|
||||
></image>
|
||||
<image v-else src="@/static/icon/girl1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 求职期望 -->
|
||||
<view class="mys-line">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="mys-info btn-feel">
|
||||
<view class="mys-h4">
|
||||
<view>求职期望</view>
|
||||
<image
|
||||
class="icon"
|
||||
src="@/static/icon/edit1.png"
|
||||
@click="navTo('/packageA/pages/jobExpect/jobExpect')"
|
||||
></image>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>期望薪资:</text>
|
||||
<text
|
||||
>{{ userInfo.salaryMin / 1000 }}k-{{
|
||||
userInfo.salaryMax / 1000
|
||||
}}k</text
|
||||
>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>期望工作地:</text>
|
||||
<text>青岛市-</text>
|
||||
<dict-Label
|
||||
dictType="area"
|
||||
:value="Number(userInfo.area)"
|
||||
></dict-Label>
|
||||
</view>
|
||||
<view class="mys-list">
|
||||
<view
|
||||
class="cards button-click"
|
||||
v-for="(title, index) in userInfo.jobTitle"
|
||||
:key="index"
|
||||
>
|
||||
{{ title }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-top" style="margin-top: 24rpx">
|
||||
<view class="mys-info" style="padding: 0">
|
||||
<view class="mys-h4 btn-feel">
|
||||
<text>工作经历</text>
|
||||
<view
|
||||
class="mys-edit-icon btn-feel"
|
||||
@click="navTo('/packageA/pages/workExp/workExp')"
|
||||
>
|
||||
<image
|
||||
class="icon button-click btn-feel"
|
||||
src="@/static/icon/plus.png"
|
||||
></image>
|
||||
<view class="txt">添加</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="exp-item btn-feel"
|
||||
v-for="item in userInfo.workExp"
|
||||
:key="item.id"
|
||||
>
|
||||
<view class="fl_box fl_justbet mar_top15">
|
||||
<view class="fs_16">{{ item.company }}</view>
|
||||
<image
|
||||
class="icon btn-feel"
|
||||
src="@/static/icon/edit1.png"
|
||||
@click="navTo(`/packageA/pages/workExp/workExp?id=${item.id}`)"
|
||||
></image>
|
||||
</view>
|
||||
<view class="mys-text fl_box fl_justbet">
|
||||
<text class="color_333333 fs_14">{{ item.position }}</text>
|
||||
<text class="datetext"
|
||||
>{{ item.startTime }}--{{ item.endTime || "至今" }}</text
|
||||
>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>{{ item.duty }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template #footer>
|
||||
<view class="footer-container">
|
||||
<view class="footer-button btn-feel" @click="chooseResume"
|
||||
>上传简历</view
|
||||
</template>
|
||||
<view
|
||||
v-if="userInfo.resumeOcrStatus && showNotice"
|
||||
class="notice-line"
|
||||
:class="userInfo.resumeOcrStatus?.includes('成功') ? 'green' : 'blue'"
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
</AppLayout>
|
||||
<image
|
||||
v-if="userInfo.resumeOcrStatus?.includes('成功')"
|
||||
class="icon"
|
||||
src="@/static/icon/notice-green.png"
|
||||
/>
|
||||
<image v-else class="icon" src="@/static/icon/notice-blue.png" />
|
||||
<view class="text">{{ userInfo.resumeOcrStatus }}</view>
|
||||
<image
|
||||
@click="closeNotice"
|
||||
v-if="userInfo.resumeOcrStatus?.includes('成功')"
|
||||
class="close"
|
||||
src="@/static/icon/close-green.png"
|
||||
/>
|
||||
<image @click="closeNotice" v-else class="close" src="@/static/icon/close-blue.png" />
|
||||
</view>
|
||||
<view class="mys-container">
|
||||
<!-- 个人信息 -->
|
||||
<view class="card-top" style="margin-top: 12rpx; padding: 0; background: none">
|
||||
<view class="mys-tops">
|
||||
<view class="tops-left">
|
||||
<view class="name">
|
||||
<text>{{ userInfo.name || '编辑用户名' }}</text>
|
||||
<view class="edit-icon mar_le10">
|
||||
<image
|
||||
class="button-click"
|
||||
src="@/static/icon/edit1.png"
|
||||
@click="navTo('/packageA/pages/personalInfo/personalInfo')"
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="subName">
|
||||
<dict-Label class="mar_ri10" dictType="sex" :value="userInfo.sex"></dict-Label>
|
||||
<text class="mar_ri10">{{ userInfo.age }}岁</text>
|
||||
<dict-Label class="mar_ri10" dictType="education" :value="userInfo.education"></dict-Label>
|
||||
<dict-Label
|
||||
class="mar_ri10"
|
||||
dictType="affiliation"
|
||||
:value="userInfo.politicalAffiliation"
|
||||
></dict-Label>
|
||||
</view>
|
||||
<view class="subName">{{ userInfo.phone }}</view>
|
||||
</view>
|
||||
<view class="tops-right">
|
||||
<view class="right-imghead">
|
||||
<image v-if="userInfo.avatar" :src="userInfo.avatar"></image>
|
||||
<image v-else-if="userInfo.sex == '0'" src="@/static/icon/boy.png"></image>
|
||||
<image v-else src="@/static/icon/girl.png"></image>
|
||||
</view>
|
||||
<view class="right-sex">
|
||||
<image v-if="userInfo.sex === '0'" src="@/static/icon/boy1.png"></image>
|
||||
<image v-else src="@/static/icon/girl1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 求职期望 -->
|
||||
<view class="mys-line">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="mys-info">
|
||||
<view class="mys-h4">
|
||||
<view>求职期望</view>
|
||||
<image
|
||||
class="icon"
|
||||
src="@/static/icon/edit1.png"
|
||||
@click="navTo('/packageA/pages/jobExpect/jobExpect')"
|
||||
></image>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>期望薪资:</text>
|
||||
<text>{{ userInfo.salaryMin / 1000 }}k-{{ userInfo.salaryMax / 1000 }}k</text>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>期望工作地:</text>
|
||||
<text>青岛市-</text>
|
||||
<dict-Label dictType="area" :value="Number(userInfo.area)"></dict-Label>
|
||||
</view>
|
||||
<view class="mys-list">
|
||||
<view class="cards button-click" v-for="(title, index) in userInfo.jobTitle" :key="index">
|
||||
{{ title }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-top" style="margin-top: 24rpx">
|
||||
<view class="mys-info" style="padding: 0">
|
||||
<view class="mys-h4">
|
||||
<text>工作经历</text>
|
||||
<view class="mys-edit-icon btn-tada" @click="navTo('/packageA/pages/workExp/workExp')">
|
||||
<image class="icon button-click btn-feel" src="@/static/icon/plus.png"></image>
|
||||
<view class="txt">添加</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="exp-item button-click" v-for="item in userInfo.workExp" :key="item.id">
|
||||
<view class="fl_box fl_justbet mar_top15">
|
||||
<view class="fs_16">{{ item.company }}</view>
|
||||
<image
|
||||
class="icon btn-feel"
|
||||
src="@/static/icon/edit1.png"
|
||||
@click="navTo(`/packageA/pages/workExp/workExp?id=${item.id}`)"
|
||||
></image>
|
||||
</view>
|
||||
<view class="mys-text fl_box fl_justbet">
|
||||
<text class="color_333333 fs_14">{{ item.position }}</text>
|
||||
<text class="datetext">{{ item.startTime }}--{{ item.endTime || '至今' }}</text>
|
||||
</view>
|
||||
<view class="mys-text">
|
||||
<text>{{ item.duty }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template #footer>
|
||||
<view class="footer-container">
|
||||
<view class="footer-button btn-feel" @click="chooseResume">上传简历</view>
|
||||
</view>
|
||||
</template>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted, computed } from "vue";
|
||||
const { $api, navTo, navBack } = inject("globalFunction");
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { storeToRefs } from "pinia";
|
||||
import useUserStore from "@/stores/useUserStore";
|
||||
import useDictStore from "@/stores/useDictStore";
|
||||
import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
|
||||
const { $api, navTo, navBack } = inject('globalFunction');
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
import useDictStore from '@/stores/useDictStore';
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
const { getUserResume } = useUserStore();
|
||||
const { getDictData, oneDictData } = useDictStore();
|
||||
import config from "@/config.js";
|
||||
import config from '@/config.js';
|
||||
|
||||
const showNotice = ref(true)
|
||||
const showNotice = ref(true);
|
||||
onLoad(() => {
|
||||
getUserResume();
|
||||
getUserResume();
|
||||
});
|
||||
|
||||
function closeNotice() {
|
||||
showNotice.value=false
|
||||
showNotice.value = false;
|
||||
}
|
||||
|
||||
function chooseResume() {
|
||||
uni.chooseImage({
|
||||
sizeType: ["original", "compressed"],
|
||||
sourceType: ["album", "camera"],
|
||||
count: 1,
|
||||
success: ({ tempFilePaths, tempFiles }) => {
|
||||
uploadResume(tempFilePaths[0], true)
|
||||
.then((res) => {
|
||||
res = JSON.parse(res);
|
||||
getUserResume();
|
||||
$api.msg("上传成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
$api.msg("上传失败");
|
||||
});
|
||||
},
|
||||
fail: (error) => {},
|
||||
});
|
||||
uni.chooseImage({
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
count: 1,
|
||||
success: ({ tempFilePaths, tempFiles }) => {
|
||||
uploadResume(tempFilePaths[0], true)
|
||||
.then((res) => {
|
||||
res = JSON.parse(res);
|
||||
getUserResume();
|
||||
$api.msg('上传成功');
|
||||
})
|
||||
.catch((err) => {
|
||||
$api.msg('上传失败');
|
||||
});
|
||||
},
|
||||
fail: (error) => {},
|
||||
});
|
||||
}
|
||||
|
||||
function uploadResume(tempFilePath, loading) {
|
||||
if (loading) {
|
||||
uni.showLoading({
|
||||
title: "请稍后",
|
||||
mask: true,
|
||||
if (loading) {
|
||||
uni.showLoading({
|
||||
title: '请稍后',
|
||||
mask: true,
|
||||
});
|
||||
}
|
||||
let Authorization = '';
|
||||
if (useUserStore().token) {
|
||||
Authorization = `${useUserStore().token}`;
|
||||
}
|
||||
const header = {};
|
||||
header['Authorization'] = encodeURIComponent(Authorization);
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: config.baseUrl + '/app/oss/uploadToObs',
|
||||
filePath: tempFilePath,
|
||||
name: 'file',
|
||||
header,
|
||||
success: (uploadFileRes) => {
|
||||
if (uploadFileRes.statusCode === 200) {
|
||||
resolve(uploadFileRes.data);
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err);
|
||||
},
|
||||
complete: () => {
|
||||
if (loading) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
let Authorization = "";
|
||||
if (useUserStore().token) {
|
||||
Authorization = `${useUserStore().token}`;
|
||||
}
|
||||
const header = {};
|
||||
header["Authorization"] = encodeURIComponent(Authorization);
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: config.baseUrl + "/app/oss/uploadToObs",
|
||||
filePath: tempFilePath,
|
||||
name: "file",
|
||||
header,
|
||||
success: (uploadFileRes) => {
|
||||
if (uploadFileRes.statusCode === 200) {
|
||||
resolve(uploadFileRes.data);
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err);
|
||||
},
|
||||
complete: () => {
|
||||
if (loading) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -286,7 +257,7 @@ function uploadResume(tempFilePath, loading) {
|
||||
.close
|
||||
width:25rpx;
|
||||
height:25rpx;
|
||||
|
||||
|
||||
.notice-line.blue{
|
||||
background: #E8F1FF
|
||||
color: #1677ff
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
width: isFullScreen ? '100%' : videoWidth + 'rpx',
|
||||
height: isFullScreen ? '100vh' : videoHeight + 'rpx',
|
||||
}"
|
||||
@touchstart="handleTouchStart"
|
||||
@touchmove="handleTouchMove"
|
||||
@touchstart.passive="handleTouchStart"
|
||||
@touchmove.passive="handleTouchMove"
|
||||
@touchend="handleTouchEnd"
|
||||
@touchmove.stop.prevent
|
||||
>
|
||||
@@ -187,4 +187,4 @@ defineExpose({ open });
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -162,8 +162,13 @@
|
||||
|
||||
<template #footer>
|
||||
<view class="footer">
|
||||
<view class="btn-wq button-click" @click="jobApply">
|
||||
{{ dataType === 2 ? '立即投递' : '立即前往' }}
|
||||
<view v-if="dataType==2" class="btn-wq button-click" :class="{'btn-des' : jobInfo.isApply}" @click="jobApply">
|
||||
<span v-if="jobInfo.isApply"> 已投递 </span>
|
||||
<span v-if="!jobInfo.isApply"> 立即投递</span>
|
||||
</view>
|
||||
<view v-else class="btn-wq button-click" @click="jobApply">
|
||||
<span v-if="jobInfo.isApply"> 立即前往</span>
|
||||
<span v-if="!jobInfo.isApply">立即投递 </span>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -308,19 +313,18 @@ function getCompetivetuveness(jobId) {
|
||||
// 申请岗位
|
||||
function jobApply() {
|
||||
if (dataType.value === 2) {
|
||||
$api.msg('敬请期待');
|
||||
return
|
||||
// 第三方数据申请逻辑
|
||||
const jobId = jobInfo.value.id;
|
||||
const params = {
|
||||
jobid:jobInfo.value.id,
|
||||
jobname:jobInfo.value.gwmc
|
||||
}
|
||||
if (jobInfo.value.isApply) {
|
||||
const jobUrl = jobInfo.value.jobUrl;
|
||||
return window.open(jobUrl);
|
||||
$api.msg('已经投递过该岗位了~');
|
||||
return ;
|
||||
} else {
|
||||
$api.createRequest(`/app/job/apply/${jobId}`, {}, 'GET').then((resData) => {
|
||||
getDetail(jobIdRef.value);
|
||||
$api.createRequest(`/app/internal/sendResume`, params, 'POST').then((resData) => {
|
||||
$api.msg('投递成功');
|
||||
const jobUrl = jobInfo.value.jobUrl;
|
||||
return window.open(jobUrl);
|
||||
getDetail(jobIdRef.value);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
@@ -651,5 +655,9 @@ for i in 0..100
|
||||
text-align: center;
|
||||
line-height: 90rpx
|
||||
}
|
||||
.btn-des{
|
||||
background: #6697FB;
|
||||
box-shadow: 0rpx -4rpx 24rpx 0rpx rgba(11,44,112,0.12);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -259,8 +259,8 @@ function getHoursBetween(startTimeStr, endTimeStr) {
|
||||
|
||||
const selectDate = (item) => {
|
||||
if (currentDay.value?.fullDate === item.fullDate) {
|
||||
currentDay.value = {};
|
||||
getFair('refresh');
|
||||
// currentDay.value = {};
|
||||
// getFair('refresh');
|
||||
return;
|
||||
}
|
||||
currentDay.value = item;
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<view
|
||||
class="input_vio"
|
||||
@touchstart.prevent="handleTouchStart"
|
||||
@touchmove="handleTouchMove"
|
||||
@touchmove.passive="handleTouchMove"
|
||||
@touchend="handleTouchEnd"
|
||||
@touchcancel="handleTouchCancel"
|
||||
:catchtouchstart="true"
|
||||
|
||||
@@ -3,8 +3,21 @@
|
||||
<view class="app-container">
|
||||
<!-- 主体内容区域 -->
|
||||
<view class="container-main">
|
||||
<swiper class="swiper" :current="state.current" @change="changeSwiperType">
|
||||
<swiper-item class="swiper-item" v-for="(_, index) in 2" :key="index">
|
||||
<swiper
|
||||
class="swiper"
|
||||
:disable-touch="disableTouch"
|
||||
:current="state.current"
|
||||
@change="changeSwiperType"
|
||||
>
|
||||
<!-- 绑定首页和尾页 -->
|
||||
<swiper-item
|
||||
@touchstart.passive="handleTouchStart"
|
||||
@touchmove.passive="handleTouchMove"
|
||||
@touchend="disableTouch = false"
|
||||
class="swiper-item"
|
||||
v-for="(_, index) in 2"
|
||||
:key="index"
|
||||
>
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<component
|
||||
:is="components[index]"
|
||||
@@ -60,6 +73,11 @@ const { unreadCount } = storeToRefs(useReadMsg());
|
||||
const showTabbar = ref(true);
|
||||
const maskFristEntry = ref(false);
|
||||
|
||||
const disableTouch = ref(false);
|
||||
const startPointX = ref(0);
|
||||
const totalPage = 2;
|
||||
const THRESHOLD = 5;
|
||||
|
||||
onLoad(() => {
|
||||
// 判断浏览器是否有 fristEntry 第一次进入
|
||||
let fristEntry = uni.getStorageSync('fristEntry') === false ? false : true; // 默认未读
|
||||
@@ -87,15 +105,69 @@ const handelComponentsRef = (el, index) => {
|
||||
}
|
||||
};
|
||||
|
||||
function handleTouchStart(e) {
|
||||
startPointX.value = e.touches[0].clientX;
|
||||
disableTouch.value = false;
|
||||
}
|
||||
function handleTouchMove(e) {
|
||||
const currentX = e.touches[0].clientX;
|
||||
const diffX = currentX - startPointX.value;
|
||||
|
||||
if (state.current === 0) {
|
||||
if (diffX > THRESHOLD) {
|
||||
disableTouch.value = true;
|
||||
} else {
|
||||
disableTouch.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (state.current === totalPage - 1) {
|
||||
if (diffX < -THRESHOLD) {
|
||||
disableTouch.value = true;
|
||||
} else {
|
||||
disableTouch.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
disableTouch.value = false;
|
||||
}
|
||||
|
||||
function changeShowTabbar(val) {
|
||||
showTabbar.value = val;
|
||||
}
|
||||
|
||||
//1 查看消息类型
|
||||
function changeSwiperType(e) {
|
||||
const newIndex = e.detail.current;
|
||||
const lastIndex = state.current;
|
||||
|
||||
const isSwipingRight = newIndex < lastIndex;
|
||||
const isSwipingLeft = newIndex > lastIndex;
|
||||
|
||||
if (lastIndex === 0 && isSwipingRight) {
|
||||
disableTouch.value = true;
|
||||
state.current = 0;
|
||||
setTimeout(() => {
|
||||
disableTouch.value = false;
|
||||
}, 50);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastIndex === totalPage - 1 && isSwipingLeft) {
|
||||
disableTouch.value = true;
|
||||
state.current = lastIndex;
|
||||
|
||||
setTimeout(() => {
|
||||
disableTouch.value = false;
|
||||
}, 50);
|
||||
return;
|
||||
}
|
||||
|
||||
const index = e.detail.current;
|
||||
state.current = index;
|
||||
handleTabChange(index);
|
||||
disableTouch.value = false;
|
||||
}
|
||||
function changeType(index) {
|
||||
state.current = index;
|
||||
|
||||
@@ -109,7 +109,9 @@
|
||||
</template>
|
||||
</tabcontrolVue>
|
||||
<SelectJobs ref="selectJobsModel"></SelectJobs>
|
||||
<view class="backdoor" @click="loginbackdoor">后门</view>
|
||||
<view class="backdoor" @click="loginbackdoor">
|
||||
<uni-icons type="gift-filled" size="30"></uni-icons>
|
||||
</view>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
@@ -310,8 +312,7 @@ function complete() {
|
||||
.backdoor{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 500rpx;
|
||||
background: red
|
||||
bottom: 200rpx;
|
||||
}
|
||||
.input-nx
|
||||
position: relative
|
||||
@@ -425,6 +426,7 @@ function complete() {
|
||||
font-size: 28rpx;
|
||||
color: #6A6A6A;
|
||||
.input-con
|
||||
pointer-events: none;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</view>
|
||||
<view class="card-main">
|
||||
<view class="main-title">服务专区</view>
|
||||
<view class="main-row btn-feel">
|
||||
<view class="main-row btn-feel" @click="selectFile">
|
||||
<view class="row-left">
|
||||
<image class="left-img" src="@/static/icon/server1.png"></image>
|
||||
<text class="left-text">实名认证</text>
|
||||
@@ -106,6 +106,7 @@ import { reactive, inject, watch, ref, onMounted } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import Tabbar from '@/components/tabbar/midell-box.vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import FileUploader from '@/utils/FileUploader.js';
|
||||
const { $api, navTo } = inject('globalFunction');
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
const popup = ref(null);
|
||||
@@ -133,6 +134,15 @@ function getUserstatistics() {
|
||||
counts.value = resData.data;
|
||||
});
|
||||
}
|
||||
|
||||
function selectFile() {
|
||||
// FileUploader.showMenuAndUpload({
|
||||
// success: function (res) {
|
||||
// alert('上传成功: ' + JSON.stringify(res));
|
||||
// },
|
||||
// });
|
||||
}
|
||||
function chooseFileUploadTest(pam) {}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
@@ -15,8 +15,20 @@
|
||||
|
||||
<!-- 主体内容区域 -->
|
||||
<view class="container-main">
|
||||
<swiper class="swiper" :current="state.current" @change="changeSwiperType">
|
||||
<swiper-item class="swiper-item" v-for="(_, index) in 2" :key="index">
|
||||
<swiper
|
||||
class="swiper"
|
||||
:disable-touch="disableTouch"
|
||||
:current="state.current"
|
||||
@change="changeSwiperType"
|
||||
>
|
||||
<swiper-item
|
||||
class="swiper-item"
|
||||
@touchstart.passive="handleTouchStart"
|
||||
@touchmove.passive="handleTouchMove"
|
||||
@touchend="disableTouch = false"
|
||||
v-for="(_, index) in 2"
|
||||
:key="index"
|
||||
>
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<component :is="components[index]" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<!-- #endif -->
|
||||
@@ -46,6 +58,11 @@ import { storeToRefs } from 'pinia';
|
||||
import { useReadMsg } from '@/stores/useReadMsg';
|
||||
const { unreadCount } = storeToRefs(useReadMsg());
|
||||
|
||||
const disableTouch = ref(false);
|
||||
const startPointX = ref(0);
|
||||
const totalPage = 2;
|
||||
const THRESHOLD = 5;
|
||||
|
||||
onShow(() => {
|
||||
// 获取消息列表
|
||||
useReadMsg().fetchMessages();
|
||||
@@ -59,6 +76,40 @@ onMounted(() => {
|
||||
handleTabChange(state.current);
|
||||
});
|
||||
|
||||
function handleTouchStart(e) {
|
||||
// 确保有触摸点
|
||||
if (e.touches.length > 0) {
|
||||
startPointX.value = e.touches[0].clientX;
|
||||
disableTouch.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function handleTouchMove(e) {
|
||||
if (e.touches.length === 0) return;
|
||||
|
||||
const currentX = e.touches[0].clientX;
|
||||
const diffX = currentX - startPointX.value;
|
||||
|
||||
if (state.current === 0) {
|
||||
if (diffX > THRESHOLD) {
|
||||
disableTouch.value = true;
|
||||
} else {
|
||||
disableTouch.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.current === totalPage - 1) {
|
||||
if (diffX < -THRESHOLD) {
|
||||
disableTouch.value = true;
|
||||
} else {
|
||||
disableTouch.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
disableTouch.value = false;
|
||||
}
|
||||
|
||||
const handelComponentsRef = (el, index) => {
|
||||
if (el) {
|
||||
swiperRefs[index].value = el;
|
||||
@@ -66,9 +117,35 @@ const handelComponentsRef = (el, index) => {
|
||||
};
|
||||
// 查看消息类型
|
||||
function changeSwiperType(e) {
|
||||
const newIndex = e.detail.current;
|
||||
const lastIndex = state.current;
|
||||
|
||||
const isSwipingRight = newIndex < lastIndex;
|
||||
const isSwipingLeft = newIndex > lastIndex;
|
||||
|
||||
if (lastIndex === 0 && isSwipingRight) {
|
||||
disableTouch.value = true;
|
||||
state.current = 0;
|
||||
setTimeout(() => {
|
||||
disableTouch.value = false;
|
||||
}, 50);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastIndex === totalPage - 1 && isSwipingLeft) {
|
||||
disableTouch.value = true;
|
||||
state.current = lastIndex;
|
||||
|
||||
setTimeout(() => {
|
||||
disableTouch.value = false;
|
||||
}, 50);
|
||||
return;
|
||||
}
|
||||
|
||||
const index = e.detail.current;
|
||||
state.current = index;
|
||||
handleTabChange(index);
|
||||
disableTouch.value = false;
|
||||
}
|
||||
function changeType(index) {
|
||||
state.current = index;
|
||||
|
||||
@@ -220,7 +220,7 @@ function handleControl(e) {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
$api.msg('使用模拟定位');
|
||||
// $api.msg('使用模拟定位');
|
||||
getInit();
|
||||
});
|
||||
|
||||
|
||||
@@ -13,8 +13,20 @@
|
||||
<view class="head-item" :class="{ actived: state.current === 3 }" @click="changeType(3)">商圈附近</view>
|
||||
</view>
|
||||
<view class="nearby-content">
|
||||
<swiper class="swiper" :current="state.current" @change="changeSwiperType">
|
||||
<swiper-item class="swiper-item" v-for="(_, index) in 4" :key="index">
|
||||
<swiper
|
||||
class="swiper"
|
||||
:disable-touch="disableTouch"
|
||||
:current="state.current"
|
||||
@change="changeSwiperType"
|
||||
>
|
||||
<swiper-item
|
||||
@touchstart.passive="handleTouchStart"
|
||||
@touchmove.passive="handleTouchMove"
|
||||
@touchend="disableTouch = false"
|
||||
class="swiper-item"
|
||||
v-for="(_, index) in 4"
|
||||
:key="index"
|
||||
>
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<component :is="components[index]" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<!-- #endif -->
|
||||
@@ -49,6 +61,11 @@ const showFilter1 = ref(false);
|
||||
const showFilter2 = ref(false);
|
||||
const showFilter3 = ref(false);
|
||||
|
||||
const disableTouch = ref(false);
|
||||
const startPointX = ref(0);
|
||||
const totalPage = 4;
|
||||
const THRESHOLD = 5;
|
||||
|
||||
const state = reactive({
|
||||
current: 0,
|
||||
all: [{}],
|
||||
@@ -63,11 +80,72 @@ const handelComponentsRef = (el, index) => {
|
||||
swiperRefs[index].value = el;
|
||||
}
|
||||
};
|
||||
|
||||
function handleTouchStart(e) {
|
||||
// 确保有触摸点
|
||||
if (e.touches.length > 0) {
|
||||
startPointX.value = e.touches[0].clientX;
|
||||
disableTouch.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function handleTouchMove(e) {
|
||||
if (e.touches.length === 0) return;
|
||||
|
||||
const currentX = e.touches[0].clientX;
|
||||
const diffX = currentX - startPointX.value;
|
||||
|
||||
if (state.current === 0) {
|
||||
if (diffX > THRESHOLD) {
|
||||
disableTouch.value = true;
|
||||
} else {
|
||||
disableTouch.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.current === totalPage - 1) {
|
||||
if (diffX < -THRESHOLD) {
|
||||
disableTouch.value = true;
|
||||
} else {
|
||||
disableTouch.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
disableTouch.value = false;
|
||||
}
|
||||
|
||||
// 查看消息类型
|
||||
function changeSwiperType(e) {
|
||||
const newIndex = e.detail.current;
|
||||
const lastIndex = state.current;
|
||||
|
||||
const isSwipingRight = newIndex < lastIndex;
|
||||
const isSwipingLeft = newIndex > lastIndex;
|
||||
|
||||
if (lastIndex === 0 && isSwipingRight) {
|
||||
disableTouch.value = true;
|
||||
state.current = 0;
|
||||
setTimeout(() => {
|
||||
disableTouch.value = false;
|
||||
}, 50);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastIndex === totalPage - 1 && isSwipingLeft) {
|
||||
disableTouch.value = true;
|
||||
state.current = lastIndex;
|
||||
|
||||
setTimeout(() => {
|
||||
disableTouch.value = false;
|
||||
}, 50);
|
||||
return;
|
||||
}
|
||||
|
||||
const index = e.detail.current;
|
||||
state.current = index;
|
||||
handleTabChange(index);
|
||||
disableTouch.value = false;
|
||||
}
|
||||
function changeType(index) {
|
||||
state.current = index;
|
||||
|
||||
@@ -16,46 +16,34 @@ const useLocationStore = defineStore("location", () => {
|
||||
|
||||
function getLocation() {
|
||||
return new Promise((resole, reject) => {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
altitude: true,
|
||||
isHighAccuracy: true,
|
||||
enableHighAccuracy: true, // 关键参数:启用传感器辅助
|
||||
timeout: 10000,
|
||||
success: function(res) {
|
||||
const resd = {
|
||||
longitude: 120.382665,
|
||||
latitude: 36.066938
|
||||
try {
|
||||
lightAppJssdk.map.getLocation({
|
||||
success: function(data) {
|
||||
longitudeVal.value = Number(data.longitude)
|
||||
latitudeVal.value = Number(data.latitude)
|
||||
resole(data)
|
||||
},
|
||||
fail: function(data) {
|
||||
longitudeVal.value = 120.382665
|
||||
latitudeVal.value = 36.066938
|
||||
resole({
|
||||
longitude: 120.382665,
|
||||
latitude: 36.066938
|
||||
})
|
||||
msg('用户位置获取失败')
|
||||
console.log('失败', data)
|
||||
}
|
||||
if (config.UsingSimulatedPositioning) { // 使用模拟定位
|
||||
longitudeVal.value = resd.longitude
|
||||
latitudeVal.value = resd.latitude
|
||||
msg('用户位置获取成功')
|
||||
resole(resd)
|
||||
} else {
|
||||
longitudeVal.value = res.longitude
|
||||
latitudeVal.value = res.latitude
|
||||
msg('用户位置获取成功')
|
||||
resole(res)
|
||||
}
|
||||
},
|
||||
fail: function(err) {
|
||||
// longitudeVal.value = ''
|
||||
// latitudeVal.value = ''
|
||||
// reject(err)
|
||||
const resd = {
|
||||
longitude: 120.382665,
|
||||
latitude: 36.066938
|
||||
}
|
||||
longitudeVal.value = resd.longitude
|
||||
latitudeVal.value = resd.latitude
|
||||
msg('用户位置获取失败,使用模拟定位')
|
||||
resole(resd)
|
||||
},
|
||||
complete: function(e) {
|
||||
console.warn('getUserLocation' + JSON.stringify(e))
|
||||
}
|
||||
})
|
||||
})
|
||||
} catch (e) {
|
||||
longitudeVal.value = 120.382665
|
||||
latitudeVal.value = 36.066938
|
||||
resole({
|
||||
longitude: 120.382665,
|
||||
latitude: 36.066938
|
||||
})
|
||||
msg('测试环境,使用模拟定位')
|
||||
console.log('失败', data)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
150
utils/FileUploader.js
Normal file
150
utils/FileUploader.js
Normal file
@@ -0,0 +1,150 @@
|
||||
/**
|
||||
* LightApp 文件上传工具类封装
|
||||
* * 使用方法:
|
||||
* 1. 列表选择上传:
|
||||
* FileUploader.showMenuAndUpload({ baseUrl: 'http://...' }).then(res => ...);
|
||||
* * 2. 直接调用某种类型上传:
|
||||
* FileUploader.directUpload({
|
||||
* baseUrl: 'http://...',
|
||||
* chooseType: 'chooseImageUpload'
|
||||
* }).then(res => ...);
|
||||
*/
|
||||
import config from "@/config.js"
|
||||
|
||||
export default {
|
||||
/**
|
||||
* 默认配置
|
||||
*/
|
||||
defaults: {
|
||||
baseUrl: config.baseUrl, // 必填,API的基础路径
|
||||
uploadPath: '/app/oss/upload', // 上传接口路径
|
||||
fileKey: 'file',
|
||||
maxSize: 10,
|
||||
maxSelectNum: 1,
|
||||
minTime: 3,
|
||||
maxTime: 15,
|
||||
transmissionType: 0, // 0-图片地址, 1-base64
|
||||
},
|
||||
|
||||
/**
|
||||
* 映射菜单索引到上传类型
|
||||
*/
|
||||
typeMapping: {
|
||||
0: 'chooseImageUpload', // 相册
|
||||
1: 'takingPicturesUpload', // 相机
|
||||
2: 'takingVideoUpload', // 视频
|
||||
3: 'chooseFileUpload' // 文件
|
||||
},
|
||||
|
||||
/**
|
||||
* 核心方法:调用 SDK 的 chooseFileUpload
|
||||
* @param {Object} options - 配置项
|
||||
* @returns {Promise}
|
||||
*/
|
||||
_executeUpload: function(options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 合并配置
|
||||
const config = {
|
||||
...this.defaults,
|
||||
...options
|
||||
};
|
||||
|
||||
// 构造 SDK 需要的参数结构
|
||||
const pam = {
|
||||
url: config.baseUrl + config.uploadPath,
|
||||
fileKey: config.fileKey,
|
||||
params: config.params || {},
|
||||
header: config.header || {},
|
||||
chooseType: config.chooseType || 'chooseFileUpload',
|
||||
transmissionType: config.transmissionType,
|
||||
maxSize: config.maxSize,
|
||||
maxSelectNum: config.maxSelectNum,
|
||||
minTime: config.minTime,
|
||||
maxTime: config.maxTime
|
||||
};
|
||||
|
||||
// 针对特定类型的特殊处理 (参考原代码逻辑)
|
||||
if (config.chooseType === 'takingPicturesUpload') {
|
||||
// 原代码注释中提到: // pam1.fileKey = 'picfile';
|
||||
// 如果需要特殊 fileKey 可以在这里处理
|
||||
}
|
||||
|
||||
console.log('开始调用SDK上传, 参数:', pam);
|
||||
|
||||
if (typeof lightAppJssdk === 'undefined') {
|
||||
const msg = 'lightAppJssdk 未定义,请在 爱山东 环境中运行';
|
||||
alert(msg);
|
||||
return reject(msg);
|
||||
}
|
||||
lightAppJssdk.uploadFile.chooseFileUpload({
|
||||
arg0: pam,
|
||||
success: function(data) {
|
||||
// 支持传入 success 回调,也支持 Promise resolve
|
||||
if (options.success) options.success(data);
|
||||
console.log(data)
|
||||
resolve(data);
|
||||
},
|
||||
fail: function(err) {
|
||||
// 支持传入 fail 回调,也支持 Promise reject
|
||||
if (options.fail) options.fail(err);
|
||||
// 默认弹窗提示错误,可以通过 silent: true 关闭
|
||||
if (!options.silent) alert(typeof err === 'object' ? JSON.stringify(
|
||||
err) : err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 场景1: 弹出菜单选择,然后上传 (封装了原 selectFile)
|
||||
* @param {Object} options - 配置项 (需包含 baseUrl)
|
||||
*/
|
||||
showMenuAndUpload: function(options = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (typeof lightAppJssdk === 'undefined') {
|
||||
alert('lightAppJssdk 未定义');
|
||||
return reject('lightAppJssdk undefined');
|
||||
}
|
||||
|
||||
const menuList = options.menuList || ['相册', '相机', '视频', '文件'];
|
||||
|
||||
lightAppJssdk.notification.showMediaAlert({
|
||||
arg0: menuList,
|
||||
success: (data) => {
|
||||
// data.index 对应 menuList 的索引
|
||||
const selectedType = this.typeMapping[data.index];
|
||||
|
||||
if (!selectedType) {
|
||||
const err = '未知的选择类型';
|
||||
if (options.fail) options.fail(err);
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
// 选中后,调用核心上传方法
|
||||
this._executeUpload({
|
||||
...options,
|
||||
chooseType: selectedType
|
||||
}).then(resolve).catch(reject);
|
||||
},
|
||||
fail: (err) => {
|
||||
if (options.fail) options.fail(err);
|
||||
if (!options.silent) alert(err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 场景2: 直接上传 (不弹窗,直接调起特定类型的上传)
|
||||
* @param {Object} options - 需包含 baseUrl 和 chooseType
|
||||
*/
|
||||
directUpload: function(options = {}) {
|
||||
if (!options.chooseType) {
|
||||
// 如果没传类型,默认当做普通文件上传
|
||||
options.chooseType = 'chooseFileUpload';
|
||||
}
|
||||
return this._executeUpload(options);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user