testDetails.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. var api_test = require("../api/test.js");
  4. require("../common/request.js");
  5. const _sfc_main = {
  6. data() {
  7. return {
  8. tempId: null,
  9. item: {}
  10. };
  11. },
  12. onLoad(option) {
  13. this.tempId = option.tempId;
  14. },
  15. onShow() {
  16. this.getTestDetails();
  17. },
  18. onShareAppMessage(res) {
  19. if (this.$isLogin()) {
  20. return {
  21. title: "\u5065\u5EB7\u81EA\u6D4B",
  22. path: "/pages_index/testDetails?tempId=" + this.tempId,
  23. imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
  24. };
  25. }
  26. },
  27. onShareTimeline(res) {
  28. if (this.utils.isLogin()) {
  29. return {
  30. title: "\u5065\u5EB7\u81EA\u6D4B",
  31. imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
  32. };
  33. }
  34. },
  35. methods: {
  36. navTo(url) {
  37. this.$isLogin().then((res) => {
  38. console.log(res);
  39. if (res) {
  40. common_vendor.index.navigateTo({
  41. url
  42. });
  43. } else {
  44. common_vendor.index.navigateTo({
  45. url: "/pages/auth/login"
  46. });
  47. }
  48. });
  49. },
  50. getTestDetails() {
  51. let data = { tempId: this.tempId };
  52. api_test.getTestDetails(data).then((res) => {
  53. if (res.code == 200) {
  54. this.item = res.data;
  55. common_vendor.index.setNavigationBarTitle({
  56. title: this.item.name + "\u81EA\u6D4B"
  57. });
  58. } else {
  59. common_vendor.index.showToast({
  60. icon: "none",
  61. title: "\u8BF7\u6C42\u5931\u8D25"
  62. });
  63. }
  64. }, (rej) => {
  65. });
  66. }
  67. }
  68. };
  69. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  70. return {
  71. a: common_vendor.t($data.item.name),
  72. b: common_vendor.t($data.item.msg),
  73. c: $data.item.descs,
  74. d: common_vendor.o(($event) => $options.navTo("/pages_index/test?tempId=" + $data.item.tempId))
  75. };
  76. }
  77. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/testDetails.vue"]]);
  78. _sfc_main.__runtimeHooks = 6;
  79. wx.createPage(MiniProgramPage);