无故事王国
2023-10-07 0e4747bd8b31ae22575e47156ba34d8a22b98fed
新增
18个文件已修改
356 ■■■■■ 已修改文件
WanPai.xcodeproj/project.pbxproj 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/AppDelegate.swift 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Bg/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Config/Def.swift 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Config/Enums.swift 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Config/WeChatTools.swift 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Info.plist 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Model/CommonModels.swift 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Network/Services.swift 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseDetailApplyVC.xib 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Games/GamesVC.swift 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Games/TCell/GamesTCell.swift 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Games/VC/GamesSubListVC.swift 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Home/Model/HomeModel.swift 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Home/VC/HomeVC.swift 96 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchVC.swift 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Yard/TCell/YardBookingTCell.swift 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Yard/VC/YardBookingDetailVC.swift 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai.xcodeproj/project.pbxproj
@@ -1922,9 +1922,9 @@
                INFOPLIST_FILE = WanPai/Info.plist;
                INFOPLIST_KEY_CFBundleDisplayName = "玩湃生活";
                INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.sports";
                INFOPLIST_KEY_NSCameraUsageDescription = "$(PRODUCT_NAME)需要使用使用使用相机,来上传学员头像、评论图片";
                INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "$(PRODUCT_NAME)需要使用使用定位,来推荐、搜索您附近的门店";
                INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "$(PRODUCT_NAME)需要使用使用使用相册,来上传学员头像、评论图片";
                INFOPLIST_KEY_NSCameraUsageDescription = "WanPai需要使用使用使用相机,来上传学员头像、评论图片";
                INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "WanPai需要使用使用定位,来推荐、搜索您附近的门店";
                INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "WanPai需要使用使用使用相册,来上传学员头像、评论图片";
                INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
                INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
                INFOPLIST_KEY_UIMainStoryboardFile = Main;
@@ -2084,9 +2084,9 @@
                INFOPLIST_FILE = WanPai/Info.plist;
                INFOPLIST_KEY_CFBundleDisplayName = "玩湃生活";
                INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.sports";
                INFOPLIST_KEY_NSCameraUsageDescription = "$(PRODUCT_NAME)需要使用使用使用相机,来上传学员头像、评论图片";
                INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "$(PRODUCT_NAME)需要使用使用定位,来推荐、搜索您附近的门店";
                INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "$(PRODUCT_NAME)需要使用使用使用相册,来上传学员头像、评论图片";
                INFOPLIST_KEY_NSCameraUsageDescription = "WanPai需要使用使用使用相机,来上传学员头像、评论图片";
                INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "WanPai需要使用使用定位,来推荐、搜索您附近的门店";
                INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "WanPai需要使用使用使用相册,来上传学员头像、评论图片";
                INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
                INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
                INFOPLIST_KEY_UIMainStoryboardFile = Main;
WanPai/AppDelegate.swift
@@ -23,6 +23,7 @@
        YYPaymentManager.shared.configuredAlipay(appScheme: APPScheme)
        AMapServices.shared().enableHTTPS = true
        AMapServices.shared().apiKey = AMapKey
        return true
    }
