Commit 0a2029eb by yuzhenWang

Merge branch 'feature-20250614-首页菜单优化' into 'uat'

Feature 20250614 首页菜单优化

See merge request !48
parents 74a52224 89bdd2d4
...@@ -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',
...@@ -284,7 +291,7 @@ ...@@ -284,7 +291,7 @@
} */ } */
/* iPad横屏 */ /* iPad横屏 */
@media (orientation: landscape) { @media (orientation: landscape) {
.container { .container {
max-width: 1024px; max-width: 1024px;
display: flex; display: flex;
......
...@@ -53,12 +53,12 @@ export default { ...@@ -53,12 +53,12 @@ export default {
// 加盟按钮文字 // 加盟按钮文字
joinText: { joinText: {
type: String, type: String,
default: '去加盟为合伙人' default: '我已知晓,继续分享'
}, },
// 继续按钮文字 // 继续按钮文字
continueText: { continueText: {
type: String, type: String,
default: '我已知晓,继续分享' default: '去加盟为合伙人'
}, },
// 是否展示icon // 是否展示icon
tipIcon: { tipIcon: {
...@@ -75,14 +75,14 @@ export default { ...@@ -75,14 +75,14 @@ export default {
close() { close() {
this.$refs.popup.close() this.$refs.popup.close()
}, },
// 点击加盟 // 点击继续
handleJoin() { handleJoin() {
this.$emit('join') this.$emit('continue')
this.close() this.close()
}, },
// 点击继续 // 点击加盟
handleContinue() { handleContinue() {
this.$emit('continue') this.$emit('join')
this.close() this.close()
} }
} }
......
...@@ -27,9 +27,16 @@ ...@@ -27,9 +27,16 @@
</view> </view>
</view> </view>
<view class="joinFotter"> <view class="joinFotter">
<view @click="handleContinue"> <view
{{ continueText }} v-if="showCanel"
</view> @click="handleCancel"
style="background-color: #FAFAFA;color: #333333;"
>
{{ cancelText }}
</view>
<view @click="handleContinue">
{{ continueText }}
</view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
...@@ -60,6 +67,11 @@ export default { ...@@ -60,6 +67,11 @@ export default {
type: String, type: String,
default: '前往首页' default: '前往首页'
}, },
// 暂不操作按钮文字
cancelText: {
type: String,
default: '暂不操作,继续浏览'
},
// 文字颜色 // 文字颜色
fontColor: { fontColor: {
type: String, type: String,
...@@ -68,6 +80,10 @@ export default { ...@@ -68,6 +80,10 @@ export default {
maskClick: { maskClick: {
type: Boolean, type: Boolean,
default: true default: true
},
showCanel: {
type: Boolean,
default: false
} }
}, },
methods: { methods: {
...@@ -86,9 +102,14 @@ export default { ...@@ -86,9 +102,14 @@ export default {
}, },
// 点击继续 // 点击继续
handleContinue() { handleContinue() {
this.$emit('continue') this.$emit('continue',1)
this.close() this.close()
} },
// 继续浏览
handleCancel(){
this.$emit('continue',2)
this.close()
}
} }
} }
</script> </script>
......
...@@ -450,7 +450,7 @@ ...@@ -450,7 +450,7 @@
}; };
</script> </script>
<style lang="less" scoped> <style lang="scss" scoped>
.signature-box { .signature-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
优质资源,专业服务 优质资源,专业服务
</view> </view>
</view> </view>
<view class="applyBox"> <view class="applyBox">
<view style="height: 550rpx;"> <view style="height: 550rpx;">
<view class="inputBox"> <view class="inputBox">
...@@ -92,18 +93,21 @@ ...@@ -92,18 +93,21 @@
<everyJoinPopup <everyJoinPopup
ref="everyJoinPopup" ref="everyJoinPopup"
@continue="jumpPage" @continue="jumpPage"
:showCanel="false"
/> />
<!-- 成功加盟为合伙人提示弹窗组件 --> <!-- 成功加盟为合伙人提示弹窗组件 -->
<everyJoinPopup <everyJoinPopup
ref="successJoinPopup" ref="successJoinPopup"
@continue="jumpPage()" @continue="jumpPage(e)"
content="您已加盟为银盾家办合伙人" content="您已加盟为银盾家办合伙人"
twoContent='购买一单"YD家庭财务法律卡"即可升级为新锐合伙人,享受组织利益' twoContent='购买一单"YD家庭财务法律卡"即可升级为新锐合伙人,享受组织利益'
continueText="前往购买" continueText="前往购买"
cancelText="暂不购买,继续浏览"
fontColor="#20279B" fontColor="#20279B"
:maskClick="false" :maskClick="false"
icon="icon-dianzan" icon="icon-dianzan"
iconSize='80rpx' iconSize='80rpx'
:showCanel="true"
/> />
</view> </view>
</template> </template>
...@@ -116,7 +120,7 @@ ...@@ -116,7 +120,7 @@
import dataHandling from "@/util/dataHandling"; import dataHandling from "@/util/dataHandling";
export default { export default {
components:{ components:{
everyJoinPopup everyJoinPopup,
}, },
data() { data() {
return { return {
...@@ -159,7 +163,9 @@ ...@@ -159,7 +163,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 +189,7 @@ ...@@ -183,10 +189,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){
...@@ -194,10 +197,13 @@ ...@@ -194,10 +197,13 @@
this.form.nickName = res.data.data.name this.form.nickName = res.data.data.name
this.form.mobile = res.data.data.mobileNumber this.form.mobile = res.data.data.mobileNumber
this.editNickName = this.editMobile = true this.editNickName = this.editMobile = true
if(res.data.data.isPartner){
this.$refs.successJoinPopup.open()
}
}) })
}, },
jumpPage(){ jumpPage(e){
// e===1时,前往购买;e===2暂不购买;目前全部跳转到首页,不进行判断
uni.switchTab({ uni.switchTab({
url:'/pages/index/index' url:'/pages/index/index'
}) })
...@@ -221,6 +227,7 @@ ...@@ -221,6 +227,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 +240,27 @@ ...@@ -233,27 +240,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,'请输入昵称');
......
...@@ -390,7 +390,7 @@ ...@@ -390,7 +390,7 @@
} }
.iconBox{ .iconBox{
border-radius: 15rpx; border-radius: 15rpx;
width: 20% !important; width: 400rpx !important;
} }
} }
.content{ .content{
......
...@@ -20,5 +20,8 @@ ...@@ -20,5 +20,8 @@
"echarts": "^5.4.1", "echarts": "^5.4.1",
"js-sha256": "^0.11.1", "js-sha256": "^0.11.1",
"nanoid": "^4.0.0" "nanoid": "^4.0.0"
},
"devDependencies": {
"less": "^4.3.0"
} }
} }
...@@ -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,12 +537,9 @@ ...@@ -540,12 +537,9 @@
},{ },{
"path": "ruleAndContract/clause", "path": "ruleAndContract/clause",
"style": { "style": {
"navigationBarTitleText": "协议", "navigationBarTitleText": "协议"
"h5": {
"reload": false // 禁用自动重新加载
}
} }
} },
] ]
},{ },{
"root": "officialWebsite", "root": "officialWebsite",
......
<template> <template>
<view class="container"> <!-- :style="{paddingTop: showFlag ? '0' : '60rpx'}" -->
<view class="homeHeader"> <view class="container" >
<view class="homeHeader" v-if="showFlag">
<view class="one"> <view class="one">
<text style="font-size: 80rpx;">01</text> <text style="font-size: 80rpx;">01</text>
<view class="titleTxt"> <view class="titleTxt">
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
</view> </view>
<view class="productBox"> <view class="productBox">
<view class="productList" :style="{marginTop}"> <view class="productList" :style="{marginTop}">
<view class="productItem" v-for="item in cffpCourseInfos" :key="item.fileId" > <view class="productItem" v-for="item in localCourseInfos" :key="item.fileId" >
<view class="top" @click="goDetail(item)"> <view class="top" @click="goDetail(item)">
<view class="left"> <view class="left">
<image class="productImg" :src="item.displayImage" alt="" mode="widthFix"></image> <image class="productImg" :src="item.displayImage" alt="" mode="widthFix"></image>
...@@ -115,6 +116,16 @@ ...@@ -115,6 +116,16 @@
import {nanoid} from 'nanoid'; import {nanoid} from 'nanoid';
export default{ export default{
name:'courselist', name:'courselist',
props:{
showFlag:{
type:Boolean,
default:true
},
cffpCourseInfos: {
type: Array,
default: () => []
}
},
components:{ components:{
courseItem, courseItem,
tabBar, tabBar,
...@@ -124,9 +135,18 @@ ...@@ -124,9 +135,18 @@
BootPage, BootPage,
PartnerTipPopup PartnerTipPopup
}, },
watch: {
// 监听 prop 变化,更新本地副本
cffpCourseInfos: {
immediate: true, // 立即执行一次
handler(newVal) {
this.localCourseInfos = [...newVal]; // 深拷贝(如果是简单数组,浅拷贝也行)
},
},
},
data(){ data(){
return{ return{
cffpCourseInfos:[], localCourseInfos: [], // 本地副本
currentPage:'courselist', currentPage:'courselist',
fileUploadItemCFFPList:[], fileUploadItemCFFPList:[],
queryName:null, queryName:null,
...@@ -155,6 +175,16 @@ ...@@ -155,6 +175,16 @@
} }
}, },
created(){
this.queryName = uni.getStorageSync('queryName') || '';
this.courseList();
// 初始化本地副本
this.localCourseInfos = [...this.cffpCourseInfos];
this.sourceType = uni.getStorageSync('addSystemType') || '1';
if(uni.getStorageSync('cffp_userInfo')){
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
}
},
computed:{ computed:{
marginTop(){ marginTop(){
if(this.env.device.isMobile){ if(this.env.device.isMobile){
...@@ -357,7 +387,7 @@ ...@@ -357,7 +387,7 @@
} }
api.courseList(param).then(res=>{ api.courseList(param).then(res=>{
if(res['success']){ if(res['success']){
this.cffpCourseInfos = res['data']['data']; this.localCourseInfos = res['data']['data']; // 修改本地副本
} }
}) })
}, },
...@@ -457,7 +487,6 @@ ...@@ -457,7 +487,6 @@
.productList{ .productList{
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
// margin-top: -2%;
background-color: #fff; background-color: #fff;
padding: 20rpx; padding: 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
...@@ -543,6 +572,12 @@ ...@@ -543,6 +572,12 @@
border: none; border: none;
} }
} }
/* 电脑端 */
@media (min-width: 768px) {
.productList{
// padding-top: 60rpx;
}
}
} }
.descriptionBox { .descriptionBox {
width: 510rpx; width: 510rpx;
...@@ -664,5 +699,46 @@ ...@@ -664,5 +699,46 @@
} }
} }
} }
.container {
padding-top: 60rpx;
.homeHeader {
padding-bottom: 100rpx;
position: relative;
z-index: 1;
}
.productBox {
position: relative;
z-index: 2;
.productList {
padding-top: 30rpx; // 改用padding-top
margin-top: 0;
.productItem {
&:first-child {
margin-top: 0;
}
}
}
}
}
/* iPad横屏特定适配 */
@media only screen
and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: landscape) {
.container {
.homeHeader {
padding-bottom: 120rpx;
}
.productBox {
.productList {
padding-top: 50rpx;
}
}
}
}
</style> </style>
\ No newline at end of file
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<view class="bottom"> <view class="bottom">
<view class="content"> <view class="content">
<view class="featureContent"> <view class="featureContent">
<!-- 顶部快捷菜单 -->
<view class="nav_wrapper"> <view class="nav_wrapper">
<view class="nav_content" v-for="featureItem in featureLists" :key="featureItem.key" <view class="nav_content" v-for="featureItem in featureLists" :key="featureItem.key"
@click="featureSelect(featureItem)"> @click="featureSelect(featureItem)">
...@@ -55,23 +56,29 @@ ...@@ -55,23 +56,29 @@
</view> --> </view> -->
<!-- 产品区域 --> <!-- 产品区域 -->
<view class="productBox"> <view class="productContainer">
<view class="productTitle"> <!-- <view class="productTitle">
<view class="titleTxt"> <view class="titleTxt">
<text style="font-size: 30rpx;font-weight: 500;">推荐产品</text> <text style="font-size: 30rpx;font-weight: 500;">推荐产品</text>
<text class="more" @click="goToCourselist()">更多 <text class="iconfont icon-youjiantou"></text> </text> <text class="more" @click="goToCourselist()">更多 <text class="iconfont icon-youjiantou"></text> </text>
</view> </view>
</view> </view> -->
<view class="productList" v-if="cffpCourseInfos.length>0"> <view class="productList" v-if="cffpCourseInfos.length>0">
<courselist :showFlag="false" :cffpCourseInfos="cffpCourseInfos"></courselist>
<view class="productListBox"> <view class="productListBox">
<view class="productListItem" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)">
<view class="top"> <!-- <view class="productListItem" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)"> -->
<image class="productImg" :src="item.displayImage" alt="" mode="widthFix"></image> <!-- <view class="top"> -->
<!-- <view class="shareBtn" @click.stop="shareProduct"> -->
<!-- 分享按钮 -->
<!-- <text class="iconfont icon-zhuanfa"></text><text>分享赚钱</text>
</view> -->
<!-- <image class="productImg" :src="item.displayImage" alt="" mode="widthFix"></image>
<view class="productDesBox"> <view class="productDesBox">
{{item.fileSynopsis}} {{item.fileSynopsis}}
</view> </view> -->
</view> <!-- </view> -->
<view class="bottom" style="text-align: left !important;"> <!-- <view class="bottom" style="text-align: left !important;">
<view class="one"> <view class="one">
{{item.fileTitle}} {{item.fileTitle}}
</view> </view>
...@@ -79,8 +86,8 @@ ...@@ -79,8 +86,8 @@
<text class="price" style="">{{item.coursePrice}}</text> <text class="price" style="">{{item.coursePrice}}</text>
<text v-if="Number(item.salesNumber)>0" class="num" >已售{{item.salesNumber}}</text> <text v-if="Number(item.salesNumber)>0" class="num" >已售{{item.salesNumber}}</text>
</view> </view>
</view> </view> -->
</view> <!-- </view> -->
</view> </view>
</view> </view>
<view class="productEmpty" v-else> <view class="productEmpty" v-else>
...@@ -215,29 +222,21 @@ ...@@ -215,29 +222,21 @@
x: 0, x: 0,
y: 0 y: 0
}, },
featureLists: [{ featureLists: [
key: '00',
name: '成交订单',
icon:'icon-dingdan',
link: '/pages/saleCourseLists/saleCourseLists',
isOpen: true,
enName:'order'
},
{
key: '01',
name: '佣金',
icon: 'icon-yongjin',
link: '/pages/pointsExchange/pointsExchange',
isOpen: true,
isJoin: true
},
{ {
key: '02', key: '02',
name: '申请加盟', name: '申请加盟',
icon: 'icon-hezuo', icon: 'icon-hezuo',
link: '/myPackageA/applyFranchise/applyFranchise', link: '/myPackageA/applyFranchise/applyFranchise',
isOpen: true, isOpen: true,
isApply:true, isApply:true
},
{
key: '07',
name: '分享产品',
icon: 'icon-zhuanfa',
link: '/pages/courselist/courselist',
isOpen: true,
}, },
{ {
...@@ -325,7 +324,13 @@ ...@@ -325,7 +324,13 @@
partnerType:res['data']['partnerType'], partnerType:res['data']['partnerType'],
nickName:res['data']['nickName'], nickName:res['data']['nickName'],
} }
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo)) uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo));
if(cffp_userInfo.partnerType){
this.featureLists = [{key: '00',name: '成交订单',icon:'icon-dingdan',link: '/pages/saleCourseLists/saleCourseLists',isOpen: true,enName:'order'},
{key: '01',name: '佣金',icon: 'icon-yongjin',link: '/pages/pointsExchange/pointsExchange',isOpen: true,isJoin: true},
{key: '07',name: '分享产品',icon: 'icon-zhuanfa',link: '/pages/courselist/courselist',isOpen: true},
{key: '04',name: '邀请加盟',icon: 'icon-yaoqing',link: '/pages/inviteJoin/inviteJoin',isOpen: true,isJoin: true}];
}
} }
}) })
...@@ -493,6 +498,7 @@ ...@@ -493,6 +498,7 @@
window.location.href = url; window.location.href = url;
// #endif // #endif
}, },
// 顶部菜单跳转
featureSelect(featureItem) { featureSelect(featureItem) {
if(uni.getStorageSync('cffp_userInfo')){ if(uni.getStorageSync('cffp_userInfo')){
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo')) this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
...@@ -506,9 +512,8 @@ ...@@ -506,9 +512,8 @@
'首页', '首页',
'pages/index/index' 'pages/index/index'
) )
uni.navigateTo({ uni.navigateTo({url: `${featureItem.link}`});
url: `${featureItem.link}`
});
return return
} }
...@@ -743,7 +748,7 @@ ...@@ -743,7 +748,7 @@
} }
} }
.productBox { .productContainer {
background-color: #fff; background-color: #fff;
margin-top: 15rpx; margin-top: 15rpx;
box-sizing: border-box; box-sizing: border-box;
...@@ -813,7 +818,22 @@ ...@@ -813,7 +818,22 @@
object-fit: cover; object-fit: cover;
display: block; display: block;
} }
.shareBtn{
position: absolute;
right: 0;
top: 0;
height: 50rpx;
color: red;
z-index: 1;
background-color: #F43530;
border-radius: 6rpx;
padding: 0 10rpx;
color: #fff;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.productDesBox { .productDesBox {
box-sizing: border-box; box-sizing: border-box;
position: absolute; position: absolute;
......
...@@ -535,9 +535,10 @@ ...@@ -535,9 +535,10 @@
.sendInvite { .sendInvite {
position: absolute; position: absolute;
left: 20vw; left: 0;
top: 80%; top: 80%;
width: 60vw; width: 60%;
transform: translateX(30%);
border-radius: 80rpx; border-radius: 80rpx;
background-color: #20269B; background-color: #20269B;
color: #fff; color: #fff;
......
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