<template>
<div class="container">
<div class="white-box">
<div class="erweima">
<img :src="user_qrcode" alt="" @touchstart="start">
<p>商家收款码</p>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'payCode',
data(){
return{
longClick: 0,
timeOutEvent: 0,
user_qrcode: ""
}
},
created:function(){
},
methods:{
start() {
var that = this;
this.longClick = 0;
this.timeOutEvent = setTimeout(function() {
that.longClick = 1;
that.downImg()
}, 500);
},
downImg(){
let _this = this;
if(!window.plus) return;
plus.gallery.save(_this.user_qrcode, function () {
_this.$public.msg('保存成功!'); //_this.user_qrcode 是服务器链接,必须是图片格式
},function(){
_this.$public.msg('保存失败,请重试!');
});
},
}
}
</script>
vue webapp 长按保存图片到相册
最新推荐文章于 2024-07-20 11:00:22 发布