my_share_qrcode.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="account">
  3. <image show-menu-by-longpress="true" mode="widthFix" :src="qrurl" ></image>
  4. <view class="accountText">
  5. 长按二维码,可保存图片,或直接分享。
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import { mapMutations, mapState } from 'vuex'
  11. export default {
  12. computed: {
  13. ...mapState('m_user', ['userinfo'])
  14. },
  15. data() {
  16. return {
  17. qrurl: ''
  18. };
  19. },
  20. created() {
  21. this.getOwnQRCodeUrl();
  22. },
  23. methods: {
  24. async getOwnQRCodeUrl() {
  25. const {
  26. data: result
  27. } = await uni.$http.get('/ucenter/mini-program-openid-uid/getOwnQRcodeUrl?uid='+ this.userinfo.uid)
  28. // console.log(result.data.QRurl)
  29. if (result.data.QRurl != undefined) {
  30. if (result.data.QRurl != "0") {
  31. this.qrurl = result.data.QRurl
  32. }
  33. }
  34. },
  35. }
  36. }
  37. </script>
  38. <style>
  39. page{
  40. height: 100%;
  41. /* background-color: #FFF; */
  42. }
  43. .account{
  44. /* background-color: #FFF2CC; */
  45. width: 100%;
  46. height: 100%;
  47. justify-content: center;
  48. text-align: center;
  49. /* margin-top: 40rpx; */
  50. padding-top: 40rpx;
  51. }
  52. .accountText{
  53. margin: 40rpx;
  54. color: gray;
  55. }
  56. </style>