外卖CPS红包小程序源码分享
外卖cps带分销返利源码
饿了么红包、美团优惠券开发(外卖cps,三级裂变源码)
源代码地址
搭建步骤
- 下载以上源代码到本地
http://y.mybei.cn
截图
步骤
-
下载以上源代码到本地
http://www.mybei.cn -
修改为你自己的微信小程序,打开 /dist/pages/ele/index.js
-
微信小程序->开发管理->开发设置 添加 request的域名: 地址:
https://mp.weixin.qq.com/wxamp/devprofile/get_profile?token=271531762&lang=zh_CN
-
小程序管理后台配置你的链接
后台地址: http://q.mybei.cn -
进去之后选择小程序管理->无裂变小程序管理->添加小程序->填入你自己的链接
-
微信开发者工具,导入项目,提交审核
(wx.webpackJsonp = wx.webpackJsonp || []).push([ [ 91 ], {
102: function(e, t, n) {
e.exports = n.p + “pages/movie/detail/select_seat/index.wxml”;
},
307: function(e, t, n) {
“use strict”;
n(102);
},
308: function(e, t, n) {},
452: function(e, t, n) {
“use strict”;
n.r(t);
n(307);
var a, i, o, r = n(3), c = n.n®, s = n(0), l = n.n(s), u = n(7), h = n.n(u), d = n(8), f = n(5), p = n(9), m = n.n§, g = n(11), _ = n(2), y = n(6), w = n(13), v = (n(308),
function() {
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var a = t[n];
a.enumerable = a.enumerable || !1, a.configurable = !0, “value” in a && (a.writable = !0),
Object.defineProperty(e, a.key, a);
}
}
return function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e;
};
}());
function _asyncToGenerator(e) {
return function() {
var t = e.apply(this, arguments);
return new Promise(function(e, n) {
return function step(a, i) {
try {
var o = ta, r = o.value;
} catch (e) {
return void n(e);
}
if (!o.done) return Promise.resolve®.then(function(e) {
step(“next”, e);
}, function(e) {
step(“throw”, e);
});
e®;
}(“next”);
});
};
}
function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError(“Cannot call a class as a function”);
}
function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError(“this hasn’t been initialised - super() hasn’t been called”);
return !t || “object” != typeof t && “function” != typeof t ? e : t;
}
var O = Object(d.connect)(function mapState(e) {
return {
movie: e.movie
};
}, function mapDispatch(e) {
return {
onUpdateCurrentWeappMp: function onUpdateCurrentWeappMp(t) {
e(Object(w.d)(t));
}
};
})((o = i = function(e) {
function SelectSeat() {
var e, t, n, a = this;
_classCallCheck(this, SelectSeat);
for (var i = arguments.length, o = Array(i), r = 0; r < i; r++) o[r] = arguments[r];
return t = n = _possibleConstructorReturn(this, (e = SelectSeat.proto || Object.getPrototypeOf(SelectSeat)).call.apply(e, [ this ].concat(o))),
n.KaTeX parse error: Expected group after '_' at position 30: …"anonymousState_̲_temp", "anonym…(O) {
for (;😉 switch (O.prev = O.next) {
case 0:
return l.a.showLoading({
title: “加载中”
}), l.a.stopPullDownRefresh(), O.prev = 2, e = {
showId: n.showId
}, O.next = 6, f.d.getSeatList(e);case 6: if (t = O.sent, l.a.hideLoading(), 0 === Number(t.data.code)) if (i = t.data.cinemaOrigin, o = f.d.getCinemaOrigin(), i !== o && l.a.showModal({ showCancel: !1, content: "电影信息有更新,点击确定按钮重新选择" }).then(function() { var e = _asyncToGenerator(c.a.mark(function _callee(e) { var t, i = e.confirm; return c.a.wrap(function _callee$(e) { for (;;) switch (e.prev = e.next) { case 0: if (i) { e.next = 2; break; } return e.abrupt("return", !1); case 2: return l.a.showLoading({ title: "正在加载", mask: !0 }), e.next = 5, Object(y.d)(); case 5: t = e.sent, l.a.hideLoading(), f.d.clearCinemaOrigin(), n.props.onUpdateCurrentWeappMp(t), l.a.reLaunch({ url: "/pages/main/home/index" }); case 10: case "end": return e.stop(); } }, _callee, a); })); return function(t) { return e.apply(this, arguments); }; }()), (r = t.data.list || []).length) { for (s = Math.max.apply(Math, r.map(function(e) { return e.rowNo; })), u = Math.min.apply(Math, r.map(function(e) { return e.rowNo; })), h = Math.max.apply(Math, r.map(function(e) { return e.columnNo; })), d = Math.min.apply(Math, r.map(function(e) { return e.columnNo; })), p = n.state, m = p.seats, g = p.sideNum, _ = u, w = 1; _ <= s; _++, w++) m.push([]), g.push(w); for (v = 0; v < h; v++) m.forEach(function(e) { e.push({ show: !1 }); }); m.forEach(function(e, t) { e.forEach(function(n, a) { r.forEach(function(n) { Number(n.rowNo) - u === t && (n.show = !0, n.choosed = !1, Number(n.columnNo) - d === a && e.splice(a, 1, n)); }); }); }), m.forEach(function(e, t) { if (e.every(function(e) { return !1 === e.show; })) { g[t] = ""; for (var n = g.slice(0, t + 1), a = g.slice(t + 1), i = 0; i < a.length; i++) a.splice(i, 1, a[i] - 1); g = n.concat(a); } }), n.setState({ seats: m, sideNum: g }, function() { n.calculateHeight(), console.log("se:", m, g, u, s, d, h); }); } else n.calculateHeight(), l.a.showToast({ title: "暂未获取到座位信息", icon: "none" }); else l.a.showToast({ title: t.data.msg || "getSeatList失败" + t.data.code, icon: "none" }), n.calculateHeight(); O.next = 14; break; case 11: O.prev = 11, O.t0 = O.catch(2), console.log("getSeatList__error:", O.t0); case 14: case "end": return O.stop(); } }, _callee2, a, [ [ 2, 11 ] ]); })), n.calculateHeight = function() { var e = null, t = null, a = null, i = "", o = "", r = l.a.createSelectorQuery(); r.select(".header").boundingClientRect(), r.selectViewport().scrollOffset(), r.exec(function(r) { var c = l.a.createSelectorQuery(); c.select(".fixed").boundingClientRect(), c.selectViewport().scrollOffset(), c.exec(function(c) { var s = l.a.createSelectorQuery(); s.select(".box").boundingClientRect(), s.selectViewport().scrollOffset(), s.exec(function(s) { e = s[0].width + 300, t = s[0].height + 300, i = e - n.width > n.width ? e / 2 + 50 : (e - n.width) / 2; var u = l.a.createSelectorQuery(); u.select(".hallName").boundingClientRect(), u.selectViewport().scrollOffset(), u.exec(function(u) { var h = l.a.createSelectorQuery(); h.select(".holder").boundingClientRect(), h.selectViewport().scrollOffset(), h.exec(function(h) { a = n.height - r[0].height - c[0].height - u[0].height - h[0].height - 20, o = s[0].height + 125 > a ? 125 : 0, n.setState({ areaWidth: e, areaHeight: t, showHeight: a, init_x: i, init_y: o }, function() { return l.a.hideLoading(); }); }); }); }); }); }); }, n.handleTouchMove = function() { n.setState({}); }, n.chooseSeat = function(e, t, a, i, o, r) { if ("LK" === i) return !1; var c = n.state, s = c.seats, u = c.selectedSeats, h = c.realPrice, d = c.selectedOriginPrice, f = c.selectedRealPrice; if (5 === u.length && !o) return l.a.showToast({ title: "最多只能选择5张", icon: "none" }), !1; if (4 === u.length && !o && r) return l.a.showToast({ title: "最多只能选择5张", icon: "none" }), !1; for (var p = 0; p < s[e].length; p++) if (s[e][p].seatNo === a) if (1 === r) if (s[e][p].choosed = !s[e][p].choosed, s[e][p + 1].choosed = !s[e][p + 1].choosed, s[e][p].choosed) u.push(s[e][p]), u.push(s[e][p + 1]); else { var m = u.findIndex(function(e) { return e.seatNo === a; }); -1 !== m && u.splice(m, 2); } else if (2 === r) if (s[e][p].choosed = !s[e][p].choosed, s[e][p - 1].choosed = !s[e][p - 1].choosed, s[e][p].choosed) u.push(s[e][p - 1]), u.push(s[e][p]); else { var _ = u.findIndex(function(e) { return e.seatNo === a; }); -1 !== _ && u.splice(_ - 1, 2); } else s[e][p].choosed = !s[e][p].choosed, s[e][p].choosed ? u.push(s[e][p]) : u = u.filter(function(e) { return e.seatNo !== a; }); d = parseFloat(Math.round(100 * Object(g.mul)(n.originPrice, u.length, { fixed: 2 })) / 100), f = parseFloat(Math.round(100 * Object(g.mul)(h, u.length, { fixed: 2 })) / 100), n.selectedOriginPrice_show = Math.round(10 * Object(g.mul)(n.originPrice, u.length, { fixed: 2 })) / 10, n.selectedRealPrice_show = Math.round(10 * Object(g.mul)(h, u.length, { fixed: 2 })) / 10, n.setState({ seats: s, selectedSeats: u, selectedOriginPrice: d, selectedRealPrice: f }); }, n.deleteTicket = function(e, t, a) { var i = n.state, o = i.selectedSeats, r = i.seats, c = i.realPrice, s = i.selectedOriginPrice, l = i.selectedRealPrice; 1 === a ? o.splice(e, 2) : 2 === a ? o.splice(e - 1, 2) : o.splice(e, 1); for (var u = 0; u < r.length; u++) for (var h = 0; h < r[u].length; h++) r[u][h].seatNo === t && (1 === a ? (r[u][h].choosed = !r[u][h].choosed, r[u][h + 1].choosed = !r[u][h + 1].choosed) : 2 === a ? (r[u][h].choosed = !r[u][h].choosed, r[u][h - 1].choosed = !r[u][h - 1].choosed) : r[u][h].choosed = !r[u][h].choosed); s = parseFloat(Math.round(100 * Object(g.mul)(n.originPrice, o.length, { fixed: 2 })) / 100), l = parseFloat(Math.round(100 * Object(g.mul)(c, o.length, { fixed: 2 })) / 100), n.selectedOriginPrice_show = Math.round(10 * Object(g.mul)(n.originPrice, o.length, { fixed: 2 })) / 10, n.selectedRealPrice_show = Math.round(10 * Object(g.mul)(c, o.length, { fixed: 2 })) / 10, n.setState({ seats: r, selectedSeats: o, selectedOriginPrice: s, selectedRealPrice: l }); }, n.openOrderPage = _asyncToGenerator(c.a.mark(function _callee4() { var e, t, i, o, r, s, u, h, d, p, m, g; return c.a.wrap(function _callee4$(w) { for (;;) switch (w.prev = w.next) { case 0: return e = f.d.getCinemaOrigin(), w.next = 3, Object(y.d)(); case 3: if ((t = w.sent).cinemaOrigin === e) { w.next = 7; break; } return l.a.showModal({ showCancel: !1, content: "电影信息有更新,点击确定按钮重新选择" }).then(function() { var e = _asyncToGenerator(c.a.mark(function _callee3(e) { var i = e.confirm; return c.a.wrap(function _callee3$(e) { for (;;) switch (e.prev = e.next) { case 0: if (i) { e.next = 2; break; } return e.abrupt("return", !1); case 2: f.d.clearCinemaOrigin(), n.props.onUpdateCurrentWeappMp(t), l.a.reLaunch({ url: "/pages/main/home/index" }); case 5: case "end": return e.stop(); } }, _callee3, a); })); return function(t) { return e.apply(this, arguments); }; }()), w.abrupt("return", !1); case 7: i = l.a.getStorageSync(_.e.MOVIE_CINEMA_INFO), o = l.a.getStorageSync(_.e.MOVIE_HALL_INFO), r = n.state, s = r.hallName, u = r.selectedSeats, h = [], d = [], p = f.d.getCinemaOrigin(), u.forEach(function(e) { h.push(e.seatNo), 2 == +p && d.push(e.seatId); }), m = h.join(","), g = { filmId: o.filmId, showId: o.showId, filmPic: o.filmPic, filmName: o.filmName, time: o.showDate + " " + o.startTime + " " + o.showVersionType, cinemaName: i.cinemaName, cinemaId: i.cinemaId, hallName: s, seat: m, seatId: d, showTime: o.showTime, duration: o.duration, hallName_full: o.hallName, movieTheaterName: i.cinemaName, ticketNum: u.length, selectedOriginPrice: n.selectedOriginPrice_show, selectedRealPrice: n.selectedRealPrice_show }, l.a.setStorageSync(_.e.MOVIE_ORDER_INFO, g), "/pages/movie/order/index", l.a.redirectTo({ url: "/pages/movie/order/index" }); case 19: case "end": return w.stop(); } }, _callee4, a); })), n.anonymousFunc0Map = {}, n.anonymousFunc1Map = {}, n.customComponents = [], _possibleConstructorReturn(n, t); } var t; return function _inherits(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t); }(SelectSeat, e), v(SelectSeat, [ { key: "_constructor", value: function _constructor(e) { (function get(e, t, n) { null === e && (e = Function.prototype); var a = Object.getOwnPropertyDescriptor(e, t); if (void 0 === a) { var i = Object.getPrototypeOf(e); return null === i ? void 0 : get(i, t, n); } if ("value" in a) return a.value; var o = a.get; return void 0 !== o ? o.call(n) : void 0; })(SelectSeat.prototype.__proto__ || Object.getPrototypeOf(SelectSeat.prototype), "_constructor", this).call(this, e), this.state = { filmName: "", filmTime: "", hallName: "", seats: [], selectedSeats: [], selectedOriginPrice: null, selectedRealPrice: null, areaHeight: null, areaWidth: null, showHeight: null, realPrice: null, realPrice_show: null, sideNum: [], init_x: "", init_y: "" }, this.cityId = null, this.cinemaName = null, this.cinemaId = null, this.filmId = null, this.showId = null, this.height = null, this.width = null, this.originPrice = null, this.selectedOriginPrice_show = null, this.selectedRealPrice_show = null, this.scale = 1, this.$$refs = new l.a.RefsArray(); } }, { key: "componentDidMount", value: (t = _asyncToGenerator(c.a.mark(function _callee5() { var e = this; return c.a.wrap(function _callee5$(t) { for (;;) switch (t.prev = t.next) { case 0: this.getPageRoute(), l.a.getSystemInfo({ success: function success(t) { e.height = t.windowHeight, e.width = t.screenWidth, e.refresh(); } }); case 2: case "end": return t.stop(); } }, _callee5, this); })), function componentDidMount() { return t.apply(this, arguments); }) }, { key: "_createData", value: function _createData() { var e = this; this.__state = arguments[0] || this.state || {}, this.__props = arguments[1] || this.props || {}; this.$prefix; var t = this.selectedOriginPrice_show, n = this.selectedRealPrice_show, a = this.__state, i = (a.filmName, a.filmTime, a.hallName, a.seats), o = a.selectedSeats, r = a.areaWidth, c = a.areaHeight, l = a.showHeight, u = (a.realPrice_show, a.sideNum, a.init_x, a.init_y, Object(s.internal_inline_style)({ height: l + "px" })), d = Object(s.internal_inline_style)({ width: r + "px", height: c + "px" }), f = Object(s.internal_inline_style)({ transform: "scale(0.5)" }), p = i.map(function(t, n) { return { $anonymousCallee__8: (t = { $original: Object(s.internal_get_original)(t) }).$original.map(function(t, a) { t = { $original: Object(s.internal_get_original)(t) }; var i = "bdizz" + n + "-" + a; return e.anonymousFunc0Map[i] = function() { return e.chooseSeat(n, a, t.$original.seatNo, t.$original.status, t.$original.choosed, t.$original.lovestatus); }, { _$indexKey: i, $loopState__temp5: t.$original.show ? h()("seat", "N" === t.$original.status ? t.$original.choosed ? "choosed" : "empty" : "LK" === t.$original.status ? "sold" : "invalid", t.$original.lovestatus && "lover") : null, $original: t.$original }; }), $original: t.$original }; }), m = o.length ? o.map(function(t, n) { t = { $original: Object(s.internal_get_original)(t) }; var a = "bdjzz" + n; return e.anonymousFunc1Map[a] = function() { return e.deleteTicket(n, t.$original.seatNo, t.$original.lovestatus); }, { _$indexKey2: a, $original: t.$original }; }) : []; return Object.assign(this.__state, { anonymousState__temp: u, anonymousState__temp2: d, anonymousState__temp3: f, loopArray98: p, loopArray99: m, selectedOriginPrice_show: t, selectedRealPrice_show: n }), this.__state; } }, { key: "anonymousFunc0", value: function anonymousFunc0(e) { for (var t, n = arguments.length, a = Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) a[i - 1] = arguments[i]; return this.anonymousFunc0Map[e] && (t = this.anonymousFunc0Map)[e].apply(t, a); } }, { key: "anonymousFunc1", value: function anonymousFunc1(e) { for (var t, n = arguments.length, a = Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) a[i - 1] = arguments[i]; return this.anonymousFunc1Map[e] && (t = this.anonymousFunc1Map)[e].apply(t, a); } } ]), SelectSeat; }(s.Component), i.$$events = [ "handleTouchMove", "anonymousFunc0", "anonymousFunc1", "openOrderPage" ], i.$$componentPath = "pages/movie/detail/select_seat/index", a = o)) || a; Component(n(0).default.createComponent(O, !0));
}
}, [ [ 452, 0, 1, 2 ] ] ]);