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
ba57aefe
Commit
ba57aefe
authored
Oct 13, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更换(商品上传图片接口),新增 sku 相关字段(原价和起售数量)
parent
03bd9f78
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
180 additions
and
41 deletions
+180
-41
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Define/Define.swift
GeliBusinessPlatform/Define/Define.swift
+13
-4
GeliBusinessPlatform/Interface/Interface_Z.plist
GeliBusinessPlatform/Interface/Interface_Z.plist
+2
-0
GeliBusinessPlatform/Model/GoodsManageMoel/GoodsDetailModel.swift
...nessPlatform/Model/GoodsManageMoel/GoodsDetailModel.swift
+5
-0
GeliBusinessPlatform/Model/Interface.swift
GeliBusinessPlatform/Model/Interface.swift
+10
-2
GeliBusinessPlatform/ViewController/商品详情/EPViewController.swift
...sinessPlatform/ViewController/商品详情/EPViewController.swift
+30
-10
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
...orm/ViewController/商品详情/ProductDetailViewController.swift
+29
-9
GeliBusinessPlatform/ViewController/工作中心/编辑工作中心/EditWorkCViewController.xib
...rm/ViewController/工作中心/编辑工作中心/EditWorkCViewController.xib
+11
-7
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift
...orm/ViewController/新增规格/CreatNewSpecsViewController.swift
+59
-4
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.xib
...tform/ViewController/新增规格/CreatNewSpecsViewController.xib
+15
-5
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
+6
-0
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
ba57aefe
No preview for this file type
GeliBusinessPlatform/Define/Define.swift
View file @
ba57aefe
...
...
@@ -27,10 +27,10 @@ let systemVersion = (UIDevice.current.systemVersion as String)
//接口地址
//test
//
let SERVERCE_ImageHost = "https://z.gelifood.com/"
//
let SERVERCE_HOST = "https://z.gelifood.com/admin/"
let
SERVERCE_ImageHost
=
"https://zx.gelifood.com/"
let
SERVERCE_HOST
=
"https://zx.gelifood.com/admin/"
let
SERVERCE_ImageHost
=
"https://z.gelifood.com/"
let
SERVERCE_HOST
=
"https://z.gelifood.com/admin/"
//
let SERVERCE_ImageHost = "https://zx.gelifood.com/"
//
let SERVERCE_HOST = "https://zx.gelifood.com/admin/"
////online
//视图常量
...
...
@@ -358,6 +358,15 @@ func getDicFromJSONString(jsonString:String) ->Dictionary<String,Any>{
//MARK: - 获取系统当前时间
func
getTimeDayNowByUpdate
()
->
String
{
let
date
=
Date
()
let
timeFormatter
=
DateFormatter
()
timeFormatter
.
dateFormat
=
"yyyyMMdd"
return
timeFormatter
.
string
(
from
:
date
)
as
String
}
func
getTimeDayNow
()
->
String
{
let
date
=
Date
()
...
...
GeliBusinessPlatform/Interface/Interface_Z.plist
View file @
ba57aefe
...
...
@@ -12,6 +12,8 @@
<string>
Common/editField
</string>
<key>
图片(文件)上传
</key>
<string>
Common/saveFile
</string>
<key>
商品图片上传
</key>
<string>
goods/uploadGoodsImage
</string>
<key>
个人中心首页+账号信息
</key>
<string>
Admin/adminInfo
</string>
<key>
商家信息
</key>
...
...
GeliBusinessPlatform/Model/GoodsManageMoel/GoodsDetailModel.swift
View file @
ba57aefe
...
...
@@ -138,6 +138,8 @@ class GoodsDetailSkuResModel: Mappable {
var
pct
:
Int
?
//定金比例(百分比) 例如填12即是定金比例为12%
var
adsale_tiered_pri
:
String
?
//预售阶梯价
var
is_adsale_tiered
:
Int
?
//是否开启预售阶梯价 1开启 0关闭
var
original_price
:
String
?
//原价
var
origin_number_sku
:
Int
?
//起售数量
required
init
?(
map
:
Map
)
{
...
...
@@ -158,6 +160,9 @@ class GoodsDetailSkuResModel: Mappable {
pct
<-
map
[
"pct"
]
adsale_tiered_pri
<-
map
[
"adsale_tiered_pri"
]
is_adsale_tiered
<-
map
[
"is_adsale_tiered"
]
original_price
<-
map
[
"original_price"
]
origin_number_sku
<-
map
[
"origin_number_sku"
]
}
}
...
...
GeliBusinessPlatform/Model/Interface.swift
View file @
ba57aefe
...
...
@@ -153,8 +153,16 @@ func getShopAdministratorInfo(_ params:[String:Any],success:@escaping (_ res:Any
}
//MARK:--图片(文件)上传
func
saveFile
(
image
:
UIImage
,
_
params
:[
String
:
Any
],
success
:
@escaping
(
_
res
:
Any
)
->
(),
failture
:
@escaping
(
_
error
:
Error
)
->
())
{
var
urlStr
=
"图片(文件)上传"
NetworkRequest
.
sharedInstance
.
uploadImage
(
url
:
"图片(文件)上传"
,
image
:
image
,
params
:
params
,
success
:
{
(
data
)
in
for
(
key
,
value
)
in
params
{
if
key
==
"path"
&&
((
value
as
AnyObject
)
.
contains
(
"goods"
)
||
(
value
as
AnyObject
)
.
contains
(
"banner"
))
{
urlStr
=
"商品图片上传"
}
}
print
(
"上传信息"
,
urlStr
,
params
,
image
)
NetworkRequest
.
sharedInstance
.
uploadImage
(
url
:
urlStr
,
image
:
image
,
params
:
params
,
success
:
{
(
data
)
in
let
model
=
Mapper
<
SaveFileModel
>
()
.
map
(
JSONObject
:
data
)
success
(
model
as
Any
)
})
{
(
error
)
in
...
...
GeliBusinessPlatform/ViewController/商品详情/EPViewController.swift
View file @
ba57aefe
...
...
@@ -548,6 +548,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
data
.
weight
=
dict
[
"wg"
]
as!
String
//重量
data
.
wenDu
=
dataSource
.
refrigerate
!//
温藏
data
.
originalPrice
=
item
.
original_price
!
data
.
originNumberSku
=
StringByInt
(
number
:
item
.
origin_number_sku
!
)
//预售设置
data
.
isOpenYSSetting
=
false
...
...
@@ -1214,12 +1216,18 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
var
original_img
:
String
?
=
""
//商品封面图
var
goods_banner
:
Array
<
String
>
?
=
[
""
,
""
,
""
,
""
,
""
]
//商品副图,多张,最多5张,使用一维数组转json格式
func
uploadImg
(
imge
:
UIImage
,
isOriginal
:
Bool
,
tag
:
Int
){
let
dateStr
=
getTimeDayNowByUpdate
()
var
path
=
""
if
isOriginal
{
path
=
"goods/"
+
dateStr
}
else
{
path
=
"banner/"
+
dateStr
}
let
upLoadImg
=
imge
as!
UIImage
HUD
.
show
(
.
progress
)
saveFile
(
image
:
upLoadImg
,
[
"user_token"
:
UserToken
as
Any
],
success
:
{
(
data
)
in
saveFile
(
image
:
upLoadImg
,
[
"user_token"
:
UserToken
as
Any
,
"path"
:
path
as
Any
],
success
:
{
(
data
)
in
let
dataM
=
data
as!
SaveFileModel
if
dataM
.
code
==
1
{
if
dataM
.
code
==
200
{
print
(
"图片上传成功
\(
dataM
.
data
?
.
url
)
"
)
if
isOriginal
{
...
...
@@ -1374,6 +1382,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
vc
.
yuShouPrice
=
dataDict
.
yuShouPrice
vc
.
specalArr
=
dataDict
.
specalArr
vc
.
jieTiArr
=
dataDict
.
jieTiArr
vc
.
originalPrice
=
dataDict
.
originalPrice
vc
.
originNumberSku
=
dataDict
.
originNumberSku
// vc.isOpenYSSetting = dataDict.isOpenYSSetting
vc
.
selectIdx
=
selectIdx
vc
.
itemDanWeiSelect
=
dataDict
.
itemDanWeiSelect
...
...
@@ -1689,7 +1699,21 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
isgetP
=
true
}
}
var
oData
=
""
if
item
.
originalPrice
.
contains
(
","
){
let
arr
=
item
.
originalPrice
.
components
(
separatedBy
:
","
)
oData
=
arr
.
joined
(
separator
:
""
)
}
else
{
oData
=
item
.
originalPrice
}
var
skuOData
=
""
if
item
.
originNumberSku
.
contains
(
","
){
let
arr
=
item
.
originNumberSku
.
components
(
separatedBy
:
","
)
skuOData
=
arr
.
joined
(
separator
:
""
)
}
else
{
skuOData
=
item
.
originNumberSku
}
// //普通阶梯价
var
is_tiered
=
0
var
tiered_pri
:
Dictionary
<
String
,
String
>
=
[:]
...
...
@@ -1767,13 +1791,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
pct
=
item
.
DJBiLi
}
// var pData = ""
// if item.price.contains(","){
// let arr = item.price.components(separatedBy: ",")
// pData = arr.joined(separator: "")
// }else{
// pData = item.price
// }
var
sku
=
[
"sku_sn"
:
""
,
"sku_id"
:
item
.
sku_id
,
...
...
@@ -1785,6 +1803,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
"refrigerate"
:
item
.
wenDu
,
"unit"
:
item
.
danWei
,
"price"
:
pData
,
"original_price"
:
oData
,
"origin_number_sku"
:
skuOData
,
"is_tiered"
:
is_tiered
,
"is_open_adsale"
:
is_open_adsale
,
"adsale_pri"
:
adsale_pri
,
...
...
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
View file @
ba57aefe
...
...
@@ -790,11 +790,19 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
var
goods_banner
:
Array
<
String
>
?
=
[
""
,
""
,
""
,
""
,
""
]
//商品副图,多张,最多5张,使用一维数组转json格式
func
uploadImg
(
imge
:
UIImage
,
isOriginal
:
Bool
,
tag
:
Int
){
let
dateStr
=
getTimeDayNowByUpdate
()
var
path
=
""
if
isOriginal
{
path
=
"goods/"
+
dateStr
}
else
{
path
=
"banner/"
+
dateStr
}
let
upLoadImg
=
imge
as!
UIImage
HUD
.
show
(
.
progress
)
saveFile
(
image
:
upLoadImg
,
[
"user_token"
:
UserToken
as
Any
],
success
:
{
(
data
)
in
saveFile
(
image
:
upLoadImg
,
[
"user_token"
:
UserToken
as
Any
,
"path"
:
path
as
Any
],
success
:
{
(
data
)
in
let
dataM
=
data
as!
SaveFileModel
if
dataM
.
code
==
1
{
if
dataM
.
code
==
200
{
print
(
"图片上传成功
\(
dataM
.
data
?
.
url
)
"
)
if
isOriginal
{
...
...
@@ -938,6 +946,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
vc
.
specalArr
=
dataDict
.
specalArr
vc
.
jieTiArr
=
dataDict
.
jieTiArr
// vc.isOpenYSSetting = dataDict.isOpenYSSetting
vc
.
originalPrice
=
dataDict
.
originalPrice
vc
.
originNumberSku
=
dataDict
.
originNumberSku
vc
.
selectIdx
=
selectIdx
vc
.
itemDanWeiSelect
=
dataDict
.
itemDanWeiSelect
vc
.
tempSelect
=
dataDict
.
tempSelect
!
...
...
@@ -1244,6 +1254,21 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
}
var
oData
=
""
if
md
.
originalPrice
.
contains
(
","
){
let
arr
=
md
.
originalPrice
.
components
(
separatedBy
:
","
)
oData
=
arr
.
joined
(
separator
:
""
)
}
else
{
oData
=
md
.
originalPrice
}
var
skuOData
=
""
if
md
.
originNumberSku
.
contains
(
","
){
let
arr
=
md
.
originNumberSku
.
components
(
separatedBy
:
","
)
skuOData
=
arr
.
joined
(
separator
:
""
)
}
else
{
skuOData
=
md
.
originNumberSku
}
//普通阶梯价
var
is_tiered
=
0
...
...
@@ -1322,13 +1347,6 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
let
packAttrStr
=
dictChangeString
(
sender
:
pack_attr
)
// var pData = ""
// if md.price.contains(","){
// let arr = md.price.components(separatedBy: ",")
// pData = arr.joined(separator: "")
// }else{
// pData = md.price
// }
var
sku
=
[
"sku_sn"
:
""
,
"spec_id"
:
"1"
,
...
...
@@ -1337,6 +1355,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
"refrigerate"
:
md
.
wenDu
,
"unit"
:
md
.
danWei
,
"price"
:
pData
,
"original_price"
:
oData
,
"origin_number_sku"
:
skuOData
,
"is_tiered"
:
is_tiered
,
"is_open_adsale"
:
is_open_adsale
,
"adsale_pri"
:
adsale_pri
,
...
...
GeliBusinessPlatform/ViewController/工作中心/编辑工作中心/EditWorkCViewController.xib
View file @
ba57aefe
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
6097
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
7156
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina4_7"
orientation=
"portrait"
appearance=
"light"
/>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
6087
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
7125
"
/>
<capability
name=
"Named colors"
minToolsVersion=
"9.0"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"System colors in document resources"
minToolsVersion=
"11.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<objects>
...
...
@@ -26,7 +27,7 @@
<subviews>
<collectionView
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"scaleToFill"
dataMode=
"none"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"bJE-2x-TVD"
>
<rect
key=
"frame"
x=
"0.0"
y=
"36"
width=
"375"
height=
"100"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"100"
id=
"ej4-tR-5IQ"
/>
</constraints>
...
...
@@ -60,7 +61,7 @@
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<constraints>
<constraint
firstItem=
"46H-tS-Yqb"
firstAttribute=
"leading"
secondItem=
"tVb-9c-Owx"
secondAttribute=
"trailing"
constant=
"5"
id=
"FsH-w8-1ed"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"tVb-9c-Owx"
secondAttribute=
"bottom"
id=
"Hap-qb-wac"
/>
...
...
@@ -71,7 +72,7 @@
</view>
<collectionView
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"scaleToFill"
dataMode=
"none"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"I9C-SQ-Pii"
>
<rect
key=
"frame"
x=
"0.0"
y=
"151"
width=
"375"
height=
"516"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<collectionViewFlowLayout
key=
"collectionViewLayout"
minimumLineSpacing=
"10"
minimumInteritemSpacing=
"10"
id=
"p8Q-tB-399"
>
<size
key=
"itemSize"
width=
"61"
height=
"69"
/>
<size
key=
"headerReferenceSize"
width=
"0.0"
height=
"0.0"
/>
...
...
@@ -80,7 +81,8 @@
</collectionViewFlowLayout>
</collectionView>
</subviews>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"fnl-2z-Ty3"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<constraints>
<constraint
firstItem=
"z1l-B1-PLS"
firstAttribute=
"trailing"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"trailing"
id=
"0Mm-H4-e1l"
/>
<constraint
firstItem=
"z1l-B1-PLS"
firstAttribute=
"leading"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"leading"
id=
"3IF-EF-10f"
/>
...
...
@@ -93,7 +95,6 @@
<constraint
firstItem=
"z1l-B1-PLS"
firstAttribute=
"top"
secondItem=
"i5M-Pr-FkT"
secondAttribute=
"top"
id=
"unq-b1-X4T"
/>
<constraint
firstItem=
"bJE-2x-TVD"
firstAttribute=
"trailing"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"trailing"
id=
"yeJ-jj-xTJ"
/>
</constraints>
<viewLayoutGuide
key=
"safeArea"
id=
"fnl-2z-Ty3"
/>
<point
key=
"canvasLocation"
x=
"108"
y=
"56.221889055472268"
/>
</view>
</objects>
...
...
@@ -104,5 +105,8 @@
<namedColor
name=
"灰色字体颜色"
>
<color
red=
"0.40000000000000002"
green=
"0.40000000000000002"
blue=
"0.40000000000000002"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<systemColor
name=
"systemBackgroundColor"
>
<color
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
</systemColor>
</resources>
</document>
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.swift
View file @
ba57aefe
...
...
@@ -36,8 +36,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
var
datasArr
:
Array
<
GuiGeModel
>
=
[]
var
dataModel
=
GuiGeModel
()
var
firstTimeSetting
=
true
let
titleArray
=
[
"售价:"
,
"规格:"
,
"重量(kg):"
,
"温藏:"
,
"单位:"
]
let
pliceHolderArr
=
[
"请输入商品售价"
,
"请输入商品规格"
,
"请输入商品重量"
,
"常温"
,
"请选择商品单位"
]
let
titleArray
=
[
"售价:"
,
"规格:"
,
"重量(kg):"
,
"温藏:"
,
"单位:"
,
"原价:"
,
"起售数量:"
]
let
pliceHolderArr
=
[
"请输入商品售价"
,
"请输入商品规格"
,
"请输入商品重量"
,
"常温"
,
"请选择商品单位"
,
"请输入商品原价"
,
"请输入起售数量"
]
@IBOutlet
weak
var
btmLbl
:
UILabel
!
@IBOutlet
weak
var
bottomBtn
:
LGButton
!
@IBOutlet
weak
var
listTbv
:
UITableView
!
...
...
@@ -62,6 +62,10 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
var
weight
=
""
var
wenDu
=
"常温"
var
danWei
=
""
var
originalPrice
=
""
var
originNumberSku
=
""
//规格
var
specalArr
:
Array
<
Any
>
=
[]{
willSet
{
...
...
@@ -146,6 +150,24 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
HUD
.
flash
(
.
label
(
"请输入正确的售价"
),
delay
:
1.2
)
return
}
if
originalPrice
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请输入原价"
),
delay
:
1.2
)
return
}
if
isPurnNumber
(
str
:
originalPrice
)
==
false
{
HUD
.
flash
(
.
label
(
"请输入正确的原价"
),
delay
:
1.2
)
return
}
if
originNumberSku
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请输入起售数量"
),
delay
:
1.2
)
return
}
if
isPurnNumber
(
str
:
originNumberSku
)
==
false
{
HUD
.
flash
(
.
label
(
"请输入正确的起售数量"
),
delay
:
1.2
)
return
}
if
guiGe
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请输入规格"
),
delay
:
1.2
)
return
...
...
@@ -186,6 +208,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
}
}
dataModel
.
originalPrice
=
originalPrice
dataModel
.
originNumberSku
=
originNumberSku
dataModel
.
price
=
price
dataModel
.
guiGe
=
guiGe
...
...
@@ -250,6 +274,27 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
weight
=
textField
.
text
!
}
break
case
5
:
if
isPurnNumber
(
str
:
textField
.
text
!
)
{
textField
.
text
=
formatShowNumber
(
value
:
textField
.
text
!
)
originalPrice
=
textField
.
text
!
}
else
{
HUD
.
flash
(
.
label
(
"请输入正确的价格"
),
delay
:
1.2
)
textField
.
text
=
""
originalPrice
=
textField
.
text
!
}
break
case
6
:
if
isPurnInt
(
string
:
textField
.
text
!
)
{
textField
.
text
=
formatShowNumber
(
value
:
textField
.
text
!
)
originNumberSku
=
textField
.
text
!
}
else
{
HUD
.
flash
(
.
label
(
"请输入正确的起售数量"
),
delay
:
1.2
)
textField
.
text
=
""
originNumberSku
=
textField
.
text
!
}
break
default
:
break
}
...
...
@@ -294,7 +339,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
==
0
{
if
indexPath
.
row
<
3
{
if
indexPath
.
row
<
3
||
indexPath
.
row
>
4
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"TitleAndTF"
)
as!
TitleAndTFCell
cell
.
nameLbl
.
text
=
titleArray
[
indexPath
.
row
]
cell
.
textTF
.
isUserInteractionEnabled
=
isAllEditing
...
...
@@ -303,7 +348,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
//keyboardType
cell
.
textTF
.
returnKeyType
=
.
done
cell
.
textTF
.
delegate
=
self
if
indexPath
.
row
==
0
||
indexPath
.
row
==
2
{
if
indexPath
.
row
==
0
||
indexPath
.
row
==
2
||
indexPath
.
row
==
5
||
indexPath
.
row
==
6
{
cell
.
textTF
.
keyboardType
=
.
decimalPad
}
let
str
=
NSAttributedString
(
string
:
pliceHolderArr
[
indexPath
.
row
],
attributes
:
[
NSAttributedString
.
Key
.
foregroundColor
:
UIColor
(
named
:
"灰色字体颜色"
)])
...
...
@@ -316,6 +361,12 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
case
1
:
cell
.
textTF
.
text
=
guiGe
break
case
5
:
cell
.
textTF
.
text
=
originalPrice
break
case
6
:
cell
.
textTF
.
text
=
originNumberSku
break
default
:
cell
.
textTF
.
text
=
weight
break
...
...
@@ -729,6 +780,10 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
selectIdx
=
indexPath
//刷新cell
let
dataDict
=
datasArr
[
selectIdx
!.
item
]
originalPrice
=
dataDict
.
originalPrice
originNumberSku
=
dataDict
.
originNumberSku
print
(
"刷新cell"
,
originalPrice
,
dataDict
.
originalPrice
)
price
=
dataDict
.
price
guiGe
=
dataDict
.
guiGe
weight
=
dataDict
.
weight
...
...
GeliBusinessPlatform/ViewController/新增规格/CreatNewSpecsViewController.xib
View file @
ba57aefe
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
5702
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
7156
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina6_1"
orientation=
"portrait"
appearance=
"light"
/>
<dependencies>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"15704"
/>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"17125"
/>
<capability
name=
"Named colors"
minToolsVersion=
"9.0"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"System colors in document resources"
minToolsVersion=
"11.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<objects>
...
...
@@ -34,14 +36,14 @@
</tableView>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"58G-5f-0zb"
>
<rect
key=
"frame"
x=
"0.0"
y=
"44"
width=
"414"
height=
"41"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"41"
id=
"BMm-7O-bZv"
/>
</constraints>
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Y0N-V9-rbQ"
customClass=
"LGButton"
customModule=
"LGButton"
>
<rect
key=
"frame"
x=
"0.0"
y=
"813"
width=
"414"
height=
"83"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute
type=
"color"
keyPath=
"gradientStartColor"
>
<color
key=
"value"
name=
"按钮渐变色上"
/>
...
...
@@ -72,6 +74,7 @@
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
<viewLayoutGuide
key=
"safeArea"
id=
"fnl-2z-Ty3"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<constraints>
<constraint
firstItem=
"bSh-mx-Kzg"
firstAttribute=
"trailing"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"trailing"
id=
"0nt-b8-Sre"
/>
...
...
@@ -89,10 +92,14 @@
<constraint
firstItem=
"bSh-mx-Kzg"
firstAttribute=
"leading"
secondItem=
"fnl-2z-Ty3"
secondAttribute=
"leading"
id=
"gaf-gS-JMH"
/>
<constraint
firstItem=
"fnl-2z-Ty3"
firstAttribute=
"bottom"
secondItem=
"cfi-M7-imX"
secondAttribute=
"bottom"
id=
"rRB-0C-Jn7"
/>
</constraints>
<viewLayoutGuide
key=
"safeArea"
id=
"fnl-2z-Ty3"
/>
<point
key=
"canvasLocation"
x=
"131.8840579710145"
y=
"129.91071428571428"
/>
</view>
</objects>
<designables>
<designable
name=
"Y0N-V9-rbQ"
>
<size
key=
"intrinsicContentSize"
width=
"10"
height=
"10"
/>
</designable>
</designables>
<resources>
<namedColor
name=
"app底色"
>
<color
red=
"0.94509803921568625"
green=
"0.94509803921568625"
blue=
"0.94509803921568625"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
...
...
@@ -106,5 +113,8 @@
<namedColor
name=
"白色背景色"
>
<color
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</namedColor>
<systemColor
name=
"systemBackgroundColor"
>
<color
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
</systemColor>
</resources>
</document>
GeliBusinessPlatform/ViewController/新增规格/GuiGeModel.swift
View file @
ba57aefe
...
...
@@ -45,4 +45,10 @@ class GuiGeModel: NSObject {
var
isYsJieTiOpen
:
Bool
=
false
///是否选择预售阶梯
var
selectYuShou
:
Bool
=
false
//原价
var
originalPrice
:
String
=
""
//起售数量
var
originNumberSku
:
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