feat: 新增工单中心、房间巡查、失物招领等业务模块
- 新增工单中心(ticket_center)与工单工作台(ticket_workbench)页面 - 新增房间巡查(room_inspection)与失物招领发布(lost_found_publish)页面 - 预约看样流程新增房型/楼栋/楼层选择器组件 - 新增工具模块: booking-entry、privacy、reservation-flow - api/index.js 补充楼层列表、看样提交等接口 - locales/messages.js 补充多语言文案 - manifest.json 开启微信小程序隐私检查 - 完善登录、注册、申请详情、账单等相关页面交互
This commit is contained in:
@@ -112,18 +112,25 @@ function pickFirstValue(...values) {
|
||||
return ''
|
||||
}
|
||||
|
||||
function buildPendingContractQuery() {
|
||||
const user = getCurrentUser() || {}
|
||||
const userCode = pickFirstValue(user.userCode, user.code, user.UserCode)
|
||||
const query = {
|
||||
ProviderType: 'WechatMiniProgram'
|
||||
function buildPendingContractQuery(order = {}) {
|
||||
const orderNo = pickFirstValue(order.orderNo, order.no, order.code, order.OrderNo)
|
||||
if (!orderNo) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (userCode) {
|
||||
query.UserCode = userCode
|
||||
return {
|
||||
ProviderType: 'WechatMiniProgram',
|
||||
OrderNo: orderNo
|
||||
}
|
||||
}
|
||||
|
||||
return query
|
||||
function buildEffectiveContractQuery(order = {}) {
|
||||
const orderNo = pickFirstValue(order.orderNo, order.no, order.code, order.OrderNo)
|
||||
if (!orderNo) {
|
||||
return null
|
||||
}
|
||||
return {
|
||||
OrderNo: orderNo
|
||||
}
|
||||
}
|
||||
|
||||
function enrichBookingLanguageFields(booking = {}) {
|
||||
@@ -233,15 +240,23 @@ function requestStayState(language = 'zh') {
|
||||
IsExport: false
|
||||
}, language)
|
||||
.then((orderResponse) => {
|
||||
return Promise.all([
|
||||
Promise.resolve(orderResponse),
|
||||
getMyPendingSignContracts(buildPendingContractQuery(), language).catch(() => []),
|
||||
getMyEffectiveContracts({}, language).catch(() => [])
|
||||
])
|
||||
})
|
||||
.then(([orderResponse, pendingContractsResponse, effectiveContractsResponse]) => {
|
||||
const orderList = normalizeBookingList(parseOrderListResponse(orderResponse), language)
|
||||
const currentOrder = pickCurrentStayOrder(orderList)
|
||||
const pendingContractQuery = buildPendingContractQuery(currentOrder)
|
||||
const effectiveContractQuery = buildEffectiveContractQuery(currentOrder)
|
||||
|
||||
return Promise.all([
|
||||
Promise.resolve(orderList),
|
||||
Promise.resolve(currentOrder),
|
||||
pendingContractQuery
|
||||
? getMyPendingSignContracts(pendingContractQuery, language).catch(() => [])
|
||||
: Promise.resolve([]),
|
||||
effectiveContractQuery
|
||||
? getMyEffectiveContracts(effectiveContractQuery, language).catch(() => [])
|
||||
: Promise.resolve([])
|
||||
])
|
||||
})
|
||||
.then(([orderList, currentOrder, pendingContractsResponse, effectiveContractsResponse]) => {
|
||||
const pendingContracts = parseContractList(pendingContractsResponse)
|
||||
const effectiveContracts = parseContractList(effectiveContractsResponse)
|
||||
const currentBooking = enrichBookingLanguageFields(pickCurrentBooking(orderList) || buildContractStepBooking(pendingContracts))
|
||||
|
||||
Reference in New Issue
Block a user