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
16ca2918
Commit
16ca2918
authored
Jul 10, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改小数位保留2位小数
parent
f12608a5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
65 deletions
+71
-65
GeliBusinessPlatform.xcodeproj/project.pbxproj
GeliBusinessPlatform.xcodeproj/project.pbxproj
+2
-2
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/ViewController/订单管理/普通商品修改价格/ChangeGoodsPriceVC.swift
...orm/ViewController/订单管理/普通商品修改价格/ChangeGoodsPriceVC.swift
+24
-22
GeliBusinessPlatform/ViewController/订单管理/预售价格修改/XiuGaiYuShouJiaViewController.swift
...ontroller/订单管理/预售价格修改/XiuGaiYuShouJiaViewController.swift
+45
-41
No files found.
GeliBusinessPlatform.xcodeproj/project.pbxproj
View file @
16ca2918
...
...
@@ -3685,7 +3685,7 @@
CLANG_ENABLE_MODULES
=
YES
;
CODE_SIGN_ENTITLEMENTS
=
GeliBusinessPlatform/GeliBusinessPlatform.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
1.2
7
;
CURRENT_PROJECT_VERSION
=
1.2
8
;
DEFINES_MODULE
=
NO
;
DEVELOPMENT_ASSET_PATHS
=
"\"GeliBusinessPlatform/Preview Content\""
;
DEVELOPMENT_TEAM
=
K48346UACH
;
...
...
@@ -3814,7 +3814,7 @@
CLANG_ENABLE_MODULES
=
YES
;
CODE_SIGN_ENTITLEMENTS
=
GeliBusinessPlatform/GeliBusinessPlatform.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
1.2
7
;
CURRENT_PROJECT_VERSION
=
1.2
8
;
DEFINES_MODULE
=
NO
;
DEVELOPMENT_ASSET_PATHS
=
"\"GeliBusinessPlatform/Preview Content\""
;
DEVELOPMENT_TEAM
=
K48346UACH
;
...
...
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
16ca2918
No preview for this file type
GeliBusinessPlatform/ViewController/订单管理/普通商品修改价格/ChangeGoodsPriceVC.swift
View file @
16ca2918
...
...
@@ -31,27 +31,27 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
})
let
wl
=
wlPrice
as
NSString
let
qt
=
qtPrice
as
NSString
btnTitle
.
text
=
"确定(合计¥
\(
total
+
wl
.
floatValue
+
qt
.
floatValue
)
)"
btnTitle
.
text
=
String
(
format
:
"确定(合计¥%.2f)"
,
total
+
wl
.
floatValue
+
qt
.
floatValue
)
tableV
.
reloadData
()
}
var
orderID
:
Int
?
=
0
var
delegate
:
ChangeGoodsPriceVCDelegate
?
var
dataArr
:
Array
<
OrderDetailGoodsModel
>
?
=
[]
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
navbar
.
title
=
"修改价格"
self
.
view
.
addSubview
(
navbar
)
setTabv
()
var
total
=
Float
(
0
)
dataArr
?
.
forEach
({
(
item
)
in
let
price
=
item
.
goods_subtotal
as!
NSString
total
+=
price
.
floatValue
})
let
wl
=
wlPrice
as
NSString
let
qt
=
qtPrice
as
NSString
btnTitle
.
text
=
"确定(合计¥
\(
total
+
wl
.
floatValue
+
qt
.
floatValue
)
)"
var
total
=
Float
(
0
)
dataArr
?
.
forEach
({
(
item
)
in
let
price
=
item
.
goods_subtotal
as!
NSString
total
+=
price
.
floatValue
})
let
wl
=
wlPrice
as
NSString
let
qt
=
qtPrice
as
NSString
btnTitle
.
text
=
String
(
format
:
"确定(合计¥%.2f)"
,
total
+
wl
.
floatValue
+
qt
.
floatValue
)
}
...
...
@@ -61,8 +61,8 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
@IBOutlet
weak
var
sureBtn
:
LGButton
!
//MARK:--确认修改价格
@IBAction
func
sureAction
(
_
sender
:
LGButton
)
{
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
var
order_goodsArr
:
Array
<
Any
>
?
=
[]
...
...
@@ -75,22 +75,23 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
order_goodsArr
?
.
append
(
dic
)
})
let
order_goods
=
dataChangeString
(
sender
:
order_goodsArr
!
)
editOrderGoodsPrice
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
orderID
as
Any
,
"order_goods"
:
order_goods
as
Any
,
"logistics_price"
:
wlPrice
as
Any
,
"other_price"
:
qtPrice
as
Any
],
success
:
{
(
data
)
in
let
dataM
=
data
as!
UpDataModel
if
dataM
.
code
==
1
{
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
delegate
?
.
changeGoodsPriByData
(
sender
:
self
.
dataArr
!
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
})
{
(
error
)
in
}
}
deinit
{
NotificationCenter
.
default
.
removeObserver
(
self
)
}
...
...
@@ -114,10 +115,11 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
}
let
wl
=
wlPrice
as
NSString
let
qt
=
qtPrice
as
NSString
btnTitle
.
text
=
"确定(合计¥
\(
total
+
wl
.
floatValue
+
qt
.
floatValue
)
)"
btnTitle
.
text
=
String
(
format
:
"确定(合计¥%.2f)"
,
total
+
wl
.
floatValue
+
qt
.
floatValue
)
self
.
tableV
.
reloadData
()
}
var
tableV
:
UITableView
!
...
...
@@ -166,16 +168,16 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"ChangePriceNormalCell"
)
as!
ChangePriceNormalCell
let
rowModel
=
dataArr
!
[
indexPath
.
row
]
cell
.
goodsImgVire
.
sd_setImage
(
with
:
URL
(
string
:
SERVERCE_ImageHost
+
rowModel
.
goods_thumb
!
))
cell
.
goodsNameLbl
.
text
=
rowModel
.
goods_name
if
rowModel
.
goods_attr
!=
nil
{
cell
.
attrrLbl
.
text
=
rowModel
.
goods_attr
}
else
{
cell
.
attrrLbl
.
text
=
"-"
}
cell
.
priceTf
.
text
=
rowModel
.
goods_price
cell
.
detailLbl
.
isHidden
=
true
...
...
GeliBusinessPlatform/ViewController/订单管理/预售价格修改/XiuGaiYuShouJiaViewController.swift
View file @
16ca2918
...
...
@@ -48,10 +48,10 @@ class XiuGaiYuShouJiaViewController: BaseViewController, UITextFieldDelegate {
titleLbl
.
text
=
rowModel
!.
goods_name
if
rowModel
?
.
goods_attr
!=
nil
{
detailLbl
.
text
=
"规格:"
+
(
rowModel
?
.
goods_attr
)
!
}
else
{
detailLbl
.
text
=
"规格:"
+
"-"
}
dingJinTF
.
text
=
dataModel
?
.
order_res
?
.
sale_res
?
.
dj_amount
weiKuanTF
.
text
=
dataModel
?
.
order_res
?
.
sale_res
?
.
wk_amount
...
...
@@ -79,22 +79,22 @@ class XiuGaiYuShouJiaViewController: BaseViewController, UITextFieldDelegate {
weiKuanTF
.
tag
=
1002
dingJinTF
.
keyboardType
=
.
decimalPad
weiKuanTF
.
keyboardType
=
.
decimalPad
}
func
textFieldDidEndEditing
(
_
textField
:
UITextField
)
{
if
textField
.
tag
==
1001
{
// print(dingJinTF.text)
// print(dingJinTF.text)
let
dingj
=
dingJinTF
.
text
!
as
NSString
if
isPurnNumber
(
str
:
dingJinTF
.
text
!
)
{
// if dingj.floatValue > (totalPrice! * 0.2) {
// HUD.flash(.label("定金不得高于总价20%"),delay: 1.2)
// dingJinTF.text = String(format: "%.2f", (totalPrice! * 0.2))
// }else{
dingJinTF
.
text
=
String
(
format
:
"%.2f"
,
dingj
.
floatValue
)
// }
// let lastDj = dingJinTF.text! as NSString
// let weiku = totalPrice! - lastDj.floatValue
// weiKuanTF.text = String(format: "%.2f",weiku)
// if dingj.floatValue > (totalPrice! * 0.2) {
// HUD.flash(.label("定金不得高于总价20%"),delay: 1.2)
// dingJinTF.text = String(format: "%.2f", (totalPrice! * 0.2))
// }else{
dingJinTF
.
text
=
String
(
format
:
"%.2f"
,
dingj
.
floatValue
)
// }
// let lastDj = dingJinTF.text! as NSString
// let weiku = totalPrice! - lastDj.floatValue
// weiKuanTF.text = String(format: "%.2f",weiku)
}
else
{
HUD
.
flash
(
.
label
(
"请填写正确的定金数值"
),
delay
:
1.2
)
dingJinTF
.
text
=
""
...
...
@@ -102,50 +102,52 @@ class XiuGaiYuShouJiaViewController: BaseViewController, UITextFieldDelegate {
}
else
if
textField
.
tag
==
1002
{
let
weiku
=
weiKuanTF
.
text
!
as
NSString
if
isPurnNumber
(
str
:
weiKuanTF
.
text
!
)
{
// if weiku.floatValue > totalPrice! {
// HUD.flash(.label("尾款不得高于总价"),delay: 1.2)
// weiKuanTF.text = String(format: "%.2f", totalPrice!)
// }else if weiku.floatValue < (totalPrice! * 0.8){
// HUD.flash(.label("尾款不得低于总价的80%"),delay: 1.2)
// weiKuanTF.text = String(format: "%.2f", (totalPrice! * 0.8))
// }else{
weiKuanTF
.
text
=
String
(
format
:
"%.2f"
,
weiku
.
floatValue
)
// }
// let lastWeiku = weiKuanTF.text! as NSString
// let dingj = totalPrice! - lastWeiku.floatValue
// dingJinTF.text = String(format: "%.2f",dingj)
// if weiku.floatValue > totalPrice! {
// HUD.flash(.label("尾款不得高于总价"),delay: 1.2)
// weiKuanTF.text = String(format: "%.2f", totalPrice!)
// }else if weiku.floatValue < (totalPrice! * 0.8){
// HUD.flash(.label("尾款不得低于总价的80%"),delay: 1.2)
// weiKuanTF.text = String(format: "%.2f", (totalPrice! * 0.8))
// }else{
weiKuanTF
.
text
=
String
(
format
:
"%.2f"
,
weiku
.
floatValue
)
// }
// let lastWeiku = weiKuanTF.text! as NSString
// let dingj = totalPrice! - lastWeiku.floatValue
// dingJinTF.text = String(format: "%.2f",dingj)
}
else
{
HUD
.
flash
(
.
label
(
"请填写正确的尾款数值"
),
delay
:
1.2
)
weiKuanTF
.
text
=
""
}
}
}
@IBAction
func
submitACTION
(
_
sender
:
Any
)
{
print
(
"预售返回上一级且提交了数据"
)
// let weiku = weiKuanTF.text! as NSString
// let dingj = dingJinTF.text! as NSString
// if (weiku.floatValue + dingj.floatValue)
// != totalPrice {
// let total = String(format: "%.2f", totalPrice!)
// HUD.flash(.label("填写的定金和尾款总价应为" + total),delay: 1.2)
// return;
// }
// let weiku = weiKuanTF.text! as NSString
// let dingj = dingJinTF.text! as NSString
// if (weiku.floatValue + dingj.floatValue)
// != totalPrice {
// let total = String(format: "%.2f", totalPrice!)
// HUD.flash(.label("填写的定金和尾款总价应为" + total),delay: 1.2)
// return;
// }
if
orderID
!=
0
{
//MARK:--需要对输入是否为金额判断
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
let
rowModel
=
dataModel
?
.
order_goods
!
[
0
]
editOrderGoodsPriceAd
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
orderID
as
Any
,
"og_id"
:
rowModel
?
.
og_id
as
Any
,
"dj_amount"
:
dingJinTF
.
text
as
Any
,
"wk_amount"
:
weiKuanTF
.
text
as
Any
],
success
:
{
(
data
)
in
let
dataM
=
data
as!
EditOGPAdModel
if
dataM
.
code
==
1
{
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
delegate
?
.
changeYuShouGoodsByData
(
sender
:
dataM
.
data
!
,
djText
:
self
.
dingJinTF
.
text
!
,
wkText
:
self
.
weiKuanTF
.
text
!
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
})
{
(
error
)
in
}
...
...
@@ -154,8 +156,10 @@ class XiuGaiYuShouJiaViewController: BaseViewController, UITextFieldDelegate {
self
.
delegate
?
.
changeYuShouGoodsByData
(
sender
:
nil
,
djText
:
dingJinTF
.
text
!
,
wkText
:
weiKuanTF
.
text
!
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
deinit
{
NotificationCenter
.
default
.
removeObserver
(
self
)
}
}
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