源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

593 lines
20 KiB

  1. ChildDressViewNew = ChildDressViewNew or BaseClass(BaseView)
  2. local ChildDressViewNew = ChildDressViewNew
  3. --[[
  4. ChildDressViewNew.TabData = {
  5. [1] = {name = "人物", level = MainRoleModel.TabOpenLevel[1]},
  6. }
  7. --]]
  8. function ChildDressViewNew:__init()
  9. self.base_file = "child"
  10. self.layout_file = "ChildDressViewNew"
  11. self.layer_name = "UI"
  12. self.destroy_imm = true
  13. self.use_background = G_USING_BG --全屏界面默认使用这个参数
  14. self.hide_maincancas = true --全屏界面需要放开隐藏主UI
  15. self.change_scene_close = true
  16. self.append_to_ctl_queue = false --是否要添加进界面堆栈
  17. self.need_show_money = false --是否要显示顶部的金钱栏
  18. self.blur_activity_bg = true
  19. self.close_fog = true
  20. self.model = ChildModel:getInstance()
  21. self.dress_item_list = {}
  22. self.attr_item_list = {}
  23. self.attr_sum_item_list = {}
  24. self.img_star_list = {}
  25. self.select_item2 = nil
  26. self.fashion_type_select = 0
  27. self.load_callback = function ()
  28. self:LoadSuccess()
  29. self:AddEvent()
  30. end
  31. self.open_callback = function ( )
  32. self:OpenSuccess()
  33. end
  34. self.switch_callback = function(index)
  35. self:SwitchTab(index)
  36. end
  37. self.destroy_callback = function ( )
  38. self:DestroySuccess()
  39. end
  40. end
  41. function ChildDressViewNew:Open( )
  42. --self.data = data
  43. BaseView.Open(self)
  44. end
  45. function ChildDressViewNew:LoadSuccess()
  46. local nodes = {
  47. "bg:raw",
  48. "mid/text_name:tmp", -- 名字
  49. "mid/rt_image_show", -- 模型
  50. "mid/btn_wear:obj:img",
  51. "mid/btn_unwear:obj:img",
  52. "mid/effectCon",
  53. -------------------------------
  54. "right/txt_fight:obj:txt", -- 战力
  55. "right/ScrollView_attr/Viewport/content_attr", -- 属性con
  56. "right/btn_upgrade:obj", -- 激活/升阶按钮
  57. "right/btn_upgrade/btn_upgrade_txt:tmp",
  58. "right/btn_upgrade/btn_upgrade_red_dot:obj",
  59. -- 时装item
  60. "right/ScrollView_up_item/Viewport/Content_up_item",
  61. "right/ScrollView_up_item/Viewport:obj",
  62. "right/ScrollView_up_item",
  63. "right/awardCon:obj",
  64. "close:obj",
  65. "right/ScrollView_up_item/Viewport/Content_up_item/di_bg_con:obj",
  66. "right/attrDes:tmp",
  67. }
  68. self:GetChildren(nodes)
  69. -- 进阶星星
  70. for i = 1, 5 do
  71. self.img_star_list[i] = self:GetChild("right/stars/star"..i):GetComponent("Image")
  72. end
  73. self:UpdateBaseView( )
  74. end
  75. function ChildDressViewNew:UpdateBaseView( )
  76. lua_resM:setOutsideRawImage(self, self.bg_raw, GameResPath.GetViewBigBg("child_dress_bg_1227_669"))
  77. -- local close_callback = function()
  78. -- self:Close()
  79. -- end
  80. -- self.tab_win = UITabWindow.New(self.transform, nil, nil,
  81. -- close_callback, self.background_wnd, nil, UITabWindow.SizeSmallHallNoTab, false,nil,true)
  82. --self.tab_win:SetTitleRes("child_asset","child_title") --标题
  83. -- self.tab_win:SetBackgroundRes("child_dress_bg_1280_720")
  84. -- self.tab_win:SetTitleText("宝宝时装")
  85. -- self.tab_win:ChangeShowFlag("Child")
  86. local function bg_back_func( ... )
  87. if self.background_wnd and self.background_wnd:GetComponent("RawImageExtend") then
  88. self:MoveUIToBack(self.background_wnd:GetComponent("RawImageExtend"))
  89. end
  90. self:MoveUIToBack(self.bg_raw)
  91. -- self:MoveUIToBack(self.tab_win.win_bg)
  92. end
  93. if self.background_wnd then
  94. bg_back_func()
  95. else
  96. self.bg_back_func = bg_back_func
  97. end
  98. end
  99. function ChildDressViewNew:AddEvent()
  100. local function onBtnClickHandler(target, x, y)
  101. if target == self.btn_wear_obj then
  102. local data = self.select_item2.data
  103. if data.is_vehicle then
  104. self.model:Fire(ChildConst.CHILD_REQ_EVENT, 16517, 1, data.fashion_id)
  105. else
  106. --宝宝时装穿戴
  107. self.model:Fire(ChildConst.CHILD_REQ_EVENT, 16530, 1, data.fashion_type, data.fashion_id)
  108. end
  109. elseif target == self.btn_unwear_obj then
  110. local data = self.select_item2.data
  111. if data.is_vehicle then
  112. self.model:Fire(ChildConst.CHILD_REQ_EVENT, 16517, 2, data.fashion_id)
  113. else
  114. --宝宝时装脱下
  115. self.model:Fire(ChildConst.CHILD_REQ_EVENT, 16530, 2, data.fashion_type, data.fashion_id)
  116. end
  117. elseif target == self.close_obj then
  118. self:Close()
  119. elseif target == self.btn_upgrade_obj then
  120. local data = self.select_item2.data
  121. local function upFunc( )
  122. --宝宝时装激活
  123. if self.select_item2.type == ChildConst.ChildDressItemType.Lock then
  124. Message.show("物品不足")
  125. return
  126. end
  127. if self.select_item2.type == ChildConst.ChildDressItemType.CanActive then
  128. if data.is_vehicle then
  129. self.model:Fire(ChildConst.CHILD_REQ_EVENT, 16515, 1, data.fashion_id)
  130. else
  131. self.model:Fire(ChildConst.CHILD_REQ_EVENT, 16531, 1, data.fashion_id,0)
  132. end
  133. else --宝宝时装升级
  134. if data.is_vehicle then
  135. self.model:Fire(ChildConst.CHILD_REQ_EVENT, 16515, 2, data.fashion_id)
  136. else
  137. local isBoolNum = 0 -- 默认不自动购买了
  138. local buyType = self.select_item2.type == ChildConst.ChildDressItemType.Lock and 1 or 2
  139. self.model:Fire(ChildConst.CHILD_REQ_EVENT, 16531, buyType, data.fashion_id,isBoolNum)
  140. end
  141. end
  142. end
  143. local isMax
  144. if data.is_vehicle then
  145. isMax = self.model:IsChildVehicleLvMax(self.select_item2.data.fashion_id,self.select_item2.data.lv)
  146. else
  147. isMax = self.model:IsChildFashionLvMax(self.select_item2.data.fashion_id,self.select_item2.data.lv)
  148. end
  149. if isMax then
  150. Message.show("已经满级了哦", "fault")
  151. -- elseif self.isShowCostTipNum and self.toggle_bug_obj:GetComponent("Toggle").isOn then
  152. -- local listCost = stringtotable(self.select_item2.data.buy_price)
  153. -- local moneyTypeName = WordManager:GetCommonMoneyStr(listCost[1])
  154. -- local ask_str = "物品不足,是否消耗<color=#ff6519>"..self.isShowCostTipNum.."</color>"..moneyTypeName.."进行补全?"
  155. -- Alert.show(ask_str,Alert.Type.Two,upFunc,nil,"确定","取消")
  156. else
  157. upFunc()
  158. end
  159. end
  160. end
  161. AddClickEvent(self.btn_wear_obj, onBtnClickHandler)
  162. AddClickEvent(self.btn_unwear_obj, onBtnClickHandler)
  163. AddClickEvent(self.btn_upgrade_obj, onBtnClickHandler)
  164. AddClickEvent(self.close_obj, onBtnClickHandler)
  165. local function UPDATA_CHILD_DRESS_INFO_fun(type, check_effect)
  166. self.need_check_effect = true
  167. self:UpdateView(nil,self.select_item2, check_effect)
  168. if self.select_item2 then
  169. self:SetItemCon2(self.select_item2) -- 得拿到最新的
  170. end
  171. end
  172. self.UPDATA_CHILD_DRESS_INFO_id = self.model:Bind(ChildConst.UPDATA_CHILD_DRESS_INFO, UPDATA_CHILD_DRESS_INFO_fun,vo)
  173. self:BindEvent(self.model, ChildConst.UPDATA_CHILD_VEHICLE_FOLLOW, UPDATA_CHILD_DRESS_INFO_fun)
  174. end
  175. function ChildDressViewNew:UpdateRedDot()
  176. for k,v in pairs(self.dress_item_list) do
  177. local cost_num = stringtotable(v.data.upgrade_cost)[1][3]
  178. local num = GoodsModel:getInstance():GetTypeGoodsNum(v.data.fashion_id)
  179. if cost_num <= num then
  180. local is_max = false
  181. if v.data.is_vehicle then
  182. is_max = self.model:IsChildVehicleLvMax(v.data.fashion_id,v.data.lv)
  183. else
  184. is_max = self.model:IsChildFashionLvMax(v.data.fashion_id,v.data.lv)
  185. end
  186. if not is_max then
  187. self.dress_item_list[k]:SetRedDot(true)
  188. else
  189. self.dress_item_list[k]:SetRedDot(false)
  190. end
  191. else
  192. self.dress_item_list[k]:SetRedDot(false)
  193. end
  194. end
  195. end
  196. function ChildDressViewNew:UpdateRoleModel( figure_id, is_vehicle, need_effect )
  197. local show_figure_id
  198. if figure_id and not is_vehicle then -- 非载具时装的选中
  199. show_figure_id = self.model:GetFashionModelID(figure_id)
  200. else
  201. show_figure_id = self.model:GetChildCloth()
  202. end
  203. if (not self.showing_effect_model) and need_effect then
  204. local function call_back( )
  205. self.showing_effect_model = false
  206. end
  207. self:ClearUIEffect(self.effectCon)
  208. self:AddUIEffect("ui_jinjie", self.effectCon, self.layer_name, Vector3(15,0,0), 1, false, 1.5, nil, call_back)
  209. self.showing_effect_model = true
  210. end
  211. local action_name_list
  212. if is_vehicle then
  213. --action_name_list = {"ride"}
  214. -- SetLocalPositionY(self.rt_image_show, 287)
  215. -- local show_conf = ChildConst.ModelShowConfig[1011] -- 默认模型
  216. local res_data = {
  217. father_node = self,
  218. transform = self.rt_image_show,
  219. fashion_type = FuncOpenModel.TypeId.Child,
  220. -- figure_id = show_figure_id,
  221. ui_model_type = UIModelCommon.ModelType.BackModel,
  222. action_name_list = action_name_list,
  223. free_param = self.model:GetVehicleModelID(figure_id),
  224. type = SceneBaseType.Baby_Include_Horse,
  225. clothe_res_id = show_figure_id,
  226. position = Vector3(0, 100, 0),
  227. rotate = -50,
  228. scale = 6,
  229. raycast_size = Vector2(340,460),
  230. }
  231. lua_resM:SetBackRoleModel(self, res_data.transform, res_data)
  232. else
  233. -- SetLocalPositionY(self.rt_image_show, 163)
  234. local res_data = {
  235. father_node = self,
  236. transform = self.rt_image_show,
  237. fashion_type = FuncOpenModel.TypeId.Child,
  238. figure_id = show_figure_id,
  239. ui_model_type = UIModelCommon.ModelType.BackModel,
  240. action_name_list = action_name_list,
  241. }
  242. FuncOpenModel:getInstance():SetModelRes(res_data)
  243. end
  244. end
  245. function ChildDressViewNew:OpenSuccess()
  246. self:UpdateView()
  247. end
  248. function ChildDressViewNew:UpdateView(fashion_type_before_function, select_item, check_effect)
  249. local fashion_type = 1 --装饰已经永久取消了,仅有1
  250. local dressList = self.model:GetChildDressList()
  251. -- local vehicle_list = self.model:GetChildVehicleList()
  252. -- item参数
  253. local item_width = 196
  254. local item_height = 204
  255. local start_x = 7
  256. local start_y = 1
  257. local space_x = 5.5
  258. local space_y = 0
  259. -- 衣柜挡板
  260. local total_count = TableSize(dressList)
  261. local di_bg_count = math.ceil(total_count / 3)
  262. self.di_item_list = self.di_item_list or {}
  263. for k,v in pairs(self.di_item_list) do
  264. if v.obj then
  265. v.obj:SetActive(false)
  266. end
  267. end
  268. for i=1, di_bg_count do
  269. if not self.di_item_list[i] then
  270. self.di_item_list[i] = {}
  271. self.di_item_list[i].obj = UiFactory.createChild(self.di_bg_con, UIType.Image2)
  272. self.di_item_list[i].tran = self.di_item_list[i].obj.transform
  273. self.di_item_list[i].img = self.di_item_list[i].obj:GetComponent("Image")
  274. lua_resM:setOutsideImageSprite(self, self.di_item_list[i].img, GameResPath.GetChildIcon("child_dress_di_bg"), true)
  275. end
  276. local image_item = self.di_item_list[i]
  277. SetLocalPosition(image_item.tran, -24.5, space_y - i * (item_height + space_y) + 73, 0)
  278. image_item.obj:SetActive(true)
  279. end
  280. -- item创建
  281. local dress_count = 0
  282. local function callback( item )
  283. for k,v in pairs(self.dress_item_list) do
  284. v:SetChosen(false)
  285. end
  286. self.select_item2 = item
  287. item:SetChosen(true)
  288. self:SetItemCon2(item)
  289. end
  290. SetSizeDeltaY(self.Content_up_item, (item_height + space_y) * di_bg_count + 70)
  291. for k,v in pairsByKeys(dressList) do
  292. dress_count = dress_count + 1
  293. local k = dress_count
  294. local item = self.dress_item_list[k]
  295. if item == nil then
  296. item = ChildDressItem.New(self.Content_up_item)
  297. self.dress_item_list[k] = item
  298. end
  299. self.dress_item_list[k]:SetData(v,callback,k, check_effect)
  300. self.dress_item_list[k]:SetVisible(true)
  301. if (not select_item and k == 1) or -- 第一次打开 没有选中的 就选第一个
  302. (select_item and v.fashion_id == select_item.data.fashion_id) -- 已有选中的 且本次是它
  303. then
  304. self.select_item2 = self.dress_item_list[k]
  305. self.select_item2:SetChosen(true)
  306. self:SetItemCon2(self.select_item2)
  307. end
  308. local pos_x = start_x + ((dress_count - 1) % 3) * (space_x + item_width)
  309. local pos_y = start_y - math.floor((dress_count - 1) / 3) * (space_y + item_height)
  310. self.dress_item_list[k]:SetPosition(pos_x, pos_y)
  311. end
  312. --[[ -- 载具排后面
  313. for k,v in pairsByKeys(vehicle_list) do
  314. dress_count = dress_count + 1
  315. local k = dress_count
  316. local item = self.dress_item_list[k]
  317. if item == nil then
  318. item = ChildDressItem.New(self.Content_up_item)
  319. self.dress_item_list[k] = item
  320. end
  321. self.dress_item_list[k]:SetData(v,callback,k, check_effect)
  322. self.dress_item_list[k]:SetVisible(true)
  323. if (not select_item and k == 1) or -- 第一次打开 没有选中的 就选第一个
  324. (select_item and v.fashion_id == select_item.data.fashion_id) -- 已有选中的 且本次是它
  325. then
  326. self.select_item2 = self.dress_item_list[k]
  327. self.select_item2:SetChosen(true)
  328. self:SetItemCon2(self.select_item2)
  329. end
  330. local pos_x = start_x + ((dress_count - 1) % 3) * (space_x + item_width)
  331. local pos_y = start_y - math.floor((dress_count - 1) / 3) * (space_y + item_height)
  332. self.dress_item_list[k]:SetPosition(pos_x, pos_y)
  333. end--]]
  334. for i = dress_count + 1, #self.dress_item_list do
  335. self.dress_item_list[i]:SetVisible(false)
  336. end
  337. -----
  338. self:UpdateRedDot()
  339. end
  340. function ChildDressViewNew:SetItemCon2(item2 )
  341. -- print('Msh:ChildDressViewNew.lua[329] data')
  342. -- PrintCallStack()
  343. local selectList = item2.data
  344. local check_effect = self.need_check_effect -- 是否要检查特效播放
  345. -- btn红点
  346. -- 时装是否升到满级
  347. local type_id = selectList.fashion_id
  348. local isMax = false
  349. if selectList.is_vehicle then
  350. isMax = self.model:IsChildVehicleLvMax(type_id, selectList.lv)
  351. else
  352. isMax = self.model:IsChildFashionLvMax(type_id, selectList.lv)
  353. end
  354. local is_active = item2.type == ChildConst.ChildDressItemType.isActive
  355. local goods_name = GoodsModel:getInstance():getGoodsName(type_id, true)
  356. local have_num = GoodsModel:getInstance():GetTypeGoodsNum(type_id) or 0
  357. local need_num = stringtotable(selectList.upgrade_cost)[1][3]
  358. if not isMax then
  359. self.btn_upgrade_red_dot_obj:SetActive(have_num >= need_num)
  360. else
  361. self.btn_upgrade_red_dot_obj:SetActive(false)
  362. end
  363. -- 名字
  364. self.text_name_tmp.text = selectList.fashion_name
  365. local dressList = self.model:GetChildDressList()
  366. for k,v in pairsByKeys(dressList) do
  367. if v.fashion_id == selectList.fashion_id then
  368. selectList = v --协议回来的更到最新
  369. end
  370. end
  371. self.btn_upgrade_txt_tmp.text = item2 .type == ChildConst.ChildDressItemType.isActive and "升级" or "激活"
  372. -- self.btn_upgrade_txt_tmp.text = item2.type == ChildConst.ChildDressItemType.Lock and "激活" or "升级"
  373. -- if item2.type == ChildConst.ChildDressItemType.CanActive then
  374. -- self.btn_upgrade_txt_tmp.text = "激活"
  375. -- end
  376. --logWarn('=======Msh:ChildDressView.lua[414]=======')
  377. --print('Msh:ChildDressView.lua[415] data', item2.type, is_active, goods_name, have_num, need_num, isMax)
  378. if isMax then -- 时装已经激活 且 升满
  379. self.btn_upgrade_txt_tmp.text = "已满"
  380. self.awardCon_obj:SetActive(false)
  381. else -- 没有满级
  382. --local listCost = stringtotable(selectList.buy_price)
  383. self.awardCon_obj:SetActive(true)
  384. if not self.up_item then
  385. self.up_item = UIObjPool:PopItem(UIObjPool.UIType.AwardItem, self.awardCon)
  386. self.up_item:SetItemSize(62, 62)
  387. end
  388. --logWarn('=======Msh:ChildDressViewNew.lua[341]=======', type_id)
  389. --if selectList.is_vehicle then
  390. -- type_id = tonumber(stringtotable(selectList.upgrade_cost)[1][2])
  391. --end
  392. self.up_item:SetData(type_id)
  393. --local basic = GoodsModel:getInstance():GetGoodsBasicByTypeId(type_id)
  394. local get_str = HtmlColorTxt(have_num, have_num < need_num and ColorUtil.RED_DARK or ColorUtil.GREEN_DARK) .."/".. need_num
  395. self.up_item:SetNumStr("")
  396. self.up_item:IsGetGoods(true, get_str, true)
  397. end
  398. -- 时装战力
  399. local attr_list
  400. if selectList.lv > 0 then
  401. attr_list = stringtotable(selectList.attr_list)
  402. else
  403. if selectList.is_vehicle then
  404. attr_list = stringtotable(Config.Childvehicle[selectList.fashion_id .. "@1"].add_attr)
  405. else
  406. attr_list = stringtotable(Config.Childfashion[selectList.fashion_id .. "@1"].attr_list)
  407. end
  408. end
  409. local new_fight = "f"..GetFighting(attr_list)
  410. local need_effect = false -- 是否需要属性刷新特效
  411. if check_effect and (self.pre_lv and self.pre_lv < selectList.lv) then
  412. if not self.show_fight_effect then -- 特效
  413. need_effect = true
  414. local function call_back( )
  415. self.show_fight_effect = false
  416. end
  417. self.show_fight_effect = true
  418. self:ClearUIEffect(self.txt_fight)
  419. self:AddUIEffect("ui_jinjieshuxing", self.txt_fight,
  420. self.layer_name, Vector3(-180, 20, 0), 1, false, 0.75, nil, call_back)
  421. end
  422. end
  423. self.txt_fight_txt.text = new_fight
  424. -- 模型
  425. self:UpdateRoleModel(selectList.fashion_id, selectList.is_vehicle, need_effect)
  426. -- 时装属性
  427. --[[ local index = 0
  428. if need_effect then -- 特效刷新则滚到最上面
  429. SetLocalPositionY(self.content_attr, 0)
  430. end
  431. for k,v in pairs(attr_list) do
  432. index = index + 1
  433. local item = self.attr_item_list[k]
  434. if item == nil then
  435. item = ChildDressAttrItem.New(self.content_attr)
  436. self.attr_item_list[k] = item
  437. end
  438. local num = v[2]
  439. self.attr_item_list[k]:SetData(k,v[1],num, need_effect and index <= 3) -- 只显示前三个
  440. end--]]
  441. self.attrDes_tmp.text = ""
  442. for k,v in pairsByKeys(attr_list) do
  443. local _, name1, _, val1 = WordManager:GetPropertyInfo(v[1], v[2])
  444. if self.attrDes_tmp.text ~= "" then
  445. self.attrDes_tmp.text = self.attrDes_tmp.text .. " "
  446. end
  447. self.attrDes_tmp.text = self.attrDes_tmp.text .. name1 .. "" .. HtmlColorTxt( val1, ColorUtil.GREEN_DARK)
  448. end
  449. -- 设置进阶星星数
  450. local nowLevel = tonumber(selectList.lv)
  451. self.pre_lv = nowLevel
  452. for i = 1, 5 do
  453. if i < nowLevel/2 then
  454. if check_effect and tonumber(self.img_star_list[i].fillAmount) < 1 then
  455. self:PlayStarEffect(self.img_star_list[i].transform, i)
  456. end
  457. self.img_star_list[i].gameObject:SetActive(true)
  458. self.img_star_list[i].fillAmount = 1
  459. elseif (i-1) < nowLevel/2 then -- 最后一个
  460. self.img_star_list[i].gameObject:SetActive(true)
  461. if nowLevel % 2 ~= 0 then -- 单数就是一半
  462. if check_effect and tonumber(self.img_star_list[i].fillAmount) < 0.5 then
  463. self:PlayStarEffect(self.img_star_list[i].transform, i)
  464. end
  465. self.img_star_list[i].fillAmount = 0.5
  466. else
  467. if check_effect and tonumber(self.img_star_list[i].fillAmount) < 1 then
  468. self:PlayStarEffect(self.img_star_list[i].transform, i)
  469. end
  470. self.img_star_list[i].fillAmount = 1
  471. end
  472. else
  473. self.img_star_list[i].gameObject:SetActive(false)
  474. self.img_star_list[i].fillAmount = 0
  475. end
  476. end
  477. -- 按钮红点
  478. if not isMax then
  479. self.btn_upgrade_red_dot_obj:SetActive(have_num >= need_num )
  480. else
  481. self.btn_upgrade_red_dot_obj:SetActive(false)
  482. end
  483. -- 穿戴/脱下 按钮
  484. if selectList.is_vehicle then
  485. local cur_wear_id = self.model:GetChildVehicleID( )
  486. self.btn_wear_obj:SetActive(cur_wear_id ~= selectList.fashion_id)
  487. self.btn_unwear_obj:SetActive(cur_wear_id == selectList.fashion_id)
  488. else
  489. local cur_wear_id = self.model:GetCurWearID( )
  490. self.btn_wear_obj:SetActive(cur_wear_id ~= selectList.fashion_id)
  491. self.btn_unwear_obj:SetActive(cur_wear_id == selectList.fashion_id)
  492. end
  493. -- 初始化特效
  494. if self.need_check_effect then
  495. self.need_check_effect = false
  496. end
  497. end
  498. -- 播星星点亮特效
  499. function ChildDressViewNew:PlayStarEffect( tran, i )
  500. self.showing_star_effect = self.showing_star_effect or {}
  501. if true then
  502. if not self.showing_star_effect[i] then
  503. local function call_back( )
  504. self.showing_star_effect[i] = false
  505. end
  506. self:ClearUIEffect(tran)
  507. self:AddUIEffect("ui_jinjiestar", tran, self.layer_name, nil, 1, false, nil, nil, call_back)
  508. self.showing_star_effect[i] = true
  509. end
  510. end
  511. end
  512. function ChildDressViewNew:SwitchTab( index )
  513. end
  514. function ChildDressViewNew:DestroySuccess( )
  515. if self.up_item then
  516. UIObjPool:PushItem(UIObjPool.UIType.AwardItem, self.up_item)
  517. self.up_item = false
  518. end
  519. for i, v in pairs(self.attr_item_list) do
  520. v:DeleteMe()
  521. v = nil
  522. end
  523. self.attr_item_list = {}
  524. for i, v in pairs(self.dress_item_list) do
  525. v:DeleteMe()
  526. v = nil
  527. end
  528. self.dress_item_list = {}
  529. if self.UPDATA_CHILD_DRESS_INFO_id then
  530. self.model:UnBind(self.UPDATA_CHILD_DRESS_INFO_id)
  531. self.UPDATA_CHILD_DRESS_INFO_id = nil
  532. end
  533. -- if self.tab_win then
  534. -- self.tab_win:DeleteMe()
  535. -- self.tab_win = nil
  536. -- end
  537. end