index.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. // components/detailsCard/index.js
  2. import international from '../../international/appointment_scence/index'
  3. const app = getApp()
  4. Component({
  5. /**
  6. * 组件的属性列表
  7. */
  8. properties: {
  9. // 标题
  10. title: {
  11. type: String,
  12. value: '认证信息'
  13. },
  14. //单子状态
  15. status: {
  16. type: Number,
  17. value: null
  18. },
  19. //内容
  20. msg: {
  21. type: Array,
  22. value: []
  23. },
  24. // 语言
  25. language: {
  26. type: String,
  27. value: 'ch'
  28. },
  29. userInfo: {
  30. type: Object,
  31. value: {}
  32. },
  33. //单子信息
  34. regularList: {
  35. type: Object,
  36. value: {}
  37. },
  38. isRegular: {
  39. type: Boolean,
  40. value: true
  41. },
  42. type: {
  43. type: String,
  44. },
  45. clickPage: {
  46. type: String,
  47. },
  48. pageType: {
  49. type: String
  50. },
  51. //通用二维码
  52. qrCode1: {
  53. type: String
  54. },
  55. //梯控二维码
  56. qrCode2: {
  57. type: String
  58. },
  59. //时效类型 1-已失效 2-未到时间 3-正常
  60. qrCodeType: {
  61. type: Number
  62. }
  63. },
  64. /**
  65. * 组件的初始数据
  66. */
  67. data: {
  68. international: international, //国际化语言包
  69. imageUrl: '',
  70. qrCodeOne: null,
  71. qrCodeTwo: null,
  72. qrCodeShowType: null, //1已失效2未到时间3允许通行
  73. recordInfo: {}
  74. },
  75. /**
  76. * 组件的方法列表
  77. */
  78. methods: {
  79. preview(event) {
  80. let currentUrl = event.currentTarget.dataset.src
  81. wx.previewImage({
  82. current: currentUrl,
  83. urls: [currentUrl]
  84. })
  85. },
  86. },
  87. observers: {
  88. 'regularList': function (regularList) {
  89. if(!regularList) {
  90. return;
  91. }
  92. var {
  93. imageUrl
  94. } = this.data;
  95. switch (regularList.reviewStatus) {
  96. case 0:
  97. imageUrl = 'wait'
  98. break;
  99. case 1:
  100. imageUrl = 'reject'
  101. break;
  102. case 2:
  103. imageUrl = 'pass'
  104. break;
  105. case 3:
  106. imageUrl = 'entrance'
  107. break;
  108. default:
  109. break;
  110. };
  111. this.setData({
  112. imageUrl,
  113. recordInfo: regularList
  114. })
  115. },
  116. 'qrCodeType': function (qrCodeType) {
  117. this.setData({
  118. qrCodeShowType: qrCodeType
  119. })
  120. },
  121. 'qrCode1': function(qrCode1) {
  122. this.setData({
  123. qrCodeOne: qrCode1
  124. })
  125. },
  126. 'qrCode2': function(qrCode2) {
  127. this.setData({
  128. qrCodeTwo: qrCode2
  129. })
  130. }
  131. },
  132. lifetimes: {
  133. created: function (e) {
  134. // 在组件实例刚刚被创建时执行,该节点不能使用this.setData({}),
  135. },
  136. ready: function () {
  137. // 在组件实例进入页面节点树时执行,该节点可以开始使用this,setData({})
  138. },
  139. attached: function () {
  140. // 在组件实例进入页面节点树时执行,该节点可以开始使用
  141. },
  142. detached: function () {
  143. // 移除
  144. clearInterval(app.data.timer)
  145. }
  146. }
  147. })