younger_times
2023-07-24 858bd6df13a6a6415d12d8e60141575574646f58
新增
50个文件已修改
9个文件已添加
1398 ■■■■■ 已修改文件
Podfile 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai-Bridging-Header.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/AppDelegate.swift 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_map_local.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_map_local.imageset/btn_local@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_map_local.imageset/btn_map_local@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_userProfile.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_userProfile.imageset/btn_userProfile@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Btns/btn_userProfile.imageset/btn_userProfile@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/icon_point.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/icon_point.imageset/icon_local@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/icon_point.imageset/icon_local@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Common/View/AgreentView.swift 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Config/Def.swift 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Config/Enums.swift 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Model/CommonModels.swift 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Network/Services.swift 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/VC/ProfileVC.swift 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/VC/ProfileVC.xib 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/CCell/SearchBannerCCell.swift 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/CCell/SearchBannerCCell.xib 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/CCell/UploadImgCCell.swift 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/CCell/UploadImgCCell.xib 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/CustomerContentQATCell.swift 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/CustomerContentQATCell.xib 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/CustomerContentTCell.swift 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/CustomerContentTCell.xib 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/SearchStoreDetail_1_TCell.swift 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/SearchStoreDetail_1_TCell.xib 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/CustomerContentDetailVC.swift 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/CustomerContentDetailVC.xib 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/CustomerListVC.swift 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/CustomerSubListVC.swift 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchStoreDetailFeedbackVC.swift 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchStoreDetailFeedbackVC.xib 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchStoreDetailVC.swift 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchStoreListVC.swift 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchVC.swift 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchVC.xib 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/View/SearchStoreDetailHeadView.swift 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/View/SearchStoreDetailHeadView.xib 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/CCell/WelfareCoinCCell.swift 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/CCell/WelfareCoinCCell.xib 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/TCell/BillInfoTCell.swift 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/TCell/BillInfoTCell.xib 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/TCell/WelfareCouponsTCell.swift 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/TCell/WelfareCouponsTCell.xib 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/RechargeCenterVC.swift 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/RechargeCenterVC.xib 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/RechargeRecordVC.swift 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/RechargeRecordVC.xib 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/WelfareBillListVC.swift 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/WelfareCouponsListVC.swift 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/WelfareCouponsSubListVC.swift 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/WelfareVC.swift 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/WelfareVC.xib 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/View/CoinStoreHeadView.swift 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Yard/TCell/YardTCell.swift 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Yard/TCell/YardTCell.xib 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Podfile
@@ -17,6 +17,7 @@
  pod 'AliyunOSSiOS'
  pod 'WechatOpenSDK-XCFramework'
  pod 'AlipaySDK-iOS'
  pod 'AMap2DMap-NO-IDFA'
  post_install do |installer|
WanPai-Bridging-Header.h
@@ -9,5 +9,6 @@
#define WanPai_Bridging_Header_h
#import "WXApi.h"
#import <AlipaySDK/AlipaySDK.h>
#import <MAMapKit/MAMapKit.h>
#endif /* WanPai_Bridging_Header_h */
WanPai/AppDelegate.swift
@@ -8,6 +8,7 @@
import UIKit
import JQTools
import Alamofire
import AMapFoundationKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -20,6 +21,8 @@
        Services.startNetworkMonitor()
        YYPaymentManager.shared.configuredWeChat(appID: WeChatAPPID, universalLink: WechatUniversalLinks)
        YYPaymentManager.shared.configuredAlipay(appScheme: APPScheme)
        AMapServices.shared().enableHTTPS = true
        AMapServices.shared().apiKey = AMapKey
        return true
    }
WanPai/Assets.xcassets/Btns/btn_map_local.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "btn_map_local@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "btn_local@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Btns/btn_map_local.imageset/btn_local@3x.png
WanPai/Assets.xcassets/Btns/btn_map_local.imageset/btn_map_local@2x.png
WanPai/Assets.xcassets/Btns/btn_userProfile.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "btn_userProfile@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "btn_userProfile@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Btns/btn_userProfile.imageset/btn_userProfile@2x.png
WanPai/Assets.xcassets/Btns/btn_userProfile.imageset/btn_userProfile@3x.png
WanPai/Assets.xcassets/Icons/icon_point.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "icon_local@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "icon_local@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/icon_point.imageset/icon_local@2x.png
WanPai/Assets.xcassets/Icons/icon_point.imageset/icon_local@3x.png
WanPai/Common/View/AgreentView.swift
@@ -17,6 +17,7 @@
    @IBOutlet weak var webView: WKWebView!
    @IBOutlet weak var bottom_cons: NSLayoutConstraint!
    private var type:AgreentType!
    private var content:String?
    private let disposeBag = DisposeBag()
    
    override func awakeFromNib() {
@@ -27,11 +28,12 @@
    }
    
    
    static func show(type:AgreentType){
    static func show(type:AgreentType,content:String? = nil){
        let alertView = AgreentView.jq_loadNibView()
        alertView.frame = screnDelegate?.window?.frame ?? .zero
        alertView.type = type
        alertView.label_title.text = type.titleStr
        alertView.content = content
        screnDelegate?.window?.addSubview(alertView)
        alertView.bottom_cons.constant = 0
        
@@ -39,11 +41,15 @@
            alertView.layoutIfNeeded()
        }
        Services.queryProtocol(type,progress: false).subscribe(onNext: { result in
            if let text = result.data?.jq_wrapHtml(){
                alertView.webView.loadHTMLString(text, baseURL: nil)
            }
        }).disposed(by: alertView.disposeBag)
        if type != .other{
            Services.queryProtocol(type,progress: false).subscribe(onNext: { result in
                if let text = result.data?.jq_wrapHtml(){
                    alertView.webView.loadHTMLString(text, baseURL: nil)
                }
            }).disposed(by: alertView.disposeBag)
        }else{
            alertView.webView.loadHTMLString(content?.jq_wrapHtml() ?? "", baseURL: nil)
        }
    }
    
    
WanPai/Config/Def.swift
@@ -11,12 +11,11 @@
import SVProgressHUD
import QMUIKit
let SHAKEY = "BT7NPhA0f775uzcUuftWjCE1TYZlWmHZ"
let WechatUniversalLinks = ""
let WeChatAPPID = ""
let APPScheme = "weparklife"
let AMapKey = "a2aff8a000be5543e410555c548793b8"
let app = UIApplication.shared.delegate as! AppDelegate
@@ -55,15 +54,18 @@
    //提示框
