gitxsm преди 4 месеца
родител
ревизия
d9b170c73b

+ 2 - 0
script/common/Lang.lua

@@ -586,6 +586,8 @@ YUNYING_BUY_ERR_CNT = [[剩余购买次数不足]]
 YUNYING_BUY_ERR_VIP = [[VIP等级不足]]
 YUNYING_BUY_ERR_HAD = [[已购买]]
 
+MONEYTREE_START = [[请先开始游戏]]
+
 MONEYTREE_IS_MAX = [[篮子已撑破, 不能再获得奖励了]]
 
 QQAPI_ERR_TIMEOUT = [[登录状态超时,请刷新游戏后再次尝试]]

+ 1 - 0
script/common/LogDefine.lua

@@ -319,6 +319,7 @@ DEFINE = {
 	ServerCommerceActBattleGround 	= 779,  -- 巅峰战场
 	HeroTianYuan 			= 780,  		-- 英雄天元系统
 	BreakThroughTheme 		= 781,  		-- 闯关主题
+	VoucherInvest 			= 782,  		-- 代金券投资
 
 	errHandle				= 99999,		-- 异常处理
 }

+ 6 - 0
script/common/ProtoID.lua

@@ -1776,6 +1776,12 @@ _ENV[1817]="CG_ABS_COMONACT_MONEYTREE_LOTTERY"
 _ENV[1818]="GC_ABS_COMONACT_MONEYTREE_LOTTERY"
 _ENV[1819]="CG_ABS_COMONACT_MONEYTREE_GET_REWARD"
 
+_ENV[1820]="CG_VOUCHER_INVEST_QUERY"
+_ENV[1821]="GC_VOUCHER_INVEST_QUERY"
+_ENV[1822]="CG_VOUCHER_INVEST_GET"
+_ENV[1823]="CG_ABS_COMONACT_MONEYTREE_LOTTERY_STAGE"
+
+
 _ENV[1896]="CG_ZHUANPAN_SUBSCRIBE_REWARD_QUERY"
 _ENV[1897]="GC_ZHUANPAN_SUBSCRIBE_REWARD_QUERY"
 _ENV[1898]="CG_ZHUANPAN_SUBSCRIBE_REWARD_GET"

+ 4 - 0
script/core/ObjHuman.lua

@@ -112,6 +112,7 @@ local Json = require("common.Json")
 local UnionLogic
 local GodsAreaNS
 local DataCache
+local VoucherInvest
 
 
 fds				= fds or {}				-- fd->obj_id,包括创角中+游戏中
@@ -398,6 +399,9 @@ function sendAttr(human,key)
 
 	if key == RoleDefine.ZHANDOULI then
 		TriggerLogic.PublishEvent(TriggerDefine.ZHANDOULI, human.db._id, human.attr[key])
+
+		VoucherInvest = VoucherInvest or require("voucher.VoucherInvest")
+		VoucherInvest.PowerUpdate(human)
 	end
 end
 

+ 28 - 9
script/module/absAct/CommonActLoginGift.lua

@@ -78,8 +78,14 @@ local function getAwardState(human, giftType, dayIdx)
         isBuy = false
     end
 
-    if isBuy and diffDays >= dayIdx and nowGiftTypeGetRecord[dayIdx] then
-        state = CommonDefine.COMMON_PRIZE_STATE_GET
+    if isBuy then
+        if diffDays < dayIdx then
+            state = CommonDefine.COMMON_PRIZE_STATE_NOGET
+        else
+            if nowGiftTypeGetRecord[dayIdx] then
+                state = CommonDefine.COMMON_PRIZE_STATE_GET
+            end
+        end
     end
 
     return state
@@ -87,6 +93,11 @@ end
 
 -- 检查是否有可领取的奖励
 local function isCanGet(human)
+    local actData = getActData(human)
+    if not actData then
+        return false
+    end
+
     local type_2_cfg = transformCfg()
 
     for giftType, giftCfgArr in pairs(type_2_cfg) do
@@ -122,7 +133,7 @@ end
 
 
 
-function isRed(human, funcConfig)
+function isRed(human, YYInfo, funcConfig)
     local state = isOpenAct(human, funcConfig and funcConfig.funcID)
     if not state then
         return false
@@ -139,7 +150,11 @@ function isActive(human, YYInfo, funcConfig)
     return not isOpen(human, YYInfo, funcConfig)
 end
 
-function onCharge(human, price, funcID, buyID, buyNum)
+function onCharge(human, nBuyID, buyNum)
+    if not isOpenAct(human, COMMONACT_LOGINGIFT_ID) then
+        return
+    end
+
     local actData = getActData(human)
     local buyGiftType = actData and actData.buyGiftType
     if buyGiftType then
@@ -150,7 +165,7 @@ function onCharge(human, price, funcID, buyID, buyNum)
 
     for giftType, giftCfgArr in pairs(type_2_cfg) do
         local singleCfg = giftCfgArr[1]
-        if singleCfg.buyId == buyID then
+        if singleCfg.buyId == nBuyID then
             updateBuyGiftType(human, giftType)
             updateRedDot(human)
             CommonActLoginGift_Query(human)
@@ -180,6 +195,10 @@ function CommonActLoginGift_Query(human)
     msgRet.giftData648[0] = 0
     msgRet.isEnd = 0
     msgRet.isStart = 1
+    msgRet.buyGiftType = 0
+
+    local actData = getActData(human)
+    msgRet.buyGiftType = actData and actData.buyGiftType or 0
 
     local len, msgOnceLen = 0, 5
     local type_2_cfg = transformCfg()
@@ -194,22 +213,22 @@ function CommonActLoginGift_Query(human)
             populateGiftMsg(human, msgRet.giftDatafree[len], type_2_cfg[1][i], 1)
         end
 
-        if type_2_cfg[2] then
+        if type_2_cfg[2] and type_2_cfg[2][i] then
             msgRet.giftData68[0] = len
             populateGiftMsg(human, msgRet.giftData68[len], type_2_cfg[2][i], 2)
         end
 
-        if type_2_cfg[3] then
+        if type_2_cfg[3] and type_2_cfg[3][i] then
             msgRet.giftData128[0] = len
             populateGiftMsg(human, msgRet.giftData128[len], type_2_cfg[3][i], 3)
         end
 
-        if type_2_cfg[4] then
+        if type_2_cfg[4] and type_2_cfg[4][i] then
             msgRet.giftData328[0] = len
             populateGiftMsg(human, msgRet.giftData328[len], type_2_cfg[4][i], 4)
         end
 
-        if type_2_cfg[5] then
+        if type_2_cfg[5] and type_2_cfg[5][i] then
             msgRet.giftData648[0] = len
             populateGiftMsg(human, msgRet.giftData648[len], type_2_cfg[5][i], 5)
         end

