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
ed648c5e
Commit
ed648c5e
authored
May 09, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加上下架操作
parent
882284fd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
1 deletion
+49
-1
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/View/CollectionCell/GoodsCollectionViewCell.swift
...latform/View/CollectionCell/GoodsCollectionViewCell.swift
+9
-0
GeliBusinessPlatform/ViewController/商品管理/GoodsManageListVC.swift
...inessPlatform/ViewController/商品管理/GoodsManageListVC.swift
+40
-1
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
ed648c5e
No preview for this file type
GeliBusinessPlatform/View/CollectionCell/GoodsCollectionViewCell.swift
View file @
ed648c5e
...
@@ -8,9 +8,15 @@
...
@@ -8,9 +8,15 @@
import
UIKit
import
UIKit
import
LGButton
import
LGButton
protocol
GoodsCollectionViewCellDelegate
{
func
selectListsIndex
(
index
:
Int
)
func
changeGoodsIsShow
(
isTrue
:
Bool
,
byIndex
:
Int
)
}
class
GoodsCollectionViewCell
:
UICollectionViewCell
{
class
GoodsCollectionViewCell
:
UICollectionViewCell
{
var
delegate
:
GoodsCollectionViewCellDelegate
?
@IBOutlet
weak
var
goodsImgV
:
UIImageView
!
@IBOutlet
weak
var
goodsImgV
:
UIImageView
!
@IBOutlet
weak
var
codeBtn
:
UIButton
!
@IBOutlet
weak
var
codeBtn
:
UIButton
!
@IBOutlet
weak
var
rightBtn
:
UIButton
!
@IBOutlet
weak
var
rightBtn
:
UIButton
!
...
@@ -26,14 +32,17 @@ class GoodsCollectionViewCell: UICollectionViewCell {
...
@@ -26,14 +32,17 @@ class GoodsCollectionViewCell: UICollectionViewCell {
@IBAction
func
lgBtnAction
(
_
sender
:
LGButton
)
{
@IBAction
func
lgBtnAction
(
_
sender
:
LGButton
)
{
print
(
"点击图片背景==
\(
sender
.
tag
)
"
)
print
(
"点击图片背景==
\(
sender
.
tag
)
"
)
self
.
delegate
?
.
selectListsIndex
(
index
:
sender
.
tag
)
}
}
@IBAction
func
leftAction
(
_
sender
:
UIButton
)
{
@IBAction
func
leftAction
(
_
sender
:
UIButton
)
{
print
(
"点击左边按钮
\(
sender
.
tag
)
"
)
print
(
"点击左边按钮
\(
sender
.
tag
)
"
)
self
.
delegate
?
.
changeGoodsIsShow
(
isTrue
:
false
,
byIndex
:
sender
.
tag
)
}
}
@IBAction
func
rightAction
(
_
sender
:
UIButton
)
{
@IBAction
func
rightAction
(
_
sender
:
UIButton
)
{
print
(
"点击右边按钮
\(
sender
.
tag
)
"
)
print
(
"点击右边按钮
\(
sender
.
tag
)
"
)
self
.
delegate
?
.
changeGoodsIsShow
(
isTrue
:
true
,
byIndex
:
sender
.
tag
)
}
}
@IBAction
func
codeAction
(
_
sender
:
UIButton
)
{
@IBAction
func
codeAction
(
_
sender
:
UIButton
)
{
...
...
GeliBusinessPlatform/ViewController/商品管理/GoodsManageListVC.swift
View file @
ed648c5e
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
import
UIKit
import
UIKit
import
ViewAnimator
import
ViewAnimator
class
GoodsManageListVC
:
BaseViewController
,
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UICollectionViewDelegateFlowLayout
,
HeaderSelectViewDelegate
,
SelectContentViewDelegate
,
UISearchBarDelegate
,
SearchBarViewDelegate
{
class
GoodsManageListVC
:
BaseViewController
,
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UICollectionViewDelegateFlowLayout
,
HeaderSelectViewDelegate
,
SelectContentViewDelegate
,
UISearchBarDelegate
,
SearchBarViewDelegate
,
GoodsCollectionViewCellDelegate
{
var
collection
:
UICollectionView
?
=
nil
var
collection
:
UICollectionView
?
=
nil
var
layout
=
UICollectionViewFlowLayout
()
var
layout
=
UICollectionViewFlowLayout
()
...
@@ -367,6 +367,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
...
@@ -367,6 +367,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
"GoodsCollectionViewCell"
,
for
:
indexPath
)
as!
GoodsCollectionViewCell
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
"GoodsCollectionViewCell"
,
for
:
indexPath
)
as!
GoodsCollectionViewCell
let
rowModel
=
self
.
items
[
indexPath
.
row
]
let
rowModel
=
self
.
items
[
indexPath
.
row
]
cell
.
delegate
=
self
cell
.
goodsName
.
text
=
rowModel
.
goods_name
cell
.
goodsName
.
text
=
rowModel
.
goods_name
cell
.
priceLbl
.
text
=
"¥"
+
rowModel
.
price
!
cell
.
priceLbl
.
text
=
"¥"
+
rowModel
.
price
!
// cell.goodsImgV.kf.setImage(with: URL.init(string:SERVERCE_HOST + rowModel.goods_thumb!)!, placeholder: nil, options: nil, progressBlock: nil, completionHandler: nil)
// cell.goodsImgV.kf.setImage(with: URL.init(string:SERVERCE_HOST + rowModel.goods_thumb!)!, placeholder: nil, options: nil, progressBlock: nil, completionHandler: nil)
...
@@ -401,6 +402,44 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
...
@@ -401,6 +402,44 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
}
}
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
print
(
"选中===
\(
indexPath
)
"
)
print
(
"选中===
\(
indexPath
)
"
)
let
vc
=
ProductDetailViewController
()
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
//MARK:---cell delegate 选中
func
selectListsIndex
(
index
:
Int
)
{
let
vc
=
ProductDetailViewController
()
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
//MARK:-- cell delegate 上下架,入库
func
changeGoodsIsShow
(
isTrue
:
Bool
,
byIndex
:
Int
)
{
//左按钮为false 右按钮为true
let
rowModel
=
self
.
items
[
byIndex
]
if
rowModel
.
is_show
==
0
{
if
isTrue
{
//"下架"
editField
([
"user_token"
:
""
,
"function_id"
:
"15"
,
"prval"
:
"goods_id"
,
"value"
:
"0"
,],
success
:
{
(
data
)
in
self
.
loadData
()
})
{
(
erro
)
in
}
}
else
{
//"入库"
}
}
else
if
rowModel
.
is_show
==
1
{
if
isTrue
{
//"入库"
}
else
{
//"上架"
editField
([
"user_token"
:
""
,
"function_id"
:
"15"
,
"prval"
:
rowModel
.
goods_id
,
"value"
:
"1"
,],
success
:
{
(
data
)
in
self
.
loadData
()
})
{
(
erro
)
in
}
}
}
}
func
upDataByGoodsId
(
goodsId
:
String
)
{
}
}
}
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