func alert(msg: String) {
    hiddenHUD()
    SVProgressHUD.showInfo(withStatus: msg)
}
func alertError(msg:String){
    hiddenHUD()
    SVProgressHUD.setMinimumDismissTimeInterval(1.5)
    SVProgressHUD.showError(withStatus: msg)
}
func alertSuccess(msg:String){
    hiddenHUD()
    SVProgressHUD.showSuccess(withStatus: msg)
}
WanPai/Config/Enums.swift
@@ -49,15 +49,18 @@
enum AgreentType:Int {
    case user = 1
    case safe = 3
    case privacy = 2
    case other = 4
    var titleStr:String{
        switch self{
            case .privacy:return "隐私协议"
            case .safe:return "运动安全告知书"
            case .user:return "用户协议"
            case .other:return ""
        }
    }
}
@@ -241,3 +244,25 @@
        }
    }
}
enum CouponConditionType:Int,HandyJSONEnum{
    case nationwide = 1 //全国
    case city = 2 //城市
    case store = 3 // 门店
    var titleRaw:String{
        switch self {
            case .nationwide:return "全国通用"
            case .city:return "指定城市可用"
            case .store:return "指定门店可用"
        }
    }
}
enum CouponUseType:Int,HandyJSONEnum{
    case unused = 1
    case used = 2
    case overdue = 3
}
WanPai/Model/CommonModels.swift
@@ -79,7 +79,7 @@
}
struct CouponInfoModel:HandyJSON{
    ///有效时间
        ///有效时间
    var effectiveTime: String = ""
        /// 优惠内容
    var favorable: String = ""
@@ -116,7 +116,7 @@
struct ActivityDetailModel:HandyJSON{
    var address: String = ""
    var age: String = ""
    ///是否报名
        ///是否报名
    var apply:Int = 0
    var city: String = ""
    var distance: Double = 0
@@ -178,7 +178,7 @@
    var integral: Int = 0
    var introduce: String = ""
    var name: String = ""
    ///学习状态(0=未学习,1=已学习)
        ///学习状态(0=未学习,1=已学习)
    var study: Int = 0
    var courseVideo:String = ""
@@ -195,7 +195,7 @@
    var donateHours: Int = 0
    var image: String = ""
    var originalPrice: Double = 0
    ///状态(1=查看详情 2=暂未开始)
        ///状态(1=查看详情 2=暂未开始)
    var status: Int = 0
    var storeDistance: Double = 0
}
@@ -206,7 +206,7 @@
    var coursePackageDiscountId:Int = 0
    var coursePackageName: String = ""
    var coverDrawing:String = ""
    ///折扣价/会员价
        ///折扣价/会员价
    var discountPrice:Double = 0
    var distance:Double = 0
    var freeClassHours:Int = 0
@@ -282,7 +282,7 @@
    var exerciseVideoList = [StartClouseVideoListModel]()
    var height: Int = 0
    var imgs: String?
    ///是否有学员信息 (1. 有学员信息 2.没有学员信息)
        ///是否有学员信息 (1. 有学员信息 2.没有学员信息)
    var isThere: Int = 2
    var remainingNums: Int = 0
    var stuAge: Int = 0
@@ -311,3 +311,123 @@
    var url = ""
    var weight:Int = 0
}
class StartClouseExploreModel:HandyJSON{
    var distance:Double = 0
    var storeAddr = ""
    var storeId:Int = 0
    var storeImg = ""
    var storeName = ""
    var latitude:Double = 0
    var longitude:Double = 0
    var annotation:MAPointAnnotation?
    required init(){}
}
struct NoticeItemModel:HandyJSON{
    var noticeContents = ""
    var noticeId = 0
    var noticeTitle = ""
    var noticeTime = ""
}
struct SearchStoreDetailModel:HandyJSON{
    var courseVoList = [SearchStoreDetailCourseModel]()
    var images = [String]()
    var storeAddress: String = ""
    var storeId: Int = 0
    var storeInfo: String = ""
    var storeName: String = ""
    var storeTime: String = ""
    var phone:String = ""
    var lat:Double = 0
    var lon:Double = 0
    var venueList = [SearchStoreDetailVenueModel]()
}
struct SearchStoreDetailCourseModel:HandyJSON{
    var applicantsNumber: Int = 0
    var classHours: Int = 0
    var classStartTime: String = ""
    var courseId: Int = 0
    var coverDrawing: String = ""
    var name: String = ""
    var originalPrice:Double = 0
}
struct SearchStoreDetailVenueModel:HandyJSON{
    var price:Double = 0
    var siteId: Int = 0
    var siteName: String = ""
    var siteTime: String = ""
    var siteType: String = ""
}
struct UserInfoModel:HandyJSON{
    var address: String = ""
    var birthday: String = ""
    var memberLifespan: String = ""
    var sex: GenderType = .man
    var userImage: String = ""
    var userName: String = ""
    var userPhone: String = ""
}
struct BenefitHomeModel:HandyJSON{
    var commodities = [BenefitHomeCommonditiesModel]()
    var image: BenefitImageModel?
    var isMember: String = ""
    var userHeadImg: String = ""
    var userIntegral: Int = 0
    var userName: String = ""
    var wpCoin: Int = 0
}
struct BenefitImageModel:HandyJSON{
    var myConpons: String?
    var onlineShop: String?
    var todayFree: String?
    var weeksBenefit: String?
}
struct BenefitHomeCommonditiesModel:HandyJSON{
    var commodityId: Int = 0
    var commodityImg: String = ""
    var commodityName: String = ""
    var commodityPrice: Double = 0
}
struct BillingModel:HandyJSON{
    var consumeAmount:Double = 0
    var consumeName = ""
    var consumeTime = ""
}
struct CouponModel:HandyJSON{
    var available: String = ""
    var cityOrStore: String = ""
    var effectiveTime: String = ""
    var id: Int = 0
    var instructionsForUse: String = ""
    var name: String = ""
    var ruleModel: CouponModelRuleModel?
    var type:CouponType = .discount
    var useCondition: CouponConditionType = .nationwide
    var useStatus: CouponUseType = .overdue
}
struct CouponModelRuleModel:HandyJSON{
    var conditionalAmount: Double = 0
    var deductionAmount: Double = 0
    var experienceName: String = ""
}
struct CoinExchangeModel:HandyJSON{
    var amount:Double = 0
    var wpGold:Int = 0
}
WanPai/Network/Services.swift
@@ -12,7 +12,8 @@
import JQTools
#if DEBUG
let All_Url = "https://console-mock.apipost.cn/mock/b5b2dee0-5564-40ae-f082-a352d502a153"
//let All_Url = "https://console-mock.apipost.cn/mock/b5b2dee0-5564-40ae-f082-a352d502a153"
let All_Url = "http://192.168.110.165:10393/mock/b5b2dee0-5564-40ae-f082-a352d502a153"
#else
let All_Url = "http://192.168.110.80:5209"
#endif
@@ -96,6 +97,71 @@
            .append(key: "phone", value: phone)
            .append(key: "password", value: password.jq_md5String().uppercased())
            .append(key: "code", value: code)
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
        /// 用户详情
    class func userDetails()->Observable<BaseResponse<UserInfoModel>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/useBenefit/userDetails")
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
}
// MARK: -- 福利相关
extension Services{
    class func benefitHome()->Observable<BaseResponse<BenefitHomeModel>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/useBenefit/indexOfAppUser")
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        /// 账单
        /// - Parameters:
        ///   - recordType: 记录(1充值 2扣除)
    class func billingList(recordType:Int?,yearMonth:String)->Observable<BaseResponse<[BillingModel]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/useBenefit/userBilling")
            .append(key: "recordId", value: recordType)
            .append(key: "yearMonth", value: yearMonth)
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        /// 优惠券
    class func myCouponList(type:Int?,useStatus:Int?)->Observable<BaseResponse<[CouponModel]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/activity/api/coupon/queryCouponPackage")
            .append(key: "couponType", value: type)
            .append(key: "yearMonth", value: useStatus)
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        /// 充值明细
        /// - Parameters:
        ///   - yearMonth:  记录(1充值 2扣除)
    class func voucherDetail(recordType:Int?,yearMonth:String)->Observable<BaseResponse<[BillingModel]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/useBenefit/voucherDetail")
            .append(key: "recordId", value: recordType)
            .append(key: "yearMonth", value: yearMonth)
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        /// 充值列表
    class func voucherCenter()->Observable<BaseResponse<[CoinExchangeModel]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/useBenefit/voucherCenter")
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
        /// 支付
    class func useBenefitPayment(payAmount:Double,payType:PayType)->Observable<BaseResponse<SimpleModel>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/useBenefit/payment")
            .append(key: "payAmount", value: payAmount)
            .append(key: "payType", value: payType.rawValue)
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
}
@@ -251,6 +317,73 @@
            .append(key: "stuId", value: stuId)
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
//    static func
}
// MARK: -- 探索玩湃
extension Services{
        /// 探索玩湃首页数据
    static func exploreHome()->Observable<BaseResponse<[StartClouseExploreModel]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/exploreWP/indexOfExl")
            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        /// 获取公告列表/常见问题列表
    static func exploreNoticeList(type:CustomerSubListVC.CustomerSubType)->Observable<BaseResponse<[NoticeItemModel]>>{
        let params = ParamsAppender.build(url: All_Url)
        if type == .notice{
            params.interface(url: "/account/base/exploreWP/noticeList")
        }else{
            params.interface(url: "/account/base/exploreWP/exceptionList")
        }
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        ///  查看详情
    static func exploreNoticeDetail(id:Int,type:CustomerSubListVC.CustomerSubType)->Observable<BaseResponse<NoticeItemModel>>{
        let params = ParamsAppender.build(url: All_Url)
        if type == .notice{
            params.interface(url: "/account/base/exploreWP/noticeDetail")
            params.append(key: "noId", value: id)
        }else{
            params.interface(url: "/account/base/exploreWP/exceptionDetail")
            params.append(key: "quesId", value: id)
        }
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
        /// 客服电话
    static func customerPhone()->Observable<BaseResponse<[String]>>{
        let params = ParamsAppender.build(url: All_Url)
            params.interface(url: "/account/base/exploreWP/customerList")
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
        /// 获取门店详情
    static func exploreStoreDetail(storeId:Int)->Observable<BaseResponse<SearchStoreDetailModel>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/base/exploreWP/storeDetail")
            .append(key: "storeId", value: storeId)
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
        /// 评价门店
    static func evaluationStore(id:Int,content:String,imgs:String,score:Int)->Observable<BaseResponse<SimpleModel>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/other/base/storeEvaluation/saveEvaluation")
            .append(key: "storeId", value: id)
            .append(key: "content", value: content)
            .append(key: "imgs", value: imgs)
            .append(key: "score", value: score)
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
}
// MARK: -- 预约场地
WanPai/Root/Other/VC/ProfileVC.swift
@@ -6,13 +6,50 @@
//
import UIKit
import QMUIKit
import JQTools
class ProfileVC: BaseVC {
    @IBOutlet weak var btn_userProfile: UIButton!
    @IBOutlet weak var label_username: UILabel!
    @IBOutlet weak var label_contact: UILabel!
    @IBOutlet weak var label_gender: UILabel!
    @IBOutlet weak var label_birthday: UILabel!
    @IBOutlet weak var label_address: UILabel!
    @IBOutlet weak var label_vipDutime: UILabel!
    private var profileImg:UIImage?
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "个人信息"
        Services.userDetails().subscribe(onNext: {[weak self] data in
            if let model = data.data{
                self?.label_username.text = model.userName
                self?.label_contact.text = model.userPhone
                self?.label_gender.text = model.sex == .man ? "男":"女"
                self?.label_birthday.text = model.birthday
                self?.label_address.text = model.address
                self?.label_vipDutime.text = model.memberLifespan
                self?.btn_userProfile.sd_setImage(with: URL(string: model.userImage), for: .normal,placeholderImage: UIImage(named: "btn_userProfile"))
            }
        }).disposed(by: disposeBag)
    }
    @IBAction func logoutAction(_ sender: UIButton) {
    }
    @IBAction func updateProfileAction(_ sender: UIButton) {
        JQ_ImagePickerTool.getSharedInstance().singleImage({ image in
            self.profileImg = image
        }, clipSize: CGSize(width: JQ_ScreenW, height: JQ_ScreenW))
    }
    @IBAction func dismissAccountAction(_ sender: UIButton) {
    }
}
WanPai/Root/Other/VC/ProfileVC.xib
@@ -12,6 +12,13 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ProfileVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="btn_userProfile" destination="DAK-PF-zJB" id="nEH-tc-Bcw"/>
                <outlet property="label_address" destination="KeY-Wp-GF3" id="yeU-Zs-Eyj"/>
                <outlet property="label_birthday" destination="UxX-uD-G2b" id="dlU-zJ-BIp"/>
                <outlet property="label_contact" destination="Ec9-N9-5yO" id="Di4-et-GO3"/>
                <outlet property="label_gender" destination="BV9-ZD-gTd" id="Dkl-IE-bSw"/>
                <outlet property="label_username" destination="eQF-2k-COB" id="5jd-xX-OHH"/>
                <outlet property="label_vipDutime" destination="Xkh-Hd-htf" id="bim-Pe-zm1"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
@@ -35,6 +42,9 @@
                            <real key="value" value="56"/>
                        </userDefinedRuntimeAttribute>
                    </userDefinedRuntimeAttributes>
                    <connections>
                        <action selector="updateProfileAction:" destination="-1" eventType="touchUpInside" id="o0X-nt-Wcu"/>
                    </connections>
                </button>
                <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="R9B-6k-bGu">
                    <rect key="frame" x="0.0" y="253" width="393" height="300"/>
@@ -266,6 +276,9 @@
                            <real key="value" value="20"/>
                        </userDefinedRuntimeAttribute>
                    </userDefinedRuntimeAttributes>
                    <connections>
                        <action selector="logoutAction:" destination="-1" eventType="touchUpInside" id="4VC-G0-dpn"/>
                    </connections>
                </button>
                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s12-1B-Lxb">
                    <rect key="frame" x="41" y="764" width="145.66666666666666" height="40"/>
@@ -289,6 +302,9 @@
                            <real key="value" value="1"/>
                        </userDefinedRuntimeAttribute>
                    </userDefinedRuntimeAttributes>
                    <connections>
                        <action selector="dismissAccountAction:" destination="-1" eventType="touchUpInside" id="1MR-wG-d2B"/>
                    </connections>
                </button>
            </subviews>
            <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
WanPai/Root/Search/CCell/SearchBannerCCell.swift
@@ -8,6 +8,19 @@
import UIKit
class SearchBannerCCell: UICollectionViewCell {
    @IBOutlet weak var img_cover: UIImageView!
    @IBOutlet weak var label_distance: UILabel!
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_address: UILabel!
    var startClouseExploreItemModel:StartClouseExploreModel!{
        didSet{
            img_cover.sd_setImage(with: URL(string: startClouseExploreItemModel.storeImg))
            label_distance.text = String(format: "离你最近%.1lfkm", startClouseExploreItemModel.distance)
            label_title.text = startClouseExploreItemModel.storeName
            label_address.text = startClouseExploreItemModel.storeAddr
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
WanPai/Root/Search/CCell/SearchBannerCCell.xib
@@ -80,6 +80,12 @@
                <constraint firstAttribute="bottom" secondItem="Rfe-En-Xee" secondAttribute="bottom" id="z1u-HX-mA9"/>
            </constraints>
            <size key="customSize" width="382" height="187"/>
            <connections>
                <outlet property="img_cover" destination="pTu-5i-L13" id="RBl-ek-ybz"/>
                <outlet property="label_address" destination="neg-i1-S7H" id="1vD-Gd-e0N"/>
                <outlet property="label_distance" destination="7Ad-qv-y5J" id="DYi-sG-VUW"/>
                <outlet property="label_title" destination="9qr-cP-39L" id="rdg-3J-NFv"/>
            </connections>
            <point key="canvasLocation" x="316.03053435114504" y="126.40845070422536"/>
        </collectionViewCell>
    </objects>
WanPai/Root/Search/CCell/UploadImgCCell.swift
@@ -8,7 +8,8 @@
import UIKit
class UploadImgCCell: UICollectionViewCell {
    @IBOutlet weak var btn_del: UIButton!
    @IBOutlet weak var img_cover: UIImageView!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
WanPai/Root/Search/CCell/UploadImgCCell.xib
@@ -37,6 +37,10 @@
                <constraint firstAttribute="bottom" secondItem="v5Q-qM-hTv" secondAttribute="bottom" constant="2.5" id="zmu-OG-hSq"/>
            </constraints>
            <size key="customSize" width="85" height="90"/>
            <connections>
                <outlet property="btn_del" destination="fFK-k3-YIh" id="b0f-MC-e1A"/>
                <outlet property="img_cover" destination="v5Q-qM-hTv" id="swz-CQ-LWj"/>
            </connections>
            <point key="canvasLocation" x="89.312977099236633" y="34.507042253521128"/>
        </collectionViewCell>
    </objects>
WanPai/Root/Search/TCell/CustomerContentQATCell.swift
@@ -8,6 +8,13 @@
import UIKit
class CustomerContentQATCell: UITableViewCell {
    @IBOutlet weak var label_content: UILabel!
    var noticeItemModel:NoticeItemModel!{
        didSet{
            label_content.text = noticeItemModel.noticeTitle
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
WanPai/Root/Search/TCell/CustomerContentQATCell.xib
@@ -10,18 +10,18 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_CustomerContentQATCell" rowHeight="98" id="KGk-i7-Jjw" customClass="CustomerContentQATCell" customModule="WanPai" customModuleProvider="target">
            <rect key="frame" x="0.0" y="0.0" width="514" height="98"/>
        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_CustomerContentQATCell" rowHeight="105" id="KGk-i7-Jjw" customClass="CustomerContentQATCell" customModule="WanPai" customModuleProvider="target">
            <rect key="frame" x="0.0" y="0.0" width="514" height="105"/>
            <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="514" height="98"/>
                <rect key="frame" x="0.0" y="0.0" width="514" height="105"/>
                <autoresizingMask key="autoresizingMask"/>
                <subviews>
                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="91R-P7-upR">
                        <rect key="frame" x="14" y="5.6666666666666643" width="486" height="87"/>
                        <rect key="frame" x="14" y="5.6666666666666643" width="486" height="94"/>
                        <subviews>
                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PRT-W8-xKQ">
                                <rect key="frame" x="14" y="27.999999999999996" width="7" height="7.0000000000000036"/>
                                <rect key="frame" x="14" y="43.333333333333336" width="7" height="7"/>
                                <color key="backgroundColor" red="0.28235294117647058" green="0.28235294117647058" blue="0.28235294117647058" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                <constraints>
                                    <constraint firstAttribute="height" constant="7" id="2Yl-RW-GZv"/>
@@ -35,7 +35,7 @@
                                </userDefinedRuntimeAttributes>
                            </view>
                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabel" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gQV-Pn-he3">
                                <rect key="frame" x="29" y="22" width="449" height="43"/>
                                <rect key="frame" x="29" y="22" width="449" height="50"/>
                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
                                <nil key="highlightedColor"/>
@@ -45,10 +45,10 @@
                        <constraints>
                            <constraint firstItem="gQV-Pn-he3" firstAttribute="leading" secondItem="PRT-W8-xKQ" secondAttribute="trailing" constant="8" id="Ax2-tb-14n"/>
                            <constraint firstAttribute="trailing" secondItem="gQV-Pn-he3" secondAttribute="trailing" constant="8" id="QSW-QF-lMs"/>
                            <constraint firstItem="PRT-W8-xKQ" firstAttribute="top" secondItem="91R-P7-upR" secondAttribute="top" constant="28" id="UM7-2d-gzZ"/>
                            <constraint firstItem="PRT-W8-xKQ" firstAttribute="leading" secondItem="91R-P7-upR" secondAttribute="leading" constant="14" id="dRH-JI-5jF"/>
                            <constraint firstAttribute="bottom" secondItem="gQV-Pn-he3" secondAttribute="bottom" constant="22" id="lv4-tZ-uXq"/>
                            <constraint firstItem="gQV-Pn-he3" firstAttribute="top" secondItem="91R-P7-upR" secondAttribute="top" constant="22" id="nuM-5a-QcQ"/>
                            <constraint firstItem="gQV-Pn-he3" firstAttribute="centerY" secondItem="PRT-W8-xKQ" secondAttribute="centerY" id="o9I-3t-LVA"/>
                        </constraints>
                        <userDefinedRuntimeAttributes>
                            <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
@@ -66,7 +66,10 @@
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <point key="canvasLocation" x="287.02290076335879" y="38.732394366197184"/>
            <connections>
                <outlet property="label_content" destination="gQV-Pn-he3" id="bPp-p5-wag"/>
            </connections>
            <point key="canvasLocation" x="287.02290076335879" y="40.492957746478872"/>
        </tableViewCell>
    </objects>
</document>
WanPai/Root/Search/TCell/CustomerContentTCell.swift
@@ -9,6 +9,18 @@
class CustomerContentTCell: UITableViewCell {
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_time: UILabel!
    @IBOutlet weak var label_content: UILabel!
    var noticeItemModel:NoticeItemModel!{
        didSet{
            label_title.text = noticeItemModel.noticeTitle
            label_time.text = noticeItemModel.noticeTime
            label_content.text = noticeItemModel.noticeContents
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        selectionStyle = .none
WanPai/Root/Search/TCell/CustomerContentTCell.xib
@@ -62,6 +62,11 @@
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="label_content" destination="0YV-aF-I28" id="yp6-hM-6HK"/>
                <outlet property="label_time" destination="0EP-LI-lSz" id="Vsh-1A-Lw9"/>
                <outlet property="label_title" destination="vdr-HC-ue6" id="CwV-M8-mW9"/>
            </connections>
            <point key="canvasLocation" x="62.595419847328245" y="54.577464788732399"/>
        </tableViewCell>
    </objects>
WanPai/Root/Search/TCell/SearchStoreDetail_1_TCell.swift
@@ -9,6 +9,26 @@
class SearchStoreDetail_1_TCell: UITableViewCell {
    var detailCourseModel:SearchStoreDetailCourseModel!{
        didSet{
            img_cover.sd_setImage(with: URL(string: detailCourseModel.coverDrawing))
            label_title.text = detailCourseModel.name
            label_teachTime.text = "上课时间:" + detailCourseModel.classStartTime
            label_hasNum.text = "包含课时数:\(detailCourseModel.classHours)"
            label_enrollNum.text = "已报名\(detailCourseModel.applicantsNumber)人"
            let price = String(format: "%@|详情", detailCourseModel.originalPrice.currency())
            btn_price.setTitle(price, for: .normal)
        }
    }
    @IBOutlet weak var img_cover: UIImageView!
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_teachTime: UILabel!
    @IBOutlet weak var label_hasNum: UILabel!
    @IBOutlet weak var label_enrollNum: UILabel!
    @IBOutlet weak var btn_price: UIButton!
    override func awakeFromNib() {
        super.awakeFromNib()
        selectionStyle = .none
WanPai/Root/Search/TCell/SearchStoreDetail_1_TCell.xib
@@ -135,6 +135,14 @@
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="btn_price" destination="c5W-VK-cgw" id="Zhu-2I-Uuw"/>
                <outlet property="img_cover" destination="QGN-0u-B5r" id="lx7-aD-TlV"/>
                <outlet property="label_enrollNum" destination="Z8g-e0-knk" id="oUX-D4-nbU"/>
                <outlet property="label_hasNum" destination="pVH-xx-Gth" id="0f1-qh-dXX"/>
                <outlet property="label_teachTime" destination="cOf-iE-VAe" id="Fd0-fd-Xov"/>
                <outlet property="label_title" destination="oRx-lW-o8z" id="CQn-v1-5eT"/>
            </connections>
            <point key="canvasLocation" x="217.55725190839695" y="69.718309859154928"/>
        </tableViewCell>
    </objects>
WanPai/Root/Search/VC/CustomerContentDetailVC.swift
@@ -6,11 +6,44 @@
//
import UIKit
import WebKit
class CustomerContentDetailVC: BaseVC {
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_datetime: UILabel!
    @IBOutlet weak var webView: WKWebView!
    private var id:Int!
    private var type:CustomerSubListVC.CustomerSubType!
    init(id:Int,type:CustomerSubListVC.CustomerSubType) {
        super.init(nibName: nil, bundle: nil)
        self.id = id
        self.type = type
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
            title = "常见问题"
        if type == .notice{
            title = "公告详情"
        }else{
            title = "问题详情"
        }
        Services.exploreNoticeDetail(id: id, type: type).subscribe(onNext: {[weak self] data in
            self?.label_title.text = data.data?.noticeTitle
            self?.label_datetime.text = data.data?.noticeTime
            if let str = data.data?.noticeContents.jq_wrapHtml(){
                self?.webView.loadHTMLString(str, baseURL: nil)
            }
        }).disposed(by: disposeBag)
    }
}
WanPai/Root/Search/VC/CustomerContentDetailVC.xib
@@ -11,7 +11,10 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CustomerContentDetailVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="label_datetime" destination="Djz-c0-gra" id="GQu-Lr-bvP"/>
                <outlet property="label_title" destination="kGn-Oc-Whe" id="3yp-CX-eR8"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
                <outlet property="webView" destination="l7I-YB-nNr" id="kej-cn-Pv8"/>
            </connections>
        </placeholder>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@@ -42,7 +45,6 @@
                                </label>
                                <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="l7I-YB-nNr">
                                    <rect key="frame" x="0.0" y="92" width="393" height="208"/>
                                    <color key="backgroundColor" red="0.36078431370000003" green="0.38823529410000002" blue="0.4039215686" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                    <wkWebViewConfiguration key="configuration">
                                        <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
                                        <wkPreferences key="preferences"/>
WanPai/Root/Search/VC/CustomerListVC.swift
@@ -97,8 +97,26 @@
    }
    @objc func callPhoneAction(){
        let url = URL(string: "tell://18111223301")!
        UIApplication.shared.open(url)
        Services.customerPhone().subscribe(onNext: {[weak self] data in
            guard let weakSelf = self else { return }
            if let strings = data.data{
                let vc = UIAlertController(title: "联系客服", message: nil, preferredStyle: .actionSheet)
                for str in strings{
                    vc.addAction(UIAlertAction(title: str, style: .default, handler: { _ in
                        UIApplication.shared.open(URL(string: "tell://\(str)")!, options: [:], completionHandler: nil)
                    }))
                }
                vc.addAction(UIAlertAction(title: "取消", style: .cancel))
                vc.show()
            }
        }).disposed(by: disposeBag)
//        let url = URL(string: "tell://18111223301")!
//        UIApplication.shared.open(url)
    }
}
WanPai/Root/Search/VC/CustomerSubListVC.swift
@@ -7,16 +7,26 @@
import UIKit
import JQTools
import RxSwift
import RxRelay
class CustomerContentViewModel:RefreshModel<NoticeItemModel>{
    var type = BehaviorRelay<CustomerSubListVC.CustomerSubType>.init(value: .notice)
    override func api() -> (Observable<BaseResponse<[NoticeItemModel]>>)? {
        return Services.exploreNoticeList(type: type.value)
    }
}
class CustomerSubListVC: BaseVC {
    enum CustomerSubType {
        case notice
        case QA
    private let viewModel = CustomerContentViewModel()
    public enum CustomerSubType {
        case notice,QA
    }
    lazy var tableView:UITableView = {
        let table = UITableView(frame: .zero, style: .plain)
    lazy var tableView:BaseTableView = {
        let table = BaseTableView(frame: .zero, style: .plain)
        table.separatorStyle = .none
        table.delegate = self
        table.dataSource = self
@@ -26,12 +36,10 @@
        return table
    }()
    private var type:CustomerSubType!
    init(type: CustomerSubType!) {
        super.init(nibName: nil, bundle: nil)
        self.type = type
        viewModel.type.accept(type)
    }
    required init?(coder: NSCoder) {
@@ -42,13 +50,15 @@
    override func viewDidLoad() {
        super.viewDidLoad()
        if type == .QA{
        if viewModel.type.value == .QA{
            let headView = UIView()
            headView.backgroundColor = .jq_randomColor
            headView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: JQ_ScreenW * 0.564)
            tableView.tableHeaderView = headView
        }
        viewModel.configure(tableView,needMore: false)
        viewModel.beginRefresh()
    }
    override func setUI() {
@@ -61,22 +71,26 @@
extension CustomerSubListVC:UITableViewDelegate{
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let vc = CustomerContentDetailVC()
        let model = viewModel.dataSource.value[indexPath.row]
        let vc = CustomerContentDetailVC(id: model.noticeId, type: viewModel.type.value)
        push(vc: vc)
    }
}
extension CustomerSubListVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         return 15
        return viewModel.dataSource.value.count
    }
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        if type == .notice{
        let model = viewModel.dataSource.value[indexPath.row]
        if  viewModel.type.value == .notice{
        let cell = tableView.dequeueReusableCell(withIdentifier: "_CustomerContentTCell") as! CustomerContentTCell
            cell.noticeItemModel = model
        return cell
        }else{
            let cell = tableView.dequeueReusableCell(withIdentifier: "_CustomerContentQATCell") as! CustomerContentQATCell
            cell.noticeItemModel = model
            return cell
        }
    }
WanPai/Root/Search/VC/SearchStoreDetailFeedbackVC.swift
@@ -6,10 +6,28 @@
//
import UIKit
import JQTools
import Photos
import QMUIKit
class SearchStoreDetailFeedbackVC: BaseVC {
    @IBOutlet weak var stackView: UIStackView!
    @IBOutlet weak var collectionView: UICollectionView!
    @IBOutlet weak var textView: QMUITextView!
    private var id:Int!
    private var items = NSMutableArray()
    private var imgs = [UIImage]()
    private var imgUrls = [String]()
    init(id:Int) {
        super.init(nibName: nil, bundle: nil)
        self.id = id
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
@@ -17,6 +35,8 @@
        collectionView.delegate = self
        collectionView.dataSource = self
        collectionView.register(UINib(nibName: "UploadImgCCell", bundle: nil), forCellWithReuseIdentifier: "_UploadImgCCell")
        items.add("Empty")
        collectionView.reloadData()
    }
    @IBAction func startAction(_ sender: UIButton) {
@@ -26,20 +46,69 @@
            v.isSelected = v.tag <= tag
        }
    }
    @IBAction func addAction(_ sender: UIButton) {
        let score = ((stackView.arrangedSubviews as! [UIButton]).filter({$0.isSelected}).last?.tag ?? 9) - 9
        guard score != 0 else {alertError(msg: "请先为门店评分");return}
        guard !textView.text.isEmpty else {
            alertError(msg: "请输入评论内容");return
        }
        if imgs.count > 0{
            showHUD("图片上传中")
            imgs.uploadImgToService(needCompress: true).subscribe { texts in
                self.imgUrls = texts
                self.uploadData(score: score)
            } onError: { error in
                alert(msg: error.localizedDescription)
            }.disposed(by: disposeBag)
        }else{
            self.uploadData(score: score)
        }
    }
    private func uploadData(score:Int){
        Services.evaluationStore(id: id, content: textView.text, imgs: imgUrls.joined(separator: ","), score: score).subscribe(onNext: {data in
            alertSuccess(msg: "评价成功")
            DispatchQueue.main.asyncAfter(deadline: .now()+1) {
                self.navigationController?.popViewController(animated: true)
            }
        }).disposed(by: disposeBag)
    }
}
extension SearchStoreDetailFeedbackVC:UICollectionViewDelegate{
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        JQ_ImagePickerTool.getSharedInstance().multiImage({ images, objs in
            self.imgs = images
            let temp = NSMutableArray(array: ["Empty"])
            for obj in objs{
                temp.insert(obj, at: 0)
            }
            self.items = temp
            self.collectionView.reloadData()
        }, max: 5, selectAsstes: NSMutableArray(array: items.filter({!($0 is String)})))
    }
}
extension SearchStoreDetailFeedbackVC:UICollectionViewDataSource{
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         let item = items[indexPath.row]
       let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_UploadImgCCell", for: indexPath) as! UploadImgCCell
        if item is String{
            cell.btn_del.isHidden = true
            cell.img_cover.image = UIImage(named: "btn_evaluate_add")
        }else{
            cell.btn_del.isHidden = false
            cell.img_cover.image = (item as? PHAsset)?.toImage()
        }
        return cell
    }
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 2
        return items.count
    }
}
WanPai/Root/Search/VC/SearchStoreDetailFeedbackVC.xib
@@ -4,6 +4,7 @@
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
        <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"/>
@@ -13,6 +14,7 @@
            <connections>
                <outlet property="collectionView" destination="Bdf-BC-sQU" id="6At-sV-EKq"/>
                <outlet property="stackView" destination="eVR-tY-BNf" id="bu9-4c-oDW"/>
                <outlet property="textView" destination="DZE-7p-bin" id="rKH-5k-SVF"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
@@ -136,16 +138,38 @@
                        <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
                    </collectionViewFlowLayout>
                </collectionView>
                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="h50-S0-pKG">
                    <rect key="frame" x="100" y="755" width="193" height="40"/>
                    <color key="backgroundColor" name="FE6E0D"/>
                    <constraints>
                        <constraint firstAttribute="height" constant="40" id="ptV-ah-EQL"/>
                    </constraints>
                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                    <state key="normal" title="保存"/>
                    <userDefinedRuntimeAttributes>
                        <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                            <real key="value" value="20"/>
                        </userDefinedRuntimeAttribute>
                        <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                    </userDefinedRuntimeAttributes>
                    <connections>
                        <action selector="addAction:" destination="-1" eventType="touchUpInside" id="0oB-8H-awG"/>
                    </connections>
                </button>
            </subviews>
            <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
            <constraints>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="oDM-kN-KPX" secondAttribute="trailing" constant="14" id="2aT-mi-vng"/>
                <constraint firstItem="h50-S0-pKG" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="100" id="Cic-ns-RHq"/>
                <constraint firstItem="Bdf-BC-sQU" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="14" id="FQn-ws-DNf"/>
                <constraint firstItem="Bdf-BC-sQU" firstAttribute="top" secondItem="aOL-oD-g8G" secondAttribute="bottom" constant="6" id="MOi-6C-9JU"/>
                <constraint firstItem="JaJ-JT-dcZ" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="14" id="PnD-Zo-hhG"/>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="h50-S0-pKG" secondAttribute="trailing" constant="100" id="S7d-6d-nzt"/>
                <constraint firstItem="aOL-oD-g8G" firstAttribute="top" secondItem="oDM-kN-KPX" secondAttribute="bottom" constant="22" id="XXj-4r-mQ1"/>
                <constraint firstItem="oDM-kN-KPX" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="14" id="bNu-Bl-8PE"/>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="h50-S0-pKG" secondAttribute="bottom" constant="23" id="cUd-i8-fBz"/>
                <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Bdf-BC-sQU" secondAttribute="trailing" constant="14" id="eYU-ax-TcF"/>
                <constraint firstItem="JaJ-JT-dcZ" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="topMargin" constant="20" id="h3p-DZ-GDN"/>
                <constraint firstItem="eVR-tY-BNf" firstAttribute="leading" secondItem="JaJ-JT-dcZ" secondAttribute="trailing" constant="3" id="ksM-IT-LLv"/>
@@ -161,6 +185,9 @@
    <resources>
        <image name="btn_start" width="18" height="18"/>
        <image name="btn_start_u" width="18" height="18"/>
        <namedColor name="FE6E0D">
            <color red="0.99199998378753662" green="0.53299999237060547" blue="0.0080000003799796104" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
        </namedColor>
        <systemColor name="labelColor">
            <color red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
        </systemColor>
WanPai/Root/Search/VC/SearchStoreDetailVC.swift
@@ -10,6 +10,15 @@
import QMUIKit
class SearchStoreDetailVC: BaseVC {
    private var id:Int!
    private var searchStoreDetailModel:SearchStoreDetailModel?{
        didSet{
            if let m = searchStoreDetailModel{
                headView.searchStoreDetailModel = m
                tableView.reloadData()
            }
        }
    }
    lazy private var tableView:UITableView = {
        let table = UITableView(frame: .zero, style: .grouped)
@@ -23,6 +32,15 @@
    private let headView = SearchStoreDetailHeadView.jq_loadNibView()
    init(id:Int) {
        super.init(nibName: nil, bundle: nil)
        self.id = id
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "门店详情"
@@ -35,6 +53,12 @@
            self.tableView.tableHeaderView = self.headView
        }
        Services.exploreStoreDetail(storeId: id).subscribe(onNext: {[weak self] data in
            if let model = data.data{
                self?.searchStoreDetailModel = model
            }
        }).disposed(by: disposeBag)
    }
    override func setUI() {
@@ -46,16 +70,28 @@
        tableView.layoutIfNeeded()
        tableView.tableHeaderView = headView
    }
    @objc func moreAction(btn:UIButton){
        if btn.tag == 10{
            let vc = YardListVC()
            push(vc: vc)
        }else{
            let vc = CourseListVC()
            push(vc: vc)
        }
    }
}
extension SearchStoreDetailVC:UITableViewDelegate{
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        if indexPath.section == 0{
            let vc = YardListVC()
            let model = searchStoreDetailModel!.venueList[indexPath.row]
            let vc = YardDetailVC(id: model.siteId)
            push(vc: vc)
        }else{
            let vc = CourseDetailVC(id: 0)
            let model = searchStoreDetailModel!.courseVoList[indexPath.row]
            let vc = CourseDetailVC(id: model.courseId)
            push(vc: vc)
        }
    }
@@ -104,11 +140,13 @@
            let morebtn = QMUIButton(type: .custom)
            morebtn.setTitle("查看更多", for: .normal)
            morebtn.tag = 10+section
            morebtn.titleLabel?.font = UIFont.systemFont(ofSize: 12, weight: .medium)
            morebtn.setTitleColor(UIColor(hexStr: "#0048FF"), for: .normal)
            morebtn.setImage(UIImage(named: "btn_more"), for: .normal)
            morebtn.imagePosition = .right
            morebtn.spacingBetweenImageAndTitle = 3
            morebtn.addTarget(self, action: #selector(moreAction), for: .touchUpInside)
            footView?.contentView.addSubview(morebtn)
            morebtn.snp.makeConstraints { make in
@@ -116,13 +154,18 @@
            }
        }
        return footView
    }
}
extension SearchStoreDetailVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 10
        if section == 0{
            return searchStoreDetailModel?.venueList.count ?? 0
        }else{
            return searchStoreDetailModel?.courseVoList.count ?? 0
        }
    }
    func numberOfSections(in tableView: UITableView) -> Int {
@@ -132,9 +175,14 @@
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        if indexPath.section == 0{
            let cell = tableView.dequeueReusableCell(withIdentifier: "_YardTCell") as! YardTCell
            let model = searchStoreDetailModel!.venueList[indexPath.row]
            cell.venueModel = model
            cell.label_distance.isHidden = true
            return cell
        }else {
            let cell = tableView.dequeueReusableCell(withIdentifier: "_SearchStoreDetail_1_TCell") as! SearchStoreDetail_1_TCell
            let model = searchStoreDetailModel!.courseVoList[indexPath.row]
            cell.detailCourseModel = model
            return cell
        }
    }
WanPai/Root/Search/VC/SearchStoreListVC.swift
@@ -59,7 +59,7 @@
extension SearchStoreListVC:UITableViewDelegate{
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let vc = SearchStoreDetailVC()
        let vc = SearchStoreDetailVC(id: 0)
        push(vc: vc)
    }
}
WanPai/Root/Search/VC/SearchVC.swift
@@ -11,11 +11,35 @@
class SearchVC: BaseVC {
    @IBOutlet weak var scrollView: UIScrollView!
    @IBOutlet weak var banner_collectionView: UICollectionView!
    @IBOutlet weak var label_empty: UILabel!
    @IBOutlet weak var view_container: UIView!
    private var models = [StartClouseExploreModel]()
    private lazy var mapView:MAMapView = {
        let map = MAMapView()
        map.delegate = self
        map.isShowsUserLocation = true
        map.userTrackingMode = .none
        map.isZoomEnabled = true
        map.isScrollEnabled = true
        return map
    }()
    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        scrollView.contentInsetAdjustmentBehavior = .never
        Services.exploreHome().subscribe(onNext: {[weak self] data in
            if let models = data.data,models.count > 0{
                self?.models = models
                self?.loadMap()
                self?.banner_collectionView.reloadData()
            }
        }).disposed(by: disposeBag)
    }
@@ -25,6 +49,29 @@
        banner_collectionView.register(UINib(nibName: "SearchBannerCCell", bundle: nil), forCellWithReuseIdentifier: "_SearchBannerCCell")
    }
    private func loadMap(){
        label_empty.isHidden = true
        view_container.addSubview(mapView)
        mapView.frame = CGRect(origin: .zero, size: view_container.size)
        for v in models{
            let point = MAPointAnnotation()
            point.coordinate = CLLocationCoordinate2D(latitude: v.latitude, longitude:v.longitude)
            point.title = v.storeAddr
            v.annotation = point
        }
        let points = models.map({$0.annotation}) as! [MAPointAnnotation]
        mapView.addAnnotations(points)
        mapView.showAnnotations(points, animated: true)
        mapView.selectAnnotation(points.first!, animated: true)
    }
    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        view_container.cornerRadius = 10
    }
    @IBAction func customerAction(_ sender: Any) {
        let vc = CustomerListVC()
@@ -38,18 +85,27 @@
extension SearchVC:UICollectionViewDelegate{
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        let vc = SearchStoreListVC()
        let model = models[indexPath.row]
        let vc = SearchStoreDetailVC(id: model.storeId)
        push(vc: vc)
    }
    func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
        let page = Int(scrollView.contentOffset.x / JQ_ScreenW)
        let model = models[page]
        mapView.selectAnnotation(model.annotation, animated: true)
    }
}
extension SearchVC:UICollectionViewDataSource{
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 5
        return models.count
    }
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_SearchBannerCCell", for: indexPath) as! SearchBannerCCell
        let model = models[indexPath.row]
        cell.startClouseExploreItemModel = model
        return cell
    }
}
@@ -68,3 +124,38 @@
        return CGSize(width: JQ_ScreenW, height: JQ_ScreenW * 0.6541)
    }
}
extension SearchVC:MAMapViewDelegate{
    func mapViewDidStopLocatingUser(_ mapView: MAMapView!) {
        print("--->停止")
    }
    func mapView(_ mapView: MAMapView!, didUpdate userLocation: MAUserLocation!, updatingLocation: Bool) {
        print("--->更新")
    }
    func mapViewWillStartLocatingUser(_ mapView: MAMapView!) {
        print("--->开始")
    }
    func mapView(_ mapView: MAMapView!, viewFor annotation: MAAnnotation!) -> MAAnnotationView! {
        if annotation is MAPointAnnotation{
            var pointView =  mapView.dequeueReusableAnnotationView(withIdentifier: "point")
            if pointView == nil{
                pointView = MAAnnotationView(annotation: annotation, reuseIdentifier: "point")
            }
            pointView?.canShowCallout = true
            pointView?.image = UIImage(named: "icon_point")?.withTintColor(UIColor(hexStr: "#f54444"))
            return pointView
        }
        return nil
    }
    func mapView(_ mapView: MAMapView!, didSelect view: MAAnnotationView!) {
        view.image = UIImage(named: "icon_point")?.withTintColor(UIColor(hexStr: "#2980ff"))
    }
    func mapView(_ mapView: MAMapView!, didDeselect view: MAAnnotationView!) {
        view.image = UIImage(named: "icon_point")?.withTintColor(UIColor(hexStr: "#f54444"))
    }
}
WanPai/Root/Search/VC/SearchVC.xib
@@ -13,8 +13,10 @@
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SearchVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="banner_collectionView" destination="GVG-mQ-5A4" id="keS-lx-iWt"/>
                <outlet property="label_empty" destination="FYv-6M-gC5" id="SA6-TH-Aqp"/>
                <outlet property="scrollView" destination="Jbe-CY-MmI" id="MM5-aA-VjT"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
                <outlet property="view_container" destination="kz4-Kz-Gzm" id="w2p-IO-YFO"/>
            </connections>
        </placeholder>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