+ 81 - 15
script/module/absAct/CommonActMoneyTree.lua

@@ -5,6 +5,8 @@
         basketItemArr = nil, --篮子里的道具idx列表
 
         lotteryTimes = nil, -- 抽奖次数
+
+        nowStage = 0, -- 当前阶段, 0-未开始阶段, 1-抽奖阶段
     }   
 ]=]--
 
@@ -21,7 +23,7 @@ local AbsActExcel = require("excel.absAct")
 
 local LOGTYPE = "CommonActMoneyTree" -- 日志标识
 local COMMONACT_MONEYTREE_ID = 7506  -- 活动Id
-local BASKET_WEIGHT = 100           -- 篮子可承受的总重量
+local BASKET_WEIGHT_MAX = 150           -- 篮子可承受的总重量
 
 
 local function getData(human)
@@ -49,6 +51,12 @@ local function resetBasketArr(human)
     actData.basketItemArr = nil
 end
 
+local function updateStage(human, newStage)
+    local actData = getData(human)
+    actData.nowStage = newStage
+end
+
+
 
 
 local function isOpenAct(human, funcID)
@@ -111,13 +119,17 @@ end
 
 
 
-function isRed(human, funcConfig)
+function isRed(human, YYInfo, funcConfig)
     local state = isOpenAct(human, funcConfig and funcConfig.funcID)
     if not state then
         return false
     end
 
     local actData = getData(human)
+    if (actData.nowStage or 0) == 1 then
+        return true
+    end
+
     if (actData.lotteryTimes or 0) > 0 then
         return true
     end
@@ -144,11 +156,20 @@ function CompleteHuoYueTask(human)
     updateRedDot(human)
 end
 
+function genAbsActData()
+    return {lotteryTimes = 1}
+end
+
 function updateDaily(human, funcID)
     if not isOpenAct(human, funcID) then
         return
     end
 
+    local actData = getData(human)
+    if not actData then
+        return
+    end
+
     updateLotteryTimes(human, 1)
 
     updateRedDot(human)
@@ -160,11 +181,12 @@ end
 function CommonActMoneyTree_Query(human)
     local msgRet = Msg.gc.GC_ABS_COMONACT_MONEYTREE_QUERY
     msgRet.rewardBasket[0] = 0
-    msgRet.weighMax = BASKET_WEIGHT
+    msgRet.weighMax = BASKET_WEIGHT_MAX
     msgRet.weighNow = 0
     msgRet.lotteryTimes = 0
     msgRet.isStart = 1
     msgRet.isEnd = 0
+    msgRet.nowStage = 0
 
     local actData = getData(human)
 
@@ -176,8 +198,13 @@ function CommonActMoneyTree_Query(human)
         msgRet.weighNow = calcBasketWeight(actData.basketItemArr)
     end
 
+    if actData.nowStage then
+        msgRet.nowStage = actData.nowStage
+    end
+
     local itemNum = actData.basketItemArr and #actData.basketItemArr or 0
     if itemNum == 0 then
+        msgRet.isEnd = 1
         return Msg.send(msgRet, human.fd)
     end
 
@@ -209,8 +236,8 @@ function CommonActMoneyTree_Query(human)
     end
 end
 
--- 抽奖
-function CommonActMoneyTree_Lottery(human)
+-- 进入抽奖阶段
+function CommonActMoneyTree_EnterLotteryStage(human)
     if not isOpenAct(human, COMMONACT_MONEYTREE_ID) then
         return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
     end
@@ -220,34 +247,51 @@ function CommonActMoneyTree_Lottery(human)
         return Broadcast.sendErr(human, Lang.JINBI_EXCHANGE_ERR_CNT)
     end
 
+    -- 扣除次数
+    updateLotteryTimes(human, -1)
+
+    -- 更新阶段
+    updateStage(human, 1)
+
+    -- 推送最新数据给客户端
+    CommonActMoneyTree_Query(human)
+end
+
+-- 抽一次奖
+function CommonActMoneyTree_Lottery(human)
+    if not isOpenAct(human, COMMONACT_MONEYTREE_ID) then
+        return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
+    end
+
+    local actData = getData(human)
+    if (actData.nowStage or 0) ~= 1 then
+        return Broadcast.sendErr(human, Lang.MONEYTREE_START)
+    end
+
     if actData.basketItemArr then
         local weightNow = calcBasketWeight(actData.basketItemArr)
-        if weightNow > BASKET_WEIGHT then
+        if weightNow > BASKET_WEIGHT_MAX then
             return Broadcast.sendErr(human, Lang.MONEYTREE_IS_MAX)
         end
     end
 
     -- 扣除次数
-    updateLotteryTimes(human, -1)
+    -- updateLotteryTimes(human, -1)
 
     local finalIdx = lottery()
     if finalIdx == 0 then
         return Broadcast.sendErr(human, Lang.COMMON_COMFIG_ERROR)
     end
 
-    -- 检查当前篮子中道具重量是否超过限定重量, 如果超过则当前篮子中每个道具都有50%几率失去
+    -- 把道具加入篮子
     insertBasketItemArr(human, finalIdx)
-    local weightNow = calcBasketWeight(actData.basketItemArr)
-    if weightNow > BASKET_WEIGHT then
-        local newBasketItemArr = randBasketItem(actData.basketItemArr)
-        updateBasketItemArr(human, newBasketItemArr)
-        CommonActMoneyTree_Query(human)
-    end
 
     local msgRet = Msg.gc.GC_ABS_COMONACT_MONEYTREE_LOTTERY
     local itemCfg = MoneyTreeConfig[finalIdx]
     Grid.makeItem(msgRet.reward, itemCfg.reward[1], itemCfg.reward[2])
     Msg.send(msgRet, human.fd)
+
+    CommonActMoneyTree_Query(human)
 end
 
 -- 领取奖励
@@ -258,12 +302,27 @@ function CommonActMoneyTree_GetReward(human)
 
     local actData = getData(human)
 
+    if (actData.nowStage or 0) ~= 1 then
+        return Broadcast.sendErr(human, Lang.MONEYTREE_START)
+    end
+
     if not actData.basketItemArr or not next(actData.basketItemArr) then
         return Broadcast.sendErr(human, Lang.SHARE_GROUP_GET_ERR_CNT)
     end
 
+
+    -- 检查当前篮子中道具重量是否超过限定重量, 如果超过则当前篮子中每个道具都有50%几率失去
+    local itemArr = actData.basketItemArr
+    local weightNow = calcBasketWeight(itemArr)
+    if weightNow > BASKET_WEIGHT_MAX then
+        itemArr = randBasketItem(itemArr)
+        -- updateBasketItemArr(human, newBasketItemArr)
+        -- CommonActMoneyTree_Query(human)
+    end
+
+
     local itemList = {}
-    for _, itemCfgIdx in ipairs(actData.basketItemArr) do
+    for _, itemCfgIdx in ipairs(itemArr) do
         local itemCfg = MoneyTreeConfig[itemCfgIdx].reward
         local itemId, itemNum = itemCfg[1], itemCfg[2]
         itemList[itemId] = (itemList[itemId] or 0) + itemNum
@@ -272,8 +331,15 @@ function CommonActMoneyTree_GetReward(human)
     -- 重置篮子中道具数据
     resetBasketArr(human)
 
+    -- 更新阶段
+    updateStage(human, 0)
+
     -- 发放道具
     BagLogic.addItemList(human, itemList, LOGTYPE)
 
+    -- 推送最新数据给客户端
     CommonActMoneyTree_Query(human)
+
+    -- 刷新红点
+    updateRedDot(human)
 end

+ 5 - 1
script/module/absAct/Handler.lua

@@ -524,7 +524,7 @@ end
 ----------------------------------------------------通用节日活动 — 摇钱树 --------------------------------------------------
 
 function CG_ABS_COMONACT_MONEYTREE_QUERY(human, msg)
-    CommonActMoneyTree.CommonActLoginGift_Query(human)
+    CommonActMoneyTree.CommonActMoneyTree_Query(human)
 end
 
 function CG_ABS_COMONACT_MONEYTREE_LOTTERY(human, msg)
@@ -533,4 +533,8 @@ end
 
 function CG_ABS_COMONACT_MONEYTREE_GET_REWARD(human, msg)
     CommonActMoneyTree.CommonActMoneyTree_GetReward(human)
+end
+
+function CG_ABS_COMONACT_MONEYTREE_LOTTERY_STAGE(human, msg)
+    CommonActMoneyTree.CommonActMoneyTree_EnterLotteryStage(human)
 end

+ 6 - 1
script/module/absAct/Proto.lua

@@ -1659,6 +1659,7 @@ GC_ABS_COMONACT_LOGINGIFT_QUERY = {
     {"giftData648",     5,     COMONACT_LOGINGIFT_INFO},      -- 奖励信息
     {"isEnd",           1,      "byte"},                      -- 是否发完数据, 0-否, 1-是
     {"isStart",         1,      "byte"},                      -- 是否是第一段数据, 0-否, 1-是
+    {"buyGiftType",     1,      "byte"},                      -- 当前已购买礼包类型, 0-没有购买过,2-68礼包, 3-128礼包, 4-328礼包, 5-648礼包
 }
 
 -- 领奖
@@ -1678,6 +1679,7 @@ GC_ABS_COMONACT_MONEYTREE_QUERY = {
     {"lotteryTimes",        1,      "short"},        -- 可抽取次数
     {"isStart",             1,      "byte"},         -- 是否是第一段数据, 0-否, 1-是
     {"isEnd",               1,      "byte"},         -- 是否发完数据, 0-否, 1-是
+    {"nowStage",            1,      "byte"},         -- 阶段, 0-开始阶段, 1-摇树阶段
 }
 
 -- 抽奖
@@ -1687,4 +1689,7 @@ GC_ABS_COMONACT_MONEYTREE_LOTTERY = {
 }
 
 -- 领奖
-CG_ABS_COMONACT_MONEYTREE_GET_REWARD = {}
+CG_ABS_COMONACT_MONEYTREE_GET_REWARD = {}
+
+-- 进入摇树阶段
+CG_ABS_COMONACT_MONEYTREE_LOTTERY_STAGE = {}

+ 28 - 1
script/module/bag/Proto.lua

@@ -1,4 +1,5 @@
 local Attr = require("role.Proto").Attr
