add file open
This commit is contained in:
@@ -15,7 +15,7 @@ function _cell.init(csObj)
|
||||
uiobjs.Label = getCC(transform, "Label", "UILabel")
|
||||
uiobjs.ButtonDel = getChild(transform, "ButtonDel").gameObject
|
||||
uiobjs.SpriteIcon = getCC(transform, "SpriteIcon", "UISprite")
|
||||
|
||||
uiobjs.SpriteRight = getChild(transform, "SpriteRight").gameObject
|
||||
uiobjs.ButtonDownload = getChild(transform, "ButtonDownload").gameObject
|
||||
uiobjs.DownloadProgress = getChild(transform, "DownloadProgress")
|
||||
uiobjs.DownloadProgressLb = getCC(uiobjs.DownloadProgress, "Label", "UILabel")
|
||||
@@ -28,15 +28,19 @@ function _cell.show(go, data)
|
||||
SetActive(uiobjs.ButtonDel, false)
|
||||
uiobjs.Label.text = mData.name
|
||||
if MyUtl.isImage(mData.name) then
|
||||
--//TODO:
|
||||
uiobjs.SpriteIcon.spriteName = "work_img-icon"
|
||||
else
|
||||
uiobjs.SpriteIcon.spriteName = "work_wenjian-icon"
|
||||
end
|
||||
SetActive(uiobjs.DownloadProgress.gameObject, false)
|
||||
|
||||
--//TODO:权限判断,如果有权限的可以考虑直接显示图片
|
||||
if DBTextures.hadDownloaded(mData.name) then
|
||||
SetActive(uiobjs.ButtonDownload, false)
|
||||
SetActive(uiobjs.SpriteRight, true)
|
||||
else
|
||||
SetActive(uiobjs.ButtonDownload, true)
|
||||
SetActive(uiobjs.SpriteRight, false)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -62,6 +66,7 @@ function _cell.download()
|
||||
if content and localPath then
|
||||
-- 附件下载完成
|
||||
MyUtl.toastS(joinStr("附件已保存本地:" .. localPath))
|
||||
SetActive(uiobjs.SpriteRight, true)
|
||||
else
|
||||
SetActive(uiobjs.ButtonDownload, true)
|
||||
end
|
||||
@@ -77,17 +82,11 @@ function _cell.refreshProgress()
|
||||
else
|
||||
SetActive(uiobjs.DownloadProgress.gameObject, true)
|
||||
local progressVal = www.downloadProgress or 0 -- downloadProgress uploadProgress
|
||||
uiobjs.LabelPersent.text = joinStr(math.floor(progressVal * 100), "%")
|
||||
uiobjs.DownloadProgressLb.text = joinStr(math.floor(progressVal * 100), "%")
|
||||
end
|
||||
|
||||
csSelf:invoke4Lua(_cell.refreshProgress, 0.1)
|
||||
end
|
||||
|
||||
function _cell.uiEventDelegate(go)
|
||||
if go.name == "ButtonDownload" then
|
||||
_cell.download()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
|
||||
@@ -66,7 +66,10 @@ end
|
||||
function _cell.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if goName == "ButtonFollow" then
|
||||
getPanelAsy("PanelNewFollow", onLoadedPanelTT, mData)
|
||||
---@type _ParamTRPNewFollow
|
||||
local param = {}
|
||||
param.cust = mData
|
||||
getPanelAsy("PanelNewFollow", onLoadedPanelTT, param)
|
||||
elseif goName == "ButtonTask" then
|
||||
getPanelAsy("PanelNewFollowTask", onLoadedPanelTT, mData)
|
||||
elseif goName == "ButtonContact" then
|
||||
|
||||
@@ -26,6 +26,10 @@ end
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
mData._phoneNo = MyUtl.hidePhone(mData.phone)
|
||||
if isNilOrEmpty(mData.custName) then
|
||||
mData.custName = mData._phoneNo
|
||||
end
|
||||
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.followUpTypeList)
|
||||
uiobjs.LabelStatus:refreshItems(optionInfor.options, optionInfor.values)
|
||||
local optionInfor = DBUser.getPopList(DBUser.FilterGroup.user)
|
||||
|
||||
@@ -23,12 +23,14 @@ end
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
-- mData.money = mData.prodNum * mData.salePrice
|
||||
-- 修改数据
|
||||
mData._phoneNo = MyUtl.hidePhone(mData.phoneNo)
|
||||
if isNilOrEmpty(mData.custName) then
|
||||
mData.custName = mData._phoneNo
|
||||
end
|
||||
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
|
||||
@@ -36,11 +38,13 @@ function _cell.show(go, data)
|
||||
if DateTime.Now:ToFileTime() > bookingTime:ToFileTime() then
|
||||
--- 超时
|
||||
uiobjs.SpriteStatus.color = ColorEx.getColor(0xfff15a4a)
|
||||
mData.bookingDone = -1 --超时是特殊出来的
|
||||
else
|
||||
uiobjs.SpriteStatus.color = ColorEx.getColor(0xff999999)
|
||||
end
|
||||
end
|
||||
|
||||
uiobjs.formRoot:setValue(mData)
|
||||
_cell.setHeadIcon()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user