WanPai/Root/Search/View/SearchStoreDetailHeadView.swift
@@ -11,19 +11,58 @@
class SearchStoreDetailHeadView: UIView,JQNibView{
    var searchStoreDetailModel:SearchStoreDetailModel!{
        didSet{
            label_title.text = searchStoreDetailModel.storeName
            label_address.text = searchStoreDetailModel.storeAddress
            label_workTime.text = searchStoreDetailModel.storeTime
            label_info.text = searchStoreDetailModel.storeInfo
            self.view_banner.addSubview(bannerView)
            bannerView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: 220)
            bannerView.setImages(images: searchStoreDetailModel.images, type: .URL) { index in
            }
        }
    }
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_address: UILabel!
    @IBOutlet weak var label_workTime: UILabel!
    @IBOutlet weak var label_info: UILabel!
    @IBOutlet weak var btn_feedback: QMUIButton!
    @IBOutlet weak var btn_location: QMUIButton!
    @IBOutlet weak var btn_phone: QMUIButton!
    @IBOutlet weak var view_banner: UIView!
    private lazy var bannerView:CommonBannerView = {
        let banner = CommonBannerView()
        return banner
    }()
    override func awakeFromNib() {
        super.awakeFromNib()
        btn_feedback.spacingBetweenImageAndTitle = 3
        btn_location.spacingBetweenImageAndTitle = 5
        btn_phone.spacingBetweenImageAndTitle = 4
    }
    
    @IBAction func feedbackAction(_ sender: UIButton) {
        let vc = SearchStoreDetailFeedbackVC()
        let vc = SearchStoreDetailFeedbackVC(id: searchStoreDetailModel.storeId)
        JQ_currentViewController().jq_push(vc: vc)
    }
    @IBAction func navAction(_ sender: QMUIButton) {
        JQ_MapNavigationTool.startNav(CLLocationCoordinate2D(latitude: searchStoreDetailModel.lat, longitude: searchStoreDetailModel.lon), distanceName: searchStoreDetailModel.storeAddress, scheme: "weparklife")
    }
    @IBAction func phoneAction(_ sender: QMUIButton) {
        UIApplication.shared.open(URL(string: "tel://\(searchStoreDetailModel.phone)")!)
    }
}
WanPai/Root/Search/View/SearchStoreDetailHeadView.xib
@@ -81,6 +81,9 @@
                                    <real key="value" value="1"/>
                                </userDefinedRuntimeAttribute>
                            </userDefinedRuntimeAttributes>
                            <connections>
                                <action selector="navAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="0Lw-IW-GQS"/>
                            </connections>
                        </button>
                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zjV-pe-qxa" customClass="QMUIButton">
                            <rect key="frame" x="0.0" y="72" width="60" height="26"/>
