orderDetail.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const utils_utils = require("../../utils/utils.js");
  4. const utils_file = require("../../utils/file.js");
  5. const _sfc_main = {
  6. __name: "orderDetail",
  7. setup(__props) {
  8. const payType = common_vendor.ref("confirmOrder");
  9. const foodList = common_vendor.ref([
  10. {
  11. id: 1,
  12. name: "石板肉酱豆腐",
  13. price: 19.9,
  14. image: "/static/demo.png",
  15. tags: [
  16. { text: "份", type: "normal" },
  17. { text: "微辣", type: "spicy" }
  18. ],
  19. quantity: 1
  20. },
  21. {
  22. id: 2,
  23. name: "经典三杯鸡",
  24. price: 26.9,
  25. image: "/static/demo.png",
  26. tags: [
  27. { text: "份", type: "normal" }
  28. ],
  29. quantity: 1
  30. }
  31. ]);
  32. const handleConfirmOrder = () => {
  33. utils_utils.go("/pages/result/index");
  34. };
  35. common_vendor.onLoad((e) => {
  36. if (e.payType)
  37. payType.value = e.payType;
  38. });
  39. return (_ctx, _cache) => {
  40. return {
  41. a: common_vendor.f(foodList.value, (item, index, i0) => {
  42. return common_vendor.e({
  43. a: common_vendor.unref(utils_file.getFileUrl)(item.image),
  44. b: common_vendor.t(item.name),
  45. c: item.tags && item.tags.length > 0
  46. }, item.tags && item.tags.length > 0 ? {
  47. d: common_vendor.f(item.tags, (tag, tagIndex, i1) => {
  48. return common_vendor.e({
  49. a: common_vendor.t(tag.text),
  50. b: tagIndex < item.tags.length - 1
  51. }, tagIndex < item.tags.length - 1 ? {} : {}, {
  52. c: tagIndex
  53. });
  54. })
  55. } : {}, {
  56. e: common_vendor.t(item.price),
  57. f: common_vendor.t(item.quantity || 1),
  58. g: item.id || index
  59. });
  60. }),
  61. b: common_vendor.o(handleConfirmOrder),
  62. c: common_vendor.o((...args) => _ctx.handleConfirmPay && _ctx.handleConfirmPay(...args))
  63. };
  64. };
  65. }
  66. };
  67. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-a6cd41f4"]]);
  68. wx.createPage(MiniProgramPage);
  69. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/orderInfo/orderDetail.js.map