index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="token-input">
  3. <view class="title">
  4. 请输入EID token
  5. </view>
  6. <view style="margin-bottom: 60rpx">
  7. <input @input="bindTokenInput" placeholder="请输入token" :value="token" />
  8. </view>
  9. <view>
  10. <button @click='onConfirm'>跳转到eID小程序</button>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import { startEid, initEid } from '../mp_ecard_sdk/main'
  16. export default {
  17. data() {
  18. return {
  19. token: '',
  20. }
  21. },
  22. onLaunch: function () {
  23. //初始化
  24. initEid();
  25. },
  26. methods: {
  27. bindTokenInput(e) {
  28. console.log('dd', e)
  29. this.token = e.detail.value;
  30. },
  31. onConfirm() {
  32. console.log('startEid', startEid)
  33. const param = {
  34. data: {
  35. token: this.token,
  36. },
  37. verifyDoneCallback(res) {
  38. console.log('收到核身完成的res', res);
  39. },
  40. };
  41. this.token && startEid(param);
  42. },
  43. }
  44. }
  45. </script>
  46. <style>
  47. .token-input {
  48. height: 100%;
  49. display: flex;
  50. flex-direction: column;
  51. align-items: center;
  52. /* justify-content: center; */
  53. }
  54. input {
  55. margin-bottom: 40rpx;
  56. border: 1px solid #ccc;
  57. width: 600rpx;
  58. height: 80rpx;
  59. }
  60. button {
  61. width: 622rpx !important;
  62. height: 96rpx !important;
  63. background-color: #198eea;
  64. color: #FFFFFF;
  65. border: 2rpx solid #DDDDDD;
  66. font-size: 32rpx;
  67. font-weight: normal !important;
  68. line-height: 96rpx !important;
  69. }
  70. </style>