add file open

This commit is contained in:
2020-08-07 22:40:04 +08:00
parent c1e3f992aa
commit f9bedd2c62
115 changed files with 9835 additions and 1096 deletions

View File

@@ -86,8 +86,14 @@ do
ButtonOK.localPosition = pos
SetActive(Spriteline2.gameObject, false)
else
ButtonCancel.localPosition = buttonCancelOrgPositon
ButtonOK.localPosition = buttonOkOrgPositon
local pos = ButtonCancel.localPosition
pos.x = buttonCancelOrgPositon.x
ButtonCancel.localPosition = pos
local pos = ButtonOK.localPosition
pos.x = buttonOkOrgPositon.x
ButtonOK.localPosition = pos
NGUITools.SetActive(ButtonCancel.gameObject, true)
lbButtonCancel.text = lbbutton2
SetActive(Spriteline2.gameObject, true)

View File

@@ -1,4 +1,9 @@
---@type IDBasePanel
---@class _ParamTRPCustDetail
---@field cust
---@field bookingData
---@field needShowMore
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPCustDetail:TRBasePanel 邮件列表
local TRPCustDetail = class("TRPCustDetail", TRBasePanel)
@@ -36,6 +41,8 @@ function TRPCustDetail:init(csObj)
uiobjs.SpriteToggle.cellWidth = width
---@type UIToggle
uiobjs.ToggleDetail = getCC(uiobjs.SpriteToggle.transform, "ToggleDetail", "UIToggle")
---@type UIToggle
uiobjs.ToggleMore = getCC(uiobjs.SpriteToggle.transform, "ToggleMore", "UIToggle")
---@type CLUIFormRoot
uiobjs.DetailRoot = getCC(uiobjs.Table.transform, "DetailRoot", "CLUIFormRoot")
uiobjs.InputTask = getCC(uiobjs.DetailRoot.transform, "InputTask", "UIPopupList")
@@ -154,25 +161,27 @@ function TRPCustDetail:prepareMoreData()
attr.donotJoinKey = true
table.insert(self.sysFields, attr)
---@type _ParamFieldAttr
attr = {}
attr.id = "followupTime"
attr.attrName = "下次跟进"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.height = 180
attr.donotJoinKey = true
table.insert(self.sysFields, attr)
-- attr = {}
-- attr.id = "followupTime"
-- attr.attrName = "下次跟进"
-- attr.attrType = DBCust.FieldType.text
-- attr.ifMust = 0
-- attr.height = 180
-- attr.donotJoinKey = true
-- table.insert(self.sysFields, attr)
end
-- 设置数据
---@param paras _ParamTRPCustDetail
function TRPCustDetail:setData(paras)
---@type _DBCust
self.mdata = paras
self.mdata = paras.cust
self.mdata._phoneNo = MyUtl.hidePhone(self.mdata.phoneNo)
if type(self.mdata.jsonStr) == "string" then
self.mdata.jsonStr = json.decode(self.mdata.jsonStr)
end
self.bookingData = paras.bookingData
self.needShowMore = paras.needShowMore
end
---public 当有通用背板显示时的回调
@@ -190,6 +199,7 @@ end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPCustDetail:show()
-- SetActive(uiobjs.ToggleMore.gameObject, self.needShowMore)
self.records = nil
self.orders = nil
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
@@ -448,10 +458,10 @@ end
function TRPCustDetail:onClickMoreProc(el)
if el.jsonKey == "follows" then
-- 跟进记录
getPanelAsy("PanelFollowList", onLoadedPanelTT, {custId = self.mdata.custId})
getPanelAsy("PanelFollowList4Cust", onLoadedPanelTT, {custId = self.mdata.custId})
elseif el.jsonKey == "followTasks" then
-- 预约记录
getPanelAsy("PanelTaskList", onLoadedPanelTT, {custId = self.mdata.custId})
getPanelAsy("PanelTaskList4Cust", onLoadedPanelTT, {custId = self.mdata.custId})
elseif el.jsonKey == "smsList" then
-- 短信记录
elseif el.jsonKey == "opList" then
@@ -561,7 +571,11 @@ function TRPCustDetail:setEventDelegate()
self:showMore()
end,
ButtonNewFollow = function()
getPanelAsy("PanelNewFollow", onLoadedPanelTT, self.mdata)
---@type _ParamTRPNewFollow
local param = {}
param.cust = self.mdata
param.bookingData = self.bookingData
getPanelAsy("PanelNewFollow", onLoadedPanelTT, param)
end,
ButtonNewTask = function()
getPanelAsy("PanelNewFollowTask", onLoadedPanelTT, self.mdata)

