index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view class="nfc-container">
  3. <view class="nfc-container-image">
  4. <image class="nfc-gif" src="@/static/images/common/nfc-flash.gif" mode="aspectFit" style="width: 230px"></image>
  5. </view>
  6. <view class="nfc-container-text">{{ proxy.$settingStore.nfcWaiting }}</view>
  7. </view>
  8. </template>
  9. <script setup>
  10. import config from "@/config";
  11. import { onLoad, onShow, onReady, onHide, onLaunch, onUnload, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  12. import { ref, reactive, computed, getCurrentInstance, toRefs, inject, watch } from "vue";
  13. const { proxy } = getCurrentInstance();
  14. onLoad((options) => {
  15. // 开启nfc监听
  16. proxy.$nfc.readNFC();
  17. });
  18. onUnload(() => {
  19. proxy.$nfc.closeNFC();
  20. });
  21. onReady(() => {});
  22. onShow(() => {
  23. //调用系统主题颜色
  24. proxy.$settingStore.systemThemeColor([1]);
  25. });
  26. </script>
  27. <style lang="scss" scoped>
  28. .nfc-container {
  29. &-image {
  30. display: flex;
  31. width: 100%;
  32. justify-content: center;
  33. margin: 55% auto 40px auto;
  34. }
  35. &-text {
  36. text-align: center;
  37. font-size: 16px;
  38. }
  39. }
  40. </style>