Commit a5c118bd authored by lujunye's avatar lujunye

分销员接口修改

parent a997896c
...@@ -239,7 +239,7 @@ class FXYGL_ViewController: BaseViewController, UISearchBarDelegate, SearchBarVi ...@@ -239,7 +239,7 @@ class FXYGL_ViewController: BaseViewController, UISearchBarDelegate, SearchBarVi
self.tableView?.mj_header?.endRefreshing() self.tableView?.mj_header?.endRefreshing()
self.page = 2 self.page = 2
if model.data?.res?.count == 0 { if model.data?.res?.count == nil {
self.tableView?.mj_footer?.endRefreshingWithNoMoreData() self.tableView?.mj_footer?.endRefreshingWithNoMoreData()
}else{ }else{
self.tableView?.mj_footer?.endRefreshing() self.tableView?.mj_footer?.endRefreshing()
...@@ -257,7 +257,7 @@ class FXYGL_ViewController: BaseViewController, UISearchBarDelegate, SearchBarVi ...@@ -257,7 +257,7 @@ class FXYGL_ViewController: BaseViewController, UISearchBarDelegate, SearchBarVi
] ]
dbtManageQuery(dic, success: { (data) in dbtManageQuery(dic, success: { (data) in
let model = data as! dbtManageQueryModel let model = data as! dbtManageQueryModel
if model.data?.res?.count == 0 { if model.data?.res?.count == nil {
self.tableView?.mj_footer?.endRefreshingWithNoMoreData() self.tableView?.mj_footer?.endRefreshingWithNoMoreData()
}else{ }else{
self.page += 1 self.page += 1
......
...@@ -42,13 +42,12 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi ...@@ -42,13 +42,12 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "FXSY_Cell") as! FXSY_Cell let cell = tableView.dequeueReusableCell(withIdentifier: "FXSY_Cell") as! FXSY_Cell
let data = model?.res![indexPath.row] let data = dataArr[indexPath.row]
if data != nil { cell.order_id_lbl.text = "#"+(data.record_sn)!
cell.order_id_lbl.text = "#"+(data?.record_sn)! cell.time_lbl.text = data.add_time!
cell.time_lbl.text = data?.add_time! cell.price_lbl.text = data.in_amount!
cell.price_lbl.text = data?.in_amount! cell.order_id_lbl2.text = data.order_sn! + "(" + data.remark! + ")"
cell.order_id_lbl2.text = (data?.order_sn!)! + "(" + (data?.remark!)! + ")"
}
return cell return cell
} }
...@@ -241,104 +240,152 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi ...@@ -241,104 +240,152 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi
let arr = getDate() let arr = getDate()
date_lbl.text = "\(arr.first!)\(arr[1])\(arr.last!)日" date_lbl.text = "\(arr.first!)\(arr[1])\(arr.last!)日"
// loadData(dic: dic)
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData)) headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
gys_list.mj_header = self.headerMJ gys_list.mj_header = self.headerMJ
gys_list.mj_header?.beginRefreshing() gys_list.mj_header?.beginRefreshing()
footerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadMoreData))
gys_list.mj_footer = self.footerMJ
} }
var isFirstTime = true var isFirstTime = true
// var isNonFirst = false var page = 0
@objc func loadData(){
//MARK:--加载更多数据
@objc func loadMoreData(){
print("加载更多数据")
var dic:Dictionary<String,Any>! var dic:Dictionary<String,Any>!
// if isNonFirst { var year = "0"
var year = "0" var month = "0"
var month = "0" var day = "0"
var day = "0" if strNowTime.count == 4 {
if strNowTime.count == 4 { year = strNowTime
year = strNowTime }else if strNowTime.count > 4 && strNowTime.count <= 7 {
}else if strNowTime.count > 4 && strNowTime.count <= 7 { let arr = strNowTime.components(separatedBy: "-")
let arr = strNowTime.components(separatedBy: "-") year = arr.first!
year = arr.first! month = arr.last!
month = arr.last! }else{
}else{ let arr = strNowTime.components(separatedBy: "-")
let arr = strNowTime.components(separatedBy: "-") year = arr.first!
year = arr.first! month = arr[1]
month = arr[1] day = arr.last!
day = arr.last! }
}
dic = ["user_token":UserToken as Any,
dic = ["user_token":UserToken as Any, "role_type":role_type as Any,
"role_type":role_type as Any, "inc_exp_type":inc_exp_type as Any,
"inc_exp_type":inc_exp_type as Any, "keyword":keyword as Any,
"keyword":keyword as Any, "year":year as Any,
"year":year as Any, "month":month as Any,
"month":month as Any, "day":day as Any,
"day":day as Any "page":page as Any
] ]
// }else{
// isNonFirst = true
// dic = ["user_token":UserToken as Any,
// "role_type":"" as Any,
// "inc_exp_type":inc_exp_type as Any,
// "keyword":keyword as Any,
// "year":"" as Any,
// "month":"" as Any,
// "day":"" as Any
// ]
// }
dbtIncomeInfo(dic) { (data) in dbtIncomeInfo(dic) { (data) in
let dateModel = data as! dbtIncomeInfoModel let dateModel = data as! dbtIncomeInfoModel
self.model = dateModel.data self.model = dateModel.data
if self.model?.inc != nil { if self.model?.res?.count == nil {
self.income_lbl.text = "收入:¥"+String(format: "%.02f", self.model?.inc! as! CVarArg) self.gys_list?.mj_footer?.endRefreshingWithNoMoreData()
self.income_lbl.isHidden = false
}else{ }else{
self.income_lbl.isHidden = true self.page += 1
self.model?.res?.forEach({ (item) in
self.dataArr.append(item)
})
self.gys_list.reloadData()
self.gys_list?.mj_footer?.endRefreshing()
} }
} failture: { (err) in
if self.model?.exp != nil { self.gys_list.mj_footer?.endRefreshing()
self.refuse_lbl.text = "支出:¥"+String(format: "%.02f", self.model?.exp! as! CVarArg) }
self.refuse_lbl.isHidden = false }
@objc func loadData(){
var dic:Dictionary<String,Any>!
page = 1
var year = "0"
var month = "0"
var day = "0"
if strNowTime.count == 4 {
year = strNowTime
}else if strNowTime.count > 4 && strNowTime.count <= 7 {
let arr = strNowTime.components(separatedBy: "-")
year = arr.first!
month = arr.last!
}else{
let arr = strNowTime.components(separatedBy: "-")
year = arr.first!
month = arr[1]
day = arr.last!
}
dic = ["user_token":UserToken as Any,
"role_type":role_type as Any,
"inc_exp_type":inc_exp_type as Any,
"keyword":keyword as Any,
"year":year as Any,
"month":month as Any,
"day":day as Any,
"page":page as Any
]
dbtIncomeInfo(dic) { (data) in
let dateModel = data as! dbtIncomeInfoModel
self.model = dateModel.data
if self.model?.res?.count == nil {
self.gys_list?.mj_header?.endRefreshing()
self.gys_list?.mj_footer?.endRefreshingWithNoMoreData()
}else{ }else{
self.refuse_lbl.isHidden = true if self.model?.inc != nil {
} self.income_lbl.text = "收入:¥"+String(format: "%.02f", self.model?.inc! as! CVarArg)
self.income_lbl.isHidden = false
self.dataArr.removeAll() }else{
self.model?.res?.forEach({ (item) in self.income_lbl.isHidden = true
self.dataArr.append(item)
})
self.gys_list.reloadData()
if self.isFirstTime {
self.isFirstTime = false
if self.model?.is_dbt == 1 && self.model?.is_sup == 0 {
self.role_type = 2
self.left_btn.isSelected = false
self.right_btn.isSelected = true
self.bottom_line.snp.updateConstraints { (make) in
make.left.width.equalTo(ScreenWidth*0.5)
make.height.equalTo(3)
make.top.equalTo(self.left_btn.snp_bottom)
}
} }
if self.model?.is_sup == 1 && self.model?.is_dbt == 1 { if self.model?.exp != nil {
self.top_view.isHidden = false self.refuse_lbl.text = "支出:¥"+String(format: "%.02f", self.model?.exp! as! CVarArg)
self.bottom_line.isHidden = false self.refuse_lbl.isHidden = false
SetTopFrame(view: self.top_view, height: 44)
}else{ }else{
self.top_view.isHidden = true self.refuse_lbl.isHidden = true
SetTopFrame(view: self.top_view, height: 0.00001)
} }
self.dataArr.removeAll()
if self.isFirstTime {
self.isFirstTime = false
if self.model?.is_dbt == 1 && self.model?.is_sup == 0 {
self.role_type = 2
self.left_btn.isSelected = false
self.right_btn.isSelected = true
self.bottom_line.snp.updateConstraints { (make) in
make.left.width.equalTo(ScreenWidth*0.5)
make.height.equalTo(3)
make.top.equalTo(self.left_btn.snp_bottom)
}
}
if self.model?.is_sup == 1 && self.model?.is_dbt == 1 {
self.top_view.isHidden = false
self.bottom_line.isHidden = false
SetTopFrame(view: self.top_view, height: 44)
}else{
self.top_view.isHidden = true
SetTopFrame(view: self.top_view, height: 0.00001)
}
}
self.page = 2
self.model?.res?.forEach({ (item) in
self.dataArr.append(item)
})
self.gys_list?.mj_header?.endRefreshing()
self.gys_list.reloadData()
} }
self.gys_list.mj_header?.endRefreshing()
} failture: { (err) in } failture: { (err) in
self.gys_list.mj_header?.endRefreshing() self.gys_list.mj_header?.endRefreshing()
} }
......
...@@ -228,7 +228,7 @@ class KHXQ_ViewController: BaseViewController, TimeShowDownViewDeleagte, UISearc ...@@ -228,7 +228,7 @@ class KHXQ_ViewController: BaseViewController, TimeShowDownViewDeleagte, UISearc
self.tableView?.mj_header?.endRefreshing() self.tableView?.mj_header?.endRefreshing()
self.page = 2 self.page = 2
if model.data?.count == 0 { if model.data?.count == nil {
self.tableView?.mj_footer?.endRefreshingWithNoMoreData() self.tableView?.mj_footer?.endRefreshingWithNoMoreData()
}else{ }else{
self.tableView?.mj_footer?.endRefreshing() self.tableView?.mj_footer?.endRefreshing()
...@@ -248,7 +248,7 @@ class KHXQ_ViewController: BaseViewController, TimeShowDownViewDeleagte, UISearc ...@@ -248,7 +248,7 @@ class KHXQ_ViewController: BaseViewController, TimeShowDownViewDeleagte, UISearc
] ]
dbtCustomerInfo(dic, success: { (data) in dbtCustomerInfo(dic, success: { (data) in
let model = data as! dbtCustomerInfoModel let model = data as! dbtCustomerInfoModel
if model.data?.count == 0 { if model.data?.count == nil {
self.tableView?.mj_footer?.endRefreshingWithNoMoreData() self.tableView?.mj_footer?.endRefreshingWithNoMoreData()
}else{ }else{
self.page += 1 self.page += 1
......
...@@ -233,7 +233,7 @@ class DSHFXY_ViewController: BaseViewController, HeaderSelectViewDelegate, TimeS ...@@ -233,7 +233,7 @@ class DSHFXY_ViewController: BaseViewController, HeaderSelectViewDelegate, TimeS
self.tableView.reloadData() self.tableView.reloadData()
self.page = 2 self.page = 2
self.tableView.mj_header?.endRefreshing() self.tableView.mj_header?.endRefreshing()
if model.data?.count == 0 { if model.data?.count == nil {
self.tableView.mj_footer?.endRefreshingWithNoMoreData() self.tableView.mj_footer?.endRefreshingWithNoMoreData()
}else{ }else{
self.tableView.mj_footer?.endRefreshing() self.tableView.mj_footer?.endRefreshing()
...@@ -257,7 +257,7 @@ class DSHFXY_ViewController: BaseViewController, HeaderSelectViewDelegate, TimeS ...@@ -257,7 +257,7 @@ class DSHFXY_ViewController: BaseViewController, HeaderSelectViewDelegate, TimeS
] ]
examineDbtInfo(dic) { (data) in examineDbtInfo(dic) { (data) in
let model = data as! examineDbtInfoModel let model = data as! examineDbtInfoModel
if model.data?.count == 0 { if model.data?.count == nil {
self.tableView.mj_footer?.endRefreshingWithNoMoreData() self.tableView.mj_footer?.endRefreshingWithNoMoreData()
}else{ }else{
self.page += 1 self.page += 1
......
...@@ -120,6 +120,7 @@ class BluetoothConnectViewController: BaseViewController,UITableViewDelegate,UIT ...@@ -120,6 +120,7 @@ class BluetoothConnectViewController: BaseViewController,UITableViewDelegate,UIT
} }
} }
//MARK:--外设返回数据(回调) //MARK:--外设返回数据(回调)
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
let data = characteristic.value let data = characteristic.value
...@@ -128,6 +129,7 @@ class BluetoothConnectViewController: BaseViewController,UITableViewDelegate,UIT ...@@ -128,6 +129,7 @@ class BluetoothConnectViewController: BaseViewController,UITableViewDelegate,UIT
if data!.count >= 1 { if data!.count >= 1 {
if resultByte![0] == 16 { if resultByte![0] == 16 {
print("---打印机打开--") print("---打印机打开--")
}else if resultByte![0] == 1 { }else if resultByte![0] == 1 {
print("---打印机缺纸--") print("---打印机缺纸--")
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BluetoothConnectViewController" customModule="GeliBusinessPlatform" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BluetoothConnectViewController" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="bottomView" destination="z6g-3U-Gjc" id="Kx7-8l-LwL"/> <outlet property="bottomView" destination="z6g-3U-Gjc" id="Kx7-8l-LwL"/>
<outlet property="tableView" destination="IoW-aR-gg0" id="Cxv-cQ-rjJ"/> <outlet property="tableView" destination="IoW-aR-gg0" id="Cxv-cQ-rjJ"/>
...@@ -48,14 +50,14 @@ ...@@ -48,14 +50,14 @@
<constraint firstAttribute="width" constant="20" id="Xi5-pM-tII"/> <constraint firstAttribute="width" constant="20" id="Xi5-pM-tII"/>
</constraints> </constraints>
</imageView> </imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kxt-WC-XyY"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kxt-WC-XyY">
<rect key="frame" x="0.0" y="0.0" width="414" height="50"/> <rect key="frame" x="0.0" y="0.0" width="414" height="50"/>
<connections> <connections>
<action selector="searchAction:" destination="-1" eventType="touchUpInside" id="lDV-he-pEz"/> <action selector="searchAction:" destination="-1" eventType="touchUpInside" id="lDV-he-pEz"/>
</connections> </connections>
</button> </button>
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="bS9-xW-ajm" firstAttribute="centerY" secondItem="z6g-3U-Gjc" secondAttribute="centerY" id="I5U-kM-DXb"/> <constraint firstItem="bS9-xW-ajm" firstAttribute="centerY" secondItem="z6g-3U-Gjc" secondAttribute="centerY" id="I5U-kM-DXb"/>
<constraint firstAttribute="height" constant="50" id="LW6-DI-gTT"/> <constraint firstAttribute="height" constant="50" id="LW6-DI-gTT"/>
...@@ -76,6 +78,7 @@ ...@@ -76,6 +78,7 @@
</constraints> </constraints>
</view> </view>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="IoW-aR-gg0" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="1BX-uM-9UQ"/> <constraint firstItem="IoW-aR-gg0" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="1BX-uM-9UQ"/>
...@@ -89,7 +92,6 @@ ...@@ -89,7 +92,6 @@
<constraint firstItem="EhN-in-WvW" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="b7Q-gR-cJG"/> <constraint firstItem="EhN-in-WvW" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="b7Q-gR-cJG"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="IoW-aR-gg0" secondAttribute="trailing" id="hos-nX-fj1"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="IoW-aR-gg0" secondAttribute="trailing" id="hos-nX-fj1"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="127.53623188405798" y="111.16071428571428"/> <point key="canvasLocation" x="127.53623188405798" y="111.16071428571428"/>
</view> </view>
</objects> </objects>
...@@ -99,10 +101,13 @@ ...@@ -99,10 +101,13 @@
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="标题字颜色"> <namedColor name="标题字颜色">
<color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="白色背景色"> <namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources> </resources>
</document> </document>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment