1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <view class="content">
- <view class="qrcode">
- <uqrcode ref="uqrcode"></uqrcode>
- <view class="qrcode-text">客户扫码</view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- };
- },
- onReady() {
- console.log(this.userInfo)
- this.$refs
- .uqrcode
- .make({
- size: 300,
- margin:50,
- text: JSON.stringify(this.userInfo.userName)
- })
- .then(res => {
- // 返回的res与uni.canvasToTempFilePath返回一致
- console.log(res)
- })
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- methods: {}
- }
- </script>
- <style lang="scss">
- .content{
- background: rgba(0, 0, 0, 0.4);
- height: 100vh;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .qrcode-text{
- text-align: center;
- position: relative;
- font-size: 24rpx;
- font-weight: 400;
- color: #878C9C;
- top: -60rpx;
- }
- // .qrcode{
- // position: absolute;
- // top: 0;
-
- // }
- </style>
|