后退按钮测试

main
wangchenxing 3 months ago
parent 4fbfb1d9a8
commit 709a70c43d

@ -5,10 +5,10 @@ import plugins from './plugins' // plugins
import './permission' // permission import './permission' // permission
// 导入invite.js // 导入invite.js
import invite from './utils/invite' import invite from './utils/invite'
// import VConsole from 'vconsole'; import VConsole from 'vconsole';
// 初始化vConsole // 初始化vConsole
// const vConsole = new VConsole(); const vConsole = new VConsole();
// 安装插件全局弹窗 // 安装插件全局弹窗
Vue.use(invite) Vue.use(invite)
Vue.use(plugins) Vue.use(plugins)

@ -1,12 +1,12 @@
<template> <template>
<view class="zhuye"> <view class="zhuye">
<meta name="viewport" <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> <!-- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> -->
<LoadingPage :loading="loading"></LoadingPage> <LoadingPage :loading="loading"></LoadingPage>
<!-- // --> <!-- // -->
<u-navbar bgColor="#ffffff" :placeholder="true" titleStyle="font-weight:600" title="首页" :autoBack="true"> <u-navbar bgColor="#ffffff" :placeholder="true" titleStyle="font-weight:600" title="首页" :autoBack="false">
<template #left> <template #left>
<image src='../static/back.png' style="width: 36rpx;height: 36rpx;" @click="goback"> <image src='../static/back.png' style="width: 36rpx;height: 36rpx;" @click="goback">
</image> </image>
@ -263,7 +263,37 @@
}, },
methods: { methods: {
goback() { goback() {
this.$router.go(-2)
// this.$router.go(-3)
// window.history.back()
// window.JSBridge.exit();
//
const pages = getCurrentPages();
console.log(pages); //
// 1
if (pages.length > 1) {
// uni.navigateBack(1);
window.history.back();
console.log("pages.length",pages.length);
} else {
console.log('已经在首页,无法返回');
window.history.back();
console.log('已执行back');
// this.$router.go(-2)
// console.log('$router');
// uni.navigateBack(1);
// console.log('navigateBack');
// window.JSBridge.exit();
// console.log('exit');
// window.close();
// console.log('close');
}
}, },
getYanLian() { getYanLian() {
backlog().then(res => { backlog().then(res => {

@ -117,7 +117,10 @@ export default {
// //
decodeDes(message) { decodeDes(message) {
console.log('00'); const options = uni.getLaunchOptionsSync(); //
const fromPage = options.path; //
const params = options.query; // URL query
console.log('00+fromPage',fromPage);
console.log(message); console.log(message);
console.log('11'); console.log('11');
// //
@ -185,8 +188,8 @@ export default {
}, },
// //
async pwdLogin(cas) { async pwdLogin(cas) {
// this.loginForm.cas = cas; this.loginForm.cas = cas;
this.loginForm.cas = this.decodeDes(cas); // this.loginForm.cas = this.decodeDes(cas);
this.$store this.$store
.dispatch('Login', this.loginForm) .dispatch('Login', this.loginForm)
.then(() => { .then(() => {

@ -7,7 +7,9 @@
height: $u.addUnit($u.getPx(height) + $u.sys().statusBarHeight,'px'), height: $u.addUnit($u.getPx(height) + $u.sys().statusBarHeight,'px'),
}" }"
></view> ></view>
<view :class="[fixed && 'u-navbar--fixed']"> <view>
<!-- :class="[fixed && 'u-navbar--fixed']" -->
<u-status-bar <u-status-bar
v-if="safeAreaInsetTop" v-if="safeAreaInsetTop"
:bgColor="bgColor" :bgColor="bgColor"

Loading…
Cancel
Save