Commit 9f6abe71 by yuzhenWang

Merge branch 'feature-20250731wyz-修改bug' into 'uat'

Feature 20250731wyz 修改bug

See merge request !63
parents ae1170b8 4f69162c
<script>
import initApp from "@/util/router.js";
import {interceptor} from "@/util/interceptor";
import {baseURL,apiURL,cffpURL,companyInfo} from "@/environments/environment";
import api from './api/api';
import {hshare} from '@/util/fiveshare';
export default {
data() {
return {
invitationHandled: false // 在data中明确定义
invitationHandled: false ,// 在data中明确定义,
dataToken:'',
}
},
onLaunch: function() {
console.log('App Launch');
if(!uni.getStorageSync('loginType')){
console.log('走进来了');
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor');
}
// 处理外部链接参数
......@@ -79,8 +80,36 @@
onShow: function(options) {
console.log('App Show', options);
// 每次进应用显示时检查用户状态
this.checkUserStatus();
if(this.dataToken){
const params = {
loginType:'5',
authToken:this.dataToken.replace(/\%/g, ' ')
// authToken:'zuihuibi eyJhbGciOiJIUzUxMiJ9.eyJVc2VySWQiOjEyODMsImNyZWF0ZWQiOjE3NTQ2NDk1MDA5NzIsImV4cCI6MTc1NzI0MTUwMH0.udjBlMY4FswgBU7zv9jD-zK8ANGR1KKXk_DiJEQkwhiC9DYwxAc7wAp6BWIKY_oiNr58QJqDtBAJ85bGOcCpeQ'
}
api.loginVerification(params).then((res)=>{
if(res['success']){
uni.setStorageSync('isLogin','1');
uni.setStorageSync('loginType','codelogin');
uni.setStorageSync('cffp_userId', res.data.userId);
uni.setStorageSync('uni-token', res.data['token']);
this.checkUserStatus();
}else{
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
return
}else {
// 每次进应用显示时检查用户状态
this.checkUserStatus();
}
// App平台从options获取参数
// #ifdef APP-PLUS
if(options && options.query) {
......@@ -92,7 +121,8 @@
console.log('App Hide')
},
methods: {
// 检查用户状态的方法
// 检查用户状态的方法 防止多端操作导致此用户不存在
async checkUserStatus() {
// 只有已登录用户才需要检查
if(uni.getStorageSync('loginType') == 'codelogin' && uni.getStorageSync('cffp_userId')) {
......@@ -128,15 +158,12 @@
}
}
if (res['success']) {
delete res.data.commonResult
const cffp_userInfo = {
name: res['data']['realName'],
mobile: res['data']['mobile'],
partnerType:res['data']['partnerType'],
nickName:res['data']['nickName'],
levelCode:res['data']['levelCode'],
...res.data
}
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo))
uni.setStorageSync('userinfodataForm', res.data);
}
} catch (err) {
console.error('检查用户状态失败:', err);
......@@ -148,7 +175,7 @@
},
// 清除登录状态
clearLoginState() {
uni.clearStorageSync();
// uni.clearStorageSync();
uni.setStorageSync('loginType', 'visitor');
this.checkToken()
// 可以在这里添加其他需要清除的状态
......@@ -238,6 +265,17 @@
// 使用uni.setStorageSync存储到本地
try {
// #ifdef H5
if(params.dataToken){
this.dataToken = params.dataToken
}
// #endif
// #ifdef MP-WEIXIN
if(params.dataToken){
this.dataToken = uni.getStorageSync('hoservice_token')
}
// #endif
if(params.addSystemType){
uni.setStorageSync('addSystemType', params.addSystemType);
}
......
......@@ -29,7 +29,7 @@
<image style="width: 80rpx;height: 80rpx;" src="../../static/Slice3.png" mode=""></image>
</view>
</view>
<restrictedTip ref="restrictedTip"/>
</view>
</template>
......@@ -38,6 +38,7 @@
import common from '../../common/common';
import {companyInfo} from "@/environments/environment";
import dataHandling from "@/util/dataHandling";
import restrictedTip from '@/components/commonPopup/restrictedTip.vue'
export default {
props:{
wayType:{
......@@ -47,8 +48,15 @@
// 哪个地方中用到了这个登录
loginSource:{
type:String,
},
// 哪个页面中用到了这个登录
pageSource:{
type:String,
}
},
components:{
restrictedTip
},
data() {
return {
agreeFlag:false,
......@@ -132,6 +140,11 @@
}
api.loginVerification(params).then((res)=>{
if(res['success']){
// 禁用账号,不让登录
if(res.data.userIsActive == 2){
this.$refs.restrictedTip.open()
return
}
this.userId = String(res['data']['userId']);
uni.setStorageSync('isLogin','1');
uni.setStorageSync('loginType','codelogin');
......@@ -140,7 +153,7 @@
this.loginTypeSync = "codelogin";
this.queryInfo()
uni.$emit('loginUpdate');
this.$emit('afterLogin')
}else{
uni.showToast({
title: res['message'],
......@@ -170,12 +183,9 @@
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
if (res['success']) {
delete res.data.commonResult
const cffp_userInfo = {
name: res['data']['realName'],
mobile: res['data']['mobile'],
partnerType:res['data']['partnerType'],
nickName:res['data']['nickName'],
levelCode:res['data']['levelCode'],
...res.data
}
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo))
this.closebootpage()
......
<template>
<uni-popup ref="popup" type="center" background-color="#fff" v-if="visible">
<!-- 你的弹窗内容 -->
<view class="joinContent">
<view class="title">{{ title }}</view>
<view class="joinHeader" >
<view class="iconfont icon-exclamation" ></view>
</view>
<view class="joinCon">
<view class="one">{{ content }}</view>
<view class="qrCode" v-if="showCode">
<image src="@/static/images/customer.jpg" mode="widthFix"></image>
</view>
</view>
<view class="joinFotter">
<view @click="handleConfirm">{{ confirmText }}</view>
</view>
</view>
</uni-popup>
</template>
<script>
import {shareURL} from "@/environments/environment";
export default {
name: 'restrictedTip',
props: {
title: String,
content: {
type: String,
default: '您的账号处在不可用状态,请扫码添加客服咨询情况'
},
showCode: {
type: Boolean,
default: true
},
confirmText: {
type: String,
default: '我知道了'
}
},
data() {
return {
visible: false
}
},
methods: {
open() {
this.visible = true
this.$nextTick(() => {
this.$refs.popup.open() // 确保DOM渲染后再打开
})
},
close() {
this.visible = false
},
handleConfirm() {
this.close()
this.$emit('confirm')
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .uni-popup .uni-popup__wrapper{
margin: 0 !important;
border-radius: 30rpx;
}
.joinContent {
width: 550rpx;
border-radius: 30rpx;
background-color: #ffff;
padding: 30rpx;
box-sizing: border-box;
display: flex;
align-items: center;
flex-direction: column;
.title{
text-align: center;
width: 100%;
}
.joinHeader {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
background: #FFC300;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20rpx;
.icon-exclamation{
color: #fff;
font-size: 30rpx;
}
}
.joinCon {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 10rpx;
box-sizing: border-box;
.one {
font-size: 28rpx;
color: #F43530;
text-align: center;
margin-bottom: 10rpx;
}
.qrCode{
width: 50%;
image{
width: 100rpx;
}
}
.two {
color: rgba(145, 144, 148, 1);
font-size: 26rpx;
text-align: center;
margin-top: 10rpx;
margin-bottom: 20rpx;
}
}
.joinFotter {
width: 100%;
color: #fff;
display: flex;
align-items: center;
flex-direction: column;
box-sizing: border-box;
font-size: 26rpx;
view {
width: 80%;
background: rgba(54, 57, 169, 1);
border-radius: 40rpx;
padding: 20rpx;
text-align: center;
margin-top: 20rpx;
}
}
.horizontal{
flex-direction: row;
justify-content: space-between;
view{
width: auto;
border-radius:15rpx;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="wrapper">
<restrictedTip ref="restrictedTip"/>
<view v-if="loginType=='resetpw' || goBack" @click="rpsdlogin()" class="psdlogin">
<view class="iconfont icon-youjiantou zuojiantou" style="top:18rpx;color: #fff;"></view>
<!-- <image style="width: 40rpx;height: 40rpx;" src="../../static/rpsloging.png" mode=""></image> -->
......@@ -183,7 +184,7 @@
uni.setStorageSync('cffp_userId',this.userId);
uni.setStorageSync('loginType',this.loginType);
uni.setStorageSync('uni-token', res.data['token']);
uni.setStorageSync('isPartner', res.data['isPartner']); //是否是合伙人
if(urlType == 'personalCenter'){
uni.switchTab({
url:'/pages/personalCenter/personalCenter'
......
......@@ -16,16 +16,27 @@
</view>
</view>
</view>
<restrictedTip
ref="restrictedOrCanelTip"
:showCode="false"
confirmText="知道了"
content="您已解约,无需重复操作"
@confirm="$refs.restrictedOrCanelTip.close()"
/>
</view>
</template>
<script>
import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
export default {
props: {
menuList: {
type: Array
}
},
components:{
restrictedTip
},
data() {
return {}
},
......@@ -50,7 +61,14 @@
}
}
});
} else if (item.link != null) {
} else if (item.isJump) {
console.log('333333',item)
this.$refs.restrictedOrCanelTip.open()
// uni.navigateTo({
// url: item.link
// });
return
}else if (item.link != null) {
uni.navigateTo({
url: item.link
});
......
import App from './App';
// #ifndef VUE3
import Vue from 'vue'
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// // #ifndef VUE3
// import Vue from 'vue'
// App.mpType = 'app'
// const app = new Vue({
// ...App
// })
// app.$mount()
// // #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
......@@ -22,3 +23,5 @@ export function createApp() {
//#ifdef H5
window.sessionStorage.setItem('firstEntryUrl',window.location.href.split('#')[0])
// #endif
<template>
<view class="container">
<!-- 禁用弹窗 -->
<restrictedTip
ref="restrictedOrCanelTip"
:showCode="showCode"
confirmText="前往首页"
:content="restrictedOrCanelContent"
@confirm="gotoIndex()"
/>
<image
class="imgbox"
:src="baseURL + `/${imgType}/static/images/applyBg.png`"
......@@ -29,7 +37,6 @@
type="text"
placeholder="请输入2~10个字符"
v-model="form.nickName"
:disabled="editNickName"
/>
</view>
</view>
......@@ -119,9 +126,11 @@
import common from '@/common/common';
import dataHandling from "@/util/dataHandling";
import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
export default {
components:{
everyJoinPopup,
restrictedTip
},
data() {
return {
......@@ -147,6 +156,9 @@
editMobile:false,
shareId:'',//邀请人分享得id
invitationCode:'',//邀请码
showCode:false ,//弹窗是否展示客服二维码
restrictedOrCanelContent:'', //禁用/注销展示文本
sharePosterObj:{invitationCode:'',inviteUserId:''},//通过分享海报进来
}
},
onLoad(options){
......@@ -161,20 +173,20 @@
if(options.shareId){
this.shareId = options.shareId
this.getqueryById(options.shareId)
uni.clearStorageSync()
// uni.clearStorageSync()
uni.setStorageSync('loginType', 'visitor')
}
},
onShow(){
if(uni.getStorageSync('loginType')){
this.loginType = uni.getStorageSync('loginType')
}
if(uni.getStorageSync('cffp_userInfo')){
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
}
console.log('show',this.userInfo)
if(uni.getStorageSync('cffp_userId')){
this.userId = uni.getStorageSync('cffp_userId')
}
......@@ -183,12 +195,12 @@
this.checkToken()
}
// 非邀请状态
if(!this.inviteUserId&&this.loginType == 'codelogin'&&this.userInfo.mobile){
if(!this.shareId&&this.loginType == 'codelogin'&&this.userInfo.mobile){
this.form.mobile = this.userInfo.mobile
this.editMobile = true
}
// 非邀请状态
if(!this.inviteUserId&&this.loginType == 'codelogin'&&!this.form.nickName){
if(!this.shareId&&this.loginType == 'codelogin'&&!this.form.nickName){
this.queryInfo()
}
// 登录状态
......@@ -202,6 +214,12 @@
},
methods: {
gotoIndex(){
uni.switchTab({
url:'/pages/index/index'
})
this.$refs.restrictedOrCanelTip.close()
},
// 未登录状态下需要重新获取token
checkToken(){
api.checkToken().then(res=>{
......@@ -289,6 +307,24 @@
}
},
gotoApply(){
if(uni.getStorageSync('sharePosterObj')){
this.sharePosterObj = uni.getStorageSync('sharePosterObj')
}
console.log('this.sharePosterObj',this.sharePosterObj)
// 登录并且是禁用状态
if(this.loginType == 'codelogin'&& this.userInfo.userIsActive == 2){
this.showCode = true
this.restrictedOrCanelContent = '您的账号处在不可用状态,请扫码添加客服咨询情况'
this.$refs.restrictedOrCanelTip.open()
return
}
// 登录并且是注销状态
if(this.loginType == 'codelogin'&& this.userInfo.partnerIsActive == 2){
this.showCode = false
this.restrictedOrCanelContent = '90天内不可再次申请加盟为合伙人'
this.$refs.restrictedOrCanelTip.open()
return
}
if(!this.form.nickName){
common.errorDialog(1,'请输入昵称');
return false;
......@@ -330,13 +366,29 @@
if(!this.loginType || this.loginType == 'visitor'){
api.loginVerification(params).then((res)=>{
if(res['success']){
// 不能登录并且是禁用状态
if(res.data.userIsActive == 2){
this.showCode = true
this.restrictedOrCanelContent = '您的账号处在不可用状态,请扫码添加客服咨询情况'
this.$refs.restrictedOrCanelTip.open()
return
}
this.userId = String(res['data']['userId']);
uni.setStorageSync('isLogin','1');
uni.setStorageSync('loginType','codelogin');
uni.setStorageSync('cffp_userId', this.userId);
uni.setStorageSync('uni-token', res.data['token']);
uni.setStorageSync('isPartner', res.data['isPartner']); //是否是合伙人
this.queryInfo()
// 禁用和注销状态并存,以禁用为准
// 已经进行过注销操作的, 弹窗提示90天内不可再次申请加盟为合伙人
// 登录并且是注销状态
if(res.data.partnerIsActive==2){
this.showCode = false
this.restrictedOrCanelContent = '90天内不可再次申请加盟为合伙人'
this.$refs.restrictedOrCanelTip.open()
return
}
// 是合伙人就不让在加盟
if(res.data.isPartner){
this.$refs.everyJoinPopup.open()
......@@ -370,12 +422,9 @@
}else {
this.editNickName = false
}
delete res.data.commonResult
const cffp_userInfo = {
name: res['data']['realName'],
mobile: res['data']['mobile'],
partnerType:res['data']['partnerType'],
nickName:res['data']['nickName'],
levelCode:res['data']['levelCode'],
...res.data
}
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo))
......@@ -388,7 +437,7 @@
// 申请加盟
getApply(){
let params = {}
if(this.inviteUserId){
if(this.shareId){
params = {
applyType:'1',
applyUserId:this.userId,
......@@ -398,13 +447,14 @@
inviterInvitationCode:this.invitationCode,
shareId:this.shareId
}
// return
}else {
params = {
applyType:'2',
applyUserId:this.userId,
applyMobile:this.form.mobile,
nickName:this.form.nickName
nickName:this.form.nickName,
inviteUserId:this.sharePosterObj.inviteUserId,
invitationCode:this.sharePosterObj.invitationCode
}
}
api.newSaveApplyInfo(params).then((res)=>{
......@@ -423,23 +473,20 @@
'pages/saleCourseLists/saleCourseLists'
)
this.$refs.successJoinPopup.open()
}else{
// 由于注销需求,依据后端报错展示弹窗
this.showCode = false
this.restrictedOrCanelContent = res['message']
this.$refs.restrictedOrCanelTip.open()
// uni.showToast({
// title: '您已加盟成功',
// duration: 1000,
// title: res['message'],
// duration: 2000,
// icon: 'none'
// })
// uni.switchTab({
// url:'/pages/index/index'
// })
}else{
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
}
},
},
}
......
......@@ -168,8 +168,8 @@
continueText="暂不解绑"
btnType="horizontal"
:tipIcon="false"
@join="continueBind()"
@continue="$refs.unbindTipPopup.close()"
@join="$refs.unbindTipPopup.close()"
@continue="continueBind()"
/>
</view>
......@@ -226,6 +226,7 @@
},
methods:{
continueBind(){
console.log('解绑');
let params = {
userId:uni.getStorageSync('cffp_userId'),
oprType:this.paymentMethod
......@@ -593,7 +594,8 @@
color: black;
font-size: 26rpx;
text-align: right;
padding-right: 20rpx;
width: 60%;
}
.error-tip{
position: absolute;
......
<template>
<view class="wrapper">
<restrictedTip ref="restrictedTip"/>
<view v-if="loginType=='resetpw' || goBack" @click="rpsdlogin()" class="psdlogin">
<view class="iconfont icon-youjiantou zuojiantou" style="top:18rpx;color: #fff;"></view>
<!-- <image style="width: 40rpx;height: 40rpx;" src="../../static/rpsloging.png" mode=""></image> -->
......@@ -61,6 +62,7 @@
import common from '../../common/common';
import {companyInfo} from "@/environments/environment";
import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
export default {
data() {
return {
......@@ -89,6 +91,9 @@
goBack:true
}
},
components:{
restrictedTip
},
methods: {
c_agreeFlag(){
this.agreeFlag=!this.agreeFlag;
......@@ -179,12 +184,18 @@
}
api.loginVerification(params).then((res)=>{
if(res['success']){
// 禁用账号,不让登录
if(res.data.userIsActive==2){
this.$refs.restrictedTip.open()
uni.hideLoading()
return
}
this.userId = String(res['data']['userId']);
uni.setStorageSync('isLogin','1');
uni.setStorageSync('cffp_userId',this.userId);
uni.setStorageSync('loginType',this.loginType);
uni.setStorageSync('uni-token', res.data['token']);
uni.setStorageSync('isPartner', res.data['isPartner']); //是否是合伙人
if(urlType == 'personalCenter'){
uni.switchTab({
url:'/pages/personalCenter/personalCenter'
......
......@@ -53,7 +53,7 @@ export default {
}
},
onShow() {
this.userInfo = uni.getStorageSync('userinfodataForm')
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
this.loginType = uni.getStorageSync('loginType')
if(!this.loginType || this.loginType == 'visitor'){
this.codeUrl = `${this.baseURL}/pages/index/index`
......
......@@ -11,12 +11,12 @@
<view class="wapperBox">
<view class="warn">
<text class="iconfont icon-redgantanhao"></text>
<text>注销后,您将无法使用当前账号</text>
<text>相关数据也将被删除无法找回</text>
<text>解约后,您可正常使用当前账号</text>
<text>但合伙人相关数据也将被删除无法找回</text>
</view>
<view class="cancelBox">
<view class="title">
注销账号
解约账号
</view>
<view class="phone">
{{mobile}}
......@@ -51,19 +51,20 @@
<view class="empty" v-if="!isTick" @click="isTick=true"></view>
<text v-else class="iconfont icon-icon_duihao-mian" @click="isTick=false"></text>
<text style="color: #666;">我已阅读并同意</text>
<text style="color: #20269B;" @click="jump()">账号注销协议》</text>
<text style="color: #20269B;" @click="jump()">合伙人解约协议》</text>
</view>
<view
class="bottomBtn"
:style="{opacity:isTick?'1':'.5'}"
@click="applyCancel()"
>
申请注销
申请解约
</view>
</view>
<everyJoinPopup
ref="successCancelPopup"
content="注销成功"
content="解约成功"
continueText="前往我的"
:maskClick="false"
@continue="jumpPage"
/>
......@@ -96,16 +97,17 @@
}
},
onLoad() {
let dataForm = uni.getStorageSync('userinfodataForm')
this.mobile = dataForm.mobile
},
onShow(){
let dataForm = JSON.parse(uni.getStorageSync('cffp_userInfo'))
this.mobile = dataForm.mobile
this.lockScroll()
// #ifdef H5
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
},
beforeDestroy() {
console.log('组件销毁');
......@@ -134,15 +136,15 @@
},
jumpPage(){
dataHandling.pocessTracking(
'注销',
`用户注销账号`,
'解约',
`用户解约`,
'点击',
2,
'注销账号',
'解约账号',
'/myPackageA/setting/logOff'
)
uni.switchTab({
url:'/pages/index/index'
url:'/pages/personalCenter/personalCenter'
})
this.$refs.successCancelPopup.close()
},
......@@ -199,10 +201,10 @@
jump(){
dataHandling.pocessTracking(
'查看',
`用户点击了账户注销协议`,
`用户点击了合伙人解约协议`,
'点击',
2,
'注销账号',
'解约账号',
'/myPackageA/setting/logOff'
)
uni.navigateTo({
......@@ -213,7 +215,7 @@
applyCancel(){
if(!this.isTick){
uni.showToast({
title: '请阅读并勾选《账号注销协议》',
title: '请阅读并勾选《合伙人解约协议》',
duration: 3000,
icon: 'none'
})
......@@ -251,11 +253,10 @@
"signatureHash":hashResult,
"timestamp":timestamp,
}
console.log('注销参数',params);
api.cancellation(params).then(res =>{
if(res['success']){
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor');
// uni.clearStorageSync();
// uni.setStorageSync('loginType','visitor');
this.$refs.successCancelPopup.open()
}else{
uni.showToast({
......@@ -265,7 +266,7 @@
}
})
this.releaseScroll()
this.checkToken()
// this.checkToken()
}
})
},
......@@ -290,21 +291,6 @@
cancel(){
uni.navigateBack({delta:1})
},
sunmit(){
api.cancellation({userId: this.userId}).then(res =>{
if(res['success']){
uni.showToast({
title: '操作成功',
icon: 'none'
});
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor');
uni.redirectTo({
url:'/myPackageA/login/login?from=index'
})
}
})
},
}
}
</script>
......
......@@ -544,6 +544,11 @@
"style": {
"navigationBarTitleText": "分销海报"
}
},{
"path": "myTeam/myTeam",
"style": {
"navigationBarTitleText": "我的团队"
}
}
]
},{
......
......@@ -103,7 +103,8 @@
dropIndex:0,
dropReasons:[{id:null,name:'请选择'}],
withdrawal: true,
readonlyFlag:false
readonlyFlag:false,
tipMessage:''
};
},
methods:{
......@@ -136,7 +137,9 @@
if(res['success']){
this.dropInfo = res['data']
}else {
this.tipMessage = res['message']
this.withdrawal = false
this.readonlyFlag = true
}
})
},
......@@ -144,7 +147,7 @@
submit(){
if(!this.withdrawal){
uni.showToast({
title: '已退款不能重新申请',
title: this.tipMessage,
icon: 'none',
duration: 2000
});
......
<template>
<view class="container">
<!-- -->
<!-- 禁用弹窗 -->
<restrictedTip ref="restrictedTip"/>
<view class="shareheader" style="" v-if="coursesharing != 1 || deviceType==3">
<!-- #ifdef APP -->
<view class="iconfont icon-youjiantou" style="margin-left: 30rpx;" @click="goBack()"></view>
......@@ -184,6 +185,7 @@
</template>
<script>
import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
import PartnerTipPopup from "@/components/commonPopup/PartnerTipPopup.vue";
import api from "../../api/api";
import BootPage from "@/components/bootpage/bootpage.vue";
......@@ -202,7 +204,8 @@
BootPage,
LoginPopup,
VerifyPopup,
PartnerTipPopup
PartnerTipPopup,
restrictedTip
},
data() {
return {
......@@ -525,6 +528,15 @@
}
},
jumppurchase() {
if(uni.getStorageSync('cffp_userInfo')){
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
}
// 登录并且是禁用状态
if(this.userInfo.userIsActive==2){
this.$refs.restrictedTip.open()
return
}
let orderPlatform = ''
// 不同得公司主题不同得购买平台
// #ifdef APP
......@@ -962,13 +974,18 @@
queryInfo(){
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
if(res['success']){
uni.setStorageSync('userinfodataForm', res.data);
delete res.data.commonResult
const cffp_userInfo = {
...res.data
}
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo))
this.realName = res.data.realName;
}
})
},
init() {
if (!uni.getStorageSync('isLogin')) {
if (!uni.getStorageSync('loginType')&& uni.getStorageSync('loginType')=='visitor') {
api.loginVerification({
"loginType": 1
}).then((res) => {
......@@ -1010,7 +1027,7 @@
uni.setStorageSync('h5_coursesharing', this.coursesharing);
this.getshareData()
}
let dataForm = uni.getStorageSync('userinfodataForm')
let dataForm = JSON.parse(uni.getStorageSync('cffp_userInfo'))
this.realName = dataForm.realName;
if(!this.realName){
this.queryInfo();
......@@ -1032,45 +1049,10 @@
}
this.userId = uni.getStorageSync('cffp_userId')
// #ifdef H5
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
},
mounted() {
let _this = this;
if(this.isWeixin){
//var btn = document.getElementById('launch-btn');
//btn.addEventListener('launch', function(e) {
//console.log('success');
//});
//btn.addEventListener('error', function(e) {
// uni.navigateTo({
// url:'/pages/downloadAppCommon/downloadAppCommon'
// })
// uni.showModal({
// title: '系统消息',
// content: '您的手机未找到当前应用,是否去下载?',
// success: function(res) {
// if (res.confirm) {
// if(uni.getSystemInfoSync().platform == 'ios'){
// window.location.href = "http://itunes.apple.com/us/app/id399608199";
// }else {
// uni.navigateTo({
// url:'/pages/downloadApp/index'
// })
// // alert('android')
// }
// //在App Store Connect中的App Store下的app信息,可找到appleId
// console.log('用户点击确定');
// } else if (res.cancel) {
// console.log('用户点击取消');
// }
// }
// });
//});
}
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
},
onReady() {
this.videoContext = uni.createVideoContext('myVideo');
......
<template>
<!-- :style="{paddingTop: showFlag ? '0' : '60rpx'}" -->
<view class="container" :style="{paddingTop: showFlag ? '0' : '60rpx'}">
<!-- 禁用弹窗 -->
<restrictedTip ref="restrictedTip"/>
<view class="homeHeader" v-if="showFlag">
<view class="one">
<text style="font-size: 80rpx;">01</text>
......@@ -121,6 +123,7 @@
import {hshare,setWechatShare,initJssdkShare} from '@/util/fiveshare';
import UniShareWx from "@/uni_modules/uni-share-wx/index.vue";
import {nanoid} from 'nanoid';
import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
export default{
name:'courselist',
props:{
......@@ -140,7 +143,8 @@
search,
UniShareWx,
BootPage,
PartnerTipPopup
PartnerTipPopup,
restrictedTip
},
watch: {
// 监听 prop 变化,更新本地副本
......@@ -447,13 +451,13 @@
}).then((res) => {
if (res['success']) {
uni.setStorageSync('fileUploadItemCFFPList', res['data']['fileUploadItemCFFPList'])
const cffp_userInfo = {
name: res['data']['userReName'],
mobile: res['data']['mobile'],
partnerType:res['data']['partnerType'],
levelCode:res['data']['levelCode'],
}
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo));
// const cffp_userInfo = {
// name: res['data']['userReName'],
// mobile: res['data']['mobile'],
// partnerType:res['data']['partnerType'],
// levelCode:res['data']['levelCode'],
// }
// uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo));
this.fileUploadItemCFFPList = uni.getStorageSync('fileUploadItemCFFPList');
}
})
......
......@@ -15,13 +15,14 @@
<view v-if="tabType===1">
<view class="ulBox">
<view class="liBox">
<text>昵称:</text>
<text>昵称 <text style="font-size: 22rpx;">(被邀请人可修改)</text> </text>
<text>
<input
v-model="dataForm.name"
class="uni-input"
maxlength="10"
placeholder="昵称"
style="width: 300rpx;"
/>
</text>
</view>
......@@ -30,48 +31,6 @@
<text><input v-model="dataForm.mobileNumber" class="uni-input" type="number" maxlength="11"
placeholder="手机号" /></text>
</view>
<!-- <view class="liBox">
<text>申请身份:</text>
<text>
<picker @change="bindPickerChange" :value="applyIdentity" :range="identityArr">
<view class="uni-input">{{identityArr[applyIdentity]}}</view>
</picker>
</text>
</view>
<view class="liBox">
<text>所属组织:</text>
<text>
<input v-if="isCross==true" v-model="dataForm.areaName" class="uni-input"
placeholder="请填写组织名称" />
<picker v-else @change="bindPChange" :value="index" :range="orgdataList">
<view class="uni-input">{{ orgdataList[index]}}</view>
</picker>
</text>
</view>
<view class="liBox">
<text>是否跨区邀请:</text>
<view class="isCrossBox">
<view :class="{checked:isCross}">
<i class="circle" @click="isCross = true"></i>
<text></text>
</view>
<view :class="{checked:!isCross}">
<i class="circle" @click="isCross = false"></i>
<text></text>
</view>
</view>
</view>
<view class="describeLabel">晋升机制:当事业伙伴成功邀请加盟人数超过10人时,经过人工审核通过后,即可成功晋升为工作室。</view>
-->
<!-- <view class="liBox" v-if="isCross== true">
<text>所属组织名称:</text>
<text>
<picker @change="bindPickerChange" :value="applyIdentity" :range="identityArr">
<view class="uni-input">{{identityArr[applyIdentity]}}</view>
</picker>
</text>
</view> -->
</view>
<!-- <share></share> -->
<button type="primary" plain="true" class="sendInvite" @click="shareToggle()">发出邀请</button>
......@@ -81,25 +40,13 @@
<h4 class="noListTip" v-if="!inviteLists || inviteLists.length<=0">暂无邀请记录!</h4>
<view class="listUl ulBox" v-for="(item,index) in inviteLists" :key="index">
<view class="liBox">
<text>姓名</text>
<text>昵称</text>
<text>{{item.name}}</text>
</view>
<view class="liBox">
<text>手机号:</text>
<text>{{item.mobileNumber}}</text>
</view>
<!-- <view class="liBox">
<text>申请身份:</text>
<text>{{item.partnerLevel == 'A1'? '事业伙伴' : '工作室'}}</text>
</view>
<view class="liBox">
<text>所属组织:</text>
<text>{{item.orgName}}</text>
</view>
<view class="liBox">
<text>是否跨区邀请:</text>
<text>{{item.hasCrossDistrict==1 ? '是' : '否'}}</text>
</view> -->
<view class="liBox">
<text>邀请状态:</text>
<text v-if="item.approvalStatus=='0'">邀请中</text>
......@@ -199,7 +146,7 @@
}else {
this.ydLogoShare = `${shareURL}/static/logo2.png`;
}
let dataForm = uni.getStorageSync('userinfodataForm')
let dataForm = JSON.parse(uni.getStorageSync('cffp_userInfo'))
this.realName = dataForm.realName || dataForm.nickName;
this.invitationCode = dataForm.invitationCode
if(!this.realName){
......@@ -222,7 +169,11 @@
queryInfo(){
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
if(res['success']){
uni.setStorageSync('userinfodataForm', res.data);
delete res.data.commonResult
const cffp_userInfo = {
...res.data
}
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo))
this.realName = res.data.realName ||res.data.nickName ;
this.invitationCode = res.data.invitationCode;
}
......@@ -293,6 +244,7 @@
// this.dataForm.name = ''
// return
// }
this.dataForm.remarkName = this.dataForm.name
if (common.mobileNoValid(this.dataForm.mobileNumber)) {
api.saveApplyInfo(this.dataForm).then(res => {
if (res['success']) {
......
......@@ -121,6 +121,14 @@
</view>
</view>
</view>
<boot-page
loginSource="我的团队"
v-if="sharelogin"
ref="sharelogin"
@close="sharelogin = false"
@afterLogin="afterLogin"
pageSource="myTeam"
></boot-page>
</view>
</template>
......@@ -129,9 +137,11 @@
import dataHandling from "@/util/dataHandling";
import api from "@/api/api";
import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import BootPage from "@/components/bootpage/bootpage.vue";
export default {
components: {
CommonTimePicker
CommonTimePicker,
BootPage
},
data() {
return {
......@@ -164,7 +174,6 @@
myTeamList:[],//我的团队表格数据,
myTeamData:{},//我的团队总数据,
CffpOrgInfoReqVO: {
userId: uni.getStorageSync('cffp_userId'),
startDate: `${new Date().getFullYear()}-${new Date().getMonth() + 1 > 9 ? new Date().getMonth() + 1 : '0'+ (new Date().getMonth() + 1)}`,
endDate: `${new Date().getFullYear()}-${new Date().getMonth() + 1 > 9 ? new Date().getMonth() + 1 : '0'+ (new Date().getMonth() + 1)}`,
courseOrPolicy: '1',
......@@ -175,7 +184,8 @@
totalCoursePrice: '0.00', // 总销售额
monthStandardSales:'0.00',//本月团队标准销售额
myTeamAchievementList:[],//我的业绩数据列表,
marginTop:'30rpx'
marginTop:'30rpx',
sharelogin: false,
}
},
watch: {
......@@ -260,29 +270,30 @@
}
},
},
onLoad(){
this.getmyseatem()
this.getqueryTeamAchievement()
onLoad(options){
// 未登录,弹出登录框
if(options.myTeam&&(!uni.getStorageSync('loginType')||uni.getStorageSync('loginType')=='visitor' )){
this.sharelogin = true
}else {
this.getmyseatem()
this.getqueryTeamAchievement()
}
},
onShow() {
// #ifdef H5
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
},
methods: {
sortswitch(obj) {
this.currentFilterBtn = obj.id
this.CffpOrgInfoReqVO.sortType = obj.sortType
this.getqueryTeamAchievement()
// if(obj.sortType == 4){
// this.CffpOrgInfoReqVO.sortType = obj.sortType
// this.getqueryTeamAchievement()
// }else{
// delete this.CffpOrgInfoReqVO.sortType
// this.getqueryTeamAchievement()
// }
},
changeTab(item){
this.currentTab = item.id
......@@ -292,6 +303,7 @@
},
getqueryTeamAchievement() {
this.CffpOrgInfoReqVO.userId=uni.getStorageSync('cffp_userId'),
this.CffpOrgInfoReqVO.queryType = this.tabList.filter(item=>item.id == this.currentTab)[0].type
this.CffpOrgInfoReqVO.sortType = this.btnList.filter(item=>item.id == this.currentFilterBtn)[0].sortType
api.queryTeamAchievement(this.CffpOrgInfoReqVO).then(res => {
......@@ -379,6 +391,11 @@
})
}
},
afterLogin(){
this.userId = uni.getStorageSync('cffp_userId'),
this.getmyseatem()
this.getqueryTeamAchievement()
}
},
}
......
......@@ -162,6 +162,7 @@
@join="jumpPage('2')"
@continue="jumpPage('1')"
/>
<restrictedTip ref="restrictedTip"/>
</view>
</template>
......@@ -175,6 +176,7 @@
import JoinPopup from '@/components/commonPopup/JoinPopup.vue';
import PartnerTipPopup from "@/components/commonPopup/PartnerTipPopup.vue";
import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
export default {
data() {
return {
......@@ -205,6 +207,7 @@
{title:'申请加盟',icon:'icon-hezuo',link:'/myPackageA/applyFranchise/applyFranchise?',isOpen:true,isShow:true,isApply:true},
{key:'06',title:'邀请加盟',icon:'icon-yaoqing',link:'/pages/inviteJoin/inviteJoin',isOpen:true,isShow:true,identity: true},
{title:'我的团队',icon:'icon-tuandui',link:'/pages/personalCenter/myTeam',isOpen:true,isShow:true,identity: true},
// {title:'我的团队',icon:'icon-tuandui',link:'/myPackageA/myTeam/myTeam',isOpen:true,isShow:true,identity: true},
{title:'育成团队',icon:'icon-yuchengguanxi',link:'/pages/personalCenter/myTeamIncubate',isOpen:true,isShow:true,identity: true},
],
},
......@@ -232,7 +235,8 @@
components:{
tabBar,
JoinPopup,
PartnerTipPopup
PartnerTipPopup,
restrictedTip
},
onShow() {
this.loginType = uni.getStorageSync('loginType')
......@@ -405,7 +409,6 @@
url: '/myPackageA/login/login?from=personalCenter'
})
try {
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor');
} catch (e) {
......@@ -478,12 +481,15 @@
'我的',
'pages/personalCenter/personalCenter'
)
if(this.customerBasicInfo.userIsActive == 2){
this.$refs.restrictedTip.open()
return
}
this.getPartnerStatistic()
return
}
//当为见习合伙人的时候,弹出框提示
if(item.key == '06'&& this.userInfo.levelCode == 'P1' && uni.getStorageSync('loginType') == 'codelogin'){
if(item.key == '06'&& this.userInfo.levelCode == 'P1' && uni.getStorageSync('loginType') == 'codelogin'&& this.userInfo.userIsActive == 1){
this.$refs.PartnerTipPopup.open()
return
}
......@@ -597,11 +603,9 @@
this.inviteEqrode = this.customerBasicInfo.invitationCode;
uni.setStorageSync('user_mobile', res.data.mobile)
uni.setStorageSync('userinfodataForm', res.data)
}else {
// 清空全部本地存储
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor')
this.showMyName = ''
this.loginType = 'visitor'
......
......@@ -5,7 +5,7 @@
<!-- #endif -->
<view class="">
<menu-list :menuList="minorMenuLists"></menu-list>
<menu-list :menuList="minorMenuLists" @tipMessage="tipMessage()"></menu-list>
</view>
......@@ -21,8 +21,10 @@
},
data() {
return {
userInfo:{},
minorMenuLists: [
{
key:'1',
title: '手机号绑定',
icon: '',
link: '',
......@@ -30,42 +32,45 @@
isOpen: true,
isShow: true,
isTips: false,
isType: 'text'
isType: 'text',
isJump: true
},
// {
// title: '重置密码',
// icon: '',
// link: '/pages/personalCenter/accountoperation/resetpassword',
// isOpen: true,
// isShow: true,
// isTips: false,
// isType: 'radio'
// },
{
title: '注销账号',
key:'2',
title: '合伙人解约',
icon: '',
link: '/myPackageA/setting/logOff',
isOpen: true,
isShow: true,
isTips: false,
isType: 'radio'
isType: 'radio',
isJump:false,
}
]
}
},
onShow() {
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
if(this.userInfo.partnerIsActive&&this.userInfo.partnerIsActive==2){
this.minorMenuLists.forEach(item=>{
if(item.key=='2'){
item.isJump = true
}
})
}
// #ifdef H5
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
},
methods:{
goBack() {
uni.navigateBack({
delta: 1
});
}
},
}
}
</script>
......
......@@ -41,7 +41,10 @@
}
},
onLoad() {
let dataForm = uni.getStorageSync('userinfodataForm')
},
onShow() {
let dataForm = JSON.parse(uni.getStorageSync('cffp_userInfo'))
this.mobile = dataForm.mobile
},
destroyed() {
......
......@@ -43,14 +43,14 @@
isShow: true,
isTips: true,
},
{
title: '关于'+companyInfo.appName+'APP',
icon: 'myCertify',
link: '/pages/personalCenter/accountoperation/aboutcffp',
isOpen: true,
isShow: true,
isTips: false,
},
// {
// title: '关于'+companyInfo.appName+'APP',
// icon: 'myCertify',
// link: '/pages/personalCenter/accountoperation/aboutcffp',
// isOpen: true,
// isShow: true,
// isTips: false,
// },
]
}
},
......@@ -59,7 +59,17 @@
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
// #endif
// #ifdef APP
this.minorMenuLists.push({
title: '关于'+companyInfo.appName+'APP',
icon: 'myCertify',
link: '/pages/personalCenter/accountoperation/aboutcffp',
isOpen: true,
isShow: true,
isTips: false,
},)
// #endif
},
destroyed() {
uni.hideToast();
......@@ -85,16 +95,16 @@
'设置',
'pages/personalCenter/system/settings'
)
uni.redirectTo({
url:'/myPackageA/login/login'
})
try {
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor');
} catch (e) {
console.log(e)
// error
}
uni.redirectTo({
url:'/myPackageA/login/login'
})
uni.showToast({
title: '操作成功',
icon: 'none'
......
<template>
<view class="container">
<!-- 禁用弹窗 -->
<restrictedTip ref="restrictedTip"/>
<view class="kuaiBox" v-for="item in mainMenuLists" :key="item.id">
<view class="kuaiTit">
{{item.categoryName}}
......@@ -30,8 +32,8 @@
<script>
import dataHandling from "@/util/dataHandling";
import tabBar from '../../components/tabBar/tabBar.vue';
import courseItem from "@/components/courseItem/courseItem.vue";
import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
export default {
data() {
return {
......@@ -72,6 +74,9 @@
]
}
},
components: {
restrictedTip
},
onShow() {
// #ifdef H5
initJssdkShare(() => {
......
......@@ -55,6 +55,24 @@
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe333;</span>
<div class="name">加号</div>
<div class="code-name">&amp;#xe333;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe302;</span>
<div class="name">save</div>
<div class="code-name">&amp;#xe302;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe301;</span>
<div class="name">加号2-fill</div>
<div class="code-name">&amp;#xe301;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe300;</span>
<div class="name">icon_对号-面</div>
<div class="code-name">&amp;#xe300;</div>
......@@ -384,9 +402,9 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1751592106397') format('woff2'),
url('iconfont.woff?t=1751592106397') format('woff'),
url('iconfont.ttf?t=1751592106397') format('truetype');
src: url('iconfont.woff2?t=1754967710345') format('woff2'),
url('iconfont.woff?t=1754967710345') format('woff'),
url('iconfont.ttf?t=1754967710345') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
......@@ -413,6 +431,33 @@
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-jiahao"></span>
<div class="name">
加号
</div>
<div class="code-name">.icon-jiahao
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-save"></span>
<div class="name">
save
</div>
<div class="code-name">.icon-save
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-jiahao2fill"></span>
<div class="name">
加号2-fill
</div>
<div class="code-name">.icon-jiahao2fill
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-icon_duihao-mian"></span>
<div class="name">
icon_对号-面
......@@ -909,6 +954,30 @@
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-jiahao"></use>
</svg>
<div class="name">加号</div>
<div class="code-name">#icon-jiahao</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-save"></use>
</svg>
<div class="name">save</div>
<div class="code-name">#icon-save</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-jiahao2fill"></use>
</svg>
<div class="name">加号2-fill</div>
<div class="code-name">#icon-jiahao2fill</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-icon_duihao-mian"></use>
</svg>
<div class="name">icon_对号-面</div>
......
@font-face {
font-family: "iconfont"; /* Project id 4933433 */
src: url('iconfont.woff2?t=1751592106397') format('woff2'),
url('iconfont.woff?t=1751592106397') format('woff'),
url('iconfont.ttf?t=1751592106397') format('truetype');
src: url('iconfont.woff2?t=1754967710345') format('woff2'),
url('iconfont.woff?t=1754967710345') format('woff'),
url('iconfont.ttf?t=1754967710345') format('truetype');
}
.iconfont {
......@@ -13,6 +13,18 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-jiahao:before {
content: "\e333";
}
.icon-save:before {
content: "\e302";
}
.icon-jiahao2fill:before {
content: "\e301";
}
.icon-icon_duihao-mian:before {
content: "\e300";
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,6 +6,27 @@
"description": "",
"glyphs": [
{
"icon_id": "7192356",
"name": "加号",
"font_class": "jiahao",
"unicode": "e333",
"unicode_decimal": 58163
},
{
"icon_id": "448643",
"name": "save",
"font_class": "save",
"unicode": "e302",
"unicode_decimal": 58114
},
{
"icon_id": "577314",
"name": "加号2-fill",
"font_class": "jiahao2fill",
"unicode": "e301",
"unicode_decimal": 58113
},
{
"icon_id": "4735289",
"name": "icon_对号-面",
"font_class": "icon_duihao-mian",
......
import api from "@/api/api";
import dataHandling from './dataHandling'
import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
......@@ -19,16 +24,18 @@ const whiteList = [
export default function initApp(){
let date = Date.now()
uni.addInterceptor('navigateTo', {
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke (e) {
let userInfo = {}
if(uni.getStorageSync('cffp_userInfo')){
userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
}
let pages = getCurrentPages()
let pagesLength = pages.length
if(whiteList.indexOf(e.url)==-1&&!uni.getStorageSync('loginType')){
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor')
uni.navigateTo({
url: '/myPackageA/login/login'
......@@ -37,8 +44,6 @@ export default function initApp(){
if(uni.getStorageSync('cffp_userId')){
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
if(!res['success']){
// 清空全部本地存储
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor')
uni.navigateTo({
url: '/myPackageA/login/login'
......@@ -47,18 +52,22 @@ export default function initApp(){
}
// 保存用户得个人信息
if (res['success']) {
delete res.data.commonResult
const cffp_userInfo = {
name: res['data']['realName'],
mobile: res['data']['mobile'],
partnerType:res['data']['partnerType'],
nickName:res['data']['nickName'],
levelCode:res['data']['levelCode'],
...res.data
}
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo))
}
})
}
if (userInfo.userIsActive == 2 &&uni.getStorageSync('loginType')=='codelogin') {
// 显示禁用用户弹窗
const currentPage = getCurrentPages()[getCurrentPages().length - 1];
currentPage.$refs.restrictedTip.open()
return false; // 返回对象而不是布尔值
}
let whiteArr = ['index','personalCenter','courselist','product']
// 1. 解析 URL 中的 from 参数
const getQueryParam = (url, key) => {
......@@ -69,7 +78,6 @@ export default function initApp(){
};
const fromParam = getQueryParam(e.url, 'from');
console.log('2222',!hasPermission(e.url));
if(!hasPermission(e.url)){
// 如果 from 参数在 whiteArr 中,说明是tabbar页带着tabbar的标志参数跳转到登录页,以便未登录状态下回到对应的tabbar页
if (fromParam && whiteArr.includes(fromParam)) {
......@@ -77,7 +85,6 @@ export default function initApp(){
url: `/myPackageA/login/login?from=${fromParam}`
})
}else {
console.log('zoujinlaile');
uni.redirectTo({
url: '/myPackageA/login/login'
})
......@@ -155,4 +162,4 @@ function hasPermission (url) {
return true
}
return false
}
\ No newline at end of file
}
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