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
401b0fe1
...
401b0fe1468cd5cd5ac743d9ab54bd334db9c35e
authored
2019-05-31 11:32:38 +0800
by
jinwawa
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
morning 0531
1 parent
b2086fc7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
18 deletions
client/xhx/client/UserDefault.xml
client/xhx/client/src/app/model/UserModel.lua
client/xhx/client/src/app/views/view/AchievementView.lua
client/xhx/client/xhx.v12.suo
client/xhx/client/UserDefault.xml
View file @
401b0fe
...
...
@@ -3,7 +3,7 @@
<!--m0800279afc6c-->
<!--m0800278b87c2-->
<!---->
<Account>
m0800278b87c
4
</Account>
<Account>
m0800278b87c
7
</Account>
<exp>
0
</exp>
<versionnum>
201801291657
</versionnum>
<isMusic>
0
</isMusic>
...
...
@@ -26,7 +26,7 @@
<new_guide_step>
4
</new_guide_step>
<is_feiyanzoubi_game_guide>
1
</is_feiyanzoubi_game_guide>
<feiyanzoubi_best>
376
</feiyanzoubi_best>
<uid>
10
00100010142874
</uid>
<uid>
10
30100010142918
</uid>
<is_bird_game_guide>
1
</is_bird_game_guide>
<bird_best>
1008
</bird_best>
<is_haidao_game_guide>
1
</is_haidao_game_guide>
...
...
client/xhx/client/src/app/model/UserModel.lua
View file @
401b0fe
...
...
@@ -992,6 +992,11 @@ function UserModel.getAchievementNum()
num
=
num
+
1
;
end
end
local
left_vip_day
=
UserModel
.
getLeftVipDay
();
if
v
.
type_id
==
10
and
left_vip_day
<=
0
and
num
>
0
then
--不是会员,不显示小红点
num
=
num
-
1
;
end
end
end
return
num
;
...
...
@@ -1018,6 +1023,11 @@ function UserModel.hasAchivementReward()
end
end
end
local
left_vip_day
=
UserModel
.
getLeftVipDay
();
if
achievement_data
.
type_id
==
10
and
left_vip_day
<=
0
then
--不是会员,不显示小红点
b
=
false
;
end
end
return
b
;
end
...
...
client/xhx/client/src/app/views/view/AchievementView.lua
View file @
401b0fe
...
...
@@ -153,24 +153,36 @@ function AchievementView:updateItems()
btn
:
addTouchEventListener
(
function
(
ref
,
type
)
self
:
onButtonClick
(
ref
,
type
,
handler
(
self
,
self
.
onGetRewardClick
))
end
);
print
(
"load achievement icon:"
,
i
..
"_"
..
ii
..
".png"
);
if
achievement_data
and
achievement_data
.
data
>=
vv
.
data
then
local
icon_url
=
"res/ui/achievement/"
..
i
..
"_"
..
ii
..
".png"
;
local
icon_url
=
""
;
local
left_vip_day
=
UserModel
.
getLeftVipDay
();
if
info
.
id
==
10
and
left_vip_day
<=
0
then
--不是会员,不显示金色框框
icon_url
=
"res/ui/achievement/gray_"
..
i
..
"_"
..
ii
..
".png"
;
else
icon_url
=
"res/ui/achievement/"
..
i
..
"_"
..
ii
..
".png"
;
end
if
cc
.
FileUtils
:
getInstance
():
isFileExist
(
icon_url
)
then
item
:
getChildByName
(
"icon"
):
setSpriteFrame
(
cc
.
Sprite
:
create
(
icon_url
):
getSpriteFrame
());
end
if
not
TableUtil
.
IsInTable
(
achievement_data
.
get_reward_id
,
ii
)
then
local
left_vip_day
=
UserModel
.
getLeftVipDay
();
if
info
.
id
==
10
and
left_vip_day
<=
0
then
--不是会员,不能领取这个成就
if
not
TableUtil
.
IsInTable
(
achievement_data
.
get_reward_id
,
ii
)
then
if
info
.
id
==
10
and
left_vip_day
<=
0
then
--不是会员,不显示领取成就的按钮
item
:
getChildByName
(
"btn_get"
):
setVisible
(
false
);
local
cur_val
=
0
;
local
total_val
=
vv
.
data
;
if
achievement_data
then
cur_val
=
achievement_data
.
data
;
end
item
:
getChildByName
(
"txt_progress"
):
setString
(
cur_val
..
"/"
..
total_val
);
else
item
:
getChildByName
(
"btn_get"
):
setVisible
(
true
);
item
:
getChildByName
(
"txt_des"
):
setVisible
(
false
);
item
:
getChildByName
(
"txt_progress"
):
setVisible
(
false
);
item
:
getChildByName
(
"bg_achievement_progress"
):
setVisible
(
false
);
item
:
getChildByName
(
"LoadingBar"
):
setVisible
(
false
);
end
--
item
:
getChildByName
(
"yilingqu"
):
setVisible
(
false
);
item
:
getChildByName
(
"txt_des"
):
setVisible
(
false
);
item
:
getChildByName
(
"txt_progress"
):
setVisible
(
false
);
item
:
getChildByName
(
"LoadingBar"
):
setVisible
(
false
);
item
:
getChildByName
(
"bg_achievement_progress"
):
setVisible
(
false
);
else
item
:
getChildByName
(
"yilingqu"
):
setVisible
(
true
);
item
:
getChildByName
(
"txt_des"
):
setVisible
(
false
);
...
...
@@ -188,14 +200,14 @@ function AchievementView:updateItems()
local
per
=
math.floor
(
cur_val
/
total_val
*
100
);
local
left_vip_day
=
UserModel
.
getLeftVipDay
();
if
info
.
id
==
10
and
left_vip_day
<=
0
then
--不是会员,不能显示这个进度条
item
:
getChildByName
(
"LoadingBar"
):
setVisible
(
false
);
item
:
getChildByName
(
"txt_progress"
):
setString
(
"0/"
..
total_val
);
else
--
local left_vip_day = UserModel.getLeftVipDay();
--
if info.id==10 and left_vip_day <= 0 then --不是会员,不能显示这个进度条
--
item:getChildByName("LoadingBar"):setVisible(false);
--
item:getChildByName("txt_progress"):setString("0/" .. total_val);
--
else
item
:
getChildByName
(
"LoadingBar"
):
setPercent
(
per
);
item
:
getChildByName
(
"txt_progress"
):
setString
(
cur_val
..
"/"
..
total_val
);
end
--
end
item
:
getChildByName
(
"yilingqu"
):
setVisible
(
false
);
item
:
getChildByName
(
"btn_get"
):
setVisible
(
false
);
...
...
@@ -238,7 +250,7 @@ function AchievementView:onGetRewardClick(ref, type)
if
achievement_data
and
achievement_data
.
data
>=
ref
.
step_info
.
data
and
not
TableUtil
.
IsInTable
(
achievement_data
.
get_reward_id
,
ref
.
step_id
)
then
local
left_vip_day
=
UserModel
.
getLeftVipDay
();
if
ref
.
main_id
==
10
and
left_vip_day
<=
0
then
--不是会员,不能
显示这个进度条
if
ref
.
main_id
==
10
and
left_vip_day
<=
0
then
--不是会员,不能
点击领取按钮
return
;
end
...
...
client/xhx/client/xhx.v12.suo
View file @
401b0fe
No preview for this file type
Please
register
or
sign in
to post a comment