@@ -100,6 +103,9 @@
                                    <real key="value" value="4"/>
                                </userDefinedRuntimeAttribute>
                            </userDefinedRuntimeAttributes>
                            <connections>
                                <action selector="phoneAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="JsV-5Z-rJy"/>
                            </connections>
                        </button>
                    </subviews>
                </stackView>
@@ -189,6 +195,11 @@
                <outlet property="btn_feedback" destination="Mrd-r7-x2d" id="EvO-B6-le4"/>
                <outlet property="btn_location" destination="nPR-en-u9G" id="APm-w8-Hil"/>
                <outlet property="btn_phone" destination="zjV-pe-qxa" id="YWR-WN-RAW"/>
                <outlet property="label_address" destination="yAu-Fs-X4T" id="l1C-mA-o7N"/>
                <outlet property="label_info" destination="WSq-v8-MBS" id="3vg-Bx-VmW"/>
                <outlet property="label_title" destination="BLD-qG-SkK" id="bqE-QF-ran"/>
                <outlet property="label_workTime" destination="YGq-0Z-lO5" id="sCn-jn-Yd0"/>
                <outlet property="view_banner" destination="fnG-1M-O7B" id="sVO-t7-A10"/>
            </connections>
            <point key="canvasLocation" x="61.832061068702288" y="-105.98591549295776"/>
        </view>
