需求: vue实现pdf文件发送到邮箱功能 <!-- 弹窗 --> <van-popup v-model="showEmail" closeab
需求: vue实现pdf文件发送到邮箱功能
<!-- 弹窗 -->
<van-popup v-model="showEmail" closeable class="contactTel" :close-on-click-overlay="false" @close="closeEmail">
<div class="popup-header fontSize36">
发送至邮箱
</div>
<div class="popup-box fontSize36 color3">
<div class="fieldInput mb50">
<!-- <van-field v-model="electricalMail" name="email" ref="email" @click-input="handleClickInput" label="电子邮箱" placeholder="请输入您的电子邮箱"/> -->
<span class="pr20 pl20 fontSize30">电子邮箱</span>
<input label="电子邮箱" class="infoCenterText fontSize30" v-model="electricalMail" placeholder="请输入您的电子邮箱"/>
</div>
<van-button type="primary" color="#024EE0" class="popup-btn" @click="handleMsg">确认</van-button>
</div>
</van-popup>
点击发送到邮箱方法:
handleMsg(){
if(!this.electricalMail){
this.$toast("邮箱不能为空");
return;
}else{
let emailRegExp=/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
if(emailRegExp.test(this.electricalMail)) {
let params = {
url:this.historyObj.taxUrl,
electricalMail:this.electricalMail
}
sendEmail(params).then(res=>{
if(res.code == 200){
this.$toast("已发至邮箱,请查看");
this.showEmail = false;
}else{
this.$toast(res.msg);
}
})
}else{
this.$toast("邮箱格式不正确");
return;
}
}
}
到此这篇关于Vue实现pdf文件发送到邮箱功能的文章就介绍到这了,更多相关vue文件发送到邮箱内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!
--结束END--
本文标题: vue实现pdf文件发送到邮箱功能的示例代码
本文链接: https://www.lsjlt.com/news/148469.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-01-12
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0