|
@@ -1,45 +1,56 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
-
|
|
|
- </div>
|
|
|
+ <div class="cmain">
|
|
|
+ <div class="ewm">
|
|
|
+ <div id="qrcode"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import QRCode from 'qrcodejs2';
|
|
|
export default {
|
|
|
- props: {
|
|
|
- item: {
|
|
|
- type: Object,
|
|
|
- default: {}
|
|
|
- },
|
|
|
- fixed_number: {
|
|
|
- type: Array,
|
|
|
- default: () => [6, 4.5]
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- open: false,
|
|
|
- visible: false, //是否显示cropper
|
|
|
- };
|
|
|
- },
|
|
|
- methods: {
|
|
|
- editCropper(data) {
|
|
|
- this.open = true;
|
|
|
- this.visible = true;
|
|
|
- this.options.img = data;
|
|
|
- },
|
|
|
- // 向左旋转
|
|
|
- rotateLeft() {
|
|
|
- this.$refs.cropper.rotateLeft();
|
|
|
- },
|
|
|
- // 向右旋转
|
|
|
- rotateRight() {
|
|
|
- this.$refs.cropper.rotateRight();
|
|
|
- },
|
|
|
- }
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ company: {}
|
|
|
+ };
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ param: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
+ },
|
|
|
+ layerid: {
|
|
|
+ type: String
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.ajax({ url: '/work/company/index' }).then((response) => {
|
|
|
+ this.company = response.data;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.qrCode();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ qrCode() {
|
|
|
+ document.getElementById('qrcode').innerHTML = '';
|
|
|
+ new QRCode('qrcode', {
|
|
|
+ width: 250,
|
|
|
+ height: 250,
|
|
|
+ text: '' + this.company.id
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
-
|
|
|
+.ewm {
|
|
|
+ text-align: center;
|
|
|
+ padding-top: 15px;
|
|
|
+ img {
|
|
|
+ margin: 0 auto;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|