|
|
|
|
@ -16,6 +16,38 @@ 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;
|
|
|
|
|
@ -77,6 +109,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
initWyyx() {
|
|
|
|
|
let that = this;
|
|
|
|
|
|
|
|
|
|
|