Files
video_mini/pagesA/servers/servesQR.vue
T
2025-08-25 11:20:35 +08:00

160 lines
4.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="bgc-body" style="width: 750rpx;
height: 100vh;
background-image: url('https://wx.yaohe.hnjrdzkj.xyz/static/wechat/static/kefbgc.png');
background-size: 750rpx 100vh;
padding: 47rpx;">
<view>
<view style="width: 656rpx; display: flex;">
<view style="display: flex;
align-items: center;
margin: 0 auto;">
<image :src="touxing"
style="width: 136rpx;height: 136rpx;border-radius: 50%;border: 3rpx solid #FFFFFF;margin-right: 24rpx;">
</image>
<view>
<view style="font-size: 46rpx;color: #fff;font-weight: 600;">
扫码添加客服微信
</view>
<view style="font-size: 30rpx;color: #fff;margin-top: 15rpx;">
有问题请联系客服
</view>
</view>
</view>
</view>
</view>
<view style="margin-top: 40rpx;">
<!-- <image src="https://wx.yaohe.hnjrdzkj.xyz/static/wechat/static/erweim.png" style="width: 656rpx;height: 760rpx;"></image> -->
<view
style="background-image: url('https://wx.yaohe.hnjrdzkj.xyz/static/wechat/static/erweim.png');background-size: 656rpx 760rpx;width: 656rpx;height: 760rpx;">
<image :src="erweim" style="width: 372rpx;height: 372rpx;margin-left: 142rpx;margin-top: 100rpx;">
</image>
</view>
<view style="position: relative;">
<!-- <image src="https://wx.yaohe.hnjrdzkj.xyz/static/wechat/static/ann.png" style=""></image> -->
<view style="
background-image: url('https://wx.yaohe.hnjrdzkj.xyz/static/wechat/static/ann.png');
background-size: 374rpx 142rpx;
width: 374rpx;
height: 142rpx;
color: #fff;
font-size: 34rpx;
text-align: center;
line-height: 102rpx;
position: absolute;
top: -170rpx;
left: 127rpx;" @click="saveImg">保存二维码
</view>
</view>
</view>
<view style="color: #fff;font-size: 28rpx;padding-left: 136rpx;margin-top: 15rpx;">
1.保存上方二维码添加客服微信
</view>
<view style="color: #fff;font-size: 28rpx;padding-left: 136rpx;">
2.添加客服微信咨询问题
</view>
<view style="color: #fff;font-size: 28rpx;padding-left: 136rpx;">
3.工作时间:9:00-18:00
</view>
</view>
</template>
<script>
export default {
data() {
return {
touxing: '',
erweim: ''
}
},
mounted() {
this.ermadata()
},
methods: {
ermadata() {
this.$httpRequest({
url:'/api/user/serviceInfo',
method:"GET",
data: {},
}).then(res=>{
this.touxing = res.data.avatar
this.erweim = res.data.qr
})
},
saveImg() {
let that = this;
// 向用户发起授权请求
uni.authorize({
scope: 'scope.writePhotosAlbum',
success: () => {
// 已授权
that.downLoadImg();
},
fail: () => {
// 拒绝授权,获取当前设置
uni.getSetting({
success: (result) => {
if (!result.authSetting['scope.writePhotosAlbum']) {
that.isAuth()
}
}
});
}
})
},
downLoadImg() {
//下载图片资源至本地,返回文件的本地临时路径
uni.showLoading()
uni.downloadFile({
url: this.erweim,
success: (res) => {
uni.hideLoading()
if (res.statusCode === 200) {
//保存图片至相册
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function () {
uni.showToast({
title: "保存成功",
icon: "none"
});
},
fail: function () {
uni.hideLoading()
uni.showToast({
title: "保存失败,请稍后重试",
icon: "none"
});
}
});
}
}
})
},
//引导用户开启权限
isAuth() {
uni.showModal({
content: '由于您还没有允许保存图片到您相册里,无法进行保存,请点击确定允许授权',
success: (res) => {
if (res.confirm) {
uni.openSetting({
success: (result) => {
console.log(result.authSetting);
}
});
}
}
});
},
houtui() {
uni.navigateBack({ //返回上一个页面
delta: 1
});
}
}
}
</script>
<style>
</style>