| | |
| | | weakSelf.items = data |
| | | let group = DispatchGroup() |
| | | |
| | | // for m in weakSelf.items{ |
| | | // let queue = DispatchQueue(label: "1") |
| | | // queue.async(group: group) { |
| | | // group.enter() |
| | | // m.radio = m.type.defaultImg.size.width / m.type.defaultImg.size.height //默认比例 |
| | | // SDWebImageDownloader.shared.downloadImage(with: URL(string: m.backgroundImage),options: .scaleDownLargeImages,progress: nil) { image, data, error, status in |
| | | // if let i = image{ |
| | | // m.radio = i.size.width / i.size.height |
| | | // } |
| | | // group.leave() |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | Services.homeInfo2(storeId: weakSelf.viewModel.storeId.value).subscribe(onNext: {data in |
| | | |
| | | }) { error in |
| | |
| | | |
| | | @IBAction func chooseStoresAction(_ sender: TapBtn) { |
| | | StoresChooseView.show { [weak self] storeId,storeName in |
| | | self?.viewModel.storeId.accept(storeId) |
| | | self?.label_store.text = storeName |
| | | self?.viewModel.beginRefresh() |
| | | guard let weakSelf = self else { return } |
| | | weakSelf.viewModel.storeId.accept(storeId) |
| | | weakSelf.label_store.text = storeName |
| | | weakSelf.layout = WaterFallFlowLayout() |
| | | weakSelf.layout.cols = 2 |
| | | weakSelf.layout.sectionInset = UIEdgeInsets(top: 14, left: 34, bottom: 14, right: 34) |
| | | weakSelf.layout.delegate = self! |
| | | weakSelf.collectionView.collectionViewLayout = weakSelf.layout |
| | | weakSelf.viewModel.beginRefresh() |
| | | } |
| | | } |
| | | |