Commit 04e100aa authored by lujunye's avatar lujunye

修改铺货数量显示方式

parent db4fdf97
......@@ -142,7 +142,8 @@ class supSpreadGoodsModel: Mappable {
}
class supSpreadGoodsTotalModel: Mappable {
var sum_goods : Int?//可铺商品总和
var sum_goods : Int?//已铺
var sum_goods2 : Int?//可铺
var res :Array<supSpreadGoodsDataModel>?
required init?( map: Map) {
......@@ -150,6 +151,7 @@ class supSpreadGoodsTotalModel: Mappable {
}
func mapping(map: Map) {
sum_goods <- map["sum_goods"]
sum_goods2 <- map["sum_goods2"]
res <- map["res"]
}
}
......
......@@ -21,7 +21,6 @@
<outlet property="payJueBtn" destination="puW-3j-GZy" id="tKT-TY-Eje"/>
<outlet property="payNumTypelbl" destination="acM-Ba-Vki" id="zmV-zH-M0d"/>
<outlet property="payTF" destination="Ysc-L7-nMy" id="En1-Zp-I2f"/>
<outlet property="percent_price_lbl" destination="oXq-yW-4YF" id="yoP-x7-g7s"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
......@@ -64,7 +63,7 @@
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="分销价格:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jKn-y5-ixC">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="分销价格:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jKn-y5-ixC">
<rect key="frame" x="15" y="68" width="56" height="19"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
......@@ -152,15 +151,6 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oXq-yW-4YF">
<rect key="frame" x="209" y="173" width="71" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="mfZ-eM-ZTX"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="密码错误字体颜色"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" name="白色背景色"/>
<constraints>
......@@ -186,12 +176,9 @@
<constraint firstAttribute="trailing" secondItem="QMk-dx-2zr" secondAttribute="trailing" constant="10" id="ecH-CC-gfR"/>
<constraint firstItem="f2v-Db-np2" firstAttribute="centerY" secondItem="9SL-t2-xg8" secondAttribute="centerY" id="f3X-gx-xEz"/>
<constraint firstItem="jKn-y5-ixC" firstAttribute="leading" secondItem="xBK-zg-doj" secondAttribute="leading" constant="15" id="nSW-iI-EmW"/>
<constraint firstItem="oXq-yW-4YF" firstAttribute="leading" secondItem="acM-Ba-Vki" secondAttribute="trailing" constant="10" id="oRJ-fa-Wr0"/>
<constraint firstItem="QMk-dx-2zr" firstAttribute="centerY" secondItem="jKn-y5-ixC" secondAttribute="centerY" id="p6G-o9-C86"/>
<constraint firstAttribute="trailing" secondItem="oXq-yW-4YF" secondAttribute="trailing" constant="15" id="pBd-Ts-Ors"/>
<constraint firstItem="qLO-Gc-A3W" firstAttribute="centerY" secondItem="o0f-Uf-X61" secondAttribute="centerY" id="pxP-3E-XFK"/>
<constraint firstItem="f0i-Vm-UAy" firstAttribute="leading" secondItem="f2v-Db-np2" secondAttribute="trailing" constant="25" id="qvK-eL-hk6"/>
<constraint firstItem="oXq-yW-4YF" firstAttribute="centerY" secondItem="acM-Ba-Vki" secondAttribute="centerY" id="xkP-1R-dMu"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N4C-9w-dcG">
......@@ -325,9 +312,6 @@
<namedColor name="9A9A9A">
<color red="0.60392156862745094" green="0.60392156862745094" blue="0.60392156862745094" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="密码错误字体颜色">
<color red="0.88999998569488525" green="0.27799999713897705" blue="0.27799999713897705" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="提示视图背景色">
<color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
......@@ -16,7 +16,7 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
let model = datas[idx]
var action = 1
var intro = "铺货成功~"
if bottom_title_lbl.text == "已铺货" {
if leftBtn.isSelected {
action = 2
intro = "取消成功~"
}
......@@ -32,8 +32,7 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
}
@IBOutlet weak var center_select_btn: UIButton!
@IBOutlet weak var count_lbl: UILabel!//已铺货/可铺货 数量
@IBOutlet weak var bottom_title_lbl: UILabel!
@IBOutlet weak var rightBtn: UIButton!
@IBOutlet weak var leftBtn: UIButton!
......@@ -48,12 +47,12 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
if sender.tag == 0 {
rightBtn.isSelected = false
leftBtn.isSelected = true
bottom_title_lbl.text = "已铺货"
// bottom_title_lbl.text = "已铺货"
}else{
rightBtn.isSelected = true
leftBtn.isSelected = false
bottom_title_lbl.text = "可铺货"
// bottom_title_lbl.text = "可铺货"
}
......@@ -107,7 +106,7 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
let vc = GYS_FX_SearchViewController()
vc.shop_id = shop_id
vc.UserToken = UserToken as! String
if bottom_title_lbl.text != "已铺货"{
if leftBtn.isSelected {
vc.look_type = 2
}
cover_Btn.isHidden = true
......@@ -196,9 +195,9 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
print("加载数据")
page = 1
isUpData = true
var look_type = 1
if bottom_title_lbl.text != "已铺货"{
look_type = 2
var look_type = 2
if leftBtn.isSelected {
look_type = 1
}
let dic = ["user_token":UserToken as Any,"retrieval":"" as Any,"page":page as Any,"look_type":look_type as Any,"shop_id":shop_id as Any]
......@@ -213,11 +212,34 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
self.home_list_tbv.reloadData()
self.home_list_tbv?.mj_header?.endRefreshing()
self.page = 2
self.count_lbl.text = "0"
if model.data?.sum_goods != nil {
self.count_lbl.text = StringByInt(number: (model.data?.sum_goods!)!)
}
if self.leftBtn.isSelected {
if model.data?.sum_goods != 0 && model.data?.sum_goods != nil{
self.leftBtn.setTitle("已铺货商品(" + StringByInt(number: (model.data?.sum_goods)!) + ")" , for: .selected)
}else{
self.leftBtn.setTitle("已铺货商品" , for: .selected)
}
if model.data?.sum_goods2 != 0 && model.data?.sum_goods2 != nil {
self.rightBtn.setTitle("可铺货商品(" + StringByInt(number: (model.data?.sum_goods2)!) + ")" , for: .normal)
}else{
self.rightBtn.setTitle("可铺货商品" , for: .normal)
}
}else{
if model.data?.sum_goods != 0 && model.data?.sum_goods != nil{
self.leftBtn.setTitle("已铺货商品(" + StringByInt(number: (model.data?.sum_goods)!) + ")" , for: .normal)
}else{
self.leftBtn.setTitle("已铺货商品" , for: .normal)
}
if model.data?.sum_goods2 != 0 && model.data?.sum_goods2 != nil {
self.rightBtn.setTitle("可铺货商品(" + StringByInt(number: (model.data?.sum_goods2)!) + ")" , for: .selected)
}else{
self.rightBtn.setTitle("可铺货商品" , for: .selected)
}
}
if model.data?.res?.count == 0 {
self.home_list_tbv?.mj_footer?.endRefreshingWithNoMoreData()
......@@ -233,9 +255,9 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
@objc func loadMoreData(){
print("加载更多数据")
var look_type = 1
if bottom_title_lbl.text != "已铺货"{
look_type = 2
var look_type = 2
if leftBtn.isSelected {
look_type = 1
}
let dic = ["user_token":UserToken as Any,"retrieval":"" as Any,"page":page as Any,"look_type":look_type as Any,"shop_id":shop_id as Any]
......@@ -273,7 +295,7 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView == home_list_tbv {
let cell = tableView.dequeueReusableCell(withIdentifier: "GYS_FX_ProductCellTableViewCell") as! GYS_FX_ProductCellTableViewCell
if bottom_title_lbl.text == "已铺货"{
if leftBtn.isSelected {
cell.submitBtn.setTitle("取消铺货", for: .normal)
}else{
cell.submitBtn.setTitle("铺货", for: .normal)
......
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