| | |
| | | Services.getCustomerCode().subscribe(onNext: {[weak self] data in |
| | | self?.image_qrCode.sd_setImage(with: URL(string: data.data ?? "")) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | let longPress = UILongPressGestureRecognizer(target: self, action: #selector(longPressCopyAction(_:))) |
| | | longPress.minimumPressDuration = 0.8 |
| | | image_qrCode.isUserInteractionEnabled = true |
| | | image_qrCode.addGestureRecognizer(longPress) |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | let vc = TreeTeskEnergyExchangeRecordVC() |
| | | push(vc: vc) |
| | | } |
| | | |
| | | @objc private func longPressCopyAction(_ gesture:UILongPressGestureRecognizer){ |
| | | if gesture.state == .began{ |
| | | if let img = image_qrCode.image{ |
| | | image_qrCode.isUserInteractionEnabled = false |
| | | UIImageWriteToSavedPhotosAlbum(img, nil,nil, nil) |
| | | alertSuccess(msg: "保存成功") |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | extension TreeTeskEnergyExchangeVC:UITableViewDataSource & UITableViewDelegate{ |