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

198 lines
6.5 KiB

  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const pages_mixins_pullRefreshMixin = require("../mixins/pullRefreshMixin.js");
  4. const _sfc_main = {
  5. mixins: [pages_mixins_pullRefreshMixin.pullRefreshMixin],
  6. data() {
  7. return {
  8. qualifiedList: [
  9. { id: 1, name: "羽绒服", price: 8, count: 8, total: 64, reason: "" }
  10. ],
  11. unqualifiedGroups: [
  12. {
  13. name: "羽绒服",
  14. price: 8,
  15. total: 0,
  16. items: [
  17. { id: 11, name: "羽绒服1", reason: "" },
  18. { id: 12, name: "羽绒服2", reason: "" },
  19. { id: 13, name: "羽绒服3", reason: "" },
  20. { id: 14, name: "羽绒服4", reason: "" },
  21. { id: 15, name: "羽绒服5", reason: "" },
  22. { id: 16, name: "羽绒服6", reason: "" },
  23. { id: 17, name: "羽绒服7", reason: "" },
  24. { id: 18, name: "羽绒服8", reason: "" }
  25. ]
  26. },
  27. {
  28. name: "品牌服饰",
  29. price: 8,
  30. total: 0,
  31. items: [
  32. { id: 21, name: "品牌服饰1", reason: "" }
  33. ]
  34. }
  35. ],
  36. unrecyclableList: [
  37. { id: 31, name: "毛衣", price: "", count: 8, total: 0, reason: "" }
  38. ],
  39. reasonPopupVisible: false,
  40. currentReasonTitle: "",
  41. reasonImages: [],
  42. reasonOptions: ["大面积破损", "不可回收", "顽固污渍", "污渍无法清除", "异味严重", "带有危险物品"],
  43. reasonChecked: [false, true, false, true, false, false],
  44. currentReasonItem: null
  45. };
  46. },
  47. methods: {
  48. goBack() {
  49. common_vendor.index.navigateBack();
  50. },
  51. goPrev() {
  52. common_vendor.index.navigateBack();
  53. },
  54. finishInspect() {
  55. common_vendor.index.showToast({ title: "完成质检", icon: "success" });
  56. },
  57. selectReason(item) {
  58. this.currentReasonItem = item;
  59. this.currentReasonTitle = item.name;
  60. this.reasonImages = item.images || [];
  61. this.reasonChecked = item.reasons || Array(this.reasonOptions.length).fill(false);
  62. this.$refs.reasonPopup.open();
  63. },
  64. closeReasonPopup() {
  65. this.$refs.reasonPopup.close();
  66. },
  67. addReasonImg() {
  68. common_vendor.index.chooseImage({
  69. count: 3 - this.reasonImages.length,
  70. success: (res) => {
  71. this.reasonImages = this.reasonImages.concat(res.tempFilePaths);
  72. }
  73. });
  74. },
  75. removeReasonImg(idx) {
  76. this.reasonImages.splice(idx, 1);
  77. },
  78. toggleReason(idx) {
  79. this.$set(this.reasonChecked, idx, !this.reasonChecked[idx]);
  80. },
  81. saveReason() {
  82. if (this.currentReasonItem) {
  83. this.currentReasonItem.images = [...this.reasonImages];
  84. this.currentReasonItem.reasons = [...this.reasonChecked];
  85. }
  86. this.closeReasonPopup();
  87. },
  88. async onRefresh() {
  89. await this.refreshData && this.refreshData();
  90. },
  91. refreshData() {
  92. }
  93. }
  94. };
  95. if (!Array) {
  96. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  97. const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
  98. (_easycom_uni_icons2 + _easycom_uni_popup2)();
  99. }
  100. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  101. const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
  102. if (!Math) {
  103. (_easycom_uni_icons + _easycom_uni_popup)();
  104. }
  105. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  106. return {
  107. a: common_vendor.p({
  108. type: "left",
  109. size: "20",
  110. color: "#222"
  111. }),
  112. b: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)),
  113. c: common_vendor.p({
  114. type: "more",
  115. size: "24",
  116. color: "#222"
  117. }),
  118. d: common_vendor.f($data.qualifiedList, (item, k0, i0) => {
  119. return {
  120. a: common_vendor.t(item.name),
  121. b: common_vendor.t(item.price),
  122. c: common_vendor.t(item.count),
  123. d: common_vendor.t(item.total),
  124. e: item.reason,
  125. f: common_vendor.o(($event) => item.reason = $event.detail.value, item.id),
  126. g: item.id
  127. };
  128. }),
  129. e: common_vendor.f($data.unqualifiedGroups, (group, k0, i0) => {
  130. return {
  131. a: common_vendor.t(group.name),
  132. b: common_vendor.t(group.price),
  133. c: common_vendor.t(group.total),
  134. d: common_vendor.f(group.items, (item, k1, i1) => {
  135. return {
  136. a: common_vendor.t(item.name),
  137. b: "431a990e-2-" + i0 + "-" + i1,
  138. c: common_vendor.o(($event) => $options.selectReason(item), item.id),
  139. d: item.id
  140. };
  141. }),
  142. e: group.name
  143. };
  144. }),
  145. f: common_vendor.p({
  146. type: "right",
  147. size: "18",
  148. color: "#bbb"
  149. }),
  150. g: common_vendor.f($data.unrecyclableList, (item, k0, i0) => {
  151. return {
  152. a: common_vendor.t(item.name),
  153. b: common_vendor.t(item.price || "—"),
  154. c: common_vendor.t(item.count),
  155. d: common_vendor.t(item.total),
  156. e: item.reason,
  157. f: common_vendor.o(($event) => item.reason = $event.detail.value, item.id),
  158. g: item.id
  159. };
  160. }),
  161. h: common_vendor.o((...args) => $options.goPrev && $options.goPrev(...args)),
  162. i: common_vendor.o((...args) => $options.finishInspect && $options.finishInspect(...args)),
  163. j: common_vendor.o((...args) => $options.closeReasonPopup && $options.closeReasonPopup(...args)),
  164. k: common_vendor.t($data.currentReasonTitle),
  165. l: common_vendor.f($data.reasonImages, (img, idx, i0) => {
  166. return {
  167. a: img,
  168. b: common_vendor.o(($event) => $options.removeReasonImg(idx), idx),
  169. c: idx
  170. };
  171. }),
  172. m: common_vendor.p({
  173. type: "plusempty",
  174. size: "40",
  175. color: "#bbb"
  176. }),
  177. n: common_vendor.o((...args) => $options.addReasonImg && $options.addReasonImg(...args)),
  178. o: common_vendor.f($data.reasonOptions, (item, idx, i0) => {
  179. return {
  180. a: common_vendor.n({
  181. checked: $data.reasonChecked[idx]
  182. }),
  183. b: common_vendor.t(item),
  184. c: item,
  185. d: common_vendor.o(($event) => $options.toggleReason(idx), item)
  186. };
  187. }),
  188. p: common_vendor.o((...args) => $options.saveReason && $options.saveReason(...args)),
  189. q: common_vendor.sr("reasonPopup", "431a990e-3"),
  190. r: common_vendor.p({
  191. type: "bottom",
  192. ["mask-click"]: false
  193. })
  194. };
  195. }
  196. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-431a990e"]]);
  197. wx.createPage(MiniProgramPage);
  198. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/manager/inspect-result.js.map