Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
7a25e418
Commit
7a25e418
authored
May 11, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补全商品分类确定按钮,并完善数据交互
parent
8c012e06
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
10 deletions
+89
-10
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/ViewController/商品分类/GoodsClassViewController.swift
...atform/ViewController/商品分类/GoodsClassViewController.swift
+31
-4
GeliBusinessPlatform/ViewController/商品分类/GoodsClassViewController.xib
...Platform/ViewController/商品分类/GoodsClassViewController.xib
+51
-5
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
...orm/ViewController/商品详情/ProductDetailViewController.swift
+7
-1
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
7a25e418
No preview for this file type
GeliBusinessPlatform/ViewController/商品分类/GoodsClassViewController.swift
View file @
7a25e418
...
...
@@ -8,14 +8,16 @@
import
UIKit
import
Dollar
protocol
GoodsClassViewControllerDelegate
{
func
blackGoodsClass
(
sender
:
GoodsClassModel
)
}
class
GoodsClassViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
{
var
delegate
:
GoodsClassViewControllerDelegate
?
var
dataModelArray
:
Array
<
GeneralInfoCatsModel
>
?
=
[]
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
navbar
.
title
=
"请选择商品分类"
print
(
"商品分类数据==
\(
dataModelArray
)
"
)
self
.
view
.
addSubview
(
navbar
)
//先分级
...
...
@@ -97,14 +99,25 @@ class GoodsClassViewController: BaseViewController , UITableViewDelegate, UITabl
setTabv
()
}
@IBOutlet
weak
var
sureBtn
:
UIButton
!
//MARK:--确定按钮
@IBAction
func
sureBtnAcion
(
_
sender
:
UIButton
)
{
if
selectModel
==
nil
{
HUD
.
flash
(
.
label
(
"请选择商品分类"
),
delay
:
1.2
)
}
else
{
//返回确定数据
self
.
delegate
?
.
blackGoodsClass
(
sender
:
selectModel
!
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
var
tableV
:
UITableView
!
var
dataArr
:
Array
<
Any
>
=
[]
func
setTabv
()
{
tableV
=
UITableView
()
view
.
addSubview
(
tableV
);
tableV
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
sureBtn
.
snp_top
)
make
.
top
.
equalTo
(
navbar
.
snp_bottom
)
}
tableV
.
backgroundColor
=
UIColor
.
init
(
named
:
"app底色"
)
...
...
@@ -186,6 +199,8 @@ class GoodsClassViewController: BaseViewController , UITableViewDelegate, UITabl
return
cell
}
var
selectModel
:
GoodsClassModel
?
=
nil
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
arrs
=
dataArr
[
indexPath
.
section
]
as!
Array
<
Any
>
...
...
@@ -198,6 +213,18 @@ class GoodsClassViewController: BaseViewController , UITableViewDelegate, UITabl
reloadSection
(
section
:
indexPath
.
section
,
model
:
rowModel
,
isExpand
:
rowModel
.
isExpand
!
)
}
else
{
rowModel
.
isSelect
=
!
rowModel
.
isSelect
!
//MARK:--如果是单选,那么就要更改别的数据源
if
rowModel
.
isSelect
!
{
if
selectModel
==
nil
{
selectModel
=
rowModel
}
else
{
selectModel
?
.
isSelect
=
false
selectModel
=
rowModel
}
}
else
{
selectModel
=
nil
}
let
reloadSet
=
IndexSet
.
init
(
arrayLiteral
:
indexPath
.
section
)
tableV
.
reloadSections
(
reloadSet
,
with
:
.
automatic
)
...
...
GeliBusinessPlatform/ViewController/商品分类/GoodsClassViewController.xib
View file @
7a25e418
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"13142"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"16096"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina6_1"
orientation=
"portrait"
appearance=
"light"
/>
<dependencies>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"12042"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"16086"
/>
<capability
name=
"Named colors"
minToolsVersion=
"9.0"
/>
<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"
customClass=
"GoodsClassViewController"
customModuleProvider=
"target"
>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
customClass=
"GoodsClassViewController"
customModule
=
"GeliBusinessPlatform"
customModule
Provider=
"target"
>
<connections>
<outlet
property=
"sureBtn"
destination=
"eo7-gg-VuW"
id=
"1Uq-wf-ger"
/>
<outlet
property=
"view"
destination=
"i5M-Pr-FkT"
id=
"sfx-zR-JGt"
/>
</connections>
</placeholder>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"-2"
customClass=
"UIResponder"
/>
<view
clearsContextBeforeDrawing=
"NO"
contentMode=
"scaleToFill"
id=
"i5M-Pr-FkT"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"
375"
height=
"667
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"
414"
height=
"896
"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<subviews>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"roundedRect"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"eo7-gg-VuW"
>
<rect
key=
"frame"
x=
"0.0"
y=
"813"
width=
"414"
height=
"83"
/>
<color
key=
"backgroundColor"
name=
"蓝色字体颜色"
/>
<connections>
<action
selector=
"sureBtnAcion:"
destination=
"-1"
eventType=
"touchUpInside"
id=
"950-0l-rjI"
/>
</connections>
</button>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
usesAttributedText=
"YES"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"ZNg-Jh-xFg"
>
<rect
key=
"frame"
x=
"0.0"
y=
"813"
width=
"414"
height=
"49"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"49"
id=
"Rgk-OM-IYa"
/>
</constraints>
<attributedString
key=
"attributedText"
>
<fragment
content=
"确定"
>
<attributes>
<color
key=
"NSColor"
name=
"白色背景色"
/>
<font
key=
"NSFont"
size=
"17"
name=
"PingFangSC-Medium"
/>
<paragraphStyle
key=
"NSParagraphStyle"
alignment=
"center"
lineBreakMode=
"wordWrapping"
baseWritingDirection=
"natural"
tighteningFactorForTruncation=
"0.0"
/>
</attributes>
</fragment>
</attributedString>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<constraints>
<constraint
firstItem=
"eo7-gg-VuW"
firstAttribute=
"top"
secondItem=
"ZNg-Jh-xFg"
secondAttribute=
"top"
id=
"5AL-cv-8Ub"
/>
<constraint
firstItem=
"fnl-2z-Ty3"
firstAttribute=
"trailing"
secondItem=
"ZNg-Jh-xFg"
secondAttribute=
"trailing"
id=
"6J2-6S-dee"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"eo7-gg-VuW"
secondAttribute=
"bottom"
id=
"KDj-tI-0PH"
/>
<constraint
firstItem=
"eo7-gg-VuW"
firstAttribute=
"leading"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"leading"
id=
"X7g-ph-OQv"
/>
<constraint
firstItem=
"fnl-2z-Ty3"
firstAttribute=
"bottom"
secondItem=
"ZNg-Jh-xFg"
secondAttribute=
"bottom"
id=
"YE4-4v-l3s"
/>
<constraint
firstItem=
"ZNg-Jh-xFg"
firstAttribute=
"leading"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"leading"
id=
"f2U-UA-ZzK"
/>
<constraint
firstItem=
"eo7-gg-VuW"
firstAttribute=
"trailing"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"trailing"
id=
"oru-RY-rax"
/>
</constraints>
<viewLayoutGuide
key=
"safeArea"
id=
"fnl-2z-Ty3"
/>
<point
key=
"canvasLocation"
x=
"131.8840579710145"
y=
"119.86607142857142"
/>
</view>
</objects>
<resources>
<namedColor
name=
"白色背景色"
>
<color
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<namedColor
name=
"蓝色字体颜色"
>
<color
red=
"0.27799999713897705"
green=
"0.56099998950958252"
blue=
"0.88999998569488525"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
</resources>
</document>
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
View file @
7a25e418
...
...
@@ -9,7 +9,7 @@
import
UIKit
import
LGButton
class
ProductDetailViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
CommendCellDelegate
,
TitleAndBtnCellDelegate
,
GLAlertSelectViewDelegate
{
class
ProductDetailViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
CommendCellDelegate
,
TitleAndBtnCellDelegate
,
GLAlertSelectViewDelegate
,
GoodsClassViewControllerDelegate
{
var
glSelectView
:
GLAlertSelectView
?
let
titleArr
=
[
"商品信息"
,
"商品图片"
,
"商品规格"
,
"预售设置"
,
"其它信息"
,
"商品详情"
]
...
...
@@ -274,6 +274,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
if
cell
.
nameLbl
.
text
==
"商品分类"
{
let
vc
=
GoodsClassViewController
()
vc
.
delegate
=
self
vc
.
dataModelArray
=
generalInfoModel
?
.
data
?
.
cats
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
...
...
@@ -297,6 +298,11 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
print
(
cell
.
nameLbl
.
text
)
}
//MARK:---选择商品分类返回数据
func
blackGoodsClass
(
sender
:
GoodsClassModel
)
{
print
(
"选择商品分类返回数据=
\(
sender
)
"
)
}
func
GLAlertSelectViewClick
(
selectNum
:
Int
,
view
:
UIView
)
{
print
(
"单选"
,
selectNum
)
glSelectView
?
.
removeFromSuperview
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment