600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 美团/饿了么外卖红包小程序源码

美团/饿了么外卖红包小程序源码

时间:2019-12-26 03:19:30

相关推荐

美团/饿了么外卖红包小程序源码

外卖cps搭建全记录

经常点外卖的人可能知道,有时候通过别人的链接或者小程序码可以领到大额优惠券。我们可能会产生疑问,这会不会是一个骗局?

本着违法必究(呸,有问必究)的原则,有了一系列的操作。领取优惠券本质上是一种按销售付费的广告,简称外卖cps。

现在的外卖cps推广是饿了么和美团外卖。

饿了么:

①下载淘宝联盟APP,在吃喝玩乐频道,有两个推广链接

②在饿了么APP中,推荐有奖直接分享

美团外卖:

在美团官网找到美团联盟,签约入驻后进行媒体备案后即可获得两个推广链接。

注意:签约入驻需要营业执照(带公章)

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

源代码地址

步骤

下载以上源代码到本地修改为你自己的微信小程序,打开 /dist/pages/ele/index.js

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

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

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

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

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

代码

'use strict';const stringWidth = require('string-width');const stripAnsi = require('strip-ansi');const ansiStyles = require('ansi-styles');const ESCAPES = new Set(['\u001B','\u009B']);const END_CODE = 39;const wrapAnsi = code => `${ESCAPES.values().next().value}[${code}m`;// Calculate the length of words split on ' ', ignoring// the extra characters added by ansi escape codesconst wordLengths = string => string.split(' ').map(character => stringWidth(character));// Wrap a long word across multiple rows// Ansi escape codes do not count towards lengthconst wrapWord = (rows, word, columns) => {const characters = [...word];let insideEscape = false;let visible = stringWidth(stripAnsi(rows[rows.length - 1]));for (const [index, character] of characters.entries()) {const characterLength = stringWidth(character);if (visible + characterLength <= columns) {rows[rows.length - 1] += character;} else {rows.push(character);visible = 0;}if (ESCAPES.has(character)) {insideEscape = true;} else if (insideEscape && character === 'm') {insideEscape = false;continue;}if (insideEscape) {continue;}visible += characterLength;if (visible === columns && index < characters.length - 1) {rows.push('');visible = 0;}}// It's possible that the last row we copy over is only// ansi escape characters, handle this edge-caseif (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {rows[rows.length - 2] += rows.pop();}};// Trims spaces from a string ignoring invisible sequencesconst stringVisibleTrimSpacesRight = str => {const words = str.split(' ');let last = words.length;while (last > 0) {if (stringWidth(words[last - 1]) > 0) {break;}last--;}if (last === words.length) {return str;}return words.slice(0, last).join(' ') + words.slice(last).join('');};// The wrap-ansi module can be invoked// in either 'hard' or 'soft' wrap mode//// 'hard' will never allow a string to take up more// than columns characters//// 'soft' allows long words to expand past the column lengthconst exec = (string, columns, options = {}) => {if (options.trim !== false && string.trim() === '') {return '';}let pre = '';let ret = '';let escapeCode;const lengths = wordLengths(string);let rows = [''];for (const [index, word] of string.split(' ').entries()) {if (options.trim !== false) {rows[rows.length - 1] = rows[rows.length - 1].trimLeft();}let rowLength = stringWidth(rows[rows.length - 1]);if (index !== 0) {if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {// If we start with a new word but the current row length equals the length of the columns, add a new rowrows.push('');rowLength = 0;}if (rowLength > 0 || options.trim === false) {rows[rows.length - 1] += ' ';rowLength++;}}// In 'hard' wrap mode, the length of a line is// never allowed to extend past 'columns'if (options.hard && lengths[index] > columns) {const remainingColumns = (columns - rowLength);const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);if (breaksStartingNextLine < breaksStartingThisLine) {rows.push('');}wrapWord(rows, word, columns);continue;}if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {if (options.wordWrap === false && rowLength < columns) {wrapWord(rows, word, columns);continue;}rows.push('');}if (rowLength + lengths[index] > columns && options.wordWrap === false) {wrapWord(rows, word, columns);continue;}rows[rows.length - 1] += word;}if (options.trim !== false) {rows = rows.map(stringVisibleTrimSpacesRight);}pre = rows.join('\n');for (const [index, character] of [...pre].entries()) {ret += character;if (ESCAPES.has(character)) {const code = parseFloat(/\d[^m]*/.exec(pre.slice(index, index + 4)));escapeCode = code === END_CODE ? null : code;}const code = ansiStyles.codes.get(Number(escapeCode));if (escapeCode && code) {if (pre[index + 1] === '\n') {ret += wrapAnsi(code);} else if (character === '\n') {ret += wrapAnsi(escapeCode);}}}return ret;};// For each newline, invoke the method separatelymodule.exports = (string, columns, options) => {return String(string).normalize().split('\n').map(line => exec(line, columns, options)).join('\n');};

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