uniapp 怎么查看pdf文件

登录时,已阅读并同意

<view class="radioPact" style="text-align: center;">
	<view @tap.stop='checkedTap1'>
		<radio v-model="radioPact" :checked="radioPactChecked"/>
	</view>
<view>我已阅读并同意<span class="radioText" @click="userService">《用户服务协议》</span></view>
</view>
.radioPact view{
	display: inline-block;
	font-size: 28rpx;
	vertical-align: top;
	height: 80rpx;
}
.radioText{
	color: #50B44D;
}

radio{
	margin-left:0rpx ;
}
/* 未选中的 背景样式 */
radio .wx-radio-input{ 
    height: 25rpx; 
    width: 25rpx;
    border-radius: 50%;
    background: transparent;
 }
/* 选中后的 背景样式 */
radio .wx-radio-input.wx-radio-input-checked{
   border: none;
}
/* 选中后的 对勾样式 */
radio .wx-radio-input.wx-radio-input-checked::before{
   border-radius: 50%;
   width: 25rpx; 
   height:25rpx;
   line-height:25rpx;
   text-align: center;
   font-size:25rpx; 
   color:#fff;
}

点击radio取消和选择

checkedTap1(){
			this.radioPactChecked = !this.radioPactChecked
		},

点击pdf,并打开

//用户协议
		userService(){
			uni.downloadFile({
			    url:`${PDF_URL}/promiseletter/承诺书.pdf`,
			    success(res) {
			        let filepathss = res.tempFilePath;
			        uni.openDocument({
			            filePath: filepathss,
			            fileType: 'pdf',
			            success: function(res) {
							
			            },
			            fail: function(err) {
			                uni.showToast({
			                    title: '暂不支持此类型',
			                    duration: 2000,
			                    icon: 'none'
			                });
			            }
			        });
			    }
			});
			
		},

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值