xc-app/pages/mine/customer.vue

63 lines
1.5 KiB
Vue

<template>
<view class="dlg">
<HeaderCom></HeaderCom>
<!-- @longpress="saveImageToLocal" -->
<image :src="imageSrc" mode="aspectFit" style="height: 800rpx;"></image>
<!-- <web-view src="https://work.weixin.qq.com/kfid/kfcdd500903e17d36af"></web-view> -->
</view>
</template>
<script>
import HeaderCom from '@/pages/components/header.vue'
export default{
data(){
return{
imageSrc:'/static/kf.png'
}
},
onLoad() {
// setTimeout(() => {
// uni.navigateBack()
// window.location.href = 'https://work.weixin.qq.com/kfid/kfcdd500903e17d36af'
// setTimeout(() => {
// },1000)
// },500)
},
components:{HeaderCom},
methods:{
saveImageToLocal() {
const image = new Image();
image.src = this.imageSrc;
image.onload = () => {
const canvas = document.createElement('canvas');
canvas.width = image.width;
canvas.height = image.height;
const ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);
const link = document.createElement('a');
link.href = canvas.toDataURL();
link.download = '客服.jpg'; // 指定下载文件名
link.click();
// this.$api.msg("保存成功")
}
}
}
}
</script>
<style lang="scss">
.dlg {
width: 100%;
height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
top: 0;
left: 0;
z-index: 888;
display: flex;
align-items: center;
justify-content: center;
}
</style>