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
d5f44a55
Commit
d5f44a55
authored
May 20, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加预售设置开关
parent
d49ad703
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
219 additions
and
95 deletions
+219
-95
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
.../junyelu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+0
-16
GeliBusinessPlatform/Model/GoodsManageMoel/GoodsDetailModel.swift
...nessPlatform/Model/GoodsManageMoel/GoodsDetailModel.swift
+11
-3
GeliBusinessPlatform/ViewController/商品详情/EPViewController.swift
...sinessPlatform/ViewController/商品详情/EPViewController.swift
+106
-36
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
...orm/ViewController/商品详情/ProductDetailViewController.swift
+3
-15
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift
...orm/ViewController/新增规格/CreatNewSpecsViewController.swift
+40
-24
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
+6
-0
GeliBusinessPlatform/ViewController/新增规格/普通+预售header/TitleAndSwitchHeaderView.swift
...ontroller/新增规格/普通+预售header/TitleAndSwitchHeaderView.swift
+13
-1
GeliBusinessPlatform/ViewController/新增规格/普通+预售header/TitleAndSwitchHeaderView.xib
...wController/新增规格/普通+预售header/TitleAndSwitchHeaderView.xib
+40
-0
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
d5f44a55
No preview for this file type
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
d5f44a55
...
...
@@ -24,21 +24,5 @@
continueAfterRunningActions =
"No"
>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
uuid =
"B223F50A-4F5B-423B-9F6D-A967E5BFB36E"
shouldBeEnabled =
"No"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"575"
endingLineNumber =
"575"
landmarkName =
"YuShouCellSwitchStatus(sender:)"
landmarkType =
"7"
>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
GeliBusinessPlatform/Model/GoodsManageMoel/GoodsDetailModel.swift
View file @
d5f44a55
...
...
@@ -25,13 +25,17 @@ class GoodsDetailModel: Mappable {
}
class
GoodsDetailDataModel
:
Mappable
{
var
goods_res
:
Array
<
GoodsDetailGoodsResModel
>
?
//商品数据
var
goods_res
:
GoodsDetailGoodsResModel
?
//商品数据
var
sku_res
:
Array
<
GoodsDetailSkuResModel
>
?
//商品sku信息
var
banner_res
:
Array
<
GoodsDetailBannerResModel
>
?
//副图信息
required
init
?(
map
:
Map
)
{
}
func
mapping
(
map
:
Map
)
{
goods_res
<-
map
[
"goods_res"
]
sku_res
<-
map
[
"sku_res"
]
banner_res
<-
map
[
"banner_res"
]
}
...
...
@@ -40,7 +44,9 @@ class GoodsDetailGoodsResModel: Mappable {
var
goods_id
:
Int
?
//商品id
var
goods_name
:
String
?
//商品名
var
cat_id
:
Int
?
//分类id
var
cat_name
:
String
?
//分类名
var
brand_id
:
Int
?
//品牌id
var
brand_name
:
String
?
//品牌名
var
goods_sn
:
String
?
//商品sn
var
market_price
:
String
?
//市场价
var
shop_price
:
String
?
//(默认)售价(本店售价)
...
...
@@ -106,6 +112,8 @@ class GoodsDetailGoodsResModel: Mappable {
set_time
<-
map
[
"set_time"
]
is_inquiry
<-
map
[
"is_inquiry"
]
is_qz
<-
map
[
"is_qz"
]
brand_name
<-
map
[
"brand_name"
]
cat_name
<-
map
[
"cat_name"
]
}
...
...
GeliBusinessPlatform/ViewController/商品详情/EPViewController.swift
View file @
d5f44a55
...
...
@@ -63,7 +63,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
var
isYuShouShangPin
:
Bool
?
//是否为预售商品
var
itemTypeArr
:
Array
<
Int
>
?
=
[]
//多选
var
isYuShou
:
Bool
=
false
//是否预售
var
shangPinStatus
:
Int
?
=
0
//商品状态
var
yunShuType
:
Int
?
=
0
//运输类型
var
maxFiveImgsArr
:
Array
<
UIImage
>
=
[]
//多图
...
...
@@ -90,41 +90,122 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
//MARK:--获取新增商品的基本信息(品牌和分类等)
HUD
.
flash
(
.
progress
)
//MARK:--新增商品和编辑商品所需要的基本信息(无)就页面不正常显示
// let UserToken = UserDefaults.standard.value(forKey: "user_token")
// GeneralInfo(["user_token":UserToken as Any], success: { (data) in
// HUD.hide(animated: true)
// self.generalInfoModel = (data as! GeneralInfoModel)
// self.shangPinStatusArr = (self.generalInfoModel?.data!.gs)!
//
// }) { (error) in
//
// }
//是否为预售商品
isYuShouShangPin
=
false
navbar
.
title
=
"商品详情"
self
.
view
.
addSubview
(
navbar
)
if
listTbv
==
nil
{
//MARK:--新增商品和编辑商品所需要的基本信息(无)就页面不正常显示
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
goodsDetail
([
"user_token"
:
UserToken
,
"goods_id"
:
goods_id
],
success
:
{
(
data
)
in
let
model
=
data
as!
GoodsDetailModel
//商品名
self
.
itemName
=
(
model
.
data
?
.
goods_res
!.
goods_name
)
!
//商品类型
if
model
.
data
?
.
goods_res
!.
is_adsale
==
0
{
self
.
itemTypeArr
=
[
99
,
99
,
99
,
99
]
}
else
{
self
.
itemTypeArr
=
[
1
,
99
,
99
,
99
]
}
if
(
model
.
data
?
.
goods_res
!.
goods_type
)
!
==
1
||
(
model
.
data
?
.
goods_res
!.
goods_type
)
!
==
2
{
self
.
itemTypeArr
?
.
insert
(
1
,
at
:
1
)
self
.
itemTypeArr
?
.
remove
(
at
:
2
)
}
else
{
self
.
itemTypeArr
?
.
insert
((
model
.
data
?
.
goods_res
!.
goods_type
)
!
,
at
:
(
model
.
data
?
.
goods_res
!.
goods_type
)
!-
1
)
self
.
itemTypeArr
?
.
remove
(
at
:
(
model
.
data
?
.
goods_res
!.
goods_type
)
!
)
}
let
contentArr
=
[
"预售"
,
"普通"
,
"期货"
,
"团购"
]
let
titles
=
NSMutableArray
()
titles
.
removeAllObjects
()
for
num
in
self
.
itemTypeArr
!
{
if
num
!=
99
{
titles
.
add
(
contentArr
[
num
])
}
}
if
titles
.
componentsJoined
(
by
:
","
)
.
contains
(
"预售"
)
{
self
.
isYuShouShangPin
=
true
}
else
{
self
.
isYuShouShangPin
=
false
}
self
.
tishixxArr
.
insert
(
titles
.
componentsJoined
(
by
:
","
),
at
:
1
)
self
.
tishixxArr
.
remove
(
at
:
2
)
//商品分类
print
(
"abc == "
,
model
.
data
?
.
goods_res
!.
cat_name
)
self
.
tishixxArr
.
insert
((
model
.
data
?
.
goods_res
!.
cat_name
)
!
,
at
:
2
)
self
.
tishixxArr
.
remove
(
at
:
3
)
//品牌名
self
.
tishixxArr
.
insert
((
model
.
data
?
.
goods_res
!.
brand_name
)
!
,
at
:
3
)
self
.
tishixxArr
.
remove
(
at
:
4
)
//起卖数量
self
.
qiMaiShuLiang
=
"
\(
model
.
data
!.
goods_res
!.
origin_number
!
)
"
//是否清真
self
.
shiFouQZ
=
true
if
model
.
data
?
.
goods_res
!.
is_qz
==
0
{
self
.
shiFouQZ
=
false
}
//是否询价
self
.
shiFouXJ
=
true
if
model
.
data
?
.
goods_res
!.
is_inquiry
==
0
{
self
.
shiFouXJ
=
false
}
//是否有封面图
// if model.data?.goods_res?.original_img?.count > 0 {
//
// }
//商品主图
//商品规格
if
(
model
.
data
?
.
sku_res
?
.
count
)
!
>
0
{
self
.
guiGeArr
.
removeAll
()
for
item
in
model
.
data
!.
sku_res
!
{
let
dataSource
=
item
as!
GoodsDetailSkuResModel
let
data
=
GuiGeModel
()
data
.
DJBiLi
=
dataSource
.
pct
!
data
.
danWei
=
dataSource
.
unit
!
data
.
sku_id
=
dataSource
.
sku_id
!
data
.
guiGe
=
dataSource
.
spec_str
!
data
.
isOpenYSSetting
=
false
if
dataSource
.
is_open_adsale
!
==
1
{
data
.
isOpenYSSetting
=
true
}
data
.
isJieTiOpen
=
false
if
dataSource
.
is_tiered
==
1
{
data
.
isJieTiOpen
=
true
}
}
}
if
self
.
listTbv
==
nil
{
let
tbv
=
UITableView
()
tbvBGView
.
addSubview
(
tbv
)
self
.
tbvBGView
.
addSubview
(
tbv
)
tbv
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
left
.
bottom
.
right
.
equalTo
(
0
)
}
listTbv
=
tbv
self
.
listTbv
=
tbv
self
.
listTbv
.
separatorStyle
=
.
none
self
.
listTbv
.
delegate
=
self
self
.
listTbv
.
dataSource
=
self
self
.
listTbv
.
register
(
UINib
(
nibName
:
"TitleAndTFCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndTF"
)
self
.
listTbv
.
register
(
UINib
(
nibName
:
"TitleAndSwitchCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndSwitch"
)
self
.
listTbv
.
register
(
UINib
(
nibName
:
"TitleAndBtnCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndBtn"
)
self
.
listTbv
.
register
(
UINib
(
nibName
:
"AddImgCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"AddImg"
)
self
.
listTbv
.
register
(
UINib
(
nibName
:
"AddGuiGeCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"AddGuiGe"
)
self
.
listTbv
.
register
(
UINib
(
nibName
:
"YuShouWeiKuanFaHuoCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"YuShouWeiKuanFaHuoCell"
)
self
.
listTbv
.
register
(
UINib
(
nibName
:
"ShangPinGguiGeCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"ShangPinGguiGeCell"
)
}
})
{
(
error
)
in
}
listTbv
.
separatorStyle
=
.
none
listTbv
.
delegate
=
self
listTbv
.
dataSource
=
self
SetTopFrameView
(
view
:
tbvBGView
,
btmView
:
btmBtnBGView
)
listTbv
.
register
(
UINib
(
nibName
:
"TitleAndTFCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndTF"
)
listTbv
.
register
(
UINib
(
nibName
:
"TitleAndSwitchCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndSwitch"
)
listTbv
.
register
(
UINib
(
nibName
:
"TitleAndBtnCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndBtn"
)
listTbv
.
register
(
UINib
(
nibName
:
"AddImgCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"AddImg"
)
listTbv
.
register
(
UINib
(
nibName
:
"AddGuiGeCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"AddGuiGe"
)
listTbv
.
register
(
UINib
(
nibName
:
"YuShouWeiKuanFaHuoCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"YuShouWeiKuanFaHuoCell"
)
listTbv
.
register
(
UINib
(
nibName
:
"ShangPinGguiGeCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"ShangPinGguiGeCell"
)
// Do any additional setup after loading the view.
}
//MARK: - cell delegate
...
...
@@ -589,12 +670,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
func
GLAlertMoreSelectViewClick
(
sender
:
Array
<
Int
>
,
view
:
UIView
)
{
itemTypeArr
=
sender
let
str
=
"
\(
sender
.
first
!
)
"
if
str
!=
"99"
{
isYuShou
=
true
}
else
{
isYuShou
=
false
}
let
contentArr
=
[
"预售"
,
"普通"
,
"期货"
,
"团购"
]
let
titles
=
NSMutableArray
()
titles
.
removeAllObjects
()
...
...
@@ -875,12 +951,6 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
override
func
backAction
()
{
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
func
textFieldShouldReturn
(
_
textField
:
UITextField
)
->
Bool
{
IQKeyboardManager
.
shared
.
resignFirstResponder
()
}
func
scrollViewDidScroll
(
_
scrollView
:
UIScrollView
)
{
IQKeyboardManager
.
shared
.
resignFirstResponder
()
}
//MARK:--处理规格数据
var
specifications
=
""
...
...
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
View file @
d5f44a55
...
...
@@ -60,7 +60,6 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
var
isYuShouShangPin
:
Bool
?
//是否为预售商品
var
itemTypeArr
:
Array
<
Int
>
?
=
[]
//多选
var
isYuShou
:
Bool
=
false
//是否预售
var
shangPinStatus
:
Int
?
=
0
//商品状态
var
yunShuType
:
Int
?
=
0
//运输类型
var
maxFiveImgsArr
:
Array
<
UIImage
>
=
[]
//多图
...
...
@@ -770,14 +769,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
//MARK: - GLAlertView(多选)下的页面
func
GLAlertMoreSelectViewClick
(
sender
:
Array
<
Int
>
,
view
:
UIView
)
{
itemTypeArr
=
sender
let
str
=
"
\(
sender
.
first
!
)
"
if
str
!=
"99"
{
isYuShou
=
true
}
else
{
isYuShou
=
false
}
let
contentArr
=
[
"预售"
,
"普通"
,
"期货"
,
"团购"
]
let
titles
=
NSMutableArray
()
titles
.
removeAllObjects
()
...
...
@@ -838,7 +830,6 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
else
{
dataDict
=
guiGeArr
.
first
}
vc
.
price
=
dataDict
.
price
vc
.
guiGe
=
dataDict
.
guiGe
vc
.
weight
=
dataDict
.
weight
...
...
@@ -856,6 +847,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
vc
.
delegate
=
self
vc
.
DJBiLi
=
dataDict
.
DJBiLi
vc
.
ysKuCun
=
dataDict
.
ysKuCun
vc
.
isYsJieTiOpen
=
dataDict
.
isYsJieTiOpen
vc
.
selectYuShou
=
dataDict
.
selectYuShou
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
// //MARK: - 删除规格
...
...
@@ -1058,12 +1051,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
override
func
backAction
()
{
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
func
textFieldShouldReturn
(
_
textField
:
UITextField
)
->
Bool
{
IQKeyboardManager
.
shared
.
resignFirstResponder
()
}
func
scrollViewDidScroll
(
_
scrollView
:
UIScrollView
)
{
IQKeyboardManager
.
shared
.
resignFirstResponder
()
}
//MARK:--处理规格数据
var
specifications
=
""
...
...
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift
View file @
d5f44a55
...
...
@@ -35,16 +35,19 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
var
collectView
:
UICollectionView
?
var
datasArr
:
Array
<
GuiGeModel
>
=
[]
var
dataModel
=
GuiGeModel
()
let
titleArray
=
[
"售价:"
,
"规格:"
,
"重量:"
,
"温藏:"
,
"单位:"
]
let
pliceHolderArr
=
[
"请输入商品售价"
,
"请输入商品规格"
,
"请输入商品重量"
,
"请选择商品温藏"
,
"请选择商品单位"
]
@IBOutlet
weak
var
bottomBtn
:
LGButton
!
@IBOutlet
weak
var
listTbv
:
UITableView
!
var
selectIdx
:
IndexPath
?
var
isYuShouSetting
=
false
//打开预售
// var isJieTiJiaSetting = false
var
isJieTiOpen
=
false
//控制阶梯价是否打开
var
isYsJieTiOpen
=
false
//控制预售阶梯是否打开
var
isOpenYSSetting
=
false
//是否打开预售设置
var
selectYuShou
:
Bool
=
false
//是否选择设置预售价格
var
selectYuShou
=
false
//是否选择设置预售价格
//选择页面
var
selectView
:
GLAlertSelectView
?
=
nil
...
...
@@ -180,9 +183,12 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
dataModel
.
weight
=
weight
dataModel
.
wenDu
=
wenDu
dataModel
.
danWei
=
danWei
dataModel
.
isYsJieTiOpen
=
isYsJieTiOpen
dataModel
.
jieTiArr
=
jieTiArr
as!
Array
<
Any
>
dataModel
.
specalArr
=
specalArr
as!
Array
<
Any
>
dataModel
.
yuShouPrice
=
yuShouPrice
print
(
"save == "
,
selectYuShou
)
dataModel
.
selectYuShou
=
selectYuShou
dataModel
.
itemDanWeiSelect
=
itemDanWeiSelect
dataModel
.
tempSelect
=
tempSelect
dataModel
.
isJieTiOpen
=
isJieTiOpen
...
...
@@ -190,10 +196,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
dataModel
.
DJBiLi
=
DJBiLi
dataModel
.
ysKuCun
=
ysKuCun
if
barTitle
?
.
contains
(
"编辑"
)
==
true
{
datasArr
.
insert
(
dataModel
,
at
:
selectIdx
!.
item
)
datasArr
.
remove
(
at
:
selectIdx
!.
item
+
1
)
}
else
{
datasArr
.
append
(
dataModel
)
selectIdx
?
.
item
=
datasArr
.
count
-
1
...
...
@@ -240,9 +244,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
if
section
==
2
{
if
selectYuShou
{
//预售
return
specalArr
.
count
}
else
{
//非预售
return
jieTiArr
.
count
}
...
...
@@ -392,11 +394,14 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
}
if
indexPath
.
section
==
2
{
if
isJieTiOpen
{
if
isJieTiOpen
&&
selectYuShou
==
false
{
return
49
}
else
{
return
0.001
}
if
isYsJieTiOpen
&&
selectYuShou
{
return
49
}
return
0.001
}
return
49
}
...
...
@@ -405,30 +410,30 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
view
=
UIView
()
if
section
==
2
{
//阶梯价设置
if
isYuShouSetting
{
//预售阶梯价
let
view
=
TitleAndSwitchHeaderView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
fullScreenWidth
,
height
:
90
))
view
.
delegate
=
self
print
(
"selectYuShou == "
,
selectYuShou
)
view
.
selectYuShou
=
selectYuShou
view
.
infoSW
.
isOn
=
isJieTiOpen
//普通
view
.
ysInfoSw
.
isOn
=
isYsJieTiOpen
//预售
return
view
}
else
{
//普通
let
view
=
NewCreateHeader
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
fullScreenWidth
,
height
:
49
))
view
.
delegate
=
self
view
.
infoSw
.
isOn
=
isJieTiOpen
if
isJieTiOpen
==
false
{
return
view
}
if
isYuShouSetting
{
//阶梯价
let
view
=
TitleAndSwitchHeaderView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
fullScreenWidth
,
height
:
90
))
view
.
delegate
=
self
view
.
selectYuShou
=
selectYuShou
view
.
infoSW
.
isOn
=
isJieTiOpen
return
view
}
return
view
}
return
view
}
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
if
section
!=
0
{
if
section
==
2
{
if
isYuShouSetting
&&
isJieTiOpen
{
if
isYuShouSetting
{
return
90
}
return
59
...
...
@@ -440,7 +445,12 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
//footer
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
if
section
==
2
{
if
isJieTiOpen
{
if
isJieTiOpen
&&
selectYuShou
==
false
{
let
view
=
NewCreateFooter
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
fullScreenWidth
,
height
:
49
))
view
.
delegate
=
self
return
view
}
if
isYsJieTiOpen
&&
selectYuShou
{
let
view
=
NewCreateFooter
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
fullScreenWidth
,
height
:
49
))
view
.
delegate
=
self
return
view
...
...
@@ -451,7 +461,10 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
if
section
==
2
{
if
isJieTiOpen
{
if
isJieTiOpen
&&
selectYuShou
==
false
{
return
49
}
if
isYsJieTiOpen
&&
selectYuShou
{
return
49
}
}
...
...
@@ -537,8 +550,11 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
func
switchStatus
(
sender
:
UISwitch
)
{
//阶梯价设置
if
sender
.
tag
==
99
{
isYsJieTiOpen
=
sender
.
isOn
}
else
{
isJieTiOpen
=
sender
.
isOn
// isJieTiJiaSetting = sender.isOn
}
listTbv
.
reloadData
()
}
...
...
@@ -583,11 +599,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
func
PuTongJieTiContent
(
price
:
String
,
count
:
String
,
cell
:
PuTongJieTiCell
)
{
if
selectYuShou
{
specalArr
.
insert
(
"
\(
price
)
_
\(
count
)
"
,
at
:
cell
.
tag
)
print
(
specalArr
)
specalArr
.
remove
(
at
:
cell
.
tag
+
1
)
}
else
{
jieTiArr
.
insert
(
"
\(
price
)
_
\(
count
)
"
,
at
:
cell
.
tag
)
print
(
jieTiArr
)
jieTiArr
.
remove
(
at
:
cell
.
tag
+
1
)
}
}
...
...
@@ -638,7 +652,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
isJieTiOpen
=
dataDict
.
isJieTiOpen
isOpenYSSetting
=
dataDict
.
isOpenYSSetting
DJBiLi
=
dataDict
.
DJBiLi
isYsJieTiOpen
=
dataDict
.
isYsJieTiOpen
ysKuCun
=
dataDict
.
ysKuCun
selectYuShou
=
dataDict
.
selectYuShou
listTbv
.
reloadData
()
collectionView
.
reloadData
()
}
...
...
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
View file @
d5f44a55
...
...
@@ -9,6 +9,8 @@
import
Foundation
class
GuiGeModel
:
NSObject
{
///sku_id
var
sku_id
:
Int
?
///售价
var
price
:
String
=
""
///规格
...
...
@@ -39,4 +41,8 @@ class GuiGeModel: NSObject {
var
isJieTiOpen
:
Bool
=
false
///是否打开预售设置
var
isOpenYSSetting
:
Bool
=
false
///是否打开预售阶梯价
var
isYsJieTiOpen
:
Bool
=
false
///是否选择预售阶梯
var
selectYuShou
:
Bool
=
false
}
GeliBusinessPlatform/ViewController/新增规格/普通+预售header/TitleAndSwitchHeaderView.swift
View file @
d5f44a55
...
...
@@ -17,15 +17,17 @@ class TitleAndSwitchHeaderView: UIView {
@IBOutlet
weak
var
bottomLine
:
UIView
!
var
selectYuShou
:
Bool
=
false
{
didSet
{
print
(
"abababababab === "
,
selectYuShou
)
var
sender
=
0
if
selectYuShou
{
sender
=
1
leftBtn
.
setTitleColor
(
UIColor
(
named
:
"标题字颜色"
),
for
:
.
normal
)
rightBtn
.
setTitleColor
(
UIColor
(
named
:
"按钮渐变色下,字体颜色"
),
for
:
.
normal
)
ysSettingView
.
isHidden
=
false
}
else
{
leftBtn
.
setTitleColor
(
UIColor
(
named
:
"按钮渐变色下,字体颜色"
),
for
:
.
normal
)
rightBtn
.
setTitleColor
(
UIColor
(
named
:
"标题字颜色"
),
for
:
.
normal
)
ysSettingView
.
isHidden
=
true
}
let
x
=
CGFloat
(
sender
)
*
fullScreenWidth
*
0.5
bottomLine
.
snp
.
updateConstraints
{
(
make
)
in
...
...
@@ -38,6 +40,8 @@ class TitleAndSwitchHeaderView: UIView {
}
var
contentView
:
UIView
!
var
delegate
:
TitleAndSwitchHeaderViewDelegate
?
@IBOutlet
weak
var
ysSettingView
:
UIView
!
@IBOutlet
weak
var
ysInfoSw
:
UISwitch
!
@IBOutlet
weak
var
infoSW
:
UISwitch
!
//初始化时将xib中的view添加进来
override
init
(
frame
:
CGRect
)
{
...
...
@@ -45,6 +49,14 @@ class TitleAndSwitchHeaderView: UIView {
contentView
=
loadViewFromNib
()
addSubview
(
contentView
)
ysInfoSw
.
transform
=
CGAffineTransform
(
scaleX
:
0.8
,
y
:
0.8
)
ysInfoSw
.
tag
=
99
ysInfoSw
.
addTarget
(
self
,
action
:
#selector(
switchChange(sender:)
)
,
for
:
.
valueChanged
)
contentView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
top
.
right
.
bottom
.
equalToSuperview
()
}
infoSW
.
transform
=
CGAffineTransform
(
scaleX
:
0.8
,
y
:
0.8
)
infoSW
.
addTarget
(
self
,
action
:
#selector(
switchChange(sender:)
)
,
for
:
.
valueChanged
)
contentView
.
snp
.
makeConstraints
{
(
make
)
in
...
...
GeliBusinessPlatform/ViewController/新增规格/普通+预售header/TitleAndSwitchHeaderView.xib
View file @
d5f44a55
...
...
@@ -13,6 +13,8 @@
<outlet
property=
"infoSW"
destination=
"CB7-5d-TkX"
id=
"NR3-4A-D6i"
/>
<outlet
property=
"leftBtn"
destination=
"Foa-mx-5Yx"
id=
"T72-dm-y5o"
/>
<outlet
property=
"rightBtn"
destination=
"ybR-u7-XP4"
id=
"Dk3-d2-gbZ"
/>
<outlet
property=
"ysInfoSw"
destination=
"GMQ-8b-xpg"
id=
"Qqe-Na-SeV"
/>
<outlet
property=
"ysSettingView"
destination=
"II7-GR-59T"
id=
"7M4-1t-9N5"
/>
</connections>
</placeholder>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"-2"
customClass=
"UIResponder"
/>
...
...
@@ -77,12 +79,44 @@
</constraints>
<color
key=
"onTintColor"
name=
"蓝色字体颜色"
/>
</switch>
<view
hidden=
"YES"
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"II7-GR-59T"
>
<rect
key=
"frame"
x=
"0.0"
y=
"10"
width=
"375"
height=
"52"
/>
<subviews>
<switch
opaque=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"750"
verticalHuggingPriority=
"750"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
on=
"YES"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"GMQ-8b-xpg"
>
<rect
key=
"frame"
x=
"311"
y=
"10"
width=
"51"
height=
"31"
/>
<color
key=
"onTintColor"
name=
"蓝色字体颜色"
/>
</switch>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
usesAttributedText=
"YES"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"fzO-2v-R5h"
>
<rect
key=
"frame"
x=
"15"
y=
"15"
width=
"105"
height=
"21"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"21"
id=
"dAn-sg-2eN"
/>
</constraints>
<attributedString
key=
"attributedText"
>
<fragment
content=
"预售阶梯价设置"
>
<attributes>
<color
key=
"NSColor"
name=
"标题字颜色"
/>
<font
key=
"NSFont"
size=
"15"
name=
"PingFangSC-Medium"
/>
</attributes>
</fragment>
</attributedString>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<constraints>
<constraint
firstItem=
"fzO-2v-R5h"
firstAttribute=
"top"
secondItem=
"II7-GR-59T"
secondAttribute=
"top"
constant=
"15"
id=
"Tr9-yg-lIC"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"GMQ-8b-xpg"
secondAttribute=
"trailing"
constant=
"15"
id=
"ZH7-e5-ZP3"
/>
<constraint
firstItem=
"GMQ-8b-xpg"
firstAttribute=
"centerY"
secondItem=
"fzO-2v-R5h"
secondAttribute=
"centerY"
id=
"ipq-Mm-XOP"
/>
<constraint
firstItem=
"fzO-2v-R5h"
firstAttribute=
"leading"
secondItem=
"II7-GR-59T"
secondAttribute=
"leading"
constant=
"15"
id=
"ytg-81-7V9"
/>
</constraints>
</view>
</subviews>
<color
key=
"backgroundColor"
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<constraints>
<constraint
firstItem=
"76R-R0-pCI"
firstAttribute=
"top"
secondItem=
"iN0-l3-epB"
secondAttribute=
"top"
id=
"4o5-ak-hVE"
/>
<constraint
firstItem=
"FFu-OD-rc8"
firstAttribute=
"top"
secondItem=
"76R-R0-pCI"
secondAttribute=
"bottom"
constant=
"15"
id=
"HvO-2g-yPj"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"FFu-OD-rc8"
secondAttribute=
"trailing"
id=
"JhF-wO-qGP"
/>
<constraint
firstItem=
"Foa-mx-5Yx"
firstAttribute=
"top"
secondItem=
"II7-GR-59T"
secondAttribute=
"bottom"
id=
"KFe-TD-fPY"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"Foa-mx-5Yx"
secondAttribute=
"bottom"
id=
"LS2-nW-eWp"
/>
<constraint
firstItem=
"76R-R0-pCI"
firstAttribute=
"leading"
secondItem=
"iN0-l3-epB"
secondAttribute=
"leading"
id=
"LrY-UI-RcR"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"ybR-u7-XP4"
secondAttribute=
"trailing"
id=
"NLC-no-i4E"
/>
...
...
@@ -91,12 +125,15 @@
<constraint
firstItem=
"ybR-u7-XP4"
firstAttribute=
"leading"
secondItem=
"Foa-mx-5Yx"
secondAttribute=
"trailing"
id=
"S3X-IS-ztd"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"76R-R0-pCI"
secondAttribute=
"trailing"
id=
"Uth-qd-FUC"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"iUg-fe-DMN"
secondAttribute=
"bottom"
id=
"UyW-VQ-lzx"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"II7-GR-59T"
secondAttribute=
"trailing"
id=
"Wsj-kO-7V7"
/>
<constraint
firstItem=
"ybR-u7-XP4"
firstAttribute=
"height"
secondItem=
"Foa-mx-5Yx"
secondAttribute=
"height"
id=
"X7T-nQ-A6m"
/>
<constraint
firstItem=
"CB7-5d-TkX"
firstAttribute=
"centerY"
secondItem=
"FFu-OD-rc8"
secondAttribute=
"centerY"
id=
"e18-MP-pNs"
/>
<constraint
firstItem=
"II7-GR-59T"
firstAttribute=
"top"
secondItem=
"iN0-l3-epB"
secondAttribute=
"top"
constant=
"10"
id=
"eQr-UG-t4i"
/>
<constraint
firstItem=
"FFu-OD-rc8"
firstAttribute=
"leading"
secondItem=
"iN0-l3-epB"
secondAttribute=
"leading"
constant=
"15"
id=
"kCT-vS-1St"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"CB7-5d-TkX"
secondAttribute=
"trailing"
constant=
"15"
id=
"ktE-YY-c70"
/>
<constraint
firstItem=
"Foa-mx-5Yx"
firstAttribute=
"leading"
secondItem=
"iN0-l3-epB"
secondAttribute=
"leading"
id=
"lve-Dd-EFp"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"ybR-u7-XP4"
secondAttribute=
"bottom"
id=
"ras-iE-35P"
/>
<constraint
firstItem=
"II7-GR-59T"
firstAttribute=
"leading"
secondItem=
"iN0-l3-epB"
secondAttribute=
"leading"
id=
"sgG-cQ-N2v"
/>
<constraint
firstItem=
"iUg-fe-DMN"
firstAttribute=
"leading"
secondItem=
"iN0-l3-epB"
secondAttribute=
"leading"
id=
"u3M-i0-jPq"
/>
</constraints>
<freeformSimulatedSizeMetrics
key=
"simulatedDestinationMetrics"
/>
...
...
@@ -113,6 +150,9 @@
<namedColor
name=
"标题字颜色"
>
<color
red=
"0.1803921568627451"
green=
"0.1803921568627451"
blue=
"0.1803921568627451"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<namedColor
name=
"标题字颜色"
>
<color
red=
"0.18000000715255737"
green=
"0.18000000715255737"
blue=
"0.18000000715255737"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<namedColor
name=
"灰色字体颜色"
>
<color
red=
"0.40000000000000002"
green=
"0.40000000000000002"
blue=
"0.40000000000000002"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
...
...
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