Commit 49c469da by yuzhenWang

Merge branch 'dev' into 'master'

Dev

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