From d587fb260c6118de4707c35a1e312af6a4cfd28c Mon Sep 17 00:00:00 2001 From: 无故事王国 <841720330@qq.com> Date: 星期四, 12 十月 2023 18:25:36 +0800 Subject: [PATCH] fix BUG --- WanPai/Root/Course/View/CourseOnlineSearchView.xib | 8 +- WanPai/Root/Home/VC/HomeVC.swift | 50 ++++++++++------ WanPai/Assets.xcassets/Icons/icon_scheme.imageset/icon_scheme@3x.png | 0 WanPai/Root/Course/VC/CourseOnlineListVC.swift | 10 +++ WanPai/Root/Welfare/VC/WelfareVC.swift | 16 ++++ WanPai/Assets.xcassets/Icons/icon_scheme.imageset/Contents.json | 22 +++++++ WanPai/Root/Course/VC/CourseInfoScheduleVC.swift | 2 WanPai/Root/Course/VC/CourseInfoVC.xib | 40 ++++++++----- WanPai/Root/Course/VC/AddStudentVC.swift | 2 WanPai/Root/Course/VC/AddStudentVC.xib | 2 WanPai/Root/Course/VC/CourseInfoVC.swift | 4 WanPai/Assets.xcassets/Icons/icon_scheme.imageset/icon_scheme@2x.png | 0 12 files changed, 113 insertions(+), 43 deletions(-) diff --git a/WanPai/Assets.xcassets/Icons/icon_scheme.imageset/Contents.json b/WanPai/Assets.xcassets/Icons/icon_scheme.imageset/Contents.json new file mode 100644 index 0000000..199d6a9 --- /dev/null +++ b/WanPai/Assets.xcassets/Icons/icon_scheme.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icon_scheme@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icon_scheme@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WanPai/Assets.xcassets/Icons/icon_scheme.imageset/icon_scheme@2x.png b/WanPai/Assets.xcassets/Icons/icon_scheme.imageset/icon_scheme@2x.png new file mode 100644 index 0000000..60a0e42 --- /dev/null +++ b/WanPai/Assets.xcassets/Icons/icon_scheme.imageset/icon_scheme@2x.png Binary files differ diff --git a/WanPai/Assets.xcassets/Icons/icon_scheme.imageset/icon_scheme@3x.png b/WanPai/Assets.xcassets/Icons/icon_scheme.imageset/icon_scheme@3x.png new file mode 100644 index 0000000..f9e4dc8 --- /dev/null +++ b/WanPai/Assets.xcassets/Icons/icon_scheme.imageset/icon_scheme@3x.png Binary files differ diff --git a/WanPai/Root/Course/VC/AddStudentVC.swift b/WanPai/Root/Course/VC/AddStudentVC.swift index 39ae03f..0ee53ed 100644 --- a/WanPai/Root/Course/VC/AddStudentVC.swift +++ b/WanPai/Root/Course/VC/AddStudentVC.swift @@ -89,6 +89,7 @@ guard !tf_name.text!.isEmpty else {alertError(msg: tf_name.placeholder!);return} guard !tf_birthday.text!.isEmpty else {alertError(msg: "请选择生日");return} + guard !tf_gender.text!.isEmpty else {alertError(msg: "请选择性别");return} guard !tf_height.text!.isEmpty else {alertError(msg: tf_height.placeholder!);return} guard !tf_weight.text!.isEmpty else {alertError(msg: tf_weight.placeholder!);return} guard tf_height.text != "0" else {alertError(msg: "请输入正确的身高");return} @@ -163,6 +164,7 @@ extension AddStudentVC:UITextFieldDelegate{ func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { if textField == tf_birthday{ + view.endEditing(true) CommonDatePickerView.show(before: 18, after: 0, type: .YMD) { year, month, day,_,_ in textField.text = String(format: "%ld-%02ld-%02ld", year!,month!,day!) } diff --git a/WanPai/Root/Course/VC/AddStudentVC.xib b/WanPai/Root/Course/VC/AddStudentVC.xib index b651683..efca791 100644 --- a/WanPai/Root/Course/VC/AddStudentVC.xib +++ b/WanPai/Root/Course/VC/AddStudentVC.xib @@ -155,7 +155,7 @@ <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> - <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="男" placeholder="请选择" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="5l9-vJ-vil"> + <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请选择" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="5l9-vJ-vil"> <rect key="frame" x="120" y="0.0" width="233" height="50"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> <textInputTraits key="textInputTraits"/> diff --git a/WanPai/Root/Course/VC/CourseInfoScheduleVC.swift b/WanPai/Root/Course/VC/CourseInfoScheduleVC.swift index 15c8178..fc8aca3 100644 --- a/WanPai/Root/Course/VC/CourseInfoScheduleVC.swift +++ b/WanPai/Root/Course/VC/CourseInfoScheduleVC.swift @@ -76,7 +76,7 @@ cell.label_week.jq_cornerRadius = cellW / 2 cell.label_week.jq_masksToBounds = true cell.label_week.text = date.jq_nowWeekDay().weekName - cell.label_time.text = date.jq_format("MM-dd") + cell.label_time.text = date.jq_format("MM.dd") cell.label_time.jq_masksToBounds = false cell.layer.masksToBounds = false cell.contentView.layer.masksToBounds = false diff --git a/WanPai/Root/Course/VC/CourseInfoVC.swift b/WanPai/Root/Course/VC/CourseInfoVC.swift index 4b4ce15..9250562 100644 --- a/WanPai/Root/Course/VC/CourseInfoVC.swift +++ b/WanPai/Root/Course/VC/CourseInfoVC.swift @@ -547,8 +547,8 @@ func pageViewController(_ pageViewController: FFPageViewController, currentPageChanged currentPage: Int) { let vc = pageViewController.currentController as! CourseInfoScheduleVC vc.currentSelectDate = currentDate - let first = vc.dates.first?.jq_format("yyyy-MM.dd") - let last = vc.dates.last?.jq_format("yyyy-MM.dd") + let first = vc.dates.first?.jq_format("yyyy.MM.dd") + let last = vc.dates.last?.jq_format("yyyy.MM.dd") label_weeklyScope.text = "\(first ?? "")-\(last ?? "")" } diff --git a/WanPai/Root/Course/VC/CourseInfoVC.xib b/WanPai/Root/Course/VC/CourseInfoVC.xib index 3ff3a0f..f506792 100644 --- a/WanPai/Root/Course/VC/CourseInfoVC.xib +++ b/WanPai/Root/Course/VC/CourseInfoVC.xib @@ -3,7 +3,7 @@ <device id="retina6_12" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22129"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/> <capability name="Named colors" minToolsVersion="9.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> @@ -89,7 +89,7 @@ </userDefinedRuntimeAttributes> </imageView> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dM8-7c-aXP"> - <rect key="frame" x="0.0" y="0.0" width="393" height="1083.3333333333333"/> + <rect key="frame" x="0.0" y="0.0" width="393" height="1085.3333333333333"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="学员名" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="egC-eg-thJ"> <rect key="frame" x="27" y="37" width="64.333333333333329" height="29"/> @@ -406,13 +406,13 @@ <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="•" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xl3-tO-aDi"> - <rect key="frame" x="312" y="421.66666666666669" width="12" height="32.333333333333314"/> + <rect key="frame" x="312" y="419.66666666666669" width="12" height="32.333333333333314"/> <fontDescription key="fontDescription" type="system" pointSize="27"/> <color key="textColor" red="0.17254901959999999" green="0.30980392159999998" blue="0.38823529410000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="前一周" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tXu-lh-XbB"> - <rect key="frame" x="38" y="429.33333333333331" width="43" height="17"/> + <rect key="frame" x="38" y="431.33333333333331" width="43" height="17"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <color key="textColor" red="0.17254901959999999" green="0.30980392159999998" blue="0.38823529410000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -424,27 +424,27 @@ <nil key="highlightedColor"/> </label> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UMv-8K-vwR"> - <rect key="frame" x="0.0" y="485.33333333333331" width="393" height="49.999999999999943"/> + <rect key="frame" x="0.0" y="487.33333333333326" width="393" height="50"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/> <constraints> <constraint firstAttribute="height" constant="50" id="bj2-Gb-oIH"/> </constraints> </view> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_star" translatesAutoresizingMaskIntoConstraints="NO" id="uha-8d-tRd"> - <rect key="frame" x="24" y="621.33333333333337" width="22" height="23"/> + <rect key="frame" x="24" y="623.33333333333337" width="22" height="23"/> <constraints> <constraint firstAttribute="height" constant="23" id="SDl-H8-Wdc"/> <constraint firstAttribute="width" constant="22" id="VaN-Xb-9IW"/> </constraints> </imageView> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="学员勋章" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ioo-oF-wME"> - <rect key="frame" x="52.999999999999993" y="623.33333333333337" width="65.333333333333314" height="19.333333333333371"/> + <rect key="frame" x="52.999999999999993" y="625.33333333333337" width="65.333333333333314" height="19.333333333333371"/> <fontDescription key="fontDescription" type="system" pointSize="16"/> <color key="textColor" red="0.17254901960784313" green="0.30980392156862746" blue="0.38823529411764707" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="b9G-TL-PI1"> - <rect key="frame" x="0.0" y="674.33333333333337" width="393" height="50"/> + <rect key="frame" x="0.0" y="676.33333333333337" width="393" height="50"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/> <constraints> <constraint firstAttribute="height" constant="50" id="c8h-cI-ZAt"/> @@ -457,7 +457,7 @@ </collectionViewFlowLayout> </collectionView> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Okg-Yc-buM"> - <rect key="frame" x="100" y="741.33333333333337" width="193" height="40"/> + <rect key="frame" x="100" y="743.33333333333337" width="193" height="40"/> <color key="backgroundColor" name="FE6E0D"/> <constraints> <constraint firstAttribute="height" constant="40" id="rQm-Bd-Kpj"/> @@ -476,21 +476,21 @@ </connections> </button> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" estimatedSectionHeaderHeight="-1" sectionFooterHeight="18" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="O0u-hX-kAR"> - <rect key="frame" x="24" y="535.33333333333337" width="345" height="70"/> + <rect key="frame" x="24" y="537.33333333333337" width="345" height="70"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/> <constraints> <constraint firstAttribute="height" constant="70" id="Opj-Pl-2o1"/> </constraints> </tableView> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tc8-tf-Jm4"> - <rect key="frame" x="19" y="818.33333333333337" width="355" height="1"/> + <rect key="frame" x="19" y="820.33333333333337" width="355" height="1"/> <color key="backgroundColor" red="0.59215686274509804" green="0.59215686274509804" blue="0.59215686274509804" alpha="0.25" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstAttribute="height" constant="1" id="zCQ-gS-bAL"/> </constraints> </view> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="wNl-09-jiS"> - <rect key="frame" x="22" y="819.33333333333337" width="349" height="264.00000000000011"/> + <rect key="frame" x="22" y="821.33333333333337" width="349" height="264.00000000000011"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KR4-hI-8vp"> <rect key="frame" x="0.0" y="0.0" width="349" height="53"/> @@ -561,6 +561,13 @@ </view> </subviews> </stackView> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_scheme" translatesAutoresizingMaskIntoConstraints="NO" id="b2B-sv-AXV"> + <rect key="frame" x="21" y="395.33333333333331" width="18" height="19"/> + <constraints> + <constraint firstAttribute="height" constant="19" id="U9y-Q3-689"/> + <constraint firstAttribute="width" constant="18" id="ker-Ij-iyX"/> + </constraints> + </imageView> </subviews> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> @@ -574,16 +581,18 @@ <constraint firstAttribute="trailing" secondItem="wNl-09-jiS" secondAttribute="trailing" constant="22" id="3SP-6t-93o"/> <constraint firstItem="gbo-sZ-lm5" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="27" id="3e7-4s-VCK"/> <constraint firstItem="egC-eg-thJ" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="27" id="71E-fS-Lee"/> - <constraint firstItem="tXu-lh-XbB" firstAttribute="centerY" secondItem="Ojc-7l-9aZ" secondAttribute="centerY" id="8Ir-Jt-aOD"/> + <constraint firstItem="tXu-lh-XbB" firstAttribute="centerY" secondItem="Ojc-7l-9aZ" secondAttribute="centerY" constant="2" id="8Ir-Jt-aOD"/> <constraint firstItem="QI0-rG-m2x" firstAttribute="leading" secondItem="Xl3-tO-aDi" secondAttribute="trailing" constant="7" id="BIF-uG-EbJ"/> + <constraint firstItem="b2B-sv-AXV" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="21" id="BJ2-n5-Jow"/> <constraint firstItem="CR5-qX-86L" firstAttribute="top" secondItem="nW8-qE-ePO" secondAttribute="bottom" constant="27" id="Cdl-RT-tsm"/> <constraint firstAttribute="trailing" secondItem="Okg-Yc-buM" secondAttribute="trailing" constant="100" id="DSx-nT-0al"/> <constraint firstItem="tXu-lh-XbB" firstAttribute="leading" secondItem="Ojc-7l-9aZ" secondAttribute="trailing" constant="7" id="GIF-gF-axt"/> <constraint firstItem="j3F-fo-P15" firstAttribute="centerY" secondItem="CR5-qX-86L" secondAttribute="centerY" id="Ick-M6-Hzh"/> <constraint firstItem="Ioo-oF-wME" firstAttribute="leading" secondItem="uha-8d-tRd" secondAttribute="trailing" constant="7" id="JfJ-xw-6OJ"/> - <constraint firstItem="QI0-rG-m2x" firstAttribute="centerY" secondItem="Xl3-tO-aDi" secondAttribute="centerY" id="JlO-tM-ePB"/> + <constraint firstItem="QI0-rG-m2x" firstAttribute="centerY" secondItem="Xl3-tO-aDi" secondAttribute="centerY" constant="2" id="JlO-tM-ePB"/> <constraint firstItem="hpJ-2G-ATO" firstAttribute="centerX" secondItem="dM8-7c-aXP" secondAttribute="centerX" id="MDr-hU-dEg"/> <constraint firstItem="Ioo-oF-wME" firstAttribute="centerY" secondItem="uha-8d-tRd" secondAttribute="centerY" id="Nzi-A3-U8i"/> + <constraint firstItem="CR5-qX-86L" firstAttribute="centerY" secondItem="b2B-sv-AXV" secondAttribute="centerY" id="PDG-Y7-gzV"/> <constraint firstItem="ya3-wv-QBZ" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="19" id="PMv-Hz-gc1"/> <constraint firstItem="ya3-wv-QBZ" firstAttribute="top" secondItem="gbo-sZ-lm5" secondAttribute="bottom" constant="30" id="PNy-jR-omb"/> <constraint firstAttribute="trailing" secondItem="gbo-sZ-lm5" secondAttribute="trailing" id="Pa6-s7-4MW"/> @@ -600,7 +609,6 @@ <constraint firstItem="Tc8-tf-Jm4" firstAttribute="top" secondItem="Okg-Yc-buM" secondAttribute="bottom" constant="37" id="dTC-iD-v4t"/> <constraint firstItem="Okg-Yc-buM" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="100" id="eH1-GW-XiZ"/> <constraint firstItem="b9G-TL-PI1" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" id="gYe-bJ-OmL"/> - <constraint firstItem="CR5-qX-86L" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="45" id="gzd-UW-hLF"/> <constraint firstAttribute="trailing" secondItem="nW8-qE-ePO" secondAttribute="trailing" id="iIW-Tl-Z4r"/> <constraint firstItem="Tc8-tf-Jm4" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="19" id="iYc-rx-eqc"/> <constraint firstItem="Ojc-7l-9aZ" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="19" id="iwm-mn-Q3j"/> @@ -617,6 +625,7 @@ <constraint firstItem="s1y-gM-ejj" firstAttribute="top" secondItem="egC-eg-thJ" secondAttribute="bottom" constant="9" id="tME-09-nWN"/> <constraint firstItem="uha-8d-tRd" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="24" id="tf3-QF-jpk"/> <constraint firstItem="egC-eg-thJ" firstAttribute="top" secondItem="dM8-7c-aXP" secondAttribute="top" constant="37" id="tvI-rg-y5R"/> + <constraint firstItem="CR5-qX-86L" firstAttribute="leading" secondItem="b2B-sv-AXV" secondAttribute="trailing" constant="6" id="uol-Qy-oWs"/> <constraint firstItem="UMv-8K-vwR" firstAttribute="top" secondItem="tXu-lh-XbB" secondAttribute="bottom" constant="39" id="uxC-SF-92L"/> <constraint firstItem="uha-8d-tRd" firstAttribute="top" secondItem="O0u-hX-kAR" secondAttribute="bottom" constant="16" id="vAj-gf-AyT"/> <constraint firstItem="nW8-qE-ePO" firstAttribute="top" secondItem="hpJ-2G-ATO" secondAttribute="bottom" constant="23" id="xey-Mz-hta"/> @@ -658,6 +667,7 @@ <image name="icon_circle_mini" width="16" height="16"/> <image name="icon_man" width="16" height="16"/> <image name="icon_more" width="11" height="18"/> + <image name="icon_scheme" width="18" height="19"/> <image name="icon_star" width="22" height="23"/> <image name="icon_stu_weight" width="20" height="20"/> <image name="icon_student_hei" width="18" height="24"/> diff --git a/WanPai/Root/Course/VC/CourseOnlineListVC.swift b/WanPai/Root/Course/VC/CourseOnlineListVC.swift index 0cc4557..ec2ece7 100644 --- a/WanPai/Root/Course/VC/CourseOnlineListVC.swift +++ b/WanPai/Root/Course/VC/CourseOnlineListVC.swift @@ -71,9 +71,11 @@ flowlayout.minimumLineSpacing = 22 // flowlayout.sectionHeadersPinToVisibleBounds = true flowlayout.headerReferenceSize = CGSize(width: JQ_ScreenW, height: 52) + flowlayout.footerReferenceSize = CGSize(width: JQ_ScreenW, height: 1) collectionView = BaseCollectionView(frame: .zero, collectionViewLayout: flowlayout) collectionView.register(UINib(nibName: "CourseOnlineCCell", bundle: nil), forCellWithReuseIdentifier: "_CourseOnlineCCell") collectionView.register(UINib(nibName: "CourseOnlineHeadView", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "_CourseOnlineHeadView") + collectionView.register(UICollectionReusableView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: "_footer") collectionView.delegate = self collectionView.dataSource = self collectionView.backgroundColor = .white @@ -131,6 +133,14 @@ headerView.label_name.text = viewModel.dataSource.value[indexPath.section].name return headerView } + + if kind == UICollectionView.elementKindSectionFooter{ + var footerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "_footer", for: indexPath) + footerView.backgroundColor = UIColor(hexStr: "#979797").withAlphaComponent(0.29) + return footerView + } + + return UICollectionReusableView() } diff --git a/WanPai/Root/Course/View/CourseOnlineSearchView.xib b/WanPai/Root/Course/View/CourseOnlineSearchView.xib index 0247998..9ca5faf 100644 --- a/WanPai/Root/Course/View/CourseOnlineSearchView.xib +++ b/WanPai/Root/Course/View/CourseOnlineSearchView.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="22154" 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="22130"/> <capability name="Named colors" minToolsVersion="9.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> @@ -31,7 +31,7 @@ <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_search" translatesAutoresizingMaskIntoConstraints="NO" id="DGu-Ef-xoc"> <rect key="frame" x="4" y="10.333333333333343" width="17" height="17"/> </imageView> - <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="输入课程名称,门店名称" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="sT4-o4-OES" customClass="QMUITextField"> + <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="输入分类名称" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="sT4-o4-OES" customClass="QMUITextField"> <rect key="frame" x="25" y="0.0" width="291" height="38"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> <textInputTraits key="textInputTraits" returnKeyType="search"/> @@ -118,7 +118,7 @@ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> </systemColor> <systemColor name="systemGray6Color"> - <color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <color red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </systemColor> </resources> </document> diff --git a/WanPai/Root/Home/VC/HomeVC.swift b/WanPai/Root/Home/VC/HomeVC.swift index 62bc2a1..c67ea8f 100644 --- a/WanPai/Root/Home/VC/HomeVC.swift +++ b/WanPai/Root/Home/VC/HomeVC.swift @@ -81,25 +81,35 @@ if let m = data.data{ var text = "欢迎来到 快乐运动俱乐部" if m.storeId != 0{ - if let storeStr = UserDefaults.standard.object(forKey: "CurrentStore") as? String{ - if let deserModel = HomeStoreModel.deserialize(from: storeStr){ - self?.label_store.text = deserModel.name.isEmpty ? "门店获取失败":deserModel.name - self?.storeModel = deserModel - self?.storeId = deserModel.storeId - if deserModel.isVip == 0{text.append("\n加入我们 成为会员")} - self?.label_vipInfo.text = text - } - }else{ - self?.label_store.text = m.name.isEmpty ? "门店获取失败":m.name - UserDefaults.standard.set(m.toJSONString(), forKey: "CurrentStore") - UserDefaults.standard.synchronize() - self?.storeModel = m - self?.storeId = m.storeId - if m.isVip == 0{text.append("\n加入我们 成为会员")} - self?.label_vipInfo.text = text - } + self?.label_store.text = m.name.isEmpty ? "门店获取失败":m.name + self?.storeModel = m + self?.storeId = m.storeId + if m.isVip == 0{text.append("\n加入我们 成为会员")} + self?.label_vipInfo.text = text + UserDefaults.standard.set(m.toJSONString(), forKey: "CurrentStore") + UserDefaults.standard.synchronize() self?.getStoreItemList() - } + + +// if let storeStr = UserDefaults.standard.object(forKey: "CurrentStore") as? String{ +// if let deserModel = HomeStoreModel.deserialize(from: storeStr){ +// self?.label_store.text = deserModel.name.isEmpty ? "门店获取失败":deserModel.name +// self?.storeModel = deserModel +// self?.storeId = deserModel.storeId +// if deserModel.isVip == 0{text.append("\n加入我们 成为会员")} +// self?.label_vipInfo.text = text +// } +// }else{ +// self?.label_store.text = m.name.isEmpty ? "门店获取失败":m.name +// UserDefaults.standard.set(m.toJSONString(), forKey: "CurrentStore") +// UserDefaults.standard.synchronize() +// self?.storeModel = m +// self?.storeId = m.storeId +// if m.isVip == 0{text.append("\n加入我们 成为会员")} +// self?.label_vipInfo.text = text +// } +// self?.getStoreItemList() + } } }) { [weak self] error in self?.label_store.text = "门店获取失败" @@ -216,6 +226,10 @@ weakSelf.storeModel = HomeStoreModel(isVip: 0, storeId: storeId, name: storeName, lon: 0, lat: 0) weakSelf.items.removeAll() weakSelf.getStoreItemList() + + UserDefaults.standard.set(weakSelf.storeModel!.toJSONString(), forKey: "CurrentStore") + UserDefaults.standard.synchronize() + } } diff --git a/WanPai/Root/Welfare/VC/WelfareVC.swift b/WanPai/Root/Welfare/VC/WelfareVC.swift index 0acf851..6e88fb5 100644 --- a/WanPai/Root/Welfare/VC/WelfareVC.swift +++ b/WanPai/Root/Welfare/VC/WelfareVC.swift @@ -125,8 +125,20 @@ } @IBAction func freeTodayAction(_ sender: UIButton) { - let vc = WelfareFreeVC(StoreWalfareModel()) - push(vc: vc) + if let storeStr = UserDefaults.standard.object(forKey: "CurrentStore") as? String{ + if let deserModel = HomeStoreModel.deserialize(from: storeStr){ + Services.queryStoreFreeBenefit(id: deserModel.storeId).subscribe(onNext: {[weak self] data in + if let m = data.data{ + let vc = WelfareFreeVC(m) + self?.push(vc: vc) + } + }).disposed(by: disposeBag) + }else{ + alert(msg: "门店获取失败") + } + }else{ + alert(msg: "门店获取失败") + } } @IBAction func storeAction(_ sender: Any) { -- Gitblit v1.7.1