zhaojs
2023-07-31 49edf3b5b18597aacc3c05529712fbbe9720a805
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_tk_api = require("../../common/tk_api.js");
require("../../common/tk_index.js");
const _sfc_main = {
  data() {
    return {
      optionsCurrent: 1,
      qrcode: "",
      api: common_tk_api.api,
      mtInfo: {},
      optionsList: [
        {
          label: "美团",
          type: 1
        },
        {
          label: "饿了么",
          type: 2
        }
      ]
    };
  },
  onLoad() {
    this.IntiData();
  },
  onShareAppMessage: function() {
    return {
      title: "美团红包",
      path: "/pages/takeout/mt"
      // promise
    };
  },
  onShareTimeline() {
    return {
      title: "美团红包",
      path: "/pages/takeout/mt"
    };
  },
  methods: {
    IntiData() {
      common_vendor.index.showLoading({
        title: "加载中",
        mask: true
      });
      var that = this;
      this.api.post("/api/taoke/meituan_act", {
        type: this.optionsCurrent
      }).then((e) => {
        common_vendor.index.hideLoading();
        if (e.code != 0) {
          common_vendor.index.showToast({
            title: res.data.msg,
            icon: "none"
          });
          return;
        }
        that.mtInfo = e.data.info;
        that.qrcode = that.mtInfo.we_app_info.miniCode;
        console.log(that.qrcode);
      }).catch(function(err) {
        console.log(err);
      });
    },
    toElm() {
      common_vendor.index.switchTab({
        url: "./elm"
      });
    },
    shareClick() {
      common_vendor.index.navigateToMiniProgram({
        appId: this.mtInfo.we_app_info.app_id,
        path: this.mtInfo.we_app_info.page_path,
        success(res2) {
        }
      });
    }
  }
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return common_vendor.e({
    a: common_vendor.o(($event) => $options.toElm()),
    b: $data.qrcode,
    c: $data.qrcode
  }, $data.qrcode ? {
    d: common_vendor.o(($event) => $options.shareClick())
  } : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/OPProject/TK_H5_Web/pages/takeout/mt.vue"]]);
_sfc_main.__runtimeHooks = 6;
wx.createPage(MiniProgramPage);