Commit a5c118bd authored by lujunye's avatar lujunye

分销员接口修改

parent a997896c
......@@ -239,7 +239,7 @@ class FXYGL_ViewController: BaseViewController, UISearchBarDelegate, SearchBarVi
self.tableView?.mj_header?.endRefreshing()
self.page = 2
if model.data?.res?.count == 0 {
if model.data?.res?.count == nil {
self.tableView?.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.tableView?.mj_footer?.endRefreshing()
......@@ -257,7 +257,7 @@ class FXYGL_ViewController: BaseViewController, UISearchBarDelegate, SearchBarVi
]
dbtManageQuery(dic, success: { (data) in
let model = data as! dbtManageQueryModel
if model.data?.res?.count == 0 {
if model.data?.res?.count == nil {
self.tableView?.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.page += 1
......
......@@ -42,13 +42,12 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "FXSY_Cell") as! FXSY_Cell
let data = model?.res![indexPath.row]
if data != nil {
cell.order_id_lbl.text = "#"+(data?.record_sn)!
cell.time_lbl.text = data?.add_time!
cell.price_lbl.text = data?.in_amount!
cell.order_id_lbl2.text = (data?.order_sn!)! + "(" + (data?.remark!)! + ")"
}
let data = dataArr[indexPath.row]
cell.order_id_lbl.text = "#"+(data.record_sn)!
cell.time_lbl.text = data.add_time!
cell.price_lbl.text = data.in_amount!
cell.order_id_lbl2.text = data.order_sn! + "(" + data.remark! + ")"
return cell
}
......@@ -241,104 +240,152 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi
let arr = getDate()
date_lbl.text = "\(arr.first!)\(arr[1])\(arr.last!)日"
// loadData(dic: dic)
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
gys_list.mj_header = self.headerMJ
gys_list.mj_header?.beginRefreshing()
footerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadMoreData))
gys_list.mj_footer = self.footerMJ
}
var isFirstTime = true
// var isNonFirst = false
@objc func loadData(){
var page = 0
//MARK:--加载更多数据
@objc func loadMoreData(){
print("加载更多数据")
var dic:Dictionary<String,Any>!
// if isNonFirst {
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
]
// }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
// ]
// }
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?.inc != nil {
self.income_lbl.text = "收入:¥"+String(format: "%.02f", self.model?.inc! as! CVarArg)
self.income_lbl.isHidden = false
if self.model?.res?.count == nil {
self.gys_list?.mj_footer?.endRefreshingWithNoMoreData()
}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()
}
if self.model?.exp != nil {
self.refuse_lbl.text = "支出:¥"+String(format: "%.02f", self.model?.exp! as! CVarArg)
self.refuse_lbl.isHidden = false
} failture: { (err) in
self.gys_list.mj_footer?.endRefreshing()
}
}
@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{
self.refuse_lbl.isHidden = true
}
self.dataArr.removeAll()
self.model?.res?.forEach({ (item) in
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?.inc != nil {
self.income_lbl.text = "收入:¥"+String(format: "%.02f", self.model?.inc! as! CVarArg)
self.income_lbl.isHidden = false
}else{
self.income_lbl.isHidden = true
}
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)
if self.model?.exp != nil {
self.refuse_lbl.text = "支出:¥"+String(format: "%.02f", self.model?.exp! as! CVarArg)
self.refuse_lbl.isHidden = false
}else{
self.top_view.isHidden = true
SetTopFrame(view: self.top_view, height: 0.00001)
self.refuse_lbl.isHidden = true
}
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
self.gys_list.mj_header?.endRefreshing()
}
......
......@@ -228,7 +228,7 @@ class KHXQ_ViewController: BaseViewController, TimeShowDownViewDeleagte, UISearc
self.tableView?.mj_header?.endRefreshing()
self.page = 2
if model.data?.count == 0 {
if model.data?.count == nil {
self.tableView?.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.tableView?.mj_footer?.endRefreshing()
......@@ -248,7 +248,7 @@ class KHXQ_ViewController: BaseViewController, TimeShowDownViewDeleagte, UISearc
]
dbtCustomerInfo(dic, success: { (data) in
let model = data as! dbtCustomerInfoModel
if model.data?.count == 0 {
if model.data?.count == nil {
self.tableView?.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.page += 1
......
......@@ -233,7 +233,7 @@ class DSHFXY_ViewController: BaseViewController, HeaderSelectViewDelegate, TimeS
self.tableView.reloadData()
self.page = 2
self.tableView.mj_header?.endRefreshing()
if model.data?.count == 0 {
if model.data?.count == nil {
self.tableView.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.tableView.mj_footer?.endRefreshing()
......@@ -257,7 +257,7 @@ class DSHFXY_ViewController: BaseViewController, HeaderSelectViewDelegate, TimeS
]
examineDbtInfo(dic) { (data) in
let model = data as! examineDbtInfoModel
if model.data?.count == 0 {
if model.data?.count == nil {
self.tableView.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.page += 1
......
......@@ -120,6 +120,7 @@ class BluetoothConnectViewController: BaseViewController,UITableViewDelegate,UIT
}
}
//MARK:--外设返回数据(回调)
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
let data = characteristic.value
......@@ -128,6 +129,7 @@ class BluetoothConnectViewController: BaseViewController,UITableViewDelegate,UIT
if data!.count >= 1 {
if resultByte![0] == 16 {
print("---打印机打开--")
}else if resultByte![0] == 1 {
print("---打印机缺纸--")
}
......
<?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"/>
<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="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"/>
</dependencies>
<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>
<outlet property="bottomView" destination="z6g-3U-Gjc" id="Kx7-8l-LwL"/>
<outlet property="tableView" destination="IoW-aR-gg0" id="Cxv-cQ-rjJ"/>
......@@ -48,14 +50,14 @@
<constraint firstAttribute="width" constant="20" id="Xi5-pM-tII"/>
</constraints>
</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"/>
<connections>
<action selector="searchAction:" destination="-1" eventType="touchUpInside" id="lDV-he-pEz"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<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"/>
......@@ -76,6 +78,7 @@
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="IoW-aR-gg0" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="1BX-uM-9UQ"/>
......@@ -89,7 +92,6 @@
<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"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="127.53623188405798" y="111.16071428571428"/>
</view>
</objects>
......@@ -99,10 +101,13 @@
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<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 name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</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