Commit 9dea7b8c by yuzhenWang

修复验证码冲刷新,协议重刷新

parent 5d2d57c0
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
import {baseURL,apiURL,cffpURL,companyInfo} from "@/environments/environment"; import {baseURL,apiURL,cffpURL,companyInfo} from "@/environments/environment";
import api from './api/api'; import api from './api/api';
export default { export default {
data() {
return {
invitationHandled: false // 在data中明确定义
}
},
onLaunch: function() { onLaunch: function() {
console.log('App Launch'); console.log('App Launch');
if(!uni.getStorageSync('loginType')){ if(!uni.getStorageSync('loginType')){
...@@ -99,10 +104,12 @@ ...@@ -99,10 +104,12 @@
const pages = getCurrentPages(); const pages = getCurrentPages();
if(pages.length > 0) { if(pages.length > 0) {
const currentRoute = pages[pages.length - 1].route; const currentRoute = pages[pages.length - 1].route;
console.log('currentRoute',currentRoute);
const whiteList = [ const whiteList = [
'/myPackageA/login/login', '/myPackageA/login/login',
'/pages/invitationRegister/invitationlogin', '/pages/invitationRegister/invitationlogin',
'/myPackageA/applyFranchise/applyFranchise', '/myPackageA/applyFranchise/applyFranchise',
'/pages/applyFranchise/applyFranchise',
'/myPackageA/ruleAndContract/clause', '/myPackageA/ruleAndContract/clause',
'/pages/courselist/courselist', '/pages/courselist/courselist',
'/pages/courseDetail/courseDetail', '/pages/courseDetail/courseDetail',
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
优质资源,专业服务 优质资源,专业服务
</view> </view>
</view> </view>
<!-- <resigter
:form="form"
:editNickName="editNickName"
:editMobile="editMobile"
@apply="gotoApply()"
/> -->
<view class="applyBox"> <view class="applyBox">
<view style="height: 550rpx;"> <view style="height: 550rpx;">
<view class="inputBox"> <view class="inputBox">
...@@ -109,6 +115,7 @@ ...@@ -109,6 +115,7 @@
</template> </template>
<script> <script>
import resigter from "./resigter.vue";
import everyJoinPopup from "@/components/commonPopup/everyJoinPopup.vue"; import everyJoinPopup from "@/components/commonPopup/everyJoinPopup.vue";
import api from '@/api/api'; import api from '@/api/api';
import * as environment from "@/environments/environment"; import * as environment from "@/environments/environment";
...@@ -116,7 +123,8 @@ ...@@ -116,7 +123,8 @@
import dataHandling from "@/util/dataHandling"; import dataHandling from "@/util/dataHandling";
export default { export default {
components:{ components:{
everyJoinPopup everyJoinPopup,
resigter
}, },
data() { data() {
return { return {
...@@ -159,7 +167,9 @@ ...@@ -159,7 +167,9 @@
uni.clearStorageSync() uni.clearStorageSync()
uni.setStorageSync('loginType', 'visitor') uni.setStorageSync('loginType', 'visitor')
} }
}, },
onShow(){ onShow(){
if(uni.getStorageSync('loginType')){ if(uni.getStorageSync('loginType')){
...@@ -183,10 +193,7 @@ ...@@ -183,10 +193,7 @@
if(!this.inviteUserId&&this.loginType == 'codelogin'&&!this.form.nickName){ if(!this.inviteUserId&&this.loginType == 'codelogin'&&!this.form.nickName){
this.queryInfo() this.queryInfo()
} }
// 邀请状态
// if(this.inviteUserId){
// this.getqueryById(this.shareId)
// }
}, },
methods: { methods: {
getqueryById(shareId){ getqueryById(shareId){
...@@ -221,6 +228,7 @@ ...@@ -221,6 +228,7 @@
c_agreeFlag(){ c_agreeFlag(){
this.agreeFlag=!this.agreeFlag; this.agreeFlag=!this.agreeFlag;
}, },
delayTime() { delayTime() {
this.disabledSendBtn = true; this.disabledSendBtn = true;
this.timer = setInterval(() => { this.timer = setInterval(() => {
...@@ -233,27 +241,27 @@ ...@@ -233,27 +241,27 @@
clearInterval(this.timer); clearInterval(this.timer);
} }
}, 1000); }, 1000);
},
sendMessage(){
const params = {
mobileNo:this.form.mobile,
type:"1",
source: "cffp"
}
if(common.mobileNoValid(this.form.mobile)){
if(!this.disabledSendBtn){
api.verificationCode(params).then((res)=>{
if(res['success']){
this.delayTime()
}else{
common.errorDialog(2,res['message'])
}
})
}
}else{
common.errorDialog(2,'请填写手机号')
}
}, },
sendMessage(){
const params = {
mobileNo:this.form.mobile,
type:"1",
source: "cffp"
}
if(common.mobileNoValid(this.form.mobile)){
if(!this.disabledSendBtn){
api.verificationCode(params).then((res)=>{
if(res['success']){
this.delayTime()
}else{
common.errorDialog(2,res['message'])
}
})
}
}else{
common.errorDialog(2,'请填写手机号')
}
},
gotoApply(){ gotoApply(){
if(!this.form.nickName){ if(!this.form.nickName){
common.errorDialog(1,'请输入昵称'); common.errorDialog(1,'请输入昵称');
......
<template>
<view class="">
11111
</view>
</template>
<script>
export default {
//项目中转页
onLoad(options){
if(options.invitationCode) {
uni.navigateTo({
url: `/myPackageA/applyFranchise/applyFranchise?shareId=${options.shareId}&invitationCode=${options.invitationCode}&inviteUserId=${options.inviteUserId}`
});
return;
}
}
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"softinputMode": "adjustResize" "softinputMode": "adjustResize"
} }
} }
}, { }, {
"path": "pages/product/product", "path": "pages/product/product",
"style": { "style": {
"navigationBarTitleText": "SFP", "navigationBarTitleText": "SFP",
...@@ -502,10 +502,7 @@ ...@@ -502,10 +502,7 @@
},{ },{
"path": "applyFranchise/applyFranchise", "path": "applyFranchise/applyFranchise",
"style": { "style": {
"navigationBarTitleText": "申请加盟", "navigationBarTitleText": "申请加盟"
"h5": {
"reload": false // 禁用自动重新加载
}
} }
},{ },{
"path": "integralExchange/exchange", "path": "integralExchange/exchange",
...@@ -540,10 +537,12 @@ ...@@ -540,10 +537,12 @@
},{ },{
"path": "ruleAndContract/clause", "path": "ruleAndContract/clause",
"style": { "style": {
"navigationBarTitleText": "协议", "navigationBarTitleText": "协议"
"h5": { }
"reload": false // 禁用自动重新加载 },{
} "path": "transformPage/transformPage",
"style": {
"navigationBarTitleText": "中转页"
} }
} }
] ]
......
import {apiURL,cffpURL} from "../environments/environment"; import {apiURL,cffpURL,sfpUrl} from "../environments/environment";
import api from "@/api/api"; import api from "@/api/api";
// 白名单,不需要携带token就允许被访问的接口 // 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`${apiURL}/authorize/obtainToken`, `${apiURL}/authorize/checkToken`, `${cffpURL}/user/loginVerification`,`${apiURL}/appVersion/checkIsUpdate`, const whiteApiList = [`${apiURL}/authorize/obtainToken`,
`${cffpURL}/accessLog/accessLogSave`,`${cffpURL}/user/powerQuery`,`${cffpURL}/user/wxLogin`,`${cffpURL}/certificate/officialWebsiteDetail`]; `${apiURL}/authorize/checkToken`,
`${cffpURL}/user/loginVerification`,
`${apiURL}/appVersion/checkIsUpdate`,
`${cffpURL}/accessLog/accessLogSave`,
`${cffpURL}/user/powerQuery`,`${cffpURL}/user/wxLogin`,
`${cffpURL}/certificate/officialWebsiteDetail`,
`${apiURL}/verificationCode`,
`${sfpUrl}/sfp/sfpMain/pocessTracking`,
`${cffpURL}/partner/queryById`,
];
export const interceptor = () => { export const interceptor = () => {
uni.addInterceptor('request', { uni.addInterceptor('request', {
// 请求拦截器 // 请求拦截器
......
...@@ -6,6 +6,7 @@ const whiteList = [ ...@@ -6,6 +6,7 @@ const whiteList = [
'/myPackageA/login/login', '/myPackageA/login/login',
'/pages/invitationRegister/invitationlogin', '/pages/invitationRegister/invitationlogin',
'/myPackageA/applyFranchise/applyFranchise', '/myPackageA/applyFranchise/applyFranchise',
'/pages/applyFranchise/applyFranchise',
'/myPackageA/ruleAndContract/clause', '/myPackageA/ruleAndContract/clause',
'/pages/orderDetail/orderDetail', '/pages/orderDetail/orderDetail',
'/pages/courseDetail/courseDetail', '/pages/courseDetail/courseDetail',
...@@ -16,15 +17,11 @@ const whiteList = [ ...@@ -16,15 +17,11 @@ const whiteList = [
export default function initApp(){ export default function initApp(){
let date = Date.now() let date = Date.now()
uni.addInterceptor('navigateTo', { uni.addInterceptor('navigateTo', {
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转 // 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke (e) { invoke (e) {
// 移除URL中的t_reload参数 console.log(e);
let url = e.url;
if(url.includes('t_reload=')) {
url = url.split('?')[0] + (url.includes('?') ? '?' : '') +
url.split('?')[1].split('&').filter(param => !param.startsWith('t_reload=')).join('&');
}
let pages = getCurrentPages() let pages = getCurrentPages()
let pagesLength = pages.length let pagesLength = pages.length
...@@ -44,7 +41,7 @@ export default function initApp(){ ...@@ -44,7 +41,7 @@ export default function initApp(){
uni.navigateTo({ uni.navigateTo({
url: '/myPackageA/login/login' url: '/myPackageA/login/login'
}) })
return return true
} }
// 保存用户得个人信息 // 保存用户得个人信息
if (res['success']) { if (res['success']) {
...@@ -68,8 +65,8 @@ export default function initApp(){ ...@@ -68,8 +65,8 @@ export default function initApp(){
return params.get(key); return params.get(key);
}; };
const fromParam = getQueryParam(url, 'from'); const fromParam = getQueryParam(e.url, 'from');
if(!hasPermission(url)){ if(!hasPermission(e.url)){
// 如果 from 参数在 whiteArr 中,说明是tabbar页带着tabbar的标志参数跳转到登录页,以便未登录状态下回到对应的tabbar页 // 如果 from 参数在 whiteArr 中,说明是tabbar页带着tabbar的标志参数跳转到登录页,以便未登录状态下回到对应的tabbar页
if (fromParam && whiteArr.includes(fromParam)) { if (fromParam && whiteArr.includes(fromParam)) {
uni.redirectTo({ uni.redirectTo({
......
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