From 117f96b4de283cd6f1896d17d8027094113435a2 Mon Sep 17 00:00:00 2001 From: younger_times <841720330@qq.com> Date: 星期四, 27 四月 2023 18:28:25 +0800 Subject: [PATCH] 新增 --- BrokerDriver/Home/VC/HomeMenuVC.swift | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/BrokerDriver/Home/VC/HomeMenuVC.swift b/BrokerDriver/Home/VC/HomeMenuVC.swift index 442c240..ada719b 100644 --- a/BrokerDriver/Home/VC/HomeMenuVC.swift +++ b/BrokerDriver/Home/VC/HomeMenuVC.swift @@ -13,10 +13,33 @@ private var tf_cargo:QMUITextField! private var btn_pickupTime:QMUIButton! private var btn_search:QMUIButton! + private(set) var selectDate:Date? + + var box:JQBox<(String?,Date?)>! override func viewDidLoad() { super.viewDidLoad() + btn_pickupTime.addTarget(self, action: #selector(showPickerView), for: .touchUpInside) + btn_search.addTarget(self, action: #selector(searchAction), for: .touchUpInside) + box = JQBox() + } + @objc private func showPickerView(){ + DatePickerView.show { [weak self] date in + self?.selectDate = date + self?.btn_pickupTime.setTitle(date.jq_format("MMM dd YYYY"), for: .normal) + self?.btn_pickupTime.setTitleColor(UIColor(hexStr: "333333"), for: .normal) + } + } + + @objc private func searchAction(){ + + var text:String? + + if !tf_cargo.text!.isEmpty{ + text = tf_cargo.text + } + box.value = (text,selectDate) } override func setUI() { -- Gitblit v1.7.1