CommonRightMenuKY.swift 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. //
  2. // CommonRightMenuKY.swift
  3. // xingchuangke
  4. //
  5. // Created by Apple on 2021/3/4.
  6. // Copyright © 2021 Virgil. All rights reserved.
  7. //
  8. import UIKit
  9. class CommonRightMenuKY: UIView {
  10. @IBOutlet weak var scrollView: UIScrollView!
  11. @IBOutlet weak var busAllBtn: UIButton!
  12. @IBOutlet weak var busJJBtn: UIButton!
  13. @IBOutlet weak var busSHBtn: UIButton!
  14. @IBOutlet weak var dealAllBtn: UIButton!
  15. @IBOutlet weak var dealSKBtn: UIButton!
  16. @IBOutlet weak var dealHKBtn: UIButton!
  17. @IBOutlet weak var dealXPBtn: UIButton!
  18. @IBOutlet weak var dealSMBtn: UIButton!
  19. @IBOutlet weak var dealYJBtn: UIButton!
  20. @IBOutlet weak var payAllBtn: UIButton!
  21. @IBOutlet weak var payYSFJBtn: UIButton!
  22. @IBOutlet weak var payYSFDBtn: UIButton!
  23. @IBOutlet weak var paySKJBtn: UIButton!
  24. @IBOutlet weak var payBZBtn: UIButton!
  25. @IBOutlet weak var payWXBtn: UIButton!
  26. @IBOutlet weak var payALBtn: UIButton!
  27. @IBOutlet weak var cardAllBtn: UIButton!
  28. @IBOutlet weak var cardJJBtn: UIButton!
  29. @IBOutlet weak var cardXYBtn: UIButton!
  30. @IBOutlet weak var wayAllBtn: UIButton!
  31. @IBOutlet weak var wayBtn: UIButton!
  32. @IBOutlet weak var wayBtn1: UIButton!
  33. @IBOutlet weak var btnConfrim: UIButton!
  34. @IBOutlet weak var btnReset: UIButton!
  35. @IBOutlet weak var btnEnd: UIButton!
  36. @IBOutlet weak var btnStart: UIButton!
  37. var queryEntity: QueryEntityKY!
  38. var oBackFunc: CommonBackQueryKY!
  39. var btnTypes = [UIButton]()
  40. var arrTempType = NSMutableArray()
  41. func initView(arrType: NSMutableArray, backFunc:@escaping CommonBackQueryKY) {
  42. oBackFunc = backFunc
  43. self.setSizeWidth(width: ScreenWidth)
  44. btnReset.setCornerRadius(size: 3)
  45. btnConfrim.setCornerRadius(size: 3)
  46. btnEnd.setCornerRadius(size: 3)
  47. btnStart.setCornerRadius(size: 3)
  48. scrollView.contentSize.height = btnConfrim.bottom() + 40
  49. busAllBtn.isSelected = true
  50. dealAllBtn.isSelected = true
  51. payAllBtn.isSelected = true
  52. cardAllBtn.isSelected = true
  53. wayAllBtn.isSelected = true
  54. busAllBtn.setTitleColor(.red, for: .selected)
  55. dealAllBtn.setTitleColor(.red, for: .selected)
  56. payAllBtn.setTitleColor(.red, for: .selected)
  57. cardAllBtn.setTitleColor(.red, for: .selected)
  58. wayAllBtn.setTitleColor(.red, for: .selected)
  59. arrTempType.removeAllObjects()
  60. arrTempType.addObjects(from: arrType as! [Any])
  61. // scrollViewType.removeAll();
  62. var left: CGFloat = 14
  63. btnTypes.removeAll()
  64. for i in 0 ..< arrType.count {
  65. let btn = UIButton(frame: CGRect(x: left, y: 0, width: 100, height: 36))
  66. btn.backgroundColor = CommonUntils.getUIColorFromRGB(rgbValue: 0xf5f5f5, alpha: 1.0)
  67. btn.setTitle((arrType[i] as! NSDictionary).getString(key: "name"), for: .normal)
  68. btn.setTitleColor(CommonUntils.getUIColorFromRGB(rgbValue: 0x333333, alpha: 1.0), for: .normal)
  69. btn.setTitleColor(UIColor.white, for: .selected)
  70. btn.sizeToFitWidth()
  71. btn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
  72. btn.tag = i
  73. btn.addTarget(self, action: #selector(btnTypeClick), for: .touchUpInside)
  74. btn.setSizeWidth(width: btn.width() + 40)
  75. // scrollViewType.addSubview(btn)
  76. left = btn.right() + 15
  77. btnTypes.append(btn)
  78. btn.setCornerRadius(size: 3)
  79. }
  80. // scrollViewType.contentSize.width = left;
  81. queryEntity = QueryEntityKY()
  82. queryEntity.startTime = "选择开始日期"
  83. queryEntity.endTime = "选择截止日期"
  84. }
  85. @objc func btnTypeClick(btn: UIButton) {
  86. for btnTemp in btnTypes {
  87. if btnTemp.tag == btn.tag {
  88. queryEntity.typeID = (arrTempType[btn.tag] as! NSDictionary).getString(key: "id")
  89. btnTemp.backgroundColor = CommonUntils.getUIColorFromRGB(rgbValue: 0x2A92F7, alpha: 1.0)
  90. btnTemp.isSelected = true
  91. } else {
  92. btnTemp.backgroundColor = CommonUntils.getUIColorFromRGB(rgbValue: 0xf5f5f5, alpha: 1.0)
  93. btnTemp.isSelected = false
  94. }
  95. }
  96. }
  97. @IBAction func btnMenuClick(_ sender: AnyObject) {
  98. switch (sender as! UIButton).tag {
  99. case 1001: // 开始时间
  100. let viewDatePicer = (CommonViewUntils.getViewForXIB(anyClass: Virgil_SelectDateForPickerView.self) as! Virgil_SelectDateForPickerView)
  101. var defaultDate: Date!
  102. if queryEntity.startTime == "选择开始日期" || queryEntity.startTime.length() != 10 {
  103. defaultDate = CommonDate.addMonth(date: Date(), month: 0)
  104. } else {
  105. defaultDate = CommonDate.getDateForString(dateStr: queryEntity.startTime, dateFormat: "yyyy-MM-dd")
  106. }
  107. viewDatePicer.datePicker.maximumDate = Date()
  108. viewDatePicer.showDatePickerView(defaultDate: defaultDate) {[weak self] (str) in
  109. self!.queryEntity.startTime = str
  110. self!.refreshView()
  111. }
  112. break
  113. case 1002: // 结束时间
  114. let viewDatePicer = (CommonViewUntils.getViewForXIB(anyClass: Virgil_SelectDateForPickerView.self) as! Virgil_SelectDateForPickerView)
  115. var defaultDate: Date!
  116. if queryEntity.endTime == "选择截止日期" || queryEntity.endTime.length() != 10 {
  117. defaultDate = Date()
  118. } else {
  119. defaultDate = CommonDate.getDateForString(dateStr: queryEntity.endTime, dateFormat: "yyyy-MM-dd")
  120. }
  121. viewDatePicer.datePicker.maximumDate = Date()
  122. viewDatePicer.showDatePickerView(defaultDate: defaultDate) {[weak self] (str) in
  123. self!.queryEntity.endTime = str
  124. self!.refreshView()
  125. }
  126. refreshView()
  127. break
  128. case 1011: // 全部
  129. queryEntity.busType = ""
  130. refreshView()
  131. break
  132. case 1012: // 个人版
  133. queryEntity.busType = "0"
  134. refreshView()
  135. case 1013: // 商户版
  136. queryEntity.busType = "1"
  137. refreshView()
  138. break
  139. case 1021: // 全部
  140. queryEntity.depositTrade = ""
  141. refreshView()
  142. break
  143. case 1022: // 刷卡
  144. queryEntity.depositTrade = "01"
  145. refreshView()
  146. break
  147. case 1023: // 挥卡
  148. queryEntity.depositTrade = "02"
  149. refreshView()
  150. break
  151. case 1024: // 芯片插卡
  152. queryEntity.depositTrade = "03"
  153. refreshView()
  154. break
  155. case 1025: // 扫码
  156. queryEntity.depositTrade = "04"
  157. refreshView()
  158. break
  159. case 1026: // 押金
  160. queryEntity.depositTrade = "05"
  161. refreshView()
  162. break
  163. case 1031: // 全部
  164. queryEntity.payType = ""
  165. refreshView()
  166. break
  167. case 1032: // 云闪付借记卡
  168. queryEntity.payType = "01"
  169. refreshView()
  170. break
  171. case 1033: // 云闪付贷记卡
  172. queryEntity.payType = "02"
  173. refreshView()
  174. break
  175. case 1034: // 刷卡交易借记卡
  176. queryEntity.payType = "03"
  177. refreshView()
  178. break
  179. case 1035: // 刷卡交易贷记卡
  180. queryEntity.payType = "04"
  181. refreshView()
  182. break
  183. case 1039: // 微信
  184. queryEntity.payType = "08"
  185. refreshView()
  186. break
  187. case 1040: // 支付宝
  188. queryEntity.payType = "09"
  189. refreshView()
  190. break
  191. case 1041: // 全部
  192. queryEntity.cardType = ""
  193. refreshView()
  194. break
  195. case 1042: // 借记卡
  196. queryEntity.cardType = "01"
  197. refreshView()
  198. break
  199. case 1043: //信用卡
  200. queryEntity.cardType = "02"
  201. refreshView()
  202. break
  203. case 1003: // S0
  204. queryEntity.settleWay = "01"
  205. refreshView()
  206. break
  207. case 1004: // T1
  208. queryEntity.settleWay = "02"
  209. refreshView()
  210. break
  211. case 1005: // 全部
  212. queryEntity.settleWay = ""
  213. refreshView()
  214. break
  215. case 1007: // 重置
  216. queryEntity.startTime = "选择开始日期"
  217. queryEntity.endTime = "选择截止日期"
  218. queryEntity.cardType = ""
  219. queryEntity.settleWay = ""
  220. queryEntity.typeID = ""
  221. queryEntity.payType = ""
  222. queryEntity.depositTrade = ""
  223. queryEntity.busType = ""
  224. refreshView()
  225. break
  226. case 1008: // 确定
  227. hidMenu()
  228. if oBackFunc != nil {
  229. oBackFunc(queryEntity)
  230. }
  231. break
  232. case 1009: // 隐藏
  233. hidMenu()
  234. break
  235. default:
  236. break
  237. }
  238. }
  239. func refreshView() {
  240. for btnTemp in btnTypes {
  241. if queryEntity.typeID != (arrTempType[btnTemp.tag] as! NSDictionary).getString(key: "id") {
  242. btnTemp.isSelected = false
  243. btnTemp.backgroundColor = CommonUntils.getUIColorFromRGB(rgbValue: 0xf5f5f5, alpha: 1.0)
  244. }
  245. }
  246. if queryEntity.busType == "" {
  247. busAllBtn.isSelected = true
  248. busJJBtn.isSelected = false
  249. busSHBtn.isSelected = false
  250. busAllBtn.setTitleColor(.red, for: .selected)
  251. busJJBtn.setTitleColor(.black, for: .normal)
  252. busSHBtn.setTitleColor(.black, for: .normal)
  253. } else if queryEntity.busType == "0" {
  254. busAllBtn.isSelected = false
  255. busJJBtn.isSelected = true
  256. busSHBtn.isSelected = false
  257. busAllBtn.setTitleColor(.black, for: .normal)
  258. busJJBtn.setTitleColor(.red, for: .selected)
  259. busSHBtn.setTitleColor(.black, for: .normal)
  260. } else {
  261. busAllBtn.isSelected = false
  262. busJJBtn.isSelected = false
  263. busSHBtn.isSelected = true
  264. busAllBtn.setTitleColor(.black, for: .normal)
  265. busJJBtn.setTitleColor(.black, for: .normal)
  266. busSHBtn.setTitleColor(.red, for: .selected)
  267. }
  268. if queryEntity.depositTrade == "" {
  269. dealAllBtn.isSelected = true
  270. dealSKBtn.isSelected = false
  271. dealHKBtn.isSelected = false
  272. dealXPBtn.isSelected = false
  273. dealSMBtn.isSelected = false
  274. dealYJBtn.isSelected = false
  275. dealAllBtn.setTitleColor(.red, for: .selected)
  276. dealSKBtn.setTitleColor(.black, for: .normal)
  277. dealHKBtn.setTitleColor(.black, for: .normal)
  278. dealXPBtn.setTitleColor(.black, for: .normal)
  279. dealSMBtn.setTitleColor(.black, for: .normal)
  280. dealYJBtn.setTitleColor(.black, for: .normal)
  281. } else if queryEntity.depositTrade == "01" {
  282. dealAllBtn.isSelected = false
  283. dealSKBtn.isSelected = true
  284. dealHKBtn.isSelected = false
  285. dealXPBtn.isSelected = false
  286. dealSMBtn.isSelected = false
  287. dealYJBtn.isSelected = false
  288. dealAllBtn.setTitleColor(.black, for: .normal)
  289. dealSKBtn.setTitleColor(.red, for: .selected)
  290. dealHKBtn.setTitleColor(.black, for: .normal)
  291. dealXPBtn.setTitleColor(.black, for: .normal)
  292. dealSMBtn.setTitleColor(.black, for: .normal)
  293. dealYJBtn.setTitleColor(.black, for: .normal)
  294. }else if queryEntity.depositTrade == "02" {
  295. dealAllBtn.isSelected = false
  296. dealSKBtn.isSelected = false
  297. dealHKBtn.isSelected = true
  298. dealXPBtn.isSelected = false
  299. dealSMBtn.isSelected = false
  300. dealYJBtn.isSelected = false
  301. dealAllBtn.setTitleColor(.black, for: .normal)
  302. dealSKBtn.setTitleColor(.black, for: .normal)
  303. dealHKBtn.setTitleColor(.red, for: .selected)
  304. dealXPBtn.setTitleColor(.black, for: .normal)
  305. dealSMBtn.setTitleColor(.black, for: .normal)
  306. dealYJBtn.setTitleColor(.black, for: .normal)
  307. }else if queryEntity.depositTrade == "03" {
  308. dealAllBtn.isSelected = false
  309. dealSKBtn.isSelected = false
  310. dealHKBtn.isSelected = false
  311. dealXPBtn.isSelected = true
  312. dealSMBtn.isSelected = false
  313. dealYJBtn.isSelected = false
  314. dealAllBtn.setTitleColor(.black, for: .normal)
  315. dealSKBtn.setTitleColor(.black, for: .normal)
  316. dealHKBtn.setTitleColor(.black, for: .normal)
  317. dealXPBtn.setTitleColor(.red, for: .selected)
  318. dealSMBtn.setTitleColor(.black, for: .normal)
  319. dealYJBtn.setTitleColor(.black, for: .normal)
  320. }else if queryEntity.depositTrade == "04" {
  321. dealAllBtn.isSelected = false
  322. dealSKBtn.isSelected = false
  323. dealHKBtn.isSelected = false
  324. dealXPBtn.isSelected = false
  325. dealSMBtn.isSelected = true
  326. dealYJBtn.isSelected = false
  327. dealAllBtn.setTitleColor(.black, for: .normal)
  328. dealSKBtn.setTitleColor(.black, for: .normal)
  329. dealHKBtn.setTitleColor(.black, for: .normal)
  330. dealXPBtn.setTitleColor(.black, for: .normal)
  331. dealSMBtn.setTitleColor(.red, for: .selected)
  332. dealYJBtn.setTitleColor(.black, for: .normal)
  333. }else {
  334. dealAllBtn.isSelected = false
  335. dealSKBtn.isSelected = false
  336. dealHKBtn.isSelected = false
  337. dealXPBtn.isSelected = false
  338. dealSMBtn.isSelected = false
  339. dealYJBtn.isSelected = true
  340. dealAllBtn.setTitleColor(.black, for: .normal)
  341. dealSKBtn.setTitleColor(.black, for: .normal)
  342. dealHKBtn.setTitleColor(.black, for: .normal)
  343. dealXPBtn.setTitleColor(.black, for: .normal)
  344. dealSMBtn.setTitleColor(.black, for: .normal)
  345. dealYJBtn.setTitleColor(.red, for: .selected)
  346. }
  347. if queryEntity.payType == "" {
  348. payAllBtn.isSelected = true
  349. payYSFJBtn.isSelected = false
  350. payYSFDBtn.isSelected = false
  351. paySKJBtn.isSelected = false
  352. payBZBtn.isSelected = false
  353. payWXBtn.isSelected = false
  354. payALBtn.isSelected = false
  355. payAllBtn.setTitleColor(.red, for: .selected)
  356. payYSFJBtn.setTitleColor(.black, for: .normal)
  357. payYSFDBtn.setTitleColor(.black, for: .normal)
  358. paySKJBtn.setTitleColor(.black, for: .normal)
  359. payBZBtn.setTitleColor(.black, for: .normal)
  360. payWXBtn.setTitleColor(.black, for: .normal)
  361. payALBtn.setTitleColor(.black, for: .normal)
  362. } else if queryEntity.payType == "01" {
  363. payAllBtn.isSelected = false
  364. payYSFJBtn.isSelected = true
  365. payYSFDBtn.isSelected = false
  366. paySKJBtn.isSelected = false
  367. payBZBtn.isSelected = false
  368. payWXBtn.isSelected = false
  369. payALBtn.isSelected = false
  370. payAllBtn.setTitleColor(.black, for: .normal)
  371. payYSFJBtn.setTitleColor(.red, for: .selected)
  372. payYSFDBtn.setTitleColor(.black, for: .normal)
  373. paySKJBtn.setTitleColor(.black, for: .normal)
  374. payBZBtn.setTitleColor(.black, for: .normal)
  375. payWXBtn.setTitleColor(.black, for: .normal)
  376. payALBtn.setTitleColor(.black, for: .normal)
  377. }else if queryEntity.payType == "02" {
  378. payAllBtn.isSelected = false
  379. payYSFJBtn.isSelected = false
  380. payYSFDBtn.isSelected = true
  381. paySKJBtn.isSelected = false
  382. payBZBtn.isSelected = false
  383. payWXBtn.isSelected = false
  384. payALBtn.isSelected = false
  385. payAllBtn.setTitleColor(.black, for: .normal)
  386. payYSFJBtn.setTitleColor(.black, for: .normal)
  387. payYSFDBtn.setTitleColor(.red, for: .selected)
  388. paySKJBtn.setTitleColor(.black, for: .normal)
  389. payBZBtn.setTitleColor(.black, for: .normal)
  390. payWXBtn.setTitleColor(.black, for: .normal)
  391. payALBtn.setTitleColor(.black, for: .normal)
  392. }else if queryEntity.payType == "03" {
  393. payAllBtn.isSelected = false
  394. payYSFJBtn.isSelected = false
  395. payYSFDBtn.isSelected = false
  396. paySKJBtn.isSelected = true
  397. payBZBtn.isSelected = false
  398. payWXBtn.isSelected = false
  399. payALBtn.isSelected = false
  400. payAllBtn.setTitleColor(.black, for: .normal)
  401. payYSFJBtn.setTitleColor(.black, for: .normal)
  402. payYSFDBtn.setTitleColor(.black, for: .normal)
  403. paySKJBtn.setTitleColor(.red, for: .selected)
  404. payBZBtn.setTitleColor(.black, for: .normal)
  405. payWXBtn.setTitleColor(.black, for: .normal)
  406. payALBtn.setTitleColor(.black, for: .normal)
  407. }else if queryEntity.payType == "04" {
  408. payAllBtn.isSelected = false
  409. payYSFJBtn.isSelected = false
  410. payYSFDBtn.isSelected = false
  411. paySKJBtn.isSelected = false
  412. payBZBtn.isSelected = true
  413. payWXBtn.isSelected = false
  414. payALBtn.isSelected = false
  415. payAllBtn.setTitleColor(.black, for: .normal)
  416. payYSFJBtn.setTitleColor(.black, for: .normal)
  417. payYSFDBtn.setTitleColor(.black, for: .normal)
  418. paySKJBtn.setTitleColor(.black, for: .normal)
  419. payBZBtn.setTitleColor(.red, for: .selected)
  420. payWXBtn.setTitleColor(.black, for: .normal)
  421. payALBtn.setTitleColor(.black, for: .normal)
  422. }else if queryEntity.payType == "05" {
  423. payAllBtn.isSelected = false
  424. payYSFJBtn.isSelected = false
  425. payYSFDBtn.isSelected = false
  426. paySKJBtn.isSelected = false
  427. payBZBtn.isSelected = false
  428. payWXBtn.isSelected = false
  429. payALBtn.isSelected = false
  430. payAllBtn.setTitleColor(.black, for: .normal)
  431. payYSFJBtn.setTitleColor(.black, for: .normal)
  432. payYSFDBtn.setTitleColor(.black, for: .normal)
  433. paySKJBtn.setTitleColor(.black, for: .normal)
  434. payBZBtn.setTitleColor(.black, for: .normal)
  435. payWXBtn.setTitleColor(.black, for: .normal)
  436. payALBtn.setTitleColor(.black, for: .normal)
  437. }else if queryEntity.payType == "06" {
  438. payAllBtn.isSelected = false
  439. payYSFJBtn.isSelected = false
  440. payYSFDBtn.isSelected = false
  441. paySKJBtn.isSelected = false
  442. payBZBtn.isSelected = false
  443. payWXBtn.isSelected = false
  444. payALBtn.isSelected = false
  445. payAllBtn.setTitleColor(.black, for: .normal)
  446. payYSFJBtn.setTitleColor(.black, for: .normal)
  447. payYSFDBtn.setTitleColor(.black, for: .normal)
  448. paySKJBtn.setTitleColor(.black, for: .normal)
  449. payBZBtn.setTitleColor(.black, for: .normal)
  450. payWXBtn.setTitleColor(.black, for: .normal)
  451. payALBtn.setTitleColor(.black, for: .normal)
  452. }else if queryEntity.payType == "07" {
  453. payAllBtn.isSelected = false
  454. payYSFJBtn.isSelected = false
  455. payYSFDBtn.isSelected = false
  456. paySKJBtn.isSelected = false
  457. payBZBtn.isSelected = false
  458. payWXBtn.isSelected = false
  459. payALBtn.isSelected = false
  460. payAllBtn.setTitleColor(.black, for: .normal)
  461. payYSFJBtn.setTitleColor(.black, for: .normal)
  462. payYSFDBtn.setTitleColor(.black, for: .normal)
  463. paySKJBtn.setTitleColor(.black, for: .normal)
  464. payBZBtn.setTitleColor(.black, for: .normal)
  465. payWXBtn.setTitleColor(.black, for: .normal)
  466. payALBtn.setTitleColor(.black, for: .normal)
  467. }else if queryEntity.payType == "08" {
  468. payAllBtn.isSelected = false
  469. payYSFJBtn.isSelected = false
  470. payYSFDBtn.isSelected = false
  471. paySKJBtn.isSelected = false
  472. payBZBtn.isSelected = false
  473. payWXBtn.isSelected = true
  474. payALBtn.isSelected = false
  475. payAllBtn.setTitleColor(.black, for: .normal)
  476. payYSFJBtn.setTitleColor(.black, for: .normal)
  477. payYSFDBtn.setTitleColor(.black, for: .normal)
  478. paySKJBtn.setTitleColor(.black, for: .normal)
  479. payBZBtn.setTitleColor(.black, for: .normal)
  480. payWXBtn.setTitleColor(.red, for: .selected)
  481. payALBtn.setTitleColor(.black, for: .normal)
  482. }else {
  483. payAllBtn.isSelected = false
  484. payYSFJBtn.isSelected = false
  485. payYSFDBtn.isSelected = false
  486. paySKJBtn.isSelected = false
  487. payBZBtn.isSelected = false
  488. payWXBtn.isSelected = false
  489. payALBtn.isSelected = true
  490. payAllBtn.setTitleColor(.black, for: .normal)
  491. payYSFJBtn.setTitleColor(.black, for: .normal)
  492. payYSFDBtn.setTitleColor(.black, for: .normal)
  493. paySKJBtn.setTitleColor(.black, for: .normal)
  494. payBZBtn.setTitleColor(.black, for: .normal)
  495. payWXBtn.setTitleColor(.black, for: .normal)
  496. payALBtn.setTitleColor(.red, for: .selected)
  497. }
  498. if queryEntity.cardType == "" {
  499. cardAllBtn.isSelected = true
  500. cardJJBtn.isSelected = false
  501. cardXYBtn.isSelected = false
  502. cardAllBtn.setTitleColor(.red, for: .selected)
  503. cardJJBtn.setTitleColor(.black, for: .normal)
  504. cardXYBtn.setTitleColor(.black, for: .normal)
  505. } else if queryEntity.cardType == "01" {
  506. cardAllBtn.isSelected = false
  507. cardJJBtn.isSelected = true
  508. cardXYBtn.isSelected = false
  509. cardAllBtn.setTitleColor(.black, for: .normal)
  510. cardJJBtn.setTitleColor(.red, for: .selected)
  511. cardXYBtn.setTitleColor(.black, for: .normal)
  512. }else if queryEntity.cardType == "02" {
  513. cardAllBtn.isSelected = false
  514. cardJJBtn.isSelected = false
  515. cardXYBtn.isSelected = true
  516. cardAllBtn.setTitleColor(.black, for: .normal)
  517. cardJJBtn.setTitleColor(.black, for: .normal)
  518. cardXYBtn.setTitleColor(.red, for: .selected)
  519. }
  520. if queryEntity.settleWay == "" {
  521. wayAllBtn.isSelected = true
  522. wayBtn.isSelected = false
  523. wayBtn1.isSelected = false
  524. wayAllBtn.setTitleColor(.red, for: .selected)
  525. wayBtn.setTitleColor(.black, for: .normal)
  526. wayBtn1.setTitleColor(.black, for: .normal)
  527. } else if queryEntity.settleWay == "01" {
  528. wayAllBtn.isSelected = false
  529. wayBtn.isSelected = true
  530. wayBtn1.isSelected = false
  531. wayAllBtn.setTitleColor(.black, for: .normal)
  532. wayBtn.setTitleColor(.red, for: .selected)
  533. wayBtn1.setTitleColor(.black, for: .normal)
  534. }else {
  535. wayAllBtn.isSelected = false
  536. wayBtn.isSelected = false
  537. wayBtn1.isSelected = true
  538. wayAllBtn.setTitleColor(.black, for: .normal)
  539. wayBtn.setTitleColor(.black, for: .normal)
  540. wayBtn1.setTitleColor(.red, for: .selected)
  541. }
  542. btnStart.setTitle(queryEntity.startTime, for: .normal)
  543. btnEnd.setTitle(queryEntity.endTime, for: .normal)
  544. }
  545. func showMenu(paretnView: UIView) {
  546. scrollView.marginLeft(left: ScreenWidth)
  547. paretnView.addSubview(self)
  548. self.setFillForSuperView()
  549. UIView.animate(withDuration: 0.5, animations: {
  550. self.scrollView.marginLeft(left: ScreenWidth - self.scrollView.width())
  551. }) { (_) in
  552. }
  553. }
  554. func hidMenu() {
  555. UIView.animate(withDuration: 0.5, animations: {
  556. self.scrollView.marginLeft(left: ScreenWidth)
  557. }) { (_) in
  558. self.removeFromSuperview()
  559. }
  560. }
  561. }
  562. class QueryEntityKY: NSObject {
  563. ///品牌ID
  564. var typeID = ""
  565. var startTime = ""
  566. var endTime = ""
  567. ///结算方式:T0 T1
  568. var settleWay = ""
  569. ///交易卡类型:借记卡
  570. var cardType = ""
  571. ///商户类型
  572. var busType = ""
  573. ///交易类型
  574. var depositTrade = ""
  575. ///交易方式
  576. var payType = ""
  577. }
  578. typealias CommonBackQueryKY=(_ entity: QueryEntityKY) -> Void