This commit is contained in:
2020-08-01 17:55:18 +08:00
parent 29a8a1dae3
commit 4435098171
160 changed files with 21247 additions and 2405 deletions

View File

@@ -0,0 +1,32 @@
-- xx单元
local _cell = {}
---@type Coolape.CLCellLua
local csSelf = nil
local transform = nil
local mData = nil
local uiobjs = {}
-- 初始化,只调用一次
function _cell.init(csObj)
csSelf = csObj
transform = csSelf.transform
uiobjs.Label = getCC(transform, "Label", "UILabel")
uiobjs.ButtonDel = getChild(transform, "ButtonDel").gameObject
uiobjs.SpriteIcon = getCC(transform, "SpriteIcon", "UISprite")
end
-- 显示,
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
uiobjs.Label.text = mData.name
--//TODO:权限判断,如果有权限的可以考虑直接显示图片
end
-- 取得数据
function _cell.getData()
return mData
end
--------------------------------------------
return _cell

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 278f1c6c3a34841fdb827858f0d72abc
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -26,17 +26,17 @@ end
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.followUpTypeList)
uiobjs.LabelStatus:refreshItems(optionInfor.options, optionInfor.values)
local optionInfor = DBUser.getPopList(DBUser.FilterGroup.user)
uiobjs.LabelServerNo:refreshItems(optionInfor.options, optionInfor.values)
if tostring(mData.dealFlag) == "0" then
SetActive(uiobjs.SpriteStatus.gameObject, true)
else
SetActive(uiobjs.SpriteStatus.gameObject, false)
end
uiobjs.LabelDate.text = string.sub(mData.createTime, 1, 10)
-- if tostring(mData.dealFlag) == "0" then
-- SetActive(uiobjs.SpriteStatus.gameObject, true)
-- else
-- SetActive(uiobjs.SpriteStatus.gameObject, false)
-- end
uiobjs.LabelDate.text = mData.recordingTime and string.sub(mData.recordingTime, 1, 10) or ""
uiobjs.formRoot:setValue(mData)

View File

@@ -1,6 +1,7 @@
---@class _ParamCellImage
---@field path string
---@field onDelete function
---@field uploadInfor table
-- xx单元
local _cell = {}
@@ -10,6 +11,7 @@ local transform = nil
---@type _ParamCellImage
local mData = nil
local uiobjs = {}
local www
-- 初始化,只调用一次
function _cell.init(csObj)
@@ -17,6 +19,10 @@ function _cell.init(csObj)
transform = csSelf.transform
---@type UITexture
uiobjs.texture = csSelf:GetComponent("UITexture")
uiobjs.SpriteProgress = getCC(transform, "SpriteProgress", "UISprite")
uiobjs.LabelPersent = getCC(uiobjs.SpriteProgress.transform, "LabelPersent", "UILabel")
uiobjs.Failed = getChild(transform, "Failed")
uiobjs.success = getChild(transform, "success")
end
-- 显示,
@@ -29,12 +35,51 @@ function _cell.show(go, data)
else
url = mData.path
end
print(url)
if uiobjs.texture.mainTexture and uiobjs.texture.mainTexture.name == mData.path then
else
_cell.release()
DBTextures.getByUrl(url, _cell.onGetTextue, mData.path)
end
SetActive(uiobjs.success.gameObject, false)
_cell.upload()
end
function _cell.upload()
SetActive(uiobjs.Failed.gameObject, false)
www =
DBTextures.upload(
mData.path,
DBOrder.getUploadPath(),
function(content)
www = nil
SetActive(uiobjs.SpriteProgress.gameObject, false)
if content and content.success then
mData.uploadInfor = content.result
SetActive(uiobjs.success.gameObject, true)
else
-- 显示重传按钮
SetActive(uiobjs.Failed.gameObject, true)
local msg = content and content.message or "上传失败"
MyUtl.toastW(msg)
end
end
)
_cell.refreshProgress()
end
function _cell.refreshProgress()
if www == nil then
SetActive(uiobjs.SpriteProgress.gameObject, false)
return
end
SetActive(uiobjs.SpriteProgress.gameObject, true)
local progressVal = www.uploadProgress or 0 -- downloadProgress uploadProgress
uiobjs.LabelPersent.text = PStr.b():a(math.floor(progressVal * 100)):a("%"):e()
uiobjs.SpriteProgress.fillAmount = progressVal
csSelf:invoke4Lua(_cell.refreshProgress, 0.1)
end
function _cell.onGetTextue(content, orgs)
@@ -61,7 +106,12 @@ end
function _cell.uiEventDelegate(go)
if go.name == "ButtonDel" then
csSelf:cancelInvoke4Lua(_cell.refreshProgress)
DBTextures.cancelUpload(mData.path, DBOrder.getUploadPath())
www = nil
Utl.doCallback(mData.onDelete, mData)
elseif go.name == "ButtonReload" then
_cell.upload()
end
end

