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.

65 lines
2.3 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_line_progress2 = common_vendor.resolveComponent("up-line-progress");
  7. _easycom_up_line_progress2();
  8. }
  9. const _easycom_up_line_progress = () => "../../../uni_modules/uview-plus/components/u-line-progress/u-line-progress.js";
  10. if (!Math) {
  11. _easycom_up_line_progress();
  12. }
  13. const _sfc_main = {
  14. __name: "chapter",
  15. setup(__props) {
  16. let usecarStore = store_modules_car.carStore();
  17. function goPage(item) {
  18. usecarStore.setCar("chapter", item.param);
  19. common_vendor.index.navigateTo({
  20. url: "/pages/exercises/brushQuestions/brushQuestions"
  21. });
  22. }
  23. let dataList = common_vendor.ref([]);
  24. async function columnFidFn() {
  25. dataList.value = [];
  26. let obj = {
  27. type: "4",
  28. stepType: usecarStore.carInfo.stepType,
  29. carType: usecarStore.carInfo.carType,
  30. city: usecarStore.carInfo.city
  31. };
  32. const { data: res } = await config_api.columnFid(obj);
  33. for (let i = 0; i < res.length; i++) {
  34. res[i].percentage = res[i].total / res[i].already * 100 % dataList.value.push(res[i]);
  35. }
  36. console.log(dataList.value);
  37. }
  38. columnFidFn();
  39. const colorArr = ["#3776FF", "#64C76C", "#8484FF", "#F05C1C", "#FDD650", "#6FD568", "#52C1D0"];
  40. return (_ctx, _cache) => {
  41. return {
  42. a: common_vendor.f(common_vendor.unref(dataList), (item, index, i0) => {
  43. return {
  44. a: common_vendor.t(index + 1),
  45. b: colorArr[index],
  46. c: common_vendor.t(item.name),
  47. d: "e609badd-0-" + i0,
  48. e: common_vendor.p({
  49. percentage: item.percentage,
  50. height: "8",
  51. activeColor: "#3776FF",
  52. showText: false
  53. }),
  54. f: common_vendor.t(item.already),
  55. g: common_vendor.t(item.total),
  56. h: index,
  57. i: common_vendor.o(($event) => goPage(item), index)
  58. };
  59. })
  60. };
  61. };
  62. }
  63. };
  64. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e609badd"]]);
  65. wx.createPage(MiniProgramPage);