Commit b7a206bd authored by ljh's avatar ljh

完成订单详情修正

parent f40fe975
......@@ -50,11 +50,11 @@ class OrderDetailResModel: Mappable {
var logistics_price : String? //物流费用
var other_price : String?//其他费用
var sum_amount : String? //订单合计价格
var from : String?
var lc_id : String?
var from : Int?
var lc_id : Int?
var lwb_no : String?//运单号
var pay_type : String?
var pay_status : String?
var pay_type : Int?
var pay_status : Int?
var postscript : String? //买家留言
var order_postscript : String? //订单备注
var address : String?
......@@ -203,10 +203,10 @@ class OrderDetailGoodsModel: Mappable {
var goods_attr : String? //商品规格
var goods_unit : String? //商品单位
var goods_price : String? //商品单价
var cart_number : String? //商品数量
var cart_number : Int? //商品数量
var goods_subtotal : String? //商品小计
var goods_thumb : String? //商品缩略图
var warehouse_inventory : String? //商品库存
var warehouse_inventory : Int? //商品库存
var is_edit : Int? = 0 //订单商品是否有修改,1是0非--前端自主添加的字段
required init?( map: Map) {
......
......@@ -43,12 +43,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
//MARK:--loginVC
func addLoginVc (isAgain:Bool){
// let vc = LoginViewController()
// vc.delegate = self
// let contentView = vc
//
let vc = EPViewController()
let vc = LoginViewController()
vc.delegate = self
let contentView = vc
//
// let vc = EPViewController()
// let contentView = vc
if let windowScene = sceneC as? UIWindowScene {
if isAgain {
......@@ -95,7 +95,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
tabBarController.viewControllers = [v1, v2, v3, v4, v5]
tabBarController.selectedIndex = 2
// tabBarController.selectedIndex = 2
......
......@@ -10,6 +10,7 @@ import UIKit
class PingLunCell: UITableViewCell {
@IBOutlet weak var editIconImgV: UIImageView!
@IBOutlet weak var contentLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
override func awakeFromNib() {
......@@ -18,7 +19,8 @@ class PingLunCell: UITableViewCell {
// Initialization code
}
@IBOutlet weak var contentRight: NSLayoutConstraint!
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<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>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<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"/>
......@@ -10,7 +10,7 @@
<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="PingLunCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="PingLunCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="49"/>
<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">
......@@ -31,10 +31,10 @@
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bianji" translatesAutoresizingMaskIntoConstraints="NO" id="ai0-qt-tes">
<rect key="frame" x="326" y="8" width="34" height="33"/>
<rect key="frame" x="343" y="16.5" width="17" height="16.5"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="13" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u0y-iz-OFK">
<rect key="frame" x="57" y="10" width="254" height="28"/>
<rect key="frame" x="57" y="10" width="273" height="28"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="灰色字体颜色"/>
<nil key="highlightedColor"/>
......@@ -52,12 +52,14 @@
<constraint firstItem="uoz-6f-uUt" firstAttribute="top" secondItem="9hM-p4-cpX" secondAttribute="bottom" id="iDZ-J7-NXw"/>
<constraint firstAttribute="bottom" secondItem="uoz-6f-uUt" secondAttribute="bottom" id="n0B-iM-v7R"/>
<constraint firstItem="9hM-p4-cpX" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="q2Q-IK-ynT"/>
<constraint firstItem="ai0-qt-tes" firstAttribute="leading" secondItem="u0y-iz-OFK" secondAttribute="trailing" constant="15" id="w97-SL-zh2"/>
<constraint firstAttribute="trailing" secondItem="u0y-iz-OFK" secondAttribute="trailing" constant="45" id="w97-SL-zh2"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="contentLbl" destination="u0y-iz-OFK" id="UlA-85-uH9"/>
<outlet property="contentRight" destination="w97-SL-zh2" id="zH7-gM-tRN"/>
<outlet property="editIconImgV" destination="ai0-qt-tes" id="Vig-37-dxb"/>
<outlet property="nameLbl" destination="9hM-p4-cpX" id="0Pr-Hd-ejy"/>
</connections>
<point key="canvasLocation" x="131.15942028985509" y="127.56696428571428"/>
......
......@@ -23,7 +23,9 @@ var delegate:TitleAndBtnCellDelegate?
self.selectionStyle = .none
// Initialization code
}
@IBOutlet weak var contentRight: NSLayoutConstraint!
@IBAction func btnClick(_ sender: Any) {
delegate?.btnClick?(content: contentLbl.text!, cell: self)
}
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<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>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<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"/>
......@@ -10,7 +10,7 @@
<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="TitleAndBtnCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="TitleAndBtnCell" 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">
......@@ -100,6 +100,7 @@
<outlet property="arrowImg" destination="Gf0-pG-ZDj" id="uaE-Be-XYP"/>
<outlet property="btn" destination="VXU-ef-rsF" id="92Z-x4-AVW"/>
<outlet property="contentLbl" destination="7nL-vu-Tdl" id="sEW-G5-GaR"/>
<outlet property="contentRight" destination="6yZ-7e-lVf" id="4sv-ji-kLJ"/>
<outlet property="imgView" destination="HSb-Uo-Ffy" id="9RM-uK-s3I"/>
<outlet property="lineWidth" destination="EUi-Y9-d4w" id="0on-lp-cbT"/>
<outlet property="nameLbl" destination="EfU-Eu-amU" id="XOH-Zx-SHi"/>
......
......@@ -101,8 +101,10 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
}else if indexPath.row == 2{
//权限设置-弹窗
HUD.flash(.label("权限设置开发中"), delay: 1.2)
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 50*glscale
}
......
......@@ -151,7 +151,7 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
vc.titleStr = "新增仓库"
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: false)
self.navigationController?.pushViewController(vc, animated: true)
}
var warehourseArr:Array<ShopWarehouseListDataModel> = []//仓库数组
......@@ -199,7 +199,7 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
vc.editIdx = indexPath.row
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: false)
self.navigationController?.pushViewController(vc, animated: true)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
......
......@@ -433,6 +433,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
func changeGoodsIsShow(isTrue: Bool, byIndex: Int) {
//左按钮为false 右按钮为true
let rowModel = self.items[byIndex]
//添加提示
if rowModel.is_show == 1 {
if isTrue {
print("入库哦哦")
......
......@@ -293,19 +293,242 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
}
break
case "入库":
let vc = RuKuViewController()
vc.barTitle = "入库"
self.navigationController?.pushViewController(vc, animated: true)
break
case "出库":
let vc = ChuKuViewController()
self.navigationController?.pushViewController(vc, animated: true)
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":1,], success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1 {
HUD.flash(.label("提交成功"), delay: 1.2)
self.loadData()
}
}) { (erro) in
}
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
}
break
case "删除":
//提示是否删除
let UserToken = UserDefaults.standard.value(forKey: "user_token")
editField(["user_token":UserToken as Any,"function_id":"16","prval":goods_id as Any,"value":1,], success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1 {
HUD.flash(.label("删除成功"), delay: 1.2)
self.navigationController?.popViewController(animated: true)
}
}) { (erro) in
}
break
default:
break
}
}
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)
}
}
//是否审核
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() {
super.viewDidLoad()
......@@ -330,186 +553,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
navbar.title = "商品详情"
self.view.addSubview(navbar)
SetTopFrameView(view: listTbv, btmView: btmBtnBGView)
//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)
}
}
//是否审核
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
}
loadData()
self.listTbv.separatorStyle = .none
self.listTbv.delegate = self
......
......@@ -46,11 +46,12 @@ class ShowAlGoodsViewController: BaseViewController , UITableViewDelegate, UITa
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "XuanZeShangPinCell") as! XuanZeShangPinCell
cell.selectBtn.isHidden = true
cell.detailLbl2.isHidden = true
let rowModel = order_goods![indexPath.row]
cell.nameLbl.text = rowModel.goods_name
cell.detailLbl.text = rowModel.goods_attr
cell.priceLbl.text = "¥" + (rowModel.goods_price!)
cell.iconImg.sd_setImage(with: URL(string: SERVERCE_ImageHost + (rowModel.goods_thumb)!))
cell.detailLbl2.text = "x" + StringByInt(number: rowModel.cart_number!)
return cell
}
......
......@@ -25,7 +25,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
glSelectView = nil
}
//MARK:--普通的是否可编辑
var iseditByData:Bool = true
var isCaneditLatsData:Bool = true
var orderId:Int? //订单编号
var isYuShou:Bool = true //是否预售
......@@ -106,7 +106,11 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
self.bottomView.addSubview(btn)
}
}
if self.dataMdoel?.order_res?.order_status == 2 {
self.isCaneditLatsData = false
}
self.listView.reloadData()
......@@ -229,7 +233,6 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
func changeGoodsPriByData(sender: Array<OrderDetailGoodsModel>) {
print("修改价格(普通商品返回数据)\(sender)")
self.dataMdoel?.order_goods = sender
// listView.reloadData()
loadData()
}
......@@ -238,7 +241,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
print("修改价格(预售返回数据)--只更新datamodel,不请求网络\(sender)")
self.dataMdoel?.order_res?.sale_res?.dj_amount = sender!.dj_amount
self.dataMdoel?.order_res?.sale_res?.wk_amount = sender!.wk_amount
// listView.reloadData()
loadData()
}
......@@ -267,7 +270,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
//MARK: - cell delegate
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if !isCaneditLatsData {
return
}
if indexPath.section == 4 {
if indexPath.row == 5{
print("运单号")
......@@ -321,19 +326,28 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
switch indexPath.section {
case 0:
cell.nameLbl.text = "关联客户"
if self.dataMdoel?.order_res?.cus_id != 0 {
cell.contentLbl.text = self.dataMdoel?.order_res?.cus_name
}else{
//如果不刷新请求,那么就更新本地,建议还是刷新,暂不刷
cell.contentLbl.text = "请选择关联客户"
if !isCaneditLatsData {
cell.contentLbl.text = "-"
}
}
if !isCaneditLatsData {
cell.arrowImg.isHidden = true
cell.contentRight.constant = 15
}else{
cell.arrowImg.isHidden = false
cell.contentRight.constant = 32
}
break
case 1:
//MARK:--商品cell
let cell = tableView.dequeueReusableCell(withIdentifier: "XuanZeShangPinCell") as! XuanZeShangPinCell
cell.priceLbl.isHidden = false
cell.detailLbl2.isHidden = true
cell.selectBtn.isHidden = true
if isYuShou {
cell.yuShouImg.isHidden = false
......@@ -341,14 +355,15 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
if indexPath.row == 1 {
cell.lineView.isHidden = true
}
//MARK:--暂时不显示CELL图片
// cell.imageView.
let rowModel = self.dataMdoel?.order_goods![indexPath.row]
cell.iconImg?.sd_setImage(with: URL(string: SERVERCE_ImageHost + (rowModel?.goods_thumb)!))
cell.nameLbl.text = rowModel?.goods_name
cell.detailLbl.text = rowModel?.goods_attr
cell.priceLbl.text = "¥" + (rowModel?.goods_price!)!
cell.detailLbl2.text = "x" + StringByInt(number: (rowModel?.cart_number!)!)
return cell
case 2:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
......@@ -361,8 +376,6 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
switch indexPath.row {
case 0:
print("预售定金")
print(self.dataMdoel?.order_res?.sale_res?.dj_amount)
if self.dataMdoel?.order_res?.sale_res?.dj_pay_status == 1 {
cell.textTF.text = "(已付)" + "¥" + (self.dataMdoel?.order_res?.sale_res?.dj_amount)!
......@@ -449,7 +462,12 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
if self.dataMdoel?.order_res?.lwb_no == nil {
cell.contentLbl.text = "-"
}else if cell.contentLbl.text?.count == 0 {
cell.contentLbl.text = "请输入物流单号"
if !isCaneditLatsData {
//MARK:-不能进行修改了
cell.contentLbl.text = "-"
}
}
break
......@@ -460,6 +478,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}else{
if self.dataMdoel?.order_res?.order_postscript?.count == 0 {
cell.contentLbl.text = "请输入订单备注"
if !isCaneditLatsData {
cell.contentLbl.text = "-"
}
}
}
......@@ -467,6 +488,13 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
default:
break
}
if !isCaneditLatsData {
cell.editIconImgV.isHidden = true
cell.contentRight.constant = 15
}else{
cell.editIconImgV.isHidden = false
cell.contentRight.constant = 45
}
return cell
}
if indexPath.row == 4 || indexPath.row == 6 || indexPath.row == 7 || indexPath.row == (6 + isYushoucount) || indexPath.row == (7 + isYushoucount){
......@@ -477,6 +505,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}
cell.arrowImg.isHidden = false
cell.contentRight.constant = 32
switch indexPath.row {
case 4:
......@@ -484,7 +513,6 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
break
case 6:
if isYuShou {
// dj_payWay = (self.dataMdoel?.order_res?.sale_res?.dj_pay_type!)!
cell.contentLbl.text = self.dataMdoel?.order_res?.sale_res?.dj_pay_type_cn
}else{
......@@ -504,7 +532,6 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
break
case 8:
if isYuShou {
// wk_payWay = (self.dataMdoel?.order_res?.sale_res?.wk_pay_type!)!
cell.contentLbl.text = self.dataMdoel?.order_res?.sale_res?.wk_pay_type_cn
}else{
cell.contentLbl.text = StringByInt(number: (self.dataMdoel?.order_res?.sale_res?.wk_pay_type!)!)
......@@ -517,6 +544,34 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
default:
break
}
//追加pay_type
if !isCaneditLatsData {
cell.arrowImg.isHidden = true
cell.contentRight.constant = 15
}else{
cell.arrowImg.isHidden = false
cell.contentRight.constant = 32
if indexPath.row == 9 {
if self.dataMdoel?.order_res?.sale_res?.wk_pay_type == 11 || self.dataMdoel?.order_res?.sale_res?.wk_pay_type == 12 {
cell.arrowImg.isHidden = true
cell.contentRight.constant = 15
}
}else if indexPath.row == 7 {
if isYuShou {
if self.dataMdoel?.order_res?.sale_res?.dj_pay_type == 11 || self.dataMdoel?.order_res?.sale_res?.dj_pay_type == 12 {
cell.arrowImg.isHidden = true
cell.contentRight.constant = 15
}
}else{
if self.dataMdoel?.order_res?.pay_type == 11 || self.dataMdoel?.order_res?.pay_type == 12 {
cell.arrowImg.isHidden = true
cell.contentRight.constant = 15
}
}
}
}
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
......@@ -584,6 +639,10 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
var lcModel : LogisticsCompanyModel? = nil
func btnClick(content: String, cell: TitleAndBtnCell) {
if !isCaneditLatsData {
//MARK:-不能进行修改了
return;
}
switch cell.nameLbl.text {
case "物流公司":
......@@ -644,6 +703,11 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
self.navigationController?.pushViewController(vc, animated: true)
break
case "支付方式":
if self.dataMdoel?.order_res?.pay_type == 11 || self.dataMdoel?.order_res?.pay_type == 12 {
return
}
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.tag = cell.tag
......@@ -662,6 +726,10 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
//无需处理:根据网络变更
break
case "定金支付方式":
if self.dataMdoel?.order_res?.sale_res?.dj_pay_type == 11 || self.dataMdoel?.order_res?.sale_res?.dj_pay_type == 12 {
return
}
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.tag = cell.tag
......@@ -675,6 +743,10 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}
break
case "尾款支付方式":
if self.dataMdoel?.order_res?.sale_res?.wk_pay_type == 11 || self.dataMdoel?.order_res?.sale_res?.wk_pay_type == 12 {
return
}
print("尾款支付方式")
print(cell.tag)
if glSelectView == nil {
......@@ -716,8 +788,11 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
self.dataMdoel?.order_res?.sale_res?.dj_pay_status_cn = "已付款"
}
self.dataMdoel?.order_res?.sale_res?.dj_pay_type = pay_type
self.listView.reloadData()
}
}) { (error) in
......@@ -744,7 +819,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
self.dataMdoel?.order_res?.sale_res?.wk_pay_status_cn = "已付款"
}
self.dataMdoel?.order_res?.sale_res?.wk_pay_type = pay_type
self.listView.reloadData()
}
......@@ -774,7 +850,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
self.dataMdoel?.order_res?.pay_status_cn = "已付款"
}
self.dataMdoel?.order_res?.pay_type = pay_type
self.listView.reloadData()
}
......@@ -866,7 +942,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
switch section {
case 1:
if isYuShou == false {
if dataArr.count > 2 {
if (self.dataMdoel?.order_goods?.count)! > 2 {
return 33.5
}else{
return 0.01
......@@ -914,20 +990,32 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
//MARK: - header delegate
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
view.subviews.forEach { (subV) in
subV.removeFromSuperview()
}
switch section {
case 1:
let view = TitleAndLblView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 49))
view.nameLbl.text = "订单状态"
let view1 = TitleAndLblView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 49))
view1.nameLbl.text = "订单状态"
//订单状态
view.contentLbl.text = orderStatusStrByInt(statusNumber: (self.dataMdoel?.order_res?.order_status)!)
view1.contentLbl.text = orderStatusStrByInt(statusNumber: (self.dataMdoel?.order_res?.order_status)!)
view.addSubview(view1)
return view
case 3:
let view = HeaderOnlyTitleView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
view.nameLbl.text = "收货信息"
let view1 = HeaderOnlyTitleView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
view1.nameLbl.text = "收货信息"
view.addSubview(view1)
if self.dataMdoel?.order_res?.shipping_type == 1{
view1.isHidden = false
}else{
view1.isHidden = true
}
return view
case 4:
let view = HeaderOnlyTitleView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
view.nameLbl.text = "订单信息"
let view1 = HeaderOnlyTitleView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
view1.nameLbl.text = "订单信息"
view.addSubview(view1)
return view
default:
break
......
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