WanPai/Root/Welfare/CCell/WelfareCoinCCell.swift
@@ -10,6 +10,7 @@
class WelfareCoinCCell: UICollectionViewCell {
    @IBOutlet weak var label_name: UILabel!
    @IBOutlet weak var label_price: UILabel!
    @IBOutlet weak var img_cover: UIImageView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
WanPai/Root/Welfare/CCell/WelfareCoinCCell.xib
@@ -48,6 +48,7 @@
            </constraints>
            <size key="customSize" width="240" height="220"/>
            <connections>
                <outlet property="img_cover" destination="IEc-iv-4yJ" id="vcq-b0-gub"/>
                <outlet property="label_name" destination="aSG-Yz-EAC" id="8fi-lJ-iyT"/>
                <outlet property="label_price" destination="AV2-Pp-S8J" id="6Cw-gZ-3Ny"/>
            </connections>
WanPai/Root/Welfare/TCell/BillInfoTCell.swift
@@ -6,9 +6,30 @@
//
import UIKit
import JQTools
class BillInfoTCell: UITableViewCell {
    var billingModel:BillingModel!{
        didSet{
            label_title.text = billingModel.consumeName
            label_datetime.text = billingModel.consumeTime
            label_price.text = billingModel.consumeAmount.currency()
            if billingModel.consumeAmount > 0{
                label_price.text = "+\(billingModel.consumeAmount.jq_formatFloat)"
                label_price.textColor = UIColor(hexStr: "#2AA60B")
            }else{
                label_price.text = "\(billingModel.consumeAmount.jq_formatFloat)"
                label_price.textColor = UIColor(hexStr: "#FD2A02")
            }
        }
    }
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_datetime: UILabel!
    @IBOutlet weak var label_price: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        selectionStyle = .none
WanPai/Root/Welfare/TCell/BillInfoTCell.xib
@@ -63,6 +63,11 @@
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="label_datetime" destination="E35-Uh-3aK" id="Amm-nA-IA9"/>
                <outlet property="label_price" destination="wNn-VN-t4h" id="9Ke-yN-E6s"/>
                <outlet property="label_title" destination="Zkg-Wm-X00" id="bAO-uq-yY3"/>
            </connections>
            <point key="canvasLocation" x="144.27480916030532" y="32.74647887323944"/>
        </tableViewCell>
    </objects>
WanPai/Root/Welfare/TCell/WelfareCouponsTCell.swift
@@ -10,12 +10,63 @@
import JQTools
class WelfareCouponsTCell: UITableViewCell {
    @IBOutlet weak var img_header: UIImageView!
    @IBOutlet weak var img_footer: UIImageView!
    @IBOutlet weak var label_price: UILabel!
    @IBOutlet weak var label_useCon: UILabel!
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_dueDatetime: UILabel!
    @IBOutlet weak var label_storeUse: UILabel!
    @IBOutlet weak var btn_info: QMUIButton!
    @IBOutlet weak var view_line: UIView!
    @IBOutlet weak var label_info: UILabel!
    @IBOutlet weak var cons_labelHei: NSLayoutConstraint!
    @IBOutlet weak var btn_detail: UIButton!
    @IBOutlet weak var img_status: UIImageView!
    @IBOutlet weak var btn_toUse: UIButton!
    var indexPath:IndexPath!
    var couponModel:CouponModel!{
        didSet{
            label_price.text = couponModel.ruleModel?.deductionAmount.currency()
            label_useCon.isHidden = couponModel.ruleModel?.conditionalAmount == 0
            if let amount = couponModel.ruleModel?.conditionalAmount{
                label_useCon.text = String(format: "满%@可用",amount)
            }
            label_title.text = couponModel.name
            label_dueDatetime.text = "有效期至\(couponModel.effectiveTime)"
            label_storeUse.text = couponModel.useCondition.titleRaw
            switch couponModel.useStatus{
                case .overdue:
                    btn_toUse.isHidden = true
                    img_status.image = UIImage(named: "icon_coupon_due")
                    img_status.isHidden = false
                    img_header.image = UIImage(named: "icon_coupon_header")?.withTintColor(UIColor(hexStr: "#BEBEBE"), renderingMode: .alwaysOriginal)
                    img_footer.image = UIImage(named: "icon_coupon_footer")?.withTintColor(UIColor(hexStr: "#BEBEBE"),renderingMode: .alwaysOriginal)
                case .unused:
                    btn_toUse.isHidden = false
                    img_status.isHidden = true
                    img_header.image = UIImage(named: "icon_coupon_header")
                    img_footer.image = UIImage(named: "icon_coupon_footer")
                case .used:
                    btn_toUse.isHidden = true
                    img_status.image = UIImage(named: "icon_coupon_used")
                    img_status.isHidden = false
                    img_header.image = UIImage(named: "icon_coupon_header")?.withTintColor(UIColor(hexStr: "#BEBEBE"), renderingMode: .alwaysOriginal)
                    img_footer.image = UIImage(named: "icon_coupon_footer")?.withTintColor(UIColor(hexStr: "#BEBEBE"),renderingMode: .alwaysOriginal)
            }
            btn_detail.isHidden = couponModel.useCondition == .nationwide
            label_info.text = couponModel.instructionsForUse
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
@@ -39,6 +90,15 @@
    }
    
    @IBAction func showDetailAction(_ sender: UIButton) {
        AgreentView.show(type: .privacy)
        AgreentView.show(type: .other,content:couponModel.cityOrStore)
    }
    @IBAction func toUseAction(_ sender: UIButton) {
        JQ_currentNavigationController().popToRootViewController(animated: true)
        DispatchQueue.main.asyncAfter(deadline: .now()+0.5) {
            JQ_currentViewController().tabBarController?.selectedIndex = 0
        }
    }
}
WanPai/Root/Welfare/TCell/WelfareCouponsTCell.xib
@@ -4,6 +4,7 @@
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
        <capability name="Named colors" 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>
@@ -147,6 +148,32 @@
                                    </label>
                                </subviews>
                            </stackView>
                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gS6-QD-F6Y">
                                <rect key="frame" x="211" y="38" width="61" height="23"/>
                                <constraints>
                                    <constraint firstAttribute="width" constant="61" id="hEn-D4-9Yg"/>
                                    <constraint firstAttribute="height" constant="23" id="mrG-BX-0C8"/>
                                </constraints>
                                <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                <state key="normal" title="去使用">
                                    <color key="titleColor" name="FE6E0D"/>
                                </state>
                                <userDefinedRuntimeAttributes>
                                    <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                        <real key="value" value="2"/>
                                    </userDefinedRuntimeAttribute>
                                    <userDefinedRuntimeAttribute type="color" keyPath="ld_borderColorXIB">
                                        <color key="value" name="FE6E0D"/>
                                    </userDefinedRuntimeAttribute>
                                    <userDefinedRuntimeAttribute type="number" keyPath="ld_borderWidthXIB">
                                        <real key="value" value="1"/>
                                    </userDefinedRuntimeAttribute>
                                </userDefinedRuntimeAttributes>
                                <connections>
                                    <action selector="toUseAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="eUa-3u-Wnb"/>
                                </connections>
                            </button>
                        </subviews>
                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                        <constraints>
@@ -154,6 +181,7 @@
                            <constraint firstAttribute="trailing" secondItem="fT4-6g-L0m" secondAttribute="trailing" id="1rt-21-G77"/>
                            <constraint firstItem="fT4-6g-L0m" firstAttribute="leading" secondItem="htP-hm-rxQ" secondAttribute="leading" id="2Dm-sq-3No"/>
                            <constraint firstItem="5BW-jy-SC9" firstAttribute="top" secondItem="G7I-Sh-sFL" secondAttribute="bottom" constant="3" id="2uK-cx-azl"/>
                            <constraint firstItem="gS6-QD-F6Y" firstAttribute="top" secondItem="htP-hm-rxQ" secondAttribute="top" constant="38" id="3OB-jO-zUW"/>
                            <constraint firstItem="bwC-Qg-DNl" firstAttribute="top" secondItem="htP-hm-rxQ" secondAttribute="top" constant="13" id="BbP-1j-qbj"/>
                            <constraint firstAttribute="trailing" secondItem="bwC-Qg-DNl" secondAttribute="trailing" constant="5" id="C2A-lN-hOf"/>
                            <constraint firstAttribute="trailing" secondItem="fpg-MK-829" secondAttribute="trailing" constant="10" id="CWH-E3-nn9"/>
@@ -163,6 +191,7 @@
                            <constraint firstItem="5BW-jy-SC9" firstAttribute="leading" secondItem="G7I-Sh-sFL" secondAttribute="leading" id="LMw-VW-ZH0"/>
                            <constraint firstItem="fT4-6g-L0m" firstAttribute="top" secondItem="htP-hm-rxQ" secondAttribute="top" id="S8h-Ep-AtT"/>
                            <constraint firstItem="G7I-Sh-sFL" firstAttribute="leading" secondItem="htP-hm-rxQ" secondAttribute="leading" constant="15" id="SiL-Cg-tTN"/>
                            <constraint firstAttribute="trailing" secondItem="gS6-QD-F6Y" secondAttribute="trailing" constant="9" id="ZDP-hZ-p1K"/>
                            <constraint firstItem="G7I-Sh-sFL" firstAttribute="top" secondItem="htP-hm-rxQ" secondAttribute="top" constant="8" id="ZPO-eZ-lUg"/>
                            <constraint firstItem="Aod-kc-Nc3" firstAttribute="centerY" secondItem="9T6-ag-k9m" secondAttribute="centerY" id="Zzy-qH-Uh1"/>
                            <constraint firstItem="Aod-kc-Nc3" firstAttribute="leading" secondItem="9T6-ag-k9m" secondAttribute="trailing" constant="4" id="cUQ-rZ-40D"/>
@@ -185,9 +214,19 @@
                </constraints>
            </tableViewCellContentView>
            <connections>
                <outlet property="btn_detail" destination="Aod-kc-Nc3" id="DaK-Xf-HHg"/>
                <outlet property="btn_info" destination="Osp-YM-6Uw" id="KTk-At-Veb"/>
                <outlet property="btn_toUse" destination="gS6-QD-F6Y" id="hff-Ta-4Dm"/>
                <outlet property="cons_labelHei" destination="Bhz-uE-F2F" id="YnU-Cl-Hi0"/>
                <outlet property="img_footer" destination="fT4-6g-L0m" id="H23-lu-v1q"/>
                <outlet property="img_header" destination="wLK-TU-eK6" id="EdA-jS-may"/>
                <outlet property="img_status" destination="bwC-Qg-DNl" id="wZJ-ll-FYZ"/>
                <outlet property="label_dueDatetime" destination="5BW-jy-SC9" id="AzI-Vk-u2M"/>
                <outlet property="label_info" destination="otH-gu-7hx" id="JSu-Vb-xXL"/>
                <outlet property="label_price" destination="efu-ap-jzG" id="Dds-Y0-cP3"/>
                <outlet property="label_storeUse" destination="9T6-ag-k9m" id="nsD-Ag-fgg"/>
                <outlet property="label_title" destination="G7I-Sh-sFL" id="bBq-aa-kjA"/>
                <outlet property="label_useCon" destination="Swu-3s-t08" id="5lK-sO-Sbo"/>
                <outlet property="view_line" destination="Idc-Qp-xg4" id="qgz-C4-7oJ"/>
            </connections>
            <point key="canvasLocation" x="104.58015267175573" y="55.633802816901408"/>
@@ -199,6 +238,9 @@
        <image name="icon_coupon_used" width="56" height="43"/>
        <image name="icon_trigon_down" width="8" height="5"/>
        <image name="icon_trigon_up" width="8" height="5"/>
        <namedColor name="FE6E0D">
            <color red="0.99199998378753662" green="0.53299999237060547" blue="0.0080000003799796104" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
        </namedColor>
        <systemColor name="systemBackgroundColor">
            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
        </systemColor>
WanPai/Root/Welfare/VC/RechargeCenterVC.swift
@@ -13,7 +13,7 @@
    struct RechargeItem {
        var coin = 0
        var money = 0
        var money:Double = 0
    }
    @IBOutlet weak var view_topBg: UIView!
@@ -24,22 +24,29 @@
    @IBOutlet weak var collectionView: UICollectionView!
    private var items = [RechargeItem]()
    private let cellW = (JQ_ScreenW - 90) / 3.0
    private let cellH = ((JQ_ScreenW - 90) / 3.0) * 0.5148
    private let cellW = (JQ_ScreenW - 100) / 3.0
    private let cellH = ((JQ_ScreenW - 100) / 3.0) * 0.5148
    private var selectIndex = 0
    var viewModel:RechargeRecordViewModel!
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        view_cion.valueNumber = NSNumber(value: viewModel.coin.value)
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "充值中心"
        view_cion.font = UIFont.init(name: "Impact", size: 36)!
        view_cion.textColor = .white
        view_cion.valueNumber = NSNumber(value: 22199)
        items.append(RechargeItem(coin: 100, money: 90))
        items.append(RechargeItem(coin: 150, money: 100))
        items.append(RechargeItem(coin: 200, money: 150))
        items.append(RechargeItem(coin: 500, money: 350))
        items.append(RechargeItem(coin: 1000, money: 500))
        Services.voucherCenter().subscribe(onNext: {[weak self] data in
            for v in data.data ?? []{
                self?.items.append(RechargeItem(coin: v.wpGold, money: v.amount))
            }
            self?.collectionView.reloadData()
        }).disposed(by: disposeBag)
    }
    override func setUI() {
@@ -60,8 +67,18 @@
        collectionView.register(UINib(nibName: "RechargeItemCCell", bundle: nil), forCellWithReuseIdentifier: "_RechargeItemCCell")
    }
    @IBAction func introAction(_ sender: UIButton) {
          let vc = JQ_CommonWebViewController(htmlText: "说明。。。。", baseURL: nil)
        present(vc, animated: true)
    }
    @IBAction func rechargeAction(_ sender: UIButton) {
        PaymentView.show(money: (ali:1,wx:2,coin:2,course:2)) { status in
        let item = items[selectIndex]
        PaymentView.show(money: (ali:item.money,wx:item.money,coin:item.coin,course:nil)) { type in
//            let result:PaymentResultVC.PaymentResult = status ? .success:.fail
//            let vc = PaymentResultVC(result: result, objType: .activityApply)
//            vc.modalPresentationStyle = .fullScreen
@@ -72,13 +89,19 @@
extension RechargeCenterVC:UICollectionViewDelegate{
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        selectIndex = indexPath.row
    }
}
extension RechargeCenterVC:UICollectionViewDataSource{
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let item = items[indexPath.row]
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_RechargeItemCCell", for:indexPath) as! RechargeItemCCell
        cell.isSelected = indexPath.row == selectIndex
        cell.label_coin.text = "\(item.coin)币"
        cell.label_moeny.text = item.money.currency()
        return cell
    }
@@ -95,6 +118,7 @@
        return 18
    }
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        return CGSize(width: cellW, height: cellH)
    }
WanPai/Root/Welfare/VC/RechargeCenterVC.xib
@@ -81,6 +81,9 @@
                            <state key="normal" title="储值说明?">
                                <color key="titleColor" name="FE6E0D"/>
                            </state>
                            <connections>
                                <action selector="introAction:" destination="-1" eventType="touchUpInside" id="34L-53-jKP"/>
                            </connections>
                        </button>
                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="UvJ-Vs-VJ9">
                            <rect key="frame" x="86" y="214.00000000000003" width="193" height="40"/>
WanPai/Root/Welfare/VC/RechargeRecordVC.swift
@@ -8,6 +8,17 @@
import UIKit
import JQTools
import QMUIKit
import RxSwift
import RxRelay
class RechargeRecordViewModel:RefreshModel<BillingModel>{
    var coin = BehaviorRelay<Int>(value: 0)
    var type = BehaviorRelay<Int?>(value: nil)
    var yearMonth = BehaviorRelay<String>(value: "")
    override func api() -> (Observable<BaseResponse<[BillingModel]>>)? {
        return Services.voucherDetail(recordType: type.value, yearMonth: yearMonth.value)
    }
}
class RechargeRecordVC: BaseVC {
@@ -15,17 +26,32 @@
    @IBOutlet weak var view_cion: JQ_RollNumberLabel!
    @IBOutlet weak var btn_rechange: UIButton!
    @IBOutlet weak var view_container: UIView!
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var tableView: BaseTableView!
    @IBOutlet weak var btn_filter: QMUIButton!
    @IBOutlet weak var btn_date: UIButton!
    private let viewModel = RechargeRecordViewModel()
    required init(coin:Int) {
        super.init(nibName: nil, bundle: nil)
        self.viewModel.coin.accept(coin)
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "充值明细"
        view_cion.font = UIFont.init(name: "Impact", size: 36)!
        view_cion.textColor = .white
        DispatchQueue.main.asyncAfter(deadline: .now()+2) {
            self.view_cion.valueNumber = NSNumber(value: 22199)
        }
    }
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        self.view_cion.valueNumber = NSNumber(value: self.viewModel.coin.value)
    }
@@ -42,23 +68,35 @@
        tableView.dataSource = self
        tableView.separatorStyle = .none
        tableView.register(UINib(nibName: "BillInfoTCell", bundle: nil), forCellReuseIdentifier:"_BillInfoTCell")
        viewModel.yearMonth.accept(Date().jq_format("yyyy-MM"))
        btn_date.setTitle("\(Date().jq_format("yyyy年MM月"))>", for: .normal)
        viewModel.configure(tableView,needMore: false)
        viewModel.beginRefresh()
    }
    @IBAction func datetimeAction(_ sender: UIButton) {
        CommonDatePickerView.show { year, month, day in
        CommonDatePickerView.show(before: 3, after: 0, type: .YM) {[weak self] year, month, day in
            self?.btn_date.setTitle(String(format: "%ld年%02ld月>", year,month), for: .normal)
            self?.viewModel.yearMonth.accept(String(format: "%ld-02ld", year,month))
            self?.viewModel.beginRefresh()
        }
    }
    @IBAction func filterAction(_ sender: QMUIButton) {
        JQ_MenuView().show(self, tapView: sender, items: ["充值","扣除"], tableHei: 150) { index, str in
        JQ_MenuView().show(self, tapView: sender, items: ["全部记录","充值","扣除"], tableHei: 150) {[weak self] index, str in
            if index == 0{
                self?.viewModel.type.accept(nil)
            }else{
                self?.viewModel.type.accept(index)
            }
            self?.viewModel.beginRefresh()
        }
    }
    @IBAction func rechargeAction(_ sender: UIButton) {
        let vc = RechargeCenterVC()
        vc.viewModel = viewModel
        push(vc: vc)
    }
}
@@ -69,11 +107,13 @@
extension RechargeRecordVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let model = viewModel.dataSource.value[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "_BillInfoTCell") as! BillInfoTCell
        cell.billingModel = model
        return cell
    }
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 50
        return viewModel.dataSource.value.count
    }
}
WanPai/Root/Welfare/VC/RechargeRecordVC.xib
@@ -12,6 +12,7 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RechargeRecordVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="btn_date" destination="Zd3-h8-Y0d" id="rE9-oV-a9u"/>
                <outlet property="btn_filter" destination="Nmp-c4-n6U" id="SK0-iY-Xer"/>
                <outlet property="btn_rechange" destination="NHb-nm-Mzb" id="7ts-Tk-cQF"/>
                <outlet property="tableView" destination="wHv-iO-wHf" id="vtl-Us-h3D"/>
