success.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. const _sfc_main = {
  4. data() {
  5. return {
  6. order: null,
  7. orderCode: "",
  8. ids: []
  9. };
  10. },
  11. onLoad(option) {
  12. this.order = JSON.parse(decodeURIComponent(option.order));
  13. this.orderCode = this.order && this.order.orderCodes ? this.order.orderCodes.join(",") : this.order.orderCode || "";
  14. this.ids = this.order && this.order.ids ? this.order.ids : this.order.id ? [this.order.id] : [];
  15. },
  16. methods: {
  17. copyOrderSn(text) {
  18. common_vendor.index.setClipboardData({
  19. data: text,
  20. success: () => {
  21. common_vendor.index.showToast({
  22. title: "\u5185\u5BB9\u5DF2\u6210\u529F\u590D\u5236\u5230\u526A\u5207\u677F",
  23. icon: "none"
  24. });
  25. }
  26. });
  27. },
  28. goOrderDetails(id) {
  29. if (this.ids && this.ids.length > 1) {
  30. common_vendor.index.navigateTo({
  31. url: "/pages_user/user/storeOrder?status="
  32. });
  33. } else {
  34. common_vendor.index.redirectTo({
  35. url: "/pages_user/user/storeOrderDetail?id=" + this.ids[0]
  36. });
  37. }
  38. }
  39. }
  40. };
  41. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  42. return {
  43. a: common_vendor.o(($event) => $options.goOrderDetails($data.order.id)),
  44. b: common_vendor.f($data.order.orderCodes, (item, k0, i0) => {
  45. return {
  46. a: common_vendor.t(item),
  47. b: item
  48. };
  49. }),
  50. c: common_vendor.o(($event) => $options.copyOrderSn($data.orderCode)),
  51. d: common_vendor.t($data.order.createTime)
  52. };
  53. }
  54. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "C:/Users/Administrator/Desktop/\u9879\u76EE/\u76F4\u64AD/liveH5-v3/pages_shop/success.vue"]]);
  55. wx.createPage(MiniProgramPage);