@@ -51,6 +52,7 @@
    func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
        return YYPaymentManager.shared.handleApplication(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
    }
    func application(_ application: UIApplication, handleOpen url: URL) -> Bool {
        if ((url.scheme?.contains("wechat")) != nil){
            return WXApi.handleOpen(url, delegate: self)
@@ -58,6 +60,7 @@
        return YYPaymentManager.shared.handleApplication(application, handleOpen: url)
    }
    // NOTE: 9.0以后使用新API接口
    func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
        if ((url.scheme?.contains("wechat")) != nil){
WanPai/Assets.xcassets/Bg/.DS_Store
Binary files differ
WanPai/Config/Def.swift
@@ -13,8 +13,8 @@
let SHAKEY = "BT7NPhA0f775uzcUuftWjCE1TYZlWmHZ"
let WechatUniversalLinks = "https://www.weparklife.com/app/"
let WeChatAPPID = "WX41D32F362BA0F911"
let WeChatSecrect = ""
let WeChatAPPID = "wx41d32f362ba0f911"
let WeChatSecrect = "cf0ebf950f5926a69041a0e2bbe20f3e"
let APPScheme = "weparklife"
let AMapKey = "a2aff8a000be5543e410555c548793b8"
let WeChatMinProgram = "gh_fea25aea0fc8" //
WanPai/Config/Enums.swift
@@ -27,9 +27,9 @@
}
    /// 支付方式
enum PayType:Int{
enum PayType:Int,HandyJSONEnum{
    case wechat = 1
    case aliPay = 2
    case wechat = 1
    case coin = 3
    case courseNum = 4
}
@@ -117,7 +117,7 @@
    var defaultImg:UIImage{
        switch self {
            case .none:
                return UIImage()
                return UIImage(named: "placeholder_1")!
            case .course:
                return UIImage(named: "b_1")!
            case .booking:
@@ -134,28 +134,6 @@
                return UIImage(named: "b_3")!
            case .wisdomCourt:
                return UIImage(named: "b_7")!
        }
    }
    var defaultHeight:Double {
        switch self {
            case .none:
                return 185
            case .course:
                return 288
            case .booking:
                return 288
            case .activity:
                return 185
            case .welfare:
                return 185
            case .coin:
                return 185
            case .ticket:
                return 185
            case .video:
                return 288
            case .wisdomCourt:
                return 288
        }
    }
}
@@ -445,4 +423,5 @@
enum ScanType:Int{
    case games = 1000 //游戏
    case course = 1001 //课程
    case yard = 1002 //场地
}
WanPai/Config/WeChatTools.swift
@@ -34,6 +34,10 @@
class WeChatTools{
    static func register(appid:String,link:String){
        WXApi.registerApp(appid, universalLink: link)
    }
        /// 授权登录
    static func sendAuthRequest(){
        let sendAuthReq = SendAuthReq()
WanPai/Info.plist
@@ -17,7 +17,7 @@
            <string>Editor</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>WX41D32F362BA0F911</string>
                <string>wx41d32f362ba0f911</string>
            </array>
        </dict>
    </array>
WanPai/Model/CommonModels.swift
@@ -332,6 +332,7 @@
    var storeLon: String = ""
    var storeName: String = ""
    var phone:String = ""
    var payType:PayType = .aliPay
    required init() {}
}
@@ -739,7 +740,7 @@
    var payMoney: Double = 0.0
    var payOrderNo: String = ""
    var payTime: Int = 0
    var payType: Int = 0
    var payType: PayType = .coin
    var payUserId: String = ""
    var phone: String = ""
    var province: String = ""
@@ -758,8 +759,13 @@
struct GameListModel:HandyJSON {
    var id = 0
    var cash:Double = 0
    var gameId:Int = 0
    var img = ""
    var name = ""
    var icon = ""
    var integral = 0
    var otherId = 0
    var playCoin = 0
}
struct DoorModel:HandyJSON{
@@ -779,15 +785,15 @@
}
struct OpenDoorModel:HandyJSON{
    var sid:Int? //场地ID
    var rid = [Int]() //区域ID
    var sid:Int? //场馆ID,全国通用值为0
    var rid = [Int]() //区域ID,单场馆和多场馆都可以放入,全国可以为空数组
    var uid:Int? //用户ID
    var time = [OpenDoorTimeModel]() //时间
    var type = 2 //固定
}
struct OpenDoorTimeModel:HandyJSON {
    var start_time:TimeInterval = 0
    var end_time:TimeInterval = 0
    var start_time:TimeInterval = 0 //开始时间
    var end_time:TimeInterval = 0 //结束时间
}
WanPai/Network/Services.swift
@@ -29,17 +29,28 @@
extension Services{
        /// 本地离线游戏
    class func game_gameList(spaceId:String,sutuId:String)->Observable<BaseResponse<[GameListModel]>>{
        let params = ParamsAppender.build(url: Game_Url)
            .interface(url: "/v7/user_api/general/gameList")
            .append(key: "space_id", value: spaceId)
            .append(key: "sutu_id", value: sutuId)
            .append(key: "sign", value: "0DB011836143EEE2C2E072967C9F4E4B")
        return NetworkRequest.request(params: params, method: .post, encoding: JSONEncoding.default, progress: false)
    class func game_gameList(spaceId:Int,storeId:Int)->Observable<BaseResponse<[GameListModel]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/other/api/game/queryGameList")
            .append(key: "siteId", value: spaceId)
            .append(key: "storeId", value: storeId)
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
    //支付游戏
    class func payGame(configId:Int,gameId:Int,spaceId:Int,sutuId:Int,type:PayType)->Observable<BaseResponse<PaymentModel>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/other/api/game/payGame")
            .append(key: "configId", value: configId)
            .append(key: "gameId", value: gameId)
            .append(key: "spaceId", value: spaceId)
            .append(key: "sutuId", value: sutuId)
            .append(key: "type", value: type.rawValue)
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        /// 启动本地游戏
    class func game_gameStart(gameId:Int,spaceId:String,sutuId:String,userID:Int)->Observable<BaseResponse<SimpleModel>>{
    class func game_gameStart(gameId:Int,spaceId:Int,sutuId:Int,userID:Int)->Observable<BaseResponse<SimpleModel>>{
        let params = ParamsAppender.build(url: Game_Url)
            .interface(url: "/v7/user_api/general/gameStart")
            .append(key: "space_id", value: spaceId)
@@ -171,7 +182,7 @@
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
    class func homeInfo2(storeId:Int)->Observable<BaseResponse<HomeStoreModel>>{
    class func homeStoreConfig2(storeId:Int)->Observable<BaseResponse<[HomeStoreConfigModel]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/other/base/store/queryIndexSet")
            .append(key: "id", value: storeId)
WanPai/Root/Course/VC/CourseDetailApplyVC.xib
@@ -265,7 +265,7 @@
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dq4-Ry-HOa">
                                            <rect key="frame" x="90.666666666666657" y="14" width="292.33333333333337" height="20"/>
                                            <constraints>
                                                <constraint firstAttribute="height" constant="20" id="Z5A-jd-BbS"/>
                                                <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="Z5A-jd-BbS"/>
                                            </constraints>
                                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                            <nil key="textColor"/>
WanPai/Root/Games/GamesVC.swift
@@ -12,18 +12,18 @@
let StartGame_Noti = Notification.Name.init("StartGame_Noti")
struct QRCodeModel:HandyJSON {
//    var scan_type:ScanType? //扫码类型:1000:游戏,10001:课程
    var space_id:String? //场地ID
    var sutu_id:String? //设备ID
    var course_id:Int? //课程ID
    var scan_type:ScanType? //扫码类型
    var space_id:Int? //场地ID
    var sutu_id:Int? //设备ID
    var id:Int? //课程/场地/游戏
}
class GamesVC: BaseVC {
    private var codeModel:QRCodeModel!
    override func viewDidLoad() {
        super.viewDidLoad()
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "智慧球场"
    }
@@ -41,21 +41,21 @@
    }
    override func setRx() {
        NotificationCenter.default.rx.notification(StartGame_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in
            guard let weakSelf = self else { return }
            if let gameId = noti.object as? Int{
                Services.userDetails().subscribe(onNext: {[weak self] data in
                    guard let weakSelf = self else { return }
                    if let model = data.data{
                        Services.game_gameStart(gameId: gameId, spaceId: weakSelf.codeModel.space_id!, sutuId: weakSelf.codeModel.sutu_id!, userID: model.userId).subscribe(onNext: { _ in
                            alertSuccess(msg: "启动成功")
                        }) { error in
                        }.disposed(by: weakSelf.disposeBag)
                    }
                }).disposed(by: weakSelf.disposeBag)
            }
        }).disposed(by: disposeBag)
//        NotificationCenter.default.rx.notification(StartGame_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in
//            guard let weakSelf = self else { return }
//            if let gameId = noti.object as? Int{
//                Services.userDetails().subscribe(onNext: {[weak self] data in
//                    guard let weakSelf = self else { return }
//                    if let model = data.data{
//                        Services.game_gameStart(gameId: gameId, spaceId: weakSelf.codeModel.space_id!, sutuId: weakSelf.codeModel.sutu_id!, userID: model.userId).subscribe(onNext: { _ in
//                            alertSuccess(msg: "启动成功")
//                        }) { error in
//
//                        }.disposed(by: weakSelf.disposeBag)
//                    }
//                }).disposed(by: weakSelf.disposeBag)
//            }
//        }).disposed(by: disposeBag)
    }
    @IBAction func scanAction(_ sender: UIButton) {
WanPai/Root/Games/TCell/GamesTCell.swift
@@ -16,10 +16,13 @@
    @IBOutlet weak var img_icon: UIImageView!
    @IBOutlet weak var label_gameName: UILabel!
    var QRCodeModel:QRCodeModel!
    var spaceId = 0
    var sutuId = 0
    var storeId = 0
    var gameListModel:GameListModel!{
        didSet{
            img_icon.sd_setImage(with: URL(string: gameListModel.icon))
            img_icon.sd_setImage(with: URL(string: gameListModel.img))
            label_gameName.text = gameListModel.name
        }
    }
@@ -35,16 +38,43 @@
    }
    @IBAction func launchGameAction(_ sender: UIButton) {
        Services.userDetails().subscribe(onNext: {[weak self] data in
        GamesPayView.show(price: gameListModel.cash, coin: gameListModel.integral) {[weak self] () in
            guard let weakSelf = self else { return }
            if let model = data.data{
                Services.game_gameStart(gameId: weakSelf.gameListModel.id, spaceId: weakSelf.QRCodeModel.space_id!, sutuId: weakSelf.QRCodeModel.sutu_id!, userID: model.userId).subscribe(onNext: { _ in
                    alertSuccess(msg: "启动成功")
            PaymentView.show(money: (ali: weakSelf.gameListModel.cash, wx: weakSelf.gameListModel.cash, coin: weakSelf.gameListModel.integral, course: nil)) { [weak self] payType in
                guard let weakSelf = self else { return }
                Services.payGame(configId: weakSelf.gameListModel.id, gameId: weakSelf.gameListModel.gameId, spaceId: weakSelf.spaceId, sutuId: weakSelf.sutuId, type: payType).subscribe(onNext: {data in
                    if data.code == 200{
                        switch payType {
                            case .wechat:break
                            case .aliPay:
                                YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: data.data?.orderString ?? "")) { result in
                                    switch result {
                                        case .success:alertSuccess(msg: "支付成功")
                                        case .cancel:alert(msg: "支付已取消")
                                        case .failure(let error):alert(msg: error.localizedDescription)
                                    }
                                }
                            default:alert(msg: "启动成功")
                        }
                    }else{
                        alert(msg: data.msg)
                    }
                }) { error in
                    alert(msg: error.localizedDescription)
                }.disposed(by: weakSelf.disposeBag)
            }
        }).disposed(by: disposeBag)
        }
//        Services.userDetails().subscribe(onNext: {[weak self] data in
//            guard let weakSelf = self else { return }
//            if let model = data.data{
//                Services.game_gameStart(gameId: weakSelf.gameListModel.id, spaceId: weakSelf.QRCodeModel.space_id!, sutuId: weakSelf.QRCodeModel.sutu_id!, userID: model.userId).subscribe(onNext: { _ in
//                    alertSuccess(msg: "启动成功")
//                }) { error in
//
//                }.disposed(by: weakSelf.disposeBag)
//            }
//        }).disposed(by: disposeBag)
    }
}
WanPai/Root/Games/VC/GamesSubListVC.swift
@@ -16,11 +16,12 @@
}
class GamesOffLineViewModel:RefreshModel<GameListModel>{
    let spaceId = BehaviorRelay<String>(value: "")
    let sutuId = BehaviorRelay<String>(value: "")
    let spaceId = BehaviorRelay<Int>(value: 0)
    let sutuId = BehaviorRelay<Int>(value: 0)
    let storeId = BehaviorRelay<Int>(value: 0)
    override func api() -> (Observable<BaseResponse<[GameListModel]>>)? {
        return Services.game_gameList(spaceId: spaceId.value, sutuId: sutuId.value)
        return Services.game_gameList(spaceId: spaceId.value, storeId: storeId.value)
    }
}
@@ -29,8 +30,8 @@
    private var model:QRCodeModel!
    private let offLineViewModel = GamesOffLineViewModel()
    private var tableView:UITableView!
    private var homeStoreModel:HomeStoreModel!
    private var tableView:BaseTableView!
    init(type:GamesSubType,model:QRCodeModel) {
        super.init(nibName: nil, bundle: nil)
@@ -45,17 +46,22 @@
    override func viewDidLoad() {
        super.viewDidLoad()
        if type == .offline{
            offLineViewModel.spaceId.accept(model.space_id!)
            offLineViewModel.sutuId.accept(model.sutu_id!)
            offLineViewModel.configure(tableView, needMore: false)
            offLineViewModel.beginRefresh()
        }
        if let storeStr = UserDefaults.standard.object(forKey: "CurrentStore") as? String{
            if let deserModel = HomeStoreModel.deserialize(from: storeStr){
                offLineViewModel.storeId.accept(deserModel.storeId)
                if type == .offline{
                    offLineViewModel.spaceId.accept(model.space_id!)
                    offLineViewModel.sutuId.accept(model.sutu_id!)
                    offLineViewModel.configure(tableView, needMore: false)
                    offLineViewModel.beginRefresh()
                }
            }
        }
    }
    override func setUI() {
        tableView = UITableView(frame: .zero, style: .plain)
        tableView = BaseTableView(frame: .zero, style: .plain)
        tableView.delegate = self
        tableView.dataSource = self
        tableView.register(UINib(nibName: "GamesTCell", bundle: nil), forCellReuseIdentifier: "_GamesTCell")
@@ -63,6 +69,8 @@
        tableView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        tableView.jq_setEmptyView()
    }
}
@@ -77,6 +85,9 @@
        if type == .offline{
            cell.gameListModel = offLineViewModel.dataSource.value[indexPath.row]
            cell.QRCodeModel = model
            cell.spaceId = offLineViewModel.spaceId.value
            cell.storeId = offLineViewModel.storeId.value
            cell.sutuId = offLineViewModel.sutuId.value
        }
        return cell
    }
WanPai/Root/Home/Model/HomeModel.swift
@@ -16,7 +16,7 @@
    var lat:Double = 0
}
class  HomeStoreConfigModel:HandyJSON {
class HomeStoreConfigModel:HandyJSON {
   required init() {}
@@ -24,8 +24,8 @@
    var isOpen:Int = 0
    var sort:Int = 0
    var backgroundImage:String = ""
    var defaultImg:UIImage?
    var radio:Double?
//    var defaultImg:UIImage?
    var radio:Double = 1.0
}
struct NormalSimpleModel:HandyJSON{
WanPai/Root/Home/VC/HomeVC.swift
@@ -43,33 +43,7 @@
    override func viewDidLoad() {
        super.viewDidLoad()
        viewModel.configure(collectionView,needMore: false)
        startLocation()
        viewModel.dataSource.subscribe(onNext: {[weak self] data in
            guard let weakSelf = self else { return }
            guard data.count != 0 else {return}
            weakSelf.items = data
            let group = DispatchGroup()
            Services.homeInfo2(storeId: weakSelf.viewModel.storeId.value).subscribe(onNext: {data in
            }) { error in
            }.disposed(by: weakSelf.disposeBag)
            group.notify(queue: .main){
                //重置Layout,不然不更新
                self!.layout = WaterFallFlowLayout()
                self!.layout.cols = 2
                self!.layout.sectionInset = UIEdgeInsets(top: 14, left: 34, bottom: 14, right: 34)
                self!.layout.delegate = self
                self!.collectionView.collectionViewLayout = self!.layout
                self!.collectionView.reloadData()
            }
        }).disposed(by: disposeBag)
        Services.startCourseHome().subscribe(onNext: {[weak self] data in
            if let model = data.data{
@@ -95,6 +69,51 @@
        }) { error in
        }.disposed(by: disposeBag)
        viewModel.dataSource.subscribe(onNext: {[weak self] data in
            guard let weakSelf = self else { return }
            guard data.count != 0 else {return}
            weakSelf.items = data
            let group = DispatchGroup()
            let queue = DispatchQueue(label: "imgRadio")
            queue.async(group: group){
                group.enter()
                Services.homeStoreConfig2(storeId: weakSelf.viewModel.storeId.value).subscribe(onNext: { data in
                    if let items = data.data{
                        weakSelf.items.append(contentsOf: items)
                        var i = 0
                        for (_,model) in weakSelf.items.enumerated(){
                            SDWebImageDownloader.shared.downloadImage(with: URL(string: model.backgroundImage)) { image, data, error, status in
                                if let i = image{
                                    model.radio = i.size.width / i.size.height
                                }else{
                                    model.radio = model.type.defaultImg.size.width / model.type.defaultImg.size.height
                                }
                                i += 1
                                if i == weakSelf.items.count - 1{
                                    group.leave()
                                }
                            }
                        }
                    }
                }) { error in
                    group.leave()
                }.disposed(by: weakSelf.disposeBag)
            }
            group.notify(queue: .main){
                    //重置Layout,不然不更新
                self!.layout = WaterFallFlowLayout()
                self!.layout.cols = 2
                self!.layout.sectionInset = UIEdgeInsets(top: 14, left: 34, bottom: 14, right: 34)
                self!.layout.delegate = self
                self!.collectionView.collectionViewLayout = self!.layout
                self!.collectionView.reloadData()
            }
        }).disposed(by: disposeBag)
    }
    
@@ -136,27 +155,11 @@
                        self?.label_vipInfo.text = text
                    }
                    self?.viewModel.beginRefresh()
                }else{
                    self?.defaultData()
                }
            }
        }) { [weak self] error in
            self?.label_store.text = "门店获取失败"
            self?.defaultData()
        }.disposed(by: disposeBag)
    }
    private func defaultData(){
        for index in 1...8{
            let type = HomeItemType(rawValue: index)!
            let m = HomeStoreConfigModel()
            m.type = type
            m.isOpen = 1
            m.sort = index
            m.radio = type.defaultImg.size.width / type.defaultImg.size.height
            items.append(m)
        }
        collectionView.reloadData()
    }
    private func startLocation(){
@@ -236,6 +239,7 @@
                let vc = WelfareWeeklyListVC()
                push(vc: vc)
            case .wisdomCourt:
                guard viewModel.storeId.value != 0 else {alert(msg: "请先选择门店");return}
                let vc = GamesVC()
                push(vc: vc)
            case .welfare:
@@ -272,11 +276,9 @@
extension HomeVC: WaterFallLayoutDelegate{
    func waterFlowLayout(_ waterFlowLayout: WaterFallFlowLayout, itemHeight indexPath: IndexPath) -> CGFloat {
        if indexPath.row % 2 != 0{
            return 185
        }else{
            return 288
        }
        let item = items[indexPath.row]
        let w = (view.frame.width - 68 - waterFlowLayout.minimumLineSpacing) / Double(waterFlowLayout.cols)
        return w / item.radio
    }
}
WanPai/Root/Search/VC/SearchVC.swift
@@ -85,9 +85,14 @@
        CommonAlertView.show(title: "提示", content: "即将打开小程序,是否继续?") { status in
            if status{
                let miniProgam = WXLaunchMiniProgramReq()
                let miniProgam = WXLaunchMiniProgramReq.object()
                miniProgam.userName = WeChatMinProgram
//                miniProgam.path = WeChatMinProgramPath
                #if DEBUG
                miniProgam.miniProgramType = .preview
                #else
                miniProgam.miniProgramType = .release
                #endif
                miniProgam.path = WeChatMinProgramPath
                WXApi.send(miniProgam) { s in
                    if !s{
                        alert(msg: "打开失败")
WanPai/Root/Yard/TCell/YardBookingTCell.swift
@@ -29,7 +29,6 @@
            label_name.text = yardBookingModel.name
            label_typeName.text = yardBookingModel.siteTypeName
            label_address.text = String(format: "%@(%@)",yardBookingModel.storeName, yardBookingModel.storeAddress)
            label_price.text = yardBookingModel.payMoney.currency()
            label_status.text = yardBookingModel.status.titleRaw
            label_bookingTime.text = String(format: "预约时间:%@", yardBookingModel.appointment)
            btn_detail.isHidden = yardBookingModel.status == .cancel
@@ -47,6 +46,14 @@
                    self.btn_payment.isHidden = true
//                    self.btn_cancel.isHidden = true
            }
            switch yardBookingModel.payType {
                case .aliPay,.wechat:
                    label_price.text = yardBookingModel.payMoney.currency()
                case .coin:
                    label_price.text = yardBookingModel.payMoney.int.string + "币"
                default:break
            }
        }
    }
WanPai/Root/Yard/VC/YardBookingDetailVC.swift
@@ -53,7 +53,6 @@
    private func getData(){
        Services.siteDetail(id: yardBookingModel.id).subscribe(onNext: {[weak self] data in
            guard let weakSelf = self else { return }
            if let model = data.data?.data{
                self?.yardBookingDetailDataModel = model
                self?.label_yardName.text = model.nextName
@@ -62,7 +61,16 @@
                self?.label_halfYardName.text = model.halfName
                self?.label_bookingPerson.text = model.booker
                self?.label_contact.text = model.phone
                self?.label_paymentPrice.text = model.payMoney.currency()
                switch model.payType {
                    case .aliPay,.wechat:
                        self?.label_paymentPrice.text = model.payMoney.currency()
                    case .courseNum:
                        self?.label_paymentPrice.text = model.payMoney.string + "课时"
                    case .coin:
                        self?.label_paymentPrice.text = model.payMoney.int.string + "币"
                }
                self?.label_bookingTime.text = Date.jq_format(TimeInterval(model.startTime / 1000), formatter: "yyyy-MM-dd")
                switch model.state {