import { onMaiDian } from '../../../utils/maiDian' import { onGoH5Page } from '../../../utils/getUserInfo' import { apiGoBorrow, apiProblemLog } from '../../../api/index/index' const H5Link = require('../../../api/base').allBaseUrl.GDEnvs.web Component({ properties: { homeInfo: Object }, data: { showDialogMultipl: false }, methods: { // 点击卡片按钮操作事件 onGoBorrowBtn () { onMaiDian('首页-点击-去借钱') wx.showLoading({ title: '加载中' }) if (this.properties.homeInfo.borrowStatus === 8) { onGoH5Page({ is_need_login: true, url: `${H5Link}/repayment/record` }) } else { apiGoBorrow({}).then((res: any)=> { wx.hideLoading() if (res.code === '1000') { apiProblemLog({ remark: JSON.stringify({ logName: 'goBorrow响应数据', logParams: res.data }) }) // canNext是否可继续后续流程:1可以,0不可以 if (res.data.canNext) { onGoH5Page({ is_need_login: res.data.isThirdH5 ? false : true, type: res.data.isThirdH5 ? 'third' : '', url: res.data.url }) } else { // 不可进行后续流程类型:1下载,0弹窗 if (res.data.noNextType) { wx.navigateTo({ url: '/pages/download/index' }) } else { wx.showModal({ showCancel: false, content: '升级中,本平台暂不支持更多借款,敬请期待。' }) } } } else if (['1636', '10004'].includes(res.code)) { // 1636二推审核中&待放款,10004一推审核中 const __this = this wx.showModal({ showCancel: false, content: res.msg, success (e) { if (e.confirm) { // 审核中点击确定重新调首页接口 __this.triggerEvent('handleGetHomePage') } } }) } else if (['1641', '1643', '1642'].includes(res.code)) { // 1641OCR即将过期,1643OCR已过期,1642已授信(一推)且额度已失效 wx.showModal({ showCancel: false, content: res.msg, success (e) { if (e.confirm) { let url = '' if (['1641', '1643'].includes(res.code)) { url = `${H5Link}/auth/identitycard?next=home` } else if (['1642'].includes(res.code)) { url = `${H5Link}/auth/loading` } onGoH5Page({ is_need_login: true, url }) } } }) } else if (['1644'].includes(res.code)) { // 主副号位切换成功,生成新的uniqueCode wx.navigateTo({ url: '/pages/download/index' }) } else { wx.showToast({ title: res.msg, icon: 'none' }) } }) } } } })