Commit 052f52c8 authored by pete谢兆麟's avatar pete谢兆麟

重复选择问题修复

parent 5aaba841
......@@ -139,7 +139,7 @@ extension YHMakePlanModel {
}
}
// If we get here, we need to check sub_products (product_id == 0 cases)
// If we get here, we need to check sub_products (product_id == 0 cases)
checkSubProducts(in: &localBasic, for: productId)
checkSubProducts(in: &localWork, for: productId)
checkSubProducts(in: &localLive, for: productId)
......
......@@ -21,6 +21,7 @@ class YHMakePlanSelectAlertView: UIView {
var lineView: UIView!
var selectIndex: Int = 0
var selectProductId: Int = 0
var firstData: YHMakePlanMainModel?
var dataSource: YHMakePlanMainModel? {
didSet {
updata()
......@@ -52,6 +53,7 @@ class YHMakePlanSelectAlertView: UIView {
static func show(dataSource: YHMakePlanMainModel, callBack: @escaping ((Int) -> Void)) {
let view = YHMakePlanSelectAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.dataSource = dataSource
view.firstData = dataSource
view.block = callBack
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
......@@ -217,6 +219,10 @@ class YHMakePlanSelectAlertView: UIView {
@objc func orderButtonClick() {
if let block = block {
if dataSource?.sub_product[selectIndex].is_add_cart == firstData?.sub_product[selectIndex].is_add_cart {
dismiss()
return
}
block(dataSource?.sub_product[selectIndex].product_id ?? 0)
}
dismiss()
......
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