首页优化

master
wangxia 2 months ago
parent c6ad4d573b
commit 6de3529fa4

@ -215,21 +215,21 @@ export default {
uni.showShareMenu({ uni.showShareMenu({
shareTypes: "normal", shareTypes: "normal",
}); });
this.getLocation().then(() => { // this.getLocation().then(() => {
// console.log("that.currentInfo", that.currentInfo); // // console.log("that.currentInfo", that.currentInfo);
if (that.currentInfo.longitude) { // if (that.currentInfo.longitude) {
that.G.Get(that.api.getCityNameByLatLng, { lng: that.currentInfo.longitude, lat: that.currentInfo.latitude }, (res) => { // that.G.Get(that.api.getCityNameByLatLng, { lng: that.currentInfo.longitude, lat: that.currentInfo.latitude }, (res) => {
// console.log("res", res); // // console.log("res", res);
if (res) { // if (res) {
let currentCity = res.replace("市", ""); // let currentCity = res.replace("", "");
uni.setStorageSync("selectedCity", currentCity); // uni.setStorageSync("selectedCity", currentCity);
uni.$emit("setCity"); // uni.$emit("setCity");
} // }
}); // });
} else { // } else {
uni.$emit("setCity"); // uni.$emit("setCity");
} // }
}); // });
// // // //
// uni.hideTabBar(); // uni.hideTabBar();
}, },

@ -256,32 +256,52 @@ export default {
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);
that.loadSelectedCityFromCache(); // that.loadSelectedCityFromCache();
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) {
let notice = uni.getStorageSync("miniApp-info").notice; // let notice = uni.getStorageSync("miniApp-info").notice;
var reg = /[\r\n]/g; // var reg = /[\r\n]/g;
notice = notice.replace(reg, ""); // notice = notice.replace(reg, "");
that.noticList = []; // that.noticList = [];
// that.noticList = notice; // // that.noticList = notice;
that.noticList.push(notice); // that.noticList.push(notice);
that.showNotic = "play"; // that.showNotic = "play";
} // }
console.log("that.noticList", that.noticList); // console.log("that.noticList", that.noticList);
}, 100); // }, 100);
}); // });
that.isShowTab = true; // that.isShowTab = true;
}); // });
// });
// }
that.isCheckShare(() => {
that.getList().then(() => {
that.showNotic = "paused";
console.log("that.showNotic1", that.showNotic);
that.getJobNum();
setTimeout(() => {
if (uni.getStorageSync("miniApp-info").notice) {
let notice = uni.getStorageSync("miniApp-info").notice;
var reg = /[\r\n]/g;
notice = notice.replace(reg, "");
that.noticList = [];
// that.noticList = notice;
that.noticList.push(notice);
that.showNotic = "play";
}
console.log("that.noticList", that.noticList);
}, 100);
}); });
} that.isShowTab = true;
});
}, },
onShow() { onShow() {
let that = this; let that = this;

Loading…
Cancel
Save