master
wangxia 2 months ago
parent 2e9c25a57e
commit c6ad4d573b

@ -255,7 +255,7 @@ export default {
that.query.page = 1; that.query.page = 1;
this.isLogin = uni.getStorageSync("apply-userinfo") ? true : false; this.isLogin = uni.getStorageSync("apply-userinfo") ? true : false;
this.query.size = this.isLogin ? 50 : 20; this.query.size = this.isLogin ? 50 : 20;
// ,
if (!sceneInfo.query.cityInfo) { if (!sceneInfo.query.cityInfo) {
uni.$on("setCity", () => { uni.$on("setCity", () => {
that.G.startAbort(1); that.G.startAbort(1);
@ -263,7 +263,7 @@ export default {
that.isCheckShare(() => { that.isCheckShare(() => {
that.getList().then(() => { that.getList().then(() => {
that.showNotic = "paused"; that.showNotic = "paused";
// console.log("that.showNotic1", that.showNotic); console.log("that.showNotic1", that.showNotic);
that.getJobNum(); that.getJobNum();
setTimeout(() => { setTimeout(() => {
if (uni.getStorageSync("miniApp-info").notice) { if (uni.getStorageSync("miniApp-info").notice) {
@ -283,6 +283,39 @@ export default {
}); });
} }
}, },
onShow() {
let that = this;
that.loadSelectedCityFromCache().then(() => {
this.getList();
});
// miniApp-infoAPI
let miniAppInfo = uni.getStorageSync("miniApp-info");
if (!miniAppInfo || Object.keys(miniAppInfo).length === 0) {
// API
this.G.Get("/yishoudan/agency/getInfo", {}, (res) => {
let obj = { ...res.agency, ...res.weixinConfig };
for (let key in obj) {
if (typeof obj[key] == "string" && obj[key].indexOf("http://") > -1) {
obj[key] = obj[key].replace("http:", "https:");
}
}
uni.setStorageSync("miniApp-info", obj);
this.appInfo = obj;
uni.setStorageSync("pgy-agency-id", res.agency.id);
uni.setStorageSync("ai-name", res.agency.aiRobotName);
uni.setStorageSync("ai-logo", res.agency.aiLogo);
});
} else {
// 使
this.appInfo = miniAppInfo;
}
// setTimeout(() => {
// that.appInfo = uni.getStorageSync("miniApp-info");
// }, 100);
},
data() { data() {
return { return {
hrtext: 2, hrtext: 2,
@ -420,37 +453,7 @@ export default {
isshowskit: false, isshowskit: false,
}; };
}, },
onShow() {
let that = this;
that.loadSelectedCityFromCache();
// miniApp-infoAPI
let miniAppInfo = uni.getStorageSync("miniApp-info");
if (!miniAppInfo || Object.keys(miniAppInfo).length === 0) {
// API
this.G.Get("/yishoudan/agency/getInfo", {}, (res) => {
let obj = { ...res.agency, ...res.weixinConfig };
for (let key in obj) {
if (typeof obj[key] == "string" && obj[key].indexOf("http://") > -1) {
obj[key] = obj[key].replace("http:", "https:");
}
}
uni.setStorageSync("miniApp-info", obj);
this.appInfo = obj;
uni.setStorageSync("pgy-agency-id", res.agency.id);
uni.setStorageSync("ai-name", res.agency.aiRobotName);
uni.setStorageSync("ai-logo", res.agency.aiLogo);
});
} else {
// 使
this.appInfo = miniAppInfo;
}
// setTimeout(() => {
// that.appInfo = uni.getStorageSync("miniApp-info");
// }, 100);
},
onReachBottom() { onReachBottom() {
let that = this; let that = this;
if (!uni.getStorageSync("apply-token") && that.tabInfo.active == 1) { if (!uni.getStorageSync("apply-token") && that.tabInfo.active == 1) {
@ -465,10 +468,14 @@ export default {
loadSelectedCityFromCache() { loadSelectedCityFromCache() {
// 'selectedCity' // 'selectedCity'
const cachedCity = uni.getStorageSync("selectedCity"); const cachedCity = uni.getStorageSync("selectedCity");
console.log("this.selectedCity", this.selectedCity);
console.log("this.selectedCity", cachedCity);
if (cachedCity && this.selectedCity != cachedCity) { if (cachedCity && this.selectedCity != cachedCity) {
this.selectedCity = cachedCity; this.selectedCity = cachedCity;
this.getList();
} }
return new Promise((reso, rej) => {
reso();
});
}, },
checkScroll() { checkScroll() {
let that = this; let that = this;
@ -617,7 +624,7 @@ export default {
} else { } else {
that.tabInfo.active = 1; that.tabInfo.active = 1;
} }
console.log('that.tabInfo.active',that.tabInfo.active); console.log("that.tabInfo.active", that.tabInfo.active);
callback(); callback();
}); });
}, },
@ -663,6 +670,7 @@ export default {
if ($type == "initall") { if ($type == "initall") {
_url = that.api.yi_job_list; _url = that.api.yi_job_list;
} else { } else {
console.log(" that.useshare", that.useshare);
if (that.tabInfo.active == 1 && that.useshare) { if (that.tabInfo.active == 1 && that.useshare) {
_url = that.api.job_share; _url = that.api.job_share;
} else { } else {

Loading…
Cancel
Save