跳转到主内容
极星编程网:以代码为星,赴技术山海!

美团/饿了么外卖CPS联盟返利公众号小程序核心源码

我们都知道,目前两家巨头饿了么和美团点外卖都可以获得返现,其中饿了么是返利6%,美团是返利3-5%,具体要根据活动来。

也就是说按正常一个人用户点餐,你可以获得每笔外卖的CPS返利佣金,而且外卖的用户粘性极高,已经成了很多淘客的首选,不巧前段时间有客户找我分析开发了一个项目,主要是公众号和小程序(后期还说要开发APP)实现用户一次注册同步关联的跟单返利。

下面是无裂变版本的搭建教程。

源码地址: http://y.mybei.cn 部署步骤 部署后台,填资料 登录后台 http://q.mybei.cn 获取账号,联系微信:mybei95 登录后台

后台新建小程序

获取小程序APPID和secret 小程序管理后台,开发设置里面获取 直达地址: https://mp.weixin.qq.com/wxamp/devprofile/get_profile?token=297816861&lang=zh_CN

饿了么外卖链接 饿了么外卖链接,通过淘宝联盟App获取。

获取后的链接举例 :

taoke/pages/shopping-guide/index?scene=a1mzJsu

具体操作步骤如下图

饿了么商超链接 登录阿里妈妈后台( https://pub.alimama.com/fourth/promo/activity.htm?tab=local )

上面的链接复制出来,再拼接上固定的开头前缀就可以了。

如,上面复制出来的是:https://s.click.ele.me/JlyCcsu 固定前缀为:

pages/sharePid/web/index?scene=

那么填在后台的商超地址为:

pages/sharePid/web/index?scene=https://s.click.ele.me/JlyCcsu

美团外卖红包 登录美团联盟后台( https://union.meituan.com ) 获取的链接格式举例:

/index/pages/h5/h5?weburl=https%3A%2F%2Fclick.meituan.com%2Ft%3Ft%3D1%26c%3D1%26p%3DOWMpZ-uzIFOVe6JyOONs3dXuqV0qcAf-r-KCvHdXiNeVlbs0UMIwS5q8l_mKFiABdjbOhkf225rrXlDRIPuQCjl3BCoxcmoWtdml_A72kchOROxAM2FHvY4dtuvocDuE7pw2AR9eIvKTSzIzj2mBZr8eIFbHPymMMrvHbZincOyWGhuu-20GIUXcfdM_2p84TjJMIu1xmglN9ZfXBl5PQeeixYBCnkcsnDr-MW8mvijFGjoHTf26MHhsfkIf8NJUEjQZd2pUnaurOlNd9qOT0Tp74KpGAcwxf_dXC9t_wOfXHeGe3oMLCOvlQ_8OQQ4EXR5NQQraN7T0b1k5tjToZi6weoIsg3KTmiMqSY7bsWf7NhG0Ixzl-RT6Y9ZairRl1PZmRSkAw-tptsMyR-TekYD6f5lt8iUkQM1m0Vmq7x8QT5KTRoHjXsnjso4WaMJqaJg3nOvfhwVWPh-k4BX38-S3Ql1J8EPwOYtBUQkav_Ydy9gW_88kJh0gV5w7w2WcckeT7N8TJXPMjor0mTN1oYdOgNUrMmxGm_94YKcBnOpJ6wdkCoRVvjTcaT6gg536TaSdBo9zlm2zUBih02iino8QUANNyMwQdSedulGPr3sas7nZEPd8eFGSm32TuaAETsVVP3OzVY30q6ddo5KkAXZhieO8sDgeXMcAvcfyM7d3UPs3bMpULocZQpgkOPzghKwXx0cjhkrJbDWgTTEr_j2Icb06cCBVM3NfI7j3xbcKanVnkP3G6MOe9kMvL6CwB2Q9Oye21AjbFVLSBGaSNw&lch=cps:waimai:5:69af7431e34639b2531623b10b38f327:olxUH5YQeupvDy5FwMKwQXWdGn4E&f_token=1&f_userId=1

美团商超红包 获取的链接格式举例:

/index/pages/h5/h5?weburl=https%3A%2F%2Frunion.meituan.com%2Furl%3Fkey%3D69af7431e34639b2531623b10b38f327%26url%3Dhttps%253A%252F%252Fi.meituan.com%252Fawp%252Fhfe%252Fblock%252Fc9ff59b58f6f5bf385b6%252F94455%252Findex.html%253Fappkey%253D69af7431e34639b2531623b10b38f327%253AolxUH5WQiQEnYtgncRKV0iOb0dQI%26sid%3DolxUH5WQiQEnYtgncRKV0iOb0dQI&lch=cps:waimai:5:69af7431e34639b2531623b10b38f327:olxUH5WQiQEnYtgncRKV0iOb0dQI&f_token=1&f_userId=1

美团酒店 美团酒店需要注册美团分销联盟( https://pub.meituan.com ) 获取的链接格式举例:

https://union-click1.meituan.com/page/click?p=ueIRVj9jpPcUJog9X-Ub7tsWBIvwMoxQfRf_ow7PRhGq_lxreTvA3b4XFqc0UbIZbBjiZ72mlUQQwjBoBQojIyeuYbpbsadO8QBXlenxwHwCocOL-QK1PHwwySX-SaUV3N7c1Yas9BfLlssClAkiQjZFv3m_q0NrgiG0J79wFzYZo1ywAXV1y6mGAsVr_1APnwkXykF7f-MHaspmGLB0YdLTa8gfhe_L717S3AIt22-UqJdnRxlWlARJ0ksDy2yddYqqjzdxsbRS34dDaAJg-MfH3E-96Jv3cU-kOm49kqdsp9aL8VAUpjII0DYNMK2pSZdmTwgJoU6-77SYSlrlpg

小程序上传部分 下载源码 下载以上源代码到本地 http://www.mybei.cn 修改为你自己的小程序AppId 修改为你自己的微信小程序,打开 /dist/pages/ele/index.js

设置小程序的请求域名 微信小程序->开发管理->开发设置 添加 request的域名: 直达地址: https://mp.weixin.qq.com/wxamp/devprofile/get_profile?token=271531762&lang=zh_CN 设置 request 合法域名: https://p.mybei.cn;https://xcf.haozii.com; 设置 downloadfile域名: https://img.mybei.cn; https://mp.weixin.qq.com;

微信开发者工具,导入项目

修改为自己的小程序AppId

上传,测试,提交审核

上传之前一定要把管理后台的正在审核打开!

!

!

用加急审核,大概20分钟左右,可以通过审核!

审核完成后,关闭后台管理正在审核保存即可!

祝大家都能赚到钱!

(wx.webpackJsonp = wx.webpackJsonp || []).push([ [ 66 ], { 142: function(e, t, n) { e.exports = n.p + “pages/main/home/iconMenu/index.wxml”; }, 380: function(e, t, n) { “use strict”; n(142); }, 381: function(e, t, n) {}, 491: function(e, t, n) { “use strict”; n.r(t); n(380); var r, a, o, i = n(3), u = n.n(i), s = n(16), c = n.n(s), l = n(8), p = n(0), d = n.n§, m = n(2), f = n(58), h = n(5), v = (n(381), function() { function defineProperties(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, “value” in r && (r.writable = !0), Object.defineProperty(e, r.key, r); } } 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(r, a) { try { var o = t r , i = o.value; } catch (e) { return void n(e); } if (!o.done) return Promise.resolve(i).then(function(e) { step(“next”, e); }, function(e) { step(“throw”, e); }); e(i); }(“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 L = Object(l.connect)(function mapState(e) { return { user: e.user }; }, function mapDispatch(e) { return { onUpdateGoodsCatId: function onUpdateGoodsCatId(t) { e(Object(f.a)(t)); } }; })((o = a = function(e) { function IconMenu() { var e, t, n, r = this; _classCallCheck(this, IconMenu); for (var a = arguments.length, o = Array(a), i = 0; i < a; i++) o[i] = arguments[i]; return t = n = _possibleConstructorReturn(this, (e = IconMenu. proto || Object.getPrototypeOf(IconMenu)).call.apply(e, [ this ].concat(o))), n. KaTeX parse error: Expected '}', got 'EOF' at end of input: …unction _callee ® { for (;😉 switch (r.prev = r.next) { case 0: return r.next = 2, h.r.fetchCatList();

case 2:

if (e = r.sent, 0 === (t = e.data).code) { r.next = 6; break; } return r.abrupt("return", !1);

case 6: if ((a = t.data.goodsCatList).length) { r.next = 9; break; } return r.abrupt("return", !1);

case 9: o = a.filter(function(e) { return !!e.catImgMedias && !!e.catImgMedias.length; }).map(function(e) { return { key: "goodsCatId-" + e.goodsCatId, icon: e.catImgMedias[0].mediaUrl, label: e.catName }; }), n.setState({ catList: o.splice(0, 10) });

case 11: case "end": return r.stop(); } }, _callee, r); })), n.getShowNewFree = function() { if (!n.props.user.loginStatus) return !1; var e = n.props.user.mp; if (!e) return !1; var t = e.newFreeThreshold, r = e.newFreeSubsidy; return !!t && (!!r && 0 !== r); }, n.initValidList = function() { var e = n.props.user, t = e.currentWeappMp, r = e.trusted, a = e.mp, o = e.block, i = t.miniServiceType, u = t.fanType, s = t.hideTaobao, c = a.pddMaster; n.menuList.couponCash.label = 1 != u || r ? "找券返现" : "找券省钱"; var l = n.getShowNewFree(); if (2 === i) return n.state.catList; if (o) return []; if (1 === i) { if (1 === s) { var p = [ n.menuList.couponCash, n.menuList.pddSave, n.menuList.jdSave, n.menuList.redPacket, n.menuList.lottery ]; return l && 0 == u && p.unshift(n.menuList.newFree), p.splice(0, 5); } if (1 === c) { var d = [ n.menuList.couponCash, n.menuList.hotList, n.menuList.pddSave, n.menuList.jdSave, n.menuList.redPacket, n.menuList.lottery ]; return l && 0 == u && d.unshift(n.menuList.newFree), d.splice(0, 5); } if (r) { var m = [ n.menuList.couponCash, n.menuList.tbSave, n.menuList.pddSave, n.menuList.jdSave, n.menuList.evaluate, n.menuList.hotList, n.menuList.tmall, n.menuList.jhs, n.menuList.tqg, n.menuList.redPacket, n.menuList.lottery ]; return l && m.unshift(n.menuList.newFree), m.splice(0, 10); } var f = [ n.menuList.couponCash, n.menuList.pddSave, n.menuList.jdSave, n.menuList.redPacket, n.menuList.lottery ]; return l && 0 == u && f.unshift(n.menuList.newFree), f.splice(0, 5); } if (3 === i) { if (1 === s) { var h = [ n.menuList.allGroup, n.menuList.couponCash, n.menuList.pddSave, n.menuList.jdSave, n.menuList.redPacket, n.menuList.lottery ]; return l && 0 == u && h.splice(4, 0, n.menuList.newFree), h.splice(0, 5); } if (1 === c) { var v = [ n.menuList.allGroup, n.menuList.couponCash, n.menuList.hotList, n.menuList.pddSave, n.menuList.jdSave, n.menuList.redPacket, n.menuList.lottery ]; return l && 0 == u && v.splice(4, 0, n.menuList.newFree), v.splice(0, 5); } if (r) { var L = [ n.menuList.allGroup, n.menuList.couponCash, n.menuList.tbSave, n.menuList.pddSave, n.menuList.jdSave, n.menuList.evaluate, n.menuList.hotList, n.menuList.tmall, n.menuList.jhs, n.menuList.redPacket, n.menuList.lottery ]; return l && L.splice(5, 0, n.menuList.newFree), L.splice(0, 10); } var y = [ n.menuList.allGroup, n.menuList.couponCash, n.menuList.pddSave, n.menuList.jdSave, n.menuList.redPacket, n.menuList.lottery ]; return l && 0 == u && y.splice(4, 0, n.menuList.newFree), y.splice(0, 5); } return []; }, n.onItemClick = function(e) { if (0 === e.indexOf("goodsCatId-")) { var t = e.split("-")[1]; n.props.onUpdateGoodsCatId(t); return d.a.switchTab({ url: "/pages/main/group/index" }), !1; } if (!n.props.user.loginStatus) return n.props.onLogin(), !1; if ("newFree" === e) return n.openNewFree(), !1; if ("couponCash" === e) return n.openCouponCash(), !1; if ("pddSave" === e) { var r = "/pages/hot_list/index?" + c.a.stringify({ navTabKey: "pdd", activeTabKey: "ssxlb" }); return d.a.navigateTo({ url: r }), !1; } if ("jdSave" === e) return n.openJdHome(), !1; if ("redPacket" === e) return n.openPddRedPacket(), !1; if ("evaluate" === e) { return d.a.navigateTo({ url: "/pages/evaluate/index" }), !1; } if ("hotList" === e) { var a = "/pages/hot_list/index?" + c.a.stringify({ navTabKey: "tb", activeTabKey: "ssxlb" }); return d.a.navigateTo({ url: a }), !1; } if ("allGroup" === e) { return d.a.switchTab({ url: "/pages/main/group/index" }), !1; } return "ele" === e || "lottery" === e ? (d.a.showToast({ title: "功能建设中", icon: "none" }), !1) : void 0; }, n.openNewFree = function() { d.a.navigateTo({ url: "/pages/new_free/index" }); }, n.openJdHome = function() { d.a.navigateTo({ url: "/packageB/jd/home/index" }); }, n.openCouponCash = function() { d.a.switchTab({ url: "/pages/super_cash/index" }); }, n.openPddRedPacket = _asyncToGenerator(u.a.mark(function _callee2() { var e, t, a, o, i, s; return u.a.wrap(function _callee2$(r) { for (;;) switch (r.prev = r.next) { case 0: if (n.ddPidId) { r.next = 11; break; } return d.a.showLoading({ title: "正在加载" }), r.next = 4, h.a.getPddPid();

case 4: if (e = r.sent, d.a.hideLoading(), 0 == (t = e.data).code) { r.next = 10; break; } return d.a.showToast({ title: t.msg, icon: "none" }), r.abrupt("return", !1);

case 10: n.ddPidId = t.ddPidId;

case 11: return a = { ddPidId: n.ddPidId }, d.a.showLoading({ title: "正在加载" }), r.next = 15, h.f.getHongBao(a);

case 15: if (o = r.sent, d.a.hideLoading(), 0 == (i = o.data).code) { r.next = 21; break; } return d.a.showToast({ title: i.msg, icon: "none" }), r.abrupt("return", !1);

case 21: s = i.hongbao.pagePath, d.a.navigateToMiniProgram({ appId: m.f.PDD, path: s }).then(function() {}).catch(function() {});

case 23: case "end": return r.stop(); } }, _callee2, r); })), n.anonymousFunc0Map = {}, 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); }(IconMenu, e), v(IconMenu, [ { key: "_constructor", value: function _constructor(e) { (function get(e, t, n) { null === e && (e = Function.prototype); var r = Object.getOwnPropertyDescriptor(e, t); if (void 0 === r) { var a = Object.getPrototypeOf(e); return null === a ? void 0 : get(a, t, n); } if ("value" in r) return r.value; var o = r.get; return void 0 !== o ? o.call(n) : void 0; })(IconMenu.prototype.__proto__ || Object.getPrototypeOf(IconMenu.prototype), "_constructor", this).call(this, e), this.state = { catList: [] }, this.showNewFree = !1, this.menuList = { newFree: { key: "newFree", icon: "" + m.c.url + m.c.menu.url + m.c.menu.newFree, label: "新人免单" }, couponCash: { key: "couponCash", icon: "" + m.c.url + m.c.menu.url + m.c.menu.couponCash, label: "找券返现" }, pddSave: { key: "pddSave", icon: "" + m.c.url + m.c.menu.url + m.c.menu.pddSave, label: "拼多多省钱" }, jdSave: { key: "jdSave", icon: "" + m.c.url + m.c.menu.url + m.c.menu.jdSave, label: "京东省钱" }, redPacket: { key: "redPacket", icon: "" + m.c.url + m.c.menu.url + m.c.menu.redPacket, label: "天天红包" }, tbSave: { key: "tbSave", icon: "" + m.c.url + m.c.menu.url + m.c.menu.tbSave, label: "淘宝省钱" }, evaluate: { key: "evaluate", icon: "" + m.c.url + m.c.menu.url + m.c.menu.regimentalEvaluate, label: "团长评测" }, hotList: { key: "hotList", icon: "" + m.c.url + m.c.menu.url + m.c.menu.hotList, label: "热销榜" }, tmall: { key: "tmall", icon: "" + m.c.url + m.c.menu.url + m.c.menu.tmall, label: "天猫超市" }, jhs: { key: "jhs", icon: "" + m.c.url + m.c.menu.url + m.c.menu.jhs, label: "聚划算" }, tqg: { key: "tqg", icon: "" + m.c.url + m.c.menu.url + m.c.menu.tqg, label: "淘抢购" }, allGroup: { key: "allGroup", icon: "" + m.c.url + m.c.menu.url + m.c.menu.allGroup, label: "全部团品" }, ele: { key: "ele", icon: "" + m.c.url + m.c.menu.url + m.c.menu.ele, label: "饿了么红包" }, lottery: { key: "lottery", icon: "" + m.c.url + m.c.menu.url + m.c.menu.lottery, label: "转盘抽免单" } }, this.ddPidId = "", this.$$refs = new d.a.RefsArray(); } }, { key: "componentDidMount", value: (t = _asyncToGenerator(u.a.mark(function _callee3() { return u.a.wrap(function _callee3$(e) { for (;;) switch (e.prev = e.next) { case 0: if (2 !== this.props.user.currentWeappMp.miniServiceType) { e.next = 4; break; } return e.next = 4, this.getTuanGoodsCatList();

case 4: case "end": return e.stop(); } }, _callee3, this); })), function componentDidMount() { return t.apply(this, arguments); }) }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate(e, t) { return this.state.catList.length !== t.catList.length || this.props.onLogin !== e.onLogin; } }, { key: "_createData", value: function _createData() { var e = this; this.__state = arguments[0] || this.state || {}, this.__props = arguments[1] || this.props || {}; this.$prefix; console.log("src/component/iconMenu/index.js/IconMenu/render"); var t = this.initValidList(); t.length; var n = t.map(function(t, n) { t = { $original: Object(p.internal_get_original)(t) }; var r = "bbezz" + n; return e.anonymousFunc0Map[r] = function() { return e.onItemClick(t.$original.key); }, { _$indexKey: r, $original: t.$original }; }); return Object.assign(this.__state, { loopArray88: n, validList: t }), this.__state; } }, { key: "anonymousFunc0", value: function anonymousFunc0(e) { for (var t, n = arguments.length, r = Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++) r[a - 1] = arguments[a]; return this.anonymousFunc0Map[e] && (t = this.anonymousFunc0Map)[e].apply(t, r); } } ]), IconMenu; }(p.Component), a.$$events = [ "anonymousFunc0" ], a.defaultProps = { onLogin: function onLogin() {} }, a.$$componentPath = "pages/main/home/iconMenu/index", r = o)) || r; Component(n(0).default.createComponent(L)); }

}, [ [ 491, 0, 1, 2 ] ] ]);

相关文章