爱简收旧衣按件回收前端代码仓库
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.

148 lines
4.7 KiB

  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. data() {
  5. return {
  6. status: "problem",
  7. // 'problem' or 'qualified'
  8. testingStatus: "",
  9. testingInstructions: "",
  10. testingTime: "",
  11. testingImages: [],
  12. statusBarHeight: 0,
  13. navBarHeight: 44,
  14. navBarTotalHeight: 44,
  15. // 质量问题示例数据
  16. problemList: [
  17. {
  18. title: "大面积破损",
  19. images: [
  20. "https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png",
  21. "https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png"
  22. ]
  23. },
  24. {
  25. title: "大面积破损",
  26. images: [
  27. "https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png",
  28. "https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png",
  29. "https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png"
  30. ]
  31. },
  32. {
  33. title: "大面积破损",
  34. images: [
  35. "https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png",
  36. "https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png",
  37. "https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png",
  38. "https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png"
  39. ]
  40. }
  41. ],
  42. // 合格图片示例
  43. qualifiedImages: [
  44. "https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png"
  45. ]
  46. };
  47. },
  48. onLoad(options) {
  49. const sysInfo = common_vendor.index.getSystemInfoSync();
  50. this.statusBarHeight = sysInfo.statusBarHeight;
  51. this.navBarHeight = 44;
  52. this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight;
  53. if (options && options.status) {
  54. this.status = options.status;
  55. }
  56. if (options.testingStatus) {
  57. this.testingStatus = options.testingStatus;
  58. }
  59. if (options.testingInstructions) {
  60. this.testingInstructions = decodeURIComponent(options.testingInstructions);
  61. }
  62. if (options.testingTime) {
  63. this.testingTime = decodeURIComponent(options.testingTime);
  64. }
  65. if (options.testingImages) {
  66. this.testingImages = decodeURIComponent(options.testingImages).split(",");
  67. }
  68. if (this.status === "problem") {
  69. this.problemList = [
  70. {
  71. title: this.testingInstructions || "质量问题",
  72. images: this.testingImages
  73. }
  74. ];
  75. } else if (this.status === "qualified") {
  76. this.qualifiedImages = this.testingImages;
  77. }
  78. },
  79. methods: {
  80. navigateBack() {
  81. common_vendor.index.navigateBack();
  82. }
  83. }
  84. };
  85. if (!Array) {
  86. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  87. _easycom_uni_icons2();
  88. }
  89. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  90. if (!Math) {
  91. _easycom_uni_icons();
  92. }
  93. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  94. return common_vendor.e({
  95. a: common_vendor.p({
  96. type: "left",
  97. size: "22",
  98. color: "#222"
  99. }),
  100. b: common_vendor.o((...args) => $options.navigateBack && $options.navigateBack(...args)),
  101. c: common_vendor.p({
  102. type: "more-filled",
  103. size: "22",
  104. color: "#222"
  105. }),
  106. d: common_vendor.p({
  107. type: "camera",
  108. size: "22",
  109. color: "#222"
  110. }),
  111. e: $data.navBarTotalHeight + "px",
  112. f: $data.statusBarHeight + "px",
  113. g: $data.status === "problem"
  114. }, $data.status === "problem" ? {
  115. h: common_vendor.t($data.testingTime),
  116. i: common_vendor.f($data.problemList, (item, idx, i0) => {
  117. return {
  118. a: common_vendor.t((idx + 1).toString().padStart(2, "0")),
  119. b: common_vendor.f(item.images, (img, i, i1) => {
  120. return {
  121. a: i,
  122. b: img
  123. };
  124. }),
  125. c: idx
  126. };
  127. }),
  128. j: common_vendor.t($data.problemList.length.toString().padStart(2, "0")),
  129. k: common_vendor.t($data.testingInstructions || "质量问题"),
  130. l: common_vendor.t($data.testingTime)
  131. } : $data.status === "qualified" ? {
  132. n: common_vendor.t($data.testingTime),
  133. o: common_vendor.t($data.qualifiedImages.length < 10 ? "0" + $data.qualifiedImages.length : $data.qualifiedImages.length),
  134. p: common_vendor.f($data.qualifiedImages, (img, i, i0) => {
  135. return {
  136. a: i,
  137. b: img
  138. };
  139. }),
  140. q: common_vendor.t($data.testingTime)
  141. } : {}, {
  142. m: $data.status === "qualified",
  143. r: $data.navBarTotalHeight + "px"
  144. });
  145. }
  146. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-381f9063"]]);
  147. wx.createPage(MiniProgramPage);
  148. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/subcomponent/inspection-detail.js.map