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.

96 lines
3.0 KiB

1 week ago
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const store_modules_car = require("../../../store/modules/car.js");
  4. const config_api = require("../../../config/api.js");
  5. if (!Array) {
  6. const _easycom_up_navbar2 = common_vendor.resolveComponent("up-navbar");
  7. const _easycom_u_parse2 = common_vendor.resolveComponent("u-parse");
  8. (_easycom_up_navbar2 + _easycom_u_parse2)();
  9. }
  10. const _easycom_up_navbar = () => "../../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
  11. const _easycom_u_parse = () => "../../../uni_modules/uview-plus/components/u-parse/u-parse.js";
  12. if (!Math) {
  13. (_easycom_up_navbar + _easycom_u_parse)();
  14. }
  15. const _sfc_main = {
  16. __name: "examIntroduction",
  17. setup(__props) {
  18. let usecarStore = store_modules_car.carStore();
  19. common_vendor.ref(false);
  20. const currentNav = common_vendor.ref(0);
  21. const nodes = common_vendor.ref("");
  22. function changeNav(val, index) {
  23. currentNav.value = index;
  24. console.log(index);
  25. console.log(dataList.value[index]);
  26. nodes.value = dataList.value[index] ? dataList.value[index].content : "<p>暂无内容</p>";
  27. }
  28. let style = {
  29. img: "max-width:100%;height:auto",
  30. p: "font-size:32rpx"
  31. };
  32. common_vendor.onLoad((option) => {
  33. if (option.tab)
  34. currentNav.value = option.tab;
  35. examProcessInfoFn();
  36. });
  37. const tabData = common_vendor.ref([
  38. {
  39. name: "考试简介",
  40. id: 0
  41. },
  42. {
  43. name: "考试准备",
  44. id: 1
  45. },
  46. {
  47. name: "考试流程",
  48. id: 2
  49. },
  50. {
  51. name: "注意事项",
  52. id: 3
  53. }
  54. ]);
  55. const dataList = common_vendor.ref([]);
  56. async function examProcessInfoFn() {
  57. const { data: res } = await config_api.examProcessInfo(usecarStore.carInfo.stepType);
  58. if (!res.length)
  59. return;
  60. dataList.value = res;
  61. nodes.value = res[currentNav.value] ? res[currentNav.value].content : "<p>暂无内容</p>";
  62. }
  63. return (_ctx, _cache) => {
  64. var _a;
  65. return {
  66. a: common_vendor.p({
  67. leftText: " ",
  68. leftIconColor: "#fff",
  69. safeAreaInsetTop: true,
  70. autoBack: true,
  71. fixed: false,
  72. bgColor: "transparent",
  73. title: "考试",
  74. titleStyle: {
  75. color: "#fff"
  76. }
  77. }),
  78. b: common_vendor.f(tabData.value, (item, index, i0) => {
  79. return {
  80. a: common_vendor.t(item.name),
  81. b: common_vendor.o(($event) => changeNav(item, index), index),
  82. c: currentNav.value == index ? 1 : "",
  83. d: index
  84. };
  85. }),
  86. c: common_vendor.t((_a = tabData.value[currentNav.value]) == null ? void 0 : _a.name),
  87. d: common_vendor.p({
  88. content: nodes.value,
  89. tagStyle: common_vendor.unref(style)
  90. })
  91. };
  92. };
  93. }
  94. };
  95. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3f444d8d"]]);
  96. wx.createPage(MiniProgramPage);