+local BuyItem = require("topup.Proto").BuyItem
 
 -- 碎片
 SuiPian = {
@@ -313,10 +314,36 @@ GC_SUIPIAN_SYNTHESIS = {
 	{"status",1,"int"}, --碎片一键合成结果通知刷新 0:合成成功 1:合成失败
 }
 
+
+Skin_Info = {
+	{"Id", 				1,		"int"},
+	{"attrs", 			5,		Attr},
+}
+
+Skin_Show_Info = {
+	{"id", 				1,		"int"},
+	{"desc", 			1,		"string"},
+	{"keepTime", 		1,		"int"},
+	{"name", 			1,		"string"},
+	{"camp", 			1,		"int"},
+	{"attrs", 			5,		Attr},
+}
+
+SkinBuyData = {
+	{"id", 				1,		"int"},
+	{"buyItem", 		1,		BuyItem},
+	{"skinData", 		1,		Skin_Info},
+	{"Iconframe", 		1,		Skin_Show_Info},
+}
+
+
 -- 发送合成道具对应的皮肤信息
 GC_ITEM_SKIN_INFO = {
 	{"nItemID", 1,	"int"},
-	{"data",	1,	"string"}
+	-- {"data",	1,	"string"}
+	{"data",	10,	SkinBuyData},
+	{"isEnd",	1,	"byte"},      -- 0-否,1-是
+	{"isStart",	1,	"byte"},      -- 0-否,1-是
 }
 
 -- 选择对应的皮肤

+ 1 - 1
script/module/combat/BeSkill.lua

@@ -1825,7 +1825,7 @@ function getExtraHurtRate(attacker,defender,skillConfig)
 					local condStatusList = condCfg[2] or {}
 					local objNowSatus = CombatBuff.getStatus(defender)
 
-					for buffCmd in pairs(condStatusList) do
+					for _, buffCmd in pairs(condStatusList) do
 						if objNowSatus[buffCmd] then
 							buffAndHPSubHurt = condCfg[3] or 0
 							break

+ 18 - 2
script/module/combat/CombatBuff.lua

@@ -35,7 +35,7 @@ end
 --和血量相关的作用
 local function isHpCmd(cmd)
 	if cmd == "hp" or cmd == "hurt" or cmd == "hurt1" or cmd == "liuxue" or cmd == "liuxue2" or cmd == "liuxue3"
-		or cmd == "zhongdu" or cmd == "ranshao" or cmd == "ranshao1" or cmd == "huiheYinji" then
+		or cmd == "liuxue4" or cmd == "zhongdu" or cmd == "ranshao" or cmd == "ranshao1" or cmd == "huiheYinji" then
 		return true
 	end
 	return false
@@ -234,6 +234,7 @@ CMD2KEY = {
 	["liuxue"] = RoleDefine.STATUS_MIANYI_RATE6,
 	["liuxue2"] = RoleDefine.STATUS_MIANYI_RATE6,
 	["liuxue3"] = RoleDefine.STATUS_MIANYI_RATE6,
+	["liuxue4"] = RoleDefine.STATUS_MIANYI_RATE6,
 	["zhongdu"] = RoleDefine.STATUS_MIANYI_RATE7,
     ["hunluan"] = RoleDefine.STATUS_MIANYI_RATE9,
 	["xuanyun2"] = RoleDefine.STATUS_MIANYI_RATE1,
@@ -2197,6 +2198,21 @@ function BuffHandleAfterSkill(obj)
 		handle2.liuxue3(obj, buffer)
 		CombatImpl.addFrameBuffer(obj,buffer,CombatDefine.BUFFER_OP_HOLD)
 	end
+
+	-- 火毒 buff 处理
+	if obj.buffer then
+		local targetBuffCmd = "liuxue4"
+		for j = obj.buffer[0], 1, -1 do
+			local buffer = obj.buffer[j]
+			local conf = GetBuffConfig(buffer.id)
+			local cmd = conf.cmd
+			if cmd == targetBuffCmd then
+				handle2.liuxue3(obj, buffer)
+				CombatImpl.addFrameBuffer(obj,buffer,CombatDefine.BUFFER_OP_HOLD)
+			end
+		end
+	end
+
 end
 
 -- 通过 xishou buff吸收伤害回血
@@ -2226,7 +2242,7 @@ function qingsuan(target)
 		local conf = GetBuffConfig(buffer.id)
 		local cmd = conf.cmd
 		if cmd == "ranshao" or cmd == "ranshao1" or cmd == "liuxue"or cmd == "liuxue2" or cmd == "liuxue3"
-			or cmd == "zhongdu" or cmd == "hurt" or cmd == "hurt1" then
+			or cmd == "liuxue4" or cmd == "zhongdu" or cmd == "hurt" or cmd == "hurt1" then
 			round = 1
 			if buffer.round and buffer.round > 0 then
 				round = buffer.round

+ 9 - 0
script/module/combat/CombatCalc.lua

@@ -944,6 +944,15 @@ function calcHp(attacker, defender, calcType, rate, isAddHp, flag)
         -- 当前攻击者攻击力百分比
         local atk = CombatObj.getValue(attacker, RoleDefine.ATK)
         hp = atk * rate
+
+    elseif calcType == 27 then
+        -- 目标当前生命百分比,不超过攻击者攻击力的5倍
+        local atk = CombatObj.getValue(attacker, RoleDefine.ATK)
+        local nMaxHp = atk * 5
+        hp = defender.hp * rate
+        if hp > nMaxHp then
+            hp = nMaxHp
+        end
     end
 
     if not NO_EXCALC_LIST[calcType] then

+ 17 - 3
script/module/combat/CombatObj.lua

@@ -446,8 +446,22 @@ function updateHp(obj, value,isRevive,delayCB, attackPos,type)
 	end
 
 
+	-- 判断伤害能否被抵消
+	local isOffset = false
+	if value < 0 and (type == SKILL_HP_TYPE or type == EXTRA_HP_TYPE) then -- 是扣血, 并且来自技能本身或技能特殊效果
+		targetBuffCMD = "jiahu"
+		if CombatBuff.isStatus(obj, {targetBuffCMD} ) then
+			extraHandle = extraHandle or {}
+			extraHandle[1] = 2
+			extraHandle[2] = targetBuffCMD
+			isOffset = true
+		end
+	end
+
+
+
 	-- 护盾值检测
-	if value < 0 and not isAbsorb then
+	if value < 0 and (not isAbsorb and not isOffset) then
 		local huDunValue = CombatBuff.getBuffHuDun(obj)
 		if huDunValue > 0 then
 			if huDunValue >= (-value) then
@@ -477,7 +491,7 @@ function updateHp(obj, value,isRevive,delayCB, attackPos,type)
 	end
 
 
-	if isAbsorb then
+	if isAbsorb or isOffset then
 		extraHandle[3] = d
 		d = 0
 
@@ -490,7 +504,7 @@ function updateHp(obj, value,isRevive,delayCB, attackPos,type)
 		sum = 0
 	end
 	local ret = beforeUpdateHp(obj, sum, value, d)
-	if ret and not isAbsorb then
+	if ret and (not isAbsorb and not isOffset) then
 		obj.hp = sum
 	end
 

+ 2 - 0
script/module/combat/Skill.lua

@@ -107,6 +107,8 @@ function ExtraHandle(obj, args)
 	local hanleType = args[1]
 	if hanleType == 1 then
 		CombatBuff.AddHPByXishouBuff(obj, args[2], -args[3])
+	elseif hanleType == 2 then
+		CombatBuff.DelBuffByCmd(obj, args[2], 1)
 	end
 end
 

+ 6 - 1
script/module/combat/TargetMode.lua

@@ -676,8 +676,13 @@ local function handler29(attacker,targetMode)
 			table.insert(targetList,obj)
 		end
 	end
+
+	if #targetList <= 0 then
+		return
+	end
+
 	local cntMap = {}
-	for i = 0,cnt do 
+	for i = 1,cnt do 
 		local obj = table.shuffle(targetList)[#targetList]
 		local objPos = obj.pos
 		cntMap[objPos] = cntMap[objPos] or 0

+ 11 - 6
script/module/dailyTask/DailyTaskLogic.lua

@@ -332,6 +332,11 @@ function CG_DAILYTASK_GET_HUOYUEBOX(human,boxID)
 			msgRet.boxID = boxId
 			msgRet.double = double and 1 or 0
 			Msg.send(msgRet,human.fd)
+
+			if boxId == #boxConfig then
+				CommonActMoneyTree = CommonActMoneyTree or require("absAct.CommonActMoneyTree")
+				CommonActMoneyTree.CompleteHuoYueTask(human)
+			end
 		end
 	end
 
@@ -376,12 +381,12 @@ function onDailyTaskHuoYue(human,sum)
 
     YunYingLogic.onCallBack(human, "onDailyTask",sum)
 
-	local finallyIdx = #DailyTaskExcel.huoYueBox
-	local finallyCfg = DailyTaskExcel.huoYueBox[finallyIdx]
-	if human.db.dailyTask.nowHuoYue >= finallyCfg.needHuoYue then
-		CommonActMoneyTree = CommonActMoneyTree or require("absAct.CommonActMoneyTree")
-		CommonActMoneyTree.CompleteHuoYueTask(human)
-	end
+	-- local finallyIdx = #DailyTaskExcel.huoYueBox
+	-- local finallyCfg = DailyTaskExcel.huoYueBox[finallyIdx]
+	-- if human.db.dailyTask.nowHuoYue >= finallyCfg.needHuoYue then
+	-- 	CommonActMoneyTree = CommonActMoneyTree or require("absAct.CommonActMoneyTree")
+	-- 	CommonActMoneyTree.CompleteHuoYueTask(human)
+	-- end
 end
 
 function onLogin(human)	

+ 1 - 1
script/module/hero/HeroSeed.lua

@@ -14,7 +14,7 @@ local TalismanLogic = require("talisman.TalismanLogic")
 local GiftLogic
 
 local LOGTAG = "HeroSeed" --日志标识
-local HAVE_SEED_HERO_MIN_STAR = 10 --英雄获得种子的最低星级要求
+local HAVE_SEED_HERO_MIN_STAR = 9 --英雄获得种子的最低星级要求
 
 
 -- 获取来自秘宝的属性倍数加成

+ 85 - 9
script/module/present/HeroSkinLogic.lua

@@ -87,6 +87,36 @@ local function populateMsg(human, net, id)
 end
 
 
+local function populateMsg2(human, net, id)
+    local cfg = HeroSkinExcel[id]
+    local skinId = cfg.content[1]
+    local skinCfg = SkinExcel[skinId]
+
+    net.id = id
+    BuyLogic.fontBuyItem(human, net.buyItem, cfg.buyId)
+    net.skinData.Id = skinId
+    net.skinData.attrs[0] = #skinCfg.attrs
+    for i, v in ipairs(skinCfg.attrs) do
+        net.skinData.attrs[i].key = v[1]
+        net.skinData.attrs[i].value = v[2]
+    end
+
+    local iconframeId = cfg.content[2]
+    local iconframeCfg = HeadFrameExcel[iconframeId]
+
+    net.Iconframe.id = iconframeId
+    net.Iconframe.desc = iconframeCfg.desc or ""
+    net.Iconframe.keepTime = iconframeCfg.keepTime or 0
+    net.Iconframe.name = iconframeCfg.name or ""
+    net.Iconframe.camp = iconframeCfg.camp or 0
+    net.Iconframe.attrs[0] = #iconframeCfg.attrs
+
+    for i, v in ipairs(iconframeCfg.attrs) do
+        net.Iconframe.attrs[i].key = v[1]
+        net.Iconframe.attrs[i].value = v[2]
+    end
+end
+
 
 -----------------------------------------
 
@@ -192,7 +222,36 @@ function SendSkinInfoByMoney(human, nMoney, nItemID)
         return
     end
 
-    local ret = {}
+    -- local ret = {}
+    -- for id,cfg in pairs(HeroSkinExcel) do
+    --     local nBuyID = cfg.buyId
+    --     local tBuyCfg = BuyExcel[nBuyID]
+    --     if tBuyCfg then
+    --         local region = human.region or "CN"
+    --         local nTrueMoney = tBuyCfg[region]
+    --         if nMoney == nTrueMoney then
+    --             ret[#ret+1] = genSkinUnit(human,id)
+    --         end
+    --     end
+    -- end
+
+    -- local data = {
+    --     list = ret
+    -- }
+    -- local msgRet = Msg.gc.GC_ITEM_SKIN_INFO
+    -- msgRet.nItemID = nItemID
+    -- msgRet.data = Json.Encode(data)
+
+    -- Msg.send(msgRet,human.fd)
+
+
+    local msgRet = Msg.gc.GC_ITEM_SKIN_INFO
+    msgRet.nItemID = nItemID
+    msgRet.data[0] = 0
+    msgRet.isEnd = 0
+    msgRet.isStart = 1
+
+    local skinArr = {}
     for id,cfg in pairs(HeroSkinExcel) do
         local nBuyID = cfg.buyId
         local tBuyCfg = BuyExcel[nBuyID]
@@ -200,19 +259,36 @@ function SendSkinInfoByMoney(human, nMoney, nItemID)
             local region = human.region or "CN"
             local nTrueMoney = tBuyCfg[region]
             if nMoney == nTrueMoney then
-                ret[#ret+1] = genSkinUnit(human,id)
+                skinArr[#skinArr+1] = id
             end
         end
     end
 
-    local data = {
-        list = ret
-    }
-    local msgRet = Msg.gc.GC_ITEM_SKIN_INFO
-    msgRet.nItemID = nItemID
-    msgRet.data = Json.Encode(data)
+    local skinNum = #skinArr
+    local len, msgOneceLen = 0, 10
 
-    Msg.send(msgRet,human.fd)
+    for _, skinId in ipairs(skinArr) do
+        len = len + 1
+        msgRet.data[0] = len
+        populateMsg2(human, msgRet.data[len], skinId)
+
+        if len >= msgOneceLen then
+            skinNum = skinNum - len
+            if skinNum <= 0 then
+                msgRet.isEnd = 1
+                return Msg.send(msgRet,human.fd)
+            end
+
+            Msg.send(msgRet,human.fd)
+            len = 0
+            msgRet.isStart = 0
+        end
+    end
+
+    if len > 0 then
+        msgRet.isEnd = 1
+        Msg.send(msgRet,human.fd)
+    end
 end
 
 function BuySkinBySuiPian(human, nSkinID, nItemID)

+ 29 - 2
script/module/topup/BuyLogic.lua

@@ -49,6 +49,8 @@ local OneKillGiftLogic = require("present.OneKillGift")
 local OpenServerGiftPackage = require("present.OpenServerGiftPackage")
 local CommonDefine = require("common.CommonDefine")
 local ZhuanpanGift = require("zhuanpan.ZhuanpanGift")
+local VoucherInvest = require("voucher.VoucherInvest")
+local CommonActLoginGift = require("absAct.CommonActLoginGift")
 
 BUY_CODE_NORMAL = 0   -- 正常调平台的充值接口
 BUY_CODE_WX_KEFU = 1  -- 微信小程序客服充值接口
@@ -363,9 +365,21 @@ end
 
 function cmd.zhuanpanGift(human, buyConf, isFirst, buyCnt, buyNum)
 	local nBuyID = buyConf.id
-	ZhuanpanGift.onCharge(human, nBuyID, buyNum)
+	VoucherInvest.onCharge(human, nBuyID, buyNum)
 end
 
+
+function cmd.VoucherInvest(human, buyConf, isFirst, buyCnt, buyNum)
+	local nBuyID = buyConf.id
+	VoucherInvest.onCharge(human, nBuyID, buyNum)
+end
+
+function cmd.CommonActLoginGift(human, buyConf, isFirst, buyCnt, buyNum)
+	local nBuyID = buyConf.id
+	CommonActLoginGift.onCharge(human, nBuyID, buyNum)
+end
+
+
 -------------------------------- cmd结束 ----------------------------------
 
 function checkBuy(human, ret)
@@ -462,11 +476,24 @@ function buy(human, arg, nolog)
 end
 
 
+-- 临时处理,不加入累充的购买项
+local notAddTopupList = {
+	[90501] = true,
+	[90502] = true,
+	[90503] = true,
+	[90504] = true,
+	[90511] = true,
+	[90512] = true,
+	[90513] = true,
+	[90514] = true,
+}
+
+
 function afterCharge(human,oJsonInput, buyID, buyConf, buyNum)
 	--local price = oJsonInput.topupMoney
 	local buyConf = BuyExcel[buyID]
 	local price = oJsonInput.price or buyConf.CN
-	if price and price > 0 and buyConf.cmd ~= "voucherbuy" then
+	if price and price > 0 and buyConf.cmd ~= "voucherbuy" and not notAddTopupList[buyID] then
 		TopupLogic.clacTopupAcount(human, price, buyID, buyNum)
 		
 		local msgRet = Msg.gc.GC_NOTICE_DADIAN

+ 14 - 0
script/module/voucher/Handler.lua

@@ -7,6 +7,8 @@
 
 local voucherShopLogic = require("voucher.VoucherShopLogic")
 
+local VoucherInvest = require("voucher.VoucherInvest")
+
 -- 请求代金券商店信息
 function CG_VOUCHER_QUERY_SHOP(human, msg)
     voucherShopLogic.VoucherShop_QueryShop(human)
@@ -20,4 +22,16 @@ end
 -- 请求代金券购买商品
 function CG_VOUCHER_BUY_ITEM(human, msg)
     voucherShopLogic.VoucherShop_BuyItem(human, msg.nBuyID, msg.nBuyNum)
+end
+
+
+
+
+
+function CG_VOUCHER_INVEST_QUERY(human, msg)
+    VoucherInvest.VoucherInvest_Query(human)
+end
+
+function CG_VOUCHER_INVEST_GET(human, msg)
+    VoucherInvest.VoucherInvest_Get(human)
 end

+ 22 - 1
script/module/voucher/Proto.lua

@@ -47,4 +47,25 @@ CG_VOUCHER_BUY_ITEM =
     {"nBuyNum",                 1,          "byte"},    -- 购买次数
 }
 
--- 无回包
+-- 无回包
+
+---------------------------------------代金券投资---------------------------
+
+VOUCHER_INVEST_AWARD_INFO = {
+    {"item",                 1,          ItemData},     -- 代金券
+    {"state",                1,           "byte"},      -- 0-不可领,1-可领, 2-已领
+    {"needPower",            1,           "double"},    -- 需要的战力
+}
+
+-- 查询
+CG_VOUCHER_INVEST_QUERY = {}
+GC_VOUCHER_INVEST_QUERY = {
+    {"buyItem",           1,          BuyItem},   -- 购买物品信息
+    {"isBuy",             1,           "byte"},   -- 是否购买(0:未购买,1:已购买)
+    {"awardArr",          15,          VOUCHER_INVEST_AWARD_INFO},   -- 物品信息
+    {"isEnd",             1,           "byte"},   -- 是否发完(0:没有,1:发完)
+    {"isStart",           1,           "byte"},   -- 是否是第一段数据(0:不是,1:是)
+}
+
+-- 领取奖励
+CG_VOUCHER_INVEST_GET = {}

+ 325 - 0
script/module/voucher/VoucherInvest.lua

@@ -0,0 +1,325 @@
+-- 代金券投资
+-- db
+--[=[
+    human.db.voucherInvestData = {
+        getRecord = { -- 领取记录数组, 初始为nil
+            idx1,
+            idx2,
+        }
+        isBuy = nil, 是否已经充值, 充值成功后为true
+        nowRound = nil, 当前轮数, 默认为1
+    }
+]=]--
+
+local Util = require("common.Util")
+local Lang = require("common.Lang")
+local Broadcast = require("broadcast.Broadcast")
+local Msg = require("core.Msg")
+local Grid = require("bag.Grid")
+local BagLogic = require("bag.BagLogic")
+local BuyLogic = require("topup.BuyLogic")
+local YunYingLogic = require("yunying.YunYingLogic")
+local voucherInvestConfig = require("excel.VoucherInvest").Sheet1
+local CommonDefine = require("common.CommonDefine")
+local YunYingExcel = require("excel.yunying")
+
+
+local LOGTYPE = "VoucherInvest" -- 日志标识
+local ACT_ID = 8203 -- 活动Id
+local VOUCHERSHOP_ACTID = 27
+
+
+local function initData(human)
+    human.db.voucherInvestData = {
+        nowRound = 1,
+        isBuy = false,
+    }
+end
+
+local function getData(human)
+    if not human.db.voucherInvestData then
+        initData(human)
+    end
+    return human.db.voucherInvestData
+end
+
+local function updateBuyState(human, buyState)
+    local voucherInvestData = getData(human)
+    voucherInvestData.isBuy = buyState
+end
+
+local function updateGetRecord(human, idx)
+    local voucherInvestData = getData(human)
+    voucherInvestData.getRecord = voucherInvestData.getRecord or {}
+    table.insert(voucherInvestData.getRecord, idx)
+end
+
+local function resetData(human, newRound)
+    local voucherInvestData = getData(human)
+    voucherInvestData.nowRound = newRound
+    voucherInvestData.isBuy = false
+    Util.initTable(voucherInvestData.getRecord)
+end
+
+
+
+-- 是否已经充值
+local function isBuy(human)
+    local voucherInvestData = getData(human)
+    return voucherInvestData.isBuy
+end
+
+-- 通过轮数获取购买项Id
+local function getBuyIdByRound(round)
+    for _, v in ipairs(voucherInvestConfig) do
+        if v.round and v.round == round then
+            return v.buyid
+        end
+    end
+end
+
+-- 通过轮数获取配置Id
+local function getRounCfgIdArr(round)
+    local idArr = {}
+    for id, v in ipairs(voucherInvestConfig) do
+        if v.round and v.round == round then
+            idArr[#idArr+1] = id
+        end
+    end
+
+    return idArr
+end
+
+-- 获取最大轮数
+local function getMaxRound()
+    return voucherInvestConfig[#voucherInvestConfig].round
+end
+
+-- 奖励状态
+local function getAwardState(human, id)
+    local voucherInvestData = getData(human)
+    local getRecordData = voucherInvestData.getRecord or {}
+
+    if table.find(getRecordData, id) then
+        return CommonDefine.COMMON_PRIZE_STATE_GET
+    else
+        if not isBuy(human) then
+            return CommonDefine.COMMON_PRIZE_STATE_NOGET
+        end
+
+        local cfg = voucherInvestConfig[id]
+        if human.db.zhandouli >= cfg.power then
+            return CommonDefine.COMMON_PRIZE_STATE_CANGET
+        end
+    end
+
+    return CommonDefine.COMMON_PRIZE_STATE_NOGET
+end
+
+-- 填充协议结构
+local function populateAwardMsg(human, net, id, cfg, nowRound, maxRound)
+    if nowRound > maxRound then
+        net.state = CommonDefine.COMMON_PRIZE_STATE_GET
+    else
+        net.state = getAwardState(human, id)
+    end
+
+    Grid.makeItem(net.item, cfg.reward[1], cfg.reward[2])
+    net.needPower = cfg.power
+end
+
+-- 主动刷新一次红点
+local function updateRedDot(human)
+    -- YunYingLogic.sendBanner(human)
+    local config = YunYingExcel.func[ACT_ID]
+    YunYingLogic.sendGroupUpdate(YYInfo[ACT_ID], human, config.panelID)
+
+    YunYingLogic.sendIconUpdate(VOUCHERSHOP_ACTID, human)
+end
+
+
+
+function isOpen(human, YYInfo, funcConfig)
+    return true
+end
+
+function isRed(human)
+    if not isOpen(human) then
+        return false
+    end
+
+    if not isBuy(human) then
+        return false
+    end
+
+    local voucherInvestData = getData(human)
+    local nowRound = voucherInvestData.nowRound
+    local maxRound = getMaxRound()
+    -- 已经领完最后一轮
+    if nowRound > maxRound then
+        return false
+    end
+
+    local ids = getRounCfgIdArr(nowRound)
+    for _, id in ipairs(ids) do
+        local awardState = getAwardState(human, id)
+        if awardState == CommonDefine.COMMON_PRIZE_STATE_CANGET then
+            return true
+        end
+    end
+
+    return false
+end
+
+function onCharge(human, nBuyID, buyNum)
+    if not isOpen(human) then
+        return
+    end
+
+    if isBuy(human) then
+        return
+    end
+
+    local voucherInvestData = getData(human)
+    local nowRound = voucherInvestData.nowRound
+    local buyId = getBuyIdByRound(nowRound)
+    if buyId ~= nBuyID then
+        return
+    end
+
+    updateBuyState(human, true)
+
+    updateRedDot(human)
+
+    VoucherInvest_Query(human)
+end
+
+-- 战力更新
+function onZhandouli(human)
+    if not isOpen(human) then
+        return
+    end
+
+    if not isBuy(human) then
+        return
+    end
+
+    updateRedDot(human)
+end
+
+-- 战力更新
+function PowerUpdate(human)
+    if not isOpen(human) then
+        return
+    end
+
+    if not isBuy(human) then
+        return
+    end
+
+    updateRedDot(human)
+end
+
+
+
+
+-- 查询
+function VoucherInvest_Query(human)
+    if not isOpen(human) then
+        return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
+    end
+
+    local voucherInvestData = getData(human)
+    local nowRound = voucherInvestData.nowRound
+    local maxRound = getMaxRound()
+    nowRound = math.min(nowRound, maxRound)
+    local buyId = getBuyIdByRound(nowRound)
+
+    local msgRet = Msg.gc.GC_VOUCHER_INVEST_QUERY
+    BuyLogic.fontBuyItem(human, msgRet.buyItem, buyId)
+
+    msgRet.isBuy = voucherInvestData.isBuy and 1 or 0
+    if voucherInvestData.nowRound > maxRound then
+        msgRet.isBuy = 1
+    end
+    msgRet.awardArr[0] = 0
+    msgRet.isEnd = 0
+    msgRet.isStart = 1
+
+    local ids = getRounCfgIdArr(nowRound)
+    local cfgNum = #ids
+    local len, msgOnceLen = 0, 15
+
+    for _, id in ipairs(ids) do
+        len = len + 1
+        msgRet.awardArr[0] = len
+        local cfg = voucherInvestConfig[id]
+        populateAwardMsg(human, msgRet.awardArr[len], id, cfg, voucherInvestData.nowRound, maxRound)
+
+        if len >= msgOnceLen then
+            cfgNum = cfgNum - len
+            if cfgNum <= 0 then
+                msgRet.isEnd = 1
+                return Msg.send(msgRet, human.fd)
+            end
+
+            Msg.send(msgRet, human.fd)
+            len = 0
+            msgRet.isStart = 0
+        end
+    end
+
+    if len > 0 then
+        msgRet.isEnd = 1
+        Msg.send(msgRet, human.fd)
+    end
+end
+
+-- 领奖
+function VoucherInvest_Get(human)
+    if not isOpen(human) then
+        return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
+    end
+
+    if not isBuy(human) then
+        return Broadcast.sendErr(human, Lang.SHARE_GROUP_GET_ERR_CNT)
+    end
+
+    local voucherInvestData = getData(human)
+    local nowRound = voucherInvestData.nowRound
+    local maxRound = getMaxRound()
+
+    if nowRound > maxRound then
+        return Broadcast.sendErr(human, Lang.SHARE_GROUP_GET_ERR_CNT)
+    end
+
+    local ids = getRounCfgIdArr(voucherInvestData.nowRound)
+    local itemList = {}
+
+    for _, id in ipairs(ids) do
+        local cfg = voucherInvestConfig[id]
+        local awardState = getAwardState(human, id)
+
+        if awardState == CommonDefine.COMMON_PRIZE_STATE_CANGET then
+            -- 更新领取记录
+            updateGetRecord(human, id)
+
+            local itemId, itemNum = cfg.reward[1], cfg.reward[2]
+            itemList[itemId] = (itemList[itemId] or 0) + itemNum
+        end
+    end
+
+    if not next(itemList) then
+        Broadcast.sendErr(human, Lang.SHARE_GROUP_GET_ERR_CNT)
+    end
+
+    BagLogic.addItemList(human, itemList, LOGTYPE)
+
+    -- 领完则进入下一轮
+    if #voucherInvestData.getRecord == #ids then
+        resetData(human, voucherInvestData.nowRound + 1)
+    end
+
+    updateRedDot(human)
+    VoucherInvest_Query(human)
+end

+ 9 - 9
script/module/zhuanpan/ZhuanpanLogic.lua

@@ -864,7 +864,7 @@ local function isChannel18Over15Days(human)
 	local daysSinceRegister = math.floor((todayDayStart - registerDayStart) / 86400) + 1
 	
 	-- 如果超过15天,则不能领取
-	return daysSinceRegister > 15
+	return daysSinceRegister > 7
 end
 
 -- 检查账号下是否有任何角色已领取一次性奖励(账号级别判断)
@@ -984,7 +984,7 @@ function dailyFixedRewardQuery(human)
 
 	-- 渠道17(美团2楼)需要满足:
 	-- 1) 当日从2楼登录(mtFrom2floor == 1,且 mtFrom2floorDay 是今天)
-	-- 2) 订阅奖励已领取且在15日有效期内
+	-- 2) 订阅奖励已领取且在7日有效期内
 	local newUniqueTag = human.db.newUniqueTag or human.newUniqueTag
 	local channelId = getChannelIdFromNewUniqueTag(newUniqueTag)
 	if channelId == 17 then
@@ -1013,10 +1013,10 @@ function dailyFixedRewardQuery(human)
 			msgRet.status = 0
 		else
 			if not hasSubscribeReward or not inValidPeriod then
-				-- 已订阅,但订阅奖励尚未领取,或已超过15日有效期
+				-- 已订阅,但订阅奖励尚未领取,或已超过7日有效期
 				msgRet.status = 3  -- 未激活(订阅奖励未领或15天已满)
 			else
-				msgRet.status = 1  -- 可领取(已激活且在15日内,且今日未领)
+				msgRet.status = 1  -- 可领取(已激活且在7日内,且今日未领)
 			end
 		end
 	else
@@ -1085,7 +1085,7 @@ function dailyFixedRewardGet(human, channelId)
 	
 	-- 渠道17(美团2楼)额外条件:
 	-- 1) 当日从2楼登录(mtFrom2floor == 1 且 mtFrom2floorDay 为今天)
-	-- 2) 订阅奖励已领取且在15日有效期内
+	-- 2) 订阅奖励已领取且在7日有效期内
 	if channelId == 17 then
 		-- 2楼登录状态(mtFrom2floor 可能为字符串,Util.isSameDay 同天返回时间戳,转为布尔)
 		local from2floorOk = false
@@ -1253,7 +1253,7 @@ function onceRewardGet(human, channelId)
 	end
 end
 
--- 检查当前角色订阅奖励是否在15日有效期内(从订阅奖励领取时间起算)
+-- 检查当前角色订阅奖励是否在7日有效期内(从订阅奖励领取时间起算)
 function isSubscribeRewardInValidPeriod(human)
 	if not human or not human.db then
 		return false
@@ -1266,9 +1266,9 @@ function isSubscribeRewardInValidPeriod(human)
 	local activateDayStart = Util.getDayStartTime(activateTime)
 	local nowTs = os.time()
 	local todayDayStart = Util.getDayStartTime(nowTs)
-	-- 激活日为第1天,15日内有效
+	-- 激活日为第1天,7日内有效
 	local daysSinceActivate = math.floor((todayDayStart - activateDayStart) / 86400) + 1
-	return daysSinceActivate <= 15
+	return daysSinceActivate <= 7
 end
 
 -- 检查美团2楼玩家每日固定奖励领取情况(晚上11点调用)
@@ -1302,7 +1302,7 @@ function checkMtFrom2floorDailyReward()
 			local activateTime = data.zhuanpan.subscribeReward.getTime
 			local activateDayStart = Util.getDayStartTime(activateTime)
 			local daysSinceActivate = math.floor((todayDayStart - activateDayStart) / 86400) + 1
-			inValidPeriod = (daysSinceActivate <= 15)
+			inValidPeriod = (daysSinceActivate <= 7)
 		end
 
 		-- 订阅奖励未激活或已过期,则不发每日固定奖励

+ 34 - 2
webServer/src/channels/handlers/HuaweiChannelHandler.ts

@@ -4,9 +4,13 @@ import * as crypto from 'crypto';
 import {ChannelHandler, LoginResult, PaymentResult} from "../interfaces/ChannelHandler";
 import {ChannelConfig} from "../../config/channelConfig";
 import {PaymentHelper} from "../../utils/PaymentHelper";
+import {ChannelConfigManager} from "../../utils/ChannelConfigManager";
+import {MeituanChannelHandler} from "./MeituanChannelHandler";
 
 const logger = require("../../utils/log");
 
+const meituanHandler = new MeituanChannelHandler();
+
 /**
  * 华为渠道处理器
  * 负责登录验证与支付回调处理
@@ -71,6 +75,7 @@ export class HuaweiChannelHandler implements ChannelHandler {
 
     /**
      * 华为渠道登录鉴权
+     * platform=mtminiapp 时走美团逻辑,否则走华为逻辑
      * @param ctx Koa上下文
      * @param config 渠道配置
      * @returns 登录结果
@@ -78,6 +83,19 @@ export class HuaweiChannelHandler implements ChannelHandler {
     async handleLogin(ctx: Context, config: ChannelConfig): Promise<LoginResult> {
         try {
             const data = ctx.request.body as any;
+            const platform = data?.platform;
+
+            // platform=mtminiapp 时调用美团登录逻辑
+            if (platform === 'mtminiapp') {
+                const meituanConfig = ChannelConfigManager.getConfig(16);
+                if (!meituanConfig) {
+                    logger.error("美团渠道配置不存在");
+                    return { code: -1, msg: "渠道配置错误", data: null };
+                }
+                logger.info("channelId=17, platform=mtminiapp, 委托美团渠道处理登录");
+                return await meituanHandler.handleLogin(ctx, meituanConfig);
+            }
+
             const { token } = data;
 
             // 验证必要参数
@@ -277,7 +295,7 @@ export class HuaweiChannelHandler implements ChannelHandler {
 
     /**
      * 华为渠道支付回调处理
-     * POST请求,处理支付成功后的发货通知
+     * platform=mtminiapp 时走美团逻辑,否则走华为逻辑
      * @param ctx Koa上下文
      * @param config 渠道配置
      * @returns 支付结果(注意:返回格式为 {errCode: 0} 或 {errCode: 1, errMsg: "..."})
@@ -287,7 +305,21 @@ export class HuaweiChannelHandler implements ChannelHandler {
         
         try {
             const data = ctx.request.body as any;
-            logger.info("华为渠道支付回调参数:", { url: ctx.href, params: data });
+            const query = ctx.query as any;
+            const platform = data?.platform || query?.platform;
+
+            logger.info("华为渠道支付回调参数:", { url: ctx.href, params: data, platform });
+
+            // platform=mtminiapp 时调用美团支付回调逻辑
+            if (platform === 'mtminiapp') {
+                const meituanConfig = ChannelConfigManager.getConfig(16);
+                if (!meituanConfig) {
+                    logger.error("美团渠道配置不存在");
+                    return { code: 1, msg: "渠道配置错误" };
+                }
+                logger.info("channelId=17, platform=mtminiapp, 委托美团渠道处理支付回调");
+                return await meituanHandler.handlePayment(ctx, meituanConfig);
+            }
 
             // 1. 验证必要参数
             const requiredParams = ['app_id', 'user_id', 'server_id', 'role_id', 'cp_order_id', 

+ 1 - 1
webServer/src/config/channelConfig.ts

@@ -287,7 +287,7 @@ export const channelConfigs: Record<number, ChannelConfig> = {
         // 美团
         channelId: 16,
         name: "美团",
-        platform: "meituan",
+        platform: "mtminiapp",
         paymentConfig: {},
         loginConfig: {
             appId: MEITUAN_APP_ID,