@@ -122,7 +123,7 @@
                                <constraint firstItem="Zd3-h8-Y0d" firstAttribute="centerY" secondItem="4js-r9-uNN" secondAttribute="centerY" id="fl8-Yy-gsh"/>
                            </constraints>
                        </view>
                        <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="wHv-iO-wHf">
                        <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="wHv-iO-wHf" customClass="BaseTableView" customModule="WanPai" customModuleProvider="target">
                            <rect key="frame" x="0.0" y="49.999999999999972" width="365" height="506.33333333333326"/>
                            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                        </tableView>
WanPai/Root/Welfare/VC/WelfareBillListVC.swift
@@ -8,11 +8,21 @@
import UIKit
import JQTools
import QMUIKit
import RxSwift
import RxRelay
class BillViewModel:RefreshModel<BillingModel>{
    var type = BehaviorRelay<Int?>(value: nil)
    var yearMonth = BehaviorRelay<String>(value: "")
    override func api() -> (Observable<BaseResponse<[BillingModel]>>)? {
        return Services.billingList(recordType: type.value, yearMonth: yearMonth.value)
    }
}
class WelfareBillListVC: BaseVC {
    lazy private var tableView:UITableView = {
        let table = UITableView(frame: .zero, style: .plain)
    lazy private var tableView:BaseTableView = {
        let table = BaseTableView(frame: .zero, style: .plain)
        table.separatorStyle = .none
        table.delegate = self
        table.dataSource = self
@@ -23,10 +33,18 @@
        return table
    }()
    private let viewModel = BillViewModel()
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "我的账单"
        viewModel.configure(tableView,needMore: false)
        viewModel.yearMonth.accept(Date().jq_format("yyyy年MM月"))
        viewModel.beginRefresh()
    }
    override func setUI() {
        tableView.jq_setEmptyView()
        view.addSubview(tableView)
        tableView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
@@ -34,19 +52,20 @@
    }
}
extension WelfareBillListVC:UITableViewDelegate{
}
extension WelfareBillListVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let model = viewModel.dataSource.value[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "_BillInfoTCell") as! BillInfoTCell
        cell.billingModel = model
        return cell
    }
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 50
        return viewModel.dataSource.value.count
    }
    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
