You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

activation-once-again-record.vue 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="selectCar-box">
  3. <view v-if="state.list.length > 0" class="item" v-for="(item, i) in state.list" :key="i">
  4. <view class="details-item">
  5. <view> 卡号: </view>
  6. <text>{{ item.cardId }}</text>
  7. </view>
  8. <view class="details-item">
  9. <view> 签号: </view>
  10. <text>{{ item.obuId }}</text>
  11. </view>
  12. <view class="details-item">
  13. <view> 激活时间: </view>
  14. <text>{{ item.insertTime }}</text>
  15. </view>
  16. </view>
  17. <view v-else class="flex"> 暂无OBU重新激活记录 </view>
  18. </view>
  19. </template>
  20. <script lang="ts" setup>
  21. import { reactive, ref } from "vue";
  22. import { navTo } from "@/utils/utils";
  23. import { onLoad, onShow } from "@dcloudio/uni-app";
  24. import { activationRecordApi } from "@/utils/network/api.js";
  25. import { request } from "@/utils/network/request.js";
  26. import { msg } from "@/utils/utils";
  27. import { getItem, StorageKeys, setItem } from "@/utils/storage";
  28. import { stringToJson } from "@/utils/network/encryption";
  29. const state = reactive({
  30. list: [],
  31. cardId: "",
  32. obuId: ""
  33. });
  34. onLoad((options) => {
  35. console.log("iooooo", options)
  36. state.cardId = options.cardId
  37. state.obuId = options.obuId
  38. activationRecordQuery().then((item : any) => {
  39. state.list = item.data
  40. console.log(item);
  41. });
  42. });
  43. // 查询重新激活记录
  44. const activationRecordQuery = () => {
  45. const options = {
  46. type: 2,
  47. data: {
  48. cardId: state.cardId,
  49. obuId: state.obuId,
  50. },
  51. method: "POST",
  52. showLoading: true,
  53. };
  54. return new Promise(async (resolve, reject) => {
  55. const res = await request(activationRecordApi, options);
  56. const data = stringToJson(res.bizContent);
  57. resolve(data);
  58. }).catch((error) => {
  59. reject(error);
  60. });
  61. }
  62. </script>
  63. <style>
  64. page {
  65. width: 100%;
  66. height: 100%;
  67. background-color: #eef7f7;
  68. }
  69. </style>
  70. <style lang="scss" scoped>
  71. .flex {
  72. display: flex;
  73. justify-content: center;
  74. }
  75. .selectCar-box {
  76. height: 100%;
  77. padding: 30rpx;
  78. .item {
  79. padding: 20rpx;
  80. background: #ffffff;
  81. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  82. border-radius: 20rpx;
  83. margin-bottom: 30rpx;
  84. }
  85. }
  86. .details-item {
  87. display: flex;
  88. font-size: 26rpx;
  89. font-family: Noto Sans S Chinese;
  90. font-weight: 400;
  91. color: #999999;
  92. margin-bottom: 30rpx;
  93. text {
  94. font-size: 26rpx;
  95. font-family: Noto Sans S Chinese;
  96. font-weight: 400;
  97. color: #333333;
  98. }
  99. }
  100. </style>