uploadReceptPopop.js 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const pagesOne_winner_utils_source = require("../utils/source.js");
  4. const hooks_useDraw = require("../../../hooks/useDraw.js");
  5. const services_ams = require("../../../services/ams.js");
  6. if (!Array) {
  7. const _easycom_wd_gap2 = common_vendor.resolveComponent("wd-gap");
  8. const _easycom_wd_popup2 = common_vendor.resolveComponent("wd-popup");
  9. (_easycom_wd_gap2 + _easycom_wd_popup2)();
  10. }
  11. const _easycom_wd_gap = () => "../../../node-modules/wot-design-uni/components/wd-gap/wd-gap.js";
  12. const _easycom_wd_popup = () => "../../../node-modules/wot-design-uni/components/wd-popup/wd-popup.js";
  13. if (!Math) {
  14. (_easycom_wd_gap + _easycom_wd_popup)();
  15. }
  16. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  17. __name: "uploadReceptPopop",
  18. props: {
  19. show: {
  20. type: Boolean,
  21. default: false
  22. },
  23. id: {
  24. type: String,
  25. defalut: ""
  26. },
  27. list: Array
  28. },
  29. emits: ["update:show"],
  30. setup(__props, { emit: __emit }) {
  31. const props = __props;
  32. const openid = common_vendor.index.getStorageSync("openid");
  33. const emit = __emit;
  34. common_vendor.ref("1");
  35. const toUploadImage = (type) => {
  36. if (!discountId.value)
  37. return common_vendor.index.showToast({
  38. title: "请先选择优惠力度",
  39. icon: "none"
  40. });
  41. const params = {
  42. openid,
  43. marketingActivityId: props.id,
  44. discountId: discountId.value
  45. };
  46. services_ams.validate(params).then((res) => {
  47. console.log("验证次数", res);
  48. });
  49. common_vendor.index.navigateTo({
  50. url: `/pagesOne/winner/uploadImage?discountId=${discountId.value}&discountLevel=${discountLevel.value}`
  51. });
  52. emit("update:show", false);
  53. };
  54. const discountId = common_vendor.ref("");
  55. const discountLevel = common_vendor.ref("");
  56. const radioChange = (e) => {
  57. discountId.value = e.detail.value;
  58. const obj = props.list.filter((item) => item.id === e.detail.value)[0];
  59. discountLevel.value = `满${obj.thresholdAmount}返${obj.cashbackAmount}`;
  60. };
  61. const { handleClose } = hooks_useDraw.useDraw(props, emit);
  62. return (_ctx, _cache) => {
  63. return {
  64. a: common_vendor.f(props.list, (item, k0, i0) => {
  65. return {
  66. a: common_vendor.t(item.thresholdAmount),
  67. b: common_vendor.t(item.cashbackAmount),
  68. c: item.id,
  69. d: item.checked,
  70. e: item.id,
  71. f: common_vendor.n(item.checked ? "active" : "static")
  72. };
  73. }),
  74. b: common_vendor.unref(pagesOne_winner_utils_source.imgObj).icon1,
  75. c: common_vendor.o(radioChange),
  76. d: common_vendor.o(toUploadImage),
  77. e: common_vendor.p({
  78. height: "16rpx",
  79. ["bg-color"]: "#F7F8F9"
  80. }),
  81. f: common_vendor.o(
  82. //@ts-ignore
  83. (...args) => common_vendor.unref(handleClose) && common_vendor.unref(handleClose)(...args)
  84. ),
  85. g: common_vendor.o(common_vendor.unref(handleClose)),
  86. h: common_vendor.o(($event) => props.show = $event),
  87. i: common_vendor.p({
  88. position: "bottom",
  89. ["safe-area-inset-bottom"]: true,
  90. ["custom-style"]: "max-height: 922rpx;border-radius: 40rpx 40rpx 0 0;",
  91. modelValue: props.show
  92. })
  93. };
  94. };
  95. }
  96. });
  97. wx.createComponent(_sfc_main);