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
9f3a4b1f
Commit
9f3a4b1f
authored
May 15, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字典修改成model
parent
42fea0c7
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
147 additions
and
76 deletions
+147
-76
GeliBusinessPlatform.xcodeproj/project.pbxproj
GeliBusinessPlatform.xcodeproj/project.pbxproj
+4
-0
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/View/Cell/AddImgCell.swift
GeliBusinessPlatform/View/Cell/AddImgCell.swift
+50
-24
GeliBusinessPlatform/View/Cell/YuShouWeiKuanFaHuoCell.swift
GeliBusinessPlatform/View/Cell/YuShouWeiKuanFaHuoCell.swift
+10
-4
GeliBusinessPlatform/ViewController/商品详情/EditProductViewController.swift
...tform/ViewController/商品详情/EditProductViewController.swift
+0
-0
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
...orm/ViewController/商品详情/ProductDetailViewController.swift
+0
-0
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift
...orm/ViewController/新增规格/CreatNewSpecsViewController.swift
+47
-44
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
+33
-0
GeliBusinessPlatform/ViewController/新增规格/PuTongJieTiCell.swift
...usinessPlatform/ViewController/新增规格/PuTongJieTiCell.swift
+2
-3
GeliBusinessPlatform/ViewController/新增规格/YuShouCell.xib
GeliBusinessPlatform/ViewController/新增规格/YuShouCell.xib
+1
-1
No files found.
GeliBusinessPlatform.xcodeproj/project.pbxproj
View file @
9f3a4b1f
...
@@ -257,6 +257,7 @@
...
@@ -257,6 +257,7 @@
E0DDCB19244AE2AC00DF54C7
/* XiuGaiYuShouJiaViewController.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0DDCB17244AE2AC00DF54C7
/* XiuGaiYuShouJiaViewController.xib */
;
};
E0DDCB19244AE2AC00DF54C7
/* XiuGaiYuShouJiaViewController.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0DDCB17244AE2AC00DF54C7
/* XiuGaiYuShouJiaViewController.xib */
;
};
E0DDCB1D244AE81800DF54C7
/* GuanLianKeHuCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0DDCB1B244AE81800DF54C7
/* GuanLianKeHuCell.swift */
;
};
E0DDCB1D244AE81800DF54C7
/* GuanLianKeHuCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0DDCB1B244AE81800DF54C7
/* GuanLianKeHuCell.swift */
;
};
E0DDCB1E244AE81800DF54C7
/* GuanLianKeHuCell.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0DDCB1C244AE81800DF54C7
/* GuanLianKeHuCell.xib */
;
};
E0DDCB1E244AE81800DF54C7
/* GuanLianKeHuCell.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0DDCB1C244AE81800DF54C7
/* GuanLianKeHuCell.xib */
;
};
E0E8ABFD246E359700E3BB54
/* GuiGeModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0E8ABFC246E359700E3BB54
/* GuiGeModel.swift */
;
};
E0F1BE382469220D003015B2
/* RongSticker.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0F1BE2A24692208003015B2
/* RongSticker.bundle */
;
};
E0F1BE382469220D003015B2
/* RongSticker.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0F1BE2A24692208003015B2
/* RongSticker.bundle */
;
};
E0F1BE392469220D003015B2
/* RCColor.plist in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0F1BE2B24692208003015B2
/* RCColor.plist */
;
};
E0F1BE392469220D003015B2
/* RCColor.plist in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0F1BE2B24692208003015B2
/* RCColor.plist */
;
};
E0F1BE3A2469220D003015B2
/* libvo-amrwbenc.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0F1BE2C24692208003015B2
/* libvo-amrwbenc.a */
;
};
E0F1BE3A2469220D003015B2
/* libvo-amrwbenc.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0F1BE2C24692208003015B2
/* libvo-amrwbenc.a */
;
};
...
@@ -737,6 +738,7 @@
...
@@ -737,6 +738,7 @@
E0DDCB17244AE2AC00DF54C7
/* XiuGaiYuShouJiaViewController.xib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.xib
;
path
=
XiuGaiYuShouJiaViewController.xib
;
sourceTree
=
"<group>"
;
};
E0DDCB17244AE2AC00DF54C7
/* XiuGaiYuShouJiaViewController.xib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.xib
;
path
=
XiuGaiYuShouJiaViewController.xib
;
sourceTree
=
"<group>"
;
};
E0DDCB1B244AE81800DF54C7
/* GuanLianKeHuCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GuanLianKeHuCell.swift
;
sourceTree
=
"<group>"
;
};
E0DDCB1B244AE81800DF54C7
/* GuanLianKeHuCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GuanLianKeHuCell.swift
;
sourceTree
=
"<group>"
;
};
E0DDCB1C244AE81800DF54C7
/* GuanLianKeHuCell.xib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.xib
;
path
=
GuanLianKeHuCell.xib
;
sourceTree
=
"<group>"
;
};
E0DDCB1C244AE81800DF54C7
/* GuanLianKeHuCell.xib */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.xib
;
path
=
GuanLianKeHuCell.xib
;
sourceTree
=
"<group>"
;
};
E0E8ABFC246E359700E3BB54
/* GuiGeModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GuiGeModel.swift
;
sourceTree
=
"<group>"
;
};
E0F1BE2A24692208003015B2
/* RongSticker.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
path
=
RongSticker.bundle
;
sourceTree
=
"<group>"
;
};
E0F1BE2A24692208003015B2
/* RongSticker.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
path
=
RongSticker.bundle
;
sourceTree
=
"<group>"
;
};
E0F1BE2B24692208003015B2
/* RCColor.plist */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.plist.xml
;
path
=
RCColor.plist
;
sourceTree
=
"<group>"
;
};
E0F1BE2B24692208003015B2
/* RCColor.plist */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.plist.xml
;
path
=
RCColor.plist
;
sourceTree
=
"<group>"
;
};
E0F1BE2C24692208003015B2
/* libvo-amrwbenc.a */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
archive.ar
;
path
=
"libvo-amrwbenc.a"
;
sourceTree
=
"<group>"
;
};
E0F1BE2C24692208003015B2
/* libvo-amrwbenc.a */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
archive.ar
;
path
=
"libvo-amrwbenc.a"
;
sourceTree
=
"<group>"
;
};
...
@@ -1247,6 +1249,7 @@
...
@@ -1247,6 +1249,7 @@
E0336DD2244EC3CA00380BE9
/* 新增规格 */
=
{
E0336DD2244EC3CA00380BE9
/* 新增规格 */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
E0E8ABFC246E359700E3BB54
/* GuiGeModel.swift */
,
E0336DD3244EC40000380BE9
/* CreatNewSpecsViewController.swift */
,
E0336DD3244EC40000380BE9
/* CreatNewSpecsViewController.swift */
,
E0336DD4244EC40000380BE9
/* CreatNewSpecsViewController.xib */
,
E0336DD4244EC40000380BE9
/* CreatNewSpecsViewController.xib */
,
E0C4F4B3244EE9EE00CC7E2F
/* YuShouCell.swift */
,
E0C4F4B3244EE9EE00CC7E2F
/* YuShouCell.swift */
,
...
@@ -2656,6 +2659,7 @@
...
@@ -2656,6 +2659,7 @@
E09F4CA22452D18800BE033D
/* ZengZhiServicesViewController.swift in Sources */
,
E09F4CA22452D18800BE033D
/* ZengZhiServicesViewController.swift in Sources */
,
F94A315B24628C7E00FEC38E
/* WorkItemTableViewCell.swift in Sources */
,
F94A315B24628C7E00FEC38E
/* WorkItemTableViewCell.swift in Sources */
,
E0DDCB18244AE2AC00DF54C7
/* XiuGaiYuShouJiaViewController.swift in Sources */
,
E0DDCB18244AE2AC00DF54C7
/* XiuGaiYuShouJiaViewController.swift in Sources */
,
E0E8ABFD246E359700E3BB54
/* GuiGeModel.swift in Sources */
,
F950FDEA2451920200C40530
/* DIYCalendarCell.swift in Sources */
,
F950FDEA2451920200C40530
/* DIYCalendarCell.swift in Sources */
,
F950FDE224518B9500C40530
/* FSCalendarCalculator.m in Sources */
,
F950FDE224518B9500C40530
/* FSCalendarCalculator.m in Sources */
,
E0D197C12448431C002B080C
/* BabyToy.m in Sources */
,
E0D197C12448431C002B080C
/* BabyToy.m in Sources */
,
...
...
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
9f3a4b1f
No preview for this file type
GeliBusinessPlatform/View/Cell/AddImgCell.swift
View file @
9f3a4b1f
...
@@ -7,9 +7,10 @@
...
@@ -7,9 +7,10 @@
//
//
import
UIKit
import
UIKit
@objc
protocol
AddImgCellDelegate
{
protocol
AddImgCellDelegate
{
@objc
optional
func
AddImgCellBtnClick
(
cell
:
AddImgCell
)
func
AddImgCellBtnClick
(
cell
:
AddImgCell
)
@objc
optional
func
DelImgCellBtnClick
(
sender
:
UIButton
,
cell
:
AddImgCell
)
func
DelImgCellBtnClick
(
sender
:
UIButton
,
cell
:
AddImgCell
)
func
ChangeCellBtnClick
(
sender
:
UIButton
,
cell
:
AddImgCell
)
}
}
class
AddImgCell
:
UITableViewCell
{
class
AddImgCell
:
UITableViewCell
{
var
delegate
:
AddImgCellDelegate
?
var
delegate
:
AddImgCellDelegate
?
...
@@ -20,26 +21,27 @@ class AddImgCell: UITableViewCell {
...
@@ -20,26 +21,27 @@ class AddImgCell: UITableViewCell {
}
}
}
}
@IBAction
func
btnClick
(
_
sender
:
Any
)
{
@IBAction
func
btnClick
(
_
sender
:
Any
)
{
delegate
?
.
AddImgCellBtnClick
?
(
cell
:
self
)
delegate
?
.
AddImgCellBtnClick
(
cell
:
self
)
}
}
var
isSingle
:
Bool
?
var
isSingle
:
Bool
?
var
imgs
:
NSArray
?
{
var
imgs
:
Array
<
UIImage
>
=
[]
{
didSet
{
didSet
{
if
imgs
!.
count
>
0
{
print
(
imgs
.
count
)
if
imgs
.
count
>
0
{
if
scrollView
==
nil
{
if
scrollView
==
nil
{
let
scrView
=
UIScrollView
(
frame
:
CGRect
(
x
:
0
,
y
:
nameLbl
.
frame
.
maxY
,
width
:
fullScreenWidth
,
height
:
self
.
bounds
.
size
.
height
-
nameLbl
.
frame
.
maxY
))
let
scrView
=
UIScrollView
(
frame
:
CGRect
(
x
:
addBtn
.
frame
.
minX
,
y
:
addBtn
.
frame
.
minY
,
width
:
fullScreenWidth
,
height
:
90
))
scrView
.
showsHorizontalScrollIndicator
=
false
scrView
.
showsHorizontalScrollIndicator
=
false
scrView
.
backgroundColor
=
UIColor
.
white
self
.
contentView
.
addSubview
(
scrView
)
self
.
contentView
.
addSubview
(
scrView
)
scrollView
=
scrView
scrollView
=
scrView
}
}
scrollView
?
.
isHidden
=
false
scrollView
?
.
isHidden
=
false
if
isSingle
==
true
{
if
isSingle
==
true
{
addBtn
.
isHidden
=
true
setImgUI
(
arr
:
imgs
)
setImgUI
(
arr
:
imgs
!
)
}
else
{
}
else
{
setImgUI
(
arr
:
imgs
!
)
setImgUI
(
arr
:
imgs
)
}
}
}
else
{
}
else
{
scrollView
?
.
isHidden
=
true
scrollView
?
.
isHidden
=
true
...
@@ -47,7 +49,7 @@ class AddImgCell: UITableViewCell {
...
@@ -47,7 +49,7 @@ class AddImgCell: UITableViewCell {
if
isSingle
==
true
{
if
isSingle
==
true
{
addBtn
.
isHidden
=
false
addBtn
.
isHidden
=
false
}
}
}
}
}
}
}
}
...
@@ -56,23 +58,24 @@ class AddImgCell: UITableViewCell {
...
@@ -56,23 +58,24 @@ class AddImgCell: UITableViewCell {
@IBOutlet
weak
var
nameLbl
:
UILabel
!
@IBOutlet
weak
var
nameLbl
:
UILabel
!
@IBOutlet
weak
var
addBtnX
:
NSLayoutConstraint
!
@IBOutlet
weak
var
addBtnX
:
NSLayoutConstraint
!
func
setImgUI
(
arr
:
NSArray
){
func
setImgUI
(
arr
:
Array
<
UIImage
>
){
let
y
=
nameLbl
.
frame
.
max
Y
let
y
=
addBtn
.
frame
.
min
Y
let
h
=
self
.
bounds
.
size
.
height
-
nameLbl
.
frame
.
maxY
let
h
:
CGFloat
=
90
if
isSingle
==
false
{
if
isSingle
==
false
{
addBtn
.
isHidden
=
false
addBtn
.
isHidden
=
false
scrollView
?
.
isHidden
=
false
scrollView
?
.
isHidden
=
false
if
arr
.
count
<
3
{
if
arr
.
count
<
3
{
scrollView
?
.
frame
=
CGRect
(
x
:
0
,
y
:
CGFloat
(
y
),
width
:
CGFloat
(
arr
.
count
)
*
110
,
height
:
h
)
scrollView
?
.
contentSize
=
CGSize
(
width
:
arr
.
count
*
105
,
height
:
0
)
addBtnX
.
constant
=
(
scrollView
?
.
frame
.
maxX
)
!+
10
scrollView
?
.
frame
=
CGRect
(
x
:
15
,
y
:
CGFloat
(
y
),
width
:
CGFloat
(
arr
.
count
)
*
105
,
height
:
h
)
addBtnX
.
constant
=
(
scrollView
?
.
frame
.
maxX
)
!
}
else
if
arr
.
count
==
5
{
}
else
if
arr
.
count
==
5
{
addBtn
.
isHidden
=
true
addBtn
.
isHidden
=
true
scrollView
?
.
contentSize
=
CGSize
(
width
:
arr
.
count
*
1
10
,
height
:
0
)
scrollView
?
.
contentSize
=
CGSize
(
width
:
arr
.
count
*
1
05
,
height
:
0
)
scrollView
?
.
frame
=
CGRect
(
x
:
0
,
y
:
CGFloat
(
y
),
width
:
fullScreenWidth
,
height
:
h
)
scrollView
?
.
frame
=
CGRect
(
x
:
15
,
y
:
CGFloat
(
y
),
width
:
fullScreenWidth
,
height
:
h
)
}
else
{
}
else
{
scrollView
?
.
contentSize
=
CGSize
(
width
:
arr
.
count
*
1
10
,
height
:
0
)
scrollView
?
.
contentSize
=
CGSize
(
width
:
arr
.
count
*
1
05
,
height
:
0
)
scrollView
?
.
frame
=
CGRect
(
x
:
0
,
y
:
CGFloat
(
y
),
width
:
fullScreenWidth
*
0.7
,
height
:
h
)
scrollView
?
.
frame
=
CGRect
(
x
:
15
,
y
:
CGFloat
(
y
),
width
:
fullScreenWidth
-
130
,
height
:
h
)
addBtnX
.
constant
=
(
scrollView
?
.
frame
.
maxX
)
!+
10
addBtnX
.
constant
=
fullScreenWidth
-
105
}
}
}
}
for
i
in
0
..<
arr
.
count
{
for
i
in
0
..<
arr
.
count
{
...
@@ -80,12 +83,31 @@ class AddImgCell: UITableViewCell {
...
@@ -80,12 +83,31 @@ class AddImgCell: UITableViewCell {
img
.
layer
.
cornerRadius
=
3
img
.
layer
.
cornerRadius
=
3
img
.
layer
.
masksToBounds
=
true
img
.
layer
.
masksToBounds
=
true
scrollView
!.
addSubview
(
img
)
scrollView
!.
addSubview
(
img
)
img
.
image
=
arr
[
i
]
as!
UIImage
img
.
image
=
arr
[
i
]
img
.
isUserInteractionEnabled
=
true
img
.
isUserInteractionEnabled
=
true
img
.
snp
.
makeConstraints
{
(
make
)
in
img
.
snp
.
makeConstraints
{
(
make
)
in
make
.
centerY
.
equalTo
(
scrollView
!.
snp_centerY
)
make
.
centerY
.
equalTo
(
scrollView
!.
snp_centerY
)
make
.
width
.
height
.
equalTo
(
90
)
make
.
width
.
height
.
equalTo
(
90
)
make
.
left
.
equalTo
(
15
+
105*
i
)
make
.
left
.
equalTo
(
105*
i
)
}
let
changeBtn
=
UIButton
()
changeBtn
.
tag
=
i
changeBtn
.
backgroundColor
=
UIColor
(
named
:
"标题字颜色"
)
changeBtn
.
alpha
=
0.5
changeBtn
.
addTarget
(
self
,
action
:
#selector(
changeAction(sender:)
)
,
for
:
.
touchUpInside
)
img
.
addSubview
(
changeBtn
)
changeBtn
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
bottom
.
right
.
left
.
equalTo
(
0
)
}
let
ti
=
UILabel
()
ti
.
text
=
"替 换"
ti
.
textColor
=
UIColor
.
white
ti
.
textAlignment
=
.
center
ti
.
font
=
UIFont
.
systemFont
(
ofSize
:
15
)
img
.
addSubview
(
ti
)
ti
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
bottom
.
right
.
left
.
equalTo
(
0
)
}
}
let
delImg
=
UIImageView
()
let
delImg
=
UIImageView
()
img
.
addSubview
(
delImg
)
img
.
addSubview
(
delImg
)
...
@@ -109,8 +131,12 @@ class AddImgCell: UITableViewCell {
...
@@ -109,8 +131,12 @@ class AddImgCell: UITableViewCell {
delBtn
.
addTarget
(
self
,
action
:
#selector(
delAction(sender:)
)
,
for
:
.
touchUpInside
)
delBtn
.
addTarget
(
self
,
action
:
#selector(
delAction(sender:)
)
,
for
:
.
touchUpInside
)
}
}
}
}
@objc
func
changeAction
(
sender
:
UIButton
){
delegate
?
.
ChangeCellBtnClick
(
sender
:
sender
,
cell
:
self
)
}
@objc
func
delAction
(
sender
:
UIButton
){
@objc
func
delAction
(
sender
:
UIButton
){
delegate
?
.
DelImgCellBtnClick
?(
sender
:
sender
,
cell
:
self
)
delegate
?
.
DelImgCellBtnClick
(
sender
:
sender
,
cell
:
self
)
}
}
override
func
awakeFromNib
()
{
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
super
.
awakeFromNib
()
...
...
GeliBusinessPlatform/View/Cell/YuShouWeiKuanFaHuoCell.swift
View file @
9f3a4b1f
...
@@ -7,19 +7,25 @@
...
@@ -7,19 +7,25 @@
//
//
import
UIKit
import
UIKit
protocol
YuShouWeiKuanFaHuoCellDelegate
{
func
YuShouWeiKuanFaHuoCellString
(
str
:
String
)
}
class
YuShouWeiKuanFaHuoCell
:
UITableViewCell
{
class
YuShouWeiKuanFaHuoCell
:
UITableViewCell
{
var
delegate
:
YuShouWeiKuanFaHuoCellDelegate
?
@IBOutlet
weak
var
textTF
:
UITextField
!
@IBOutlet
weak
var
textTF
:
UITextField
!
@IBOutlet
weak
var
nameLbl
:
UILabel
!
@IBOutlet
weak
var
nameLbl
:
UILabel
!
override
func
awakeFromNib
()
{
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
super
.
awakeFromNib
()
self
.
selectionStyle
=
.
none
self
.
selectionStyle
=
.
none
textTF
.
addTarget
(
self
,
action
:
#selector(
textChange(tf:)
)
,
for
:
.
allEditingEvents
)
// Initialization code
// Initialization code
}
}
@objc
func
textChange
(
tf
:
UITextField
){
if
tf
.
text
!=
nil
{
delegate
?
.
YuShouWeiKuanFaHuoCellString
(
str
:
tf
.
text
!
)
}
}
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
super
.
setSelected
(
selected
,
animated
:
animated
)
super
.
setSelected
(
selected
,
animated
:
animated
)
...
...
GeliBusinessPlatform/ViewController/商品详情/EditProductViewController.swift
View file @
9f3a4b1f
This diff is collapsed.
Click to expand it.
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
View file @
9f3a4b1f
This diff is collapsed.
Click to expand it.
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift
View file @
9f3a4b1f
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
import
UIKit
import
UIKit
import
LGButton
import
LGButton
protocol
CreatNewSpecsViewControllerDelegate
{
protocol
CreatNewSpecsViewControllerDelegate
{
func
CreatNewSpecsViewControllerSaveAction
(
datas
:
NSMutableArray
)
func
CreatNewSpecsViewControllerSaveAction
(
datas
:
Array
<
GuiGeModel
>
)
func
CreatNewSpecsViewControllerDeleteAction
()
func
CreatNewSpecsViewControllerDeleteAction
()
}
}
class
CreatNewSpecsViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
TitleAndTFCellDelegate
,
TitleAndBtnCellDelegate
,
TitleAndSwitchCellDelegate
,
TitleAndSwitchHeaderViewDelegate
,
NewCreateHeaderDelegate
,
NewCreateFooterDelegate
,
YuShouCellDelegate
,
GLAlertSelectViewDelegate
,
PuTongJieTiCellDelegate
,
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UICollectionViewDelegateFlowLayout
{
class
CreatNewSpecsViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
TitleAndTFCellDelegate
,
TitleAndBtnCellDelegate
,
TitleAndSwitchCellDelegate
,
TitleAndSwitchHeaderViewDelegate
,
NewCreateHeaderDelegate
,
NewCreateFooterDelegate
,
YuShouCellDelegate
,
GLAlertSelectViewDelegate
,
PuTongJieTiCellDelegate
,
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UICollectionViewDelegateFlowLayout
{
...
@@ -19,9 +19,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -19,9 +19,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
var
delegate
:
CreatNewSpecsViewControllerDelegate
?
var
delegate
:
CreatNewSpecsViewControllerDelegate
?
var
collectView
:
UICollectionView
?
var
collectView
:
UICollectionView
?
var
datasArr
:
NSMutableArray
=
[]
var
datasArr
:
Array
<
GuiGeModel
>
=
[]
var
dataDict
:
NSDictionary
?
var
dataModel
=
GuiGeModel
()
let
titleArray
=
[
"售价:"
,
"规格:"
,
"重量:"
,
"温藏:"
,
"单位:"
]
let
titleArray
=
[
"售价:"
,
"规格:"
,
"重量:"
,
"温藏:"
,
"单位:"
]
let
pliceHolderArr
=
[
"请输入商品售价"
,
"请输入商品规格"
,
"请输入商品重量"
,
"请选择商品温藏"
,
"请选择商品单位"
]
let
pliceHolderArr
=
[
"请输入商品售价"
,
"请输入商品规格"
,
"请输入商品重量"
,
"请选择商品温藏"
,
"请选择商品单位"
]
@IBOutlet
weak
var
bottomBtn
:
LGButton
!
@IBOutlet
weak
var
bottomBtn
:
LGButton
!
...
@@ -68,16 +67,16 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -68,16 +67,16 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
danWei
=
newValue
danWei
=
newValue
}
}
}
//规格
}
//规格
var
specalArr
:
NSMutableArray
=
[]{
var
specalArr
:
Array
<
Any
>
=
[]{
willSet
{
willSet
{
specalArr
.
removeAll
Objects
()
specalArr
.
removeAll
()
specalArr
=
newValue
specalArr
=
newValue
}
}
}
//预售
}
//预售
var
jieTiArr
:
NSMutableArray
=
[]{
var
jieTiArr
:
Array
<
Any
>
=
[]{
willSet
{
willSet
{
jieTiArr
.
removeAll
Objects
()
jieTiArr
.
removeAll
()
jieTiArr
=
newValue
jieTiArr
=
newValue
}
}
...
@@ -186,24 +185,26 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -186,24 +185,26 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
// }
// }
// }
// }
let
dict
=
NSMutableDictionary
()
// let dict = NSMutableDictionary()
dict
[
"price"
]
=
price
dataModel
.
price
=
price
dict
[
"guiGe"
]
=
guiGe
dataModel
.
guiGe
=
guiGe
dict
[
"weight"
]
=
weight
dataModel
.
weight
=
weight
dict
[
"wenDu"
]
=
wenDu
dataModel
.
wenDu
=
wenDu
dict
[
"danWei"
]
=
danWei
dataModel
.
danWei
=
danWei
dict
[
"jieTiArr"
]
=
jieTiArr
dataModel
.
jieTiArr
=
jieTiArr
as!
Array
<
Any
>
dict
[
"specalArr"
]
=
specalArr
dataModel
.
specalArr
=
specalArr
as!
Array
<
Any
>
dict
[
"itemIdx"
]
=
datasArr
.
count
dataModel
.
isNonYuShou
=
isNonYuShou
dict
[
"isNonYuShou"
]
=
isNonYuShou
dataModel
.
isYuShouSetting
=
isYuShouSetting
dict
[
"isYuShouSetting"
]
=
isYuShouSetting
dataModel
.
yuShouPrice
=
yuShouPrice
dict
[
"yuShouPrice"
]
=
yuShouPrice
if
barTitle
?
.
contains
(
"编辑"
)
==
true
{
if
barTitle
?
.
contains
(
"编辑"
)
==
true
{
datasArr
.
replaceObject
(
at
:
selectIdx
!.
item
,
with
:
dict
)
// datasArr.replaceObject(at: selectIdx!.item, with: dict)
datasArr
.
insert
(
dataModel
,
at
:
selectIdx
!.
item
)
datasArr
.
remove
(
at
:
selectIdx
!.
item
+
1
)
}
else
{
}
else
{
datasArr
.
a
dd
(
dict
)
datasArr
.
a
ppend
(
dataModel
)
}
}
delegate
?
.
CreatNewSpecsViewControllerSaveAction
(
datas
:
datasArr
)
delegate
?
.
CreatNewSpecsViewControllerSaveAction
(
datas
:
datasArr
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
//MARK: - cell delegate
//MARK: - cell delegate
...
@@ -529,29 +530,33 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -529,29 +530,33 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
}
func
footerClickAction
()
{
func
footerClickAction
()
{
print
(
jieTiArr
)
if
selectYuShou
{
//预售
if
selectYuShou
{
//预售
specalArr
.
a
d
d
(
""
)
specalArr
.
a
ppen
d
(
""
)
}
else
{
//非预售
}
else
{
//非预售
jieTiArr
.
a
d
d
(
""
)
jieTiArr
.
a
ppen
d
(
""
)
}
}
listTbv
.
reloadData
()
listTbv
.
reloadData
()
}
}
func
YuShouCellSwitchStatus
(
sender
:
UISwitch
)
{
func
YuShouCellSwitchStatus
(
sender
:
UISwitch
)
{
//控制
//控制
print
(
"status3 =
\(
isYuShouSetting
)
,
\(
isJieTiJiaSetting
)
"
)
isYuShouSetting
=
sender
.
isOn
isYuShouSetting
=
sender
.
isOn
listTbv
.
reloadData
()
listTbv
.
reloadData
()
}
}
func
PuTongJieTiDelAction
(
sender
:
UIButton
)
{
func
PuTongJieTiDelAction
(
sender
:
PuTongJieTiCell
)
{
jieTiArr
.
remove
Object
(
at
:
sender
.
tag
)
jieTiArr
.
remove
(
at
:
sender
.
tag
)
print
(
jieTiArr
)
print
(
jieTiArr
,
sender
.
tag
)
listTbv
.
reloadData
()
listTbv
.
reloadData
()
}
}
func
PuTongJieTiContent
(
price
:
String
,
count
:
String
,
cell
:
PuTongJieTiCell
)
{
func
PuTongJieTiContent
(
price
:
String
,
count
:
String
,
cell
:
PuTongJieTiCell
)
{
if
selectYuShou
{
if
selectYuShou
{
specalArr
.
replaceObject
(
at
:
cell
.
tag
,
with
:
"
\(
price
)
_
\(
count
)
"
)
specalArr
.
insert
(
"
\(
price
)
_
\(
count
)
"
,
at
:
cell
.
tag
)
print
(
specalArr
)
specalArr
.
remove
(
at
:
cell
.
tag
+
1
)
}
else
{
}
else
{
jieTiArr
.
replaceObject
(
at
:
cell
.
tag
,
with
:
"
\(
price
)
_
\(
count
)
"
)
jieTiArr
.
insert
(
"
\(
price
)
_
\(
count
)
"
,
at
:
cell
.
tag
)
print
(
jieTiArr
)
jieTiArr
.
remove
(
at
:
cell
.
tag
+
1
)
}
}
}
}
...
@@ -589,19 +594,17 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -589,19 +594,17 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
selectIdx
=
indexPath
selectIdx
=
indexPath
//刷新cell
//刷新cell
let
dataDict
=
datasArr
[
selectIdx
!.
item
]
as!
NSDictionary
let
dataDict
=
datasArr
[
selectIdx
!.
item
]
price
=
dataDict
[
"price"
]
as!
String
price
=
dataDict
.
price
guiGe
=
dataDict
[
"guiGe"
]
as!
String
guiGe
=
dataDict
.
guiGe
weight
=
dataDict
[
"weight"
]
as!
String
weight
=
dataDict
.
weight
wenDu
=
dataDict
[
"wenDu"
]
as!
String
wenDu
=
dataDict
.
wenDu
danWei
=
dataDict
[
"danWei"
]
as!
String
danWei
=
dataDict
.
danWei
let
arr
=
dataDict
[
"jieTiArr"
]
as!
NSMutableArray
isNonYuShou
=
dataDict
.
isNonYuShou
let
arr2
=
dataDict
[
"specalArr"
]
as!
NSMutableArray
isYuShouSetting
=
dataDict
.
isYuShouSetting
isNonYuShou
=
dataDict
[
"isNonYuShou"
]
as!
Bool
yuShouPrice
=
dataDict
.
yuShouPrice
isYuShouSetting
=
dataDict
[
"isYuShouSetting"
]
as!
Bool
specalArr
=
dataDict
.
specalArr
yuShouPrice
=
dataDict
[
"yuShouPrice"
]
as!
String
jieTiArr
=
dataDict
.
jieTiArr
specalArr
=
arr2
jieTiArr
=
arr
listTbv
.
reloadData
()
listTbv
.
reloadData
()
collectionView
.
reloadData
()
collectionView
.
reloadData
()
}
}
...
...
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
0 → 100644
View file @
9f3a4b1f
//
// GuiGeModel.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/15.
// Copyright © 2020 junye lu. All rights reserved.
//
import
Foundation
class
GuiGeModel
:
NSObject
{
///售价
var
price
:
String
=
""
///规格
var
guiGe
:
String
=
""
///重量
var
weight
:
String
=
""
///温度
var
wenDu
:
String
=
""
///单位
var
danWei
:
String
=
""
///是否预售
var
isNonYuShou
:
Bool
=
false
///是否打开预售设置
var
isYuShouSetting
:
Bool
=
false
///预售价格
var
yuShouPrice
:
String
=
""
///普通阶梯价
var
jieTiArr
:
Array
<
Any
>
=
[]
///预售阶梯价
var
specalArr
:
Array
<
Any
>
=
[]
}
GeliBusinessPlatform/ViewController/新增规格/PuTongJieTiCell.swift
View file @
9f3a4b1f
...
@@ -8,16 +8,15 @@
...
@@ -8,16 +8,15 @@
import
UIKit
import
UIKit
@objc
protocol
PuTongJieTiCellDelegate
{
@objc
protocol
PuTongJieTiCellDelegate
{
@objc
optional
func
PuTongJieTiDelAction
(
sender
:
UIButton
)
@objc
optional
func
PuTongJieTiDelAction
(
sender
:
PuTongJieTiCell
)
@objc
optional
func
PuTongJieTiContent
(
price
:
String
,
count
:
String
,
cell
:
PuTongJieTiCell
)
@objc
optional
func
PuTongJieTiContent
(
price
:
String
,
count
:
String
,
cell
:
PuTongJieTiCell
)
}
}
class
PuTongJieTiCell
:
UITableViewCell
{
class
PuTongJieTiCell
:
UITableViewCell
{
var
delegate
:
PuTongJieTiCellDelegate
?
var
delegate
:
PuTongJieTiCellDelegate
?
@IBAction
func
delAction
(
_
sender
:
UIButton
)
{
@IBAction
func
delAction
(
_
sender
:
UIButton
)
{
delegate
?
.
PuTongJieTiDelAction
?(
sender
:
se
nder
)
delegate
?
.
PuTongJieTiDelAction
?(
sender
:
se
lf
)
}
}
@IBOutlet
weak
var
priceTF
:
UITextField
!
@IBOutlet
weak
var
priceTF
:
UITextField
!
@IBOutlet
weak
var
countTF
:
UITextField
!
@IBOutlet
weak
var
countTF
:
UITextField
!
@IBOutlet
weak
var
titleLbl
:
UILabel
!
@IBOutlet
weak
var
titleLbl
:
UILabel
!
...
...
GeliBusinessPlatform/ViewController/新增规格/YuShouCell.xib
View file @
9f3a4b1f
...
@@ -156,7 +156,7 @@
...
@@ -156,7 +156,7 @@
<color
red=
"0.18000000715255737"
green=
"0.18000000715255737"
blue=
"0.18000000715255737"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<color
red=
"0.18000000715255737"
green=
"0.18000000715255737"
blue=
"0.18000000715255737"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
</namedColor>
<namedColor
name=
"标题字颜色"
>
<namedColor
name=
"标题字颜色"
>
<color
red=
"0.180
3921568627451"
green=
"0.1803921568627451"
blue=
"0.1803921568627451
"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<color
red=
"0.180
00000715255737"
green=
"0.18000000715255737"
blue=
"0.18000000715255737
"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
</namedColor>
<namedColor
name=
"灰色分界线"
>
<namedColor
name=
"灰色分界线"
>
<color
red=
"0.92941176470588238"
green=
"0.92941176470588238"
blue=
"0.92941176470588238"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<color
red=
"0.92941176470588238"
green=
"0.92941176470588238"
blue=
"0.92941176470588238"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
...
...
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