91 lines
2.2 KiB
Vue
91 lines
2.2 KiB
Vue
<template>
|
|
<tpx-page>
|
|
<view style="padding: 2rpx 30rpx;">
|
|
|
|
<view class="blcok-white" style="padding: 40rpx 0;">
|
|
<u-row justify="center">
|
|
<view>
|
|
<u-row>
|
|
<u-avatar size="120"></u-avatar>
|
|
<view class="pl-30">
|
|
<u-row>
|
|
<u-text :text="userInfo.empName" size="32" bold="true"></u-text>
|
|
<view class="ml-20 font-24 pos-rlt" style="padding: 8rpx 12rpx;">{{userInfo.ownerSiteName}}
|
|
<view class="pos-abt-all" style="z-index: 0;background: #999;opacity: 0.2;border-radius: 20rpx;"></view>
|
|
</view>
|
|
</u-row>
|
|
<view class="mt-20 font-24">{{userInfo.phonenumber}}</view>
|
|
</view>
|
|
</u-row>
|
|
<view class="mt-30">
|
|
<u-image height="600" width="600" radius="10" :src="qrCodeImgUrl"></u-image>
|
|
</view>
|
|
|
|
<view class="mt-40">
|
|
<u-row justify="between">
|
|
<view style="width: 200rpx;" @click="handleSave">
|
|
<u-button type="primary" custom-style="border-radius: 10rpx;">保存到本地</u-button>
|
|
</view>
|
|
<view style="width: 200rpx;" @click="handlePrint">
|
|
<u-button type="primary" plain="true" custom-style="border-radius: 10rpx;">打印</u-button>
|
|
</view>
|
|
</u-row>
|
|
</view>
|
|
</view>
|
|
</u-row>
|
|
</view>
|
|
</view>
|
|
<tpx-bluetooth-print ref="curPrint"></tpx-bluetooth-print>
|
|
</tpx-page>
|
|
</template>
|
|
<script>
|
|
import * as apiService from "@/common/api"
|
|
|
|
export default {
|
|
computed: {
|
|
userInfo() {
|
|
return this.$store.getters.userInfo
|
|
}
|
|
},
|
|
props: {
|
|
},
|
|
data() {
|
|
return {
|
|
qrCodeImgUrl: ''
|
|
}
|
|
},
|
|
onShareAppMessage() {
|
|
return {
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.initData()
|
|
},
|
|
methods: {
|
|
async initData(){
|
|
let res = await apiService.getStaffQRCodePng({ _loading: true })
|
|
this.qrCodeImgUrl = res?.data?.fileUrl
|
|
},
|
|
async handleSave(){
|
|
this.saveNetFile(this.qrCodeImgUrl)
|
|
},
|
|
handlePrint() {
|
|
this.$refs.curPrint.startPrint({
|
|
imageUrl: this.qrCodeImgUrl,
|
|
paperWidth: 480,
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import '@/common/uni-nvue.scss';
|
|
page{
|
|
height: 100% !important;
|
|
}
|
|
</style>
|
|
<style scoped lang="scss">
|
|
|
|
</style>
|