Commit 0a2029eb by yuzhenWang

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

Feature 20250614 首页菜单优化

See merge request !48
parents 74a52224 89bdd2d4
......@@ -4,6 +4,11 @@
import {baseURL,apiURL,cffpURL,companyInfo} from "@/environments/environment";
import api from './api/api';
export default {
data() {
return {
invitationHandled: false // 在data中明确定义
}
},
onLaunch: function() {
console.log('App Launch');
if(!uni.getStorageSync('loginType')){
......@@ -99,10 +104,12 @@
const pages = getCurrentPages();
if(pages.length > 0) {
const currentRoute = pages[pages.length - 1].route;
console.log('currentRoute',currentRoute);
const whiteList = [
'/myPackageA/login/login',
'/pages/invitationRegister/invitationlogin',
'/myPackageA/applyFranchise/applyFranchise',
'/pages/applyFranchise/applyFranchise',
'/myPackageA/ruleAndContract/clause',
'/pages/courselist/courselist',
'/pages/courseDetail/courseDetail',
......@@ -284,7 +291,7 @@
} */
/* iPad横屏 */
@media (orientation: landscape) {
@media (orientation: landscape) {
.container {
max-width: 1024px;
display: flex;
......
......@@ -53,12 +53,12 @@ export default {
// 加盟按钮文字
joinText: {
type: String,
default: '去加盟为合伙人'
default: '我已知晓,继续分享'
},
// 继续按钮文字
continueText: {
type: String,
default: '我已知晓,继续分享'
default: '去加盟为合伙人'
},
// 是否展示icon
tipIcon: {
......@@ -75,14 +75,14 @@ export default {
close() {
this.$refs.popup.close()
},
// 点击加盟
// 点击继续
handleJoin() {
this.$emit('join')
this.$emit('continue')
this.close()
},
// 点击继续
// 点击加盟
handleContinue() {
this.$emit('continue')
this.$emit('join')
this.close()
}
}
......
......@@ -27,9 +27,16 @@
</view>
</view>
<view class="joinFotter">
<view @click="handleContinue">
{{ continueText }}
</view>
<view
v-if="showCanel"
@click="handleCancel"
style="background-color: #FAFAFA;color: #333333;"
>
{{ cancelText }}
</view>
<view @click="handleContinue">
{{ continueText }}
</view>
</view>
</view>
</uni-popup>
......@@ -60,6 +67,11 @@ export default {
type: String,
default: '前往首页'
},
// 暂不操作按钮文字
cancelText: {
type: String,
default: '暂不操作,继续浏览'
},
// 文字颜色
fontColor: {
type: String,
......@@ -68,6 +80,10 @@ export default {
maskClick: {
type: Boolean,
default: true
},
showCanel: {
type: Boolean,
default: false
}
},
methods: {
......@@ -86,9 +102,14 @@ export default {
},
// 点击继续
handleContinue() {
this.$emit('continue')
this.$emit('continue',1)
this.close()
}
},
// 继续浏览
handleCancel(){
this.$emit('continue',2)
this.close()
}
}
}
</script>
......
......@@ -450,7 +450,7 @@
};
</script>
<style lang="less" scoped>
<style lang="scss" scoped>
.signature-box {
display: flex;
flex-direction: column;
......
......@@ -15,6 +15,7 @@
优质资源,专业服务
</view>
</view>
<view class="applyBox">
<view style="height: 550rpx;">
<view class="inputBox">
......@@ -92,18 +93,21 @@
<everyJoinPopup
ref="everyJoinPopup"
@continue="jumpPage"
:showCanel="false"
/>
<!-- 成功加盟为合伙人提示弹窗组件 -->
<everyJoinPopup
ref="successJoinPopup"
@continue="jumpPage()"
@continue="jumpPage(e)"
content="您已加盟为银盾家办合伙人"
twoContent='购买一单"YD家庭财务法律卡"即可升级为新锐合伙人,享受组织利益'
continueText="前往购买"
cancelText="暂不购买,继续浏览"
fontColor="#20279B"
:maskClick="false"
icon="icon-dianzan"
iconSize='80rpx'
:showCanel="true"
/>
</view>
</template>
......@@ -116,7 +120,7 @@
import dataHandling from "@/util/dataHandling";
export default {
components:{
everyJoinPopup
everyJoinPopup,
},
data() {
return {
......@@ -159,7 +163,9 @@
uni.clearStorageSync()
uni.setStorageSync('loginType', 'visitor')
}
},
onShow(){
if(uni.getStorageSync('loginType')){
......@@ -183,10 +189,7 @@
if(!this.inviteUserId&&this.loginType == 'codelogin'&&!this.form.nickName){
this.queryInfo()
}
// 邀请状态
// if(this.inviteUserId){
// this.getqueryById(this.shareId)
// }
},
methods: {
getqueryById(shareId){
......@@ -194,10 +197,13 @@
this.form.nickName = res.data.data.name
this.form.mobile = res.data.data.mobileNumber
this.editNickName = this.editMobile = true
if(res.data.data.isPartner){
this.$refs.successJoinPopup.open()
}
})
},
jumpPage(){
jumpPage(e){
// e===1时,前往购买;e===2暂不购买;目前全部跳转到首页,不进行判断
uni.switchTab({
url:'/pages/index/index'
})
......@@ -221,6 +227,7 @@
c_agreeFlag(){
this.agreeFlag=!this.agreeFlag;
},
delayTime() {
this.disabledSendBtn = true;
this.timer = setInterval(() => {
......@@ -233,27 +240,27 @@
clearInterval(this.timer);
}
}, 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(){
if(!this.form.nickName){
common.errorDialog(1,'请输入昵称');
......
......@@ -390,7 +390,7 @@
}
.iconBox{
border-radius: 15rpx;
width: 20% !important;
width: 400rpx !important;
}
}
.content{
......
......@@ -20,5 +20,8 @@
"echarts": "^5.4.1",
"js-sha256": "^0.11.1",
"nanoid": "^4.0.0"
},
"devDependencies": {
"less": "^4.3.0"
}
}
......@@ -27,7 +27,7 @@
"softinputMode": "adjustResize"
}
}
}, {
}, {
"path": "pages/product/product",
"style": {
"navigationBarTitleText": "SFP",
......@@ -502,10 +502,7 @@
},{
"path": "applyFranchise/applyFranchise",
"style": {
"navigationBarTitleText": "申请加盟",
"h5": {
"reload": false // 禁用自动重新加载
}
"navigationBarTitleText": "申请加盟"
}
},{
"path": "integralExchange/exchange",
......@@ -540,12 +537,9 @@
},{
"path": "ruleAndContract/clause",
"style": {
"navigationBarTitleText": "协议",
"h5": {
"reload": false // 禁用自动重新加载
}
"navigationBarTitleText": "协议"
}
}
},
]
},{
"root": "officialWebsite",
......
<template>
<view class="container">
<view class="homeHeader">
<!-- :style="{paddingTop: showFlag ? '0' : '60rpx'}" -->
<view class="container" >
<view class="homeHeader" v-if="showFlag">
<view class="one">
<text style="font-size: 80rpx;">01</text>
<view class="titleTxt">
......@@ -25,7 +26,7 @@
</view>
<view class="productBox">
<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="left">
<image class="productImg" :src="item.displayImage" alt="" mode="widthFix"></image>
......@@ -115,6 +116,16 @@
import {nanoid} from 'nanoid';
export default{
name:'courselist',
props:{
showFlag:{
type:Boolean,
default:true
},
cffpCourseInfos: {
type: Array,
default: () => []
}
},
components:{
courseItem,
tabBar,
......@@ -124,9 +135,18 @@
BootPage,
PartnerTipPopup
},
watch: {
// 监听 prop 变化,更新本地副本
cffpCourseInfos: {
immediate: true, // 立即执行一次
handler(newVal) {
this.localCourseInfos = [...newVal]; // 深拷贝(如果是简单数组,浅拷贝也行)
},
},
},
data(){
return{
cffpCourseInfos:[],
localCourseInfos: [], // 本地副本
currentPage:'courselist',
fileUploadItemCFFPList:[],
queryName:null,
......@@ -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:{
marginTop(){
if(this.env.device.isMobile){
......@@ -357,7 +387,7 @@
}
api.courseList(param).then(res=>{
if(res['success']){
this.cffpCourseInfos = res['data']['data'];
this.localCourseInfos = res['data']['data']; // 修改本地副本
}
})
},
......@@ -457,7 +487,6 @@
.productList{
width: 100%;
box-sizing: border-box;
// margin-top: -2%;
background-color: #fff;
padding: 20rpx;
border-radius: 10rpx;
......@@ -543,6 +572,12 @@
border: none;
}
}
/* 电脑端 */
@media (min-width: 768px) {
.productList{
// padding-top: 60rpx;
}
}
}
.descriptionBox {
width: 510rpx;
......@@ -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>
\ No newline at end of file
......@@ -19,6 +19,7 @@
<view class="bottom">
<view class="content">
<view class="featureContent">
<!-- 顶部快捷菜单 -->
<view class="nav_wrapper">
<view class="nav_content" v-for="featureItem in featureLists" :key="featureItem.key"
@click="featureSelect(featureItem)">
......@@ -55,23 +56,29 @@
</view> -->
<!-- 产品区域 -->
<view class="productBox">
<view class="productTitle">
<view class="productContainer">
<!-- <view class="productTitle">
<view class="titleTxt">
<text style="font-size: 30rpx;font-weight: 500;">推荐产品</text>
<text class="more" @click="goToCourselist()">更多 <text class="iconfont icon-youjiantou"></text> </text>
</view>
</view>
</view> -->
<view class="productList" v-if="cffpCourseInfos.length>0">
<courselist :showFlag="false" :cffpCourseInfos="cffpCourseInfos"></courselist>
<view class="productListBox">
<view class="productListItem" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)">
<view class="top">
<image class="productImg" :src="item.displayImage" alt="" mode="widthFix"></image>
<!-- <view class="productListItem" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)"> -->
<!-- <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">
{{item.fileSynopsis}}
</view>
</view>
<view class="bottom" style="text-align: left !important;">
</view> -->
<!-- </view> -->
<!-- <view class="bottom" style="text-align: left !important;">
<view class="one">
{{item.fileTitle}}
</view>
......@@ -79,8 +86,8 @@
<text class="price" style="">{{item.coursePrice}}</text>
<text v-if="Number(item.salesNumber)>0" class="num" >已售{{item.salesNumber}}</text>
</view>
</view>
</view>
</view> -->
<!-- </view> -->
</view>
</view>
<view class="productEmpty" v-else>
......@@ -215,29 +222,21 @@
x: 0,
y: 0
},
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
},
featureLists: [
{
key: '02',
name: '申请加盟',
icon: 'icon-hezuo',
link: '/myPackageA/applyFranchise/applyFranchise',
isOpen: true,
isApply:true,
isApply:true
},
{
key: '07',
name: '分享产品',
icon: 'icon-zhuanfa',
link: '/pages/courselist/courselist',
isOpen: true,
},
{
......@@ -325,7 +324,13 @@
partnerType:res['data']['partnerType'],
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 @@
window.location.href = url;
// #endif
},
// 顶部菜单跳转
featureSelect(featureItem) {
if(uni.getStorageSync('cffp_userInfo')){
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
......@@ -506,9 +512,8 @@
'首页',
'pages/index/index'
)
uni.navigateTo({
url: `${featureItem.link}`
});
uni.navigateTo({url: `${featureItem.link}`});
return
}
......@@ -743,7 +748,7 @@
}
}
.productBox {
.productContainer {
background-color: #fff;
margin-top: 15rpx;
box-sizing: border-box;
......@@ -813,7 +818,22 @@
object-fit: cover;
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 {
box-sizing: border-box;
position: absolute;
......
......@@ -535,9 +535,10 @@
.sendInvite {
position: absolute;
left: 20vw;
left: 0;
top: 80%;
width: 60vw;
width: 60%;
transform: translateX(30%);
border-radius: 80rpx;
background-color: #20269B;
color: #fff;
......
import {apiURL,cffpURL} from "../environments/environment";
import {apiURL,cffpURL,sfpUrl} from "../environments/environment";
import api from "@/api/api";
// 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`${apiURL}/authorize/obtainToken`, `${apiURL}/authorize/checkToken`, `${cffpURL}/user/loginVerification`,`${apiURL}/appVersion/checkIsUpdate`,
`${cffpURL}/accessLog/accessLogSave`,`${cffpURL}/user/powerQuery`,`${cffpURL}/user/wxLogin`,`${cffpURL}/certificate/officialWebsiteDetail`];
const whiteApiList = [`${apiURL}/authorize/obtainToken`,
`${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 = () => {
uni.addInterceptor('request', {
// 请求拦截器
......
......@@ -6,6 +6,7 @@ const whiteList = [
'/myPackageA/login/login',
'/pages/invitationRegister/invitationlogin',
'/myPackageA/applyFranchise/applyFranchise',
'/pages/applyFranchise/applyFranchise',
'/myPackageA/ruleAndContract/clause',
'/pages/orderDetail/orderDetail',
'/pages/courseDetail/courseDetail',
......@@ -16,15 +17,11 @@ const whiteList = [
export default function initApp(){
let date = Date.now()
uni.addInterceptor('navigateTo', {
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke (e) {
// 移除URL中的t_reload参数
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('&');
}
console.log(e);
let pages = getCurrentPages()
let pagesLength = pages.length
......@@ -44,7 +41,7 @@ export default function initApp(){
uni.navigateTo({
url: '/myPackageA/login/login'
})
return
return true
}
// 保存用户得个人信息
if (res['success']) {
......@@ -68,8 +65,8 @@ export default function initApp(){
return params.get(key);
};
const fromParam = getQueryParam(url, 'from');
if(!hasPermission(url)){
const fromParam = getQueryParam(e.url, 'from');
if(!hasPermission(e.url)){
// 如果 from 参数在 whiteArr 中,说明是tabbar页带着tabbar的标志参数跳转到登录页,以便未登录状态下回到对应的tabbar页
if (fromParam && whiteArr.includes(fromParam)) {
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