identityVerify.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!--化学品扫码身份验证-->
  2. <template>
  3. <view class="identityVerify">
  4. <img v-if="pageType==1" src="@/pages/images/icon_kcxq_cg.png"/>
  5. <img v-if="pageType==2" src="@/pages/images/icon_kcxq_sb.png"/>
  6. <view class="tip">{{pageType==1?'身份验证成功':'身份验证失败'}}</view>
  7. </view>
  8. </template>
  9. <script>
  10. import {chemicalAioIdentityScanLogin} from '@/pages/api/index.js'
  11. export default {
  12. name: "identityVerify",
  13. props: {
  14. },
  15. data() {
  16. return {
  17. pageType:1,
  18. // 查询参数
  19. queryParams: {
  20. code:'',
  21. subId:'',
  22. userId:'',
  23. },
  24. }
  25. },
  26. onLoad(option) {
  27. this.$set(this.queryParams,'code',option.code);
  28. this.$set(this.queryParams,'subId',option.subId);
  29. this.$set(this.queryParams,'userId',uni.setStorageSync('userId'));
  30. this.chemicalAioIdentityScanLogin();
  31. },
  32. created() {
  33. },
  34. mounted() {
  35. },
  36. methods: {
  37. //身份验证
  38. async chemicalAioIdentityScanLogin(){
  39. let self = this;
  40. const {data} = await chemicalAioIdentityScanLogin(this.queryParams);
  41. if(data.code == 200){
  42. this.$set(this,'pageType',1)
  43. }else{
  44. this.$set(this,'pageType',2)
  45. }
  46. },
  47. },
  48. }
  49. </script>
  50. <style lang="stylus" scoped>
  51. .identityVerify {
  52. margin: 0;
  53. padding: 0;
  54. display: flex;
  55. flex-direction: column;
  56. justify-content: center;
  57. align-items: center;
  58. >img{
  59. width: 200rpx;
  60. height: 200rpx;
  61. margin: 339rpx 0 48rpx 0;
  62. }
  63. .tip{
  64. font-weight: 400;
  65. font-size: 30rpx;
  66. color: #3D3D3D;
  67. line-height: 60rpx;
  68. text-align: center;
  69. }
  70. }
  71. </style>