integralGoodsDetails.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. var api_integral = require("../api/integral.js");
  4. require("../common/request.js");
  5. const _sfc_main = {
  6. data() {
  7. return {
  8. imgs: [],
  9. activeImg: 1,
  10. goodsId: null,
  11. item: {}
  12. };
  13. },
  14. onLoad(option) {
  15. this.goodsId = option.goodsId;
  16. },
  17. onShow() {
  18. this.getIntegralGoodsById();
  19. },
  20. methods: {
  21. submit() {
  22. common_vendor.index.navigateTo({
  23. url: "./integralOrderPay?goodsId=" + this.goodsId
  24. });
  25. },
  26. swiperChange(event) {
  27. this.activeImg = event.detail.current + 1;
  28. },
  29. showImg() {
  30. common_vendor.index.previewImage({
  31. urls: this.imgs,
  32. current: this.imgs[0]
  33. });
  34. },
  35. getIntegralGoodsById() {
  36. let data = { goodsId: this.goodsId };
  37. api_integral.getIntegralGoodsById(data).then((res) => {
  38. if (res.code == 200) {
  39. this.item = res.data;
  40. if (res.data.images != null) {
  41. this.imgs = res.data.images.split(",");
  42. } else {
  43. this.activeImg = 0;
  44. }
  45. console.log(this.imgs);
  46. } else {
  47. common_vendor.index.showToast({
  48. icon: "none",
  49. title: "\u8BF7\u6C42\u5931\u8D25"
  50. });
  51. }
  52. }, (rej) => {
  53. });
  54. }
  55. }
  56. };
  57. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  58. return {
  59. a: common_vendor.f($data.imgs, (item, index, i0) => {
  60. return {
  61. a: item,
  62. b: index
  63. };
  64. }),
  65. b: common_vendor.o((...args) => $options.swiperChange && $options.swiperChange(...args)),
  66. c: common_vendor.t($data.activeImg),
  67. d: common_vendor.t($data.imgs.length),
  68. e: common_vendor.o(($event) => $options.showImg()),
  69. f: common_vendor.t($data.item.goodsName),
  70. g: common_vendor.t($data.item.integral),
  71. h: common_vendor.t($data.item.otPrice.toFixed(2)),
  72. i: $data.item.descs,
  73. j: common_vendor.t($data.item.integral),
  74. k: common_vendor.o(($event) => $options.submit())
  75. };
  76. }
  77. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_user/integralGoodsDetails.vue"]]);
  78. wx.createPage(MiniProgramPage);