require("../sub-vendors.js"), (wx.webpackJsonp = wx.webpackJsonp || []).push([
  [1839], {
    9644: function (n, e, t) {
      var s = t(4160),
        r = t(5652),
        a = t(2555),
        c = t(4576),
        o = t(758),
        i = t(2573),
        u = t.n(i),
        l = t(4269),
        f = t(4107);

      function d(n) {
        var e = n.utm || "",
          t = n.sqm || "",
          s = {};
        if (null != n && n.args) {
          var r = decodeURIComponent(null == n ? void 0 : n.args);
          s = JSON.parse(r)
        }
        return (0, f.A)({
          utm: e,
          sqm: t
        }, s)
      }
      var m = t(3816),
        p = {
          api: "mtop.damai.wireless.follow.relation.update",
          v: "1.2",
          method: "GET",
          data: {}
        },
        v = {
          api: "mtop.film.MtopSnatchAPI.subscribeSnatchStart",
          v: "1.0",
          method: "GET",
          data: {}
        },
        S = t(9887),
        h = t(6432),
        w = function () {
          var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
          return new S.p((0, f.A)((0, f.A)({
            platform: (0, h.Jt)("platformValue")
          }, p), n)).create()
        },
        b = function () {
          var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
          return new S.p((0, f.A)((0, f.A)({
            platform: (0, h.Jt)("platformValue")
          }, v), n)).create()
        },
        g = function (n) {
          return new Promise((function (e) {
            x({
              templateIds: n.acceptTmpIds.join(","),
              startTime: Date.now(),
              ruleId: null == n ? void 0 : n.ruleId
            }).then((function (n) {
              n.returnValue ? (u().showToast({
                title: "已添加提醒",
                icon: "none"
              }), e({
                subscribeSuc: !0
              })) : e({
                subscribeSuc: !1
              })
            })).catch((function (n) {
              var t = n.message,
                s = void 0 === t ? "订阅失败，请稍后再试" : t;
              u().showToast({
                title: s,
                icon: "none"
              }), e({
                subscribeSuc: !1
              })
            }))
          }))
        },
        x = function (n) {
          return new Promise((function (e, t) {
            b(n).then((function (n) {
              var s = (0, c.A)(n, 2),
                r = s[0],
                a = s[1];
              r ? t(r) : e(a)
            })).catch((function (n) {
              t(n)
            }))
          }))
        },
        I = function (n, e, t) {
          var s = n.templateIds.split(","),
            c = !0;
          return new Promise((function (o) {
            setTimeout((function () {
              c && t && e(!0), c || t || e(!1), c = !0
            }), 1e3);
            var i = function () {
              t && e(!1), c = !1, o({
                reject: !0
              })
            };
            u().requestSubscribeMessage({
              tmplIds: s,
              success: function () {
                var e = (0, a.A)((0, r.A)().m((function e(a) {
                  var l, d, p;
                  return (0, r.A)().w((function (e) {
                    for (;;) switch (e.n) {
                      case 0:
                        if (t && (c = !1), l = (s || []).filter((function (n) {
                            return "accept" === a[n]
                          })), d = function () {
                            g((0, f.A)({
                              acceptTmpIds: l
                            }, n)).then((function (n) {
                              o(n)
                            }))
                          }, !(l && l.length > 0)) {
                          e.n = 7;
                          break
                        }
                        return e.n = 1, m.A.isLogin();
                      case 1:
                        if (e.v) {
                          e.n = 5;
                          break
                        }
                        return e.n = 2, m.A.login();
                      case 2:
                        if (p = e.v, !p.success) {
                          e.n = 3;
                          break
                        }
                        d(), e.n = 4;
                        break;
                      case 3:
                        return u().showToast({
                          title: "登录失败，请登录后重试",
                          icon: "none"
                        }), o({
                          subscribeSuc: !1
                        }), e.a(2);
                      case 4:
                        e.n = 6;
                        break;
                      case 5:
                        d();
                      case 6:
                        e.n = 8;
                        break;
                      case 7:
                        i();
                      case 8:
                        return e.a(2)
                    }
                  }), e)
                })));
                return function (n) {
                  return e.apply(this, arguments)
                }
              }(),
              fail: function (n) {
                n.errCode && i()
              }
            })
          }))
        },
        j = t(9933),
        A = t(3526),
        T = t(6070),
        k = function (n) {
          var e = n.confirm,
            t = void 0 === e ? function () {} : e,
            s = n.wantSee,
            r = void 0 === s ? function () {} : s,
            a = n.wantSeeStatus,
            c = n.flowDetail;
          return (0, T.jsxs)(l.Ss, {
            className: (0, A.A)("confirmHelps", {
              dianyin: "SHOW" !== (null == c ? void 0 : c.buType)
            }),
            children: [(0, T.jsx)(l.Ss, {
              className: "confirmHelpsTitle",
              children: (null == c ? void 0 : c.joinTitle) || "帮我助力"
            }), (0, T.jsxs)(l.Ss, {
              className: "confirmHelpsUserInfo",
              children: [(0, T.jsx)(l.Ss, {
                className: "userInfoIcon",
                style: {
                  backgroundImage: "url(".concat((0, j.zp)({
                    url: null == c ? void 0 : c.userAvatar
                  }), ")")
                }
              }), (0, T.jsxs)(l.Ss, {
                className: "userInfoContent",
                children: [(0, T.jsxs)(l.EY, {
                  children: [null == c ? void 0 : c.userNick, "："]
                }), (null == c ? void 0 : c.joinSubTitle) || "帮我助力一下，送我去现场！谢啦～"]
              })]
            }), (0, T.jsxs)(l.Ss, {
              className: "confirmHelpsBtn",
              children: [(0, T.jsx)(l.Ss, {
                className: "refuse",
                onClick: function () {
                  var n = "/pages/webview/index?url=".concat(encodeURIComponent(null == c ? void 0 : c.indexUrl));
                  u().redirectTo({
                    url: n
                  })
                },
                children: "狠心拒绝"
              }), (0, T.jsx)(l.Ss, {
                className: "ok",
                onClick: t,
                children: (null == c ? void 0 : c.joinBtn) || "确认入团"
              })]
            }), "SHOW" === (null == c ? void 0 : c.buType) && (null == c ? void 0 : c.showIds) && (0, T.jsxs)(l.Ss, {
              className: "confirmHelpsWantSee",
              onClick: r,
              children: [(0, T.jsx)(l.Ss, {
                className: (0, A.A)("wantSeeIcon", {
                  wantSeeIconTrue: a
                })
              }), (0, T.jsx)(l.Ss, {
                className: "wantSeeText",
                children: "同步标记想看"
              })]
            })]
          })
        },
        N = function () {
          var n = (0, i.useRouter)(),
            e = (0, o.useMemo)((function () {
              return d(null == n ? void 0 : n.params)
            }), [null == n ? void 0 : n.params]),
            t = (0, o.useState)(!0),
            s = (0, c.A)(t, 2),
            f = s[0],
            m = s[1],
            p = (0, o.useState)(!1),
            v = (0, c.A)(p, 2),
            S = v[0],
            h = v[1],
            b = function () {
              var n = (0, a.A)((0, r.A)().m((function n() {
                var t, s, a, o;
                return (0, r.A)().w((function (n) {
                  for (;;) switch (n.n) {
                    case 0:
                      return t = e.showIds, n.n = 1, w({
                        operateType: 1,
                        targetId: t,
                        targetType: 7
                      });
                    case 1:
                      s = n.v, a = (0, c.A)(s, 2), null != (o = a[1]) && o.success && m(!!Number(null == o ? void 0 : o.status));
                    case 2:
                      return n.a(2)
                  }
                }), n)
              })));
              return function () {
                return n.apply(this, arguments)
              }
            }(),
            g = function () {
              var n = (0, a.A)((0, r.A)().m((function n() {
                var t, s;
                return (0, r.A)().w((function (n) {
                  for (;;) switch (n.n) {
                    case 0:
                      return h(!0), n.n = 1, I({
                        templateIds: e.templateIds,
                        ruleId: null == e ? void 0 : e.ruleId
                      }, (function () {}), !1);
                    case 1:
                      h(!1), f && b(), t = "".concat(null == e ? void 0 : e.currentPageUrl, "&confirmHelps=true"), s = "/pages/webview/index?url=".concat(encodeURIComponent(t)), u().redirectTo({
                        url: s
                      });
                    case 2:
                      return n.a(2)
                  }
                }), n)
              })));
              return function () {
                return n.apply(this, arguments)
              }
            }();
          return (0, o.useEffect)((function () {
            return function () {
              m(!0)
            }
          }), []), (0, T.jsxs)(l.Ss, {
            className: "confirm-join-container",
            children: [(0, T.jsx)(l.Ss, {
              className: "container-dialogbg"
            }), (0, T.jsx)(l.Ss, {
              className: "container-dialogmask",
              onClick: function () {}
            }), S && (0, T.jsx)(l.Ss, {
              className: "container-customTips",
              style: {
                backgroundImage: "url(".concat("https://gw.alicdn.com/imgextra/i4/O1CN01CjPbeP1OAcIQ2RfV8_!!6000000001665-2-tps-1000-460.png", ")")
              }
            }), (0, T.jsx)(l.Ss, {
              className: "container-dialogbox",
              children: (0, T.jsx)(k, {
                flowDetail: e,
                wantSeeStatus: f,
                confirm: g,
                wantSee: function () {
                  m(!f)
                }
              })
            })]
          })
        };
      Page((0, s.eU)(N, "subPackages/confirmJoinGroupbuying/index", {
        root: {
          cn: []
        }
      }, {
        navigationBarTitleText: "活动详情",
        navigationBarBackgroundColor: "#FFFFFF",
        navigationBarTextStyle: "black"
      } || {}))
    }
  },
  function (n) {
    n.O(0, [6907, 8096, 2076], (function () {
      return e = 9644, n(n.s = e);
      var e
    })), n.O()
  }
]);
