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
d7a7aff6
Commit
d7a7aff6
authored
May 11, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正新增商品页面数据-并开始做商品分类数据交互
parent
15fb54d9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
24 deletions
+37
-24
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Model/GeneralInfoModel.swift
GeliBusinessPlatform/Model/GeneralInfoModel.swift
+1
-1
GeliBusinessPlatform/SceneDelegate.swift
GeliBusinessPlatform/SceneDelegate.swift
+1
-1
GeliBusinessPlatform/ViewController/商品分类/GoodsClassViewController.swift
...atform/ViewController/商品分类/GoodsClassViewController.swift
+4
-0
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
...orm/ViewController/商品详情/ProductDetailViewController.swift
+31
-22
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
d7a7aff6
No preview for this file type
GeliBusinessPlatform/Model/GeneralInfoModel.swift
View file @
d7a7aff6
...
@@ -12,7 +12,7 @@ import ObjectMapper
...
@@ -12,7 +12,7 @@ import ObjectMapper
class
GeneralInfoModel
:
Mappable
{
class
GeneralInfoModel
:
Mappable
{
var
code
:
Int
?
var
code
:
Int
?
var
message
:
String
?
var
message
:
String
?
var
data
:
G
oodsList
DataModel
?
var
data
:
G
eneral
DataModel
?
required
init
?(
map
:
Map
)
{
required
init
?(
map
:
Map
)
{
...
...
GeliBusinessPlatform/SceneDelegate.swift
View file @
d7a7aff6
...
@@ -88,7 +88,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
...
@@ -88,7 +88,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
// Create the SwiftUI view that provides the window contents.
// Create the SwiftUI view that provides the window contents.
tabBarController
.
viewControllers
=
[
v1
,
v2
,
v3
,
v4
,
v5
]
tabBarController
.
viewControllers
=
[
v1
,
v2
,
v3
,
v4
,
v5
]
tabBarController
.
selectedIndex
=
2
tabBarController
.
selectedIndex
=
1
let
contentView
=
tabBarController
let
contentView
=
tabBarController
if
let
windowScene
=
sceneC
as?
UIWindowScene
{
if
let
windowScene
=
sceneC
as?
UIWindowScene
{
...
...
GeliBusinessPlatform/ViewController/商品分类/GoodsClassViewController.swift
View file @
d7a7aff6
...
@@ -10,11 +10,15 @@ import UIKit
...
@@ -10,11 +10,15 @@ import UIKit
import
Dollar
import
Dollar
class
GoodsClassViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
{
class
GoodsClassViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
{
var
dataModelArray
:
Array
<
GeneralInfoCatsModel
>
?
=
[]
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
navbar
.
title
=
"请选择商品分类"
navbar
.
title
=
"请选择商品分类"
print
(
"商品分类数据==
\(
dataModelArray
)
"
)
self
.
view
.
addSubview
(
navbar
)
self
.
view
.
addSubview
(
navbar
)
for
i
in
0
..<
5
{
for
i
in
0
..<
5
{
let
model_1
=
GoodsClassModel
()
let
model_1
=
GoodsClassModel
()
model_1
.
name
=
"第一级商品=
\(
i
)
"
model_1
.
name
=
"第一级商品=
\(
i
)
"
...
...
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
View file @
d7a7aff6
...
@@ -14,10 +14,17 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -14,10 +14,17 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
var
glSelectView
:
GLAlertSelectView
?
var
glSelectView
:
GLAlertSelectView
?
let
titleArr
=
[
"商品信息"
,
"商品图片"
,
"商品规格"
,
"预售设置"
,
"其它信息"
,
"商品详情"
]
let
titleArr
=
[
"商品信息"
,
"商品图片"
,
"商品规格"
,
"预售设置"
,
"其它信息"
,
"商品详情"
]
let
spxxArr
=
[
"商品名称"
,
"商品类型"
,
"商品分类"
,
"品牌"
,
"起卖数量"
,
"是否清真"
,
"是否询价"
]
let
spxxArr
=
[
"商品名称"
,
"商品类型"
,
"商品分类"
,
"品牌"
,
"起卖数量"
,
"是否清真"
,
"是否询价"
]
let
tishixxArr
=
[
"请输入商品名称"
,
"请选择商品类型"
,
"请选择商品分类"
,
"请选择品牌"
,
"请输入起卖数量"
]
let
tishixxArr1
=
[
"请输入关键字"
,
"请输入物流费用"
,
"请选择国家"
,
"请选择商品状态"
,
"请选择运输方式"
]
let
sptpArr
=
[
"商品封面图(限一张)"
,
"商品主图(限五张)"
]
let
sptpArr
=
[
"商品封面图(限一张)"
,
"商品主图(限五张)"
]
let
qtxxArr
=
[
"关键字"
,
"物流费用"
,
"国家"
,
"商品状态"
,
"运输方式"
]
let
qtxxArr
=
[
"关键字"
,
"物流费用"
,
"国家"
,
"商品状态"
,
"运输方式"
]
let
ysszArr
=
[
"用户付款是否需要审核"
,
"预设预付定金时间段"
,
"预设预付尾款时间段"
,
"预设预付尾款发货时间"
]
let
ysszArr
=
[
"用户付款是否需要审核"
,
"预设预付定金时间段"
,
"预设预付尾款时间段"
,
"预设预付尾款发货时间"
]
//MARK:--保存按钮
@IBAction
func
submitAction
(
_
sender
:
Any
)
{
@IBAction
func
submitAction
(
_
sender
:
Any
)
{
print
(
"保存按钮submitAction"
)
}
}
@IBOutlet
weak
var
submitBtn
:
LGButton
!
@IBOutlet
weak
var
submitBtn
:
LGButton
!
@IBOutlet
weak
var
listTbv
:
UITableView
!
@IBOutlet
weak
var
listTbv
:
UITableView
!
...
@@ -35,28 +42,20 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -35,28 +42,20 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
@objc
func
bottomBtnClick
(
sender
:
UIButton
){
@objc
func
bottomBtnClick
(
sender
:
UIButton
){
print
(
sender
.
titleLabel
?
.
text
)
print
(
sender
.
titleLabel
?
.
text
)
}
}
var
generalInfoModel
:
GeneralInfoModel
?
=
nil
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
//MARK:--获取新增商品的基本信息(品牌和分类等)
HUD
.
flash
(
.
progress
)
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
})
{
(
error
)
in
}
isYuShouShangPin
=
true
isYuShouShangPin
=
true
// if 浏览状态 {
let
w
=
fullScreenWidth
/
CGFloat
(
btmTitleArr
.
count
)
lgBtnLbl
.
isHidden
=
true
submitBtn
.
isHidden
=
true
for
i
in
0
..<
btmTitleArr
.
count
{
let
btn
=
UIButton
(
frame
:
CGRect
(
x
:
CGFloat
(
i
)
*
w
,
y
:
0
,
width
:
w
,
height
:
btmView
.
bounds
.
size
.
height
))
btn
.
tag
=
i
btn
.
setTitle
(
btmTitleArr
[
i
],
for
:
.
normal
)
btn
.
titleLabel
?
.
textColor
=
UIColor
.
clear
btn
.
addTarget
(
self
,
action
:
#selector(
bottomBtnClick(sender:)
)
,
for
:
.
touchUpInside
)
let
lbl
=
UILabel
(
frame
:
CGRect
(
x
:
CGFloat
(
i
)
*
w
,
y
:
0
,
width
:
w
,
height
:
49*
glscale
))
lbl
.
textAlignment
=
.
center
lbl
.
text
=
btmTitleArr
[
i
]
lbl
.
font
=
UIFont
.
systemFont
(
ofSize
:
13
)
lbl
.
textColor
=
UIColor
(
named
:
"蓝色字体颜色"
)
btmView
.
addSubview
(
btn
)
btmView
.
addSubview
(
lbl
)
}
// }
navbar
.
title
=
"商品详情"
navbar
.
title
=
"商品详情"
self
.
view
.
addSubview
(
navbar
)
self
.
view
.
addSubview
(
navbar
)
...
@@ -97,6 +96,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -97,6 +96,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
if
indexPath
.
row
==
0
||
indexPath
.
row
==
4
{
if
indexPath
.
row
==
0
||
indexPath
.
row
==
4
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndTF"
)
as!
TitleAndTFCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndTF"
)
as!
TitleAndTFCell
cell
.
nameLbl
.
text
=
spxxArr
[
indexPath
.
row
]
cell
.
nameLbl
.
text
=
spxxArr
[
indexPath
.
row
]
cell
.
textTF
.
placeholder
=
tishixxArr
[
indexPath
.
row
]
return
cell
return
cell
}
}
if
indexPath
.
row
>
4
{
if
indexPath
.
row
>
4
{
...
@@ -106,6 +106,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -106,6 +106,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndBtn"
)
as!
TitleAndBtnCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndBtn"
)
as!
TitleAndBtnCell
cell
.
nameLbl
.
text
=
spxxArr
[
indexPath
.
row
]
cell
.
nameLbl
.
text
=
spxxArr
[
indexPath
.
row
]
cell
.
contentLbl
.
text
=
tishixxArr
[
indexPath
.
row
]
cell
.
delegate
=
self
cell
.
delegate
=
self
return
cell
return
cell
case
1
:
case
1
:
...
@@ -139,10 +141,14 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -139,10 +141,14 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
if
indexPath
.
row
<
2
{
if
indexPath
.
row
<
2
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndTF"
)
as!
TitleAndTFCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndTF"
)
as!
TitleAndTFCell
cell
.
nameLbl
.
text
=
qtxxArr
[
indexPath
.
row
]
cell
.
nameLbl
.
text
=
qtxxArr
[
indexPath
.
row
]
cell
.
textTF
.
placeholder
=
tishixxArr1
[
indexPath
.
row
]
return
cell
return
cell
}
else
{
}
else
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndBtn"
)
as!
TitleAndBtnCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndBtn"
)
as!
TitleAndBtnCell
cell
.
nameLbl
.
text
=
qtxxArr
[
indexPath
.
row
]
cell
.
nameLbl
.
text
=
qtxxArr
[
indexPath
.
row
]
cell
.
contentLbl
.
text
=
tishixxArr1
[
indexPath
.
row
]
cell
.
delegate
=
self
cell
.
delegate
=
self
return
cell
return
cell
}
}
...
@@ -249,16 +255,17 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -249,16 +255,17 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
listTbv
.
endUpdates
()
listTbv
.
endUpdates
()
}
}
func
CommendCellSendStr
(
content
:
String
)
{
func
CommendCellSendStr
(
content
:
String
)
{
print
(
"CommendCellSendStr"
)
}
}
override
func
backAction
()
{
override
func
backAction
()
{
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
//MARK: -- 选择填或跳转
func
btnClick
(
content
:
String
,
cell
:
TitleAndBtnCell
)
{
if
cell
.
nameLbl
.
text
==
"商品类型"
{
func
btnClick
(
content
:
String
,
cell
:
TitleAndBtnCell
)
{
if
cell
.
nameLbl
.
text
==
"商品类型"
{
if
glSelectView
==
nil
{
if
glSelectView
==
nil
{
let
view
=
GLAlertSelectView
(
frame
:
self
.
view
.
bounds
)
let
view
=
GLAlertSelectView
(
frame
:
self
.
view
.
bounds
)
view
.
isMultipleSelect
=
true
view
.
isMultipleSelect
=
true
view
.
titleLbl
.
text
=
"请选择
仓库
类型"
view
.
titleLbl
.
text
=
"请选择
商品
类型"
view
.
delegate
=
self
view
.
delegate
=
self
view
.
dataArr
=
[
"预售"
,
"普通"
,
"期货"
,
"团购"
]
view
.
dataArr
=
[
"预售"
,
"普通"
,
"期货"
,
"团购"
]
self
.
view
.
addSubview
(
view
)
self
.
view
.
addSubview
(
view
)
...
@@ -266,7 +273,9 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
...
@@ -266,7 +273,9 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
}
}
}
if
cell
.
nameLbl
.
text
==
"商品分类"
{
if
cell
.
nameLbl
.
text
==
"商品分类"
{
let
vc
=
GoodsClassViewController
()
vc
.
dataModelArray
=
generalInfoModel
?
.
data
?
.
cats
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
if
cell
.
nameLbl
.
text
==
"品牌"
{
if
cell
.
nameLbl
.
text
==
"品牌"
{
...
...
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