赞
踩
那么美团和饿了么这么牛逼,管我们什么事情呢?当然管我们的事情,因为我们可以利用美团和饿了么赚钱,怎么赚钱呢?
答案是和淘客的模式一样,现在美团和饿了么都推出了联盟推广系统,只要你有流量,就可以对接美团和饿了么联盟系统,美团和饿了么发放大量平台无门槛红包,红包金额是最低6元-最高60元。你的任务就是帮这个红包推送给需要点餐的客户手里去,客户通过你的链接领取了红包点餐了,美团和饿了么会给你1-3元的佣金(简称推广费)
#include “Config.h”
#include “File.h”
Config Config::config_;
Config::Config()
{
//init();
}
Config::~Config()
{
//delete doc;
//write();
}
void Config::init(const std::string& filepath)
{
filename_ = filepath + “/config.xml”;
printf(“try find config file: %s\n”, filename_.c_str());
doc_.LoadFile(filename_.c_str());
//ʼṹ
if (doc_.Error())
{
//doc.DeleteChildren();
doc.LinkEndChild(doc_.NewDeclaration());
root_ = doc_.NewElement(“root”);
}
else
{
root_ = doc_.FirstChildElement(“root”);
}
record_ = root_->FirstChildElement("record");
if (!record_)
{
record_ = root_->InsertFirstChild(doc_.NewElement("record"))->ToElement();
}
}
void Config::write()
{
//doc.LinkEndChild(doc.NewDeclaration());
doc.LinkEndChild(root);
doc_.SaveFile(filename_.c_str());
}
tinyxml2::XMLElement* Config::getElement(tinyxml2::XMLElement* parent, const char* name)
{
auto p = parent->FirstChildElement(name);
if §
{
return p;
}
else
{
p = parent->InsertFirstChild(doc_.NewElement(name))->ToElement();
p->SetText("");
return p;
}
}
int Config::getRecord(const char* name)
{
if (strlen(name) == 0) { return 0; }
auto mainname = File::getFileMainname(File::getFilenameWithoutPath(name));
dealFilename(mainname);
const char* str = getElement(record_, mainname.c_str())->GetText();
if (!str)
{
return 0;
}
return atoi(str);
}
void Config::removeRecord(const char* name)
{
if (strlen(name) == 0) { return; }
auto mainname = File::getFileMainname(File::getFilenameWithoutPath(name));
dealFilename(mainname);
record_->DeleteChild(getElement(record_, mainname.c_str()));
}
void Config::setRecord(int v, const char* name)
{
if (strlen(name) == 0) { return; }
auto mainname = File::getFileMainname(File::getFilenameWithoutPath(name));
dealFilename(mainname);
getElement(record_, mainname.c_str())->SetText(File::formatString("%d", v).c_str());
}
void Config::clearRecord()
{
if (record_)
{
record_->DeleteChildren();
}
}
std::string Config::getString(const char* name, std::string def /<
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。