Commit f8c7710e authored by lujunye's avatar lujunye

修改价格界面修改完成

parent 11217487
......@@ -160,6 +160,8 @@
E06524FA24581A7900CA22E2 /* ChuKuCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E06524F824581A7900CA22E2 /* ChuKuCell.xib */; };
E06524FD24581BD900CA22E2 /* PiCiXuanZeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E06524FB24581BD900CA22E2 /* PiCiXuanZeViewController.swift */; };
E06524FE24581BD900CA22E2 /* PiCiXuanZeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E06524FC24581BD900CA22E2 /* PiCiXuanZeViewController.xib */; };
E0706EF424B40BE800D8251C /* TitleAndTfYuanCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0706EF224B40BE800D8251C /* TitleAndTfYuanCell.swift */; };
E0706EF524B40BE800D8251C /* TitleAndTfYuanCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0706EF324B40BE800D8251C /* TitleAndTfYuanCell.xib */; };
E0707DB8246244EB00E039A8 /* AMapFoundationKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E0707DB6246244EA00E039A8 /* AMapFoundationKit.framework */; };
E0707DB9246244EB00E039A8 /* AMapLocationKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E0707DB7246244EA00E039A8 /* AMapLocationKit.framework */; };
E0707DBB2462453200E039A8 /* ExternalAccessory.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E0707DBA2462453200E039A8 /* ExternalAccessory.framework */; };
......@@ -733,6 +735,8 @@
E06524FB24581BD900CA22E2 /* PiCiXuanZeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PiCiXuanZeViewController.swift; sourceTree = "<group>"; };
E06524FC24581BD900CA22E2 /* PiCiXuanZeViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PiCiXuanZeViewController.xib; sourceTree = "<group>"; };
E0706EF124B4088500D8251C /* Bridge_Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Bridge_Header.h; sourceTree = "<group>"; };
E0706EF224B40BE800D8251C /* TitleAndTfYuanCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleAndTfYuanCell.swift; sourceTree = "<group>"; };
E0706EF324B40BE800D8251C /* TitleAndTfYuanCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TitleAndTfYuanCell.xib; sourceTree = "<group>"; };
E0707DB6246244EA00E039A8 /* AMapFoundationKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AMapFoundationKit.framework; sourceTree = "<group>"; };
E0707DB7246244EA00E039A8 /* AMapLocationKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AMapLocationKit.framework; sourceTree = "<group>"; };
E0707DBA2462453200E039A8 /* ExternalAccessory.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExternalAccessory.framework; path = System/Library/Frameworks/ExternalAccessory.framework; sourceTree = SDKROOT; };
......@@ -2343,6 +2347,8 @@
E0CC848624823EC1009B1FE9 /* CRKCell.xib */,
E002465024A8697B00049DBC /* TitleAndTFBtnCell.swift */,
E002465124A8697B00049DBC /* TitleAndTFBtnCell.xib */,
E0706EF224B40BE800D8251C /* TitleAndTfYuanCell.swift */,
E0706EF324B40BE800D8251C /* TitleAndTfYuanCell.xib */,
);
path = Cell;
sourceTree = "<group>";
......@@ -3031,6 +3037,7 @@
E06524FA24581A7900CA22E2 /* ChuKuCell.xib in Resources */,
E0CC848824823EC1009B1FE9 /* CRKCell.xib in Resources */,
E0337EF62464FCFC00952EF4 /* GYSListViewController.xib in Resources */,
E0706EF524B40BE800D8251C /* TitleAndTfYuanCell.xib in Resources */,
E0337EF22464F69000952EF4 /* YingFuZKListViewController.xib in Resources */,
E002465324A8697B00049DBC /* TitleAndTFBtnCell.xib in Resources */,
E0B9462C2456AABE00FBEC9A /* YuShouWeiKuanFaHuoCell.xib in Resources */,
......@@ -3480,6 +3487,7 @@
F950FDE024518B9500C40530 /* FSCalendarExtensions.m in Sources */,
E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */,
E0D46C5624503EC50087B564 /* TitleAndSelectCell.swift in Sources */,
E0706EF424B40BE800D8251C /* TitleAndTfYuanCell.swift in Sources */,
F93E32112473E05C00524DFC /* GeliAlertTextView.swift in Sources */,
E0F97B022451228A001BD600 /* GLAlertSelectView.swift in Sources */,
F96E9D5C246656A700B5B94A /* HGImagePickerCell.swift in Sources */,
......
......@@ -6,21 +6,29 @@
// Created by geli on 2018/6/22.
// Copyright © 2018年 geli. All rights reserved.
//
//shareSDK账号&密码
//17322010717
//gelifood81338860
//
//融云账号&融云密码
//18924107259
//81338860geLI
//
//苹果账号&密码
//notice@gelifood.com
//81338860^geLi
//极光密码
//GeliFood
//81338860geLI
//
/*
shareSDK账号&密码
17322010717
gelifood81338860
融云账号&融云密码
18924107259
81338860geLI
苹果账号&密码
notice@gelifood.com
81338860^geLi
极光密码
GeliFood
81338860geLI
微信开发平台
GELIFOOD123@126.com
81338860geli
*/
import UIKit
import ESTabBarController_swift
......
//
// TitleAndTfYuanCell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/7/7.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
protocol TitleAndTfYuanCellDelegate {
func TitleAndTfYuanCellGetData(price:String,idx:Int)
}
class TitleAndTfYuanCell: UITableViewCell,UITextFieldDelegate {
@IBOutlet weak var line: UIView!
var delegate:TitleAndTfYuanCellDelegate?
@IBOutlet weak var textTF: UITextField!
@IBOutlet weak var nameLbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
func textFieldDidEndEditing(_ textField: UITextField) {
delegate?.TitleAndTfYuanCellGetData(price: textField.text!, idx: self.tag)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="TitleAndTfYuanCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sXD-jW-d4W">
<rect key="frame" x="15" y="0.0" width="305" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="Vxl-JA-Hce"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ATS-JC-ifT">
<rect key="frame" x="15" y="14" width="33" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="元" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cp7-kK-hcS">
<rect key="frame" x="291.5" y="14" width="13.5" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="WRY-dV-ofH">
<rect key="frame" x="193.5" y="6" width="93" height="32"/>
<constraints>
<constraint firstAttribute="height" constant="32" id="TTx-AT-euc"/>
<constraint firstAttribute="width" constant="93" id="eBB-dc-88a"/>
</constraints>
<color key="textColor" name="蓝色字体颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits" keyboardType="decimalPad"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="3"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" name="#999999"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="delegate" destination="-1" id="7h2-A8-F1h"/>
</connections>
</textField>
</subviews>
<constraints>
<constraint firstItem="cp7-kK-hcS" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="JY0-SG-u0Y"/>
<constraint firstAttribute="trailing" secondItem="sXD-jW-d4W" secondAttribute="trailing" id="P9H-UZ-fcD"/>
<constraint firstItem="WRY-dV-ofH" firstAttribute="centerY" secondItem="cp7-kK-hcS" secondAttribute="centerY" id="SYs-CA-ksl"/>
<constraint firstItem="ATS-JC-ifT" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="aYP-wB-fcB"/>
<constraint firstAttribute="trailing" secondItem="cp7-kK-hcS" secondAttribute="trailing" constant="15" id="iHN-To-HSh"/>
<constraint firstItem="sXD-jW-d4W" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="igJ-Ps-MaU"/>
<constraint firstItem="sXD-jW-d4W" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="kHN-Au-5gS"/>
<constraint firstItem="cp7-kK-hcS" firstAttribute="leading" secondItem="WRY-dV-ofH" secondAttribute="trailing" constant="5" id="sJh-ed-EXX"/>
<constraint firstItem="ATS-JC-ifT" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="z1z-KR-mg9"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="line" destination="sXD-jW-d4W" id="wtR-7B-xqq"/>
<outlet property="nameLbl" destination="ATS-JC-ifT" id="whW-aA-4eU"/>
<outlet property="textTF" destination="WRY-dV-ofH" id="pk9-hz-13Q"/>
</connections>
<point key="canvasLocation" x="132" y="99"/>
</tableViewCell>
</objects>
<resources>
<namedColor name="#999999">
<color red="0.60000002384185791" green="0.60000002384185791" blue="0.60000002384185791" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="蓝色字体颜色">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -177,7 +177,11 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
// cell.leftIcon.isHidden = true
// cell.nameLblLeft.constant = -15
cell.nameLbl.text = rowModel.user_name
if rowModel.cus_name != nil {
cell.nameLbl.text = rowModel.cus_name
}else{
cell.nameLbl.text = rowModel.user_name
}
cell.orderNumerLbl.text = rowModel.order_sn
cell.statusLbl.text = orderStatusStrByInt(statusNumber: rowModel.order_status!)
cell.countLbl.text = "\(rowModel.goods_number!)"
......
......@@ -15,7 +15,24 @@ protocol ChangeGoodsPriceVCDelegate {
func changeGoodsPriByData(sender:Array<OrderDetailGoodsModel>)
}
class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableViewDataSource,UITextFieldDelegate {
class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableViewDataSource,UITextFieldDelegate,TitleAndTfYuanCellDelegate {
@IBOutlet weak var btnTitle: UILabel!
func TitleAndTfYuanCellGetData(price: String, idx: Int) {
if idx == 0 {
wlPrice = price
}else{
qtPrice = price
}
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 orderID:Int? = 0
var delegate:ChangeGoodsPriceVCDelegate?
var dataArr : Array<OrderDetailGoodsModel>? = []
......@@ -25,9 +42,20 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
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 wlPrice:String = ""
var qtPrice:String = ""
@IBOutlet weak var sureBtn: LGButton!
//MARK:--确认修改价格
@IBAction func sureAction(_ sender: LGButton) {
......@@ -60,6 +88,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
}
func textFieldDidEndEditing(_ textField: UITextField) {
var total = Float(0)
for i in 0..<dataArr!.count {
if i == textField.tag {
let md = dataArr![i]
......@@ -68,9 +97,17 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
//记录哪个更改了
md.is_edit = 1
}
let p = md.goods_price as! NSString
total += Float(md.cart_number!) * p.floatValue
}else{
let md = dataArr![i]
let price = md.goods_subtotal as! NSString
total += price.floatValue
}
}
let wl = wlPrice as NSString
let qt = qtPrice as NSString
btnTitle.text = "确定(合计¥\(total + wl.floatValue + qt.floatValue))"
self.tableV.reloadData()
}
......@@ -92,14 +129,35 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
tableV.separatorStyle = .none
tableV?.register(UINib(nibName: "ChangePriceNormalCell", bundle: nil), forCellReuseIdentifier: "ChangePriceNormalCell")
tableV?.register(UINib(nibName: "TitleAndTfYuanCell", bundle: nil), forCellReuseIdentifier: "TitleAndTfYuanCell")
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// return 20
return dataArr!.count
if section == 0{
return dataArr!.count
}
return 2
}
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTfYuanCell") as! TitleAndTfYuanCell
cell.tag = indexPath.row
cell.delegate = self
cell.nameLbl.text = "物流费用"
cell.textTF.text = wlPrice
if indexPath.row == 1 {
cell.line.isHidden = false
cell.nameLbl.text = "其他费用"
cell.textTF.text = qtPrice
}
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "ChangePriceNormalCell") as! ChangePriceNormalCell
let rowModel = dataArr![indexPath.row]
......@@ -120,13 +178,23 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
cell.priceTf.tag = indexPath.row
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath)
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 5))
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section == 0{
return 5
}
return 0
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 120*glscale
if indexPath.section == 0{
return 120*glscale
}
return 49*glscale
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
IQKeyboardManager.shared.resignFirstResponder()
......
......@@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
......@@ -10,6 +11,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChangeGoodsPriceVC" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="btnTitle" destination="Jwf-MV-g9X" id="tfJ-C3-dub"/>
<outlet property="sureBtn" destination="u6y-CU-3oP" id="jeI-hQ-epr"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
......
......@@ -161,7 +161,11 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
vc.dataArr = self.dataMdoel?.order_goods
vc.orderID = self.orderId
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true)
vc.wlPrice = self.dataMdoel?.order_res?.logistics_price as! String
vc.qtPrice = self.dataMdoel?.order_res?.other_price! as! String
self.navigationController?.pushViewController(vc,animated: true)
}
break
case "打印":
......
......@@ -136,7 +136,8 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
let cell = tableView.dequeueReusableCell(withIdentifier: "CGDListCell") as! CGDListCell
let model = datas[indexPath.row]
cell.cgDataArr = model.goods_res
cell.nameLbl.text = model.po_no!
cell.nameLbl.text = model.user_name!
cell.orderNumerLbl.text = model.po_no!
cell.statusLbl.isHidden = true
var status = ""
if orderStatus == 2 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment