| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <template>
- <view class="print-page">
- <image class="pic" :src="QRCode" mode="widthFix" :show-menu-by-longpress="true"></image>
- <view v-if="QRCode.length>0">
- <span style="display: flex; justify-content: center;">长按识别二维码</span>
- </view>
- </view>
- </template>
- <script>
- import {mapState} from 'vuex';
- import {checkBox} from '../components/p-checkbox.vue'
- export default {
- components: {
- checkBox
- },
- data () {
- return {
- qrCodeUrl: '/storeUserLoginApi/getTempWeiXinQRCode',
- QRCode: ''
- }
- },
- computed: {
- ...mapState(['storeInfo'])
- },
- methods: {
- loadData () {
- uni.showLoading({
- title: '加载中'
- });
- var dateStr = (new Date()).getTime();
- var sign = this.getSign('' + this.storeInfo.storeUserId + dateStr);
- this.requst({
- url: this.qrCodeUrl,
- data: {
- timestamp: dateStr,
- sign: sign,
- storeUserId: this.storeInfo.storeUserId
- },
- success: res => {
- if (res.data.rtnBean.rtnCode == 0) {
- this.QRCode = res.data.obj
- } else {
- this.$api.msg(res.data.rtnBean.rtnMsg);
- }
- uni.hideLoading();
- },
- fail: (e) => {
- console.log("接口调用失败:" + JSON.stringify(e));
- uni.hideLoading();
- },
- })
- }
- },
- onLoad () {
- this.loadData()
- }
- }
- </script>
- <style lang="scss" scoped>
- .print-page {
- width: 100vw;
- height: 100vh;
- background-color: #fff;
- }
- .pic {
- display: block;
- margin: 0 auto;
- }
- </style>
|