View File

@@ -15,7 +15,6 @@ function _cell.init(csObj)
uiobjs.LabelStatus = getCC(transform, "LabelStatus", "UIPopupList")
---@type CLUIFormRoot
uiobjs.formRoot = csSelf:GetComponent("CLUIFormRoot")
uiobjs.SpriteStatus = getChild(transform, "SpriteStatus")
end
-- 显示,
@@ -24,14 +23,7 @@ function _cell.show(go, data)
mData = data
mData._phoneNo = MyUtl.hidePhone(mData.phoneNo)
mData.lastFollowUpTime = isNilOrEmpty(mData.upTime) and "" or mData.upTime
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
uiobjs.LabelStatus:refreshItems(optionInfor.options, optionInfor.values)
uiobjs.formRoot:setValue(mData)
if tostring(mData.dealFlag) == "0" then
SetActive(uiobjs.SpriteStatus.gameObject, true)
else
SetActive(uiobjs.SpriteStatus.gameObject, false)
end
end
-- 取得数据
@@ -39,5 +31,15 @@ function _cell.getData()
return mData
end
function _cell.uiEventDelegate(go)
if go.name == "ButtonGet" then
showHotWheel()
local params = {
ids = mData.id,
oprType = "byId"
}
NetProto.send.getFromGH(params)
end
end
--------------------------------------------
return _cell

View File

@@ -0,0 +1,68 @@
-- xx单元
local _cell = {}
---@type Coolape.CLCellLua
local csSelf = nil
local transform = nil
---@type _DBCust
local mData = nil
local uiobjs = {}
-- 初始化,只调用一次
function _cell.init(csObj)
csSelf = csObj
transform = csSelf.transform
---@type UIPopupList
uiobjs.LabelServerNo = getCC(transform, "LabelServerNo", "UIPopupList")
---@type CLUIFormRoot
uiobjs.formRoot = csSelf:GetComponent("CLUIFormRoot")
uiobjs.SpriteStatus = getCC(transform, "SpriteStatus", "UISprite")
uiobjs.SpriteHeadIcon = getCC(transform, "SpriteHeadBg/SpriteHeadIcon", "UITexture")
end
-- 显示,
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
-- mData.money = mData.prodNum * mData.salePrice
mData._phoneNo = MyUtl.hidePhone(mData.phoneNo)
local optionInfor = DBUser.getPopList(DBUser.FilterGroup.user)
uiobjs.LabelServerNo:refreshItems(optionInfor.options, optionInfor.values)
uiobjs.formRoot:setValue(mData)
if tonumber(mData.bookingDone) == 1 then
uiobjs.SpriteStatus.color = ColorEx.getColor(0xff27ae60)
else
local bookingTime = DateTime.Parse(mData.bookingTime)
if DateTime.Now:ToFileTime() > bookingTime:ToFileTime() then
--- 超时
uiobjs.SpriteStatus.color = ColorEx.getColor(0xfff15a4a)
else
uiobjs.SpriteStatus.color = ColorEx.getColor(0xff999999)
end
end
_cell.setHeadIcon()
end
function _cell.setHeadIcon()
---@type _DBUser
local user = DBUser.getUserById(mData.loginNo)
if user then
DBUser.getIcon(
mData.loginNo,
function(texture)
if texture and texture.name == user.imageUrl then
uiobjs.SpriteHeadIcon.mainTexture = texture
end
end
)
end
end
-- 取得数据
function _cell.getData()
return mData
end
--------------------------------------------
return _cell

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 46397f5cd6dc9464fbc5e4e68a21ae14
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: