cyl/master-0804
jscyl13849007907 3 months ago
commit 5db7686772

@ -16,6 +16,37 @@ export default {
onLaunch() {
let that = this;
uni.removeStorageSync("selectedCity");
//
// uni.onBeforeAppRoute((res) => {
// console.log("setNavStyle", res);
// try {
// that.G.Post("/common/user/browsing/history/addRecord", { browsingUrl: res.path }, (res) => {});
// } catch (error) {
// console.log("error", error);
// }
// });
//
uni.addInterceptor("navigateTo", {
//
invoke(args) {
console.log("navigateTo 跳转前", args);
that.G.watchUserPage(args.url);
},
});
uni.addInterceptor("reLaunch", {
//
invoke(args) {
console.log("reLaunch 跳转前", args);
that.G.watchUserPage(args.url);
},
});
uni.addInterceptor("redirectTo", {
//
invoke(args) {
console.log("redirectTo 跳转前", args);
that.G.watchUserPage(args.url);
},
});
},
onShow: function (options) {
let that = this;
@ -47,14 +78,10 @@ export default {
this.G.checkToken();
}
if (!that.globalData.timer) {
if (uni.getStorageSync("apply-token")) {
that.checkNum();
}
that.globalData.timer = setInterval(() => {
console.log("inner+++++++++++++++++++++++++++++++++++++++++++++++");
if (uni.getStorageSync("apply-token")) {
that.checkNum();
}
}, 30 * 1000);
}

@ -352,6 +352,7 @@ export default {
this.agencyInfo = uni.getStorageSync("agencyInfo");
this.userInfo = uni.getStorageSync("apply-userinfo");
that.loadSelectedCityFromCache();
that.G.watchUserPage("pages/home/index");
}
},

@ -352,6 +352,7 @@ export default {
this.getCompanyInfo();
}
});
that.G.watchUserPage("pages/person/index");
// that.userInfo = uni.getStorageSync("apply-userinfo");
} else {
that.waitNum_ups = 0;

@ -203,6 +203,7 @@ export default {
this.getList();
}
this.getGZHInfo();
that.G.watchUserPage("pages/workBench/index");
},
onReachBottom() {
let that = this;

@ -1,13 +1,7 @@
// let ajaxUrl = "http://192.168.3.83:8001";
let ajaxUrl = "https://daotian.matripe.com.cn";
let requestTask;
let data = {
ajaxUrl: ajaxUrl,
startAbort($bool = 0) {
if ($bool == 1) {
requestTask.abort();
}
},
Get ($url = '', $parmas = {}, callback = () => { }, failback = () => { }) {
let that = this,
params = {};
@ -113,11 +107,7 @@ let data = {
}
}
console.log("公共参数,+++++", Object.assign($parmas, that.setPublicParams()));
uni.getNetworkType({
success: function(res) {
// console.log(res);
if (res.networkType != 'none') {
requestTask = uni.request({
uni.request({
url: ajaxUrl + $url,
data: Object.assign($parmas, that.setPublicParams()),
header: Object.assign($header, that.setPublicParams()),
@ -137,8 +127,7 @@ let data = {
failback(resData);
setTimeout(() => {
uni.reLaunch({
url: '/root/person/loginIndex?path=/' + that.getPathCopy().path + '&level=' +
that.getPathCopy().level
url: '/root/person/loginIndex?path=/' + that.getPathCopy().path + '&level=' + that.getPathCopy().level
});
}, 1500);
} else if (resData.status == 500 || resData.status == 502) {// 某种原因导致接口提示该状态码
@ -161,8 +150,7 @@ let data = {
});
setTimeout(() => {
uni.reLaunch({
url: '/root/person/loginIndex?path=/pages/home/index&level=' + that
.getPathCopy().level
url: '/root/person/loginIndex?path=/pages/home/index&level=' + that.getPathCopy().level
});
}, 1500);
} else {// 其他异常
@ -188,14 +176,6 @@ let data = {
failback(error);
}
});
} else {
uni.showToast({
title: '网络异常,请检查网络',
icon: "none"
})
}
},
});
},
// 头像上传
@ -231,6 +211,17 @@ let data = {
};
}
},
//监听用户的页面点击
watchUserPage (path) {
let that = this;
try {
if (uni.getStorageSync("apply-userinfo")) {
that.Post("/common/user/browsing/history/addRecord", { browsingUrl: path }, (res) => { });
}
} catch (error) {
console.log("error", error);
}
},
};
export default data;

@ -161,6 +161,8 @@ let data = {
/*
*/
setNavStyle ($form = 'default') {
console.log('into setNavStyle');
if ($form == 'home') {
uni.setNavigationBarColor({
backgroundColor: "#fff",
@ -1573,6 +1575,7 @@ let data = {
}
return str;
},
}
export default data;

Loading…
Cancel
Save