diff --git a/App.vue b/App.vue
index 3a24242..dac90e1 100644
--- a/App.vue
+++ b/App.vue
@@ -11,26 +11,32 @@ const appword = 'aKd20dbGdFvmuwrt'; // 固定值
onLaunch((options) => {
useDictStore().getDictData();
- try {
+ if (lightAppJssdk.user) {
+ console.warn('爱山东环境');
getUserInfo();
useUserStore().changMiniProgramAppStatus(false);
- } catch {
- console.log('不是爱山东平台,使用测试登陆');
+ return;
+ }
+ if (window.hh) {
+ console.warn('求职一体机环境');
+ useUserStore().logOutApp();
useUserStore().changMiniProgramAppStatus(true);
- useUserStore().initSeesionId(); //更新
- let token = uni.getStorageSync('token') || ''; // 同步获取 缓存信息
- if (token) {
- useUserStore()
- .loginSetToken(token)
- .then(() => {
- $api.msg('登录成功');
- });
- } else {
- safeReLaunch('/pages/login/login');
- // uni.redirectTo({
- // url: '/pages/login/login',
- // });
- }
+ useUserStore().changMachineEnv(true);
+ return;
+ }
+ // 正式上线去除此方法
+ console.warn('浏览器环境');
+ useUserStore().changMiniProgramAppStatus(true);
+ useUserStore().initSeesionId(); //更新
+ let token = uni.getStorageSync('token') || '';
+ if (token) {
+ useUserStore()
+ .loginSetToken(token)
+ .then(() => {
+ $api.msg('登录成功');
+ });
+ } else {
+ safeReLaunch('/pages/login/login');
}
});
@@ -110,15 +116,9 @@ function loginCallback(userInfo) {
.then((resume) => {
if (resume.data.jobTitleId) {
useUserStore().initSeesionId();
- // uni.reLaunch({
- // url: '/pages/index/index',
- // });
safeReLaunch('/pages/index/index');
} else {
safeReLaunch('/pages/login/login');
- // uni.redirectTo({
- // url: '/pages/login/login',
- // });
}
});
});
@@ -130,7 +130,6 @@ function loginCallback(userInfo) {
@import '@/common/animation.css';
@import '@/common/common.css';
-
/* 修改pages tabbar样式 H5才有效 */
.uni-tabbar .uni-tabbar__item:nth-child(4) .uni-tabbar__bd .uni-tabbar__icon {
width: 108rpx !important;
@@ -163,7 +162,6 @@ uni-modal,
z-index: 998;
}
-
@font-face {
font-family: DingTalk JinBuTi;
src: url('/static/font/DingTalk JinBuTi_min.woff2') format('woff2');
@@ -184,7 +182,7 @@ uni-modal,
@font-face {
font-family: DIN-Medium;
- src: url('https://qd.zhaopinzao8dian.com/file/csn/DIN-Medium.woff2') format('woff2');
+ src: url('./static/font/DIN-Medium.woff2') format('woff2');
font-display: swap;
}
diff --git a/config.js b/config.js
index 5da92a2..502066f 100644
--- a/config.js
+++ b/config.js
@@ -4,11 +4,12 @@ export default {
// baseUrl: 'http://192.168.3.29:8081',
// baseUrl: 'http://10.213.6.207:19010/api',
// 语音转文字
- // vioceBaseURl: 'wss://qd.zhaopinzao8dian.com/api/system/asr/connect', // 自定义
- vioceBaseURl: 'wss://fw.rc.qingdao.gov.cn/rgpp-api/api/system/asr/connect', // 内网
+ vioceBaseURl: 'wss://qd.zhaopinzao8dian.com/api/app/asr/connect', // 自定义
+ // vioceBaseURl: 'wss://fw.rc.qingdao.gov.cn/rgpp-api/api/app/asr/connect', // 内网
// 语音合成
- speechSynthesis: 'wss://qd.zhaopinzao8dian.com/api/speech-synthesis',
+ // speechSynthesis: 'wss://qd.zhaopinzao8dian.com/api/speech-synthesis',
speechSynthesis2: 'wss://resource.zhuoson.com/synthesis/', //直接替换即可
+ // speechSynthesis2: 'http://39.98.44.136:19527', //直接替换即可
// indexedDB
DBversion: 3,
// 只使用本地缓寸的数据
diff --git a/hook/piper-sdk.js b/hook/piper-sdk.js
index 17ab55a..e8921a3 100644
--- a/hook/piper-sdk.js
+++ b/hook/piper-sdk.js
@@ -8,11 +8,13 @@
export class PiperTTS {
constructor(config = {}) {
this.baseUrl = config.baseUrl || 'http://localhost:5001';
+ this.wsUrl = config.wsUrl || '/ws/synthesize'
this.audioCtx = config.audioCtx || new(window.AudioContext || window.webkitAudioContext)();
this.onStatus = config.onStatus || ((msg, type) => console.log(`[Piper] ${msg}`));
this.onStart = config.onStart || (() => {});
this.onEnd = config.onEnd || (() => {});
+
// 内部状态
this.ws = null;
this.nextTime = 0; // 下一段音频的预定播放时间
@@ -56,7 +58,7 @@ export class PiperTTS {
this.onStatus('正在建立连接...', 'processing');
try {
- const wsUrl = this.baseUrl.replace(/^http/, 'ws') + '/ws/synthesize';
+ const wsUrl = this.baseUrl.replace(/^http/, 'ws') + this.wsUrl;
this.ws = new WebSocket(wsUrl);
this.ws.binaryType = 'arraybuffer';
diff --git a/index.html b/index.html
index 0ea9071..0760052 100644
--- a/index.html
+++ b/index.html
@@ -22,17 +22,19 @@
-->
-
+
+
+
+
-
diff --git a/packageA/pages/post/post.vue b/packageA/pages/post/post.vue
index 86d82cb..10f5f48 100644
--- a/packageA/pages/post/post.vue
+++ b/packageA/pages/post/post.vue
@@ -168,7 +168,7 @@
立即前往
- 立即投递
+ 立即前往
@@ -185,7 +185,7 @@ import dictLabel from '@/components/dict-Label/dict-Label.vue';
import RadarMap from './component/radarMap.vue';
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
-const { isMiniProgram } = storeToRefs(useUserStore());
+const { isMiniProgram, hasLogin } = storeToRefs(useUserStore());
const { $api, navTo, getLenPx, parseQueryParams, navBack, isEmptyObject } = inject('globalFunction');
import config from '@/config.js';
@@ -252,7 +252,10 @@ function getDetail(jobId) {
const { latitude, longitude, companyName, companyId } = resData.data;
jobInfo.value = resData.data;
getCompanyIsAJobs(companyId);
- getCompetivetuveness(jobId);
+
+ if (hasLogin.value) {
+ getCompetivetuveness(jobId);
+ }
if (latitude && longitude) {
initMapCovers(latitude, longitude, companyName);
@@ -285,12 +288,12 @@ function getCompanyIsAJobs(...args) {
if (dataType.value === 2) {
// 第三方数据获取公司职位数量
const [gsID, gsmc, zphID] = args;
- const params={
+ const params = {
gsID,
gsmc,
- zphID
- }
- $api.createRequest(`/app/internal/jobThirdPart`,params).then((resData) => {
+ zphID,
+ };
+ $api.createRequest(`/app/internal/jobThirdPart`, params).then((resData) => {
companyCount.value = resData.total;
});
} else {
diff --git a/pages.json b/pages.json
index bab627a..cd14c31 100644
--- a/pages.json
+++ b/pages.json
@@ -281,7 +281,7 @@
// "enablePullDownRefresh": false,
// "navigationStyle": "custom",
"rpxCalcBaseDeviceWidth": 375,
- "rpxCalcMaxDeviceWidth": 1200,
+ "rpxCalcMaxDeviceWidth": 960,
"rpxCalcIncludeWidth": 750
},
"uniIdRouter": {}
diff --git a/pages/index/components/index-refactor.vue b/pages/index/components/index-refactor.vue
index d50b1b8..da8904d 100644
--- a/pages/index/components/index-refactor.vue
+++ b/pages/index/components/index-refactor.vue
@@ -259,7 +259,7 @@ const { $api, navTo, vacanciesTo, formatTotal, throttle } = inject('globalFuncti
import { onLoad, onShow } from '@dcloudio/uni-app';
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
-const { userInfo } = storeToRefs(useUserStore());
+const { userInfo, hasLogin } = storeToRefs(useUserStore());
import useDictStore from '@/stores/useDictStore';
const { getTransformChildren, oneDictData } = useDictStore();
import useLocationStore from '@/stores/useLocationStore';
@@ -316,6 +316,49 @@ const isLoaded = ref(false);
const colors = ['#0069FE', '#FF9400', '#FF6969', '#21EA85', '#87E2EC'];
+const occupations = [
+ '律师',
+ '工程师',
+ '医生',
+ '教师',
+ '设计师',
+ '程序员',
+ '会计师',
+ '建筑师',
+ '护士',
+ '销售',
+ '经理',
+ '顾问',
+ '分析师',
+ '研究员',
+ '编辑',
+ '记者',
+ '摄影师',
+ '厨师',
+ '司机',
+ '保安',
+ '客服',
+ '行政',
+ '人事',
+ '市场',
+ '运营',
+ '产品',
+ '测试',
+ '运维',
+ '前端',
+ '后端',
+ '全栈',
+ '数据',
+ '策划',
+ '导演',
+ '演员',
+ '歌手',
+ '作家',
+ '画家',
+ '翻译',
+ '导游',
+];
+
onMounted(() => {
let firstEntry = uni.getStorageSync('firstEntry') === false ? false : true; // 默认未读
maskFirstEntry.value = firstEntry;
@@ -323,17 +366,34 @@ onMounted(() => {
});
async function getMatchTags() {
- try {
- matchLoading.value = true;
- const { data } = await $api.createRequest('/app/user/getJobAdviceByResume');
- matchTags.value = data;
- matchLoading.value = false;
- } catch (err) {
- console.err('简历匹配职位获取失败');
- } finally {
+ if (hasLogin.value) {
+ try {
+ matchLoading.value = true;
+ const { data } = await $api.createRequest('/app/user/getJobAdviceByResume');
+ matchTags.value = data;
+ matchLoading.value = false;
+ } catch (err) {
+ console.error('简历匹配职位获取失败');
+ }
+ } else {
+ const vals = getRandomStrings(occupations).map((text) => ({
+ job_name: text,
+ score: 0,
+ }));
+ matchTags.value = vals;
}
}
+function getRandomStrings(arr, count = 10) {
+ const size = Math.min(arr.length, count);
+ const shuffled = [...arr];
+ for (let i = shuffled.length - 1; i > 0; i--) {
+ const j = Math.floor(Math.random() * (i + 1));
+ [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
+ }
+ return shuffled.slice(0, size);
+}
+
const checkStickyStatus = (e) => {
scrollTop.value = e.detail.scrollTop;
nextTick(() => {
diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue
index 36e8f70..eb03b2a 100644
--- a/pages/mine/mine.vue
+++ b/pages/mine/mine.vue
@@ -82,7 +82,7 @@
已开启
-
+ 退出登录
screenStore.isWideScreen,
(newVal) => {
- showTabbar.value = newVal
+ showTabbar.value = newVal;
},
{ immediate: true }
-)
-
-
+);
function logOut() {
popup.value.open();
diff --git a/static/font/DIN-Medium.woff2 b/static/font/DIN-Medium.woff2
new file mode 100644
index 0000000..fb53b47
Binary files /dev/null and b/static/font/DIN-Medium.woff2 differ
diff --git a/static/js/jsbridge.js b/static/js/jsbridge.js
new file mode 100644
index 0000000..aefedd8
--- /dev/null
+++ b/static/js/jsbridge.js
@@ -0,0 +1,69 @@
+(() => {
+ if (!/android/.test(navigator.userAgent.toLowerCase())) {
+ console.error("当前环境不支持WebView桥接通信, 请检查是否为安卓环境");
+ return
+ }
+ let bridge;
+ function setupWebViewJavascriptBridge(callback) {
+ return new Promise((reslove, reject) => {
+ if (window.WebViewJavascriptBridge) {
+ bridge = window.WebViewJavascriptBridge;
+ callback && callback()
+ reslove()
+ } else {
+ document.addEventListener(
+ "WebViewJavascriptBridgeReady",
+ function () {
+ bridge = window.WebViewJavascriptBridge;
+ callback && callback()
+ reslove()
+ },
+ false
+ );
+ }
+ })
+ }
+ let funcs = {}
+ setupWebViewJavascriptBridge(() => {
+ bridge.init()
+ bridge.registerHandler("ampeHHCommunication", (data) => {
+ console.log('[zyh][registerHandler]',data);
+ data = JSON.parse(data || '{}');
+ let eventName = data.eventName || '{}';
+ let eventData = JSON.parse(data.eventData || '{}');
+ if (funcs[eventName]) {
+ for (let callback of funcs[eventName]) {
+ callback({type: eventName, data: eventData})
+ }
+ }
+ });
+ })
+ window.hh = {
+ async call(funcName, params, callback) {
+ if (!bridge) {
+ await setupWebViewJavascriptBridge()
+ }
+ bridge.callHandler(funcName, params, callback);
+ },
+ async on(funcName, callback) {
+ if (funcs[funcName]) {
+ funcs[funcName].add(callback)
+ } else {
+ funcs[funcName] = new Set([callback])
+ }
+ },
+ off(funcName, callback) {
+ if (!funcs[funcName]) {
+ return false
+ }
+ if (!callback) {
+ return delete funcs[funcName]
+ }
+ let res = funcs[funcName].delete(callback)
+ if(funcs[funcName].size <= 0) {
+ delete funcs[funcName]
+ }
+ return res
+ }
+ };
+})();
diff --git a/stores/useUserStore.js b/stores/useUserStore.js
index d0d89d4..8ca5de9 100644
--- a/stores/useUserStore.js
+++ b/stores/useUserStore.js
@@ -59,6 +59,7 @@ const useUserStore = defineStore("user", () => {
const seesionId = ref('')
const counts = ref({})
const isMiniProgram = ref(false)
+ const isMachineEnv = ref(false)
const login = (value) => {
hasLogin.value = true;
@@ -84,6 +85,20 @@ const useUserStore = defineStore("user", () => {
});
}
+ const logOutApp = () => {
+ hasLogin.value = false;
+ token.value = ''
+ resume.value = {}
+ userInfo.value = {}
+ role.value = {}
+ uni.clearStorageSync('userInfo')
+ uni.clearStorageSync('token')
+ uni.switchTab({
+ url: '/pages/index/index',
+ });
+ }
+
+
const getUserInfo = () => {
return new Promise((reslove, reject) => {
createRequest('/getInfo', {}, 'get').then((userInfo) => {
@@ -145,6 +160,9 @@ const useUserStore = defineStore("user", () => {
isMiniProgram.value = val
}
+ function changMachineEnv(val) {
+ isMachineEnv.value = val
+ }
// 导入
return {
@@ -154,6 +172,7 @@ const useUserStore = defineStore("user", () => {
resume,
login,
logOut,
+ logOutApp,
loginSetToken,
getUserResume,
initSeesionId,
@@ -162,7 +181,9 @@ const useUserStore = defineStore("user", () => {
getUserstatistics,
counts,
isMiniProgram,
- changMiniProgramAppStatus
+ changMiniProgramAppStatus,
+ changMachineEnv,
+ isMachineEnv
}
}, {
unistorage: true,