Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
X
xzf_uniapp-wechat-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李智书
xzf_uniapp-wechat-web
Commits
8c9a5063
Commit
8c9a5063
authored
Jan 11, 2022
by
李智书
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.新增pdf预览;
parent
ede6adf2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
13 deletions
+122
-13
src/pages.json
src/pages.json
+10
-0
src/pages/UserAgreement/UserAgreement.vue
src/pages/UserAgreement/UserAgreement.vue
+60
-0
src/pages/pdfPreview/pdfPreview.vue
src/pages/pdfPreview/pdfPreview.vue
+52
-13
No files found.
src/pages.json
View file @
8c9a5063
...
@@ -312,6 +312,16 @@
...
@@ -312,6 +312,16 @@
}
}
}
}
,{
"path"
:
"pages/UserAgreement/UserAgreement"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"用户协议"
,
"enablePullDownRefresh"
:
false
}
}
],
],
"globalStyle"
:
{
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
"navigationBarTextStyle"
:
"black"
,
...
...
src/pages/UserAgreement/UserAgreement.vue
0 → 100644
View file @
8c9a5063
<
template
>
<view
class=
"UserAgreement"
>
<view
class=
"AgreementItem"
@
click=
"ToAgreement(1)"
>
<van-icon
name=
"question"
/>
《服务协议》
</view>
<view
class=
"AgreementItem"
@
click=
"ToAgreement(2)"
>
<van-icon
name=
"question"
/>
《隐私权政策》
</view>
<view
class=
"AgreementItem"
@
click=
"ToAgreement(3)"
>
<van-icon
name=
"question"
/>
《未成年人个人信息保护规则》
</view>
</view>
</
template
>
<
script
>
export
default
{
name
:
"
UserAgreement
"
,
data
()
{
return
{
externalInfo
:
{
seesionID
:
''
,
userID
:
''
,
AppID
:
''
}
}
},
onLoad
:
function
(
options
)
{
console
.
warn
(
options
);
this
.
externalInfo
=
options
},
methods
:
{
// 跳转协议
async
ToAgreement
(
type
)
{
try
{
uni
.
navigateTo
({
url
:
"
../pdfPreview/pdfPreview?pdfName=
"
+
this
.
externalInfo
.
AppID
+
'
_
'
+
type
})
}
catch
(
e
)
{
//TODO handle the exception
}
}
}
}
</
script
>
<
style
lang=
"scss"
>
.UserAgreement
{
margin-top
:
300rpx
;
margin-left
:
150rpx
;
.AgreementItem
{
font-family
:
PingFang
SC
;
font-size
:
35rpx
;
letter-spacing
:
1rpx
;
font-weight
:
600
;
color
:
#34C98E
;
line-height
:
100rpx
;
}
}
</
style
>
src/pages/pdfPreview/pdfPreview.vue
View file @
8c9a5063
...
@@ -9,22 +9,61 @@
...
@@ -9,22 +9,61 @@
name
:
'
App
'
,
name
:
'
App
'
,
data
()
{
data
()
{
return
{
return
{
pdfh5
:
null
pdfh5
:
null
,
pdfName
:
""
,
ImgUrl
:
this
.
$ImgUrl
};
};
},
},
mounted
()
{
onLoad
:
function
(
options
)
{
//实例化
console
.
warn
(
options
);
this
.
pdfh5
=
new
Pdfh5
(
"
#pdfh5
"
,
{
let
type
=
options
.
pdfName
.
split
(
"
_
"
)[
1
]
*
1
pdfurl
:
"
../../static/test.pdf
"
,
switch
(
type
)
{
scale
:
2
,
case
1
:
zoomEnable
:
true
,
uni
.
setNavigationBarTitle
({
renderType
:
'
svg
'
title
:
"
服务协议
"
})
break
;
case
2
:
uni
.
setNavigationBarTitle
({
title
:
"
隐私权政策
"
})
break
;
case
3
:
uni
.
setNavigationBarTitle
({
title
:
"
未成年人个人信息保护规则
"
})
break
;
default
:
break
;
}
this
.
pdfName
=
options
.
pdfName
this
.
Init
(
this
.
ImgUrl
+
'
AgreementPdf/
'
+
this
.
pdfName
)
},
mounted
()
{},
methods
:
{
// 跳转协议
async
Init
(
pdfName
)
{
let
this_
=
this
try
{
this
.
$nextTick
(
function
()
{
//实例化
this_
.
pdfh5
=
new
Pdfh5
(
"
#pdfh5
"
,
{
pdfurl
:
pdfName
+
'
.pdf
'
,
scale
:
2
,
zoomEnable
:
true
,
renderType
:
'
svg
'
});
});
//监听完成事件
//监听完成事件
this
.
pdfh5
.
on
(
"
complete
"
,
function
(
status
,
msg
,
time
)
{
this_
.
pdfh5
.
on
(
"
complete
"
,
function
(
status
,
msg
,
time
)
{
console
.
log
(
"
状态:
"
+
status
+
"
,信息:
"
+
msg
+
"
,耗时:
"
+
time
+
"
毫秒,总页数:
"
+
this
.
totalNum
)
console
.
log
(
"
状态:
"
+
status
+
"
,信息:
"
+
msg
+
"
,耗时:
"
+
time
+
"
毫秒,总页数:
"
+
})
this
.
totalNum
)
})
})
}
catch
(
e
)
{
//TODO handle the exception
}
}
}
}
}
}
</
script
>
</
script
>
...
...
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