This commit is contained in:
lianxiang
2018-09-27 00:20:01 +08:00
parent d0230f55ed
commit cb0accdb66
60 changed files with 1063 additions and 290 deletions
@@ -74,10 +74,11 @@
CGFloat navH = SAFE_NAV_HEIGHT;
UIButton *numberBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[numberBtn setBackgroundImage:[UIImage imageNamed:@"ceshi_number"] forState:UIControlStateNormal];
NSAttributedString *numbertitle = [[NSAttributedString alloc] initWithString:@"1" attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
[numberBtn setAttributedTitle:numbertitle forState:UIControlStateNormal];
[numberBtn setBackgroundImage:[UIImage imageNamed:@"result_logo"] forState:UIControlStateNormal];
// NSAttributedString *numbertitle = [[NSAttributedString alloc] initWithString:@"1" attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
//
//
// [numberBtn setAttributedTitle:numbertitle forState:UIControlStateNormal];
self.numberBtn = numberBtn;
[self.view addSubview:numberBtn];
@@ -85,16 +86,20 @@
titleLabel.text = @"悄悄地告诉你小优的年龄区间是?";
titleLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:16];
titleLabel.textColor = GIGARGB(63, 63, 63, 1);
titleLabel.numberOfLines = 2;
self.questionlabel = titleLabel;
[titleLabel sizeToFit];
[self.view addSubview:titleLabel];
UILabel *descLabel = [[UILabel alloc] init];
descLabel.text = @"精准的选择,让小优更好的为您挑选最符合您的肤质的面膜";
descLabel.font = [UIFont fontWithName:GIGA_FONTNAME size:12];
descLabel.textColor = GIGARGB(208, 208, 208, 1);
descLabel.numberOfLines = 0;
descLabel.numberOfLines = 3;
descLabel.textAlignment = NSTextAlignmentCenter;
self.descLabel = descLabel;
[descLabel sizeToFit];
[self.view addSubview:descLabel];
[numberBtn mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -108,14 +113,14 @@
make.left.mas_equalTo(numberBtn.mas_right).offset(12);
make.centerY.mas_equalTo(numberBtn.mas_centerY);
make.right.mas_equalTo(self.view.mas_right).offset(-53);
}];
[descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(numberBtn.mas_right).offset(12);
make.top.mas_equalTo(titleLabel.mas_bottom).offset(20);
make.right.mas_equalTo(self.view.mas_right).offset(-89);
make.right.mas_equalTo(self.view.mas_right).offset(-50);
}];
@@ -305,9 +310,9 @@
-(void)reloadViews{
//刷新问题相关数据
NSAttributedString *numbertitle = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%ld",(long)_page] attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
[_numberBtn setAttributedTitle:numbertitle forState:UIControlStateNormal];
// NSAttributedString *numbertitle = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%ld",(long)_page] attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
//
// [_numberBtn setAttributedTitle:numbertitle forState:UIControlStateNormal];
self.questionlabel.text = [NSString stringWithFormat:@"%@",_currentModel.question];
self.descLabel.text = _currentModel.remark;
@@ -343,7 +348,7 @@
[self saveProgress];
if (_page == self.questonArray.count ) {
GIGA_ShowToast(@"没有了");
//GIGA_ShowToast(@"没有了");
[self submitAnswer];
return;
}
@@ -16,6 +16,7 @@
#import "GiGaFileNanager.h"
#import <WXApi.h>
#import "MaskTestResult.h"
#import "MaskTestNODataViewCell.h"
@interface MaskTestResultVC ()
@@ -42,11 +43,18 @@
[self.tableView registerClass:[MaskResultMinViewCell class] forCellReuseIdentifier:@"MaskResultMinViewCell"];
[self.tableView registerClass:[MaskResultShareViewCell class] forCellReuseIdentifier:@"MaskResultShareViewCell"];
if (!self.model) {
[self addNavTitile:@"历史测试"];
[self requstLatestTestData];
}
NC_ADD_TARGET_NAME_OBJECT(self, @selector(usershareSuccessNoti), NC_UseShareSuccessNoti, nil);
}
-(void)dealloc{
NC_REMOVE_NAME(self, NC_UseShareSuccessNoti, nil);
}
-(void)requstLatestTestData{
@@ -75,11 +83,24 @@
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (self.model == nil) {
return 1;
}
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (self.model == nil) {
MaskTestNODataViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTestNODataViewCell"];
if(!cell){
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTestNODataViewCell" owner:self options:nil] lastObject];
}
[cell.testBtn addTarget:self action:@selector(testBtnAction) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
if (indexPath.row == 0) {
static NSString *cellID = @"MaskResultPercentCell";
MaskResultPercentCell *cell =[tableView dequeueReusableCellWithIdentifier:cellID];
@@ -114,6 +135,10 @@
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (self.model == nil) {
return 255;
}
CGFloat viewH = KMainH - SAFE_NAV_HEIGHT;
CGFloat cellH = viewH / 3 ;
return cellH;
@@ -182,6 +207,15 @@
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
//分享成功
-(void)usershareSuccessNoti{
}
-(void)testBtnAction{
[self.navigationController popToRootViewControllerAnimated:YES];
}
@end
@@ -62,7 +62,7 @@
NSArray *colorArr = @[(id)[[UIColor colorWithHex:0xFFFFFF] CGColor],
(id)[[UIColor colorWithHex:0xFFF3E4] CGColor],
(id)[[UIColor colorWithHex:0x9A9996] CGColor]];
(id)[[UIColor colorWithHex:0xFBC37B] CGColor]];
NSArray *colorLocationArray = @[@0.0, @0.5, @1];
CAGradientLayer * gradientLayer = [CAGradientLayer layer];
gradientLayer.frame = self.bounds;
@@ -0,0 +1,14 @@
//
// MaskTestNODataViewCell.h
// GIGA
//
// Created by lianxiang on 2018/9/26.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MaskTestNODataViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIButton *testBtn;
@end
@@ -0,0 +1,27 @@
//
// MaskTestNODataViewCell.m
// GIGA
//
// Created by lianxiang on 2018/9/26.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import "MaskTestNODataViewCell.h"
@implementation MaskTestNODataViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.testBtn.layer.masksToBounds = YES;
self.testBtn.layer.cornerRadius = self.testBtn.frame.size.height /2 ;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MaskTestNODataViewCell" id="KGk-i7-Jjw" customClass="MaskTestNODataViewCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="255"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="254.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lm9-j5-N2R">
<rect key="frame" x="97" y="115" width="126" height="65"/>
<constraints>
<constraint firstAttribute="height" constant="65" id="38X-Cc-rhW"/>
<constraint firstAttribute="width" constant="126" id="d9e-ST-XY6"/>
</constraints>
<string key="text">还没有测试记录
快测测肤质吧</string>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
<color key="textColor" red="0.41568627450000001" green="0.41568627450000001" blue="0.41568627450000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SPr-Bd-mHF">
<rect key="frame" x="94" y="196" width="132" height="41"/>
<color key="backgroundColor" red="0.70980392160000005" green="0.054901960780000002" blue="0.054901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="132" id="mEU-iC-bBa"/>
<constraint firstAttribute="height" constant="41" id="szc-TX-R5l"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
<state key="normal" title="测试肤质"/>
</button>
</subviews>
<constraints>
<constraint firstItem="Lm9-j5-N2R" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="5RG-7U-vcz"/>
<constraint firstItem="SPr-Bd-mHF" firstAttribute="top" secondItem="Lm9-j5-N2R" secondAttribute="bottom" constant="16" id="ULk-kk-GV7"/>
<constraint firstItem="Lm9-j5-N2R" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="115" id="aYP-OA-woj"/>
<constraint firstItem="SPr-Bd-mHF" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="gJY-SL-6hY"/>
<constraint firstAttribute="bottom" secondItem="SPr-Bd-mHF" secondAttribute="bottom" constant="17.5" id="iso-5M-RBe"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="testBtn" destination="SPr-Bd-mHF" id="t1Y-Ap-CkT"/>
</connections>
<point key="canvasLocation" x="34" y="53.5"/>
</tableViewCell>
</objects>
</document>