@@ -55,16 +74,30 @@
    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        let v = HeaderInSectionView()
        v.viewModel = viewModel
        return v
    }
}
private class HeaderInSectionView:UIView{
    fileprivate var viewModel:BillViewModel?{
        didSet{
            if let m = viewModel{
                btn_datetime.setTitle("\(m.yearMonth.value)>", for: .normal)
                if let  type = m.type.value{
                    btn_filter.setTitle(type == 1 ? "充值":"扣除", for: .normal)
                }else{
                    btn_filter.setTitle("全部记录", for: .normal)
                }
            }
        }
    }
    private lazy var btn_datetime:QMUIButton = {
        let btn = QMUIButton(type: .custom)
        btn.setTitle(Date().jq_format("yyyy年M月>"), for: .normal)
        btn.setTitleColor(UIColor(hexStr: "#0048FF"), for: .normal)
        btn.setTitleColor(UIColor.black, for: .normal)
        btn.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
        return btn
    }()
@@ -123,14 +156,22 @@
    }
    @objc func fliterAction(){
        JQ_MenuView().show(self, tapView: btn_filter, items: ["1","2"],tableHei: 140) { index, str in
        JQ_MenuView().show(self, tapView: btn_filter, items: ["全部记录","充值","扣除"],tableHei: 140) { [weak self] index, str in
            self?.btn_filter.setTitle(str, for: .normal)
            if index == 0{
                self?.viewModel?.type.accept(nil)
            }else{
                self?.viewModel?.type.accept(index)
            }
            self?.viewModel?.beginRefresh()
        }
    }
    @objc func datetimePickerAction(){
        CommonDatePickerView.show{ year, month, day in
        CommonDatePickerView.show(before: 2, after: 0, type: .YM) {[weak self] year, month,_ in
            self?.viewModel?.yearMonth.accept(String(format: "%ld年%ld月", year,month))
            self?.viewModel?.beginRefresh()
        }
    }
WanPai/Root/Welfare/VC/WelfareCouponsListVC.swift
@@ -108,8 +108,16 @@
    }
    @objc func fliterAction(){
        JQ_MenuView().show(self, tapView: btn_filter, items: ["1","2"], tableHei: 150) { index, str in
        JQ_MenuView().show(self, tapView: btn_filter, items: ["全部","未使用","已使用","已过期"], tableHei: 150) {[weak self] index, str in
            self?.btn_filter.setTitle(str, for: .normal)
            if let vc =  self?.pageViewController.currentController as? WelfareCouponsSubListVC{
                if index == 0{
                    vc.viewModel.status.accept(nil)
                }else{
                    vc.viewModel.status.accept(index)
                }
                vc.viewModel.beginRefresh()
            }
        }
    }
}
@@ -132,7 +140,10 @@
    }
    func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController {
        return WelfareCouponsSubListVC()
        if page == 0{
            return WelfareCouponsSubListVC(type: nil)
        }else{
            return WelfareCouponsSubListVC(type: page)
        }
    }
}
WanPai/Root/Welfare/VC/WelfareCouponsSubListVC.swift
@@ -1,18 +1,29 @@
//
//  WelfareCouponsSubListVC.swift
//  WanPai
//
//  Created by 无故事王国 on 2023/6/28.
//
    //
    //  WelfareCouponsSubListVC.swift
    //  WanPai
    //
    //  Created by 无故事王国 on 2023/6/28.
    //
