yjwarnqr.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="container">
  3. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  4. @clickLeft="toBack">
  5. <view class="nav-title">
  6. <text>{{title}}</text>
  7. </view>
  8. </uni-nav-bar>
  9. <view class="page-body">
  10. <uni-card :title="warnName">
  11. <image style="width: 100%;" :src="toQr" mode="widthFix"></image>
  12. </uni-card>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import http from '@/http/api.js';
  18. import {
  19. oss
  20. } from '@/common/setting';
  21. export default {
  22. components: {
  23. },
  24. data() {
  25. return {
  26. title: '预警响应二维码',
  27. warnName: '',
  28. warnId: '',
  29. baseOSS: '',
  30. qrImageUrl: '',
  31. }
  32. },
  33. computed: {
  34. toQr() {
  35. if (this.qrImageUrl != undefined && this.qrImageUrl.length > 0) {
  36. let url = this.baseOSS + this.qrImageUrl;
  37. return url;
  38. } else {
  39. return '';
  40. }
  41. },
  42. },
  43. onLoad(options) {
  44. this.baseOSS = oss;
  45. this.warnId = options.id;
  46. let that = this;
  47. let postData = {};
  48. postData['id'] = this.warnId;
  49. http.request({
  50. url: '/galaxy-business/yj/warn/detail',
  51. method: 'GET',
  52. data: postData
  53. }).then(res => {
  54. if (res.data != null) {
  55. that.qrImageUrl = res.data.warnQrUrl;
  56. that.warnName = res.data.warnName;
  57. }
  58. }).catch(err => {
  59. console.log(err)
  60. })
  61. },
  62. onShow() {
  63. },
  64. methods: {
  65. toOss(path) {
  66. let url = this.baseOSS + path;
  67. return url;
  68. },
  69. toBack() {
  70. uni.navigateBack({
  71. delta: 1
  72. })
  73. },
  74. }
  75. }
  76. </script>
  77. <style>
  78. </style>