Commit 49c469da by yuzhenWang

Merge branch 'dev' into 'master'

Dev

See merge request !82
parents 68eadfda de2a5c14
......@@ -149,6 +149,7 @@
uni.setStorageSync('isLogin','1');
uni.setStorageSync('loginType','codelogin');
uni.setStorageSync('cffp_userId', this.userId);
console.log('============',uni.getStorageSync('cffp_userId'))
uni.setStorageSync('uni-token', res.data['token']);
this.loginTypeSync = "codelogin";
this.queryInfo()
......
......@@ -182,6 +182,7 @@
this.userId = String(res['data']['userId']);
uni.setStorageSync('isLogin','1');
uni.setStorageSync('cffp_userId',this.userId);
console.log('============',uni.getStorageSync('cffp_userId'))
uni.setStorageSync('loginType',this.loginType);
uni.setStorageSync('uni-token', res.data['token']);
......
<!-- components/pdf-viewer/PdfViewer.vue -->
<template>
<view class="pdf-viewer" ref="pdfContainerRef" >
<!-- 横屏提示组件 -->
<LandscapeTip
:debug="false"
:auto-show="pdfInfo.landscapeFlag ? pdfInfo.landscapeFlag : false"
:show-delay="1000"
:check-wide-content="false"
/>
<!-- 添加一个滚动容器 -->
<scroll-view
class="pdf-scroll-view"
scroll-y
:show-scrollbar="false"
@scroll="handleScroll"
:scroll-top="scrollTop"
>
<!-- PDF文档信息 -->
<view class="pdf-info" v-if="pdfInfo.title">
<view class="pdf-viewer" :style="{ height: containerHeight + 'px' }">
<!-- 标题 -->
<view v-if="pdfInfo.title" class="pdf-header">
<text class="pdf-title">{{ pdfInfo.title }}</text>
<text class="pdf-page-count" v-if="pdfPageCount > 0">{{ pdfPageCount }}</text>
</view>
<!-- 页面列表 -->
<view
v-for="pageIndex in pdfPageCount"
:key="pageIndex"
class="page-container"
:id="`page-${pageIndex}`"
<!-- 滚动容器 -->
<scroll-view
class="pdf-scroll"
scroll-y
:show-scrollbar="false"
@scroll="onScroll"
:scroll-top="scrollTop"
:style="{ height: scrollContainerHeight + 'px' }"
>
<view class="page-header" v-if="loadingStatus">
<text class="page-number">{{ pageIndex }}</text>
<text class="page-status" v-if="isPageLoading(pageIndex)">加载中...</text>
<text class="page-status error" v-else-if="isPageFailed(pageIndex)">加载失败</text>
<text class="page-status success" v-else-if="getPageImage(pageIndex)">加载完成</text>
<!-- 页面列表 -->
<view
v-for="pageNum in totalPages"
:key="pageNum"
class="page-item"
:style="{ minHeight: getPageMinHeight(pageNum) + 'px' }"
>
<!-- 页码标签 -->
<view v-if="props.showPageNumber" class="page-number-tag">
{{ pageNum }}
</view>
<!-- 缩小模式:widthFix + 固定最大高度防过长 -->
<view v-if="!isZoomed[pageNum] && hasImage(pageNum)" class="fit-mode">
<image
:src="getImage(pageNum)"
mode="widthFix"
class="pdf-image-fit"
:show-menu-by-longpress="false"
/>
</view>
<!-- 高清模式:原始尺寸 + 可拖动 -->
<view
v-else-if="isZoomed[pageNum] && hasImage(pageNum)"
class="zoom-container"
@touchstart="onTouchStart($event, pageNum)"
@touchmove="onTouchMove($event, pageNum)"
@touchend="onTouchEnd"
@touchcancel="onTouchEnd"
>
<view
class="image-original"
:style="{
transform: `translate(${translateX[pageNum] || 0}px, ${translateY[pageNum] || 0}px)`,
width: (pageRenderWidth[pageNum] || 0) + 'px',
height: (pageRenderHeight[pageNum] || 0) + 'px'
}"
>
<image
:src="getImage(pageNum)"
mode="scaleToFill"
style="display: block; width: 100%; height: 100%;"
/>
</view>
</view>
<!-- 加载中 / 错误 -->
<view v-else-if="isLoading(pageNum)" class="placeholder loading">
<view class="spinner"></view>
</view>
<view
v-else-if="isFailed(pageNum)"
class="placeholder error"
@click="retryPage(pageNum)"
>
❌ 加载失败,点击重试
</view>
<!-- 操作按钮 -->
<view class="action-btns" v-if="hasImage(pageNum)">
<button
v-if="!isZoomed[pageNum]"
class="zoom-btn"
@click="toggleZoom(pageNum)"
>
放大查看
</button>
<button
v-else
class="reset-btn-inline"
@click="resetZoom(pageNum)"
>
重置
</button>
</view>
</view>
<!-- 全局状态 -->
<view v-if="globalLoading" class="global-status">
<view class="spinner"></view>
<text>正在加载文档...</text>
</view>
<view class="page-content">
<view class="loadEffect" v-if="!getPageImage(pageIndex) || isPageLoading(pageIndex)"></view>
<image
v-if="getPageImage(pageIndex)"
:src="getPageImage(pageIndex)"
mode="widthFix"
class="pdf-image"
@load="handlePageImageLoad(pageIndex)"
@error="handlePageImageError(pageIndex)"
:show-menu-by-longpress="false"
></image>
<view v-else-if="isPageFailed(pageIndex)" class="page-error" @click="retryLoadPage(pageIndex)">
<text class="error-text">页面加载失败,点击重试</text>
<text class="retry-count">已重试 {{ getPageRetryCount(pageIndex) }}</text>
</view>
<view v-else class="page-placeholder">
<text>页面加载中...</text>
</view>
<view v-else-if="globalError" class="global-status error">
<text>{{ errorMessage }}</text>
<button size="mini" @click="reload">重试</button>
</view>
</view>
<!-- 加载状态 -->
<view v-if="loading" class="loading-state">
<view class="loading-spinner"></view>
<text>文件较大,正在加载中...</text>
</view>
<!-- 错误状态 -->
<view v-if="error" class="error-state">
<text class="error-icon"></text>
<text class="error-message">{{ errorMessage }}</text>
<button class="retry-button" @click="initPdf">重试</button>
</view>
<!-- 加载进度 -->
<view v-if="!loading && !error && pdfPageCount > 0" class="progress-info">
<text>已加载 {{ loadedPages }}/{{ pdfPageCount }}</text>
<view class="progress-bar">
<view class="progress-inner" :style="{ width: `${(loadedPages / pdfPageCount) * 100}%` }"></view>
<view v-else-if="totalPages > 0" class="progress-bar">
<text>已加载 {{ loadedSet.size }} / {{ totalPages }}</text>
<view class="bar-bg">
<view class="bar-fill" :style="{ width: progress + '%' }"></view>
</view>
</view>
</view>
</scroll-view>
</scroll-view>
</view>
</template>
<script setup lang="ts">
import { ref, computed, watch, onMounted, onUnmounted, nextTick } from 'vue';
// 导入本地安装的PDF.js
import * as pdfjsLib from 'pdfjs-dist';
// ================== IMPORTS ==================
import { ref, computed, onMounted, onUnmounted } from 'vue';
import * as pdfjsLib from 'pdfjs-dist/build/pdf';
// 👇 关键:静态导入 worker(Vite 语法)
import pdfjsWorker from 'pdfjs-dist/build/pdf.worker?url';
import LandscapeTip from '@/components/LandscapeTip/LandscapeTip.vue';
// ========================== 类型定义 ==========================
// ================== PROPS ==================
interface PdfInfo {
title?: string;
url: string;
landscapeFlag?:boolean;
}
interface Props {
const props = withDefaults(defineProps<{
pdfInfo: PdfInfo;
autoLoad?: boolean;
lazyLoad?: boolean;
maxRetryCount?: number;
loadingStatus?:boolean;
}
// ========================== Props & Emits ==========================
const props = withDefaults(defineProps<Props>(), {
showPageName?: boolean;
showPageNumber?: boolean;
}>(), {
autoLoad: true,
lazyLoad: true,
maxRetryCount: 3,
loadingStatus:false,
showPageNumber: false,
});
const emit = defineEmits<{
loadStart: [url: string];
loadComplete: [url: string, pageCount: number];
loadError: [url: string, error: Error];
pageChange: [currentPage: number, totalPages: number];
}>();
// ========================== 响应式数据 ==========================
const pdfImages = ref<string[]>([]);
const imgLoading = ref<boolean[]>([]);
const pdfPageCount = ref(0);
const currentLoading = ref(0);
const pdfDoc = ref<any>(null);
const failedPages = ref<Record<number, number>>({});
const loadingQueue = ref<number[]>([]);
const isProcessingQueue = ref(false);
const loading = ref(false);
const error = ref(false);
const errorMessage = ref('');
const currentPage = ref(1);
const lastScrollTime = ref(0);
const scrollThrottle = ref(300);
const loadedPageSet = ref<Set<number>>(new Set()); // 记录已加载的页面
// 添加 scrollTop 用于控制滚动位置
// ================== STATE ==================
const isMounted = ref(true);
const containerHeight = ref(0);
const scrollContainerHeight = ref(0);
// PDF 文档
const pdfDoc = ref<pdfjsLib.PDFDocumentProxy | null>(null);
const totalPages = ref(0);
// 页面数据(按页存储)
const images = ref<string[]>([]);
const loading = ref<boolean[]>([]);
const failed = ref<Record<number, number>>({});
const loadedSet = ref<Set<number>>(new Set());
// 👇 每页独立尺寸(支持横版/竖版)
const pageOriginalWidth = ref<Record<number, number>>({});
const pageOriginalHeight = ref<Record<number, number>>({});
const pageRenderWidth = ref<Record<number, number>>({});
const pageRenderHeight = ref<Record<number, number>>({});
// 双模式状态
const isZoomed = ref<Record<number, boolean>>({});
const translateX = ref<Record<number, number>>({});
const translateY = ref<Record<number, number>>({});
// 滚动 & 加载队列
const scrollTop = ref(0);
// ========================== 初始化PDF.js ==========================
// 设置worker
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfjsWorker;
// ========================== 横屏提示处理 ==========================
const autoLandscapeTipRef = ref();
/**
* 提示关闭回调
*/
const onTipClose = () => {
console.log('横屏提示已关闭');
};
/**
* 提示显示回调
*/
const onTipShow = () => {
console.log('横屏提示已显示');
};
/**
* 方向变化回调
*/
const onOrientationChange = (orientation: 'portrait' | 'landscape') => {
console.log('屏幕方向变为:', orientation);
};
const lastScroll = ref(0);
const queue = ref<number[]>([]);
const isProcessingQueue = ref(false);
// 全局状态
const globalLoading = ref(false);
const globalError = ref(false);
const errorMessage = ref('');
// ========================== 计算属性 ==========================
const loadedPages = computed(() => {
return loadedPageSet.value.size;
});
// ================== COMPUTED ==================
const progress = computed(() =>
totalPages.value > 0 ? (loadedSet.value.size / totalPages.value) * 100 : 0
);
const hasMoreToLoad = computed(() => {
return loadedPages.value < pdfPageCount.value;
});
const hasImage = (pageNum: number) => !!images.value[pageNum - 1];
const getImage = (pageNum: number) => images.value[pageNum - 1] || '';
const isLoading = (pageNum: number) => !!loading.value[pageNum - 1];
const isFailed = (pageNum: number) => (failed.value[pageNum] || 0) > 0;
// ========================== 生命周期 ==========================
// ================== LIFECYCLE ==================
onMounted(() => {
if (props.autoLoad) {
initPdf();
}
const sys = uni.getSystemInfoSync();
containerHeight.value = sys.windowHeight;
scrollContainerHeight.value = sys.windowHeight - (props.pdfInfo.title ? 80 : 40);
if (props.autoLoad) init();
});
onUnmounted(() => {
isMounted.value = false;
cleanup();
});
// ========================== 监听器 ==========================
watch(() => props.pdfInfo.url, (newUrl, oldUrl) => {
if (newUrl && newUrl !== oldUrl) {
resetState();
initPdf();
}
});
// ========================== 公共方法 ==========================
/**
* 初始化PDF
*/
const initPdf = async () => {
if (!props.pdfInfo.url) {
setError('PDF URL不能为空');
return;
}
// ================== INIT ==================
const init = async () => {
if (!props.pdfInfo.url) return setError('PDF URL 为空');
try {
resetState();
loading.value = true;
error.value = false;
emit('loadStart', props.pdfInfo.url);
await loadPdfDocument();
// 初始加载前3页
const initialPages = Math.min(3, pdfPageCount.value);
console.log(`初始加载前 ${initialPages} 页`);
for (let i = 1; i <= initialPages; i++) {
addToLoadingQueue(i);
}
processLoadingQueue();
// 延迟检查其他可见页面
nextTick(() => {
setTimeout(() => {
checkVisiblePages();
}, 800);
});
reset();
globalLoading.value = true;
await loadDocument();
preloadInitialPages();
} catch (err: any) {
setError('文件读取失败')
// setError(`PDF初始化失败: ${err.message}`);
emit('loadError', props.pdfInfo.url, err);
setError(err.message || '加载失败');
} finally {
loading.value = false;
globalLoading.value = false;
}
};
/**
* 重新加载PDF
*/
const reload = () => {
initPdf();
// ================== LOAD DOCUMENT ==================
const loadDocument = async () => {
// ====== 平台差异化设置 worker ======
let useWorkerFlag = false;
// #ifdef H5
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfjsWorker; // ← 静态导入
useWorkerFlag = true;
// #endif
const doc = await pdfjsLib.getDocument({
url: props.pdfInfo.url,
cMapUrl: 'https://cdn.jsdelivr.net/npm/pdfjs-dist@2.11.338/cmaps/',
cMapPacked: true,
useWorker: useWorkerFlag,
}).promise;
pdfDoc.value = doc;
totalPages.value = doc.numPages;
// 初始化数组
images.value = new Array(doc.numPages).fill('');
loading.value = new Array(doc.numPages).fill(false);
};
// ================== PAGE LOADING ==================
const preloadInitialPages = () => {
const count = Math.min(3, totalPages.value);
for (let i = 1; i <= count; i++) addToQueue(i);
processQueue();
};
// ========================== 内部方法 ==========================
/**
* 重置状态
*/
const resetState = () => {
pdfImages.value = [];
imgLoading.value = [];
pdfPageCount.value = 0;
currentLoading.value = 0;
failedPages.value = {};
loadingQueue.value = [];
isProcessingQueue.value = false;
error.value = false;
errorMessage.value = '';
currentPage.value = 1;
loadedPageSet.value.clear();
if (pdfDoc.value) {
pdfDoc.value.destroy();
pdfDoc.value = null;
}
const addToQueue = (pageNum: number) => {
if (!queue.value.includes(pageNum)) queue.value.push(pageNum);
};
/**
* 清理资源
*/
const cleanup = () => {
if (pdfDoc.value) {
pdfDoc.value.destroy();
pdfDoc.value = null;
const processQueue = async () => {
if (isProcessingQueue.value || queue.value.length === 0) return;
isProcessingQueue.value = true;
while (queue.value.length > 0) {
const pageNum = queue.value.shift()!;
await loadPage(pageNum);
await new Promise(r => setTimeout(r, 10));
}
};
/**
* 设置错误状态
*/
const setError = (message: string) => {
error.value = true;
errorMessage.value = message;
loading.value = false;
isProcessingQueue.value = false;
};
/**
* 加载PDF文档
*/
const loadPdfDocument = async (): Promise<number> => {
const loadPage = async (pageNum: number) => {
if (!isMounted.value || !pdfDoc.value || loadedSet.value.has(pageNum)) return;
if (getRetryCount(pageNum) >= props.maxRetryCount) return;
try {
const loadingTask = pdfjsLib.getDocument({
url: props.pdfInfo.url,
cMapUrl: 'https://cdn.jsdelivr.net/npm/pdfjs-dist@2.11.338/cmaps/',
cMapPacked: true,
disableFontFace: true,
useSystemFonts: true,
isEvalSupported: false,
});
pdfDoc.value = await loadingTask.promise;
pdfPageCount.value = pdfDoc.value.numPages;
// 初始化数组
pdfImages.value = new Array(pdfPageCount.value).fill('');
imgLoading.value = new Array(pdfPageCount.value).fill(false);
emit('loadComplete', props.pdfInfo.url, pdfPageCount.value);
console.log(`PDF文档加载完成: ${props.pdfInfo.url}, 共 ${pdfPageCount.value} 页`);
return pdfPageCount.value;
} catch (err: any) {
console.error('PDF文档加载失败:', err);
throw new Error(`文档加载失败: ${err.message}`);
loading.value[pageNum - 1] = true;
const page = await pdfDoc.value.getPage(pageNum);
// 获取原始尺寸
const originalViewport = page.getViewport({ scale: 1 });
pageOriginalWidth.value[pageNum] = originalViewport.width;
pageOriginalHeight.value[pageNum] = originalViewport.height;
// 计算高清渲染尺寸(目标宽度 ~1600px)
const targetPhysicalWidth = 1600;
const scale = Math.min(5.0, Math.max(1.0, targetPhysicalWidth / originalViewport.width));
const renderViewport = page.getViewport({ scale });
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
if (!ctx) {
console.error('Failed to get 2D context for canvas.');
return;
}
canvas.width = renderViewport.width;
canvas.height = renderViewport.height;
await page.render({ canvasContext: ctx, viewport: renderViewport }).promise;
// 存储渲染结果
pageRenderWidth.value[pageNum] = canvas.width;
pageRenderHeight.value[pageNum] = canvas.height;
images.value[pageNum - 1] = canvas.toDataURL('image/jpeg', 0.95);
loadedSet.value.add(pageNum);
delete failed.value[pageNum];
canvas.width = canvas.height = 0;
} catch (err) {
console.error(`Page ${pageNum} error:`, err);
failed.value[pageNum] = (failed.value[pageNum] || 0) + 1;
} finally {
if (isMounted.value) loading.value[pageNum - 1] = false;
}
};
/**
* 滚动处理 - 使用 scroll-view 的 scroll 事件
*/
const handleScroll = (e: any) => {
if (!props.lazyLoad || loading.value) return;
const now = Date.now();
if (now - lastScrollTime.value < scrollThrottle.value) {
return;
}
lastScrollTime.value = now;
// 使用防抖
clearTimeout((window as any).scrollTimer);
(window as any).scrollTimer = setTimeout(() => {
checkVisiblePages(e.detail.scrollTop);
}, 100);
// ================== ZOOM MODE ==================
const toggleZoom = (pageNum: number) => {
if (!hasImage(pageNum)) return;
isZoomed.value[pageNum] = true;
};
/**
* 检查可见页面 - 修改为接收 scrollTop 参数
*/
const checkVisiblePages = (scrollTop: number) => {
if (pdfPageCount.value === 0 || loadingQueue.value.length > 5) return;
console.log('开始检查可见页面...', scrollTop);
const windowHeight = uni.getSystemInfoSync().windowHeight;
// 计算可见区域
const visibleTop = scrollTop - 500; // 提前500px开始加载
const visibleBottom = scrollTop + windowHeight + 1000; // 延后1000px加载
// 检查每个页面是否在可见区域内
for (let i = 1; i <= pdfPageCount.value; i++) {
// 如果页面已经加载或正在加载,跳过
if (loadedPageSet.value.has(i) || isPageLoading(i)) {
continue;
}
// 检查页面位置
uni.createSelectorQuery()
.select(`#page-${i}`)
.boundingClientRect((rect: any) => {
if (rect) {
const pageTop = scrollTop + rect.top;
const pageBottom = scrollTop + rect.bottom;
// 如果页面在可见区域内
if (pageBottom > visibleTop && pageTop < visibleBottom) {
console.log(`页面 ${i} 在可见区域内,准备加载`);
addToLoadingQueue(i);
}
// 更新当前页
if (rect.top < windowHeight / 2 && rect.bottom > windowHeight / 2) {
if (currentPage.value !== i) {
currentPage.value = i;
emit('pageChange', i, pdfPageCount.value);
}
}
}
})
.exec();
}
// 处理加载队列
setTimeout(() => {
processLoadingQueue();
}, 50);
const resetZoom = (pageNum: number) => {
isZoomed.value[pageNum] = false;
translateX.value[pageNum] = 0;
translateY.value[pageNum] = 0;
};
/**
* 添加到加载队列
*/
const addToLoadingQueue = (pageNumber: number) => {
if (!loadingQueue.value.includes(pageNumber) &&
!loadedPageSet.value.has(pageNumber) &&
!isPageLoading(pageNumber)) {
console.log(`添加页面 ${pageNumber} 到加载队列`);
loadingQueue.value.push(pageNumber);
// 限制队列长度,避免一次性加载太多
if (loadingQueue.value.length > 10) {
loadingQueue.value = loadingQueue.value.slice(0, 10);
}
}
// ================== DRAGGING ==================
const onTouchStart = (e: any, pageNum: number) => {
const touches = e.touches || [];
if (touches.length !== 1) return;
const x = touches[0].clientX - (translateX.value[pageNum] || 0);
const y = touches[0].clientY - (translateY.value[pageNum] || 0);
(window as any).pdfTouchStart = { x, y, pageNum };
};
/**
* 处理加载队列
*/
const processLoadingQueue = async () => {
if (isProcessingQueue.value || loadingQueue.value.length === 0) return;
const onTouchMove = (e: any, pageNum: number) => {
const touches = e.touches || [];
if (touches.length !== 1 || !isZoomed.value[pageNum]) return;
isProcessingQueue.value = true;
const start = (window as any).pdfTouchStart;
if (!start || start.pageNum !== pageNum) return;
try {
// 每次处理1页
const pagesToLoad = loadingQueue.value.splice(0, 1);
console.log(`处理加载队列: 加载页面 ${pagesToLoad[0]}`);
for (const pageNumber of pagesToLoad) {
await loadPdfPage(pageNumber);
}
} catch (err) {
console.error('处理加载队列失败:', err);
} finally {
isProcessingQueue.value = false;
// 如果队列中还有任务,继续处理
if (loadingQueue.value.length > 0) {
setTimeout(processLoadingQueue, 200);
} else {
// 队列处理完成后,再次检查可见页面
setTimeout(() => {
checkVisiblePages();
}, 300);
}
}
const currentX = touches[0].clientX - start.x;
const currentY = touches[0].clientY - start.y;
const sys = uni.getSystemInfoSync();
const viewW = sys.windowWidth;
const viewH = sys.windowHeight;
const imgW = pageRenderWidth.value[pageNum] || 0;
const imgH = pageRenderHeight.value[pageNum] || 0;
if (imgW === 0 || imgH === 0) return;
const minX = viewW - imgW > 0 ? 0 : viewW - imgW;
const minY = viewH - imgH > 0 ? 0 : viewH - imgH;
const maxX = 0;
const maxY = 0;
translateX.value[pageNum] = Math.min(maxX, Math.max(minX, currentX));
translateY.value[pageNum] = Math.min(maxY, Math.max(minY, currentY));
};
/**
* 加载PDF页面
*/
const loadPdfPage = async (pageNumber: number) => {
if (loadedPageSet.value.has(pageNumber)) return;
const retryCount = getPageRetryCount(pageNumber);
if (retryCount >= props.maxRetryCount) {
console.warn(`页面 ${pageNumber} 已达到最大重试次数`);
return;
}
try {
imgLoading.value[pageNumber - 1] = true;
currentLoading.value++;
console.log(`开始加载页面 ${pageNumber}...`);
if (!pdfDoc.value) {
throw new Error('PDF文档未加载');
}
const page = await pdfDoc.value.getPage(pageNumber);
// 根据设备像素比动态设置缩放
const pixelRatio = window.devicePixelRatio || 1;
const scale = Math.max(1.5, pixelRatio); // 至少 1.5 倍,高分屏自动更高
const viewport = page.getViewport({ scale });
// const viewport = page.getViewport({ scale: 1.8 });
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
if (!context) {
throw new Error('无法获取Canvas上下文');
}
canvas.width = viewport.width;
canvas.height = viewport.height;
const renderContext = {
canvasContext: context,
viewport: viewport
};
await page.render(renderContext).promise;
const imageData = canvas.toDataURL('image/jpeg', 0.85);
pdfImages.value[pageNumber - 1] = imageData;
loadedPageSet.value.add(pageNumber);
console.log(`页面 ${pageNumber} 加载完成,当前已加载: ${Array.from(loadedPageSet.value).join(',')}`);
// 清理
canvas.width = 0;
canvas.height = 0;
// 清除失败记录
if (failedPages.value[pageNumber]) {
delete failedPages.value[pageNumber];
}
} catch (err: any) {
console.error(`页面 ${pageNumber} 加载失败:`, err);
// 记录失败次数
if (!failedPages.value[pageNumber]) {
failedPages.value[pageNumber] = 1;
} else {
failedPages.value[pageNumber]++;
}
// 对有问题的页面生成占位图
if (err.message.includes('private field') || err.message.includes('TypeError')) {
pdfImages.value[pageNumber - 1] = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAwIiBoZWlnaHQ9IjUwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjhmOWZhIi8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgZmlsbD0iIzk5OSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPuW3suino+eggTwvdGV4dD48L3N2Zz4=';
loadedPageSet.value.add(pageNumber);
}
} finally {
imgLoading.value[pageNumber - 1] = false;
currentLoading.value--;
}
const onTouchEnd = () => {
delete (window as any).pdfTouchStart;
};
/**
* 手动加载下一页
*/
const loadNextPage = () => {
if (pdfPageCount.value === 0) return;
// 找到第一个未加载的页面
for (let i = 1; i <= pdfPageCount.value; i++) {
if (!loadedPageSet.value.has(i) && !isPageLoading(i)) {
console.log(`手动加载页面 ${i}`);
addToLoadingQueue(i);
processLoadingQueue();
break;
}
}
// ================== LAZY LOAD ==================
const onScroll = (e: any) => {
if (!props.lazyLoad || globalLoading.value) return;
scrollTop.value = e.detail.scrollTop;
const now = Date.now();
if (now - lastScroll.value < 200) return;
lastScroll.value = now;
checkVisible();
};
/**
* 重试加载页面
*/
const retryLoadPage = (pageNumber: number) => {
const retryCount = getPageRetryCount(pageNumber);
if (retryCount >= props.maxRetryCount) {
uni.showToast({
title: '已达到最大重试次数',
icon: 'none',
duration: 2000
});
return;
}
if (failedPages.value[pageNumber]) {
delete failedPages.value[pageNumber];
const checkVisible = () => {
if (totalPages.value === 0) return;
const sys = uni.getSystemInfoSync();
const winHeight = sys.windowHeight;
const top = scrollTop.value;
// 👇 关键:不依赖页面高度,直接按页码区间预加载
// 假设每页至少占 200px(保守值)
const MIN_PAGE_HEIGHT = 200; // px
const visibleStartPage = Math.max(1, Math.floor(top / MIN_PAGE_HEIGHT));
const visibleEndPage = Math.min(
totalPages.value,
Math.ceil((top + winHeight * 2) / MIN_PAGE_HEIGHT)
);
// 预加载前后各 2 页(共约 5~7 页)
const startPage = Math.max(1, visibleStartPage - 2);
const endPage = Math.min(totalPages.value, visibleEndPage + 2);
for (let i = startPage; i <= endPage; i++) {
if (!loadedSet.value.has(i) && !isLoading(i) && !isFailed(i)) {
addToQueue(i);
}
}
// 从已加载集合中移除
loadedPageSet.value.delete(pageNumber);
pdfImages.value[pageNumber - 1] = '';
addToLoadingQueue(pageNumber);
processLoadingQueue();
};
// ========================== 辅助方法 ==========================
const getPageImage = (pageIndex: number): string => {
return pdfImages.value[pageIndex - 1] || '';
if (queue.value.length > 0 && !isProcessingQueue.value) {
processQueue();
}
};
const isPageLoading = (pageIndex: number): boolean => {
return imgLoading.value[pageIndex - 1] || false;
// ================== UTILS ==================
const retryPage = (pageNum: number) => {
if (getRetryCount(pageNum) < props.maxRetryCount) {
addToQueue(pageNum);
processQueue();
}
};
const isPageFailed = (pageIndex: number): boolean => {
const retryCount = getPageRetryCount(pageIndex);
return retryCount > 0 && retryCount <= props.maxRetryCount;
const getRetryCount = (pageNum: number) => failed.value[pageNum] || 0;
const reload = () => init();
const reset = () => {
images.value = [];
loading.value = [];
failed.value = {};
loadedSet.value.clear();
queue.value = [];
isZoomed.value = {};
translateX.value = {};
translateY.value = {};
pageOriginalWidth.value = {};
pageOriginalHeight.value = {};
pageRenderWidth.value = {};
pageRenderHeight.value = {};
globalError.value = false;
errorMessage.value = '';
};
const getPageRetryCount = (pageIndex: number): number => {
return failedPages.value[pageIndex] || 0;
const cleanup = () => {
if (pdfDoc.value) {
pdfDoc.value.destroy();
pdfDoc.value = null;
}
};
const handlePageImageLoad = (pageIndex: number) => {
console.log(`页面 ${pageIndex} 图片加载完成`);
const setError = (msg: string) => {
globalError.value = true;
errorMessage.value = msg;
};
const handlePageImageError = (pageIndex: number) => {
console.error(`页面 ${pageIndex} 图片加载失败`);
const getPageMinHeight = (pageNum: number) => {
if (loadedSet.value.has(pageNum)) {
const w = pageRenderWidth.value[pageNum] || 1;
const h = pageRenderHeight.value[pageNum] || 1;
return uni.getSystemInfoSync().windowWidth * (h / w);
}
return 400; // px
};
// 暴露方法给父组件
// ================== EXPOSE ==================
defineExpose({
initPdf,
reload,
loadNextPage, // 新增手动加载下一页方法
getCurrentPage: () => currentPage.value,
getTotalPages: () => pdfPageCount.value,
getLoadedPages: () => Array.from(loadedPageSet.value),
// 手动控制横屏提示
showLandscapeTip: () => autoLandscapeTipRef.value?.show?.(),
hideLandscapeTip: () => autoLandscapeTipRef.value?.hide?.(),
resetLandscapeTip: () => autoLandscapeTipRef.value?.reset?.()
init,
});
</script>
<style scoped lang="scss">
.pdf-viewer {
width: 100%;
height: 100vh;
background: #ffffff;
display: flex;
flex-direction: column;
}
.pdf-scroll-view {
flex: 1;
height: 0; // 重要:让 scroll-view 正确计算高度
background: #fff;
}
.pdf-info {
display: flex;
justify-content: space-between;
align-items: center;
.pdf-header {
padding: 24rpx;
background: #f8f9fa;
border-bottom: 1rpx solid #e8e8e8;
.pdf-title {
font-size: 32rpx;
font-weight: 600;
color: #333;
flex: 1;
}
.pdf-page-count {
font-size: 26rpx;
color: #666;
background: #e6f7ff;
padding: 8rpx 16rpx;
border-radius: 20rpx;
}
font-size: 32rpx;
font-weight: bold;
}
.page-container {
margin-bottom: 32rpx;
border-bottom: 1rpx solid #f0f0f0;
&:last-child {
border-bottom: none;
}
}
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 24rpx;
background: #fafafa;
.page-number {
font-size: 28rpx;
color: #333;
font-weight: 500;
}
.page-status {
font-size: 24rpx;
&.success {
color: #52c41a;
}
&.error {
color: #ff4d4f;
}
}
.pdf-scroll {
width: 100%;
}
.page-content {
.page-item {
position: relative;
min-height: 400rpx;
.pdf-image {
width: 100%;
height: auto;
display: block;
// 禁用长按菜单
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
// 禁止长按保存
pointer-events: none;
}
margin-bottom: 10rpx;
padding: 0 24rpx;
}
.loadEffect {
width: 200rpx;
height: 200rpx;
.page-number-tag {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: url('../../static/range-fullloading/loading.gif') no-repeat center;
background-size: contain;
top: -40rpx;
left: 24rpx;
background: #20269B;
color: white;
padding: 4rpx 12rpx;
border-radius: 20rpx;
font-size: 24rpx;
z-index: 10;
}
.page-error {
.pdf-image-fit {
width: 100%;
display: block;
border-radius: 12rpx;
box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.05);
}
.placeholder {
width: 100%;
height: 400rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 400rpx;
background: #fff2f2;
border: 1rpx dashed #ff4d4f;
border-radius: 8rpx;
align-items: center;
background: #f9f9f9;
border-radius: 12rpx;
font-size: 28rpx;
color: #999;
}
.placeholder.error {
color: #ff4d4f;
.error-text {
font-size: 28rpx;
margin-bottom: 16rpx;
}
.retry-count {
font-size: 24rpx;
color: #999;
}
}
.page-placeholder {
display: flex;
align-items: center;
justify-content: center;
height: 400rpx;
background: #f8f9fa;
color: #666;
font-size: 28rpx;
.zoom-container {
overflow: hidden;
background: #f9f9f9;
border-radius: 12rpx;
min-height: 400rpx;
}
.loading-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80rpx 0;
.loading-spinner {
width: 40rpx;
height: 40rpx;
border: 4rpx solid #e8e8e8;
border-top: 4rpx solid #20269B;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 24rpx;
}
text {
color: #666;
font-size: 28rpx;
}
.image-original {
position: relative;
transition: transform 0.1s ease-out;
}
.error-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80rpx 0;
text-align: center;
.error-icon {
font-size: 60rpx;
margin-bottom: 24rpx;
}
.error-message {
color: #ff4d4f;
font-size: 28rpx;
margin-bottom: 32rpx;
}
.retry-button {
background: #20269B;
color: white;
border: none;
padding: 16rpx 32rpx;
border-radius: 8rpx;
font-size: 28rpx;
}
.reset-btn {
position: absolute;
bottom: 20rpx;
right: 20rpx;
background: rgba(0,0,0,0.7);
color: white;
padding: 12rpx 20rpx;
border-radius: 6rpx;
font-size: 24rpx;
z-index: 999;
}
.progress-info {
padding: 12rpx;
background: #f8f9fa;
.global-status {
text-align: center;
text {
display: block;
color: #666;
font-size: 26rpx;
margin-bottom: 16rpx;
padding: 80rpx 0;
color: #666;
.spinner {
margin: 0 auto 16rpx;
}
}
.global-status.error button {
margin-top: 20rpx;
background: #20269B;
color: white;
border: none;
}
.progress-bar {
width: 100%;
height: 8rpx;
background: #e8e8e8;
border-radius: 4rpx;
overflow: hidden;
.progress-inner {
height: 100%;
background: #20269B;
transition: width 0.3s ease;
padding: 20rpx;
text-align: center;
font-size: 26rpx;
color: #666;
.bar-bg {
width: 100%;
height: 8rpx;
background: #eee;
border-radius: 4rpx;
margin-top: 8rpx;
.bar-fill {
height: 100%;
background: #20269B;
transition: width 0.3s;
}
}
}
.action-buttons {
.spinner {
width: 40rpx;
height: 40rpx;
border: 4rpx solid #eee;
border-top: 4rpx solid #20269B;
border-radius: 50%;
animation: spin 1s linear infinite;
}
.action-btns {
display: flex;
justify-content: space-between;
padding: 20rpx 16rpx;
background: #f8f9fa;
border-top: 1rpx solid #e8e8e8;
.action-btn {
flex: 1;
margin: 0 8rpx;
background: #20269B;
color: white;
border: none;
padding: 16rpx;
border-radius: 8rpx;
font-size: 26rpx;
&:disabled {
background: #ccc;
color: #999;
}
}
justify-content: center;
margin-top: 20rpx;
}
.zoom-btn, .reset-btn-inline {
padding: 8rpx 24rpx;
font-size: 24rpx;
border-radius: 8rpx;
background: #20269B;
color: white;
border: none;
line-height: 1;
}
.reset-btn-inline {
background: #666;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
to { transform: rotate(360deg); }
}
</style>
\ No newline at end of file
......@@ -107,6 +107,7 @@
uni.setStorageSync('isLogin', '1');
uni.setStorageSync('loginType', 'codelogin');
uni.setStorageSync('cffp_userId', res.data['userId']);
console.log('============',uni.getStorageSync('cffp_userId'))
uni.setStorageSync('uni-token', res.data['token']);
//关闭弹窗
this.$refs.loginPopup.close();
......
......@@ -8,7 +8,7 @@
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
// 判断是否在小程序Webview环境中
function isInMiniProgram() {
// 更安全的小程序环境判断
......@@ -18,7 +18,7 @@
return false;
}
}
// 页面加载完成后执行
document.addEventListener('DOMContentLoaded', function() {
// 非小程序环境才加载微信JS-SDK
......@@ -35,7 +35,7 @@
<title>银盾家办</title>
<link rel="stylesheet" href="./static/font/iconfont.css">
<link rel="shortcut icon" href="./static/suplogo.ico">
<script src="/static/uni.webview.1.5.7.js"></script>
</head>
<body>
......@@ -43,5 +43,18 @@
<!--app-html-->
</div>
<script type="module" src="/main.js"></script>
<!-- uni 的 SDK,必须引用。 -->
<script type="text/javascript" src="./static/uni.webview.1.5.4.js"></script>
<script type="text/javascript">
// 验证脚本是否加载成功(调试关键:控制台打印 webViewJs 确认)
const webViewJs = window.uni?.webView;
if (!webViewJs) {
console.error('uni.webview.js 加载失败!请检查路径是否正确');
} else {
console.log('uni.webview.js 加载成功', webViewJs);
// 将 webViewJs 挂载到 window 全局,供 Vue 组件访问
window.webViewJs = webViewJs;
}
</script>
</body>
</html>
\ No newline at end of file
<template>
<view class="container">
<!-- 禁用弹窗 -->
<restrictedTip
ref="restrictedOrCanelTip"
:showCode="showCode"
confirmText="前往首页"
:content="restrictedOrCanelContent"
@confirm="gotoIndex()"
/>
<image
class="imgbox"
:src="baseURL + `/${imgType}/static/images/applyBg.png`"
mode="widthFix"
></image>
<restrictedTip ref="restrictedOrCanelTip" :showCode="showCode" confirmText="前往首页"
:content="restrictedOrCanelContent" @confirm="gotoIndex()" />
<image class="imgbox" src="../assets/images/bg1.jpg" mode="widthFix"></image>
<view class="wapper">
<view style="flex: 1;">
<view class="header">
<!-- <view class="header">
<view class="one">
合伙人加盟
</view>
<view class="two">
优质资源,专业服务
</view>
</view> -->
<view class="header">
<view class="headerLeft">
<view class="one">
合伙人加盟
</view>
<view class="two">
优质资源,专业服务
</view>
</view>
<view class="headerRight">
<image class="headerImg" src="@/static/suplogo.png" mode="widthFix"></image>
</view>
</view>
<view class="applyBox">
<view style="height: 550rpx;">
<view class="inputBox">
......@@ -31,13 +34,8 @@
<text class="require">*</text>昵称 <text class="desTxt">(用于邀请好友及统计业绩显示)</text>
</view>
<view class="">
<input
class="user-input"
maxlength="10"
type="text"
placeholder="请输入2~10个字符"
v-model="form.nickName"
/>
<input class="user-input" maxlength="10" type="text" placeholder="请输入2~10个字符"
v-model="form.nickName" />
</view>
</view>
<view class="inputBox">
......@@ -45,46 +43,30 @@
<text class="require">*</text>手机号码 <text class="desTxt">(账号唯一标识)</text>
</view>
<view class="codeBox">
<input
type="number"
class="user-input"
name="mobileNo"
placeholder="请输入手机号"
v-model="form.mobile"
maxlength="11"
:disabled="editMobile"
/>
<view
:class="{'grey':disabledSendBtn}"
@click="sendMessage()"
v-if="showVerificationCode"
>
<input type="number" class="user-input" name="mobileNo" placeholder="请输入手机号"
v-model="form.mobile" maxlength="11" :disabled="editMobile" />
<view :class="{'grey':disabledSendBtn}" @click="sendMessage()"
v-if="showVerificationCode">
{{sendCodeHtml}}
</view>
</view>
</view>
</view>
<view class="inputBox" v-if="showVerificationCode">
<view class="txt">
<text class="require">*</text>验证码
<text class="require">*</text>验证码
</view>
<view class="">
<input
type="number"
class="user-input"
name="mobileNo"
placeholder="请输入短信验证码"
v-model="form.code"
maxlength="6"
/>
<input type="number" class="user-input" name="mobileNo" placeholder="请输入短信验证码"
v-model="form.code" maxlength="6" />
</view>
</view>
<view class="protol">
<view class="empty" v-if="!agreeFlag" @click="agreeFlag=true"></view>
<text v-else class="iconfont icon-icon_duihao-mian" @click="agreeFlag=false"></text>
<text style="color: #666;">我已阅读并同意</text>
<text style="color: #20269B;" @click="getFile(1)">服务协议</text>
<text style="color: #20269B;" @click="getFile(1)">服务协议</text>
<text style="color: #666666;"></text>
<text style="color: #20269B;" @click="getFile(2)">隐私条款</text>
<text style="color: #20269B;" @click="getFile(2)">隐私条款</text>
</view>
</view>
<view class="btnBox" @click="gotoApply">
......@@ -93,29 +75,15 @@
</view>
</view>
<view class="footer">
银盾家族办公室
银盾家
</view>
</view>
<!-- 已加盟为合伙人提示弹窗组件 -->
<everyJoinPopup
ref="everyJoinPopup"
@continue="jumpPage"
:showCanel="false"
/>
<!-- 成功加盟为合伙人提示弹窗组件 -->
<everyJoinPopup
ref="successJoinPopup"
@continue="jumpPage(e)"
content="您已加盟为银盾家办合伙人"
twoContent='购买一单"YD家庭财务法律卡"即可升级为新锐合伙人,享受组织利益'
continueText="前往购买"
cancelText="暂不购买,继续浏览"
fontColor="#20279B"
:maskClick="false"
icon="icon-dianzan"
iconSize='80rpx'
:showCanel="true"
/>
<everyJoinPopup ref="everyJoinPopup" @continue="jumpPage" :showCanel="false" />
<!-- 成功加盟为合伙人提示弹窗组件 -->
<everyJoinPopup ref="successJoinPopup" @continue="jumpPage(e)" content="您已加盟为银盾家办合伙人"
twoContent='购买一单"财务健康智能体检"即可升级为新锐合伙人,享受组织利益' continueText="前往购买" cancelText="暂不购买,继续浏览" fontColor="#20279B"
:maskClick="false" icon="icon-dianzan" iconSize='80rpx' :showCanel="true" />
</view>
</template>
......@@ -128,114 +96,116 @@
import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
import restrictedTip from '@/components/commonPopup/restrictedTip.vue';
export default {
components:{
components: {
everyJoinPopup,
restrictedTip
},
data() {
return {
companyInfo:environment.companyInfo,
imgType:environment.companyInfo.imgType,
baseURL:environment.baseURL,
form:{
mobile:'',
nickName:'',
code:''
companyInfo: environment.companyInfo,
shareURL: environment.shareURL,
form: {
mobile: '',
nickName: '',
code: ''
},
agreeFlag:false,
sendCodeHtml:'发送验证码',
disabledSendBtn:false,
timer:null,
remainTimes:60,
loginType:uni.getStorageSync('loginType'),
userInfo:'',
userId: uni.getStorageSync('cffp_userId'),//本人id,
InviteeUserId:'',//被邀请人id
inviteUserId:'',//邀请人id,
editNickName:false,
editMobile:false,
shareId:'',//邀请人分享得id
invitationCode:'',//邀请码
showCode:false ,//弹窗是否展示客服二维码
restrictedOrCanelContent:'', //禁用/注销展示文本
sharePosterObj:{invitationCode:'',inviteUserId:''},//通过分享海报进来
showVerificationCode:false,//验证码是否展示
agreeFlag: false,
sendCodeHtml: '发送验证码',
disabledSendBtn: false,
timer: null,
remainTimes: 60,
loginType: uni.getStorageSync('loginType'),
userInfo: '',
userId: uni.getStorageSync('cffp_userId'), //本人id,
InviteeUserId: '', //被邀请人id
inviteUserId: '', //邀请人id,
editNickName: false,
editMobile: false,
shareId: '', //邀请人分享得id
invitationCode: '', //邀请码
showCode: false, //弹窗是否展示客服二维码
restrictedOrCanelContent: '', //禁用/注销展示文本
sharePosterObj: { invitationCode: '', inviteUserId: '' }, //通过分享海报进来
showVerificationCode: false, //验证码是否展示,
}
},
onLoad(options){
if(uni.getStorageSync('loginType')){
onLoad(options) {
if (uni.getStorageSync('loginType')) {
this.loginType = uni.getStorageSync('loginType')
}
this.inviteUserId = ''
if(options.inviteUserId){
if (options.inviteUserId) {
this.inviteUserId = options.inviteUserId
}
if(options.invitationCode){
if (options.invitationCode) {
this.invitationCode = options.invitationCode
}
// 邀请链接进来的统一走注册加盟
if(options.shareId){
if (options.shareId) {
this.shareId = options.shareId
this.getqueryById(options.shareId)
// uni.clearStorageSync()
// uni.setStorageSync('loginType', 'visitor')
}
},
onShow(){
if(uni.getStorageSync('loginType')){
onShow() {
console.log('onShowloginType', uni.getStorageSync('loginType'));
if (uni.getStorageSync('loginType')) {
this.loginType = uni.getStorageSync('loginType')
}
if(uni.getStorageSync('cffp_userInfo')){
if (uni.getStorageSync('cffp_userInfo')) {
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
}
if(uni.getStorageSync('cffp_userId')){
if (uni.getStorageSync('cffp_userId')) {
this.userId = uni.getStorageSync('cffp_userId')
}
if(!uni.getStorageSync('loginType') || this.loginType == 'visitor'){
if (!uni.getStorageSync('loginType') || this.loginType == 'visitor') {
this.loginType = 'visitor'
this.checkToken()
}
// 非邀请状态
if(!this.shareId&&this.loginType == 'codelogin'&&this.userInfo.mobile){
if (!this.shareId && this.loginType == 'codelogin' && this.userInfo.mobile) {
this.form.mobile = this.userInfo.mobile
this.editMobile = true
this.showVerificationCode = false
}
// 非邀请状态
if(!this.shareId&&this.loginType == 'codelogin'&&!this.form.nickName){
if (!this.shareId && this.loginType == 'codelogin' && !this.form.nickName) {
this.queryInfo()
}
// 登录状态 非邀请
if(this.loginType == 'codelogin' && !this.shareId){
if (this.loginType == 'codelogin' && !this.shareId) {
// #ifdef H5
initJssdkShare(() => {
setWechatShare();
setWechatShare();
}, window.location.href);
// #endif
}else {
} else {
this.showVerificationCode = true
}
},
methods: {
gotoIndex(){
gotoIndex() {
uni.switchTab({
url:'/pages/index/index'
})
url: '/pages/index/index'
})
this.$refs.restrictedOrCanelTip.close()
},
// 未登录状态下需要重新获取token
checkToken(){
api.checkToken().then(res=>{
if(res['success']){}else{
api.obtainToken().then(res=>{
if(res.success){
uni.setStorageSync('uni-token',res.data['token']);
checkToken() {
api.checkToken().then(res => {
if (res['success']) {} else {
api.obtainToken().then(res => {
if (res.success) {
uni.setStorageSync('uni-token', res.data['token']);
// #ifdef H5
initJssdkShare(() => {
setWechatShare();
setWechatShare();
}, window.location.href);
// #endif
}
......@@ -243,10 +213,9 @@
}
})
},
getqueryById(shareId){
api.queryById({id:shareId}).then(res =>{
console.log('res.data.data',res.data.data);
getqueryById(shareId) {
api.queryById({ id: shareId }).then(res => {
this.form.nickName = res.data.data.name
this.form.mobile = res.data.data.mobileNumber
this.editNickName = this.editMobile = true
......@@ -257,139 +226,146 @@
// return
// }
// 之前登录过,但和申请加盟的账号不一致
if(this.userInfo&&(this.userInfo.mobile !==this.form.mobile )){
if (this.userInfo && (this.userInfo.mobile !== this.form.mobile)) {
this.showVerificationCode = true
uni.setStorageSync('loginType', 'visitor')
this.loginType = 'visitor'
return
}
if(res.data.data.isPartner&& this.loginType == 'codelogin'){
if (res.data.data.isPartner && this.loginType == 'codelogin') {
this.$refs.successJoinPopup.open()
}
})
},
jumpPage(e){
jumpPage(e) {
// e===1时,前往购买;e===2暂不购买;目前全部跳转到首页,不进行判断
uni.switchTab({
url:'/pages/index/index'
url: '/pages/index/index'
})
this.$refs.successJoinPopup.close()
this.$refs.everyJoinPopup.close()
},
getFile(type){
let typeName = type==1?'服务协议':type==2?'隐私条款':''
getFile(type) {
let typeName = type == 1 ? '服务协议' : type == 2 ? '隐私条款' : ''
dataHandling.pocessTracking(
'查看协议',
`查看${typeName}`,
'点击',
2,
'申请加盟',
'pages/saleCourseLists/saleCourseLists'
'查看协议',
`查看${typeName}`,
'点击',
2,
'申请加盟',
'pages/saleCourseLists/saleCourseLists'
)
uni.navigateTo({
url:`/myPackageA/ruleAndContract/clause?type=${type}`
url: `/myPackageA/ruleAndContract/clause?type=${type}`
})
},
c_agreeFlag(){
this.agreeFlag=!this.agreeFlag;
c_agreeFlag() {
this.agreeFlag = !this.agreeFlag;
},
delayTime() {
this.disabledSendBtn = true;
this.timer = setInterval(() => {
this.remainTimes--;
this.sendCodeHtml = `${this.remainTimes}(S)`;
if (this.remainTimes <= 0) {
this.sendCodeHtml = '获取验证码';
this.remainTimes = 60;
this.disabledSendBtn = false;
clearInterval(this.timer);
}
this.remainTimes--;
this.sendCodeHtml = `${this.remainTimes}(S)`;
if (this.remainTimes <= 0) {
this.sendCodeHtml = '获取验证码';
this.remainTimes = 60;
this.disabledSendBtn = false;
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'])
}
})
}
},
gotoApply(){
if(uni.getStorageSync('sharePosterObj')){
} else {
common.errorDialog(2, '请填写手机号')
}
},
gotoApply: dataHandling.debounce(function () {
uni.showLoading({
title: '申请中...'
});
if (uni.getStorageSync('sharePosterObj')) {
this.sharePosterObj = uni.getStorageSync('sharePosterObj')
}
console.log('this.sharePosterObj',this.sharePosterObj)
console.log('this.sharePosterObj', this.sharePosterObj)
// 登录并且是禁用状态
if(this.loginType == 'codelogin'&& this.userInfo.userIsActive == 2){
if (this.loginType == 'codelogin' && this.userInfo.userIsActive == 2) {
this.showCode = true
this.restrictedOrCanelContent = '您的账号处在不可用状态,请扫码添加客服咨询情况'
this.$refs.restrictedOrCanelTip.open()
return
}
// 登录并且是注销状态 前端不判断,通过申请加盟的接口判断
if(!this.form.nickName){
common.errorDialog(1,'请输入昵称');
if (!this.form.nickName) {
common.errorDialog(1, '请输入昵称');
return false;
}
if(this.form.nickName&&this.form.nickName.length<2){
common.errorDialog(1,'昵称长度为2~10个字符');
return
if (this.form.nickName && this.form.nickName.length < 2) {
common.errorDialog(1, '昵称长度为2~10个字符');
return
}
if(!this.form.mobile){
common.errorDialog(1,'请输入手机号');
if (!this.form.mobile) {
common.errorDialog(1, '请输入手机号');
return false;
}
if(!common.mobileNoValid(this.form.mobile)){
common.errorDialog(2,'手机号格式填写错误');
if (!common.mobileNoValid(this.form.mobile)) {
common.errorDialog(2, '手机号格式填写错误');
return false;
}
if(!this.loginType || this.loginType=== 'visitor'){
if(!this.form.code){
common.errorDialog(1,'请输入验证码');
if (!this.loginType || this.loginType === 'visitor') {
if (!this.form.code) {
common.errorDialog(1, '请输入验证码');
return false;
}
}
if(!this.agreeFlag){
if (!this.agreeFlag) {
uni.showToast({
title: '请阅读并勾选'+`${this.companyInfo.companyFullName}`+'服务协议和隐私条款',
title: '请阅读并勾选' + `${this.companyInfo.companyFullName}` + '服务协议和隐私条款',
duration: 3000,
icon: 'none'
icon: 'none'
})
return false;
}
const params = {
loginType:'3',
loginType: '3',
...this.form
}
if(this.loginType == 'codelogin'){
if (this.loginType == 'codelogin') {
this.getApply()
uni.hideLoading()
return
}
if(!this.loginType || this.loginType == 'visitor'){
api.loginVerification(params).then((res)=>{
if(res['success']){
if (!this.loginType || this.loginType == 'visitor') {
api.loginVerification(params).then((res) => {
uni.hideLoading()
if (res['success']) {
// 不能登录并且是禁用状态
if(res.data.userIsActive == 2){
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('isLogin', '1');
uni.setStorageSync('loginType', 'codelogin');
uni.setStorageSync('cffp_userId', this.userId);
uni.setStorageSync('uni-token', res.data['token']);
this.queryInfo()
......@@ -404,16 +380,16 @@
// return
// }
// 是合伙人就不让在加盟
if(res.data.isPartner && res.data.partnerIsActive==1){
if (res.data.isPartner && res.data.partnerIsActive == 1) {
this.$refs.everyJoinPopup.open()
return
}
// 不是合伙人就加盟
if(!res.data.isPartner && res.data.partnerIsActive!=1){
if (!res.data.isPartner && res.data.partnerIsActive != 1) {
this.getApply()
}
}else{
} else {
uni.showToast({
title: res['message'],
duration: 2000,
......@@ -421,19 +397,119 @@
})
}
})
}
},
}, 500),
// gotoApply() {
// // this.loginType = uni.getStorageSync('loginType')
// 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.form.nickName) {
// common.errorDialog(1, '请输入昵称');
// return false;
// }
// if (this.form.nickName && this.form.nickName.length < 2) {
// common.errorDialog(1, '昵称长度为2~10个字符');
// return
// }
// if (!this.form.mobile) {
// common.errorDialog(1, '请输入手机号');
// return false;
// }
// if (!common.mobileNoValid(this.form.mobile)) {
// common.errorDialog(2, '手机号格式填写错误');
// return false;
// }
// if (!this.loginType || this.loginType === 'visitor') {
// if (!this.form.code) {
// common.errorDialog(1, '请输入验证码');
// return false;
// }
// }
// if (!this.agreeFlag) {
// uni.showToast({
// title: '请阅读并勾选' + `${this.companyInfo.companyFullName}` + '服务协议和隐私条款',
// duration: 3000,
// icon: 'none'
// })
// return false;
// }
// const params = {
// loginType: '3',
// ...this.form
// }
// if (this.loginType == 'codelogin') {
// this.getApply()
// return
// }
// 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']);
// this.queryInfo()
// // 禁用和注销状态并存,以禁用为准
// // 已经进行过注销操作的, 弹窗提示90天内不可再次申请加盟为合伙人
// // partnerIsActive 合伙人状态:1签约,2解约,3为加盟 ;解约过的合伙人状态一直为解约,直到下次签约成功才会改变
// // 登录并且是注销状态 前端不判断,通过申请加盟的接口判断
// // if(res.data.partnerIsActive==2){
// // this.showCode = false
// // this.restrictedOrCanelContent = '90天内不可再次申请加盟为合伙人'
// // this.$refs.restrictedOrCanelTip.open()
// // return
// // }
// // 是合伙人就不让在加盟
// if (res.data.isPartner && res.data.partnerIsActive == 1) {
// this.$refs.everyJoinPopup.open()
// return
// }
// // 不是合伙人就加盟
// if (!res.data.isPartner && res.data.partnerIsActive != 1) {
// this.getApply()
// }
// } else {
// uni.showToast({
// title: res['message'],
// duration: 2000,
// icon: 'none'
// })
// }
// })
// }
// },
queryInfo() {
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
api.queryInfo({ userId: uni.getStorageSync('cffp_userId') }).then(res => {
// 保存用户得个人信息
if (res['success']) {
this.form.nickName = res['data']['nickName']
if(this.form.nickName){
if (this.form.nickName) {
this.editNickName = true
}else {
} else {
this.editNickName = false
}
delete res.data.commonResult
......@@ -441,181 +517,231 @@
...res.data
}
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo))
uni.setStorageSync('user_mobile', cffp_userInfo.mobile)
}else {
uni.setStorageSync('user_mobile', cffp_userInfo.mobile)
} else {
uni.setStorageSync('loginType', 'visitor')
this.loginType = 'visitor'
}
})
},
// 申请加盟
getApply(){
getApply() {
console.log('login状态', this.loginType);
let params = {}
if(this.shareId){
params = {
applyType:'1',
applyUserId:this.userId,
applyMobile:this.form.mobile,
inviteUserId:this.inviteUserId,
nickName:this.form.nickName,
inviterInvitationCode:this.invitationCode,
shareId:this.shareId
if (this.shareId) {
params = {
applyType: '1',
applyUserId: this.userId,
applyMobile: this.form.mobile,
inviteUserId: this.inviteUserId,
nickName: this.form.nickName,
inviterInvitationCode: this.invitationCode,
shareId: this.shareId
}
}else {
} else {
params = {
applyType:'2',
applyUserId:this.userId,
applyMobile:this.form.mobile,
nickName:this.form.nickName,
inviteUserId:this.sharePosterObj.inviteUserId,
invitationCode:this.sharePosterObj.invitationCode
applyType: '2',
applyUserId: this.userId,
applyMobile: this.form.mobile,
nickName: this.form.nickName,
inviteUserId: this.sharePosterObj.inviteUserId,
invitationCode: this.sharePosterObj.invitationCode
}
}
api.newSaveApplyInfo(params).then((res)=>{
if(res['success']){
api.newSaveApplyInfo(params).then((res) => {
if (res['success']) {
// 是合伙人就不让在加盟
if(res.data.isPartner){
if (res.data.isPartner) {
this.$refs.everyJoinPopup.open()
return
}
dataHandling.pocessTracking(
'加盟',
`已成功加盟为合伙人`,
'点击',
2,
'申请加盟',
'pages/saleCourseLists/saleCourseLists'
'加盟',
`已成功加盟为合伙人`,
'点击',
2,
'申请加盟',
'pages/saleCourseLists/saleCourseLists'
)
this.$refs.successJoinPopup.open()
}else{
// 由于注销需求,依据后端报错展示弹窗
this.showCode = false
this.restrictedOrCanelContent = res['message']
this.$refs.restrictedOrCanelTip.open()
} else {
// 由于注销需求,依据后端报错展示弹窗
this.showCode = false
this.restrictedOrCanelContent = res['message']
this.$refs.restrictedOrCanelTip.open()
}
})
},
},
}
</script>
<style lang="scss" scoped>
::v-deep .uni-radio-input{
::v-deep .uni-radio-input {
// background-color: #20279B !important;
// border-color: #20279B !important;
}
.container{
position: relative;
box-sizing: border-box;
.imgbox{
display: block;
}
.wapper{
// background-color: pink;
.container {
position: relative;
box-sizing: border-box;
display: flex;
flex-direction: column;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
padding: 0 50rpx;
.header{
color: #333333;
margin-top: 140rpx;
.one{
font-size: 60rpx;
font-weight: 700;
}
.two{
font-size: 30rpx;
font-weight: 500;
}
.imgbox {
display: block;
}
.applyBox{
background-color: #fff;
padding: 30rpx;
border-radius: 20rpx;
margin-top: 100rpx;
.wapper {
// background-color: pink;
box-sizing: border-box;
.inputBox{
margin-bottom: 20rpx;
padding-bottom: 10rpx;
border-bottom: 1rpx solid #E8E8E8;
.require{
font-size: 24rpx;
color: red;
display: flex;
flex-direction: column;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
padding: 0 50rpx;
// .header{
// color: #333333;
// margin-top: 140rpx;
// .one{
// font-size: 60rpx;
// font-weight: 700;
// }
// .two{
// font-size: 30rpx;
// font-weight: 500;
// }
// }
.header {
display: flex;
align-items: center;
justify-content: space-between;
color: #333333;
margin-top: 30rpx;
.one {
font-size: 60rpx;
font-weight: 700;
margin-bottom: 20rpx;
}
.desTxt{
font-size: 24rpx;
color: #333333;
.two {
font-size: 30rpx;
font-weight: 500;
}
.user-input{
color: black;
.headerRight {
width: 300rpx;
}
}
.headerImg {
width: 300rpx;
height: 300rpx;
opacity: .5;
}
.applyBox {
background-color: #fff;
padding: 30rpx;
border-radius: 20rpx;
// margin-top: 100rpx;
box-sizing: border-box;
.inputBox {
margin-bottom: 20rpx;
padding-bottom: 10rpx;
border-bottom: 1rpx solid #E8E8E8;
.require {
font-size: 24rpx;
color: red;
}
.desTxt {
font-size: 24rpx;
color: #333333;
}
.user-input {
color: black;
font-size: 26rpx;
margin-top: 15rpx;
}
.codeBox {
display: flex;
align-items: center;
justify-content: space-between;
color: #20279B;
font-size: 26rpx;
.grey {
color: rgba(32, 39, 155, 0.5);
/* 50% 透明 */
}
}
}
.agreeBox {
padding-top: 20rpx;
font-size: 26rpx;
margin-top: 15rpx;
color: #20279B;
}
.codeBox{
.protol {
display: flex;
align-items: center;
justify-content: space-between;
color: #20279B;
font-size: 26rpx;
.grey{
color: rgba(32, 39, 155, 0.5); /* 50% 透明 */
.empty {
width: 30rpx;
height: 30rpx;
border: 1rpx solid #20269B;
border-radius: 50%;
margin-right: 5rpx;
}
.icon-icon_duihao-mian {
font-size: 30rpx;
color: #20269B;
margin-right: 5rpx;
}
}
}
.agreeBox{
padding-top: 20rpx;
font-size: 26rpx;
color:#20279B ;
}
.protol{
display: flex;
align-items: center;
font-size: 26rpx;
.empty{
width: 30rpx;
height: 30rpx;
border: 1rpx solid #20269B;
border-radius: 50%;
margin-right: 5rpx;
}
.icon-icon_duihao-mian{
font-size: 30rpx;
color: #20269B;
margin-right: 5rpx;
.btnBox {
box-sizing: border-box;
width: 80%;
text-align: center;
padding: 20rpx;
border-radius: 50rpx;
background-color: #20279B;
color: #fff;
font-size: 28rpx;
margin: 0rpx 50rpx 30rpx 50rpx;
}
}
.btnBox{
box-sizing: border-box;
width: 80%;
text-align: center;
padding: 20rpx;
border-radius: 50rpx;
background-color: #20279B;
color: #fff;
.footer {
font-size: 28rpx;
margin: 0rpx 50rpx 30rpx 50rpx;
color: rgba(0, 0, 0, .5);
width: 100%;
text-align: center;
margin-bottom: 20rpx;
margin-top: auto;
letter-spacing: 8rpx;
}
}
.footer{
font-size: 28rpx;
color: rgba(0, 0, 0, .5);
width: 100%;
text-align: center;
margin-bottom: 20rpx;
margin-top: auto;
letter-spacing: 8rpx;
}
}
}
</style>
</style>
\ No newline at end of file
......@@ -26,39 +26,37 @@
<!-- 对比内容(按group分组展示) -->
<!-- 对比内容:从 productPKInfoList.basicInfos 提取分组渲染 -->
<view class="compare-content" v-if="productPKInfoList.length > 0">
<!-- 核心:从第一个产品的 basicInfos 中遍历分组(A/B/C组) -->
<view class="compare-content" v-if="productPKInfoList.length > 0 && renderGroups.length > 0">
<view
class="compare-section"
v-for="group in renderGroups"
:key="group.groupCode"
>
<view class="section-header">
<uni-icons
:type="getGroupIcon(group.groupCode)"
size="22"
:color="getGroupColor(group.groupCode)"
></uni-icons>
<text class="section-title">{{ group.groupName }}</text>
</view>
<view class="section-content">
<view
class="compare-section"
v-for="group in getFirstProductGroups()"
:key="group.groupCode"
class="compare-item"
:class="{ 'hidden-item': shouldHide(field.fieldBizId) }"
v-for="field in group.fields"
:key="field.fieldBizId"
>
<view class="section-header">
<uni-icons
:type="getGroupIcon(group.groupCode)"
size="22"
:color="getGroupColor(group.groupCode)"
></uni-icons>
<text class="section-title">{{ group.groupName }}</text>
</view>
<view class="section-content">
<!-- 遍历当前分组下的所有属性(factor) -->
<view
class="compare-item"
:class="{ 'hidden-item': shouldHide(group.groupCode, factor.type) }"
v-for="factor in group.factors"
:key="factor.type"
>
<text class="item-label">{{ factor.typeName }}</text>
<view class="item-values">
<!-- 遍历所有产品,匹配当前分组+当前属性的内容 -->
<view class="item-value" v-for="product in productPKInfoList" :key="product.planBizId">
{{ getProductFactorValue(product, group.groupCode, factor.type) || '-' }}
</view>
</view>
<text class="item-label">{{ field.label }}</text>
<view class="item-values">
<view class="item-value" v-for="product in productPKInfoList" :key="product.planBizId">
{{ getProductFieldValue(product, field.fieldBizId) || '-' }}
</view>
</view>
</view>
</view>
</view>
<!-- 产品彩页分组(单独处理,从 planFiles 提取) -->
<view class="compare-section" id="product-file-group">
......@@ -96,6 +94,36 @@
<text class="empty-text">暂无对比产品数据</text>
</view>
</view>
<!-- 放在 </view> 最后,</template> 之前 -->
<!-- PDF 查看弹窗 -->
<!-- 调试用 -->
<view v-if="showPdfModal">Debug URL: {{ currentPdfUrl }}</view>
<uni-popup
ref="pdfPopupRef"
:mask-click="true"
type="bottom"
@change="onPopupChange"
>
<view class="pdf-modal-container">
<!-- 关闭按钮 -->
<view class="modal-header">
<button class="close-btn" @click="closePdfModal"></button>
</view>
<!-- PDF 查看器 -->
<view class="pdf-viewer-wrapper" v-if="showPdfModal && currentPdfUrl">
<PdfViewer
:pdfInfo="{ url: currentPdfUrl }"
:autoLoad="true"
:lazyLoad="false"
:maxRetryCount="2"
@loadComplete="handlePdfLoadComplete"
@loadError="handlePdfLoadError"
@pageChange="handlePageChange"
/>
</view>
</view>
</uni-popup>
</template>
<script setup>
......@@ -103,189 +131,162 @@ import { ref, computed, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import common from '@/common/common';
import api from '@/api/api';
// 路由实例
import PdfViewer from '@/components/pdf-viewer/pdf-viewer.vue';
import { onBeforeUnmount } from 'vue';
import uniPopup from '@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue';
import { hshare } from '@/util/fiveshare';
const pdfPopupRef = ref();
const router = useRouter();
const route = useRoute();
// 后端返回的原始数据
// 原始数据
const resultData = ref({});
// 配置分组列表(基本信息、适合人群等)
const configList = ref([]);
// 产品对比信息列表
const configList = ref([]); // ← 新增:用于定义页面结构
const productPKInfoList = ref([]);
// 是否只看不同
const showOnlyDiff = ref(false);
// 查看文件的URL
const viewFileUrl = ref()
const currentPdfUrl = ref('');
const showPdfModal = ref(false);
// 【✅ 关键修正1:构建 fieldBizId → 字段元信息 的映射】
const fieldMetaMap = ref(new Map()); // fieldBizId => { cnName, groupCode }
// 【✅ 关键修正2:初始化 configList 并构建映射】
const initConfigStructure = (configs) => {
configList.value = configs;
const map = new Map();
configs.forEach(group => {
group.fieldList.forEach(field => {
map.set(field.fieldBizId, {
cnName: field.fieldCnName,
groupCode: group.groupCode,
groupName: group.groupName
});
});
});
fieldMetaMap.value = map;
};
// 【✅ 关键修正3:获取标准化的分组+字段结构(用于渲染)】
const renderGroups = computed(() => {
return configList.value.map(group => ({
groupCode: group.groupCode,
groupName: group.groupName,
fields: group.fieldList.map(field => ({
fieldBizId: field.fieldBizId,
label: field.fieldCnName
}))
}));
});
// 【✅ 关键修正4:根据 fieldBizId 获取产品值】
const getProductFieldValue = (product, fieldBizId) => {
for (const basicInfo of product.basicInfos || []) {
const factor = basicInfo.factors?.find(f => f.type === fieldBizId);
if (factor) return factor.content || '';
}
return ''; // 未找到返回空
};
// 【✅ 关键修正5:判断是否应隐藏(只看不同)】
const shouldHide = (fieldBizId) => {
if (!showOnlyDiff.value || productPKInfoList.value.length <= 1) return false;
const normalize = (val) => (val === '' || val === '/' ? '无数据' : val);
const baseValue = normalize(getProductFieldValue(productPKInfoList.value[0], fieldBizId));
// 根据分组编码获取对应的图标
return productPKInfoList.value.every(product => {
return normalize(getProductFieldValue(product, fieldBizId)) === baseValue;
});
};
// 其余方法保持不变(图标、颜色、PDF、分享等)
const getGroupIcon = (groupCode) => {
const iconMap = {
'A': 'info', // 基本信息
'B': 'auth', // 适合人群
'C': 'star', // 产品特色
'D': 'image' // 产品彩页
};
const iconMap = { A: 'info', B: 'auth', C: 'star', D: 'image' };
return iconMap[groupCode] || 'help';
};
// 根据分组编码获取对应的颜色
const getGroupColor = (groupCode) => {
const colorMap = {
'A': '#20269B', // 基本信息-蓝色
'B': '#00cc66', // 适合人群-绿色
'C': '#ff9900', // 产品特色-橙色
'D': '#cc66ff' // 产品彩页-紫色
};
const colorMap = { A: '#20269B', B: '#00cc66', C: '#ff9900', D: '#cc66ff' };
return colorMap[groupCode] || '#999';
};
import {hshare} from '@/util/fiveshare';
const wxShare = (productIds,categoryId)=>{
// H5 自定义分享
const shareLink = `${window.location.origin}/myPackageA/compare-result/compare-result?categoryId=${categoryId}&productIds=${productIds}`;
// 2. 分享标题(简洁明了,包含产品数量)
const shareTitle = `多款产品对比结果`;
// 3. 分享描述(突出对比价值)
const shareDesc = `包含核心参数对比,快速了解差异`;
// 4. 分享图标(建议用公司LOGO或产品相关图标,尺寸200x200px,HTTPS地址)
const shareIcon = `${window.location.origin}/static/mypoint_pic.png`;
let data = {
title: shareTitle,
desc:shareDesc,
link: shareLink, //分享链接
imgUrl: shareIcon, //图片c
}
//安卓机型获取当前页面路径
let url = window.location.href.split('#')[0];
//ios机型获取当前页面路径
let ua = navigator.userAgent.toLowerCase();
let isWeixin = ua.indexOf('micromessenger') !== -1;
if (isWeixin) {
let isiOS = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent); //ios终端
if (isiOS && window.sessionStorage.getItem('firstEntryUrl')) {
url = window.sessionStorage.getItem('firstEntryUrl').split('#')[0];
}
}
hshare(data, url)
}
const wxShare = (productIds, categoryId) => {
const shareLink = `${window.location.origin}/myPackageA/compare-result/compare-result?categoryId=${categoryId}&productIds=${productIds}`;
const shareTitle = `多款产品对比结果`;
const shareDesc = `包含核心参数对比,快速了解差异`;
const shareIcon = `${window.location.origin}/static/mypoint_pic.png`;
let data = { title: shareTitle, desc: shareDesc, link: shareLink, imgUrl: shareIcon };
let url = window.location.href.split('#')[0];
let ua = navigator.userAgent.toLowerCase();
let isWeixin = ua.indexOf('micromessenger') !== -1;
if (isWeixin) {
let isiOS = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent);
if (isiOS && window.sessionStorage.getItem('firstEntryUrl')) {
url = window.sessionStorage.getItem('firstEntryUrl').split('#')[0];
}
}
hshare(data, url);
};
const navigateToPKPage = () => {
uni.navigateBack();
};
const getUrl = (fileUrl) => {
if (!fileUrl) {
uni.showToast({ title: '暂无文档', icon: 'none' });
return;
}
// 区分环境:H5 端直接打开 URL,其他端用原下载逻辑
if (uni.getSystemInfoSync().uniPlatform === 'web') {
// H5 方案:用浏览器新窗口打开 PDF(依赖浏览器原生支持)
const opened = window.open(fileUrl, '_blank');
} else {
// 非 H5 端(小程序/APP):保留原下载+打开逻辑
uni.downloadFile({
url: fileUrl,
success: (res) => {
if (res.statusCode === 200) {
uni.openDocument({
filePath: res.tempFilePath,
showMenu: true,
success: () => console.log('打开文档成功'),
fail: (err) => {
uni.showToast({ title: '打开失败,请重试', icon: 'none' });
console.error('openDocument 失败:', err);
}
});
} else {
uni.showToast({ title: '下载失败', icon: 'none' });
}
},
fail: (err) => {
uni.showToast({ title: '下载失败,请检查网络', icon: 'none' });
console.error('downloadFile 失败:', err);
}
});
}
uni.showLoading({ title: '加载PDF中...' });
currentPdfUrl.value = fileUrl;
showPdfModal.value = true;
setTimeout(() => {
pdfPopupRef.value?.open?.();
uni.hideLoading();
}, 100);
};
// 【核心1:获取第一个产品的分组列表(A/B/C组)】
// 所有产品的分组结构一致,取第一个产品的 basicInfos 作为分组源
const getFirstProductGroups = () => {
if (productPKInfoList.value.length === 0) return [];
return productPKInfoList.value[0].basicInfos || [];
const closePdfModal = () => {
showPdfModal.value = false;
setTimeout(() => pdfPopupRef.value?.close?.(), 100);
};
// 【核心2:获取指定产品、指定分组、指定属性的内容】
const getProductFactorValue = (product, groupCode, factorType) => {
// 1. 找到产品中当前分组(如A组-基本信息)
const targetGroup = product.basicInfos.find(item => item.groupCode === groupCode);
if (!targetGroup) return '';
// 2. 找到分组中当前属性(如type=5-保障期限)
const targetFactor = targetGroup.factors.find(item => item.type === factorType);
return targetFactor ? targetFactor.content : '';
const onPopupChange = (e) => {
if (!e.show && showPdfModal.value) showPdfModal.value = false;
};
onBeforeUnmount(() => {
if (pdfPopupRef.value) pdfPopupRef.value.close();
});
// 【核心3:判断属性是否所有产品都相同(“只看不同”逻辑)】
const shouldHide = (groupCode, factorType) => {
// 未开启“只看不同”或只有1个产品,不隐藏
if (!showOnlyDiff.value || productPKInfoList.value.length <= 1) return false;
// 取第一个产品的属性值作为基准
const firstProduct = productPKInfoList.value[0];
const baseValue = getProductFactorValue(firstProduct, groupCode, factorType);
// 归一化空值(避免“/”“空字符串”视为不同)
const normalize = (val) => val === '' || val === '/' ? '无数据' : val;
const baseNormalized = normalize(baseValue);
// 检查所有产品的当前属性值是否与基准一致
const allSame = productPKInfoList.value.every(product => {
const currentValue = getProductFactorValue(product, groupCode, factorType);
return normalize(currentValue) === baseNormalized;
});
// 所有产品相同则隐藏,否则显示
return allSame;
};
// 【✅ 关键修正6:初始化时同时处理 configList 和 productPKInfoList】
onMounted(() => {
const { productIds, categoryId } = route.query;
if (!productIds || !categoryId) {
uni.showToast({ title: '缺少对比参数', icon: 'none' });
return;
}
// 前往PK选择页
const navigateToPKPage = () => {
uni.navigateBack()
const params = {
category: categoryId,
planBizIdList: productIds.split(',')
};
};
let ua = navigator.userAgent.toLowerCase();
let isWeixin = ua.indexOf('micromessenger') !== -1;
// 初始化数据
onMounted(() => {
api.getProductPKInfo(params).then(res => {
if (res.success && res.data) {
// ✅ 同时保存 configList 和 product 列表
initConfigStructure(res.data.configList || []);
productPKInfoList.value = res.data.productPKInfoList || [];
const { productIds, categoryId} = route.query;
if (!productIds || !categoryId) {
uni.showToast({ title: '缺少对比参数', icon: 'none' });
return;
}
const params = {
category: categoryId,
planBizIdList: productIds.split(',')
};
let ua = navigator.userAgent.toLowerCase();
let isWeixin = ua.indexOf('micromessenger') !== -1;
api.getProductPKInfo(params).then(res => {
if (res.success && res.data?.productPKInfoList) {
productPKInfoList.value = res.data.productPKInfoList;
// 微信环境初始化分享(如有)
if (isWeixin) {
wxShare(productIds,categoryId)
}
} else {
common.errorDialog(1, res.message || '获取对比数据失败');
}
});
})
if (isWeixin) wxShare(productIds, categoryId);
} else {
common.errorDialog(1, res.message || '获取对比数据失败');
}
});
});
</script>
<style scoped>
......@@ -488,4 +489,38 @@ onMounted(() => {
align-items: center;
justify-content: center;
}
.pdf-modal-container {
width: 100vw;
height: 90vh; /* 占屏 90% */
background: #fff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
overflow: hidden;
display: flex;
flex-direction: column;
}
.modal-header {
padding: 20rpx;
text-align: right;
}
.close-btn {
width: 60rpx;
height: 60rpx;
font-size: 36rpx;
background: #f5f5f5;
border-radius: 50%;
border: none;
color: #999;
display: flex;
justify-content: center;
align-items: center;
}
.pdf-viewer-wrapper {
flex: 1;
width: 100%;
overflow: hidden;
}
</style>
\ No newline at end of file
......@@ -160,7 +160,7 @@ const fetchRateData = async () => {
try {
const params = {
planBizId:planBizId.value,
userId:localStorage.getItem('cffp_userId')
userId:uni.getStorageSync('cffp_userId') || ''
}
const response = await api.queryRate(params)
......@@ -193,7 +193,7 @@ const fetchRateData = async () => {
// 生命周期
onMounted(() => {
userId.value = localStorage.getItem('cffp_userId') || ''
userId.value = uni.getStorageSync('cffp_userId') || ''
fetchRateData()
})
</script>
......
......@@ -131,7 +131,7 @@
<button
class="compare-btn"
@click="navigateToPKPage"
:disabled="pkList.length < 2"
:disabled="pkList.length < 1"
>
去对比
</button>
......
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
......@@ -496,6 +497,13 @@
"webviewDebug": true
}
}
},
{
"path": "pages/lanch/index",
"style": {
"topWindow": false,
"navigationBarTitleText": "启动页"
}
}
],
......
......@@ -63,8 +63,8 @@
<view class="courseTitleContent">
<view class="courseTitle">
<view class="" style="width: 100%;">
<h4>{{courseInfo.fileSynopsis}}</h4>
<view>{{courseInfo.fileTitle}}</view>
<h4>{{courseInfo.fileTitle}}</h4>
<view>{{courseInfo.fileSynopsis}}</view>
</view>
</view>
......
......@@ -90,10 +90,10 @@
</view>
<view class="right">
<view class="one">
{{item.fileSynopsis}}
{{item.fileTitle}}
</view>
<view class="two">
{{item.fileTitle}}
{{item.fileSynopsis}}
</view>
<view class="three">
<text style="font-size: 28rpx;color: rgba(32, 39, 155, 1);">{{Number(item.coursePrice).toFixed(2)}}</text>
......
......@@ -575,7 +575,7 @@
if(this.cffpCourseInfos.length>0){
this.cffpCourseInfos.forEach(item=>{
item.coursePrice =Number(item.coursePrice).toFixed(2) || '0.00'
if(item.productCode&&item.productCode=='C09'){
if(item.productCode&&item.productCode=='ZNTJ'){
this.productItem = item
uni.setStorageSync('productItem',this.productItem );
}
......@@ -743,7 +743,7 @@
let result = res['data']['data'];
if(result.length>0){
result.forEach(item=>{
if(item.productCode&&item.productCode=='C09'){
if(item.productCode&&item.productCode=='ZNTJ'){
this.productItem = item
uni.setStorageSync('productItem',this.productItem );
}
......@@ -764,10 +764,9 @@
}
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('cffp_userId', JSON.stringify(res.data.userId));
uni.setStorageSync('uni-token', res.data['token']);
this.userId = res.data.userId
this.querySystemMessage()
......
......@@ -3,26 +3,15 @@
<!-- #ifdef APP -->
<text class="iconfont icon-youjiantou zuojiantou" @click="goBack()" style="top: 20rpx;"></text>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="generateImageBox" v-if="!generatedImage">
<view class="generateImageBox" v-if="!generatedImage">
<view class="imgBox" ref="captureElement">
<img
v-if="posterImg"
class="posterImg"
@load="handleBgImageLoad"
@error="handleBgImageError"
style="display: block;"
src="@/static/images/sharePoster.png"
crossorigin="anonymous"
alt="防缓存图片"
/>
<img v-if="posterImg" class="posterImg" @load="handleBgImageLoad" @error="handleBgImageError"
style="display: block;" src="@/static/images/sharePoster.png" crossorigin="anonymous" alt="防缓存图片" />
<view class="qrcode-container">
<canvas
canvas-id="qrcode"
class="qrcode-canvas"
:style="{width: qrCodeSize + 'px', height: qrCodeSize + 'px'}"
></canvas>
<canvas canvas-id="qrcode" class="qrcode-canvas"
:style="{width: qrCodeSize + 'px', height: qrCodeSize + 'px'}"></canvas>
</view>
</view>
</view>
......@@ -39,13 +28,8 @@
<view class="liBox">
<text>昵称 <text style="font-size: 22rpx;">(被邀请人可修改)</text></text>
<text>
<input
v-model="dataForm.name"
class="uni-input"
maxlength="10"
placeholder="昵称"
style="width: 300rpx;"
/>
<input v-model="dataForm.name" class="uni-input" maxlength="10" placeholder="昵称"
style="width: 300rpx;" />
</text>
</view>
<view class="liBox">
......@@ -55,17 +39,9 @@
</view>
</view>
<!-- <share></share> -->
<button
type="primary"
plain="true"
class="sendInvite"
@click="shareToggle()"
>
<loadingIcon
:loading="isLoading"
v-if="isLoading"
/>
<text style="margin-left: 5rpx;">发出邀请</text>
<button type="primary" plain="true" class="sendInvite" @click="shareToggle()">
<loadingIcon :loading="isLoading" v-if="isLoading" />
<text style="margin-left: 5rpx;">发出邀请</text>
</button>
</view>
<!-- 邀请信息 -->
......@@ -128,12 +104,8 @@
</view>
</view>
<!-- 海报弹窗 -->
<sharePosterPop
ref="sharePosterPop"
:generatedImage="generatedImage"
@closePoster="closePoster"
btnBottom="-15%"
></sharePosterPop>
<sharePosterPop ref="sharePosterPop" :generatedImage="generatedImage" @closePoster="closePoster"
btnBottom="-15%"></sharePosterPop>
</view>
</template>
......@@ -141,20 +113,20 @@
import dataHandling from "@/util/dataHandling";
import api from "@/api/api"
import common from '../../common/common';
import {hshare ,setWechatShare,initJssdkShare} from '@/util/fiveshare';
import {baseURL,apiURL,cffpURL,companyInfo,shareURL} from "@/environments/environment";
import { hshare, setWechatShare, initJssdkShare } from '@/util/fiveshare';
import { baseURL, apiURL, cffpURL, companyInfo, shareURL } from "@/environments/environment";
import sharePosterPop from '@/components/commonPopup/sharePosterPop.vue';
import UQRCode from 'uqrcodejs';
import { elementToImage } from '@/util/htmlToImage';
import { elementToImage } from '@/util/htmlToImage';
import loadingIcon from '@/components/loading/loading.vue';
export default {
components:{
components: {
sharePosterPop,
loadingIcon
},
data() {
return {
companyType:companyInfo.companyType,
companyType: companyInfo.companyType,
ydLogoShare: `${shareURL}/static/suplogo.png`,
dataForm: {
applyType: '1', //申请类型邀请加盟传 1 申请加盟传 2
......@@ -183,49 +155,49 @@
partnerLevel: '',
invitationCode: '',
shareTipsFlag: false,
qrCodeUrl:'/myPackageA/applyFranchise/applyFranchise',
qrCodeSize: 80,//二维码的尺寸
generatedImage:'',//生成的海报图片
companyLogo : '../../static/suplogo.png',
posterImg:'',
qrCodeUrl: '/myPackageA/applyFranchise/applyFranchise',
qrCodeSize: 80, //二维码的尺寸
generatedImage: '', //生成的海报图片
companyLogo: '../../static/suplogo.png',
posterImg: '',
isLoading: false
};
},
onLoad(option) {
//this.partnerLevel = option.levelCode
this.partnerLevel = 'P1'
//this.getqueryOrgList()
if(this.companyType == '1'){
if (this.companyType == '1') {
this.ydLogoShare = `${shareURL}/static/cffp_logo.jpg`;
}else {
} else {
this.ydLogoShare = `${shareURL}/static/suplogo.png`;
}
if(companyInfo.companyType == '1'){
this.companyLogo='../../static/myteam/Group1633.png';
}else if(this.companyType == '2'){
this.companyLogo='../../static/suplogo.png';
if (companyInfo.companyType == '1') {
this.companyLogo = '../../static/myteam/Group1633.png';
} else if (this.companyType == '2') {
this.companyLogo = '../../static/suplogo.png';
}
let dataForm = JSON.parse(uni.getStorageSync('cffp_userInfo'))
this.realName = dataForm.realName || dataForm.nickName;
this.invitationCode = dataForm.invitationCode
if(!this.realName){
if (!this.realName) {
this.queryInfo();
}
},
onShow(){
onShow() {
this.isLoading = false
this.posterImg = ''
this.generatedImage = ''
// #ifdef H5
initJssdkShare(() => {
setWechatShare();
setWechatShare();
}, window.location.href);
// #endif
},
onHide() {
this.$nextTick(()=>{
this.$nextTick(() => {
this.$refs.sharePosterPop.closeDropdown()
})
},
......@@ -235,15 +207,15 @@
delta: 1
})
},
queryInfo(){
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
if(res['success']){
queryInfo() {
api.queryInfo({ userId: uni.getStorageSync('cffp_userId') }).then(res => {
if (res['success']) {
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.realName = res.data.realName || res.data.nickName;
this.invitationCode = res.data.invitationCode;
}
})
......@@ -290,7 +262,7 @@
},
// 发起邀请事件
shareToggle() {
//this.dataForm.partnerLevel = this.applyIdentity == 0 ? 'B1' : 'A1'
this.dataForm.partnerLevel = 'P1'
this.dataForm.hasCrossDistrict = this.isCross == true ? '1' : '0'
......@@ -318,24 +290,40 @@
api.saveApplyInfo(this.dataForm).then(res => {
if (res['success']) {
this.shareId = res.data.id;
// #ifdef APP-PLUS
this.$refs.share.open()
// #endif
// if (typeof wx !== 'undefined' && wx.miniProgram) {
// console.log('wx',wx.miniProgram);
// wx.miniProgram.postMessage({
// data: {
// type: 'requestShare',
// title: '银盾家办家庭财务策划师联盟邀您加入',
// desc: `${this.realName}邀您加入【家庭财策师联盟】,资源+伙伴,共赢未来!`,
// path: shareURL +
// "/myPackageA/applyFranchise/applyFranchise?shareId=" + this
// .shareId + '&invitationCode=' + this.invitationCode +
// '&inviteUserId=' + this.userId, //分享链接
// }
// });
// return
// }
//#ifdef H5
// 小程序跳cffp得分享
if(uni.getStorageSync('mpCffp')){
if (uni.getStorageSync('mpCffp')) {
this.qrCodeUrl = shareURL +
"/myPackageA/applyFranchise/applyFranchise?shareId=" +
this.shareId + '&invitationCode=' + this.invitationCode+ '&inviteUserId=' + this.userId, //分享链接
this.posterImg = '@/static/images/sharePoster.png'
"/myPackageA/applyFranchise/applyFranchise?shareId=" +
this.shareId + '&invitationCode=' + this.invitationCode + '&inviteUserId=' +
this.userId, //分享链接
this.posterImg = '@/static/images/sharePoster.png'
this.isLoading = true
return
return
}
this.shareTipsFlag = true;
this.getshareData()
// #endif
}else{
} else {
uni.showToast({
title: res['message'],
duration: 2000,
......@@ -349,7 +337,7 @@
},
getshareData() {
if(!this.realName){
if (!this.realName) {
this.realName = ""
}
let data = {
......@@ -358,8 +346,9 @@
desc: `${this.realName}邀您加入【家庭财策师联盟】,资源+伙伴,共赢未来!`,
link: shareURL +
"/myPackageA/applyFranchise/applyFranchise?shareId=" +
this.shareId + '&invitationCode=' + this.invitationCode+ '&inviteUserId=' + this.userId, //分享链接
imgUrl: this.ydLogoShare, //图片
this.shareId + '&invitationCode=' + this.invitationCode + '&inviteUserId=' + this
.userId, //分享链接
imgUrl: this.ydLogoShare, //图片
//imgUrl: `${baseURL}/static/cffp_logo.jpg`, //图片
}
//安卓机型获取当前页面路径
......@@ -376,12 +365,12 @@
}
hshare(data, url)
dataHandling.pocessTracking(
'邀请',
`发出邀请`,
'点击',
2,
'邀请加盟',
'pages/inviteJoin/inviteJoin'
'邀请',
`发出邀请`,
'点击',
2,
'邀请加盟',
'pages/inviteJoin/inviteJoin'
)
// setTimeout(()=>{
// // #ifdef H5
......@@ -390,7 +379,7 @@
// }, window.location.href);
// // #endif
// },500)
},
closeShare() {
this.$refs.share.close()
......@@ -402,22 +391,31 @@
this.$refs.share.open()
// #endif
//#ifdef H5
if (uni.getStorageSync('mpCffp')) {
this.qrCodeUrl = shareURL +
"/myPackageA/applyFranchise/applyFranchise?shareId=" +
this.shareId + '&invitationCode=' + this.invitationCode + '&inviteUserId=' +
this.userId, //分享链接
this.posterImg = '@/static/images/sharePoster.png'
this.isLoading = true
return
}
this.shareTipsFlag = true;
this.getshareData()
// #endif
},
uniShare(type) {
if(!this.realName){
if (!this.realName) {
this.realName = ""
}
let typeName = type == 1?'微信好友':'朋友圈'
let typeName = type == 1 ? '微信好友' : '朋友圈'
dataHandling.pocessTracking(
'邀请',
`向${typeName}发出邀请`,
'点击',
2,
'邀请加盟',
'pages/inviteJoin/inviteJoin'
'邀请',
`向${typeName}发出邀请`,
'点击',
2,
'邀请加盟',
'pages/inviteJoin/inviteJoin'
)
uni.share({
provider: "weixin",
......@@ -447,59 +445,59 @@
}
})
},
// 分享海报代码
// 背景图片加载成功
handleBgImageLoad() {
console.log('产品图片加载成功');
this.generateQrcodeAndCapture();
console.log('产品图片加载成功');
this.generateQrcodeAndCapture();
},
// 背景图片加载失败
handleBgImageError() {
console.log('产品图片加载失败');
// 即使失败也继续流程,可能会有默认背景
// this.generateQrcodeAndCapture();
console.log('产品图片加载失败');
// 即使失败也继续流程,可能会有默认背景
// this.generateQrcodeAndCapture();
},
// 顺序执行:生成二维码 -> 截图
async generateQrcodeAndCapture() {
try {
uni.showLoading({
title: '准备生成分享图...'
});
// 1. 先生成二维码
console.log('开始生成二维码...');
await this.makeQrcode();
console.log('二维码生成完成');
// 2. 等待500ms确保渲染完成
await new Promise(resolve => setTimeout(resolve, 1500));
// 3. 执行截图
console.log('开始截图...');
await this.captureImage();
console.log('截图完成');
uni.hideLoading();
} catch (error) {
console.error('生成分享图失败:', error);
uni.hideLoading();
// this.retryGenerate();
}
try {
uni.showLoading({
title: '准备生成分享图...'
});
// 1. 先生成二维码
console.log('开始生成二维码...');
await this.makeQrcode();
console.log('二维码生成完成');
// 2. 等待500ms确保渲染完成
await new Promise(resolve => setTimeout(resolve, 1500));
// 3. 执行截图
console.log('开始截图...');
await this.captureImage();
console.log('截图完成');
uni.hideLoading();
} catch (error) {
console.error('生成分享图失败:', error);
uni.hideLoading();
// this.retryGenerate();
}
},
// 重试机制
// retryGenerate() {
// if (this.retryCount < this.maxRetryCount) {
// this.retryCount++;
// const delay = 1000 * this.retryCount;
// console.log(`第${this.retryCount}次重试,${delay}ms后重试...`);
// setTimeout(() => {
// this.generateQrcodeAndCapture();
// }, delay);
......@@ -510,84 +508,84 @@
// // });
// }
// },
// 生成二维码
makeQrcode() {
return new Promise((resolve, reject) => {
// 创建实例
const qr = new UQRCode();
// 设置二维码内容
qr.data = this.qrCodeUrl;
// 设置二维码大小
qr.size = this.qrCodeSize;
// 设置前景色(二维码颜色)
qr.foregroundColor = '#000000';
// 设置背景色
qr.backgroundColor = '#FFFFFF';
// 设置边距
qr.margin = 10;
// 设置纠错等级
qr.errorCorrectLevel = UQRCode.errorCorrectLevel.H;
try {
// 调用制作二维码方法
qr.make();
// 获取canvas上下文
const ctx = uni.createCanvasContext('qrcode', this);
// 清空画布
ctx.clearRect(0, 0, this.qrCodeSize, this.qrCodeSize);
// 将二维码绘制到canvas上
qr.canvasContext = ctx;
qr.drawCanvas();
// 绘制完成
ctx.draw(true, () => {
console.log('二维码绘制完成');
resolve();
});
} catch (err) {
reject(err);
}
});
return new Promise((resolve, reject) => {
// 创建实例
const qr = new UQRCode();
// 设置二维码内容
qr.data = this.qrCodeUrl;
// 设置二维码大小
qr.size = this.qrCodeSize;
// 设置前景色(二维码颜色)
qr.foregroundColor = '#000000';
// 设置背景色
qr.backgroundColor = '#FFFFFF';
// 设置边距
qr.margin = 10;
// 设置纠错等级
qr.errorCorrectLevel = UQRCode.errorCorrectLevel.H;
try {
// 调用制作二维码方法
qr.make();
// 获取canvas上下文
const ctx = uni.createCanvasContext('qrcode', this);
// 清空画布
ctx.clearRect(0, 0, this.qrCodeSize, this.qrCodeSize);
// 将二维码绘制到canvas上
qr.canvasContext = ctx;
qr.drawCanvas();
// 绘制完成
ctx.draw(true, () => {
console.log('二维码绘制完成');
resolve();
});
} catch (err) {
reject(err);
}
});
},
// 截图方法
async captureImage() {
try {
uni.showLoading({
title: '正在生成图片...'
});
// 获取DOM元素(在H5环境下)
const element = this.$refs.captureElement.$el;
// 调用工具函数生成图片
const imageData = await elementToImage(element);
this.generatedImage=imageData
this.isLoading = false
this.$refs.sharePosterPop.toggleDropdown()
// 压缩图片
// const compressedImage = await this.compressImage(imageData);
// this.generatedImage = compressedImage;
} catch (error) {
console.error('截图失败:', error);
throw error; // 抛出错误以便外部捕获
} finally {
uni.hideLoading();
}
try {
uni.showLoading({
title: '正在生成图片...'
});
// 获取DOM元素(在H5环境下)
const element = this.$refs.captureElement.$el;
// 调用工具函数生成图片
const imageData = await elementToImage(element);
this.generatedImage = imageData
this.isLoading = false
this.$refs.sharePosterPop.toggleDropdown()
// 压缩图片
// const compressedImage = await this.compressImage(imageData);
// this.generatedImage = compressedImage;
} catch (error) {
console.error('截图失败:', error);
throw error; // 抛出错误以便外部捕获
} finally {
uni.hideLoading();
}
},
// 关闭海报弹窗
closePoster(){
closePoster() {
this.posterImg = ''
this.generatedImage = ''
}
......@@ -599,9 +597,10 @@
.container {
position: relative;
height: 100vh;
.generateImageBox{
.generateImageBox {
position: absolute;
top:-100%;
top: -100%;
z-index: -1;
border-radius: 20rpx;
width: 100%;
......@@ -612,33 +611,38 @@
align-items: center;
justify-content: center;
flex-direction: column;
.imgBox{
.imgBox {
position: relative;
width: 500rpx;
height: 900rpx;
box-sizing: border-box;
.posterImg{
width: 100%;
height: 100%;
.posterImg {
width: 100%;
height: 100%;
object-fit: cover;
}
.qrcode-container {
position: absolute;
bottom: 1%;
right: 1%;
background: #fff;
padding: 10rpx;
border-radius: 10rpx;
box-shadow: 0 0 10rpx rgba(0,0,0,0.1);
.qrcode-canvas {
display: block;
}
position: absolute;
bottom: 1%;
right: 1%;
background: #fff;
padding: 10rpx;
border-radius: 10rpx;
box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
.qrcode-canvas {
display: block;
}
}
}
}
.tabTitle {
color: #666666;
background-color: #fff;
......@@ -647,8 +651,10 @@
justify-content: space-around;
padding: 30rpx;
box-sizing: border-box;
text {
font-size: 26rpx;
&.actived {
color: #333;
border-bottom: 4rpx solid #20269B;
......@@ -683,6 +689,7 @@
justify-content: space-between;
align-items: center;
font-size: 26rpx;
&:last-child {
border: none;
}
......
<template>
<view class="loadTxt">Loading...</view>
</template>
<script setup >
import { ref } from "vue";
import api from '@/api/api';
import { onLaunch, onLoad } from '@dcloudio/uni-app'
import * as environment from '@/environments/environment'
let dataToken = ref()
onLoad((options) => {
// 参数带token了重新登录
if (options.dataToken) {
// uni.clearStorageSync();
dataToken.value = options.dataToken
reLogin(options.landingPage)
}
})
const reLogin = (landingPage) => {
uni.showLoading({
title: '加载中...'
});
// 添加iOS平台检测
const isIOS = navigator.platform.match(/(iPhone|iPod|iPad)/i);
const params = {
loginType: '5',
authToken: dataToken.value
}
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']);
dataToken.value = ''
uni.removeStorageSync('dataToken')
if (landingPage == 'sfpHousePurchase') {
uni.reLaunch({ url: `/sfp/housePurchase/housePurchase` })
}else if(landingPage == 'sfpIndex'){
uni.reLaunch({ url: `/sfp/index/index` })
}
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
uni.hideLoading()
}
</script>
<style lang="scss" scoped>
.loadTxt {
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
}
</style>
\ No newline at end of file
......@@ -10,8 +10,8 @@
<!-- 课程详情 -->
<template v-if="courseInfoItem">
<view class="courseItemBox" >
<course-item :thumbnailPath="courseInfoItem.displayImage" :title="courseInfoItem.fileSynopsis"
:summaryBox="courseInfoItem.fileTitle"
<course-item :thumbnailPath="courseInfoItem.displayImage" :title="courseInfoItem.fileTitle"
:summaryBox="courseInfoItem.fileSynopsis"
:dataList="{coursePrice:courseInfoItem.coursePrice,salesNumber:courseInfoItem.salesNumber}"
:fileLecturerId="courseInfoItem.fileLecturerId" :fileId="fileId"></course-item>
</view>
......
......@@ -130,7 +130,8 @@ const companyPdf = ref<PdfItem>({
// urls: Array.from({ length: 21 }, (_, i) =>
// `${OSS_BASE_URL}/public/company-intro_part${i + 1}.pdf`
// ),
urls: [`${OSS_BASE_URL}/public/company-intro.pdf`],
// urls: [`${OSS_BASE_URL}/public/company-intro.pdf`],
urls: [`${OSS_BASE_URL}/wslucky/product/2025/06/24/31c164ac-565c-4990-a584-b5d4935840d0.pdf`],
type: 'showURL'
});
......@@ -271,7 +272,6 @@ const queryUserInfoAndPermission = () => {
const initPdfAfterPermission = () => {
loading.value = true;
const filteredTabs = filteredCurrentTabs.value;
console.log(filteredTabs)
if (currentType.value >= 2 && currentType.value <= 4) {
if (filteredTabs.length > 0) {
activeTab.value = 0;
......@@ -310,7 +310,7 @@ const switchTab = (index: number) => {
const tabs = filteredCurrentTabs.value;
if (index < 0 || index >= tabs.length || tabs.length === 0) return;
uni.showLoading({ title: '切换中...' });
loading.value = true;
setTimeout(() => {
activeTab.value = index;
......@@ -318,7 +318,7 @@ const switchTab = (index: number) => {
uni.setStorageSync('tabsIndex', index);
setTimeout(() => {
uni.hideLoading();
loading.value = false;
}, 300);
}, 100);
};
......
......@@ -4,36 +4,39 @@
<!-- <FloatingButton ></FloatingButton> -->
<view class="myHeader">
<view class="left" @click="userinfo()">
<view
class="avatar"
:style="{backgroundImage: 'url(' + (customerBasicInfo.headPicture || companyLogo) + ')'}"
>
<view class="avatar"
:style="{backgroundImage: 'url(' + (customerBasicInfo.headPicture || companyLogo) + ')'}">
</view>
<view class="headerInfo">
<view class="headerTop">
<view class="" style="margin-right: 15rpx;">
<view class="myName" v-if="loginType == 'codelogin'">
{{showMyName || '点击头像完善信息'}}
<text v-if="customerBasicInfo.partnerType" class="typePartner">{{customerBasicInfo.partnerType}}</text>
{{showMyName || '点头像完善信息'}}
<text v-if="customerBasicInfo.partnerType"
class="typePartner">{{customerBasicInfo.partnerType}}</text>
</view>
<view class="myName" v-if="loginType == 'visitor'">游客</view>
</view>
<!-- &&customerBasicInfo.parentName 我的上级:{{customerBasicInfo.parentName}} -->
<view class="desBox" v-if="loginType == 'codelogin'">
<!-- 上级的显示 -->
<text class="desTxt" v-if="customerBasicInfo.parentRealName&&customerBasicInfo.parentNickName">我的上级:{{customerBasicInfo.parentRealName}}({{customerBasicInfo.parentNickName}})</text>
<text v-else-if="customerBasicInfo.parentRealName">我的上级:{{customerBasicInfo.parentRealName}} </text>
<text v-else-if="!customerBasicInfo.parentRealName&&customerBasicInfo.parentNickName">我的上级:{{customerBasicInfo.parentNickName}}</text>
<text class="desTxt"
v-if="customerBasicInfo.parentRealName&&customerBasicInfo.parentNickName">我的上级:{{customerBasicInfo.parentRealName}}({{customerBasicInfo.parentNickName}})</text>
<text v-else-if="customerBasicInfo.parentRealName">我的上级:{{customerBasicInfo.parentRealName}}
</text>
<text
v-else-if="!customerBasicInfo.parentRealName&&customerBasicInfo.parentNickName">我的上级:{{customerBasicInfo.parentNickName}}</text>
</view>
</view>
</view>
</view>
<view class="right" @click="goDetail(settingItem)">
<view class="iconfont icon-shezhi " style="font-size: 40rpx;color: #fff;"></view>
</view>
</view>
<view class="myContent">
<view class="myContent" :style="{ paddingBottom: tabBarPadding + 'px' }">
<view class="infoBody" @click="jumpToSystemMsg()">
<view class="">
<view v-if="messageInfo.length>0">
......@@ -44,27 +47,29 @@
</view>
</view>
<view class="msgBox">
<view class="magNum" v-if="msgTotal>0" >
<view class="magNum" v-if="msgTotal>0">
{{msgTotal}}
</view>
<view class="iconfont icon-youjiantou iconColor"></view>
</view>
</view>
</view>
<!-- 不是合伙人的角色可以看名片 v-if="customerBasicInfo.userIdentity&&customerBasicInfo.userIdentity!=='PARTNER'" -->
<!-- <view class="infoBody" v-if="customerBasicInfo.userIdentity&&customerBasicInfo.userIdentity!=='PARTNER'" style="margin-top: 10rpx;" @click="businessCard()">
<view class="infoBody" v-if="customerBasicInfo.userIdentity&&customerBasicInfo.userIdentity!=='PARTNER'"
style="margin-top: 10rpx;" @click="businessCard()">
<view class="">
我的名片
</view>
<view class="">
<view class="iconfont icon-youjiantou iconColor"></view>
</view>
</view> -->
</view>
<view class="kuaiBox" v-for="item in mainMenuLists" :key="item.id">
<view class="kuaiTit">
{{item.categoryName}}
</view>
<view class="kuaiCon">
<view class="kuaiItem" v-for="menuItem in item.children.filter(v=>v.isShow)" :key="menuItem.title" @click="goDetail(menuItem)">
<view class="kuaiItem" v-for="menuItem in item.children.filter(v=>v.isShow)" :key="menuItem.title"
@click="goDetail(menuItem)">
<view class="imgbox">
<view class="iconfont iconSize" :class="`${menuItem.icon}`"></view>
</view>
......@@ -72,31 +77,28 @@
{{menuItem.title}}
</view>
</view>
</view>
</view>
<view class="shareBtn" :class="{'shareBottom':shareBtnBottom}" @click="gotoPoster">
<view class="shareBtn" @click="gotoPoster">
<view class="shareBox">
分享给好友
</view>
</view>
</view>
<!-- 使用封装后的弹窗组件 -->
<join-popup
ref="joinPopup"
@confirm="gotoApply"
></join-popup>
<join-popup ref="joinPopup" @confirm="gotoApply"></join-popup>
<uni-popup ref="applyPopup" type="center" background-color="#fff">
<view class="applyBox">
<view style="text-align: right;" @click="$refs.applyPopup.close()">
<view class="iconfont icon-chahao" ></view>
<view class="iconfont icon-chahao"></view>
</view>
<view class="applyCon">
<view style="text-align: center;" >
<view class="iconfont icon-dianzan" ></view>
<view style="text-align: center;">
<view class="iconfont icon-dianzan"></view>
</view>
<view class="title">
您已加盟为银盾家办合伙人
</view>
......@@ -106,80 +108,61 @@
</view>
<view class="" v-if="partnerStatistic.reachPeopleNum>0">
<view class="">
<text class="iconfont icon-a-tuandui3 leftIcon" ></text>
<text class="iconfont icon-a-tuandui3 leftIcon"></text>
<text>团队有效人数</text>
<text
v-if="partnerStatistic.totalPeopleNum<partnerStatistic.reachPeopleNum"
class="iconfont icon-weiwancheng rightIcon"
></text>
<text
v-else
class="iconfont icon-duihao2 rightIcon"
></text>
<text v-if="partnerStatistic.totalPeopleNum<partnerStatistic.reachPeopleNum"
class="iconfont icon-weiwancheng rightIcon"></text>
<text v-else class="iconfont icon-duihao2 rightIcon"></text>
</view>
<view class="num">
<text >{{partnerStatistic.totalPeopleNum}} / {{partnerStatistic.reachPeopleNum}}</text>
<text>{{partnerStatistic.totalPeopleNum}} / {{partnerStatistic.reachPeopleNum}}</text>
<text v-if="partnerStatistic.peopleNum>0">(相差{{partnerStatistic.peopleNum}}人)</text>
</view>
</view>
<view class="" v-if="partnerStatistic.reachSingeSaleNum>0">
<view class="" >
<text class="iconfont icon-xiaoshoue leftIcon" ></text>
<view class="">
<text class="iconfont icon-xiaoshoue leftIcon"></text>
<text>个人标准销售累计金额</text>
<!-- <text class="iconfont icon-duihao2 rightIcon" ></text> -->
<text
v-if="partnerStatistic.totalSingeSaleNum<partnerStatistic.reachSingeSaleNum"
class="iconfont icon-weiwancheng rightIcon"
></text>
<text
v-else
class="iconfont icon-duihao2 rightIcon"
></text>
<text v-if="partnerStatistic.totalSingeSaleNum<partnerStatistic.reachSingeSaleNum"
class="iconfont icon-weiwancheng rightIcon"></text>
<text v-else class="iconfont icon-duihao2 rightIcon"></text>
</view>
<view class="num">
<text >{{partnerStatistic.totalSingeSaleNum.toFixed(2)}}元 / {{partnerStatistic.reachSingeSaleNum.toFixed(2)}}</text>
<text>{{partnerStatistic.totalSingeSaleNum.toFixed(2)}}元 /
{{partnerStatistic.reachSingeSaleNum.toFixed(2)}}</text>
</view>
</view>
<view class="" v-if="partnerStatistic.reachSaleNum>0">
<view class="">
<text class="iconfont icon-ddailirenshu leftIcon" ></text>
<text class="iconfont icon-ddailirenshu leftIcon"></text>
<text>团队标准销售累计金额</text>
<!-- <text class="iconfont icon-weiwancheng rightIcon" ></text> -->
<text
v-if="partnerStatistic.totalSaleNum<partnerStatistic.reachSaleNum"
class="iconfont icon-weiwancheng rightIcon"
></text>
<text
v-else
class="iconfont icon-duihao2 rightIcon"
></text>
<text v-if="partnerStatistic.totalSaleNum<partnerStatistic.reachSaleNum"
class="iconfont icon-weiwancheng rightIcon"></text>
<text v-else class="iconfont icon-duihao2 rightIcon"></text>
</view>
<view class="num">
<text >{{partnerStatistic.totalSaleNum.toFixed(2)}}元 / {{partnerStatistic.reachSaleNum.toFixed(2)}}</text>
<text v-if="partnerStatistic.saleNum>0">(相差{{partnerStatistic.saleNum.toFixed(2)}}元)</text>
<text>{{partnerStatistic.totalSaleNum.toFixed(2)}}元 /
{{partnerStatistic.reachSaleNum.toFixed(2)}}</text>
<text
v-if="partnerStatistic.saleNum>0">(相差{{partnerStatistic.saleNum.toFixed(2)}}元)</text>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<!-- 不是新锐合伙人提示 -->
<partner-tip-popup
ref="PartnerTipPopup"
content="您还未升级为新锐合伙人,团队成员销售成功您不能拿到收益。购买产品升级为新锐合伙人 "
joinText="暂不升级,继续邀请"
continueText="购买产品,立即升级"
btnType="vertical"
:tipIcon="true"
@join="jumpPage('2')"
@continue="jumpPage('1')"
/>
<restrictedTip ref="restrictedTip"/>
<partner-tip-popup ref="PartnerTipPopup" content="您还未升级为新锐合伙人,团队成员销售成功您不能拿到收益。购买产品升级为新锐合伙人 "
joinText="暂不升级,继续邀请" continueText="购买产品,立即升级" btnType="vertical" :tipIcon="true" @join="jumpPage('2')"
@continue="jumpPage('1')" />
<restrictedTip ref="restrictedTip" />
</view>
</template>
......@@ -188,7 +171,7 @@
import common from "../../common/common";
import tabBar from '../../components/tabBar/tabBar.vue';
import api from "@/api/api";
import {companyInfo} from "@/environments/environment";
import { companyInfo } from "@/environments/environment";
import FloatingButton from '@/components/FloatingButton/FloatingButton.vue';
import JoinPopup from '@/components/commonPopup/JoinPopup.vue';
import PartnerTipPopup from "@/components/commonPopup/PartnerTipPopup.vue";
......@@ -197,71 +180,207 @@
export default {
data() {
return {
showMyName:'',
msgTotal:0,
messageInfo:[],
companyType : companyInfo.companyType,
companyLogo : '../../static/suplogo.png',
showMyName: '',
msgTotal: 0,
messageInfo: [],
companyType: companyInfo.companyType,
companyLogo: '../../static/suplogo.png',
userId: uni.getStorageSync('cffp_userId'),
loginType : uni.getStorageSync('loginType'),
inviteEqrode:'',
currentPage:'personalCenter',
customerBasicInfo:{},
loginType: uni.getStorageSync('loginType'),
inviteEqrode: '',
currentPage: 'personalCenter',
customerBasicInfo: {},
loginornot: true,
settingItem:{title:'系统设置',icon:'setting',link:'/pages/personalCenter/system/settings',isOpen:true,isShow:true},
mainMenuLists:[
{id:'00',categoryName:'交易',
children:[
{title:'成交订单',icon:'icon-dingdan',link:'/pages/saleCourseLists/saleCourseLists',isOpen:true,isShow:true},
{title:'佣金',icon:'icon-yongjin',link:'/pages/pointsExchange/pointsExchange',isOpen:true,isShow:true,identity: true},
{title:'我的售后',icon:'icon-shouhoufuwu',link:'/pages/afterSales/afterSales',isOpen:true,isShow:true},
{title:'分享数据',icon:'icon-shujufenxi',link:'/pages/myShare/myShare',isOpen:true,isShow:true},
tabBarPadding: 100,
settingItem: {
title: '系统设置',
icon: 'setting',
link: '/pages/personalCenter/system/settings',
isOpen: true,
isShow: true
},
mainMenuLists: [{
id: '00',
categoryName: '交易',
children: [{
title: '成交订单',
icon: 'icon-dingdan',
link: '/pages/saleCourseLists/saleCourseLists',
isOpen: true,
isShow: true
},
{
title: '佣金',
icon: 'icon-yongjin',
link: '/pages/pointsExchange/pointsExchange',
isOpen: true,
isShow: true,
identity: true
},
{
title: '我的售后',
icon: 'icon-shouhoufuwu',
link: '/pages/afterSales/afterSales',
isOpen: true,
isShow: true
},
{
title: '分享数据',
icon: 'icon-shujufenxi',
link: '/pages/myShare/myShare',
isOpen: true,
isShow: true
},
],
},
{id:'01',categoryName:'团队',
children:[
{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},
],
},{id:'03',categoryName:'学习研讨',
children:[
{key:'company-intro',title:'公司介绍',icon:'icon-gongsi',link:'/pages/personalCenter/detail',isOpen:true,isShow:true,identity:true,type:1},
{key:'policies',title:'制度',icon:'icon-xiaoshoue',link:'/pages/personalCenter/detail',isOpen:true,isShow:false,identity: true,type:4},
{key:'products',title:'产品分析',icon:'icon-shujufenxi',link:'/pages/personalCenter/detail',isOpen:true,isShow:false,identity: true,type:3},
{key:'cases',title:'案例分享',icon:'icon-shiyongjiaocheng',link:'/pages/personalCenter/detail',isOpen:true,isShow:false,identity: true,type:2},
{key:'commission',title:'持牌人佣金',icon:'icon-dingdan',link:'/myPackageA/product-list/product-commission',isOpen:true,isShow:false,identity: true},
{
id: '01',
categoryName: '团队',
children: [{
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: '/myPackageA/myTeam/myTeam',
isOpen: true,
isShow: true,
identity: true
},
// {title:'育成团队',icon:'icon-yuchengguanxi',link:'/pages/personalCenter/myTeamIncubate',isOpen:true,isShow:true,identity: true},
],
},{id:'04',categoryName:'海外资产配置',
children:[
{title:'积分明细',icon:'icon-yongjin',link:'/pages/personalCenter/helpCenter',isOpen:false,isShow:true,islogin:true}
}, {
id: '03',
categoryName: '学习研讨',
children: [{
key: 'company-intro',
title: '公司介绍',
icon: 'icon-gongsi',
link: '/pages/personalCenter/detail',
isOpen: true,
isShow: true,
identity: true,
type: 1
},
{
key: 'policies',
title: '制度',
icon: 'icon-xiaoshoue',
link: '/pages/personalCenter/detail',
isOpen: true,
isShow: false,
identity: true,
type: 4
},
{
key: 'products',
title: '产品分析',
icon: 'icon-shujufenxi',
link: '/pages/personalCenter/detail',
isOpen: true,
isShow: false,
identity: true,
type: 3
},
{
key: 'cases',
title: '案例分享',
icon: 'icon-shiyongjiaocheng',
link: '/pages/personalCenter/detail',
isOpen: true,
isShow: false,
identity: true,
type: 2
},
{
key: 'commission',
title: '持牌人佣金',
icon: 'icon-dingdan',
link: '/myPackageA/product-list/product-commission',
isOpen: true,
isShow: false,
identity: true
},
],
}, {
id: '04',
categoryName: '海外资产配置',
children: [{
title: '积分明细',
icon: 'icon-yongjin',
link: '/pages/personalCenter/helpCenter',
isOpen: false,
isShow: true,
islogin: true
}],
},
{id:'02',categoryName:'帮助',
children:[
{title:'帮助中心',icon:'icon-wenhao1',link:'/pages/personalCenter/helpCenter',isOpen:true,isShow:true,islogin:true},
{title:'咨询客服',icon:'icon-kefu1',link:'',isOpen:true,isShow:true,islogin:true,kefu:true},
{
id: '02',
categoryName: '帮助',
children: [{
title: '帮助中心',
icon: 'icon-wenhao1',
link: '/pages/personalCenter/helpCenter',
isOpen: true,
isShow: true,
islogin: true
},
{
title: '咨询客服',
icon: 'icon-kefu1',
link: '',
isOpen: true,
isShow: true,
islogin: true,
kefu: true
},
],
},
],
minorMenuLists:[
minorMenuLists: [
// {title:'我的邀请码',icon:'shareEcode',link:'',isOpen:true,isShow:true},
{title:'我的卡包',icon:'card',link:'',isOpen:true,isShow:false},
{ title: '我的卡包', icon: 'card', link: '', isOpen: true, isShow: false },
// {title:'我的认证',icon:'myCertify',link:'/pages/myCertify/myCertify',isOpen:true,isShow:true},
{title:'申请修改公司周边',icon:'setting',link:'',isOpen:true,isShow:false},
{title:'我的消息',icon:'message',link:'/pages/systemMsg/system_msg',isOpen:true,isShow:true,islogin:true},
{title:'系统设置',icon:'setting',link:'/pages/personalCenter/system/settings',isOpen:true,isShow:true}
{ title: '申请修改公司周边', icon: 'setting', link: '', isOpen: true, isShow: false },
{
title: '我的消息',
icon: 'message',
link: '/pages/systemMsg/system_msg',
isOpen: true,
isShow: true,
islogin: true
},
{
title: '系统设置',
icon: 'setting',
link: '/pages/personalCenter/system/settings',
isOpen: true,
isShow: true
}
],
partnerStatistic:{}, //申请加盟统计
userInfo:{} ,//用户信息,
shareBtnBottom:false,
productItem:{}
partnerStatistic: {}, //申请加盟统计
userInfo: {}, //用户信息,
shareBtnBottom: false,
productItem: {}
}
},
components:{
components: {
tabBar,
JoinPopup,
PartnerTipPopup,
......@@ -269,23 +388,23 @@
},
onShow() {
this.loginType = uni.getStorageSync('loginType')
if(this.companyType == '1'){
this.companyLogo='../../static/myteam/Group1633.png';
}else if(this.companyType == '2'){
this.companyLogo='../../static/suplogo.png';
if (this.companyType == '1') {
this.companyLogo = '../../static/myteam/Group1633.png';
} else if (this.companyType == '2') {
this.companyLogo = '../../static/suplogo.png';
}
if(!this.loginType|| this.loginType == "visitor"){
if (!this.loginType || this.loginType == "visitor") {
this.loginornot = false
}else{
} else {
this.loginornot = true;
}
if(this.loginType == 'codelogin'){
if (this.loginType == 'codelogin') {
this.querySystemMessage()
this.queryInfo();
this.courseList()
}else {
} else {
this.messageInfo = []
uni.removeTabBarBadge({ index: 3 });
this.msgTotal = 0
......@@ -293,118 +412,131 @@
}
uni.$on("handClick", res => {
this.customerBasicInfo = res.data
let name = this.customerBasicInfo.realName || this.customerBasicInfo.nickName
if(name && name.length>4){
this.showMyName =name.substring(0, 4) + '...'
}else {
let name = this.customerBasicInfo.realName || this.customerBasicInfo.nickName
if (name && name.length > 4) {
this.showMyName = name.substring(0, 4) + '...'
} else {
this.showMyName = name
}
// 移除监听事件
uni.$off('handClick');
uni.$off('handClick');
});
if(uni.getStorageSync('cffp_userInfo')){
if (uni.getStorageSync('cffp_userInfo')) {
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
if (this.userInfo) {
const levelCode = this.userInfo.levelCode || '';
const dealerId = this.userInfo.dealerId || '';
// 2. 找到“申请加盟”菜单项(通过 key)
const team = this.mainMenuLists.find(item => item.id === '01');
if (!team) return;
const applyItem = team.children.find(child => child.key === 'applyFranchise');
if (!applyItem) return;
// 3. 更新标题和显示状态
applyItem.title = levelCode === '' ? '申请加盟' : '晋升目标';
applyItem.isShow = !dealerId && levelCode != 'P3'; // 没有 dealerId 才显示
}
}
// #ifdef H5
const systemInfo = uni.getSystemInfoSync();
this.shareBtnBottom = systemInfo.platform === 'ios'
// console.log('this.shareBtnBottom',this.shareBtnBottom);
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
},
methods: {
courseList() {
api.courseList().then(res => {
if (res['success']) {
let cffpCourseInfos = res['data']['data'];
if(cffpCourseInfos.length>0){
cffpCourseInfos.forEach(item=>{
if(item.productCode&&item.productCode=='C09'){
if (cffpCourseInfos.length > 0) {
cffpCourseInfos.forEach(item => {
if (item.productCode && item.productCode == 'ZNTJ') {
this.productItem = item
uni.setStorageSync('productItem',this.productItem );
uni.setStorageSync('productItem', this.productItem);
}
})
}
}
})
},
gotoPoster(){
if(!uni.getStorageSync('loginType') || uni.getStorageSync('loginType')=='visitor'){
uni.setStorageSync('loginType','visitor')
uni.setStorageSync('islogin','1')
gotoPoster() {
if (!uni.getStorageSync('loginType') || uni.getStorageSync('loginType') == 'visitor') {
uni.setStorageSync('loginType', 'visitor')
uni.setStorageSync('islogin', '1')
}
uni.navigateTo({
url:'/myPackageA/poster/poster?from=personalCenter'
url: '/myPackageA/poster/poster?from=personalCenter'
})
},
jumpPage(type){
if(type=='1'){
jumpPage(type) {
if (type == '1') {
uni.navigateTo({
url:'/pages/inviteJoin/inviteJoin'
url: '/pages/inviteJoin/inviteJoin'
})
}else {
} else {
let productItem = {}
if(uni.getStorageSync('productItem')){
if (uni.getStorageSync('productItem')) {
productItem = JSON.parse(JSON.stringify(uni.getStorageSync('productItem')))
}
uni.navigateTo({
url: `/pages/courseDetail/courseDetail?fileId=${productItem.fileId}`
});
}
},
getPartnerStatistic(){
if(this.userId){
api.partnerStatisticsGrade({userId:uni.getStorageSync('cffp_userId')}).then((res)=>{
if(res['success']){
getPartnerStatistic() {
if (this.userId) {
api.partnerStatisticsGrade({ userId: uni.getStorageSync('cffp_userId') }).then((res) => {
if (res['success']) {
this.partnerStatistic = res['data']
for (let key in this.partnerStatistic) {
if(key!='peopleNum' && key!='reachPeopleNum'&& key!='totalPeopleNum'){
if(key){
if (key != 'peopleNum' && key != 'reachPeopleNum' && key != 'totalPeopleNum') {
if (key) {
this.partnerStatistic[key] = Number(this.partnerStatistic[key].toFixed(2))
}
}
}
this.$refs.applyPopup.open()
}else {
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
icon: 'none'
})
}
})
}
},
gotoApply(){
gotoApply() {
uni.navigateTo({
url: '/myPackageA/applyFranchise/applyFranchise'
})
url: '/myPackageA/applyFranchise/applyFranchise'
})
this.$refs.joinPopup.close()
},
querySystemMessage(){
if(this.userId){
api.querySystemMessage({systemType:1,userId:uni.getStorageSync('cffp_userId')}).then((res)=>{
if(res['success']&&res['data']['dataList']&&res['data']['dataList'].length>0){
querySystemMessage() {
if (this.userId) {
api.querySystemMessage({ systemType: 1, userId: uni.getStorageSync('cffp_userId') }).then((res) => {
if (res['success'] && res['data']['dataList'] && res['data']['dataList'].length > 0) {
this.messageInfo = res['data']['dataList'];
this.msgTotal = res['data']['dataList'].filter(item=>{
return item.isRead == 0
}).length
if(this.msgTotal>0){
uni.setTabBarBadge({
index: 3,
text: this.msgTotal.toString()
});
}else {
uni.removeTabBarBadge({ index: 3 });
}
}else {
this.msgTotal = res['data']['dataList'].filter(item => {
return item.isRead == 0
}).length
if (this.msgTotal > 0) {
uni.setTabBarBadge({
index: 3,
text: this.msgTotal.toString()
});
} else {
uni.removeTabBarBadge({ index: 3 });
}
} else {
this.messageInfo = []
uni.removeTabBarBadge({ index: 3 });
this.msgTotal = 0
......@@ -412,116 +544,117 @@
})
}
},
jumpToSystemMsg(){
jumpToSystemMsg() {
dataHandling.pocessTracking(
'查看',
`用户查看个人消息`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
'查看',
`用户查看个人消息`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
)
uni.navigateTo({
url:'../systemMsg/system_msg'
url: '../systemMsg/system_msg'
})
// if(this.userId&& this.messageInfo.length>0){
// uni.navigateTo({
// url:'../systemMsg/system_msg'
// })
// }
},
close(){
// if(this.userId&& this.messageInfo.length>0){
// uni.navigateTo({
// url:'../systemMsg/system_msg'
// })
// }
},
close() {
this.bootpage = false
},
isLogin(){
isLogin() {
uni.navigateTo({
url: '/myPackageA/login/login?from=personalCenter'
})
try {
uni.setStorageSync('loginType','visitor');
uni.setStorageSync('loginType', 'visitor');
} catch (e) {
}
return false
},
// 菜单跳转页面
goDetail(item){
if(uni.getStorageSync('cffp_userInfo')){
goDetail(item) {
if (uni.getStorageSync('cffp_userInfo')) {
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
}
if(item.isApply&&(!uni.getStorageSync('loginType')||uni.getStorageSync('loginType')=='visitor')){
if (item.isApply && (!uni.getStorageSync('loginType') || uni.getStorageSync('loginType') == 'visitor')) {
dataHandling.pocessTracking(
'申请加盟',
`用户在未登录时点击了申请加盟`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
'申请加盟',
`用户在未登录时点击了申请加盟`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
)
uni.navigateTo({
url: `${item.link}`
});
return
}
if(item.kefu){
if (item.kefu) {
// 现在还没转化成小程序,暂时放在这
// #ifdef MP-WEIXIN
console.log('MP-WEIXIN====')
dataHandling.pocessTracking(
'咨询客服',
`用户咨询客服`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
'咨询客服',
`用户咨询客服`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
)
uni.openCustomerServiceChat({
extInfo: {
url: 'https://work.weixin.qq.com/kfid/kfc08c55f4170e7fc9e'
},
corpId: 'ww43cac1cf9dd6a3d0', // 客服会话按钮打开后,在微信客服会话按钮处理的事件类型
showMessageCard: true,
sendMessageTitle: (uni.getStorageSync('hoservice_mobileNo')?(uni.getStorageSync('hoservice_mobileNo')+",") :"" ) + "进入个人中心-->咨询客服",
sendMessagePath: `/pages/index/mySelf.html`,
//sendMessageImg: cardItem.value['list'][0]['itemImg']
extInfo: {
url: 'https://work.weixin.qq.com/kfid/kfc08c55f4170e7fc9e'
},
corpId: 'ww43cac1cf9dd6a3d0', // 客服会话按钮打开后,在微信客服会话按钮处理的事件类型
showMessageCard: true,
sendMessageTitle: (uni.getStorageSync('hoservice_mobileNo') ? (uni.getStorageSync(
'hoservice_mobileNo') + ",") : "") + "进入个人中心-->咨询客服",
sendMessagePath: `/pages/index/mySelf.html`,
//sendMessageImg: cardItem.value['list'][0]['itemImg']
});
// #endif
// #ifdef H5
console.log('H5====')
dataHandling.pocessTracking(
'咨询客服',
`用户咨询客服`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
'咨询客服',
`用户咨询客服`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
)
if (uni.getStorageSync('mpCffp') == '1'){
if (uni.getStorageSync('mpCffp') == '1') {
let d = {
corpId: 'ww43cac1cf9dd6a3d0',//企业微信ID
url: 'https://work.weixin.qq.com/kfid/kfc08c55f4170e7fc9e',//企业微信客户接入链接
corpId: 'ww43cac1cf9dd6a3d0', //企业微信ID
url: 'https://work.weixin.qq.com/kfid/kfc08c55f4170e7fc9e', //企业微信客户接入链接
}
let p = Object.keys(d).reduce((p, k, i) => p + `${i ? '&' : '?'}${k}=${d[k]}`, '');
wx.miniProgram.reLaunch({ url: `/pages/index/homePage${p}` });//触发小程序刷新页面获取appId
}else{
wx.miniProgram.reLaunch({ url: `/pages/index/homePage${p}` }); //触发小程序刷新页面获取appId
} else {
window.open('https://work.weixin.qq.com/kfid/kfc08c55f4170e7fc9e')
}
// #endif
return
}
if(item.isApply&&this.customerBasicInfo.partnerType){
if (item.isApply && this.customerBasicInfo.partnerType) {
dataHandling.pocessTracking(
'申请加盟',
`用户已成为合伙人查看了团队统计差`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
'申请加盟',
`用户已成为合伙人查看了团队统计差`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
)
if(this.customerBasicInfo.userIsActive == 2){
if (this.customerBasicInfo.userIsActive == 2) {
this.$refs.restrictedTip.open()
return
}
......@@ -529,186 +662,192 @@
return
}
//当为见习合伙人的时候,弹出框提示
if(item.key == '06'&& this.userInfo.levelCode == 'P1' && uni.getStorageSync('loginType') == 'codelogin'&& this.userInfo.userIsActive == 1){
if (item.key == '06' && this.userInfo.levelCode == 'P1' && uni.getStorageSync('loginType') ==
'codelogin' && this.userInfo.userIsActive == 1) {
this.$refs.PartnerTipPopup.open()
return
}
// 说明不需要登录就可以进
if(item.isLogin){
if (item.isLogin) {
dataHandling.pocessTracking(
'查看',
`用户点击了${item.title}模块`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
'查看',
`用户点击了${item.title}模块`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
)
uni.navigateTo({
url: `${item.link}`
});
return
}
if(!this.loginornot&& !item.islogin){
if (!this.loginornot && !item.islogin) {
this.isLogin()
return
}
if(item.isShow && item.isOpen){
if(item.title==='我的邀请码'){
if (item.isShow && item.isOpen) {
if (item.title === '我的邀请码') {
this.$refs.popup1.open('bottom');
}else{
} else {
this.ckidentity(item)
}
}else{
common.errorDialog(2,'该模块正在开发中,敬请期待!','提示');
} else {
common.errorDialog(2, '该模块正在开发中,敬请期待!', '提示');
}
},
ckidentity(item){
if(item.identity == true && this.customerBasicInfo.partnerType ==null){
ckidentity(item) {
if (item.identity == true && this.customerBasicInfo.partnerType == null) {
dataHandling.pocessTracking(
'查看',
`用户在未加盟时点击了${item.title}模块`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
'查看',
`用户在未加盟时点击了${item.title}模块`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
)
this.$refs.joinPopup.open()
return false
}else if(item.title == '邀请加盟'){
} else if (item.title == '邀请加盟') {
uni.navigateTo({
url: `${item.link}?levelCode=` + this.customerBasicInfo.levelCode
});
}else{
} else {
const urlObj = JSON.parse(JSON.stringify(item))
if(urlObj.type){
urlObj.link = `${urlObj.link}?type=${urlObj.type}&from=personalCenter&partnerType=${this.customerBasicInfo.partnerType}`
}else{
urlObj.link = `${urlObj.link}?from=personalCenter&partnerType=${this.customerBasicInfo.partnerType}`
if (urlObj.type) {
urlObj.link =
`${urlObj.link}?type=${urlObj.type}&from=personalCenter&partnerType=${this.customerBasicInfo.partnerType}`
} else {
urlObj.link =
`${urlObj.link}?from=personalCenter&partnerType=${this.customerBasicInfo.partnerType}`
}
if(item.isTab){
if (item.isTab) {
uni.switchTab({
url:`../../${urlObj.link}`
url: `../../${urlObj.link}`
})
}else{
} else {
uni.navigateTo({
url: urlObj.link
});
}
}
},
userinfo(){
if(this.loginornot === true){
userinfo() {
if (this.loginornot === true) {
dataHandling.pocessTracking(
'个人信息',
`用户在我的点击个人资料`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
'个人信息',
`用户在我的点击个人资料`,
'点击',
2,
'我的',
'pages/personalCenter/personalCenter'
)
uni.navigateTo({
url:`/pages/personalCenter/user-information?customerBasicInfo=` + JSON.stringify(this.customerBasicInfo)
url: `/pages/personalCenter/user-information?customerBasicInfo=` + JSON.stringify(this
.customerBasicInfo)
})
}else {
} else {
this.isLogin()
}
},
// 弹窗
errorDialog(type,content){
common.errorDialog(type,content);
errorDialog(type, content) {
common.errorDialog(type, content);
return false;
},
closePopup(){
closePopup() {
this.$refs.popup1.close()
},
copy(){
copy() {
uni.setClipboardData({
data: this.inviteEqrode,
success: function () {
success: function() {
console.log('success');
}
});
},
setSpecificMenuIsShow(mainMenus,permKeys){
setSpecificMenuIsShow(mainMenus, permKeys) {
// 找到id=03的主菜单
const targetMenu = mainMenus.find(menu => menu.id === '03');
if(permKeys){
// 提取权限数组中的key
const validKeys = permKeys.map(item => item.key);
if (targetMenu && targetMenu.children) {
// 只遍历该菜单的children
targetMenu.children.forEach(subMenu => {
if (subMenu.key && validKeys.includes(subMenu.key)) {
subMenu.isShow = true;
}else{
subMenu.isShow = false;
}
});
}
}else{
if (permKeys) {
// 提取权限数组中的key
const validKeys = permKeys.map(item => item.key);
if (targetMenu && targetMenu.children) {
// 只遍历该菜单的children
targetMenu.children.forEach(subMenu => {
if (subMenu.key && validKeys.includes(subMenu.key)) {
subMenu.isShow = true;
} else {
subMenu.isShow = false;
}
});
}
} else {
if (targetMenu && targetMenu.children) {
// 只遍历该菜单的children
targetMenu.children.forEach(subMenu => {
// 只有当key不是'company-intro'时,才设置isShow为false
if (subMenu.key !== 'company-intro') {
subMenu.isShow = false;
}
// 只有当key不是'company-intro'时,才设置isShow为false
if (subMenu.key !== 'company-intro') {
subMenu.isShow = false;
}
});
}
}
}
return mainMenus;
return mainMenus;
},
// 查询个人资料
queryInfo(){
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
if(res['success']){
queryInfo() {
api.queryInfo({ userId: uni.getStorageSync('cffp_userId') }).then(res => {
if (res['success']) {
this.customerBasicInfo = res['data'];
// id=03的权限设置
// 执行处理
const result = this.setSpecificMenuIsShow(this.mainMenuLists, this.customerBasicInfo.accessPermission);
const result = this.setSpecificMenuIsShow(this.mainMenuLists, this.customerBasicInfo
.accessPermission);
// 输出结果(仅展示id=03的children验证效果)
// console.log('处理后的"学习研讨"子菜单:',
// JSON.stringify(result.find(menu => menu.id === '03')?.children, null, 2));
// this.customerBasicInfo.userIdentity = 'DISTRIBUTOR'
let name = this.customerBasicInfo.realName || this.customerBasicInfo.nickName
if(name && name.length>4){
let name = this.customerBasicInfo.realName || this.customerBasicInfo.nickName
if (name && name.length > 4) {
this.showMyName = name.substring(0, 4) + '...'
}else {
} else {
this.showMyName = name
}
if(this.customerBasicInfo.parentRealName&&this.customerBasicInfo.parentNickName && this.customerBasicInfo.parentNickName.length>3){
this.customerBasicInfo.parentNickName = this.customerBasicInfo.parentNickName.substring(0, 3) + '..'
if (this.customerBasicInfo.parentRealName && this.customerBasicInfo.parentNickName && this
.customerBasicInfo.parentNickName.length > 3) {
this.customerBasicInfo.parentNickName = this.customerBasicInfo.parentNickName
.substring(0, 3) + '..'
}
if(this.customerBasicInfo.parentRealName&&this.customerBasicInfo.parentNickName&& this.customerBasicInfo.parentRealName.length>3){
this.customerBasicInfo.parentRealName = this.customerBasicInfo.parentRealName.substring(0, 3) + '..'
if (this.customerBasicInfo.parentRealName && this.customerBasicInfo.parentNickName && this
.customerBasicInfo.parentRealName.length > 3) {
this.customerBasicInfo.parentRealName = this.customerBasicInfo.parentRealName
.substring(0, 3) + '..'
}
this.inviteEqrode = this.customerBasicInfo.invitationCode;
uni.setStorageSync('user_mobile', res.data.mobile)
}else {
uni.setStorageSync('loginType','visitor')
console.log('this.mainMenuLists', this.mainMenuLists);
} else {
uni.setStorageSync('loginType', 'visitor')
this.showMyName = ''
this.loginType = 'visitor'
}
})
},
// 获取名片状态
// getCard(){
// }
// 我的名片页面
businessCard(){
if(!uni.getStorageSync('loginType')||uni.getStorageSync('loginType')=='visitor'){
businessCard() {
if (!uni.getStorageSync('loginType') || uni.getStorageSync('loginType') == 'visitor') {
this.isLogin()
return
}
......@@ -716,33 +855,33 @@
// 和后端协商一致,先查询名片状态,在做出相应反应
api.getBusinessCard(
userId
).then(res =>{
if(res['success']){
).then(res => {
if (res['success']) {
let cardStatus = res.data.data.cardStatus
if(cardStatus=='1'){
if (cardStatus == '1') {
//未申请名片
uni.navigateTo({
url:'/myPackageA/noBusinessCard/noBusinessCard'
url: '/myPackageA/noBusinessCard/noBusinessCard'
});
}else if(cardStatus=='2'){
} else if (cardStatus == '2') {
// 名片审核中
uni.showModal({
title: '提示',
content: `您申请的名片正在审核中,请耐心等待...`,
showCancel: false,
confirmText: '我知道了'
title: '提示',
content: `您申请的名片正在审核中,请耐心等待...`,
showCancel: false,
confirmText: '我知道了'
});
}else {
} else {
//申请的名片已经审核通过
uni.navigateTo({
url:'/myPackageA/businessCard/businessCard'
url: '/myPackageA/businessCard/businessCard'
});
}
}else {
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
icon: 'none'
})
}
})
......@@ -754,26 +893,30 @@
// });
},
},
}
</script>
<style lang="scss" scoped>
::v-deep .uni-popup .uni-popup__wrapper{
margin: 0 !important;
border-radius: 30rpx;
}
.container{
box-sizing:border-box;
min-height: 100vh; /* 使用视口高度 */
::v-deep .uni-popup .uni-popup__wrapper {
margin: 0 !important;
border-radius: 30rpx;
}
.container {
box-sizing: border-box;
min-height: 100vh;
/* 使用视口高度 */
height: auto !important;
height: 100vh;
.iconColor{
.iconColor {
color: rgba(51, 51, 51, 1);
font-size: 28rpx;
}
.myHeader{
.myHeader {
box-sizing: border-box;
width: 100%;
height: 250rpx;
......@@ -781,27 +924,30 @@
display: flex;
align-items: center;
justify-content: space-between;
.left{
.left {
margin-left: 50rpx;
flex: 1;
display: flex;
align-items: center;
.avatar{
.avatar {
flex-grow: 0;
width: 130rpx;
height: 130rpx;
border-radius: 50%;
overflow: hidden;
/* 背景图设置 */
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
/* 添加以下属性强制硬件加速 */
transform: translateZ(0);
-webkit-transform: translateZ(0);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
image{
image {
width: 100%;
height: 100%;
object-fit: cover;
......@@ -811,8 +957,8 @@
border-radius: none !important;
}
}
.headerInfo{
.headerInfo {
box-sizing: border-box;
margin-left: 20rpx;
display: flex;
......@@ -821,12 +967,15 @@
color: rgba(51, 51, 51, 1);
flex-direction: column;
justify-content: flex-start;
.headerTop{
color:#fff;
.myName{
.headerTop {
color: #fff;
.myName {
display: flex;
align-items: center;
.typePartner{
.typePartner {
margin-left: 15rpx;
padding: 5rpx 10rpx;
background-color: #fff;
......@@ -836,10 +985,10 @@
font-size: 26rpx;
}
}
}
.desBox{
.desBox {
border-radius: 8rpx;
padding: 0 2rpx;
font-size: 24rpx;
......@@ -852,16 +1001,20 @@
text-overflow: ellipsis;
white-space: nowrap !important;
flex-shrink: 1;
.desTxt{
width: 350rpx; /* 根据需要调整 */
display: inline-block; /* 或者 block */
.desTxt {
width: 350rpx;
/* 根据需要调整 */
display: inline-block;
/* 或者 block */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap !important;
flex-shrink: 1;
}
}
.nickName{
.nickName {
font-size: 27rpx;
font-weight: normal;
color: rgba(102, 102, 102, 1);
......@@ -869,17 +1022,18 @@
}
}
}
.right{
.right {
width: 100rpx;
margin-top: -20rpx;
}
}
.myContent{
box-sizing:border-box;
.myContent {
box-sizing: border-box;
padding: 20rpx;
.infoBody{
.infoBody {
box-sizing: border-box;
background: #fff;
width: 100%;
......@@ -889,81 +1043,92 @@
align-items: center;
justify-content: space-between;
font-size: 28rpx;
.msgBox{
.msgBox {
display: flex;
align-items: center;
.magNum{
.magNum {
background-color: #f43530;
width: 40rpx;
height: 40rpx;
min-width: 35rpx;
padding: 0 5rpx; /* 为多位数留空间 */
box-sizing: border-box;
min-width: 35rpx;
padding: 0 5rpx;
/* 为多位数留空间 */
box-sizing: border-box;
border-radius: 50%;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
justify-content: center;
align-items: center;
}
}
}
.kuaiBox{
.kuaiBox {
box-sizing: border-box;
background: #fff;
width: 100%;
padding: 10rpx 20rpx;
border-radius: 8rpx;
margin-top: 20rpx;
.kuaiTit{
.kuaiTit {
font-size: 30rpx;
}
.kuaiCon {
margin-top: 30rpx;
display: flex;
align-items: center;
justify-content: flex-start; /* 保持 flex-start */
flex-wrap: wrap;
width: 100%;
gap: 20rpx; /* 替代 margin-right */
margin-top: 30rpx;
display: flex;
align-items: center;
justify-content: flex-start;
/* 保持 flex-start */
flex-wrap: wrap;
width: 100%;
gap: 20rpx;
/* 替代 margin-right */
}
.kuaiItem {
display: flex;
align-items: center;
flex-direction: column;
margin-bottom: 40rpx;
font-size: 26rpx;
// width: calc(25% - 20rpx); /* 4个子项,每个占25%宽度减去边距 */
width: calc(25% - 15rpx); /* 调整计算方式 */
// margin-right: 20rpx; /* 设置右边距 */
display: flex;
align-items: center;
flex-direction: column;
margin-bottom: 40rpx;
font-size: 26rpx;
// width: calc(25% - 20rpx); /* 4个子项,每个占25%宽度减去边距 */
width: calc(25% - 15rpx);
/* 调整计算方式 */
// margin-right: 20rpx; /* 设置右边距 */
}
/* 每行第4个子项去掉右侧间距 */
.kuaiItem:nth-child(4n) {
margin-right: 0;
margin-right: 0;
}
.imgbox {
margin-bottom: 10rpx;
margin-bottom: 10rpx;
}
.iconSize {
font-size: 40rpx;
font-size: 40rpx;
}
}
.kuaiBox:last-child{
.kuaiBox:last-child {
margin-bottom: 100rpx;
}
.shareBtn{
.shareBtn {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 50rpx 0rpx;
.shareBox{
.shareBox {
background-color: #20269B;
color: #fff;
font-size: 30rpx;
......@@ -973,11 +1138,13 @@
padding: 20rpx 30rpx;
}
}
.shareBottom{
.shareBottom {
padding-bottom: 150rpx;
}
}
.joinContent{
.joinContent {
width: 500rpx;
border-radius: 30rpx;
background-color: #ffff;
......@@ -986,7 +1153,8 @@
display: flex;
align-items: center;
flex-direction: column;
.joinHeader{
.joinHeader {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
......@@ -996,15 +1164,18 @@
justify-content: center;
margin-bottom: 20rpx;
}
.joinCon{
.joinCon {
// padding: 20rpx 0;
.one{
.one {
font-size: 30rpx;
color: rgba(38, 41, 44, 1);
font-weight: 600;
text-align: center;
}
.two{
.two {
color: rgba(145, 144, 148, 1);
font-size: 26rpx;
text-align: center;
......@@ -1012,16 +1183,19 @@
margin-bottom: 20rpx;
}
}
.desBox{
.desBox {
display: flex;
flex-direction: column;
margin-bottom: 20rpx;
view{
view {
font-size: 28rpx;
margin-bottom: 10rpx;
}
}
.joinFotter{
.joinFotter {
width: 100%;
color: #fff;
display: flex;
......@@ -1034,86 +1208,89 @@
font-size: 28rpx;
}
}
.applyBox{
.applyBox {
width: 500rpx;
border-radius: 30rpx;
background-color: #ffff;
padding: 30rpx;
box-sizing: border-box;
.icon-chahao{
.icon-chahao {
color: #272536;
font-size: 28rpx;
}
.applyCon{
.applyCon {
display: flex;
// align-items: center;
flex-direction: column;
.icon-dianzan{
.icon-dianzan {
color: #FF8D1A;
font-size: 60rpx;
}
.title{
.title {
font-size: 35rpx;
font-weight: 600;
margin: 20rpx 0;
}
.applycontent{
.applycontent {
color: #20269B;
font-size: 28rpx;
.subtit{
.subtit {
font-size: 30rpx;
margin-bottom: 10rpx;
}
.num{
.num {
font-size: 26rpx;
color: #333333;
margin: 10rpx 0;
}
.leftIcon{
.leftIcon {
color: #20269B;
font-size: 26rpx;
margin-right: 5rpx;
}
.rightIcon{
.rightIcon {
margin-left: 5rpx;
font-size: 26rpx;
color: #F43530;
}
.icon-duihao2{
.icon-duihao2 {
color: #41C740;
}
}
}
}
}
/* 新增:iPad mini 和 iPad Air 竖屏的媒体查询 */
/* iPad mini 竖屏 */
@media only screen
and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: portrait)
and (-webkit-min-device-pixel-ratio: 1) {
.container {
.myContent .shareBtn{
padding-bottom: 120rpx;
}
/* iPad mini 竖屏 */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 1) {
.container {
.myContent {
padding-bottom: 120rpx;
}
}
/* iPad Air 竖屏 */
@media only screen
and (min-device-width: 820px)
and (max-device-width: 1180px)
and (orientation: portrait)
and (-webkit-min-device-pixel-ratio: 1) {
.container {
.myContent .shareBtn{
padding-bottom: 120rpx !important;
}
}
/* iPad Air 竖屏 */
@media only screen and (min-device-width: 820px) and (max-device-width: 1180px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 1) {
.container {
.myContent {
padding-bottom: 120rpx !important;
}
}
</style>
}
</style>
\ No newline at end of file
<template>
<view class="container" :style="cffpFortuneDateList.length>6?'height:auto':'height:100vh'">
<!-- #ifdef APP -->
<view class="backArrow">
<text class="iconfont icon-youjiantou zuojiantou" style="left: 5rpx;" @click="goBack()"></text>
<text style="font-size: 30rpx;">佣金</text>
</view>
<!-- #endif -->
<view class="listBox" >
<!-- #ifdef APP -->
<view class="backArrow">
<text class="iconfont icon-youjiantou zuojiantou" style="left: 5rpx;" @click="goBack()"></text>
<text style="font-size: 30rpx;">佣金</text>
</view>
<!-- #endif -->
<view class="listBox">
<view class="first">
<view class="top">
<view class="left">
......@@ -18,22 +18,20 @@
{{yesExchangeFortune?yesExchangeFortune:'0.00'}}
</view>
</view>
<view class="right" @click="toWithdrawal()">
<view class="right" @click="toWithdrawal()" v-if="showWithdrawal">
提现
</view>
</view>
<view class="bottom">
<view class="bottomItem" v-for="score in scoreList " :key="score.id">
<!-- @click="gotoRecord(score.id)" -->
<view class="one" >
<view
@click="gotoRecord(score.id)"
style="font-size:28rpx;color: rgba(199, 199, 199, 1);"
>
<view class="one">
<view @click="gotoRecord(score.id)" style="font-size:28rpx;color: rgba(199, 199, 199, 1);">
{{score.name}}
</view>
<uni-tooltip class="item" :content="score.content" :placement="score.position">
<text class="iconfont icon-wenhao1" style="margin-left: 3rpx;color: rgba(199, 199, 199, 1);font-size: 28rpx;" ></text>
<text class="iconfont icon-wenhao1"
style="margin-left: 3rpx;color: rgba(199, 199, 199, 1);font-size: 28rpx;"></text>
</uni-tooltip>
</view>
<view class="fotter">
......@@ -44,9 +42,9 @@
</view>
</view>
<view class="" style="padding: 0 20rpx;">
<view class="two" >
<view class="two">
<view class="twoHeader">
订单收益明细
订单收益明细
</view>
<view class="timeBox" @click="$refs.timePopup.open()">
<view style="margin-right: 5rpx;">
......@@ -55,14 +53,9 @@
<text class="iconfont icon-xiajiantou iconStyle"></text>
</view>
<view class="filterBox">
<scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
<view
class="scroll-view-item_H uni-bg-blue"
v-for="item in commissionTypeList"
:key="item.id"
:class="{active:item.id == currentFilter.id }"
@click="changeFilter(item)"
>
<scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
<view class="scroll-view-item_H uni-bg-blue" v-for="item in commissionTypeList" :key="item.id"
:class="{active:item.id == currentFilter.id }" @click="changeFilter(item)">
{{item.dropOptionName}}
</view>
</scroll-view>
......@@ -72,20 +65,13 @@
<text style="margin-right: 10rpx;">合计</text> {{sumCommissionAmount}}
</view>
<view class="totalSelect">
<uni-data-select
v-model="selectItem"
:localdata="selectList"
@change="getDetail()"
></uni-data-select>
<uni-data-select v-model="selectItem" :localdata="selectList"
@change="getDetail()"></uni-data-select>
</view>
</view>
<view class="detailBox" v-if="cffpFortuneDateList.length>0">
<view
class="detailItem"
v-for="(item,index) in cffpFortuneDateList"
:key="index"
@click="viewDetail(item)"
>
<view class="detailItem" v-for="(item,index) in cffpFortuneDateList" :key="index"
@click="viewDetail(item)">
<view class="detailLeft">
<view class="txt">
{{item.productTypeName}}
......@@ -97,8 +83,10 @@
<view class="detailRight">
<view class="">
<view class="money">
<text v-if="item.commissionAmount&&item.commissionAmount>0">+{{item.commissionAmount}}</text>
<text v-if="item.commissionAmount&&item.commissionAmount<0" style="color: rgba(212, 48, 48, 1);">{{item.commissionAmount}}</text>
<text
v-if="item.commissionAmount&&item.commissionAmount>0">+{{item.commissionAmount}}</text>
<text v-if="item.commissionAmount&&item.commissionAmount<0"
style="color: rgba(212, 48, 48, 1);">{{item.commissionAmount}}</text>
</view>
<view style="font-weight: normal;font-size: 26rpx;color: rgba(56, 56, 56, 1);">
{{item.exchangeStatus&&item.exchangeStatus=='1'?'待结算'
......@@ -123,11 +111,12 @@
</view>
</view>
</view>
<uni-popup ref="timePopup" type="bottom" >
<customDatePop @closePop="closePop" @comfirm="comfirm" :dateParts="dateParts" :currentItem="currentItem" :childData="childData"></customDatePop>
<uni-popup ref="timePopup" type="bottom">
<customDatePop @closePop="closePop" @comfirm="comfirm" :dateParts="dateParts" :currentItem="currentItem"
:childData="childData"></customDatePop>
</uni-popup>
</view>
</template>
......@@ -137,111 +126,120 @@
import dataHandling from "@/util/dataHandling";
import { initJssdkShare, setWechatShare } from '@/util/fiveshare';
let nowTime = dataHandling.getMonthRange(dataHandling.getDateParts().year, dataHandling.getDateParts().month)
export default{
data(){
export default {
data() {
return {
yesExchangeFortune:'0.00',
notExchangeFortune:'',
inExchangeFortune:'',
alreadyExchangeFortune:'',
returnFortune:'',
totalFortune:'',
scoreList:[
{name:'总积分',value:'0.00',id:'1',position:'bottom',content:'包含已兑换+待结算+可兑换+兑换中的积分'},
{name:'已兑换',value:'0.00',id:'2',position:'bottom',content:'已经提取入账的积分'},
{name:'待结算',value:'0.00',id:'3',position:'left',content:'订单成交后需等待7天结算期'},
{name:'兑换中',value:'0.00',id:'4',position:'left',content:'正在审核中的积分'},
yesExchangeFortune: '0.00',
notExchangeFortune: '',
inExchangeFortune: '',
alreadyExchangeFortune: '',
returnFortune: '',
totalFortune: '',
scoreList: [
{ name: '总积分', value: '0.00', id: '1', position: 'bottom', content: '包含已兑换+待结算+可兑换+兑换中的积分' },
{ name: '已兑换', value: '0.00', id: '2', position: 'bottom', content: '已经提取入账的积分' },
{ name: '待结算', value: '0.00', id: '3', position: 'left', content: '订单成交后需等待7天结算期' },
{ name: '兑换中', value: '0.00', id: '4', position: 'left', content: '正在审核中的积分' },
],
commissionTypeList:[],
currentFilter:{id:'0',dropOptionCode:null},
selectItem:'0',
selectList:[
commissionTypeList: [],
currentFilter: { id: '0', dropOptionCode: null },
selectItem: '0',
selectList: [
{ value: '0', text: "全部" },
{ value: 1, text: "待结算" },
{ value: 2, text: "可兑换" },
{ value: 1, text: "待结算" },
{ value: 2, text: "可兑换" },
{ value: 3, text: "已兑换" },
{ value: 4, text: "兑换中" },
{ value: 5, text: "已失效" },
],
dateParts:dataHandling.getDateParts(),
currentItem:'1',//便于弹框弹出回显是月份选择还是自定义时间
timeType:'1',//有三种,1:年月,2:上月,近三月,近半年,3:具体日期的选择
showTime:`${dataHandling.getDateParts().year}${dataHandling.getDateParts().month}月`,
childData:{
current:'1',
year:dataHandling.getDateParts().year,
month:dataHandling.getDateParts().month,
timeType:'8',
queryDateStart:nowTime.start,
queryDateEnd:nowTime.end,
dateParts: dataHandling.getDateParts(),
currentItem: '1', //便于弹框弹出回显是月份选择还是自定义时间
timeType: '1', //有三种,1:年月,2:上月,近三月,近半年,3:具体日期的选择
showTime: `${dataHandling.getDateParts().year}${dataHandling.getDateParts().month}月`,
childData: {
current: '1',
year: dataHandling.getDateParts().year,
month: dataHandling.getDateParts().month,
timeType: '8',
queryDateStart: nowTime.start,
queryDateEnd: nowTime.end,
},
sumCommissionAmount:'0.00',
cffpFortuneDateList:[],
sumCommissionAmount: '0.00',
cffpFortuneDateList: [],
userInfo: {},
showWithdrawal:true
}
},
components:{CustomDatePop},
onLoad(){
components: { CustomDatePop },
onLoad() {
this.userInfo = JSON.parse(uni.getStorageSync('cffp_userInfo'))
// 经销商职级p3之上的都不给提现
if(this.userInfo.levelCode&&this.userInfo.levelCode.split('')[1]>3){
this.showWithdrawal = false
}
console.log('levelCode',this.userInfo.levelCode);
},
onShow(){
onShow() {
this.queryByUserIdFortuneStatistic();
this.getCommissionType()
this.getDetail()
// #ifdef H5
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
initJssdkShare(() => {
setWechatShare();
}, window.location.href);
// #endif
},
methods:{
methods: {
// 查看订单详情
viewDetail(item){
viewDetail(item) {
dataHandling.pocessTracking(
'查看订单详情',
`点击查看订单详情`,
'点击',
2,
'佣金',
'pages/pointsExchange/pointsExchange'
'查看订单详情',
`点击查看订单详情`,
'点击',
2,
'佣金',
'pages/pointsExchange/pointsExchange'
)
uni.navigateTo({
url:`/pages/orderDetail/orderDetail?id=${item.orderId}&commissionType=${item.commissionType}&type=drop`
url: `/pages/orderDetail/orderDetail?id=${item.orderId}&commissionType=${item.commissionType}&type=drop`
})
},
getDetail(){
const param = {
isDtl: 1,
userId: uni.getStorageSync('cffp_userId'),
queryDateStart:this.childData.queryDateStart,
queryDateEnd:this.childData.queryDateEnd,
commissionType:this.currentFilter.dropOptionCode,
queryPage:2,
exchangeStatus:this.selectItem=='0'?'':this.selectItem,
productType: 1
}
api.findForExchangeStatisticDtl(param).then((res)=>{
if(res['success']){
getDetail() {
const param = {
isDtl: 1,
userId: uni.getStorageSync('cffp_userId'),
queryDateStart: this.childData.queryDateStart,
queryDateEnd: this.childData.queryDateEnd,
commissionType: this.currentFilter.dropOptionCode,
queryPage: 2,
exchangeStatus: this.selectItem == '0' ? '' : this.selectItem,
productType: 1
}
api.findForExchangeStatisticDtl(param).then((res) => {
if (res['success']) {
this.cffpFortuneDateList = []
if(res['data']['cffpFortuneDeductionList']&&res['data']['cffpFortuneDeductionList'].length>0){
this.cffpFortuneDateList = res['data']['cffpFortuneDeductionList'].map(item=>{
if (res['data']['cffpFortuneDeductionList'] && res['data']['cffpFortuneDeductionList']
.length > 0) {
this.cffpFortuneDateList = res['data']['cffpFortuneDeductionList'].map(item => {
item.commissionAmount = Number(item.commissionAmount).toFixed(2)
return item
})
}
if(res['data']['sumCommissionAmount']){
if (res['data']['sumCommissionAmount']) {
this.sumCommissionAmount = Number(res['data']['sumCommissionAmount']).toFixed(2);
}else {
this.sumCommissionAmount= '0.00'
} else {
this.sumCommissionAmount = '0.00'
}
}
});
},
getCommissionType(){
api.dropOptionsQuery({code:'CFFP_Commission_Item'}).then((res)=>{
this.commissionTypeList = [{dropOptionName:'全部',dropOptionCode:null,id:'0'}].concat(res['data']['dropMasterInfoList'][0]['dropOptionsInfoList']);
getCommissionType() {
api.dropOptionsQuery({ code: 'CFFP_Commission_Item' }).then((res) => {
this.commissionTypeList = [{ dropOptionName: '全部', dropOptionCode: null, id: '0' }].concat(res[
'data']['dropMasterInfoList'][0]['dropOptionsInfoList']);
// for(let i=0;i<this.commissionTypeList.length;i++){
// if(this.commissionType == this.commissionTypeList[i]['dropOptionCode']){
// this.commissionTypeIdx = i;
......@@ -250,16 +248,16 @@
// }
})
},
closePop(){
closePop() {
this.$refs.timePopup.close()
},
//时间选择框确定事件
comfirm(obj){
console.log('obj',obj);
comfirm(obj) {
console.log('obj', obj);
this.currentItem = obj.current
// timeType 8:月份 9:三种方式的选择 10:自定义日期选择
switch (obj.timeType){
switch (obj.timeType) {
case '8':
this.showTime = `${obj.year}${obj.month}月`
const { year, month } = obj;
......@@ -280,30 +278,30 @@
default:
break;
}
this.childData = obj
this.$refs.timePopup.close()
this.getDetail()
},
// 切换过滤条件
changeFilter(item){
changeFilter(item) {
this.currentFilter = item
this.getDetail()
},
maskClick(e){
maskClick(e) {
console.log('maskClick事件:', e);
},
goBack(){
goBack() {
uni.navigateBack({
delta: 1
delta: 1
});
},
queryByUserIdFortuneStatistic(){
api.queryByUserIdFortuneStatistic({userId:uni.getStorageSync('cffp_userId')}).then((res)=>{
if(res['success']){
queryByUserIdFortuneStatistic() {
api.queryByUserIdFortuneStatistic({ userId: uni.getStorageSync('cffp_userId') }).then((res) => {
if (res['success']) {
// //可兑换
this.yesExchangeFortune = res['data']['yesExchangeFortune'] || '0.00';
//总积分
this.scoreList[0].value = res['data']['totalFortune'] || '0.00';
//兑换中
......@@ -312,36 +310,37 @@
this.scoreList[2].value = res['data']['notExchangeFortune'] || '0.00';
//兑换中
this.scoreList[3].value = res['data']['inExchangeFortune'] || '0.00';
}
})
},
toWithdrawal(){
if(!this.yesExchangeFortune || this.yesExchangeFortune==0){
toWithdrawal() {
if (!this.yesExchangeFortune || this.yesExchangeFortune == 0) {
uni.showModal({
content: `目前可兑换积分为${this.yesExchangeFortune},积分低于1分时无法兑换`,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
content: `目前可兑换积分为${this.yesExchangeFortune},积分低于1分时无法兑换`,
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
}
});
}else{
} else {
// uni.navigateTo({
// url:`/pages/withdrawal/withdrawal?exchangeAmount=${this.yesExchangeFortune}`
// })
dataHandling.pocessTracking(
'提现',
`点击提现按钮`,
'点击',
2,
'佣金',
'pages/pointsExchange/pointsExchange'
'提现',
`点击提现按钮`,
'点击',
2,
'佣金',
'pages/pointsExchange/pointsExchange'
)
uni.navigateTo({
url:`/myPackageA/integralExchange/exchange`
url: `/myPackageA/integralExchange/exchange`
})
}
},
......@@ -350,15 +349,15 @@
// url:'/pages/exchangeRecord/exchangeRecord'
// })
// },
viewDropLists(){
viewDropLists() {
uni.navigateTo({
url:'/pages/dropLists/dropLists'
url: '/pages/dropLists/dropLists'
})
},
gotoRecord(id){
if(id=='2'){
gotoRecord(id) {
if (id == '2') {
uni.navigateTo({
url:'/myPackageA/commission/withdrawalRecord'
url: '/myPackageA/commission/withdrawalRecord'
})
}
}
......@@ -368,38 +367,44 @@
<style lang="scss" scoped>
::v-deep .uni-tooltip-popup {
white-space: normal !important;
word-break: break-word !important;
// max-width: 200rpx !important; /* 设置一个合适的最大宽度 */
white-space: normal !important;
word-break: break-word !important;
// max-width: 200rpx !important; /* 设置一个合适的最大宽度 */
width: 420rpx !important;
font-size: 26rpx;
transform: none !important;
// left: -200% !important;
}
::v-deep .uni-popup .uni-popup__wrapper{
margin: 0 !important;
}
::v-deep .uni-select__input-text{
font-size: 24rpx !important;
}
::v-deep .uni-select__selector-item{
font-size: 22rpx !important;
}
::v-deep .uni-select__input-box{
height: 50rpx;
box-sizing: border-box;
padding:10rpx 15rpx !important;
display: flex;
align-items: center;
}
.container{
}
::v-deep .uni-popup .uni-popup__wrapper {
margin: 0 !important;
}
::v-deep .uni-select__input-text {
font-size: 24rpx !important;
}
::v-deep .uni-select__selector-item {
font-size: 22rpx !important;
}
::v-deep .uni-select__input-box {
height: 50rpx;
box-sizing: border-box;
padding: 10rpx 15rpx !important;
display: flex;
align-items: center;
}
.container {
box-sizing: border-box;
/* #ifdef H5 */
padding-top: 15rpx;
/* #endif */
padding-bottom: 20rpx;
.backArrow{
.backArrow {
background-color: #fff;
box-sizing: border-box;
display: flex;
......@@ -409,34 +414,40 @@
position: relative;
width: 100%;
margin-bottom: 10rpx;
text:nth-child(2){
text:nth-child(2) {
width: 100%;
text-align: center;
position: absolute;
}
}
.listBox{
.listBox {
padding: 10rpx 20rpx 0rpx 20rpx;
}
.first{
.first {
color: rgba(244, 239, 212, 1);
box-sizing: border-box;
background: #2a2927;
width: 100%;
padding: 30rpx;
border-radius: 10rpx;
.top{
.top {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
.left{
.left {
font-size: 28rpx;
width: 60%;
}
.right{
.right {
padding: 15rpx 50rpx;
background: rgba(249, 219, 165, 1);
border-radius: 50rpx;
......@@ -445,27 +456,31 @@
font-weight: 500;
}
}
.bottom{
.bottom {
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
.bottomItem{
.one{
.bottomItem {
.one {
display: flex;
margin-bottom: 5rpx;
align-items: center;
justify-content: center;
}
.fotter{
.fotter {
font-size: 26rpx;
}
}
}
}
.two{
.two {
margin-top: 20rpx;
box-sizing: border-box;
background: #fff;
......@@ -473,12 +488,14 @@
padding: 20rpx 30rpx;
border-radius: 10rpx;
box-sizing: border-box;
.twoHeader{
.twoHeader {
color: rgba(46, 38, 29, 1);
font-size: 32rpx;
font-weight: 500;
}
.timeBox{
.timeBox {
display: flex;
align-items: center;
width: fit-content;
......@@ -486,100 +503,118 @@
margin: 40rpx 0;
font-size: 27rpx;
}
.filterBox{
.filterBox {
display: flex;
align-items: center;
justify-content: space-between;
.scroll-view_H {
white-space: nowrap;
width: 100%;
box-sizing: border-box;
}
.scroll-view-item {
height: 100rpx;
// line-height: 300rpx;
text-align: center;
font-size: 36rpx;
}
.scroll-view-item_H {
display: inline-block;
margin-right: 20rpx;
text-align: center;
background: #f7f7f7;
font-size: 27rpx;
padding: 10rpx 20rpx;
color: rgba(46, 38, 29, 1);
border-radius: 8rpx;
margin-bottom: 20rpx;
&.active{
background: rgba(32, 39, 155, 1);
color: #fff;
}
}
.scroll-view-item_H:last-child{
margin-right: 0rpx;
white-space: nowrap;
width: 100%;
box-sizing: border-box;
}
.scroll-view-item {
height: 100rpx;
// line-height: 300rpx;
text-align: center;
font-size: 36rpx;
}
.scroll-view-item_H {
display: inline-block;
margin-right: 20rpx;
text-align: center;
background: #f7f7f7;
font-size: 27rpx;
padding: 10rpx 20rpx;
color: rgba(46, 38, 29, 1);
border-radius: 8rpx;
margin-bottom: 20rpx;
&.active {
background: rgba(32, 39, 155, 1);
color: #fff;
}
.filterItem{
}
.scroll-view-item_H:last-child {
margin-right: 0rpx;
}
.filterItem {
background: #f7f7f7;
font-size: 27rpx;
padding: 10rpx;
color: rgba(46, 38, 29, 1);
border-radius: 8rpx;
&.active{
&.active {
background: rgba(32, 39, 155, 1);
color: #fff;
}
}
}
.totalBox{
.totalBox {
display: flex;
align-items: center;
justify-content: space-between;
margin: 30rpx 0;
.totalItem{
.totalItem {
font-size: 31rpx;
font-weight: 500;
}
.totalSelect{
.totalSelect {
width: 300rpx;
}
}
.detailBox{
.detailBox {
background-color: #fcfcfc;
padding: 0rpx 30rpx;
border-radius: 10rpx;
.emptyBox{
.emptyBox {
display: flex;
align-items: center;
justify-content: center;
margin: 20rpx;
color: rgba(153, 153, 153, 1);
}
.detailItem{
.detailItem {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid rgba(232, 232, 232, 1);
padding: 30rpx 0;
.detailLeft{
.txt{
.detailLeft {
.txt {
font-size: 29rpx;
font-weight: 500;
color: rgba(34, 34, 34, 1);
}
.date{
.date {
color: rgba(56, 56, 56, 1);
font-size: 26rpx;
margin-top: 10rpx;
}
}
.detailRight{
.detailRight {
width: 25%;
display: flex;
justify-content: space-between;
align-items: center;
.money{
.money {
font-size: 29rpx;
font-weight: 500;
color: rgba(34, 34, 34, 1);
......@@ -587,11 +622,12 @@
}
}
}
.detailItem:last-child{
.detailItem:last-child {
border: none;
}
}
}
}
</style>
\ No newline at end of file
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).uni=n()}(this,(function(){"use strict";try{var e={};Object.defineProperty(e,"passive",{get:function(){!0}}),window.addEventListener("test-passive",null,e)}catch(e){}var n=Object.prototype.hasOwnProperty;function i(e,i){return n.call(e,i)}var t=[];function r(){return window.__dcloud_weex_postMessage||window.__dcloud_weex_}var o=function(e,n){var i={options:{timestamp:+new Date},name:e,arg:n};if(r()){if("postMessage"===e){var o={data:[n]};return window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessage(o):window.__dcloud_weex_.postMessage(JSON.stringify(o))}var a={type:"WEB_INVOKE_APPSERVICE",args:{data:i,webviewIds:t}};window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessageToService(a):window.__dcloud_weex_.postMessageToService(JSON.stringify(a))}if(!window.plus)return window.parent.postMessage({type:"WEB_INVOKE_APPSERVICE",data:i,pageId:""},"*");if(0===t.length){var d=plus.webview.currentWebview();if(!d)throw new Error("plus.webview.currentWebview() is undefined");var s=d.parent(),w="";w=s?s.id:d.id,t.push(w)}if(plus.webview.getWebviewById("__uniapp__service"))plus.webview.postMessageToUniNView({type:"WEB_INVOKE_APPSERVICE",args:{data:i,webviewIds:t}},"__uniapp__service");else{var u=JSON.stringify(i);plus.webview.getLaunchWebview().evalJS('UniPlusBridge.subscribeHandler("'.concat("WEB_INVOKE_APPSERVICE",'",').concat(u,",").concat(JSON.stringify(t),");"))}},a={navigateTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;o("navigateTo",{url:encodeURI(n)})},navigateBack:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.delta;o("navigateBack",{delta:parseInt(n)||1})},switchTab:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;o("switchTab",{url:encodeURI(n)})},reLaunch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;o("reLaunch",{url:encodeURI(n)})},redirectTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;o("redirectTo",{url:encodeURI(n)})},getEnv:function(e){r()?e({nvue:!0}):window.plus?e({plus:!0}):e({h5:!0})},postMessage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o("postMessage",e.data||{})}},d=/uni-app/i.test(navigator.userAgent),s=/Html5Plus/i.test(navigator.userAgent),w=/complete|loaded|interactive/;var u=window.my&&navigator.userAgent.indexOf(["t","n","e","i","l","C","y","a","p","i","l","A"].reverse().join(""))>-1;var g=window.swan&&window.swan.webView&&/swan/i.test(navigator.userAgent);var v=window.qq&&window.qq.miniProgram&&/QQ/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var c=window.tt&&window.tt.miniProgram&&/toutiaomicroapp/i.test(navigator.userAgent);var m=window.wx&&window.wx.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var p=window.qa&&/quickapp/i.test(navigator.userAgent);var f=window.ks&&window.ks.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var l=window.tt&&window.tt.miniProgram&&/Lark|Feishu/i.test(navigator.userAgent);var _=window.jd&&window.jd.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var E=window.xhs&&window.xhs.miniProgram&&/xhsminiapp/i.test(navigator.userAgent);for(var h,P=function(){window.UniAppJSBridge=!0,document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady",{bubbles:!0,cancelable:!0}))},b=[function(e){if(d||s)return window.__dcloud_weex_postMessage||window.__dcloud_weex_?document.addEventListener("DOMContentLoaded",e):window.plus&&w.test(document.readyState)?setTimeout(e,0):document.addEventListener("plusready",e),a},function(e){if(m)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.wx.miniProgram},function(e){if(v)return window.QQJSBridge&&window.QQJSBridge.invoke?setTimeout(e,0):document.addEventListener("QQJSBridgeReady",e),window.qq.miniProgram},function(e){if(u){document.addEventListener("DOMContentLoaded",e);var n=window.my;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(g)return document.addEventListener("DOMContentLoaded",e),window.swan.webView},function(e){if(c)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(p){window.QaJSBridge&&window.QaJSBridge.invoke?setTimeout(e,0):document.addEventListener("QaJSBridgeReady",e);var n=window.qa;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(f)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.ks.miniProgram},function(e){if(l)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(_)return window.JDJSBridgeReady&&window.JDJSBridgeReady.invoke?setTimeout(e,0):document.addEventListener("JDJSBridgeReady",e),window.jd.miniProgram},function(e){if(E)return window.xhs.miniProgram},function(e){return document.addEventListener("DOMContentLoaded",e),a}],y=0;y<b.length&&!(h=b[y](P));y++);h||(h={});var B="undefined"!=typeof uni?uni:{};if(!B.navigateTo)for(var S in h)i(h,S)&&(B[S]=h[S]);return B.webView=h,B}));
......@@ -23,10 +23,8 @@ export default [
"Q": "合伙人晋升条件",
"A": [
"见习合伙人:完成加盟申请",
"新锐合伙人:个人标准销售额≥799元",
"资深合伙人:个人标准销售额≥799元 + 团队有效人数≥5人 + 团队标准销售额≥5万元",
"精英合伙人:个人标准销售额≥799元 + 团队有效人数≥10人 + 团队标准销售额≥15万元",
"营业部部长:个人标准销售额≥799元 + 团队有效人数≥20人 + 团队标准销售额≥50万元"
"新锐合伙人:个人标准销售额≥198元",
"资深合伙人:个人标准销售额≥198元 + 团队有效人数≥5人 + 团队标准销售额≥5万元",
],
"isActive": 1,
"isMore": true
......@@ -70,8 +68,6 @@ export default [
"A": [
"见习合伙人:自购或分享产品,他人购买后可获得销售收入",
"更高级别合伙人:可额外获得团队订单的一级/二级管理津贴",
"营业部部长:可享受部长津贴",
"育成营业部部长:可享受育成津贴",
"(以上收益可叠加)"
],
"isActive": 1,
......
......@@ -118,7 +118,26 @@ export default function initApp(){
// tabbar页面跳转前进行拦截
invoke(e) {
if(uni.getStorageSync('cffp_userId')){
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
// if(!res['success']){
// uni.setStorageSync('loginType','visitor')
// uni.navigateTo({
// url: '/myPackageA/login/login'
// })
// return true
// }
// 保存用户得个人信息
if (res['success']) {
delete res.data.commonResult
const cffp_userInfo = {
...res.data
}
uni.setStorageSync('cffp_userInfo', JSON.stringify(cffp_userInfo))
}
})
}
if (date) {
//如果时间戳存在 那么记录此页面的停留时间
dataHandling.pocessTracking(
......
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