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
28a70dce
Commit
28a70dce
authored
May 18, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复规格,商品详情bug
parent
ccb1ec82
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
94 additions
and
130 deletions
+94
-130
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/SceneDelegate.swift
GeliBusinessPlatform/SceneDelegate.swift
+5
-6
GeliBusinessPlatform/View/AlertView/GLAlertSelectView.swift
GeliBusinessPlatform/View/AlertView/GLAlertSelectView.swift
+1
-17
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
...orm/ViewController/商品详情/ProductDetailViewController.swift
+59
-37
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift
...orm/ViewController/新增规格/CreatNewSpecsViewController.swift
+25
-69
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
+4
-1
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
28a70dce
No preview for this file type
GeliBusinessPlatform/SceneDelegate.swift
View file @
28a70dce
...
@@ -43,15 +43,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
...
@@ -43,15 +43,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
//MARK:--loginVC
//MARK:--loginVC
func
addLoginVc
(
isAgain
:
Bool
){
func
addLoginVc
(
isAgain
:
Bool
){
//
let vc = LoginViewController()
let
vc
=
LoginViewController
()
//
vc.delegate = self
vc
.
delegate
=
self
//
let contentView = vc
let
contentView
=
vc
//
//
let
vc
=
ChuRuKuJiLuXQViewController
()
// let vc = ProductDetailViewController()
vc
.
barTitle
=
"入库"
// let contentView = vc
let
contentView
=
vc
if
let
windowScene
=
sceneC
as?
UIWindowScene
{
if
let
windowScene
=
sceneC
as?
UIWindowScene
{
...
...
GeliBusinessPlatform/View/AlertView/GLAlertSelectView.swift
View file @
28a70dce
...
@@ -68,26 +68,10 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
...
@@ -68,26 +68,10 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
}
}
@IBAction
func
closeAction
(
_
sender
:
UIButton
)
{
@IBAction
func
closeAction
(
_
sender
:
UIButton
)
{
print
(
"close"
,
tempArr
,
selectArray
)
if
tempNum
==
nil
{
if
tempNum
==
nil
{
tempNum
=
10086
tempNum
=
10086
}
}
delegate
?
.
GLASClose
(
view
:
self
,
selectnum
:
tempNum
!
,
selectArr
:
tempArr
!
)
delegate
?
.
GLASClose
(
view
:
self
,
selectnum
:
tempNum
!
,
selectArr
:
tempArr
!
)
// if isMultipleS == false {
// if selectNum == nil {
// HUD.flash(.label("\(titleLbl.text!)"), delay: 1.2)
// return
// }
// delegate?.GLAlertSelectViewClick?(selectNum: selectNum!,view: self)
// }else{
//
// if selectArray?.componentsJoined(by: "_") == "99_99_99_99" {
// HUD.flash(.label("\(titleLbl.text!)"), delay: 1.2)
// return
// }
// delegate?.GLAlertMoreSelectViewClick?(sender: selectArray!,view:self)
// }
}
}
//初始化时将xib中的view添加进来
//初始化时将xib中的view添加进来
@IBOutlet
weak
var
btmView
:
UIView
!
@IBOutlet
weak
var
btmView
:
UIView
!
...
@@ -224,7 +208,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
...
@@ -224,7 +208,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
HUD
.
flash
(
.
label
(
"
\(
titleLbl
.
text
!
)
"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"
\(
titleLbl
.
text
!
)
"
),
delay
:
1.2
)
return
return
}
}
print
(
"abc ==
\(
selectNum
)
"
)
delegate
?
.
GLAlertSelectViewClick
?(
selectNum
:
selectNum
!
,
view
:
self
)
delegate
?
.
GLAlertSelectViewClick
?(
selectNum
:
selectNum
!
,
view
:
self
)
}
else
{
}
else
{
if
selectArray
==
[
99
,
99
,
99
,
99
]
{
if
selectArray
==
[
99
,
99
,
99
,
99
]
{
...
...
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
View file @
28a70dce
...
@@ -29,9 +29,6 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -29,9 +29,6 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
shangPinStatus
=
selectnum
shangPinStatus
=
selectnum
}
}
}
}
view
.
removeFromSuperview
()
view
.
removeFromSuperview
()
glSelectView
=
nil
glSelectView
=
nil
}
}
...
@@ -47,13 +44,14 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -47,13 +44,14 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
let
qtxxArr
=
[
"关键字"
,
"物流费用"
,
"国家"
,
"商品状态"
,
"运输方式"
]
let
qtxxArr
=
[
"关键字"
,
"物流费用"
,
"国家"
,
"商品状态"
,
"运输方式"
]
let
ysszArr
=
[
"用户付款是否需要审核"
,
"预设预付定金时间段"
,
"预设预付尾款时间段"
,
"预设预付尾款发货时间"
]
let
ysszArr
=
[
"用户付款是否需要审核"
,
"预设预付定金时间段"
,
"预设预付尾款时间段"
,
"预设预付尾款发货时间"
]
let
ysszHolder
=
[
"0"
,
"请选择时段"
,
"请选择时段"
,
"0"
]
let
ysszHolder
=
[
"0"
,
"请选择时段"
,
"请选择时段"
,
"0"
]
var
shangPinStatusArr
:
Array
<
GeneralInfoGsModel
>
?
var
shangPinStatusArr
:
Array
<
GeneralInfoGsModel
>
?
=
[]
var
yunShuTypeArr
=
[
"冷链"
,
"常温"
,
"热链"
]
var
yunShuTypeArr
=
[
"冷链"
,
"常温"
,
"热链"
]
var
countryArr
=
[
"中国"
]
var
countryArr
=
[
"中国"
]
var
layout
=
UICollectionViewFlowLayout
()
var
layout
=
UICollectionViewFlowLayout
()
var
glSelectView
:
GLAlertSelectView
?
var
glSelectView
:
GLAlertSelectView
?
var
selectIdx
:
IndexPath
?
//多规格状态下点击collectionCell的row记录
var
selectIdx
:
IndexPath
?
=
IndexPath
(
item
:
0
,
section
:
0
)
//多规格状态下点击collectionCell的row记录
var
isYuShouShangPin
:
Bool
?
//是否为预售商品
var
isYuShouShangPin
:
Bool
?
//是否为预售商品
...
@@ -77,11 +75,38 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -77,11 +75,38 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
@IBAction
func
submitAction
(
_
sender
:
Any
)
{
@IBAction
func
submitAction
(
_
sender
:
Any
)
{
print
(
"保存按钮submitAction"
)
print
(
"保存按钮submitAction"
)
print
(
itemName
)
//商品名称
print
(
itemName
)
//商品名称
print
(
itemTypeArr
)
//商品类型
print
(
qiMaiShuLiang
)
//起卖数量
print
(
singleImgArr
.
count
)
//商品封面图
print
(
shiFouQZ
)
//是否清真
print
(
shiFouXJ
)
//是否询价
print
(
maxFiveImgsArr
)
//商品主图
print
(
shiFouSH
)
print
(
guiGeArr
)
//商品规格
print
(
keyWord
)
//关键字
print
(
wuLiuPrice
)
//物流费用
print
(
shangPinStatus
)
//商品状态
print
(
yunShuType
)
//运输方式
print
(
countrySelect
)
//选择国家
if
itemName
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请输入商品名称"
),
delay
:
1.2
)
return
}
if
itemTypeArr
==
[]
||
itemTypeArr
==
[
99
,
99
,
99
,
99
]
{
HUD
.
flash
(
.
label
(
"请选择商品类型"
),
delay
:
1.2
)
return
}
//待补充
if
itemName
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请输入商品名称"
),
delay
:
1.2
)
return
}
//待补充
if
itemName
.
count
==
0
{
if
itemName
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请输入商品名称"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请输入商品名称"
),
delay
:
1.2
)
return
return
}
}
print
(
itemTypeArr
)
//商品类型
if
itemTypeArr
==
[
99
,
99
,
99
,
99
]
{
if
itemTypeArr
==
[
99
,
99
,
99
,
99
]
{
HUD
.
flash
(
.
label
(
"请选择商品类型"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请选择商品类型"
),
delay
:
1.2
)
return
return
...
@@ -90,20 +115,17 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -90,20 +115,17 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
HUD
.
flash
(
.
label
(
"请输入起卖数量"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请输入起卖数量"
),
delay
:
1.2
)
return
return
}
}
print
(
qiMaiShuLiang
)
//起卖数量
print
(
shiFouQZ
)
//是否清真
print
(
shiFouXJ
)
//是否询价
if
singleImgArr
.
count
==
0
{
if
singleImgArr
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请选择商品封面图"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请选择商品封面图"
),
delay
:
1.2
)
return
return
}
}
print
(
singleImgArr
.
count
)
//商品封面图
if
maxFiveImgsArr
.
count
==
0
{
if
maxFiveImgsArr
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请选择商品主图"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请选择商品主图"
),
delay
:
1.2
)
return
return
}
}
print
(
maxFiveImgsArr
)
//商品主图
if
guiGeArr
.
count
==
0
{
if
guiGeArr
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写商品规格"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请填写商品规格"
),
delay
:
1.2
)
return
return
...
@@ -113,7 +135,6 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -113,7 +135,6 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
HUD
.
flash
(
.
label
(
"请输入发货时间"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请输入发货时间"
),
delay
:
1.2
)
return
return
}
}
print
(
shiFouSH
)
}
}
if
keyWord
.
count
==
0
{
if
keyWord
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请输入关键字"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请输入关键字"
),
delay
:
1.2
)
...
@@ -123,24 +144,22 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -123,24 +144,22 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
HUD
.
flash
(
.
label
(
"请输入物流费用"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请输入物流费用"
),
delay
:
1.2
)
return
return
}
}
print
(
guiGeArr
)
//商品规格
if
countrySelect
==
nil
{
print
(
keyWord
)
//关键字
HUD
.
flash
(
.
label
(
"请选择国家"
),
delay
:
1.2
)
print
(
wuLiuPrice
)
//物流费用
return
}
if
shangPinStatus
==
nil
{
if
shangPinStatus
==
nil
{
HUD
.
flash
(
.
label
(
"请选择商品状态"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请选择商品状态"
),
delay
:
1.2
)
return
return
}
}
print
(
shangPinStatusArr
!
[
shangPinStatus
!
])
//商品状态
if
yunShuType
==
nil
{
if
yunShuType
==
nil
{
HUD
.
flash
(
.
label
(
"请选择运输方式"
),
delay
:
1.2
)
HUD
.
flash
(
.
label
(
"请选择运输方式"
),
delay
:
1.2
)
return
return
}
}
print
(
yunShuTypeArr
[
yunShuType
!
])
//运输方式
if
countrySelect
==
nil
{
HUD
.
flash
(
.
label
(
"请选择国家"
),
delay
:
1.2
)
return
}
print
(
countryArr
[
countrySelect
!
])
//选择国家
...
@@ -160,6 +179,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -160,6 +179,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
HUD
.
hide
(
animated
:
true
)
HUD
.
hide
(
animated
:
true
)
self
.
generalInfoModel
=
(
data
as!
GeneralInfoModel
)
self
.
generalInfoModel
=
(
data
as!
GeneralInfoModel
)
self
.
shangPinStatusArr
=
(
self
.
generalInfoModel
?
.
data
!.
gs
)
!
self
.
shangPinStatusArr
=
(
self
.
generalInfoModel
?
.
data
!.
gs
)
!
})
{
(
error
)
in
})
{
(
error
)
in
}
}
...
@@ -366,7 +386,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -366,7 +386,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
itemTypeArr
?
.
append
(
99
)
itemTypeArr
?
.
append
(
99
)
}
}
}
}
view
.
selectArray
=
itemTypeArr
view
.
selectArray
=
itemTypeArr
view
.
tempArr
=
itemTypeArr
view
.
tempArr
=
itemTypeArr
self
.
view
.
addSubview
(
view
)
self
.
view
.
addSubview
(
view
)
...
@@ -548,9 +568,10 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -548,9 +568,10 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
func
GLAlertSelectViewClick
(
selectNum
:
Int
,
view
:
GLAlertSelectView
)
{
func
GLAlertSelectViewClick
(
selectNum
:
Int
,
view
:
GLAlertSelectView
)
{
switch
view
.
titleLbl
.
text
{
switch
view
.
titleLbl
.
text
{
case
"请选择商品
类型
"
:
case
"请选择商品
状态
"
:
shangPinStatus
=
selectNum
shangPinStatus
=
selectNum
let
item
=
shangPinStatusArr
!
[
selectNum
]
let
item
=
shangPinStatusArr
!
[
selectNum
]
print
(
item
.
gs_name
!
)
tishixxArr1
.
insert
(
item
.
gs_name
!
,
at
:
view
.
tag
)
tishixxArr1
.
insert
(
item
.
gs_name
!
,
at
:
view
.
tag
)
tishixxArr1
.
remove
(
at
:
view
.
tag
+
1
)
tishixxArr1
.
remove
(
at
:
view
.
tag
+
1
)
break
break
...
@@ -564,6 +585,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -564,6 +585,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
tishixxArr1
.
insert
(
countryArr
[
selectNum
],
at
:
view
.
tag
)
tishixxArr1
.
insert
(
countryArr
[
selectNum
],
at
:
view
.
tag
)
tishixxArr1
.
remove
(
at
:
view
.
tag
+
1
)
tishixxArr1
.
remove
(
at
:
view
.
tag
+
1
)
break
break
default
:
default
:
break
break
}
}
...
@@ -634,7 +656,6 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -634,7 +656,6 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
let
vc
=
CreatNewSpecsViewController
()
let
vc
=
CreatNewSpecsViewController
()
vc
.
barTitle
=
"编辑规格"
vc
.
barTitle
=
"编辑规格"
vc
.
datasArr
=
guiGeArr
vc
.
datasArr
=
guiGeArr
vc
.
danWeiArr
=
generalInfoModel
?
.
data
?
.
unit
!
vc
.
danWeiArr
=
generalInfoModel
?
.
data
?
.
unit
!
vc
.
isJieTiJiaSetting
=
true
vc
.
isJieTiJiaSetting
=
true
let
dataDict
:
GuiGeModel
!
let
dataDict
:
GuiGeModel
!
...
@@ -654,12 +675,9 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -654,12 +675,9 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
vc
.
yuShouPrice
=
dataDict
.
yuShouPrice
vc
.
yuShouPrice
=
dataDict
.
yuShouPrice
vc
.
specalArr
=
dataDict
.
specalArr
vc
.
specalArr
=
dataDict
.
specalArr
vc
.
jieTiArr
=
dataDict
.
jieTiArr
vc
.
jieTiArr
=
dataDict
.
jieTiArr
if
selectIdx
==
nil
{
vc
.
selectIdx
=
selectIdx
vc
.
selectIdx
=
IndexPath
(
item
:
0
,
section
:
0
)
vc
.
itemDanWeiSelect
=
dataDict
.
itemDanWeiSelect
}
else
{
vc
.
tempSelect
=
dataDict
.
tempSelect
vc
.
selectIdx
=
selectIdx
}
print
(
vc
.
selectIdx
?
.
item
)
vc
.
delegate
=
self
vc
.
delegate
=
self
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
...
@@ -680,14 +698,17 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -680,14 +698,17 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
vc
.
isYuShouSetting
=
isYuShou
vc
.
isYuShouSetting
=
isYuShou
vc
.
isNonYuShou
=
isYuShou
vc
.
isNonYuShou
=
isYuShou
vc
.
datasArr
=
guiGeArr
vc
.
datasArr
=
guiGeArr
vc
.
selectIdx
=
selectIdx
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
//MARK: - 新增、编辑规格
//MARK: - 新增、编辑规格
func
CreatNewSpecsViewControllerSaveAction
(
datas
:
Array
<
GuiGeModel
>
)
{
func
CreatNewSpecsViewControllerSaveAction
(
datas
:
Array
<
GuiGeModel
>
,
selectIdx
:
IndexPath
)
{
guiGeArr
=
datas
guiGeArr
=
datas
self
.
selectIdx
=
selectIdx
listTbv
.
reloadData
()
listTbv
.
reloadData
()
}
}
//MARK: - COLLECTIONVIEW DELEGATE
//MARK: - COLLECTIONVIEW DELEGATE
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
collectionViewLayout
:
UICollectionViewLayout
,
minimumLineSpacingForSectionAt
section
:
Int
)
->
CGFloat
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
collectionViewLayout
:
UICollectionViewLayout
,
minimumLineSpacingForSectionAt
section
:
Int
)
->
CGFloat
{
return
0
return
0
...
@@ -701,9 +722,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -701,9 +722,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
as!
ItemCell
as!
ItemCell
cell
.
tag
=
indexPath
.
row
cell
.
tag
=
indexPath
.
row
cell
.
nameLbl
.
text
=
"规格"
+
"
\(
indexPath
.
item
+
1
)
"
cell
.
nameLbl
.
text
=
"规格"
+
"
\(
indexPath
.
item
+
1
)
"
if
selectIdx
==
nil
{
selectIdx
=
IndexPath
(
item
:
0
,
section
:
0
)
}
if
indexPath
==
selectIdx
{
if
indexPath
==
selectIdx
{
cell
.
nameLbl
.
textColor
=
UIColor
(
named
:
"蓝色字体颜色"
)
cell
.
nameLbl
.
textColor
=
UIColor
(
named
:
"蓝色字体颜色"
)
cell
.
lineView
.
isHidden
=
false
cell
.
lineView
.
isHidden
=
false
...
@@ -717,8 +736,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -717,8 +736,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
selectIdx
=
indexPath
selectIdx
=
indexPath
//刷新cell
//刷新cell
listTbv
.
reloadData
()
collectionView
.
reloadData
()
collectionView
.
reloadData
()
listTbv
.
reloadRows
(
at
:
[
IndexPath
(
row
:
0
,
section
:
2
)],
with
:
.
none
)
}
}
//MARK: - switchClick
//MARK: - switchClick
func
switchClick
(
content
:
UISwitch
,
cell
:
TitleAndSwitchCell
)
{
func
switchClick
(
content
:
UISwitch
,
cell
:
TitleAndSwitchCell
)
{
...
@@ -814,7 +833,10 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -814,7 +833,10 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
layout
.
scrollDirection
=
.
horizontal
layout
.
scrollDirection
=
.
horizontal
collectionView
.
collectionViewLayout
=
layout
collectionView
.
collectionViewLayout
=
layout
collectionView
.
register
(
UINib
(
nibName
:
"ItemCell"
,
bundle
:
nil
),
forCellWithReuseIdentifier
:
"ItemCell"
)
collectionView
.
register
(
UINib
(
nibName
:
"ItemCell"
,
bundle
:
nil
),
forCellWithReuseIdentifier
:
"ItemCell"
)
collectionView
.
selectItem
(
at
:
selectIdx
,
animated
:
false
,
scrollPosition
:
.
left
)
if
guiGeArr
.
count
>
0
{
collectionView
.
layoutIfNeeded
()
collectionView
.
scrollToItem
(
at
:
selectIdx
!
,
at
:
.
centeredHorizontally
,
animated
:
false
)
}
}
}
}
}
return
view
return
view
...
...
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift
View file @
28a70dce
...
@@ -11,29 +11,24 @@ import LGButton
...
@@ -11,29 +11,24 @@ import LGButton
import
IQKeyboardManagerSwift
import
IQKeyboardManagerSwift
protocol
CreatNewSpecsViewControllerDelegate
{
protocol
CreatNewSpecsViewControllerDelegate
{
func
CreatNewSpecsViewControllerSaveAction
(
datas
:
Array
<
GuiGeModel
>
)
func
CreatNewSpecsViewControllerSaveAction
(
datas
:
Array
<
GuiGeModel
>
,
selectIdx
:
IndexPath
)
func
CreatNewSpecsViewControllerDeleteAction
(
datas
:
Array
<
GuiGeModel
>
,
selectIdx
:
IndexPath
)
func
CreatNewSpecsViewControllerDeleteAction
(
datas
:
Array
<
GuiGeModel
>
,
selectIdx
:
IndexPath
)
}
}
class
CreatNewSpecsViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
TitleAndTFCellDelegate
,
TitleAndBtnCellDelegate
,
TitleAndSwitchCellDelegate
,
TitleAndSwitchHeaderViewDelegate
,
NewCreateHeaderDelegate
,
NewCreateFooterDelegate
,
YuShouCellDelegate
,
GLAlertSelectViewDelegate
,
PuTongJieTiCellDelegate
,
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UICollectionViewDelegateFlowLayout
,
UITextFieldDelegate
{
class
CreatNewSpecsViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
TitleAndTFCellDelegate
,
TitleAndBtnCellDelegate
,
TitleAndSwitchCellDelegate
,
TitleAndSwitchHeaderViewDelegate
,
NewCreateHeaderDelegate
,
NewCreateFooterDelegate
,
YuShouCellDelegate
,
GLAlertSelectViewDelegate
,
PuTongJieTiCellDelegate
,
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UICollectionViewDelegateFlowLayout
,
UITextFieldDelegate
{
func
GLASClose
(
view
:
GLAlertSelectView
,
selectnum
:
Int
,
selectArr
:
Array
<
Int
>
)
{
func
GLASClose
(
view
:
GLAlertSelectView
,
selectnum
:
Int
,
selectArr
:
Array
<
Int
>
)
{
if
selectnum
!=
10086
{
if
selectnum
!=
10086
{
if
view
.
titleLbl
.
text
==
"请选择商品温藏"
{
if
view
.
titleLbl
.
text
==
"请选择商品温藏"
{
tempSelect
=
selectnum
tempSelect
=
selectnum
}
}
if
view
.
titleLbl
.
text
==
"请选择商品单位"
{
if
view
.
titleLbl
.
text
==
"请选择商品单位"
{
itemDanWeiSelect
=
selectnum
itemDanWeiSelect
=
selectnum
}
}
}
}
view
.
removeFromSuperview
()
view
.
removeFromSuperview
()
selectView
=
nil
selectView
=
nil
}
}
var
layout
=
UICollectionViewFlowLayout
()
var
layout
=
UICollectionViewFlowLayout
()
var
delegate
:
CreatNewSpecsViewControllerDelegate
?
var
delegate
:
CreatNewSpecsViewControllerDelegate
?
var
collectView
:
UICollectionView
?
var
collectView
:
UICollectionView
?
var
datasArr
:
Array
<
GuiGeModel
>
=
[]
var
datasArr
:
Array
<
GuiGeModel
>
=
[]
...
@@ -43,12 +38,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -43,12 +38,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
@IBOutlet
weak
var
bottomBtn
:
LGButton
!
@IBOutlet
weak
var
bottomBtn
:
LGButton
!
@IBOutlet
weak
var
listTbv
:
UITableView
!
@IBOutlet
weak
var
listTbv
:
UITableView
!
var
selectIdx
:
IndexPath
?
var
selectIdx
:
IndexPath
?
var
isYuShouSetting
:
Bool
=
false
{
var
isYuShouSetting
=
false
//打开预售
willSet
{
var
isJieTiJiaSetting
=
false
isYuShouSetting
=
newValue
}
}
//打开预售
var
isJieTiJiaSetting
:
Bool
=
false
var
selectYuShou
:
Bool
=
false
//是否选择设置预售价格
var
selectYuShou
:
Bool
=
false
//是否选择设置预售价格
...
@@ -58,54 +49,17 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -58,54 +49,17 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
//选择页面
//选择页面
var
selectView
:
GLAlertSelectView
?
=
nil
var
selectView
:
GLAlertSelectView
?
=
nil
var
selectListArr
:
Array
<
String
>
=
[
"冷冻"
,
"冷藏"
,
"常温"
]
var
selectListArr
:
Array
<
String
>
=
[
"冷冻"
,
"冷藏"
,
"常温"
]
var
danWeiArr
:
Array
<
String
>
?{
var
danWeiArr
:
Array
<
String
>
?
willSet
{
var
price
=
""
print
(
newValue
)
var
guiGe
=
""
danWeiArr
=
newValue
var
weight
=
""
}
var
wenDu
=
""
}
var
danWei
=
""
var
price
=
""
{
//规格
willSet
{
price
=
newValue
}
}
var
guiGe
=
""
{
willSet
{
guiGe
=
newValue
}
}
var
weight
=
""
{
willSet
{
weight
=
newValue
}
}
var
wenDu
=
""
{
willSet
{
wenDu
=
newValue
for
i
in
0
..<
selectListArr
.
count
{
if
newValue
==
selectListArr
[
i
]
{
tempSelect
=
i
}
}
}
}
var
danWei
=
""
{
willSet
{
danWei
=
newValue
if
danWeiArr
!=
nil
{
for
i
in
0
..<
danWeiArr
!.
count
{
if
newValue
==
selectListArr
[
i
]
{
itemDanWeiSelect
=
i
}
}
}
}
}
//规格
var
specalArr
:
Array
<
Any
>
=
[]{
var
specalArr
:
Array
<
Any
>
=
[]{
willSet
{
willSet
{
specalArr
.
removeAll
()
specalArr
.
removeAll
()
specalArr
=
newValue
specalArr
=
newValue
}
}
}
//预售
}
//预售
var
jieTiArr
:
Array
<
Any
>
=
[]{
var
jieTiArr
:
Array
<
Any
>
=
[]{
...
@@ -231,6 +185,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -231,6 +185,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
dataModel
.
isNonYuShou
=
isNonYuShou
dataModel
.
isNonYuShou
=
isNonYuShou
dataModel
.
isYuShouSetting
=
isYuShouSetting
dataModel
.
isYuShouSetting
=
isYuShouSetting
dataModel
.
yuShouPrice
=
yuShouPrice
dataModel
.
yuShouPrice
=
yuShouPrice
dataModel
.
itemDanWeiSelect
=
itemDanWeiSelect
dataModel
.
tempSelect
=
tempSelect
if
barTitle
?
.
contains
(
"编辑"
)
==
true
{
if
barTitle
?
.
contains
(
"编辑"
)
==
true
{
datasArr
.
insert
(
dataModel
,
at
:
selectIdx
!.
item
)
datasArr
.
insert
(
dataModel
,
at
:
selectIdx
!.
item
)
...
@@ -238,8 +194,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -238,8 +194,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
else
{
}
else
{
datasArr
.
append
(
dataModel
)
datasArr
.
append
(
dataModel
)
selectIdx
?
.
item
=
datasArr
.
count
-
1
}
}
delegate
?
.
CreatNewSpecsViewControllerSaveAction
(
datas
:
datasArr
)
delegate
?
.
CreatNewSpecsViewControllerSaveAction
(
datas
:
datasArr
,
selectIdx
:
selectIdx
!
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
//MARK: - TEXTFIELD DELEGATE
//MARK: - TEXTFIELD DELEGATE
...
@@ -532,10 +489,10 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -532,10 +489,10 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
selectView
?
.
removeFromSuperview
()
selectView
?
.
removeFromSuperview
()
selectView
=
nil
selectView
=
nil
}
}
var
tempSelect
:
Int
?
var
tempSelect
:
Int
?
var
itemDanWeiSelect
:
Int
?
var
itemDanWeiSelect
:
Int
?
...
@@ -585,7 +542,6 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -585,7 +542,6 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
isYuShouSetting
=
content
.
isOn
isYuShouSetting
=
content
.
isOn
let
idxPath
=
IndexPath
(
row
:
0
,
section
:
1
)
let
idxPath
=
IndexPath
(
row
:
0
,
section
:
1
)
if
isYuShouSetting
&&
isJieTiJiaSetting
{
//单独点击预售设置
if
isYuShouSetting
&&
isJieTiJiaSetting
{
//单独点击预售设置
listTbv
.
reloadData
()
listTbv
.
reloadData
()
}
else
{
//单独打开预售设置
}
else
{
//单独打开预售设置
listTbv
.
reloadRows
(
at
:
[
idxPath
],
with
:
.
none
)
listTbv
.
reloadRows
(
at
:
[
idxPath
],
with
:
.
none
)
...
@@ -649,8 +605,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -649,8 +605,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
"ItemCell"
,
for
:
indexPath
)
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
"ItemCell"
,
for
:
indexPath
)
as!
ItemCell
as!
ItemCell
cell
.
tag
=
indexPath
.
row
cell
.
tag
=
indexPath
.
item
cell
.
nameLbl
.
text
=
"规格"
+
"
\(
indexPath
.
item
+
1
)
"
if
indexPath
==
selectIdx
{
if
indexPath
==
selectIdx
{
cell
.
nameLbl
.
textColor
=
UIColor
(
named
:
"蓝色字体颜色"
)
cell
.
nameLbl
.
textColor
=
UIColor
(
named
:
"蓝色字体颜色"
)
cell
.
lineView
.
isHidden
=
false
cell
.
lineView
.
isHidden
=
false
...
...
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
View file @
28a70dce
...
@@ -29,5 +29,8 @@ class GuiGeModel: NSObject {
...
@@ -29,5 +29,8 @@ class GuiGeModel: NSObject {
var
jieTiArr
:
Array
<
Any
>
=
[]
var
jieTiArr
:
Array
<
Any
>
=
[]
///预售阶梯价
///预售阶梯价
var
specalArr
:
Array
<
Any
>
=
[]
var
specalArr
:
Array
<
Any
>
=
[]
///单位select
var
itemDanWeiSelect
:
Int
?
///温度select
var
tempSelect
:
Int
?
}
}
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