WanPai.xcodeproj/project.pbxproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Config/Def.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Model/CommonModels.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Network/Services.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Root/Course/VC/AddStudentVC.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Root/Course/VC/CourseDetailApplyVC.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Root/Course/VC/CourseInfoVC.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Root/Search/TCell/SearchStoreTCell.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Root/Search/TCell/SearchStoreTCell.xib | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Root/Search/VC/SearchStoreListVC.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Root/Search/VC/SearchStoreListVC.xib | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WanPai/Root/Yard/VC/YardBookingDetailVC.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
WanPai.xcodeproj/project.pbxproj
@@ -1986,9 +1986,9 @@ INFOPLIST_FILE = WanPai/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "玩湃生活"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.sports"; INFOPLIST_KEY_NSCameraUsageDescription = "WanPai需要使用使用使用相机,来上传学员头像、评论图片"; INFOPLIST_KEY_NSCameraUsageDescription = "WanPai需要使用使用使用相机,来上传学员头像、评论图片、扫描二维码"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "WanPai需要使用使用定位,来推荐、搜索您附近的门店"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "WanPai需要使用使用使用相册,来上传学员头像、评论图片"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "WanPai需要使用使用使用相册,来上传学员头像、评论图片、扫描二维码"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; @@ -2148,9 +2148,9 @@ INFOPLIST_FILE = WanPai/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "玩湃生活"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.sports"; INFOPLIST_KEY_NSCameraUsageDescription = "WanPai需要使用使用使用相机,来上传学员头像、评论图片"; INFOPLIST_KEY_NSCameraUsageDescription = "WanPai需要使用使用使用相机,来上传学员头像、评论图片、扫描二维码"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "WanPai需要使用使用定位,来推荐、搜索您附近的门店"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "WanPai需要使用使用使用相册,来上传学员头像、评论图片"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "WanPai需要使用使用使用相册,来上传学员头像、评论图片、扫描二维码"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; WanPai/Config/Def.swift
@@ -267,12 +267,12 @@ case "探索玩湃": if page == "门店列表"{ // let vc = SearchStoreListVC(id: id ?? 0) // JQ_currentViewController().jq_push(vc: vc) JQ_currentViewController().navigationController?.popToRootViewController(animated: true) DispatchQueue.main.asyncAfter(deadline: .now()+0.5) { JQ_currentViewController().tabBarController?.selectedIndex = 3 } let vc = SearchStoreListVC() JQ_currentViewController().jq_push(vc: vc) // JQ_currentViewController().navigationController?.popToRootViewController(animated: true) // DispatchQueue.main.asyncAfter(deadline: .now()+0.5) { // JQ_currentViewController().tabBarController?.selectedIndex = 3 // } } if page == "常见问题"{ WanPai/Model/CommonModels.swift
@@ -492,6 +492,17 @@ var venueList = [SearchStoreDetailVenueModel]() } struct SearchStoreListModel:HandyJSON{ var storeAddress:String = "" var storeDistance:Double = 0 var storeImg:String = "" var storeId:Int = 0 var storeInfo:String = "" var storeName:String = "" var storeTime:String = "" var storePhone:String = "" } struct SearchStoreDetailCourseModel:HandyJSON{ var applicantsNumber: Int = 0 var classHours = [Int]() WanPai/Network/Services.swift
@@ -469,7 +469,7 @@ class func courcePayment(conponId:Int? = nil,courseConfigId:Int,id:Int,price:Double,payType:PayType,stuId:[Int])->Observable<BaseResponse<PaymentModel>>{ let params = ParamsAppender.build(url: All_Url) .interface(url: "/course/api/course/paymentCourse") .append(key: "conponId", value: conponId) .append(key: "couponId", value: conponId) .append(key: "coursePackagePaymentConfigId", value: courseConfigId) .append(key: "id", value: id) .append(key: "payType", value: payType.rawValue) @@ -734,6 +734,17 @@ // MARK: -- 探索玩湃 extension Services{ static func exploreStoreList(search:String? = nil,space:Int? = nil,cityCode:Int? = nil)->Observable<BaseResponse<[SearchStoreListModel]>>{ let params = ParamsAppender.build(url: All_Url) .interface(url: "/account/base/exploreWP/storeList") .append(key: "latitude", value: locationTool.currentLocation?.coordinate.latitude.string) .append(key: "longitude", value: locationTool.currentLocation?.coordinate.longitude.string) .append(key: "search", value: search) .append(key: "space", value: space) .append(key: "cityCode", value: cityCode) return NetworkRequest.request(params: params, method: .post, progress: false) } /// 探索玩湃首页数据 static func exploreHome()->Observable<BaseResponse<[StartClouseExploreModel]>>{ let params = ParamsAppender.build(url: All_Url) WanPai/Root/Course/VC/AddStudentVC.swift
@@ -180,6 +180,7 @@ }else{ Services.editStu(studentModel).subscribe(onNext: {[weak self]data in self?.addStudentSuccess(text: "添加成功") NotificationCenter.default.post(name: StudentUpdate_Nofi, object: nil) }) { error in }.disposed(by: disposeBag) WanPai/Root/Course/VC/CourseDetailApplyVC.swift
@@ -222,7 +222,7 @@ case .courseNum,.integral:break } Services.courcePayment(conponId: weakSelf.selectCouponModel?.id, courseConfigId: model.id, id: weakSelf.detailModel!.id, price: paymentPrice, payType: payType, stuId: weakSelf.studentModels.map({$0.id})).subscribe(onNext: { data in Services.courcePayment(conponId: weakSelf.selectCouponModel?.id, courseConfigId: model.id, id: weakSelf.detailModel!.id, price: price, payType: payType, stuId: weakSelf.studentModels.map({$0.id})).subscribe(onNext: { data in if data.code == 200{ switch payType { case .aliPay: WanPai/Root/Course/VC/CourseInfoVC.swift
@@ -390,9 +390,8 @@ @objc func localDetailAction(btn:UIButton){ let index = btn.tag - 10 if (weeklyCourseModel?.data[index]) != nil{ JQ_MapNavigationTool.startNav(CLLocationCoordinate2D(latitude: weeklyCourseModel!.lat, longitude: weeklyCourseModel!.lon), distanceName: weeklyCourseModel?.name ?? "未命名地址", scheme: "weparklife") } guard let m = weeklyCourseModel else {return} JQ_MapNavigationTool.startNav(CLLocationCoordinate2D(latitude: m.lat, longitude: m.lon), distanceName: m.name, scheme: "weparklife") } } WanPai/Root/Search/TCell/SearchStoreTCell.swift
@@ -9,7 +9,27 @@ class SearchStoreTCell: UITableViewCell { override func awakeFromNib() { var searchStoreListModel:SearchStoreListModel!{ didSet{ img.sd_setImage(with: URL(string: searchStoreListModel.storeImg)) label_title.text = searchStoreListModel.storeName label_address.text = searchStoreListModel.storeAddress label_distance.text = String(format: "距离我%.2lfkm", searchStoreListModel.storeDistance) label_phone.text = searchStoreListModel.storePhone label_storeInfo.text = searchStoreListModel.storeInfo label_times.text = searchStoreListModel.storeTime } } @IBOutlet weak var img: UIImageView! @IBOutlet weak var label_title: UILabel! @IBOutlet weak var label_address: UILabel! @IBOutlet weak var label_distance: UILabel! @IBOutlet weak var label_phone: UILabel! @IBOutlet weak var label_times: UILabel! @IBOutlet weak var label_storeInfo: UILabel! override func awakeFromNib() { super.awakeFromNib() selectionStyle = .none } WanPai/Root/Search/TCell/SearchStoreTCell.xib
@@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina6_12" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -43,7 +43,7 @@ <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="距离我0km" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tYq-lL-KJ9"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="距离我0km" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tYq-lL-KJ9"> <rect key="frame" x="323.33333333333331" y="273.66666666666669" width="68.666666666666686" height="14.333333333333314"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="calibratedRGB"/> @@ -116,6 +116,15 @@ <constraint firstAttribute="trailing" secondItem="D5l-QO-O1U" secondAttribute="trailing" id="wOq-kd-YTQ"/> </constraints> </tableViewCellContentView> <connections> <outlet property="img" destination="D5l-QO-O1U" id="HA3-CF-Llo"/> <outlet property="label_address" destination="69A-vv-fPN" id="qat-l5-k0O"/> <outlet property="label_distance" destination="tYq-lL-KJ9" id="0dj-kE-D2J"/> <outlet property="label_phone" destination="iBF-pV-O5V" id="gMw-zg-id1"/> <outlet property="label_storeInfo" destination="cSO-9H-l13" id="X8g-xB-NTH"/> <outlet property="label_times" destination="f5d-eY-6Fx" id="Khg-vL-IUq"/> <outlet property="label_title" destination="K31-7N-OPG" id="ynD-3v-1xW"/> </connections> <point key="canvasLocation" x="128.24427480916029" y="134.1549295774648"/> </tableViewCell> </objects> WanPai/Root/Search/VC/SearchStoreListVC.swift
@@ -8,6 +8,21 @@ import UIKit import QMUIKit import JQTools import RxRelay import RxSwift class SearchStoreViewModel:RefreshModel<SearchStoreListModel>{ let search = BehaviorRelay<String?>(value:nil) let space = BehaviorRelay<Int?>(value:nil) // 1=升序/2=降序 var cityCode = BehaviorRelay<Int?>(value:nil) override func api() -> (Observable<BaseResponse<[SearchStoreListModel]>>)? { return Services.exploreStoreList(search: search.value, space: space.value, cityCode: cityCode.value) } } class SearchStoreListVC: BaseVC { @@ -16,11 +31,35 @@ @IBOutlet weak var btn_limits: QMUIButton! @IBOutlet weak var tableView: UITableView! @IBOutlet weak var stackView: UIStackView! private var id:Int! @IBOutlet weak var view_localtion: UIView! @IBOutlet weak var tf_searchStore: UITextField! private var cityChooseSubTypeView:CityChooseSubTypeView? private var viewModel = SearchStoreViewModel() override func viewDidLoad() { super.viewDidLoad() title = "门店列表" viewModel.configure(tableView,needMore: false) viewModel.beginRefresh() let currentStatus = CLLocationManager.authorizationStatus() switch currentStatus { case .authorizedAlways,.authorizedWhenInUse: view_localtion.isHidden = true viewModel.beginRefresh() case .restricted,.denied: view_localtion.isHidden = false case .notDetermined: view_localtion.isHidden = true locationTool.startLocation { [weak self] local in self?.viewModel.beginRefresh() locationTool.stopLocation() } errorClouse: { error in alertError(msg: "定位获取失败") } default:break } } override func setUI() { @@ -28,7 +67,7 @@ btn_city.spacingBetweenImageAndTitle = 10 btn_distance.imagePosition = .right btn_distance.spacingBetweenImageAndTitle = -5 btn_distance.spacingBetweenImageAndTitle = 6 btn_limits.imagePosition = .left btn_limits.spacingBetweenImageAndTitle = 2 @@ -39,50 +78,74 @@ tableView.dataSource = self tableView.separatorStyle = .none tableView.register(UINib(nibName: "SearchStoreTCell", bundle: nil), forCellReuseIdentifier: "_SearchStoreTCell") tf_searchStore.delegate = self tf_searchStore.returnKeyType = .search } init(id:Int) { super.init(nibName: nil, bundle: nil) self.id = id override func setRx() { tf_searchStore.rx.text.orEmpty.bind(to: viewModel.search).disposed(by: disposeBag) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") @IBAction func gotoSettingAction(_ sender: QMUIButton) { JQ_AuthorizesTool.default.openURL(.location) } @IBAction func cityAction(_ sender: QMUIButton) { guard !sender.isSelected else {return} sender.isSelected = true let items = Array<NormalSimpleModel>() CourseSubTypeView.show(inView: self.view, afterView: stackView, items:items) { m in sender.isSelected = false } closeClouse: { sender.isSelected = false } guard !sender.isSelected else {return} sender.isSelected = true cityChooseSubTypeView = CityChooseSubTypeView.show(inView: self.view, afterView: stackView) { [weak self] m in self?.viewModel.space.accept(nil) self?.btn_distance.setImage(UIImage(named: "icon_sort_normal"), for: .normal) sender.setTitle(m.name, for: .normal) self?.viewModel.cityCode.accept(m.code) self?.viewModel.beginRefresh() sender.isSelected = false } closeClouse: { sender.isSelected = false } } @IBAction func distanceAction(_ sender: QMUIButton) { view.endEditing(true) sender.isSelected = !sender.isSelected let sortType = sender.isSelected ? 1:2 viewModel.space.accept(sortType) sender.setImage(sortType == 1 ? UIImage(named: "icon_asc"):UIImage(named: "icon_desc"), for: .normal) viewModel.beginRefresh() } @IBAction func searchAction(_ sender: Any) { view.endEditing(true) viewModel.beginRefresh() } } extension SearchStoreListVC:UITextFieldDelegate{ func textFieldShouldReturn(_ textField: UITextField) -> Bool { view.endEditing(true) viewModel.beginRefresh() return true } } extension SearchStoreListVC:UITableViewDelegate{ func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let vc = SearchStoreDetailVC(id: 0) let model = viewModel.dataSource.value[indexPath.row] let vc = SearchStoreDetailVC(id: model.storeId) push(vc: vc) } } extension SearchStoreListVC:UITableViewDataSource{ func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let model = viewModel.dataSource.value[indexPath.row] let cell = tableView.dequeueReusableCell(withIdentifier: "_SearchStoreTCell", for: indexPath) as! SearchStoreTCell cell.searchStoreListModel = model return cell } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 10 return viewModel.dataSource.value.count } } WanPai/Root/Search/VC/SearchStoreListVC.xib
@@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina6_12" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> <capability name="Named colors" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> @@ -17,7 +17,9 @@ <outlet property="btn_limits" destination="L73-YJ-fMg" id="Apw-Mp-8Gs"/> <outlet property="stackView" destination="p37-ee-k1s" id="KOE-Id-1Ga"/> <outlet property="tableView" destination="w5f-N5-JJP" id="6Oc-pX-5Vv"/> <outlet property="tf_searchStore" destination="ijW-3g-tUM" id="V2D-K7-LrL"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view_localtion" destination="9la-Zv-RdZ" id="qK5-Fu-2ii"/> </connections> </placeholder> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> @@ -67,6 +69,9 @@ <state key="normal" title="搜索"> <color key="titleColor" name="FE6E0D"/> </state> <connections> <action selector="searchAction:" destination="-1" eventType="touchUpInside" id="gTx-dX-GTW"/> </connections> </button> </subviews> <color key="backgroundColor" systemColor="systemBackgroundColor"/> @@ -106,6 +111,9 @@ <real key="value" value="2"/> </userDefinedRuntimeAttribute> </userDefinedRuntimeAttributes> <connections> <action selector="gotoSettingAction:" destination="-1" eventType="touchUpInside" id="Wlp-xa-ZLG"/> </connections> </button> </subviews> <color key="backgroundColor" systemColor="systemBackgroundColor"/> @@ -120,14 +128,14 @@ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Y91-9f-1ri"> <rect key="frame" x="0.0" y="97" width="393" height="35"/> <subviews> <stackView opaque="NO" contentMode="scaleToFill" spacing="73" translatesAutoresizingMaskIntoConstraints="NO" id="Z8B-KR-reT"> <rect key="frame" x="14" y="0.0" width="186" height="35"/> <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="73" translatesAutoresizingMaskIntoConstraints="NO" id="Z8B-KR-reT"> <rect key="frame" x="14" y="0.0" width="231" height="35"/> <subviews> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Vo-Nb-UWI" customClass="QMUIButton"> <rect key="frame" x="0.0" y="0.0" width="53" height="35"/> <rect key="frame" x="0.0" y="0.0" width="79" height="35"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <state key="normal" title="成都" image="icon_down_arrow"> <state key="normal" title="热门城市" image="icon_down_arrow"> <color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="0.69999999999999996" colorSpace="custom" customColorSpace="sRGB"/> </state> <state key="selected" image="icon_down_arrow_s"/> @@ -136,7 +144,7 @@ </connections> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Sjl-a9-MXw" customClass="QMUIButton"> <rect key="frame" x="126" y="0.0" width="60" height="35"/> <rect key="frame" x="152" y="0.0" width="79" height="35"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <state key="normal" title="距离" image="icon_sort_normal"> @@ -179,10 +187,10 @@ </view> </objects> <resources> <image name="icon_down_arrow" width="20" height="14"/> <image name="icon_down_arrow_s" width="20" height="14"/> <image name="icon_down_arrow" width="13" height="8"/> <image name="icon_down_arrow_s" width="13" height="8"/> <image name="icon_local" width="14" height="14"/> <image name="icon_sort_normal" width="27" height="30"/> <image name="icon_sort_normal" width="9" height="12"/> <image name="search" width="16" height="16"/> <namedColor name="FE6E0D"> <color red="0.99199998378753662" green="0.53299999237060547" blue="0.0080000003799796104" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> WanPai/Root/Yard/VC/YardBookingDetailVC.swift
@@ -119,6 +119,7 @@ self?.label_bookingTime.text = model.times self?.label_usedState.text = model.status.titleRaw self?.label_paymentTime.text = Date.jq_format(TimeInterval(model.payTime / 1000), formatter: "yyyy-MM-dd HH:mm") self?.view_paymentTime.isHidden = model.payTime == 0 switch model.status { case .waitPayment: