600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 饿了么美团外卖源码php_从零搭建外卖CPS平台小程序开发

饿了么美团外卖源码php_从零搭建外卖CPS平台小程序开发

时间:2022-07-10 16:10:11

相关推荐

饿了么美团外卖源码php_从零搭建外卖CPS平台小程序开发

前段时间天天在抖音刷到 [每天都点外卖,竟然不知道这个隐藏功能] 推广视频,基于程序员明锐的嗅觉,发现里面有利可寻。。。

于是自己整个了一个简单的美团饿了吗领外卖红包的,在公众号、微信群发了几次,没想到效果还挺好:

通过推广订单详情,也可以看出用户为了使用红包(有金额门槛)会下凑单下大额订单(推广效果达到了)。

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

源代码地址

步骤

下载以上源代码到本地

修改为你自己的微信小程序,打开 /dist/pages/ele/index.js

微信小程序->开发管理->开发设置 添加 request的域名: 地址:

https://mp./wxamp/devprofile/get_profile?token=271531762&lang=zh_CN

小程序管理后台配置你的链接

后台地址:

进去之后选择小程序管理->无裂变小程序管理->添加小程序->填入你自己的链接

微信开发者工具,导入项目,提交审核

成品展示

代码

/*!* accepts* Copyright(c) Jonathan Ong* Copyright(c) Douglas Christopher Wilson* MIT Licensed*/'use strict'/*** Module dependencies.* @private*/var Negotiator = require('negotiator')var mime = require('mime-types')/*** Module exports.* @public*/module.exports = Accepts/*** Create a new Accepts object for the given req.** @param {object} req* @public*/function Accepts (req) {if (!(this instanceof Accepts)) {return new Accepts(req)}this.headers = req.headersthis.negotiator = new Negotiator(req)}/*** Check if the given `type(s)` is acceptable, returning* the best match when true, otherwise `undefined`, in which* case you should respond with 406 "Not Acceptable".** The `type` value may be a single mime type string* such as "application/json", the extension name* such as "json" or an array `["json", "html", "text/plain"]`. When a list* or array is given the _best_ match, if any is returned.** Examples:**// Accept: text/html*this.types('html');*// => "html"**// Accept: text/*, application/json*this.types('html');*// => "html"*this.types('text/html');*// => "text/html"*this.types('json', 'text');*// => "json"*this.types('application/json');*// => "application/json"**// Accept: text/*, application/json*this.types('image/png');*this.types('png');*// => undefined**// Accept: text/*;q=.5, application/json*this.types(['html', 'json']);*this.types('html', 'json');*// => "json"** @param {String|Array} types...* @return {String|Array|Boolean}* @public*/Accepts.prototype.type =Accepts.prototype.types = function (types_) {var types = types_// support flattened argumentsif (types && !Array.isArray(types)) {types = new Array(arguments.length)for (var i = 0; i < types.length; i++) {types[i] = arguments[i]}}// no types, return all requested typesif (!types || types.length === 0) {return this.negotiator.mediaTypes()}// no accept header, return first given typeif (!this.headers.accept) {return types[0]}var mimes = types.map(extToMime)var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))var first = accepts[0]return first? types[mimes.indexOf(first)]: false}/*** Return accepted encodings or best fit based on `encodings`.** Given `Accept-Encoding: gzip, deflate`* an array sorted by quality is returned:**['gzip', 'deflate']** @param {String|Array} encodings...* @return {String|Array}* @public*/Accepts.prototype.encoding =Accepts.prototype.encodings = function (encodings_) {var encodings = encodings_// support flattened argumentsif (encodings && !Array.isArray(encodings)) {encodings = new Array(arguments.length)for (var i = 0; i < encodings.length; i++) {encodings[i] = arguments[i]}}// no encodings, return all requested encodingsif (!encodings || encodings.length === 0) {return this.negotiator.encodings()}return this.negotiator.encodings(encodings)[0] || false}/*** Return accepted charsets or best fit based on `charsets`.** Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`* an array sorted by quality is returned:**['utf-8', 'utf-7', 'iso-8859-1']** @param {String|Array} charsets...* @return {String|Array}* @public*/Accepts.prototype.charset =Accepts.prototype.charsets = function (charsets_) {var charsets = charsets_// support flattened argumentsif (charsets && !Array.isArray(charsets)) {charsets = new Array(arguments.length)for (var i = 0; i < charsets.length; i++) {charsets[i] = arguments[i]}}// no charsets, return all requested charsetsif (!charsets || charsets.length === 0) {return this.negotiator.charsets()}return this.negotiator.charsets(charsets)[0] || false}/*** Return accepted languages or best fit based on `langs`.** Given `Accept-Language: en;q=0.8, es, pt`* an array sorted by quality is returned:**['es', 'pt', 'en']** @param {String|Array} langs...* @return {Array|String}* @public*/Accepts.prototype.lang =Accepts.prototype.langs =Accepts.prototype.language =Accepts.prototype.languages = function (languages_) {var languages = languages_// support flattened argumentsif (languages && !Array.isArray(languages)) {languages = new Array(arguments.length)for (var i = 0; i < languages.length; i++) {languages[i] = arguments[i]}}// no languages, return all requested languagesif (!languages || languages.length === 0) {return this.negotiator.languages()}return this.negotiator.languages(languages)[0] || false}/*** Convert extnames to mime.** @param {String} type* @return {String}* @private*/function extToMime (type) {return type.indexOf('/') === -1? mime.lookup(type): type}/*** Check if mime is valid.** @param {String} type* @return {String}* @private*/function validMime (type) {return typeof type === 'string'}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。