View File

@@ -168,7 +168,12 @@ function TRPCustList:initCell(cell, data)
end
function TRPCustList:onClickCell(cell, data)
getPanelAsy("PanelCustDetail", onLoadedPanelTT, data)
---@type _ParamTRPCustDetail
local param = {}
param.cust = data
param.bookingData = nil
param.needShowMore = true
getPanelAsy("PanelCustDetail", onLoadedPanelTT, param)
end
function TRPCustList:refreshFilterBtnStatus()

View File

@@ -166,7 +166,10 @@ function TRPFollowList:initCell(cell, data)
end
function TRPFollowList:onClickCell(cell, data)
getPanelAsy("PanelNewFollow", onLoadedPanelTT, data)
---@type _ParamTRPNewFollow
local param = {}
param.followData = data
getPanelAsy("PanelNewFollow", onLoadedPanelTT, param)
end
function TRPFollowList:refreshFilterBtnStatus()

View File

@@ -396,7 +396,12 @@ function TRPNewCust:setEventDelegate()
cust,
function(content)
if content.success then
getPanelAsy("PanelCustDetail", onLoadedPanel, content.result)
---@type _ParamTRPCustDetail
local param = {}
param.cust = content.result
param.bookingData = nil
param.needShowMore = true
getPanelAsy("PanelCustDetail", onLoadedPanel, param)
end
hideHotWheel()
end

View File

@@ -1,4 +1,9 @@
---@type IDBasePanel
---@class _ParamTRPNewFollow
---@field cust
---@field followData
---@field bookingData
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPNewFollow:TRBasePanel 邮件列表
local TRPNewFollow = class("TRPNewFollow", TRBasePanel)
@@ -111,14 +116,17 @@ end
-- 设置数据
---@param paras _ParamTRPNewFollow
function TRPNewFollow:setData(paras)
if paras.recordingTime then
self.mdata = paras
self.cust = paras.cust
self.mdata = paras.followData
self.bookingData = paras.bookingData
if self.mdata and self.mdata.recordingTime then
self.isNewFollow = false
else
self.mdata = {}
self.mdata.custId = paras.custId
self.mdata.taskId = paras.taskId
self.mdata.custName = paras.custName
self.mdata.custId = self.cust.custId
self.mdata.taskId = self.cust.taskId
self.mdata.custName = self.cust.custName
self.mdata.opportunity = "0"
self.mdata.followUpType = "0"
@@ -244,12 +252,19 @@ function TRPNewFollow:setEventDelegate()
return
end
self.mdata = uiobjs.DetailFromRoot:getValue(self.mdata, true)
if self.bookingData then
self.mdata.bookingId = self.bookingData.bookingId
end
showHotWheel()
NetProto.send.create_followUp_record(
self.mdata,
function(content)
hideHotWheel()
if content.success then
if self.bookingData then
-- 刷新预约的状态
self.bookingData.bookingDone = "1"
end
MyUtl.toastS("保存成功")
hideTopPanel(self.csSelf)
end
@@ -267,12 +282,14 @@ function TRPNewFollow:setEventDelegate()
hideHotWheel()
if content.success then
local cust = content.result
---@type _ParamTRPCustDetail
local param = {}
param.cust = cust
param.bookingData = self.mdata
param.needShowMore = false
if cust then
getPanelAsy(
"PanelCustDetailSimple",
onLoadedPanelTT,
{cust = cust, isShowButtonGet = false}
)
getPanelAsy("PanelCustDetail", onLoadedPanelTF, param)
end
end
end

View File

@@ -25,6 +25,7 @@ function TRPNewFollowTask:init(csObj)
uiobjs.ButtonSave = getChild(self.transform, "Top/ButtonSave")
uiobjs.ButtonCustDetail = getChild(self.transform, "ButtonCustDetail")
uiobjs.ButtonNewFollow = getChild(self.transform, "ButtonNewFollow")
end
function TRPNewFollowTask:initFiledsAttr()
@@ -99,13 +100,16 @@ end
function TRPNewFollowTask:show()
if self.isNewFollow then
SetActive(uiobjs.ButtonCustDetail.gameObject, false)
SetActive(uiobjs.ButtonNewFollow.gameObject, false)
else
---@type Coolape.CLPanelLua
local panel = CLPanelManager.getPanel("PanelCustDetail")
if panel and panel.gameObject.activeInHierarchy then
SetActive(uiobjs.ButtonCustDetail.gameObject, false)
SetActive(uiobjs.ButtonNewFollow.gameObject, false)
else
SetActive(uiobjs.ButtonCustDetail.gameObject, true)
SetActive(uiobjs.ButtonNewFollow.gameObject, true)
end
end
@@ -232,6 +236,8 @@ function TRPNewFollowTask:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.update_customer then
self:refreshContent()
elseif cmd == NetProto.cmds.create_followUp_record then
self:refreshContent()
end
end
end
@@ -245,6 +251,12 @@ function TRPNewFollowTask:setEventDelegate()
return
end
self.mdata = uiobjs.DetailFromRoot:getValue(self.mdata, true)
-- 时间处理
local setDt = DateTime.Parse( self.mdata.bookingTime)
if setDt:ToFileTime() < DateTime.Now:ToFileTime() then
MyUtl.toastW("预约时间已过,请选择未来的预约时间")
return
end
showHotWheel()
NetProto.send.create_followUp_task(
self.mdata,
@@ -266,15 +278,27 @@ function TRPNewFollowTask:setEventDelegate()
if content.success then
local cust = content.result
if cust then
---@type _ParamTRPCustDetail
local param = {}
param.cust = cust
param.bookingData = self.mdata
param.needShowMore = false
getPanelAsy(
"PanelCustDetailSimple",
onLoadedPanelTT,
{cust = cust, isShowButtonGet = false}
"PanelCustDetail",
onLoadedPanelTF,
param
)
end
end
end
)
end,
ButtonNewFollow = function()
---@type _ParamTRPNewFollow
local param = {}
param.cust = self.mdata
param.bookingData = self.mdata
getPanelAsy("PanelNewFollow", onLoadedPanelTT, param)
end
}
end

