Commit b0c461a2 by 王栋源

wdy

parent 56158abf
...@@ -122,84 +122,84 @@ class businesschanceApplet extends AppletBase { ...@@ -122,84 +122,84 @@ class businesschanceApplet extends AppletBase {
} }
//发布需求 //发布需求
async submitneed(pobj, obj) { async submitneed(pobj, obj) {
// var serviceItem_name = ""; var serviceItem_name = "";
// var chanceType = "yzc"; var chanceType = "yzc";
// if (obj.publisherName == "" || obj.publisherName == null) { if (obj.publisherName == "" || obj.publisherName == null) {
// return { code: -100, msg: "请填写您的姓名" }; return { code: -100, msg: "请填写您的姓名" };
// } }
// if (obj.publisherMobile == "" || obj.publisherMobile == null) { if (obj.publisherMobile == "" || obj.publisherMobile == null) {
// return { code: -100, msg: "请填写您的电话" }; return { code: -100, msg: "请填写您的电话" };
// } }
// if (obj.notes != "" && obj.notes.length > 255) { if (obj.notes != "" && obj.notes.length > 255) {
// return { code: -100, msg: "备注字数超出限制,请重新填写" }; return { code: -100, msg: "备注字数超出限制,请重新填写" };
// } }
// if (obj.channelCode == "") { if (obj.channelCode == "") {
// return { code: -110, msg: "channelCode参数传递错误" }; return { code: -110, msg: "channelCode参数传递错误" };
// } }
// var channelItem = await this.channelSve.getChannelItem(obj.channelCode); var channelItem = await this.channelSve.getChannelItem(obj.channelCode);
// if (channelItem == "" || channelItem == null) { if (channelItem == "" || channelItem == null) {
// return { code: -110, msg: "channelCode参数传递错误" }; return { code: -110, msg: "channelCode参数传递错误" };
// } }
// if (obj.serviceItem_code == "") { if (obj.serviceItem_code == "") {
// return { code: -110, msg: "serviceItem_code参数传递错误" }; return { code: -110, msg: "serviceItem_code参数传递错误" };
// } }
// var serviceItem = await this.servicesitemSve.findOneByCode(obj.serviceItem_code); var serviceItem = await this.servicesitemSve.findOneByCode(obj.serviceItem_code);
// if (serviceItem == "" || serviceItem == null) { if (serviceItem == "" || serviceItem == null) {
// return { code: -110, msg: "serviceItem_code参数传递错误" }; return { code: -110, msg: "serviceItem_code参数传递错误" };
// } else { } else {
// serviceItem_name = serviceItem.name; serviceItem_name = serviceItem.name;
// chanceType = serviceItem.itemType; chanceType = serviceItem.itemType;
// } }
// if (obj.publisherOnlyCode != "" && obj.shopOnlyCode != "") { if (obj.publisherOnlyCode != "" && obj.shopOnlyCode != "") {
// var pobj = { var pobj = {
// publisherOnlyCode: obj.publisherOnlyCode, publisherOnlyCode: obj.publisherOnlyCode,
// shopOnlyCode: obj.shopOnlyCode, shopOnlyCode: obj.shopOnlyCode,
// serviceItem_code: obj.serviceItem_code, serviceItem_code: obj.serviceItem_code,
// channelCode: obj.channelCode, channelCode: obj.channelCode,
// chanceStatus: "1" chanceStatus: "1"
// } }
// var result = await this.businesschanceService.findchance(pobj); var result = await this.businesschanceService.findchance(pobj);
// if (result != "" && result != null) { if (result != "" && result != null) {
// return { code: "0", msg: "您已经发布需求,请不要重复提交" }; return { code: "0", msg: "您已经发布需求,请不要重复提交" };
// } }
// } }
try { try {
// var reqParams = { var reqParams = {
// notes: obj.notes, notes: obj.notes,
// publisherName: obj.publisherName, publisherName: obj.publisherName,
// publisherMobile: obj.publisherMobile, publisherMobile: obj.publisherMobile,
// channelCode: obj.channelCode, channelCode: obj.channelCode,
// serviceItem_code: obj.serviceItem_code, serviceItem_code: obj.serviceItem_code,
// serviceItem_name: serviceItem_name, serviceItem_name: serviceItem_name,
// publisherOnlyCode: obj.publisherOnlyCode, publisherOnlyCode: obj.publisherOnlyCode,
// shopOnlyCode: obj.shopOnlyCode, shopOnlyCode: obj.shopOnlyCode,
// chanceStatus: "1", chanceStatus: "1",
// chanceType: chanceType, chanceType: chanceType,
// channelProfitRatio: channelItem.profitType == 1 ? (channelItem.everySingleProfit || 0) : 0,//渠道分成比率(如:总额100,字段值30,则渠道的利润为30/100,剩下的则为平台利润) channelProfitRatio: channelItem.profitType == 1 ? (channelItem.everySingleProfit || 0) : 0,//渠道分成比率(如:总额100,字段值30,则渠道的利润为30/100,剩下的则为平台利润)
// channelProfit: channelItem.profitType == 2 ? (channelItem.everySingleProfit || 0) : 0,//渠道利润 channelProfit: channelItem.profitType == 2 ? (channelItem.everySingleProfit || 0) : 0,//渠道利润
// profitType: channelItem.profitType//渠道利润类型:1: "比例分成", 2: "每单分成" profitType: channelItem.profitType//渠道利润类型:1: "比例分成", 2: "每单分成"
// } }
// //新增的省份和城市 //新增的省份和城市
// var tCity = obj.city || ""; var tCity = obj.city || "";
// var tProvince = obj.province || ""; var tProvince = obj.province || "";
// if (tCity && tProvince) { if (tCity && tProvince) {
// reqParams.city = tCity; reqParams.city = tCity;
// reqParams.province = tProvince; reqParams.province = tProvince;
// } }
// // console.log(reqParams); // console.log(reqParams);
// var chance = await this.businesschanceService.create(reqParams); var chance = await this.businesschanceService.create(reqParams);
// if (obj.shopOnlyCode != null && obj.shopOnlyCode != "" && obj.shopOnlyCode != "undefined" && chance) { if (obj.shopOnlyCode != null && obj.shopOnlyCode != "" && obj.shopOnlyCode != "undefined" && chance) {
// var shopItem = await this.shopSve.getShopItem(obj.shopOnlyCode); var shopItem = await this.shopSve.getShopItem(obj.shopOnlyCode);
// if (shopItem != null && shopItem.userMobile != null && shopItem.userMobile != "" && shopItem.userMobile != "undefined") { if (shopItem != null && shopItem.userMobile != null && shopItem.userMobile != "" && shopItem.userMobile != "undefined") {
// //发送短信 //发送短信
// var smsClient = system.getObject("util.smsClient"); var smsClient = system.getObject("util.smsClient");
// smsClient.sendMsg(shopItem.userMobile, "亲,您的客户【" + obj.publisherName + "】于" + (new Date()).Format("yyyy-MM-dd") + "发布了关于【" + smsClient.sendMsg(shopItem.userMobile, "亲,您的客户【" + obj.publisherName + "】于" + (new Date()).Format("yyyy-MM-dd") + "发布了关于【" +
// serviceItem_name + "】求购需求,赶紧到知产合伙人小程序中【我的商机】进行查看!"); serviceItem_name + "】求购需求,赶紧到知产合伙人小程序中【我的商机】进行查看!");
// } }
// } }
var token = ""; var token = "";
var app = { var app = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment