posture-guide.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. data() {
  5. return {
  6. currentIndex: 0,
  7. isLastSlide: false,
  8. guideImages: [
  9. {
  10. url: "https://data.qicai321.com/minlong/85fbafbd-1b80-48cd-bcd6-fc4911e9ff54.jpg",
  11. description: "左手手掌"
  12. },
  13. {
  14. url: "https://data.qicai321.com/minlong/17d141e0-8f99-4a54-a534-f6b954c600f8.png",
  15. description: "左手手背"
  16. },
  17. {
  18. url: "https://data.qicai321.com/minlong/5c7d7d6f-5e14-4cd6-bb9f-11509473a8bb.png",
  19. description: "左手握拳"
  20. },
  21. {
  22. url: "https://data.qicai321.com/minlong/148eea00-21b4-49e1-a3b6-712fff08a5a8.png",
  23. description: "右手手掌"
  24. },
  25. {
  26. url: "https://data.qicai321.com/minlong/c67c303e-91c0-4e79-8e82-84096435481f.png",
  27. description: "右手手背"
  28. },
  29. {
  30. url: "https://data.qicai321.com/minlong/5a093f70-d397-4a36-9539-a8b4d11e0a13.png",
  31. description: "右手握拳"
  32. }
  33. ],
  34. instructions: [
  35. "第1步:请按图示展示左手手掌",
  36. "第2步:请按图示展示左手手背",
  37. "第3步:请按图示展示左手握拳",
  38. "第4步:请按图示展示右手手掌",
  39. "第5步:请按图示展示右手手背",
  40. "第6步:请按图示展示右手握拳"
  41. ]
  42. };
  43. },
  44. computed: {
  45. currentInstruction() {
  46. return this.instructions[this.currentIndex];
  47. }
  48. },
  49. methods: {
  50. handleSwiperChange(e) {
  51. this.currentIndex = e.detail.current;
  52. this.isLastSlide = this.currentIndex === this.guideImages.length - 1;
  53. },
  54. handleConfirm() {
  55. if (this.isLastSlide) {
  56. common_vendor.index.navigateTo({
  57. url: "/pages/interview/interview",
  58. success: () => {
  59. console.log("跳转成功");
  60. },
  61. fail: (err) => {
  62. console.error("跳转失败:", err);
  63. common_vendor.index.redirectTo({
  64. url: "/pages/interview/interview",
  65. fail: (redirectErr) => {
  66. console.error("redirectTo 也失败了:", redirectErr);
  67. common_vendor.index.showToast({
  68. title: "页面跳转失败,请重试",
  69. icon: "none"
  70. });
  71. }
  72. });
  73. }
  74. });
  75. } else {
  76. common_vendor.index.showToast({
  77. title: "请查看完所有说明",
  78. icon: "none"
  79. });
  80. }
  81. }
  82. }
  83. };
  84. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  85. return {
  86. a: common_vendor.f($data.guideImages, (item, index, i0) => {
  87. return {
  88. a: item.url,
  89. b: common_vendor.t(item.description),
  90. c: index
  91. };
  92. }),
  93. b: common_vendor.o((...args) => $options.handleSwiperChange && $options.handleSwiperChange(...args)),
  94. c: common_vendor.t($data.isLastSlide ? "我知道了,开始采集" : "请查看完所有说明"),
  95. d: !$data.isLastSlide ? 1 : "",
  96. e: !$data.isLastSlide,
  97. f: common_vendor.o((...args) => $options.handleConfirm && $options.handleConfirm(...args))
  98. };
  99. }
  100. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  101. wx.createPage(MiniProgramPage);