import UIKit
import RxSwift
import RxRelay
import JQTools
let WelfareCoupons_Noti = NSNotification.Name("WelfareCoupons_Noti")
class WelfareCouponViewModel:RefreshModel<CouponModel>{
    var type = BehaviorRelay<Int?>(value: nil)
    var status = BehaviorRelay<Int?>(value: nil)
    override func api() -> (Observable<BaseResponse<[CouponModel]>>)? {
        Services.myCouponList(type: type.value, useStatus: status.value)
    }
}
class WelfareCouponsSubListVC: BaseVC {
    lazy private var tableView:UITableView = {
        let table = UITableView(frame: .zero, style: .plain)
    lazy private var tableView:BaseTableView = {
        let table = BaseTableView(frame: .zero, style: .plain)
        table.separatorStyle = .none
        table.delegate = self
        table.dataSource = self
@@ -20,11 +31,23 @@
        return table
    }()
    let viewModel = WelfareCouponViewModel()
    private var rows = Set<Int>()
    required init(type:Int?) {
        super.init(nibName: nil, bundle: nil)
        viewModel.type.accept(type)
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        viewModel.configure(tableView,needMore: false)
        viewModel.beginRefresh()
    }
    override func setUI() {
@@ -32,6 +55,7 @@
        tableView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        tableView.jq_setEmptyView()
    }
    override func setRx() {
@@ -54,7 +78,7 @@
extension WelfareCouponsSubListVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         return 15
        return viewModel.dataSource.value.count
    }
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
@@ -64,6 +88,7 @@
        cell.btn_info.isSelected = rows.contains(indexPath.row)
        cell.label_info.isHidden = !rows.contains(indexPath.row)
        cell.view_line.isHidden = !rows.contains(indexPath.row)
        cell.couponModel = viewModel.dataSource.value[indexPath.row]
        return cell
    }
WanPai/Root/Welfare/VC/WelfareVC.swift
@@ -7,18 +7,63 @@
import UIKit
import JQTools
import QMUIKit
class WelfareVC: BaseVC {
    @IBOutlet weak var img_userProfile: UIImageView!
    @IBOutlet weak var label_username: UILabel!
    @IBOutlet weak var btn_vip: QMUIButton!
    @IBOutlet weak var label_coin: UILabel!
    @IBOutlet weak var label_score: UILabel!
    @IBOutlet weak var scrollView: UIScrollView!
    @IBOutlet weak var coinCollectionView: UICollectionView!
    @IBOutlet weak var btn_coupon: UIButton!
    @IBOutlet weak var btn_shoppping: UIButton!
    @IBOutlet weak var btn_weekly: UIButton!
    @IBOutlet weak var btn_todayFree: UIButton!
    private var timer:Timer?
    private var timerOffsetX:Double = 0
    private let cellW = JQ_ScreenW * 0.3794
    private var benefitHomeModel:BenefitHomeModel?
    override func viewDidLoad() {
        super.viewDidLoad()
        Services.benefitHome().subscribe(onNext: {[weak self] data in
            if let model = data.data{
                self?.benefitHomeModel = model
                self?.img_userProfile.sd_setImage(with: URL(string: model.userHeadImg))
                self?.label_username.text = model.userName
                self?.btn_vip.isHidden = model.isMember == "年度会员"
                self?.label_coin.text = "\(model.wpCoin)"
                self?.label_score.text = "\(model.userIntegral)"
                self?.coinCollectionView.reloadData()
                if let coupon = model.image?.myConpons{
                    self?.btn_coupon.sd_setImage(with: URL(string: coupon), for: .normal, placeholderImage: nil,context: nil)
                }
                if let onlineShop = model.image?.onlineShop{
                    self?.btn_shoppping.sd_setImage(with: URL(string: onlineShop), for: .normal, placeholderImage: nil, context: nil)
                }
                if let weeksBenefit = model.image?.weeksBenefit{
                    self?.btn_weekly.sd_setImage(with: URL(string: weeksBenefit), for: .normal, placeholderImage: nil, context: nil)
                }
                if let todayFree = model.image?.todayFree{
                    self?.btn_todayFree.sd_setImage(with: URL(string: todayFree), for: .normal, placeholderImage: nil, context: nil)
                }
                if model.commodities.count > 0{
                    self?.autoScroll()
                }
            }
        }) { error in
        }.disposed(by: disposeBag)
    }
    override func viewDidDisappear(_ animated: Bool) {
@@ -68,7 +113,7 @@
    }
    @IBAction func rechargeAction(_ sender: UIButton) {
        let vc = RechargeRecordVC()
        let vc = RechargeRecordVC(coin: benefitHomeModel?.wpCoin ?? 0)
        push(vc: vc)
    }
@@ -89,13 +134,14 @@
    
    private func autoScroll(){
        guard benefitHomeModel != nil else {return}
        timer = Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(runTimer), userInfo: nil, repeats: true)
        timer?.fire()
        RunLoop.current.add(timer!, forMode: .common)
    }
    @objc func runTimer(){
        if timerOffsetX >= (JQ_ScreenW - cellW * (4 - 3)){
        if timerOffsetX >= (JQ_ScreenW - cellW * Double(benefitHomeModel!.commodities.count - 3)){
            timerOffsetX = 0
            coinCollectionView.setContentOffset(CGPoint.zero, animated: true)
            timer?.invalidate()
@@ -108,6 +154,7 @@
    }
    private func recoverTimer(){
        guard benefitHomeModel != nil else {return}
        timer = Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(runTimer), userInfo: nil, repeats: true)
    }
@@ -130,6 +177,7 @@
extension WelfareVC:UICollectionViewDelegate{
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        let model = benefitHomeModel!.commodities[indexPath.row]
        let vc = WelfareRedeemGoodsDetailVC()
        push(vc: vc)
    }
@@ -137,12 +185,15 @@
extension WelfareVC:UICollectionViewDataSource{
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 4
        return benefitHomeModel?.commodities.count ?? 0
    }
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
       let model = benefitHomeModel!.commodities[indexPath.row]
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_WelfareCoinCCell", for: indexPath) as! WelfareCoinCCell
        cell.label_name.text = "\(indexPath.row)"
        cell.label_name.text = model.commodityName
        cell.label_price.text = model.commodityPrice.currency()
        cell.img_cover.sd_setImage(with: URL(string: model.commodityImg), placeholderImage: UIImage(named: "test_1"))
        return cell
    }
}
WanPai/Root/Welfare/VC/WelfareVC.xib
@@ -11,7 +11,16 @@
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WelfareVC" customModule="WanPai" customModuleProvider="target">
            <connections>
                <outlet property="btn_coupon" destination="Kte-Xd-tVd" id="Xg6-k9-w88"/>
                <outlet property="btn_shoppping" destination="QmB-HQ-3Lg" id="1WQ-j1-yHd"/>
                <outlet property="btn_todayFree" destination="r4f-Ay-EGJ" id="zTX-Pu-U2q"/>
                <outlet property="btn_vip" destination="6lk-Nd-Tug" id="fed-2F-KP6"/>
                <outlet property="btn_weekly" destination="hBk-90-GU4" id="R7h-4s-dyR"/>
                <outlet property="coinCollectionView" destination="yBw-of-rdU" id="g6s-C7-Axj"/>
                <outlet property="img_userProfile" destination="7GZ-X8-dwC" id="nYH-xs-aFt"/>
                <outlet property="label_coin" destination="5GZ-Mz-c7r" id="XTu-31-9ux"/>
                <outlet property="label_score" destination="FKV-jp-n9Z" id="C2w-p6-oI8"/>
                <outlet property="label_username" destination="yxM-ot-SxY" id="MgH-Uf-xUY"/>
                <outlet property="scrollView" destination="Cgs-lB-S86" id="yMF-vU-sVl"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
WanPai/Root/Welfare/View/CoinStoreHeadView.swift
@@ -53,9 +53,9 @@
    }
    @IBAction func recoredAction(_ sender: UIButton) {
        let vc = RechargeRecordVC()
        vc.title = "积分明细"
        JQ_currentViewController().jq_push(vc: vc)
//        let vc = RechargeRecordVC()
//        vc.title = "积分明细"
//        JQ_currentViewController().jq_push(vc: vc)
    }
WanPai/Root/Yard/TCell/YardTCell.swift
@@ -23,6 +23,18 @@
        }
    }
    var venueModel:SearchStoreDetailVenueModel!{
        didSet{
            label_name.text = venueModel.siteName
            label_typeName.text = venueModel.siteType
            view_address.isHidden = true
            label_time.text = "可预约时间段:" + venueModel.siteTime
            label_price.attributedText = AttributedStringbuilder.build().add(string: venueModel.price.currency(), withFont: UIFont.systemFont(ofSize: 18, weight: .semibold), withColor: Def_ThemeColor)
                .add(string: "起", withFont: UIFont.systemFont(ofSize: 12, weight: .semibold), withColor: Def_ThemeColor).mutableAttributedString
        }
    }
    @IBOutlet weak var label_name: UILabel!
    @IBOutlet weak var label_typeName: UILabel!
@@ -30,6 +42,7 @@
    @IBOutlet weak var label_time: UILabel!
    @IBOutlet weak var label_distance: UILabel!
    @IBOutlet weak var label_price: UILabel!
    @IBOutlet weak var view_address: UIView!
    override func awakeFromNib() {
        super.awakeFromNib()
WanPai/Root/Yard/TCell/YardTCell.xib
@@ -111,7 +111,7 @@
                            </view>
                        </subviews>
                    </stackView>
                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hxt-yX-skH">
                    <button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hxt-yX-skH">
                        <rect key="frame" x="322" y="151" width="65" height="31"/>
                        <color key="backgroundColor" red="0.42352941176470588" green="0.76470588235294112" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                        <constraints>
@@ -171,6 +171,7 @@
                <outlet property="label_price" destination="OoZ-Hg-I7m" id="cp4-HO-YcP"/>
                <outlet property="label_time" destination="VPM-cW-lTi" id="DHH-4e-Jrn"/>
                <outlet property="label_typeName" destination="HvA-v4-DgN" id="4gW-PO-qwT"/>
                <outlet property="view_address" destination="sfw-5b-qHg" id="bRd-td-Toc"/>
            </connections>
            <point key="canvasLocation" x="159.54198473282443" y="73.591549295774655"/>
        </tableViewCell>