index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const utils_utils = require("../../utils/utils.js");
  4. const _sfc_main = {
  5. __name: "index",
  6. setup(__props) {
  7. const diners = common_vendor.ref(12);
  8. const currentDiners = common_vendor.ref(2);
  9. const addDiners = () => {
  10. diners.value = 16;
  11. };
  12. const selectDiners = (item) => {
  13. currentDiners.value = item;
  14. };
  15. const toOrderFood = () => {
  16. common_vendor.index.setStorageSync("currentDiners", currentDiners.value);
  17. utils_utils.go("/pages/orderFood/index");
  18. };
  19. common_vendor.onLoad((e) => {
  20. let currentDiners2 = common_vendor.index.getStorageSync("currentDiners");
  21. if (currentDiners2)
  22. currentDiners2.value = currentDiners2;
  23. });
  24. return (_ctx, _cache) => {
  25. return common_vendor.e({
  26. a: common_vendor.f(diners.value, (item, k0, i0) => {
  27. return {
  28. a: common_vendor.t(item),
  29. b: currentDiners.value === item ? 1 : "",
  30. c: item,
  31. d: common_vendor.o(($event) => selectDiners(item), item)
  32. };
  33. }),
  34. b: diners.value < 16
  35. }, diners.value < 16 ? {
  36. c: common_vendor.o(addDiners)
  37. } : {}, {
  38. d: common_vendor.o(toOrderFood)
  39. });
  40. };
  41. }
  42. };
  43. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-aa63678d"]]);
  44. wx.createPage(MiniProgramPage);
  45. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/numberOfDiners/index.js.map