用云开发实现的开源的外卖cps返利小程序,现在来啦(附带源码)
作者:互联网
外卖cps带分销返利源码
怎么推广“外卖CPS项目”赚佣金?
饿了么美团外卖红包小程序搭建教程
源代码地址
搭建步骤
- 下载以上源代码到本地
http://www.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 - 进去之后选择小程序管理->无裂变小程序管理->添加小程序->填入你自己的链接
- 微信开发者工具,导入项目,提交审核
'use strict';
var Functor = require('./functor'),
Pledge = require('./pledge');
var Cell = function(tuple) {
this._ext = tuple[0];
this._session = tuple[1];
this._functors = {
incoming: new Functor(this._session, 'processIncomingMessage'),
outgoing: new Functor(this._session, 'processOutgoingMessage')
};
};
Cell.prototype.pending = function(direction) {
var functor = this._functors[direction];
if (!functor._stopped) functor.pending += 1;
};
Cell.prototype.incoming = function(error, message, callback, context) {
this._exec('incoming', error, message, callback, context);
};
Cell.prototype.outgoing = function(error, message, callback, context) {
this._exec('outgoing', error, message, callback, context);
};
Cell.prototype.close = function() {
this._closed = this._closed || new Pledge();
this._doClose();
return this._closed;
};
Cell.prototype._exec = function(direction, error, message, callback, context) {
this._functors[direction].call(error, message, function(err, msg) {
if (err) err.message = this._ext.name + ': ' + err.message;
callback.call(context, err, msg);
this._doClose();
}, this);
};
Cell.prototype._doClose = function() {
var fin = this._functors.incoming,
fout = this._functors.outgoing;
if (!this._closed || fin.pending + fout.pending !== 0) return;
if (this._session) this._session.close();
this._session = null;
this._closed.done();
};
module.exports = Cell;
标签:function,context,session,返利,Cell,源码,外卖,._,message 来源: https://blog.csdn.net/m0_56783412/article/details/115394618