const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
let weappId = extConfig.weappId;
console.log(extConfig, wx.getExtConfigSync(), 'extConfig')
let dataTowerUrl = extConfig.attr.datatowerurl;
let url = extConfig.attr.configUrl;
var apiPrefix = url + '/B';
var config = {
  // name: "富茂",
  api: {
    /**
     * 接口用途:login
     */
    login: '/api/user/login',
    /**
     * B端用户详情
     */
    userDetail: '/api/user/detail',
    getMallIcon: '/api/mall/getAppIcon',
    //提现列表
    withdrawLsit: "/api/cashout/list",
    //账户余额
    balance: "/api/cashout/getCurrentCashOutData",
    // 商户提现
    userWithdraw: "/api/cashout/cashout",
    /**
     * 修改密码
     */
    userUpdatePwd: '/api/user/updatepwd',
    /**
     * 券包详情
     */
    couponOrderDetail: '/api/couponOrder/detail',
    /**
     * 购买须知图文详情
     */
    couponHtmlDetail: '/api/couponOrder/html',
    /**
     * 退款
     */
    refundOrderCreate: '/api/refund/create',
    /**
     * 券核销
     */
    couponOrderVerify: '/api/couponOrder/verify',
    /**
     * 发送验证码
     */
    sendValidationCode: '/wxMsgValidationcode/sendvalidationcode',
    /**
     * 验证验证码
     */
    hasValidationCode: '/wxMsgValidationcode/hasvalidationcode',
    /**
     * 已被核销的券包
     */
    couponOrderListVerified: '/api/couponOrder/listVerified',
    /**
     * 已被核销的券包V2
     */
    couponOrderListVerifiedV2: '/api/couponOrder/listVerifiedV2',
    /**
     * 核销总金额和总笔数
     */
    couponOrderSumVerified: '/api/couponOrder/sumVerified',
    /**
     * 未核销的券包
     */
    couponOrderListUnVerified: '/api/couponOrder/listUnverified',
    /**
     * 手动券码核销开关
     */
    getByKey: '/api/sysConfig/getByKey',
    /**
     * 上报解单
     */
    reportDailyVolume: '/api/wxMerchantTradeDaily/reportDailyVolume',
    /**
     * 解单编辑
     */
    updateDailyVolume: '/api/wxMerchantTradeDaily/updateDailyVolume',
    /**
     * 获取当日解单
     */
    getVolume: '/api/wxMerchantTradeDaily/getVolume',
    /**
     * 获取周解单
     */
    getVolumeOfWeek: '/api/wxMerchantTradeDaily/getVolumeOfWeek',
    /**
     * 交易记录list
     */
    dateAmountRecordListOrder: '/api/wxDateAmountRecord/listOrder',
    /**
     * 交易记录list
     */
    dateAmountRecordListVerified: '/api/wxDateAmountRecord/listVerified',
    /**
     * 某日期交易总流水
     */
    getUnverifiedAmountOnDate: '/api/couponOrder/getUnverifiedAmountOnDate',
    /**
     * 某日期核销总流水
     */
    getVerifiedAmountOnDate: '/api/couponOrder/getVerifiedAmountOnDate',
    /**
     *刷卡支付订单
     */
    orderCreate: '/api/micropay/order_create',
    /**
     *查询刷卡支付订单
     */
    orderQuery: '/api/micropay/order_query',
    /**
     *撤销刷卡支付订单
     */
    orderReverse: '/api/micropay/order_reverse',
    /**
     *首页查询刷卡金额记录接口
     */
    listMicropay: '/api/wxDateAmountRecord/listMicropay',
    oneMerchantOrderlist: '/neupos/api/trade/oneMerchantOrderlist', // pos交易流水
    dateMerchantOrderlist: '/neupos/api/trade/dateMerchantOrderlist', // pos交易流水
    /**
     *刷卡支付交易流水分页列表接口
     */
    micropayListMicroPay: '/api/micropay/listMicroPay',
    /**
     *刷卡支付交易流水分页列表接口V2
     */
    micropayListMicroPayV2: '/api/micropay/listMicroPayV2',
    /**
     *刷卡支付交易流水分页列表接口V2
     */
    micropaySumMicroPay: '/api/micropay/sumMicroPay',
    /**
     *刷卡支付退款
     */
    // microPayRefund: '/api/micropay/microPayRefund',
    /**
     *刷卡支付某日期交易总流水
     */
    getMicroPayAmountOnDate: '/api/micropay/getMicroPayAmountOnDate',
    /**
     * 首页账单列表
     */
    listBillOweAndWaitPay: "/api/bill/listBillOweAndWaitPay",
    /**
     * 账单
     */
    listBill: "/api/bill/listBill",
    notifyList: "/api/bill/notifyList",
    oweBillList: "/api/bill/oweBillList",
    nearBillList: '/api/bill/nearBillList',
    billDetail: '/api/bill/detail',
    mallbillDetail: '/api/mallAdmin/detail',
    billActionlist: '/api/bill/billActionlist',
    billScales: '/api/bill/billScales',
    billTypes: '/api/bill/billTypes',
    payChannel: '/api/bill/payChannel',
    payBill: '/api/bill/payBill',
    mallNotifyList: '/api/mallAdmin/notifyList',
    mallNearBillHot: '/api/mallAdmin/nearBillHot',
    mallOweBillHot: '/api/mallAdmin/oweBillHot',
    mallListBill: "/api/mallAdmin/listBill",
    mallBillSum: "/api/mallAdmin/billSum",
    mallRent: "/api/mallAdmin/rent",
    mallSales: "/api/mallAdmin/sales",
    mallBillDailyTypes: "/api/mallAdmin/billDailyTypes",
    menus: "/api/mallAdmin/menus",
    billDailyAdd: "/api/mallAdmin/billDailyAdd",
    getbuildingfloorlist: "/api/mallAdmin/getbuildingfloorlist",
    getShopList: "/api/mallAdmin/shopList?pageNum=1&pageSize=1000&floor=",
    getShopMeterList: "/api/mallAdmin/shopMeterList?",
    timeList: "/api/mallAdmin/timeList",
    meterList: "/api/mallAdmin/meterList",
    preShopReadingList: "/api/mallAdmin/preShopReadingList?meterId=",
    commitEnergyReading: "/api/mallAdmin/commitEnergyReading",

    /**
     * 获得openId
     */
    getOpenId: "/api/wx/getOpenId",
    /**
     * 获得超级管理员openid
     */
    getSuperOpenId: "/api/wx/getSuperOpenId",
    /**
     * 获得手机号
     */
    getUserPhone: "/api/wx/getUserPhone",
    /**
     * 
     */
    getUserPhoneForBuser: "/api/wx/getUserPhoneForBuser",
    /**
     * 发起微信小程序支付订单
     */
    createorder: "/api/pay/create",
    /**
     * 更新支付订单状态
     */
    updatePayBill: '/api/pay/updatePayBill',
    /**
     * 获取用户等级及在此商户的折扣率及折扣后的金额
     */
    getUserInfo: "/api/user/getUserInfo",
    /**
     * 扫C端会员码返回会员信息
     */
    memScan: "/api/mem/mem_scan",
    /**
     * 补充会员信息
     */
    cMemberAdd: "/api/cuser/updateUserInfo",
    /**
     * 
     */
    findUserInfo: '/api/cuser/findUserInfo',
    /**
     *b端来源会员信息分页列表接口
     */
    listCUser: '/api/cuser/listCUser',
    /**
     *C端扫B端储值卡交易流水(消费记录 + 补贴)列表接口
     */
    cardPayList: "/api/cardPay/list",

    cardRefundCardOrder: "/api/cardPay/refundCardOrder",

    cardPayDetail: "/api/cardPay/detail",
    /**
     *B端根据手机号查询卡列表
     */
    cardInfoList: "/api/cardInfo/list",
    useCardBySearchPhone: "/api/merchant/useCardBySearchPhone",
    /**
     *C端扫B端储值卡交易流水SUM
     */
    payMum: "/api/cardPay/sum",
    /**
      补贴记录
     */
    subsidyList: "/api/subsidy/list",
    /**
     * 补贴记录汇总
     */
    subsidySum: "/api/subsidy/sum",
    /**
     * 图片上传
     */
    imgUpload: '/api/upload/awsFileUpload',
    /**
     * 获取商户列表
     */
    getMerchentList: "/api/merchant/name_list",
    /**
     * 获取消费金额对应积分
     */
    getCreditNum: "/api/credit/findByMerchantIdAndSpend",
    /**
     * 积分新增
     */
    addCredit: "/api/credit/add",
    /**
     * 根据手机号查询C端会员信息
     */
    findByPhone: "/api/credit/findByPhone",
    /**
     * 获取积分操作记录
     */
    getCreditList: "/api/credit/list",
    /**
     * 查询账户信息
     */
    findAccountById: "/api/merchant/findAccountById",
    /**
     * 更新收款账户信息
     */
    updateAccount: "/api/merchant/updateAccount",
    /**
     * 删除分账账户
     */
    deleteByReceiverId: "/api/merchant/deleteByReceiverId",
    /**
     * 获得解单的list
     */
    tradeDailyList: "/api/wxMerchantTradeDaily/list",
    /**
     *保存或编辑
     */
    saveOrUpdate: "/api/wxMerchantTradeDaily/saveOrUpdate",
    /**
     * 解单详情详情
     */
    wxMerchantTradeDailyfindById: "/api/wxMerchantTradeDaily/findById",
    /**
     * 获取会员可赠送的券列表
     */
    wxMerchantcouponSend: "/api/couponSend/list",
    /**
     * 商户注券操作
     */
    wxMerchantcouponhandSel: "/api/couponSend/handSel",
    /**
     * 商户注券记录
     */
    wxMerchantcouponStory: "/api/couponSend/actionLog",
    /**
     * 获取结算单详情接口
     */
    findSettleById: "/api/bill/findSettleById",
    /**
     * 检查用户手机授权状态
     */
    checkPhoneStatus: "/api/wx/checkPhoneStatus",
    /**
     * 检查用户是否有权限修改收款账户
     */
    permitModifiy: "/api/merchant/permitModifiy",
    /**
     * 查询服装tag
     */
    getTag: "/api/tag/getData",
    /**
     * 收银满减券
     */
    getManjian: "/api/micropay/order_create_v2",
    /**
     * 获取营销结算列表
     */
    getSubsidyList: "/api/subsidy/list",
    /**
     * 获取营销结算汇总
     */
    getSubsidySummary: "/api/subsidy/summary",
    /**
     *刷卡支付订单
     */
    orderCreate2: '/api/micropay/pay_order_create_v2',
    /**
     * 查询商户授权状态
     */
    getOpenIdByPhone: "/api/merchant/getOpenIdByPhone",
    /**
     * B端发卷-查询
     */
    getCouponlist: "/api/coupon/list",
    /**
     * B端发卷-已上架
     */
    getShelf: "/api/wxCouponChannel/list",
    /**
     * B端发卷-添加通用卷
     */
    addCoupon: "/api/coupon/add",
    /**
     * B端发卷-修改通用券
     */
    updataCoupon: "/api/coupon/update",
    /**
     *B端发卷- 提交审批
     */
    submitExamine: "/api/coupon/apply",
    /**
     * B端发卷-投放
     */
    addbatch: "/api/wxCouponChannel/addbatch",
    /**
     * B端发卷-下架
     */
    soldOut: "/api/wxCouponChannel/update",
    /**
     * B端发卷-作废
     */
    cancellation: "/api/coupon/update",
    /**
     * B端发卷-查询审批历史记录
     */
    lookHistory: "/api/coupon/flowHistory",
    /**
     * 配送列表
     */
    goodsList: '/api/couponOrder/goodsList',
    /**
     * 查询配送详情
     */
    ouponOrderId: "/api/couponOrder/detail",
    /**
     * 发货
     */
    sendGoods: "/api/couponOrder/sendGoods",
    getAppMouldType: "/api/wx/getAppMouldType",
    /**
     * 上传交易凭证
     */
    finishBill: "/api/bill/finishBill",
    /**
     * 判断行业资质
     */
    getQualification: "/api/sharingReceiverApply/getQualification",
    /**
     * 进件
     */
    receiverAdd: "/api/sharingReceiverApply/receiverAdd",
    /**
     * 查询进件状态
     */

    getReceiverApply: "/api/sharingReceiverApply/getReceiverApply",
    /**
     * 图片上传
     */
    merchantUpload: "/api/mediaUpload/merchantUpload",
    /**
     * 获取行业资质列表
     */
    getQualification: "/api/sharingReceiverApply/getQualification",
    /**
     * 查询银行
     * 
     */
    banking: "/api/bank/banking",

    /**
     * 查询省份
     */
    // areasProvinces:"/api/bank/areasProvinces",
    areasProvinces: "/api/bank/wxProvinces",

    /**
     * 查询市
     */
    // areasCities:"/api/bank/areasCities",
    areasCities: "/api/bank/wxCities",

    /**
     * 查支行
     */
    bankBranches: "/api/bank/bankBranches",

    /**
     * 下载授权函
     */
    getYwsqh: "/api/sharingReceiverApply/getYwsqh_v2",
    /**
     * 进件提交审核
     */
    applyment: "/api/sharingReceiverApply/applyment",
    /**
     * 查询进件状态
     */
    syncApplymentStates: "/api/sharingReceiverApply/syncApplymentStates",
    /**
     * 查看支付配置
     * 
     */
    getPayAccount: "/api/payAccount/getPayAccount",

    cardInfoDetail: "/api/cardInfo/detail",
    cardPayScanCard: '/api/cardPay/scanCard',
    // 活动返现
    cashbackList: '/api/cashback/list',
    recordList: '/api/cashback/recordList',
    recordCount: '/api/cashback/recordCount',
    recordInfo: '/api/cashback/recordInfo',
    saveOrUpdateRecord: '/api/cashback/saveOrUpdateRecord',
    //线上抽奖
    raffleList: '/api/raffle/list',
    raffleRecordList: '/api/raffle/recordList',
    raffleRecordCount: '/api/raffle/recordCount',
    raffleRecordInfo: '/api/raffle/recordInfo',
    raffleSaveOrUpdateRecord: '/api/raffle/saveOrUpdateRecord',

    //军团活动
    legionList: '/api/legion/list',
    legionOrderGetInfoById: '/api/legionOrder/getInfoById',
    legionOrderList: '/api/legionOrder/list',
    legionOrderSaveOrUpdate: '/api/legionOrder/saveOrUpdate',
    legionOrderStatistics: '/api/legionOrder/statistics',
    legionUserGetByPhone: '/api/legionUser/getByPhone',
    legionUserGetInfoById: '/api/legionUser/getInfoById',
    legionUserList: '/api/legionUser/list',
    legionUserSaveOrUpdate: '/api/legionUser/saveOrUpdate',
    //军团活动用户分页列表
    legionUserList:'/api/legionUser/list', 

    //活动发奖
    offlineRecordList: "/api/offlineRecord/list",
    //新建/修改活动审批
    offlineSaveOrUpdate: '/api/offlineRecord/saveOrUpdate',
    //查看活动审批详情
    offlineRecordGetInfoById: '/api/offlineRecord/getInfoById',
    //线下活动统计
    fflineRecordStatistics: '/api/offlineRecord/statistics'
    
  },

  weapp: {
    appId: weappId,
    dataTowerUrl: dataTowerUrl,
  }
};

for (var key in config.api) {
  config.api[key] = apiPrefix + config.api[key];
}

module.exports = config;