goCode.vue 818 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="goCode">
  3. <view class="code">
  4. <image :src="code1" alt="" class="img" />
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import mineApi from '@/api/mine/index.js'
  10. export default {
  11. data() {
  12. return {
  13. primary:this.$theme.primary,
  14. settingFile:getApp().globalData.siteinfo,
  15. code1: ''
  16. };
  17. },
  18. onShow() {
  19. var that = this;
  20. mineApi.myqrcode({
  21. // #ifdef MP-WEIXIN
  22. apptype: 'weixin'
  23. // #endif
  24. // #ifdef H5
  25. apptype: 'h5'
  26. // #endif
  27. }).then(ret=>{
  28. if(ret.status == 200){
  29. that.code1 = ret.data.img
  30. }else{
  31. this.$u.toast(ret.msg)
  32. }
  33. })
  34. }
  35. }
  36. </script>
  37. <style lang="scss">
  38. page{
  39. width:100%;
  40. height: 100%;
  41. }
  42. .code {
  43. width: 100%;
  44. height: 100%;
  45. }
  46. .code .img {
  47. position: fixed;
  48. width: 100%;
  49. height: 100%;
  50. }
  51. </style>