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
6ea18577
Commit
6ea18577
authored
May 26, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改商品编辑跳转和提交信息
parent
b7a206bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
213 additions
and
199 deletions
+213
-199
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/SceneDelegate.swift
GeliBusinessPlatform/SceneDelegate.swift
+1
-1
GeliBusinessPlatform/ViewController/商品详情/EPViewController.swift
...sinessPlatform/ViewController/商品详情/EPViewController.swift
+212
-198
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
6ea18577
No preview for this file type
GeliBusinessPlatform/SceneDelegate.swift
View file @
6ea18577
...
...
@@ -95,7 +95,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
tabBarController
.
viewControllers
=
[
v1
,
v2
,
v3
,
v4
,
v5
]
// tabBarController.selectedIndex = 2
tabBarController
.
selectedIndex
=
1
...
...
GeliBusinessPlatform/ViewController/商品详情/EPViewController.swift
View file @
6ea18577
...
...
@@ -14,7 +14,7 @@ import Dollar
class
EPViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
TitleAndBtnCellDelegate
,
GLAlertSelectViewDelegate
,
GoodsClassViewControllerDelegate
,
PinPaiListViewControllerDelegate
,
AddImgCellDelegate
,
AddGuiGeCellDelegate
,
CreatNewSpecsViewControllerDelegate
,
ShangPinGguiGeCellDelegate
,
UICollectionViewDelegate
,
UICollectionViewDataSource
,
UICollectionViewDelegateFlowLayout
,
TitleAndSwitchCellDelegate
,
TitleAndTFCellDelegate
,
YuShouWeiKuanFaHuoCellDelegate
,
UITextFieldDelegate
,
ShowTimeSelectViewDelegate
,
LMNoteViewControllerDelegate
{
@IBOutlet
weak
var
btmBtnViewH
:
NSLayoutConstraint
!
...
...
@@ -273,7 +273,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
"coun_id"
:
"1"
,
//国家id 1(中国)
"gs_id"
:
gs_id
as
Any
,
//商品状态
"transportation"
:
transportation
as
Any
,
//运输方式,1冷链,2常温,3热链
"goods_desc"
:
""
,
//商品详情 html p标签
"goods_desc"
:
goodsDesc
,
//商品详情 html p标签
"specifications"
:
specifications
as
Any
,
//默认规格,选sku中最低价格(需判定阶梯价)的 规格值
"shop_price"
:
shop_price
as
Any
,
//默认售价,选sku中最低价格(需判定阶梯价)的价格
"goods_unit"
:
goods_unit
as
Any
,
//默认商品单位,选sku中最低价格(需判定阶梯价)的单位
...
...
@@ -294,17 +294,17 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
break
case
"入库"
:
let
vc
=
RuKuViewController
()
vc
.
barTitle
=
"入库"
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
vc
.
barTitle
=
"入库"
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
case
"出库"
:
let
vc
=
ChuKuViewController
()
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
break
case
"上架"
:
//提示是否上架
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
editField
([
"user_token"
:
UserToken
as
Any
,
"function_id"
:
"15"
,
"prval"
:
goods_id
as
Any
,
"value"
:
1
,],
success
:
{
(
data
)
in
let
dataM
=
data
as!
UpDataModel
if
dataM
.
code
==
1
{
...
...
@@ -317,14 +317,14 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
break
case
"下架"
:
//提示是否下架
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
editField
([
"user_token"
:
UserToken
as
Any
,
"function_id"
:
"15"
,
"prval"
:
goods_id
as
Any
,
"value"
:
0
,],
success
:
{
(
data
)
in
let
dataM
=
data
as!
UpDataModel
if
dataM
.
code
==
1
{
HUD
.
flash
(
.
label
(
"提交成功"
),
delay
:
1.2
)
self
.
loadData
()
}
})
{
(
erro
)
in
...
...
@@ -338,7 +338,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
if
dataM
.
code
==
1
{
HUD
.
flash
(
.
label
(
"删除成功"
),
delay
:
1.2
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
})
{
(
erro
)
in
}
...
...
@@ -348,186 +348,186 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
}
}
func
loadData
()
{
//MARK:--新增商品和编辑商品所需要的基本信息(无)就页面不正常显示
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
goodsDetail
([
"user_token"
:
UserToken
,
"goods_id"
:
goods_id
],
success
:
{
(
data
)
in
//MARK: - 获取详情
let
model
=
data
as!
GoodsDetailModel
self
.
goodsDetailModel
=
model
//商品名
self
.
itemName
=
(
model
.
data
?
.
goods_res
!.
goods_name
)
!
//默认单位
self
.
goods_unit
=
(
model
.
data
?
.
goods_res
!.
goods_unit
)
!
//商品类型
if
model
.
data
?
.
goods_res
!.
is_adsale
==
0
{
self
.
itemTypeArr
=
[
99
,
99
,
99
,
99
]
}
else
{
self
.
itemTypeArr
=
[
0
,
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
)
//商品分类
self
.
selectGoodsClassModel
.
cat_id
=
model
.
data
?
.
goods_res
?
.
cat_id
self
.
tishixxArr
.
insert
((
model
.
data
?
.
goods_res
!.
cat_name
)
!
,
at
:
2
)
self
.
tishixxArr
.
remove
(
at
:
3
)
//品牌名
self
.
pinPai_id
=
(
model
.
data
?
.
goods_res
!.
brand_id
)
!
self
.
pinPai
=
(
model
.
data
?
.
goods_res
!.
brand_name
)
!
self
.
tishixxArr
.
insert
(
self
.
pinPai
,
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
.
specifications
=
(
model
.
data
?
.
goods_res
!.
specifications
)
!
//是否询价
self
.
shiFouXJ
=
true
if
model
.
data
?
.
goods_res
!.
is_inquiry
==
0
{
self
.
shiFouXJ
=
false
}
//是否有封面图
self
.
singleImgArr
=
[
(
model
.
data
?
.
goods_res
!.
original_img
)
!
]
//单张图
self
.
original_img
=
(
model
.
data
?
.
goods_res
!.
original_img
)
!
//商品规格
if
(
model
.
data
?
.
sku_res
?
.
count
)
!
>
0
{
self
.
guiGeArr
.
removeAll
()
for
item
in
model
.
data
!.
sku_res
!
{
let
dataSource
=
item
let
data
=
GuiGeModel
()
data
.
price
=
dataSource
.
price
!//
价格
data
.
danWei
=
dataSource
.
unit
!//
单位
data
.
sku_id
=
dataSource
.
sku_id
!//
sku_id
let
arr
=
dataSource
.
spec_str
?
.
components
(
separatedBy
:
":"
)
data
.
guiGe
=
(
arr
?
.
last
)
!//
规格
let
dict
=
getDictionaryFromJSONString
(
jsonString
:
dataSource
.
pack_attr
!
)
data
.
weight
=
dict
[
"wg"
]
as!
String
//重量
data
.
wenDu
=
dataSource
.
refrigerate
!//
温藏
//预售设置
data
.
isOpenYSSetting
=
false
if
dataSource
.
is_open_adsale
!
==
1
{
data
.
isOpenYSSetting
=
true
}
//普通阶梯价是否打开
data
.
isJieTiOpen
=
false
if
dataSource
.
is_tiered
==
1
{
data
.
isJieTiOpen
=
true
data
.
selectYuShou
=
false
}
//预售阶梯价是否打开
data
.
isYsJieTiOpen
=
false
if
dataSource
.
is_adsale_tiered
==
1
{
data
.
selectYuShou
=
true
data
.
isYsJieTiOpen
=
true
}
//预售价格
data
.
yuShouPrice
=
dataSource
.
adsale_pri
!
//预售库存
if
dataSource
.
adsale_inventory
!=
nil
{
data
.
ysKuCun
=
dataSource
.
adsale_inventory
!
}
//百分比
if
dataSource
.
pct
!=
nil
{
data
.
DJBiLi
=
dataSource
.
pct
!
}
//阶梯价
if
dataSource
.
tiered_pri
!.
count
>
0
{
data
.
jieTiArr
=
self
.
getResponseArr
(
str
:
dataSource
.
tiered_pri
!
)
}
//预售阶梯价
if
dataSource
.
adsale_tiered_pri
!.
count
>
0
{
data
.
specalArr
=
self
.
getResponseArr
(
str
:
dataSource
.
adsale_tiered_pri
!
)
}
self
.
guiGeArr
.
append
(
data
)
}
//MARK:--新增商品和编辑商品所需要的基本信息(无)就页面不正常显示
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
goodsDetail
([
"user_token"
:
UserToken
,
"goods_id"
:
goods_id
],
success
:
{
(
data
)
in
//MARK: - 获取详情
let
model
=
data
as!
GoodsDetailModel
self
.
goodsDetailModel
=
model
//商品名
self
.
itemName
=
(
model
.
data
?
.
goods_res
!.
goods_name
)
!
//默认单位
self
.
goods_unit
=
(
model
.
data
?
.
goods_res
!.
goods_unit
)
!
//商品类型
if
model
.
data
?
.
goods_res
!.
is_adsale
==
0
{
self
.
itemTypeArr
=
[
99
,
99
,
99
,
99
]
}
else
{
self
.
itemTypeArr
=
[
0
,
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
)
//商品分类
self
.
selectGoodsClassModel
.
cat_id
=
model
.
data
?
.
goods_res
?
.
cat_id
self
.
tishixxArr
.
insert
((
model
.
data
?
.
goods_res
!.
cat_name
)
!
,
at
:
2
)
self
.
tishixxArr
.
remove
(
at
:
3
)
//品牌名
self
.
pinPai_id
=
(
model
.
data
?
.
goods_res
!.
brand_id
)
!
self
.
pinPai
=
(
model
.
data
?
.
goods_res
!.
brand_name
)
!
self
.
tishixxArr
.
insert
(
self
.
pinPai
,
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
.
specifications
=
(
model
.
data
?
.
goods_res
!.
specifications
)
!
//是否询价
self
.
shiFouXJ
=
true
if
model
.
data
?
.
goods_res
!.
is_inquiry
==
0
{
self
.
shiFouXJ
=
false
}
//是否有封面图
self
.
singleImgArr
=
[
(
model
.
data
?
.
goods_res
!.
original_img
)
!
]
//单张图
self
.
original_img
=
(
model
.
data
?
.
goods_res
!.
original_img
)
!
//商品规格
if
(
model
.
data
?
.
sku_res
?
.
count
)
!
>
0
{
self
.
guiGeArr
.
removeAll
()
for
item
in
model
.
data
!.
sku_res
!
{
let
dataSource
=
item
let
data
=
GuiGeModel
()
data
.
price
=
dataSource
.
price
!//
价格
data
.
danWei
=
dataSource
.
unit
!//
单位
data
.
sku_id
=
dataSource
.
sku_id
!//
sku_id
let
arr
=
dataSource
.
spec_str
?
.
components
(
separatedBy
:
":"
)
data
.
guiGe
=
(
arr
?
.
last
)
!//
规格
let
dict
=
getDictionaryFromJSONString
(
jsonString
:
dataSource
.
pack_attr
!
)
data
.
weight
=
dict
[
"wg"
]
as!
String
//重量
data
.
wenDu
=
dataSource
.
refrigerate
!//
温藏
//预售设置
data
.
isOpenYSSetting
=
false
if
dataSource
.
is_open_adsale
!
==
1
{
data
.
isOpenYSSetting
=
true
}
//是否审核
self
.
shiFouSH
=
false
if
model
.
data
?
.
goods_res
?
.
need_check
==
1
{
self
.
shiFouSH
=
true
//普通阶梯价是否打开
data
.
isJieTiOpen
=
false
if
dataSource
.
is_tiered
==
1
{
data
.
isJieTiOpen
=
true
data
.
selectYuShou
=
false
}
//预设预付定金时间段
// print("abcl === ",model.data?.goods_res!.dj_time_start!)
if
model
.
data
?
.
goods_res
!.
dj_time_start
!=
0
{
let
begin
=
dayByDouble
(
sender
:
(
model
.
data
?
.
goods_res
!.
dj_time_start
)
!
)
+
"-"
+
dayByDouble
(
sender
:
(
model
.
data
?
.
goods_res
!.
dj_time_end
)
!
)
self
.
dj_time_start
=
(
model
.
data
?
.
goods_res
!.
dj_time_start
)
self
.
dj_time_end
=
(
model
.
data
?
.
goods_res
!.
dj_time_end
)
self
.
ysszHolder
.
insert
(
begin
,
at
:
1
)
self
.
ysszHolder
.
remove
(
at
:
2
)
//预售阶梯价是否打开
data
.
isYsJieTiOpen
=
false
if
dataSource
.
is_adsale_tiered
==
1
{
data
.
selectYuShou
=
true
data
.
isYsJieTiOpen
=
true
}
//预设预付尾款时间段
if
model
.
data
?
.
goods_res
!.
wk_time_start
!=
0
{
let
end
=
dayByDouble
(
sender
:
(
model
.
data
?
.
goods_res
!.
wk_time_start
)
!
)
+
"-"
+
dayByDouble
(
sender
:
(
model
.
data
?
.
goods_res
!.
wk_time_end
)
!
)
self
.
wk_time_start
=
(
model
.
data
?
.
goods_res
!.
wk_time_start
)
self
.
wk_time_end
=
(
model
.
data
?
.
goods_res
!.
wk_time_end
)
self
.
ysszHolder
.
insert
(
end
,
at
:
2
)
self
.
ysszHolder
.
remove
(
at
:
3
)
//预售价格
data
.
yuShouPrice
=
dataSource
.
adsale_pri
!
//预售库存
if
dataSource
.
adsale_inventory
!=
nil
{
data
.
ysKuCun
=
dataSource
.
adsale_inventory
!
}
//
发货时间
if
model
.
data
?
.
goods_res
?
.
set_time
!=
nil
{
self
.
faHuoTime
=
"
\(
model
.
data
!.
goods_res
!.
set_time
!
)
"
//
百分比
if
dataSource
.
pct
!=
nil
{
data
.
DJBiLi
=
dataSource
.
pct
!
}
//
商品主图
for
item
in
model
.
data
!.
banner_res
!
{
self
.
maxFiveImgsArr
.
append
(
item
.
img_original
!
)
//
阶梯价
if
dataSource
.
tiered_pri
!.
count
>
0
{
data
.
jieTiArr
=
self
.
getResponseArr
(
str
:
dataSource
.
tiered_pri
!
)
}
//商品附图
let
imgArr
=
model
.
data
?
.
banner_res
!
if
imgArr
!.
count
>
0
{
for
i
in
0
..<
imgArr
!.
count
{
let
imgData
=
imgArr
!
[
i
]
self
.
goods_banner
?
.
insert
(
imgData
.
img_original
!
,
at
:
i
)
self
.
goods_banner
?
.
remove
(
at
:
i
+
1
)
}
//预售阶梯价
if
dataSource
.
adsale_tiered_pri
!.
count
>
0
{
data
.
specalArr
=
self
.
getResponseArr
(
str
:
dataSource
.
adsale_tiered_pri
!
)
}
//关键字
self
.
keyWord
=
(
model
.
data
?
.
goods_res
!.
keywords
)
!
//物流费用
self
.
wuLiuPrice
=
(
model
.
data
?
.
goods_res
!.
logistics
)
!
//国家
self
.
countrySelect
=
(
model
.
data
?
.
goods_res
!.
coun_id
)
!-
1
self
.
tishixxArr1
.
insert
(
self
.
countryArr
[
self
.
countrySelect
!
],
at
:
2
)
self
.
tishixxArr1
.
remove
(
at
:
3
)
//商品状态
self
.
shangPinStatus
=
(
model
.
data
?
.
goods_res
?
.
gs_id
)
!-
1
self
.
tishixxArr1
.
insert
((
model
.
data
?
.
goods_res
!.
gs_name
)
!
,
at
:
3
)
self
.
tishixxArr1
.
remove
(
at
:
4
)
//运输方式
self
.
yunShuType
=
(
model
.
data
?
.
goods_res
!.
transportation
)
!
-
1
self
.
tishixxArr1
.
insert
(
self
.
yunShuTypeArr
[
self
.
yunShuType
!
],
at
:
4
)
self
.
tishixxArr1
.
remove
(
at
:
5
)
//商品详情
self
.
goodsDesc
=
model
.
data
?
.
goods_res
?
.
goods_desc
as!
String
self
.
listTbv
.
reloadData
()
})
{
(
error
)
in
self
.
guiGeArr
.
append
(
data
)
}
}
//是否审核
self
.
shiFouSH
=
false
if
model
.
data
?
.
goods_res
?
.
need_check
==
1
{
self
.
shiFouSH
=
true
}
//预设预付定金时间段
// print("abcl === ",model.data?.goods_res!.dj_time_start!)
if
model
.
data
?
.
goods_res
!.
dj_time_start
!=
0
{
let
begin
=
dayByDouble
(
sender
:
(
model
.
data
?
.
goods_res
!.
dj_time_start
)
!
)
+
"-"
+
dayByDouble
(
sender
:
(
model
.
data
?
.
goods_res
!.
dj_time_end
)
!
)
self
.
dj_time_start
=
(
model
.
data
?
.
goods_res
!.
dj_time_start
)
self
.
dj_time_end
=
(
model
.
data
?
.
goods_res
!.
dj_time_end
)
self
.
ysszHolder
.
insert
(
begin
,
at
:
1
)
self
.
ysszHolder
.
remove
(
at
:
2
)
}
//预设预付尾款时间段
if
model
.
data
?
.
goods_res
!.
wk_time_start
!=
0
{
let
end
=
dayByDouble
(
sender
:
(
model
.
data
?
.
goods_res
!.
wk_time_start
)
!
)
+
"-"
+
dayByDouble
(
sender
:
(
model
.
data
?
.
goods_res
!.
wk_time_end
)
!
)
self
.
wk_time_start
=
(
model
.
data
?
.
goods_res
!.
wk_time_start
)
self
.
wk_time_end
=
(
model
.
data
?
.
goods_res
!.
wk_time_end
)
self
.
ysszHolder
.
insert
(
end
,
at
:
2
)
self
.
ysszHolder
.
remove
(
at
:
3
)
}
//发货时间
if
model
.
data
?
.
goods_res
?
.
set_time
!=
nil
{
self
.
faHuoTime
=
"
\(
model
.
data
!.
goods_res
!.
set_time
!
)
"
}
//商品主图
for
item
in
model
.
data
!.
banner_res
!
{
self
.
maxFiveImgsArr
.
append
(
item
.
img_original
!
)
}
//商品附图
let
imgArr
=
model
.
data
?
.
banner_res
!
if
imgArr
!.
count
>
0
{
for
i
in
0
..<
imgArr
!.
count
{
let
imgData
=
imgArr
!
[
i
]
self
.
goods_banner
?
.
insert
(
imgData
.
img_original
!
,
at
:
i
)
self
.
goods_banner
?
.
remove
(
at
:
i
+
1
)
}
}
//关键字
self
.
keyWord
=
(
model
.
data
?
.
goods_res
!.
keywords
)
!
//物流费用
self
.
wuLiuPrice
=
(
model
.
data
?
.
goods_res
!.
logistics
)
!
//国家
self
.
countrySelect
=
(
model
.
data
?
.
goods_res
!.
coun_id
)
!-
1
self
.
tishixxArr1
.
insert
(
self
.
countryArr
[
self
.
countrySelect
!
],
at
:
2
)
self
.
tishixxArr1
.
remove
(
at
:
3
)
//商品状态
self
.
shangPinStatus
=
(
model
.
data
?
.
goods_res
?
.
gs_id
)
!-
1
self
.
tishixxArr1
.
insert
((
model
.
data
?
.
goods_res
!.
gs_name
)
!
,
at
:
3
)
self
.
tishixxArr1
.
remove
(
at
:
4
)
//运输方式
self
.
yunShuType
=
(
model
.
data
?
.
goods_res
!.
transportation
)
!
-
1
self
.
tishixxArr1
.
insert
(
self
.
yunShuTypeArr
[
self
.
yunShuType
!
],
at
:
4
)
self
.
tishixxArr1
.
remove
(
at
:
5
)
//商品详情
self
.
goodsDesc
=
model
.
data
?
.
goods_res
?
.
goods_desc
as!
String
self
.
listTbv
.
reloadData
()
})
{
(
error
)
in
}
}
override
func
viewDidLoad
()
{
...
...
@@ -553,7 +553,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
navbar
.
title
=
"商品详情"
self
.
view
.
addSubview
(
navbar
)
SetTopFrameView
(
view
:
listTbv
,
btmView
:
btmBtnBGView
)
loadData
()
self
.
listTbv
.
separatorStyle
=
.
none
...
...
@@ -682,9 +682,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
return
cell
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"AddGuiGe"
)
as!
AddGuiGeCell
cell
.
delegate
=
self
cell
.
tag
=
indexPath
.
section
cell
.
imgBtn
.
isUserInteractionEnabled
=
isAllEditing
cell
.
imgBtn
.
setImage
(
UIImage
(
named
:
"xinzeng"
),
for
:
.
normal
)
cell
.
imgBtn
.
addTarget
(
self
,
action
:
#selector(
addGuiGe(sender:)
)
,
for
:
.
touchUpInside
)
return
cell
case
3
:
if
indexPath
.
row
==
0
{
...
...
@@ -742,20 +744,20 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
}
default
:
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"AddGuiGe"
)
as!
AddGuiGeCell
cell
.
imgBtn
.
isUserInteractionEnabled
=
isAllEditing
cell
.
imgBtn
.
tag
=
indexPath
.
row
cell
.
tag
=
indexPath
.
section
if
goodsDesc
.
count
>
0
{
cell
.
webView
.
isHidden
=
false
let
headerString
:
String
=
"<header><meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'><style>img{max-width:100%}</style></header>"
let
goodsDescHmtl
=
"<html>"
+
goodsDesc
+
"</html>"
cell
.
webView
.
loadHTMLString
(
goodsDescHmtl
+
headerString
,
baseURL
:
nil
)
}
cell
.
imgBtn
.
setImage
(
UIImage
(
named
:
"tjxq"
),
for
:
.
normal
)
cell
.
btmH
.
constant
=
25
cell
.
imgBtn
.
addTarget
(
self
,
action
:
#selector(
AddGuiGeCellClick(cell:)
)
,
for
:
.
touchUpInside
)
cell
.
delegate
=
self
return
cell
}
}
...
...
@@ -767,18 +769,30 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
@objc
func
editHtml
(){
print
(
"编辑软文"
)
let
vc
=
LMNoteViewController
()
vc
.
htmlStr
=
goodsDesc
;
vc
.
delegatedata
=
self
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
func
AddGuiGeCellClick
(
cell
:
AddGuiGeCell
)
{
let
vc
=
LMNoteViewController
()
vc
.
htmlStr
=
goodsDesc
;
vc
.
delegatedata
=
self
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
print
(
"akkd == "
,
cell
.
tag
)
if
cell
.
tag
==
5
{
let
vc
=
LMNoteViewController
()
vc
.
htmlStr
=
goodsDesc
;
vc
.
delegatedata
=
self
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
else
{
print
(
"新增规格"
)
let
vc
=
CreatNewSpecsViewController
()
vc
.
barTitle
=
"新增规格"
vc
.
delegate
=
self
vc
.
danWeiArr
=
generalInfoModel
?
.
data
!.
unit
vc
.
isYuShouSetting
=
isYuShouShangPin
!
vc
.
datasArr
=
guiGeArr
vc
.
selectIdx
=
selectIdx
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
//MARK: -- 点击按钮事件,跳转或者展示选择界面
func
btnClick
(
content
:
String
,
cell
:
TitleAndBtnCell
)
{
...
...
@@ -1190,7 +1204,6 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
//MARK: - 新增规格
@objc
func
addGuiGe
(
sender
:
UIView
){
print
(
"新增规格"
)
let
vc
=
CreatNewSpecsViewController
()
vc
.
barTitle
=
"新增规格"
...
...
@@ -1200,6 +1213,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
vc
.
datasArr
=
guiGeArr
vc
.
selectIdx
=
selectIdx
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
//MARK: - 新增、编辑规格数据返回
...
...
@@ -1663,7 +1677,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
var
goodsDesc
=
""
func
getHTMLByVc
(
_
model
:
String
!
)
{
goodsDesc
=
model
listTbv
.
reloadData
()
}
...
...
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