View File

@@ -252,7 +252,7 @@ function TRPOrderDetail:showExtentFiles(templetId)
param.data = self.mdata and self.mdata.attrJson or {}
param.onFinish = self:wrapFunc(self.reposition)
param.fields = {}
local fields = DBCust.getFieldsByTask(templetId) or {}
local fields = DBOrder.getFields(templetId) or {}
---@type _ParamCellExtendFiled
local filedInfor
for i, v in ipairs(fields) do
@@ -301,13 +301,15 @@ function TRPOrderDetail:onClickAttachment(cell, data)
false,
"打开",
function()
Application.OpenURL(joinStr("file://", path))
-- Application.OpenURL(joinStr("file://", path))
MyFileOpen.open(path)
end,
"取消",
nil
)
else
MyUtl.toastW("附件未下载完成,暂时无法查看")
cell.luaTable.download()
-- MyUtl.toastW("附件未下载完成,暂时无法查看")
end
end

View File

@@ -103,9 +103,15 @@ function TRPResetPasswordStep2:setEventDelegate()
data,
function(content)
if content.success then
MyUtl.toastS("绑定手机号成功")
Prefs.setUserName(self.mData.phone)
hideTopPanel(self.csSelf)
hideTopPanel()
MyUtl.toastS("绑定手机号成功")
hideTopPanel()
hideTopPanel()
hideTopPanel()
hideTopPanel()
getPanelAsy("PanelLogin", onLoadedPanel)
end
end
)

View File

@@ -242,6 +242,8 @@ function TRPTaskList:procNetwork(cmd, succ, msg, paras)
uiobjs.Grid:refreshContentOnly()
elseif cmd == NetProto.cmds.save_customer then
self:refreshList()
elseif cmd == NetProto.cmds.create_followUp_record then
uiobjs.Grid:refreshContentOnly()
end
end
end