Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
金学艇
/
xhx
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
86cc6ba3
...
86cc6ba35fde3e2597ece5cfea03f2a11e556b84
authored
2019-07-03 19:15:31 +0800
by
jinwawa
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
0703
1 parent
fe08f20f
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
84 additions
and
54 deletions
client/xhx/client/res/config/pay.xml
client/xhx/client/res/ui/Activity/tianjin_cucc/ActivityVip.csb
client/xhx/client/src/app/info/ShopInfo.lua
client/xhx/client/src/app/model/ShopModel.lua
client/xhx/client/src/app/model/UserModel.lua
client/xhx/client/src/app/views/view/ActivityVipView_tianjin_cucc.lua
client/xhx/client/src/app/views/view/LoginView.lua
client/xhx/client/src/app/views/view/ShopView.lua
client/xhx/client/src/app/views/view/XyxPayView_tianjin_cucc.lua
client/xhx/client/xhx.v12.suo
client/xhx/client/res/config/pay.xml
View file @
86cc6ba
...
...
@@ -34,14 +34,14 @@
</platform>
<!--天津-->
<platform
id=
"103,102"
channel=
"cucc"
>
<pay
id=
"6"
name=
"10钻石"
type=
"1"
extra=
"0"
item=
"100000,10"
rmb=
"1.0"
product=
"dclyac001"
productPuTao=
"qjqp006"
agentLv=
"0"
notice=
"0"
/>
<pay
id=
"7"
name=
"100钻石"
type=
"1"
extra=
"0"
item=
"100000,100"
rmb=
"10.0"
product=
"dclyac010"
productPuTao=
"qjqp007"
agentLv=
"0"
notice=
"1"
/>
<pay
id=
"8"
name=
"300钻石"
type=
"1"
extra=
"10"
item=
"100000,310"
rmb=
"30.0"
product=
"dclyac030"
productPuTao=
"qjqp008"
agentLv=
"0"
notice=
"1"
/>
<pay
id=
"9"
name=
"500钻石"
type=
"1"
extra=
"20"
item=
"100000,520"
rmb=
"50.0"
product=
"dclyac050"
productPuTao=
"qjqp009"
agentLv=
"0"
notice=
"1"
/>
<pay
id=
"10"
name=
"1000钻石"
type=
"1"
extra=
"50"
item=
"100000,1050"
rmb=
"100.0"
product=
"dclyac100"
productPuTao=
"qjqp010"
agentLv=
"0"
notice=
"1"
/>
<pay
id=
"201"
name=
"月卡(31天)"
type=
"2"
des=
"月卡"
day=
"31"
item=
"100001,1000;600001,5"
payitem=
""
rmb=
"25.0"
product=
"dcly
ac025
"
productPuTao=
"qjqp201"
notice=
"1"
/>
<pay
id=
"202"
name=
"年卡(365天)"
type=
"2"
des=
"年卡"
day=
"365"
item=
"100001,2000;600002,5;200001,1"
payitem=
""
rmb=
"198.0"
product=
"dclybn198"
productPuTao=
"qjqp202"
notice=
"1"
/>
<pay
id=
"301"
name=
"自动续包月卡(31天)"
type=
"2"
des=
"月卡"
day=
"31"
item=
"100001,1000;600001,5"
payitem=
""
rmb=
"20.0"
product=
"
tjlhdcylyby020@207"
productPuTao=
"qjqp999"
notice=
"1"
/>
<pay
id=
"6"
name=
"10钻石"
type=
"1"
extra=
"0"
item=
"100000,10"
rmb=
"1.0"
product=
"dclyac001"
server=
"dclyac001"
content=
"tjlhdcylyac001@"
productPuTao=
"qjqp006"
agentLv=
"0"
notice=
"0"
/>
<pay
id=
"7"
name=
"100钻石"
type=
"1"
extra=
"0"
item=
"100000,100"
rmb=
"10.0"
product=
"dclyac010"
server=
"dclyac010"
content=
"tjlhdcylyac010@"
productPuTao=
"qjqp007"
agentLv=
"0"
notice=
"1"
/>
<pay
id=
"8"
name=
"300钻石"
type=
"1"
extra=
"10"
item=
"100000,310"
rmb=
"30.0"
product=
"dclyac030"
server=
"dclyac030"
content=
"tjlhdcylyac030@"
productPuTao=
"qjqp008"
agentLv=
"0"
notice=
"1"
/>
<pay
id=
"9"
name=
"500钻石"
type=
"1"
extra=
"20"
item=
"100000,520"
rmb=
"50.0"
product=
"dclyac050"
server=
"dclyac050"
content=
"tjlhdcylyac050@"
productPuTao=
"qjqp009"
agentLv=
"0"
notice=
"1"
/>
<pay
id=
"10"
name=
"1000钻石"
type=
"1"
extra=
"50"
item=
"100000,1050"
rmb=
"100.0"
product=
"dclyac100"
server=
"dclyac100"
content=
"tjlhdcylyac100@"
productPuTao=
"qjqp010"
agentLv=
"0"
notice=
"1"
/>
<pay
id=
"201"
name=
"月卡(31天)"
type=
"2"
des=
"月卡"
day=
"31"
item=
"100001,1000;600001,5"
payitem=
""
rmb=
"25.0"
product=
"dcly
by025"
server=
"dclyby025"
content=
"tjlhdcylyby025@
"
productPuTao=
"qjqp201"
notice=
"1"
/>
<pay
id=
"202"
name=
"年卡(365天)"
type=
"2"
des=
"年卡"
day=
"365"
item=
"100001,2000;600002,5;200001,1"
payitem=
""
rmb=
"198.0"
product=
"dclybn198"
server=
"dclybn198"
content=
"tjlhdcylyac198@"
productPuTao=
"qjqp202"
notice=
"1"
/>
<pay
id=
"301"
name=
"自动续包月卡(31天)"
type=
"2"
des=
"月卡"
day=
"31"
item=
"100001,1000;600001,5"
payitem=
""
rmb=
"20.0"
product=
"
dclyby020"
server=
"dclyby020"
content=
"tjlhdcylyby020@"
productPuTao=
"qjqp999"
notice=
"1"
/>
</platform>
<!--上海电信-->
<platform
id=
"106"
channel=
"shdx"
>
...
...
client/xhx/client/res/ui/Activity/tianjin_cucc/ActivityVip.csb
View file @
86cc6ba
No preview for this file type
client/xhx/client/src/app/info/ShopInfo.lua
View file @
86cc6ba
...
...
@@ -114,6 +114,10 @@ local function init()
else
info
.
product
=
vv
.
attr
.
product
;
end
if
CHANNEL
==
"cucc"
then
info
.
server
=
vv
.
attr
.
server
;
--新增两个字段用于天津续包月支付
info
.
content
=
vv
.
attr
.
content
;
end
if
info
.
product
and
info
.
product
~=
""
then
if
info
.
type
==
1
then
info
.
extra
=
tonumber
(
vv
.
attr
.
extra
);
...
...
@@ -349,4 +353,15 @@ function ShopInfo.getPayInfoByProduct(product)
return
info
;
end
--针对天津联通配置表问题
function
ShopInfo
.
getPayInfoByContent
(
product
)
local
info
=
nil
;
for
i
,
v
in
ipairs
(
vipList
)
do
if
v
.
content
==
product
then
info
=
v
;
end
end
return
info
;
end
return
ShopInfo
\ No newline at end of file
...
...
client/xhx/client/src/app/model/ShopModel.lua
View file @
86cc6ba
...
...
@@ -140,7 +140,7 @@ end
-- 天津联通支付
function
ShopModel
.
payCucc
(
productId
,
productName
,
productPrice
,
callBack
,
timeoutCallBack
,
gameid
)
--
logUI("ShopModel------------------------------>"..productId);
logUI
(
"ShopModel------------------------------>"
..
productId
);
local
function
onGetPayIDSuccessFun
(
_params
)
local
data
=
json
.
decode
(
_params
);
if
data
.
pay_id
==
""
then
...
...
@@ -187,7 +187,9 @@ function ShopModel.payCucc(productId, productName, productPrice, callBack, timeo
end
local
pay_params
=
tradeNo
..
","
..
productId
..
","
..
subject
..
","
..
amount
..
","
..
notificationURL
..
","
..
peng_bo_shi_token
;
local
payInfo
=
ShopInfo
.
getPayInfoByProduct
(
productId
);
logUI
(
"ShopModel payCucc pay_params= "
..
pay_params
);
local
payInfo
=
ShopInfo
.
getPayInfoByContent
(
productId
);
--天津联通根据content筛选
logUI
(
"ShopModel payCucc payInfo.id= "
..
payInfo
.
id
);
if
payInfo
.
id
==
301
then
DeviceUtil
.
cycleBilling
(
pay_params
,
payCallbackFromJava
);
else
...
...
@@ -207,7 +209,7 @@ function ShopModel.payCucc(productId, productName, productPrice, callBack, timeo
if
CHANNEL
==
"cucc"
and
cc
.
Application
:
getInstance
():
getTargetPlatform
()
==
cc
.
PLATFORM_OS_ANDROID
then
local
paramsStr
=
"uid="
..
UserModel
.
getStringUID
()
..
"&product="
..
productId
..
"&account="
..
UserModel
.
account
..
"&gameid="
..
gameid
;
--logUI("ShopModel sendHttpRequest------------------------------>");
--
logUI("ShopModel sendHttpRequest------------------------------>".."POST," .. get_pay_id_url .. "," .. PROXY_HTTP_ADDR .. "," .. paramsStr);
logUI
(
"ShopModel sendHttpRequest------------------------------>"
..
"POST,"
..
get_pay_id_url
..
","
..
PROXY_HTTP_ADDR
..
","
..
paramsStr
);
DeviceUtil
.
sendHttpRequest
(
"POST,"
..
get_pay_id_url
..
","
..
PROXY_HTTP_ADDR
..
","
..
paramsStr
,
onGetPayIDSuccessFun
);
else
HttpRequest
:
getInstance
():
post
(
get_pay_id_url
,
{
uid
=
UserModel
.
getStringUID
(),
product
=
productId
,
account
=
UserModel
.
account
,
gameid
=
gameid
},
onGetPayIDSuccessFun
,
onGetPayIDFaildFun
);
...
...
client/xhx/client/src/app/model/UserModel.lua
View file @
86cc6ba
...
...
@@ -413,24 +413,32 @@ function UserModel.onConnectSuccess(params)
--APK容易崩溃,查找原因中。。。
--已解决,Android中加上了runOnUIThread导致的
local
targetPlatform
=
cc
.
Application
:
getInstance
():
getTargetPlatform
();
if
CHANNEL
==
"shdx"
and
targetPlatform
==
cc
.
PLATFORM_OS_ANDROID
then
if
CHANNEL
==
"shdx"
and
targetPlatform
==
cc
.
PLATFORM_OS_ANDROID
then
--上海电信鉴权
local
function
callbackLua
(
params
)
local
arr
=
StringUtil
.
split
(
params
,
","
);
if
arr
[
1
]
and
arr
[
1
]
==
"success"
and
arr
[
2
]
then
--支付成功
logUI
(
"on connect success callbackLua"
);
IS_MEMBER
=
1
;
--初始化会员全局变量
--logUI("鉴权返回数据:"..params);
--local arr = StringUtil.split(params,",");
--if arr[1] and arr[1] == "success" and arr[2] then --支付成功
--logUI("on connect success callbackLua");
--IS_MEMBER = 1; --初始化会员全局变量
--SocketClient:getInstance():send("gateway_msg.login_msg",
--{
-- platform = PLATFORM,
-- account = account,
-- session = session,
--shanghai_dianxin_pay_id=tonumber(arr[2]),
--} );
--logUI("从服务端返回会员类型:" .. arr[2]);
--else
--logUI("鉴权失败!");
-- end
end
SocketClient
:
getInstance
():
send
(
"gateway_msg.login_msg"
,
{
platform
=
PLATFORM
,
account
=
account
,
session
=
session
,
shanghai_dianxin_pay_id
=
tonumber
(
arr
[
2
]),
--
shanghai_dianxin_pay_id=tonumber(arr[2]),
}
);
logUI
(
"从服务端返回会员类型:"
..
arr
[
2
]);
else
logUI
(
"鉴权失败!"
);
end
end
local
luaj
=
require
"cocos.cocos2d.luaj"
;
--引入luaj
local
className
=
"org/cocos2dx/lua/AppActivity"
;
local
args
=
{
callbackLua
};
...
...
@@ -442,10 +450,31 @@ function UserModel.onConnectSuccess(params)
-- 当成功时,第一个值为 true,第二个值是 Java 方法的返回值(如果有)
-- 当失败时,第一个值为 false,第二个值是错误代码
--local ok, ret = luaj.callStaticMethod(className, "sendPayInfo", args, sigs);
logUI
(
"callStaticMethod----->authPermission"
);
local
ok
,
ret
=
luaj
.
callStaticMethod
(
className
,
"authPermission"
,
args
,
sigs
);
if
not
ok
then
print
(
"sendPayInfo error:"
..
ret
);
end
elseif
CHANNEL
==
"cucc"
and
targetPlatform
==
cc
.
PLATFORM_OS_ANDROID
then
--天津联通鉴权
local
function
callbackLua
(
params
)
logUI
(
"天津鉴权返回数据: "
..
params
);
if
params
==
"success"
then
IS_MEMBER
=
1
;
--初始化会员全局变量
else
--还不是会员,鉴权返回的productid保存再AppActivity中
end
end
SocketClient
:
getInstance
():
send
(
"gateway_msg.login_msg"
,
{
platform
=
PLATFORM
,
account
=
account
,
session
=
session
,
--shanghai_dianxin_pay_id=tonumber(arr[2]),
}
);
local
vipList
=
ShopInfo
.
getVipList
();
--续包月这里应该是server和content,但是配置表配反了
DeviceUtil
.
authPermissionForPruductId
(
vipList
[
3
].
product
..
",1,"
..
vipList
[
3
].
server
,
callbackLua
);
else
SocketClient
:
getInstance
():
send
(
"gateway_msg.login_msg"
,
{
...
...
client/xhx/client/src/app/views/view/ActivityVipView_tianjin_cucc.lua
View file @
86cc6ba
...
...
@@ -40,7 +40,7 @@ function ActivityVipView:init()
self
.
yilingqu_month
:
setVisible
(
false
);
self
.
btn_lingqu_month
:
setVisible
(
false
);
self
.
btn_vip_lianxu
:
setVisible
(
false
);
local
function
authCallbackLua
(
result
)
--[[
local function authCallbackLua(result)
-- 去鉴权看看有没有订购连续包月
self.orderStaus = result;
if self.orderStaus == "success" then
...
...
@@ -57,7 +57,7 @@ function ActivityVipView:init()
-- return self:update(true); --处理好订购关系后在更新后续内容
end
local vipList = ShopInfo.getVipList();
DeviceUtil
.
authPermissionForPruductId
(
vipList
[
3
].
product
..
",2"
,
authCallbackLua
);
DeviceUtil.authPermissionForPruductId(vipList[3].product .. ",2", authCallbackLua);
--]]
return
self
:
update
(
true
);
...
...
@@ -238,26 +238,18 @@ function ActivityVipView:update(_is_init)
end
function
ActivityVipView
:
onGetClick
(
ref
)
local
shopInfo
=
ShopInfo
.
getPayInfo
(
ref
.
id
);
-- ShopModel.onPayResFun({data={product=shopInfo.product}});
local
vipList
=
ShopInfo
.
getVipList
();
local
shopInfo
=
ShopInfo
.
getPayInfo
(
vipList
[
3
].
id
);
ShopModel
.
pay
(
shopInfo
.
product
,
shopInfo
.
name
,
shopInfo
.
costList
[
1
].
num
);
end
-- 包月(取消连续包月功能暂未实现,取消连续包月返回时应该调用update_msg接口通知后端服务器)
function
ActivityVipView
:
onGetContinueClick
(
ref
)
local
shopInfo
=
ShopInfo
.
getPayInfo
(
ref
.
id
);
local
vipList
=
ShopInfo
.
getVipList
();
local
shopInfo
=
ShopInfo
.
getPayInfo
(
vipList
[
3
].
id
);
-- 包月卡的id,获取包月卡的item信息
-- 天津联通支付,支持连续包月
local
function
authCallbackLua
(
result
)
-- if nil~=result then
logUI
(
"ActivityVipView:onGetContinueClick------------------>"
..
result
);
ShopModel
.
pay
(
result
,
shopInfo
.
name
,
shopInfo
.
costList
[
1
].
num
);
-- end
end
local
vipList
=
ShopInfo
.
getVipList
();
DeviceUtil
.
authPermissionForPruductId
(
vipList
[
3
].
product
..
",2"
,
authCallbackLua
);
ShopModel
.
pay
(
shopInfo
.
content
,
shopInfo
.
name
,
shopInfo
.
costList
[
1
].
num
);
end
function
ActivityVipView
:
onLingquClick
(
ref
)
...
...
client/xhx/client/src/app/views/view/LoginView.lua
View file @
86cc6ba
...
...
@@ -450,11 +450,11 @@ function LoginView:doLogin(account)
verifystring
=
md5
(
verifystring
);
logUI
(
"登录验证:"
..
verifystring
);
if
CHANNEL
==
"gzdt"
then
UserModel
.
login
(
"http://183.234.214.1"
,
"10400"
,
"xiaokanggogogo"
,
""
);
--直接调用gateway,跳过登录接口 __TODO:jinwawa
else
--
if CHANNEL=="gzdt" then
--
UserModel.login("http://183.234.214.1","10400","xiaokanggogogo",""); --直接调用gateway,跳过登录接口 __TODO:jinwawa
--
else
HttpRequest
:
getInstance
():
post
(
GAME_LOGIN_URL
,{
platform
=
PLATFORM
,
account
=
self
.
account
,
verify
=
verifystring
,
openid
=
self
.
openid
,
access_token
=
self
.
access_token
},
handler
(
self
,
self
.
onLoginServerBackFun
),
handler
(
self
,
self
.
onLoginServerFaildFun
));
end
--
end
end
end
...
...
client/xhx/client/src/app/views/view/ShopView.lua
View file @
86cc6ba
...
...
@@ -346,7 +346,11 @@ function ShopView:onBuyClick(ref,event)
if
shopItemInfo
.
costList
[
1
].
id
==
0
then
--RMB充值购买道具
if
CHANNEL
==
"cucc"
then
--天津联通支付采用content字段,并且需要拼接省份标识carrierId
ShopModel
.
pay
(
shopItemInfo
.
content
,
shopItemInfo
.
name
,
shopItemInfo
.
costList
[
1
].
num
,
callBack
,
timeoutCallBack
);
else
ShopModel
.
pay
(
shopItemInfo
.
product
,
shopItemInfo
.
name
,
shopItemInfo
.
costList
[
1
].
num
,
callBack
,
timeoutCallBack
);
end
else
--游戏币购买道具
local
myNum
=
UserModel
.
getItemNum
(
shopItemInfo
.
costList
[
1
].
id
);
...
...
client/xhx/client/src/app/views/view/XyxPayView_tianjin_cucc.lua
View file @
86cc6ba
...
...
@@ -129,21 +129,9 @@ function XyxPayView:onBuyClick(ref,event)
--[[self.shop_reciever = require("app.views.view.ActivityView"):show("ActivityVipView");
self.shop_reciever:setLocalZOrder(dialog.ZORDER_POP);
cc.Director:getInstance():getRunningScene().keypadManager:addKeypadReceiver(self.shop_reciever);--]]
local
vipList
=
ShopInfo
.
getVipList
();
local
shopInfo
=
ShopInfo
.
getPayInfo
(
vipList
[
3
].
id
);
-- 包月卡的id,获取包月卡的item信息
-- 天津联通支付,支持连续包月
local
function
authCallbackLua
(
result
)
-- if nil~=result then
--logUI("ActivityVipView:onGetContinueClick------------------>" .. result);
ShopModel
.
pay
(
result
,
shopInfo
.
name
,
shopInfo
.
costList
[
1
].
num
);
-- end
end
local
vipList
=
ShopInfo
.
getVipList
();
DeviceUtil
.
authPermissionForPruductId
(
vipList
[
3
].
product
..
",2"
,
authCallbackLua
);
-- self:onPayCallBack("success");
ShopModel
.
pay
(
shopInfo
.
content
,
shopInfo
.
name
,
shopInfo
.
costList
[
1
].
num
);
end
function
XyxPayView
:
onPayCallBack
(
params
)
...
...
client/xhx/client/xhx.v12.suo
View file @
86cc6ba
No preview for this file type
Please
register
or
sign in
to post a comment