Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
c9fc0671
Commit
c9fc0671
authored
Jan 16, 2026
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决文件在手机上不能直接打开的问题
parent
1e4cf0b9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
16 deletions
+29
-16
components/bootpage/bootpage.vue
+1
-0
components/login/login.vue
+1
-0
components/pdf-viewer/pdf-viewer.vue
+0
-0
components/unipopup/loginPopup.vue
+1
-0
environments/environment.ts
+1
-1
myPackageA/compare-result/compare-result.vue
+20
-10
pages/index/index.vue
+1
-2
pages/personalCenter/detail.vue
+4
-3
No files found.
components/bootpage/bootpage.vue
View file @
c9fc0671
...
...
@@ -149,6 +149,7 @@
uni
.
setStorageSync
(
'isLogin'
,
'1'
);
uni
.
setStorageSync
(
'loginType'
,
'codelogin'
);
uni
.
setStorageSync
(
'cffp_userId'
,
this
.
userId
);
console
.
log
(
'============'
,
uni
.
getStorageSync
(
'cffp_userId'
))
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'token'
]);
this
.
loginTypeSync
=
"codelogin"
;
this
.
queryInfo
()
...
...
components/login/login.vue
View file @
c9fc0671
...
...
@@ -182,6 +182,7 @@
this
.
userId
=
String
(
res
[
'data'
][
'userId'
]);
uni
.
setStorageSync
(
'isLogin'
,
'1'
);
uni
.
setStorageSync
(
'cffp_userId'
,
this
.
userId
);
console
.
log
(
'============'
,
uni
.
getStorageSync
(
'cffp_userId'
))
uni
.
setStorageSync
(
'loginType'
,
this
.
loginType
);
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'token'
]);
...
...
components/pdf-viewer/pdf-viewer.vue
View file @
c9fc0671
This diff is collapsed.
Click to expand it.
components/unipopup/loginPopup.vue
View file @
c9fc0671
...
...
@@ -107,6 +107,7 @@
uni
.
setStorageSync
(
'isLogin'
,
'1'
);
uni
.
setStorageSync
(
'loginType'
,
'codelogin'
);
uni
.
setStorageSync
(
'cffp_userId'
,
res
.
data
[
'userId'
]);
console
.
log
(
'============'
,
uni
.
getStorageSync
(
'cffp_userId'
))
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'token'
]);
//关闭弹窗
this
.
$refs
.
loginPopup
.
close
();
...
...
environments/environment.ts
View file @
c9fc0671
...
...
@@ -53,7 +53,7 @@ const config = {
stage
,
prod
}
let
env
=
'
prod
'
;
let
env
=
'
dev
'
;
let
baseURL
=
config
[
env
].
base_url
;
let
apiURL
=
config
[
env
].
api_url
;
...
...
myPackageA/compare-result/compare-result.vue
View file @
c9fc0671
...
...
@@ -98,6 +98,8 @@
</view>
<!-- 放在
</view>
最后,
</
template
>
之前 -->
<!-- PDF 查看弹窗 -->
<!-- 调试用 -->
<view
v-if=
"showPdfModal"
>
Debug URL: {{ currentPdfUrl }}
</view>
<uni-popup
ref=
"pdfPopupRef"
:mask-click=
"true"
...
...
@@ -111,14 +113,15 @@
</view>
<!-- PDF 查看器 -->
<view
class=
"pdf-viewer-wrapper"
v-if=
"showPdfModa
l"
>
<view
class=
"pdf-viewer-wrapper"
v-if=
"showPdfModal && currentPdfUr
l"
>
<PdfViewer
:pdfInfo=
"{ url: currentPdfUrl }"
:autoLoad=
"true"
:lazyLoad=
"tru
e"
:lazyLoad=
"fals
e"
:maxRetryCount=
"2"
:loadingStatus=
"true"
style=
"height: 100%; width: 100%;"
@
loadComplete=
"handlePdfLoadComplete"
@
loadError=
"handlePdfLoadError"
@
pageChange=
"handlePageChange"
/>
</view>
</view>
...
...
@@ -130,11 +133,10 @@ import { ref, computed, onMounted } from 'vue';
import
{
useRouter
,
useRoute
}
from
'vue-router'
;
import
common
from
'@/common/common'
;
import
api
from
'@/api/api'
;
import
{
onBeforeUnmount
}
from
'vue'
;
// 导入PDF查看器组件
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'
;
const
pdfPopupRef
=
ref
();
// 路由实例
const
router
=
useRouter
();
...
...
@@ -294,16 +296,21 @@ const navigateToPKPage = () => {
const
showPdfModal
=
ref
(
false
);
const
currentPdfUrl
=
ref
(
''
);
// 修改 getUrl 方法
const
getUrl
=
(
fileUrl
)
=>
{
if
(
!
fileUrl
)
{
uni
.
showToast
({
title
:
'暂无文档'
,
icon
:
'none'
});
return
;
}
uni
.
showLoading
({
title
:
'加载PDF中...'
});
// 所有平台统一处理:弹出 PdfViewer
uni
.
showLoading
({
title
:
'加载PDF中...'
});
currentPdfUrl
.
value
=
fileUrl
;
showPdfModal
.
value
=
true
;
console
.
log
(
'Opening PDF:'
,
fileUrl
);
// 延迟打开弹窗,确保数据已绑定
setTimeout
(()
=>
{
pdfPopupRef
.
value
?.
open
?.();
uni
.
hideLoading
();
},
100
);
};
// 关闭弹窗
...
...
@@ -587,6 +594,9 @@ onMounted(() => {
border-radius
:
50%
;
border
:
none
;
color
:
#999
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.pdf-viewer-wrapper
{
...
...
pages/index/index.vue
View file @
c9fc0671
...
...
@@ -764,10 +764,9 @@
}
api
.
loginVerification
(
params
).
then
((
res
)
=>
{
if
(
res
[
'success'
]){
uni
.
setStorageSync
(
'isLogin'
,
'1'
);
uni
.
setStorageSync
(
'loginType'
,
'codelogin'
);
uni
.
setStorageSync
(
'cffp_userId'
,
res
.
data
.
userId
);
uni
.
setStorageSync
(
'cffp_userId'
,
JSON
.
stringify
(
res
.
data
.
userId
)
);
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'token'
]);
this
.
userId
=
res
.
data
.
userId
this
.
querySystemMessage
()
...
...
pages/personalCenter/detail.vue
View file @
c9fc0671
...
...
@@ -130,7 +130,8 @@ const companyPdf = ref<PdfItem>({
// urls: Array.from({ length: 21 }, (_, i) =>
// `${OSS_BASE_URL}/public/company-intro_part${i + 1}.pdf`
// ),
urls
:
[
`
${
OSS_BASE_URL
}
/public/company-intro.pdf`
],
// urls: [`${OSS_BASE_URL}/public/company-intro.pdf`],
urls
:
[
`
${
OSS_BASE_URL
}
/wslucky/product/2025/06/24/31c164ac-565c-4990-a584-b5d4935840d0.pdf`
],
type
:
'showURL'
});
...
...
@@ -310,7 +311,7 @@ const switchTab = (index: number) => {
const
tabs
=
filteredCurrentTabs
.
value
;
if
(
index
<
0
||
index
>=
tabs
.
length
||
tabs
.
length
===
0
)
return
;
uni
.
showLoading
({
title
:
'切换中...'
})
;
loading
.
value
=
true
;
setTimeout
(()
=>
{
activeTab
.
value
=
index
;
...
...
@@ -318,7 +319,7 @@ const switchTab = (index: number) => {
uni
.
setStorageSync
(
'tabsIndex'
,
index
);
setTimeout
(()
=>
{
uni
.
hideLoading
()
;
loading
.
value
=
false
;
},
300
);
},
100
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment