|
@@ -8,32 +8,54 @@ CMD.runTask = async function(t_data,main_info,PlatformInfo,call_back){
|
|
|
let tg_link_config = JSON.parse(main_info.tg_link_config)
|
|
|
let chongzhi_id = tg_link_config['chongzhi_id']
|
|
|
let huichuan_id = tg_link_config['huichuan_id']
|
|
|
- let chongzhi_list = JSON.parse(PlatformInfo.chongzhi)
|
|
|
- let huichuan_list = JSON.parse(PlatformInfo.huichuan)
|
|
|
- let payment_template_id = ""
|
|
|
- let callback_rule_id = ""
|
|
|
+ // let chongzhi_list = JSON.parse(PlatformInfo.chongzhi)
|
|
|
+ // let huichuan_list = JSON.parse(PlatformInfo.huichuan)
|
|
|
+ let payment_template_id = chongzhi_id
|
|
|
+ let callback_rule_id = huichuan_id
|
|
|
|
|
|
- for (let index = 0; index < chongzhi_list.length; index++) {
|
|
|
- const cz_obj = chongzhi_list[index];
|
|
|
- if(cz_obj.id==chongzhi_id){
|
|
|
- payment_template_id = cz_obj.value
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (let index = 0; index < chongzhi_list.length; index++) {
|
|
|
+ // const cz_obj = chongzhi_list[index];
|
|
|
+ // if(cz_obj.id==chongzhi_id){
|
|
|
+ // payment_template_id = cz_obj.value
|
|
|
+ // break
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // for (let index = 0; index < huichuan_list.length; index++) {
|
|
|
+ // const hc_obj = huichuan_list[index];
|
|
|
+ // if(hc_obj.id==huichuan_id){
|
|
|
+ // callback_rule_id = hc_obj.value
|
|
|
+ // break
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ let body = {
|
|
|
|
|
|
- for (let index = 0; index < huichuan_list.length; index++) {
|
|
|
- const hc_obj = huichuan_list[index];
|
|
|
- if(hc_obj.id==huichuan_id){
|
|
|
- callback_rule_id = hc_obj.value
|
|
|
- break
|
|
|
- }
|
|
|
}
|
|
|
+
|
|
|
+ let free_word_num = 0
|
|
|
+ let unlock_word_num = 0
|
|
|
let member_token = main_info.member_token
|
|
|
let timestamp = helper.getCurrentUnixTimestamp()
|
|
|
- let postData = {
|
|
|
- "timestamp": `${timestamp}`,
|
|
|
- "app_id": config.zhihu_conifg.app_id,
|
|
|
- "data": {
|
|
|
+ if(main_info.pay_type==0){//mf
|
|
|
+ let zh_iaa_config = JSON.parse( main_info.zh_iaa_config)
|
|
|
+ free_word_num = zh_iaa_config.free_word_num
|
|
|
+ unlock_word_num = zh_iaa_config.unlock_word_num
|
|
|
+ body = {
|
|
|
+ "member_token": member_token,
|
|
|
+ "work_id": t_data.product_id,
|
|
|
+ "media_channel_type": 5,
|
|
|
+ "ad_link_name": `${t_data.product_name}_${main_info.id}`,
|
|
|
+ "app_id": main_info.app_id,
|
|
|
+ "callback_type": 0,
|
|
|
+ "callback_rule_id": callback_rule_id,
|
|
|
+ "num": 1,
|
|
|
+ "free_word_num":free_word_num,
|
|
|
+ "unlock_word_num":unlock_word_num,
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ body = {
|
|
|
"member_token": member_token,
|
|
|
"work_id": t_data.product_id,
|
|
|
"media_channel_type": 5,
|
|
@@ -45,6 +67,12 @@ CMD.runTask = async function(t_data,main_info,PlatformInfo,call_back){
|
|
|
"num": 1
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ let postData = {
|
|
|
+ "timestamp": `${timestamp}`,
|
|
|
+ "app_id": config.zhihu_conifg.app_id,
|
|
|
+ "data": body
|
|
|
+ }
|
|
|
let sign = tools.zh_sign(JSON.stringify(postData),config.zhihu_conifg.app_secret)
|
|
|
|
|
|
let client = tools.getOneNewClinet({
|