2020-07-08
This commit is contained in:
@@ -86,8 +86,8 @@ do
|
||||
ButtonOK.localPosition = pos
|
||||
SetActive(Spriteline2.gameObject, false)
|
||||
else
|
||||
ButtonCancel.localPosition = buttonOkOrgPositon
|
||||
ButtonOK.localPosition = buttonCancelOrgPositon
|
||||
ButtonCancel.localPosition = buttonCancelOrgPositon
|
||||
ButtonOK.localPosition = buttonOkOrgPositon
|
||||
NGUITools.SetActive(ButtonCancel.gameObject, true)
|
||||
lbButtonCancel.text = lbbutton2
|
||||
SetActive(Spriteline2.gameObject, true)
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
-- xx界面
|
||||
local CLLPPopList = {}
|
||||
|
||||
---@type Coolape.CLPanelLua
|
||||
local csSelf = nil
|
||||
---@type UnityEngine.Transform
|
||||
local transform = nil
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
function CLLPPopList.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
---@type UISprite
|
||||
uiobjs.SpriteBg = getCC(transform, "Bottom/offset/SpriteBg", "UISprite")
|
||||
---@type CLUIPopListPanel
|
||||
uiobjs.popList = csSelf:GetComponent("CLUIPopListPanel")
|
||||
uiobjs.list = getChild(transform, "Bottom/offset/List")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
function CLLPPopList.setData(paras)
|
||||
end
|
||||
|
||||
--当有通用背板显示时的回调
|
||||
function CLLPPopList.onShowFrame()
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function CLLPPopList.show()
|
||||
if uiobjs.popList.items.Count == 1 then
|
||||
uiobjs.SpriteBg.height = 170
|
||||
uiobjs.list.localPosition = Vector3(0, -340, 0)
|
||||
elseif uiobjs.popList.items.Count == 2 then
|
||||
uiobjs.SpriteBg.height = 340
|
||||
uiobjs.list.localPosition = Vector3(0, -170, 0)
|
||||
else
|
||||
uiobjs.SpriteBg.height = 510
|
||||
uiobjs.list.localPosition = Vector3.zero
|
||||
end
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function CLLPPopList.refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CLLPPopList.hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function CLLPPopList.procNetwork(cmd, succ, msg, paras)
|
||||
--[[
|
||||
if(succ == NetSuccess) then
|
||||
if(cmd == "xxx") then
|
||||
-- TODO:
|
||||
end
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function CLLPPopList.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
--[[
|
||||
if(goName == "xxx") then
|
||||
--TODO:
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function CLLPPopList.onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function CLLPPopList.hideSelfOnKeyBack()
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return CLLPPopList
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e471a865b3e54bffac09db464d469c4
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -143,9 +143,9 @@ do
|
||||
CLLPSplash.upgradeGame(MapEx.getString(map, "url"))
|
||||
end
|
||||
if MapEx.getBool(map, "force") then
|
||||
CLUIUtl.showConfirm(LGet("MsgHadNewVerApp"), true, LGet("Update"), doUpgradeApp, "", nil)
|
||||
CLUIUtl.showConfirm(LGet("MsgHadNewVerApp"), true, "更新", doUpgradeApp, "", nil)
|
||||
else
|
||||
CLUIUtl.showConfirm(LGet("MsgHadNewVerApp"), false, LGet("Update"), doUpgradeApp, LGet("UpdateLater"), CLLPSplash.updateRes)
|
||||
CLUIUtl.showConfirm(LGet("MsgHadNewVerApp"), false, "更新", doUpgradeApp, "忽略", CLLPSplash.updateRes)
|
||||
end
|
||||
else
|
||||
CLLPSplash.updateRes()
|
||||
@@ -153,7 +153,7 @@ do
|
||||
end
|
||||
|
||||
local onGetVerError = function(msg, orgs)
|
||||
CLAlert.add(LGet("MsgCheckAppUpgradeFail"), Color.white, 1)
|
||||
-- CLAlert.add(LGet("MsgCheckAppUpgradeFail"), Color.white, 1)
|
||||
CLLPSplash.updateRes()
|
||||
end
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ end
|
||||
---@param paras _ParamTRPCustDetail
|
||||
function TRPCustDetail:setData(paras)
|
||||
self.mdata = paras
|
||||
if type(self.mdata.jsonstr) == "string" then
|
||||
self.mdata.jsonstr = json.decode(self.mdata.jsonstr)
|
||||
if type(self.mdata.jsonStr) == "string" then
|
||||
self.mdata.jsonStr = json.decode(self.mdata.jsonStr)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ end
|
||||
|
||||
function TRPCustList:onShowRefreshFlg()
|
||||
-- printe("TRPCustList:onShowRefreshFlg")
|
||||
uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 250, 0)
|
||||
uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 300, 0)
|
||||
SetActive(uiobjs.ButtonHeadList.gameObject, true)
|
||||
end
|
||||
function TRPCustList:onhideRefreshFlg()
|
||||
@@ -86,7 +86,7 @@ function TRPCustList:onEndList(tail)
|
||||
-- 取得下一页
|
||||
NetProto.send.list_customers(self.filterValue, queryKey, self.pageInfo.current_page + 1)
|
||||
else
|
||||
uiobjs.ButtonEndList.localPosition = tail.transform.localPosition + Vector3.up * -270
|
||||
uiobjs.ButtonEndList.localPosition = tail.transform.localPosition + Vector3.up * -300
|
||||
SetActive(uiobjs.ButtonEndList.gameObject, true)
|
||||
end
|
||||
end
|
||||
@@ -141,6 +141,8 @@ function TRPCustList:procNetwork(cmd, succ, msg, paras)
|
||||
hideHotWheel()
|
||||
elseif cmd == NetProto.cmds.update_customer then
|
||||
uiobjs.Grid:refreshContentOnly()
|
||||
elseif cmd == NetProto.cmds.save_customer then
|
||||
self:refreshList()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,6 +29,8 @@ function TRPNewCust:init(csObj)
|
||||
uiobjs.starGridPrefab2 = getChild(uiobjs.starGrid2.transform, "00000").gameObject
|
||||
|
||||
uiobjs.ExtendRoot = getCC(uiobjs.Table.transform, "ExtendRoot", "CLCellLua")
|
||||
---@type CLUIFormRoot
|
||||
uiobjs.ExtendFormRoot = uiobjs.ExtendRoot:GetComponent("CLUIFormRoot")
|
||||
uiobjs.elements = uiobjs.DetailRoot.gameObject:GetComponentsInChildren(typeof(CLUIElement), true)
|
||||
uiobjs.ButtonSave = getChild(self.transform, "Top/ButtonSave")
|
||||
end
|
||||
@@ -48,9 +50,10 @@ function TRPNewCust:setData(paras)
|
||||
self.mdata.serviceNo = NetProto.loginNo
|
||||
self.mdata.customerLabel = 1
|
||||
end
|
||||
if type(self.mdata.jsonstr) == "string" then
|
||||
self.mdata.jsonstr = json.decode(self.mdata.jsonstr)
|
||||
if type(self.mdata.jsonStr) == "string" then
|
||||
self.mdata.jsonStr = json.decode(self.mdata.jsonStr)
|
||||
end
|
||||
self.mdata.jsonStr = self.mdata.jsonStr or {}
|
||||
end
|
||||
|
||||
---public 当有通用背板显示时的回调
|
||||
@@ -140,6 +143,9 @@ function TRPNewCust:onClickStar(cell, data)
|
||||
v.value = false
|
||||
end
|
||||
end
|
||||
if self.isNewCust then
|
||||
self.mdata.customerLabel = data.index
|
||||
end
|
||||
CLUIUtl.resetList4Lua(uiobjs.starGrid2, uiobjs.starGridPrefab2, stars, self:wrapFunc(self.initStarCell))
|
||||
if (not self.isNewCust) and data.index ~= self.mdata.customerLabel then
|
||||
-- 说明更改了星级
|
||||
@@ -169,12 +175,17 @@ function TRPNewCust:setElementMode(el)
|
||||
local input = el:GetComponent("UIInput")
|
||||
local inputOnGUI = el:GetComponent("UIInputOnGUI")
|
||||
local boxcollider = el:GetComponent("BoxCollider")
|
||||
local ButtonReset = getCC(el.transform, "ButtonReset", "MyInputReset")
|
||||
|
||||
if (not self.isNewCust) and (el.jsonKey == "taskId" or el.jsonKey == "phoneNo") then
|
||||
boxcollider.enabled = false
|
||||
else
|
||||
boxcollider.enabled = true
|
||||
end
|
||||
|
||||
if ButtonReset then
|
||||
ButtonReset.disabled = (not self.isNewCust)
|
||||
end
|
||||
if input then
|
||||
if isPopList or isPopCheckbox then
|
||||
input.enabled = false
|
||||
@@ -266,7 +277,7 @@ function TRPNewCust:sendModifymsg(key, val, isExtend)
|
||||
local content = {}
|
||||
content.id = self.mdata.custId
|
||||
if isExtend then
|
||||
content.jsonstr = {[key] = val}
|
||||
content.jsonStr = {[key] = val}
|
||||
else
|
||||
content[key] = val
|
||||
end
|
||||
@@ -278,10 +289,11 @@ function TRPNewCust:sendModifymsg(key, val, isExtend)
|
||||
if result.success then
|
||||
-- 更新本地数据
|
||||
if isExtend then
|
||||
self.mdata.jsonstr[key] = val
|
||||
self.mdata.jsonStr[key] = val
|
||||
else
|
||||
self.mdata[key] = val
|
||||
end
|
||||
CLAlert.add("修改成功", Color.white, 1)
|
||||
end
|
||||
end
|
||||
)
|
||||
@@ -295,7 +307,7 @@ function TRPNewCust:onPopupFieldValChg4Extend(go)
|
||||
local el = go:GetComponent("CLUIElement")
|
||||
if el then
|
||||
local err = el:checkValid()
|
||||
if (not isNilOrEmpty(el.value)) and tostring(el.value) ~= tostring(self.mdata.jsonstr[el.jsonKey]) then
|
||||
if (not isNilOrEmpty(el.value)) and tostring(el.value) ~= tostring(self.mdata.jsonStr[el.jsonKey]) then
|
||||
if isNilOrEmpty(err) then
|
||||
-- 有修改,发送数据
|
||||
self:sendModifymsg(el.jsonKey, el.value, true)
|
||||
@@ -329,7 +341,7 @@ function TRPNewCust:onClickInputField4Extend(go)
|
||||
end
|
||||
|
||||
function TRPNewCust:onFinishSetField4Extend(key, val)
|
||||
if tostring(val) ~= tostring(self.mdata.jsonstr[key]) then
|
||||
if tostring(val) ~= tostring(self.mdata.jsonStr[key]) then
|
||||
self:sendModifymsg(key, val, true)
|
||||
end
|
||||
end
|
||||
@@ -337,6 +349,27 @@ end
|
||||
function TRPNewCust:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonSave = function()
|
||||
local err = uiobjs.DetailRoot:checkValid()
|
||||
err = joinStr(err, uiobjs.ExtendFormRoot:checkValid())
|
||||
if not isNilOrEmpty(err) then
|
||||
CLAlert.add(err, Color.yellow, 1)
|
||||
return
|
||||
end
|
||||
|
||||
local cust = uiobjs.DetailRoot:getValue(true)
|
||||
cust.customerLabel = self.mdata.customerLabel
|
||||
local jsonStr = uiobjs.ExtendFormRoot:getValue(true)
|
||||
cust.jsonStr = jsonStr
|
||||
showHotWheel()
|
||||
NetProto.send.save_customer(
|
||||
cust,
|
||||
function(content)
|
||||
if content.success then
|
||||
getPanelAsy("PanelCustDetail", onLoadedPanel, cust)
|
||||
end
|
||||
hideHotWheel()
|
||||
end
|
||||
)
|
||||
end,
|
||||
InputTask = function()
|
||||
if self.isNewCust then
|
||||
|
||||
Reference in New Issue
Block a user