Commit 3b08473e by sunchao

relaunch改成redirectTo

parent 1b76257f
......@@ -16,7 +16,7 @@
<input class="uni-input" name="invitationCode" placeholder="输入邀请码(非必填)" v-model="invitation_code"/>
</view> -->
<view class="inputItem" v-if="loginType!=='agentlogin'">
<input class="uni-input" name="mobileNo" placeholder="输入手机号" v-model="form.mobile" maxlength="11"/>
<input type="number" class="uni-input" name="mobileNo" placeholder="输入手机号" v-model="form.mobile" maxlength="11"/>
</view>
<view class="inputItem" v-if="loginType==='agentlogin'">
<input class="uni-input" name="mobileNo" placeholder="输入账号" v-model="form.account" maxlength="11"/>
......@@ -155,16 +155,22 @@
}
api.loginVerification(params).then((res)=>{
if(res['success']){
console.log(1)
this.userId = String(res['data']['userId']);
uni.setStorageSync('isLogin','1')
uni.setStorageSync('isLogin','1');
uni.setStorageSync('cffp_userId',this.userId);
uni.setStorageSync('loginType',this.loginType)
// uni.navigateTo({
// url:'/pages/index/index'
// })
console.log(2)
// uni.switchTab({
// url: '/pages/courselist/courselist'
// })
uni.switchTab({
url: '/pages/index/index'
url:'/pages/index/index'
})
console.log(3)
}else{
uni.showToast({
title: res['message'],
......
......@@ -48,16 +48,12 @@
}else{
//有参数就掉查询否则直接跳转到课程列表页
if(this.queryName){
// this.$emit("send",this.queryName)
uni.navigateTo({
url:`/pages/courselist/courselist?queryName=${this.queryName}`
})
}else{
uni.setStorageSync('queryName',this.queryName)
}
uni.switchTab({
url:'/pages/courselist/courselist'
})
}
}
}
},
......
......@@ -270,14 +270,9 @@
}
},
goBack() {
let back = getCurrentPages();
if (back && back.length > 1) {
uni.navigateBack({
delta: 1
});
} else {
history.back();
}
},
// 监听空白关闭
maskClick(val) {
......
<template>
<view :class="{pad:onlyShowList!=0}">
<view class="pad">
<!--搜索组件-->
<search :isSearch="1" v-if="onlyShowList!=0" @send="getCourseList"></search>
<search :isSearch="1" @send="getCourseList"></search>
<!--轮播组件-->
<carousel :carouselList="fileUploadItemCFFPList" v-if="onlyShowList!=0"></carousel>
<carousel :carouselList="fileUploadItemCFFPList"></carousel>
<h4 v-if="cffpCourseInfos.length<=0" class="noListTip">暂无课程列表</h4>
<view class="ulBox" v-if="cffpCourseInfos.length>0">
<view class="liBox" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)">
......@@ -21,7 +21,7 @@
import carousel from '@/components/carousel/carousel.vue';
import search from '@/components/search/search.vue';
export default{
props:['tagIds','onlyShowList'],
props:['tagIds'],
data(){
return{
cffpCourseInfos:[],
......@@ -37,9 +37,9 @@
carousel,
search
},
onLoad(options){
onLoad(){
this.fileUploadItemCFFPList = uni.getStorageSync('fileUploadItemCFFPList');
this.queryName = options.queryName;
this.queryName = uni.getStorageSync('queryName');
},
methods:{
goDetail(item){
......@@ -78,6 +78,9 @@
},
mounted() {
this.courseList();
},
onHide() {
uni.removeStorageSync('queryName')
}
}
</script>
......
......@@ -163,7 +163,7 @@
search,
courseItem
},
onLoad(options) {
onLoad() {
if (uni.getStorageSync('isLogin')) {
this.queryAreaCenterInfo();
this.announcementQuery();
......@@ -173,6 +173,7 @@
})
}
this.courseList()
},
onShow() {
let loginType = uni.getStorageSync('loginType')
......@@ -217,7 +218,7 @@
duration: 2000,
icon: 'none'
});
uni.reLaunch({
uni.redirectTo({
url:'/components/login/login'
})
return false
......@@ -304,14 +305,11 @@
})
},
onChange: function(e) {
console.log(e)
this.old.x = e.detail.x
this.old.y = e.detail.y
}
},
mounted() {
}
}
</script>
......
......@@ -40,6 +40,9 @@
created() {
},
destroyed() {
uni.hideToast();
},
methods:{
getFile(type){
uni.navigateTo({
......
......@@ -36,6 +36,9 @@
codetimecode: false
}
},
destroyed() {
uni.hideToast();
},
methods: {
sendMessage() {
const params = {
......@@ -76,7 +79,7 @@
icon: 'none'
})
uni.removeStorageSync('isLogin')
uni.reLaunch({
uni.redirectTo({
url:'/components/login/login'
})
//重置密码后需要密码登录
......
......@@ -170,10 +170,15 @@
duration: 2000,
icon: 'none'
});
uni.reLaunch({
uni.redirectTo({
url:'/components/login/login'
})
try {
uni.clearStorageSync();
} catch (e) {
// console.log(e)
// error
}
return false
},
// 菜单跳转页面
......
......@@ -38,9 +38,12 @@
let dataForm = uni.getStorageSync('userinfodataForm')
this.mobile = dataForm.mobile
},
destroyed() {
uni.hideToast();
},
methods: {
cancel(){
uni.navigateBack(1)
uni.navigateBack({delta:1})
},
sunmit(){
api.cancellation({userId: this.userId}).then(res =>{
......@@ -49,7 +52,7 @@
title: '操作成功',
icon: 'none'
});
uni.reLaunch({
uni.redirectTo({
url:'/components/login/login'
})
}
......
......@@ -31,6 +31,9 @@
mounted() {
console.log(this.minorMenuLists, 7412)
},
destroyed() {
uni.hideToast();
},
methods: {
goDetail(item) {
console.log(item, 844)
......
......@@ -48,6 +48,9 @@ import MenuList from "@/components/menuList/menuList.vue"
]
}
},
destroyed() {
uni.hideToast();
},
methods:{
outLing(){
uni.showModal({
......@@ -56,10 +59,16 @@ import MenuList from "@/components/menuList/menuList.vue"
showCancel: true,
success: function(res) {
if (res.confirm) {
uni.reLaunch({
console.log(getCurrentPages().length)
uni.redirectTo({
url:'/components/login/login'
})
try {
uni.clearStorageSync();
} catch (e) {
console.log(e)
// error
}
uni.showToast({
title: '操作成功',
icon: 'none'
......
......@@ -12,7 +12,7 @@ export default function initApp(){
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke (e) {
if(!hasPermission(e.url)){
uni.reLaunch({
uni.redirectTo({
url: '/components/login/login'
})
return false
......@@ -27,7 +27,7 @@ export default function initApp(){
// tabbar页面跳转前进行拦截
invoke (e) {
if(!hasPermission(e.url)){
uni.reLaunch({
uni.redirectTo({
url: '/components/login/login'
})
return false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment