feat: 优化首页服务入口与租住业务流程
补齐首页待办跳转、押金支付引导和多类租住服务页面能力,统一租客端关键业务流程体验。
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
<current-application-bill-panel
|
||||
ref="billPanel"
|
||||
:reference-type-no="referenceTypeNo"
|
||||
:auto-resolve-reference="!pendingBillNo || !!referenceTypeNo"
|
||||
@reference-resolved="handleReferenceResolved"
|
||||
@all-paid="handleAllPaid"
|
||||
/>
|
||||
@@ -16,6 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { accountQueryBill } from '@/api/index.js'
|
||||
import { fetchEnums } from '@/utils/enum-store.js'
|
||||
import { saveActiveApplicationCode, saveHomePageTabId } from '@/utils/app-state'
|
||||
import CurrentApplicationBillPanel from '../components/CurrentApplicationBillPanel.vue'
|
||||
@@ -26,17 +28,54 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
referenceTypeNo: ''
|
||||
referenceTypeNo: '',
|
||||
pendingBillNo: ''
|
||||
}
|
||||
},
|
||||
async onLoad(options) {
|
||||
await fetchEnums(false, this.$getLanguage())
|
||||
this.referenceTypeNo = options && options.referenceTypeNo ? decodeURIComponent(options.referenceTypeNo) : ''
|
||||
this.pendingBillNo = options && options.billNo ? decodeURIComponent(options.billNo) : ''
|
||||
if (!this.referenceTypeNo && this.pendingBillNo) {
|
||||
await this.resolveReferenceTypeNoByBillNo(this.pendingBillNo)
|
||||
}
|
||||
if (this.referenceTypeNo) {
|
||||
saveActiveApplicationCode(this.referenceTypeNo)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
extractBillDetail(response) {
|
||||
const payload = response && response.data ? response.data : response
|
||||
if (payload && payload.data && typeof payload.data === 'object' && !Array.isArray(payload.data)) {
|
||||
return payload.data
|
||||
}
|
||||
return payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : {}
|
||||
},
|
||||
async resolveReferenceTypeNoByBillNo(billNo = '') {
|
||||
const currentBillNo = String(billNo || '').trim()
|
||||
if (!currentBillNo) {
|
||||
return ''
|
||||
}
|
||||
try {
|
||||
const response = await accountQueryBill({ billNo: currentBillNo }, this.$getLanguage())
|
||||
const detail = this.extractBillDetail(response)
|
||||
const referenceTypeNo = String(
|
||||
detail.referenceTypeNo
|
||||
|| detail.ReferenceTypeNo
|
||||
|| detail.detailCode
|
||||
|| detail.applicationCode
|
||||
|| ''
|
||||
).trim()
|
||||
if (referenceTypeNo) {
|
||||
this.referenceTypeNo = referenceTypeNo
|
||||
saveActiveApplicationCode(referenceTypeNo)
|
||||
}
|
||||
return referenceTypeNo
|
||||
} catch (error) {
|
||||
console.error('根据账单号解析申请单号失败', error)
|
||||
return ''
|
||||
}
|
||||
},
|
||||
handleReferenceResolved(referenceTypeNo) {
|
||||
this.referenceTypeNo = referenceTypeNo || ''
|
||||
if (this.referenceTypeNo) {
|
||||
|
||||
Reference in New Issue
Block a user