Commit c34c7862 by 李伟康

```

feat(usedCar): 新增二手车相关接口与日报功能

- 新增 usedCarApi 模块,提供二手车驻店日报的增删改查接口
- 在 interceptionApi 中增加二手车员工入职及日报填写状态校验接口
- 新增 DailyReport 组件支持二手车日报填写、展示与限制逻辑
- 调整 HomeFrame 页面图标与跳转逻辑,支持二手车场景
- 优化日报填写字段和提交逻辑,限制输入范围并增加超期提示
- 增加 signHttp 请求超时配置,提升接口稳定性
```
1 parent 0498f384
......@@ -9,6 +9,8 @@ import receptionApi from './receptionApi'
import sceneMarketApi from './sceneMarketApi'
import interceptionApi from './interceptionApi'
import popupApi from './popupApi'
import usedCarApi from './usedCar'
module.exports = {
commonApi,
systemApi,
......@@ -20,5 +22,6 @@ module.exports = {
sceneMarketApi,
interceptionApi,
popupApi,
evaluationApi
evaluationApi,
usedCarApi
}
import http from '../request/http'
import signHttp from '../request/signHttp'
module.exports = {
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid (data) {
......@@ -27,5 +27,22 @@ module.exports = {
...data
})
},
/**
* 二手车查询员工昨天是否新入职或调店
*/
checkUsedCarStaffIsNew (data) {
return http.post({
method: 'dj.api.smartcarlife.secondHandCar.staffDailyReport.popup.need',
projectName: 'boutique',
...data
})
},
/**
* 查询员工是否需要填写二手车日报
*/
checkUsedCarStaffDailyReportValid (data) {
return signHttp.post('/carDailyReport/yesterday/check', {
...data
})
},
}
import { add } from 'lodash'
import http from '../request/signHttp'
module.exports = {
/** 二手车驻店日报列表 */
getCarDailyReportList(data) {
return http.post('/carDailyReport/list', {
...data
})
},
/**
* 新增二手车驻店日报
*/
addCarDailyReport(data) {
return http.post('/carDailyReport/add', {
...data
})
},
/**
* 二手车驻店日报详情
*/
getCarDailyReportDetail(data) {
return http.post('/carDailyReport/detail', {
...data
})
},
/**
* 修改二手车驻店日报
*/
editCarDailyReport(data) {
return http.post('/carDailyReport/edit', {
...data
})
},
}
......@@ -20,6 +20,7 @@ function createRequestInstance() {
params: {
sessionId
},
timeout: 30000,
response: {
code_key: 'code',
code_success_value: '0',
......
No preview for this file type
......@@ -148,7 +148,7 @@ export default {
7: {
title: '二手车',
describe: '二手车业务',
icon: 'icon-scene-5',
icon: 'icon-scene-7',
zoom: 1.1669,
}
......
<template>
<view class="container" @click="handleTouchStart">
<view
class="container"
@click="handleTouchStart"
>
<view :class="['home', { show: !id && showHome }]">
<left-side :userInfo="userInfo" :tabIndex.sync="tabIndex" ref="leftBox" @changeTab="changeTab" @stopAudio="stopAudio" @showReadCountTips="showReadCountTips" @closeTips="closeTips" />
<view class="tips-box" :style="tipsObject.style" @click.stop="closeTips">{{ tipsObject.text }}</view>
<left-side
:userInfo="userInfo"
:tabIndex.sync="tabIndex"
ref="leftBox"
@changeTab="changeTab"
@stopAudio="stopAudio"
@showReadCountTips="showReadCountTips"
@closeTips="closeTips"
/>
<view
class="tips-box"
:style="tipsObject.style"
@click.stop="closeTips"
>{{ tipsObject.text }}</view>
<view class="right-side">
<view :class="['app-content-box right-content', { 'show-content-box': tabIndex == 0 }]">
<view class="start" @click="start">
<view
class="start"
@click="start"
>
<template v-if="sceneType != 4">
<view class="sprite-icon icon-start-text"></view>
</template>
......@@ -15,7 +33,14 @@
<view class="module-box box-class">
<view class="common-title">产品介绍</view>
<view class="content-box">
<swiper-component :moduleList="moduleList" @click="swiperClick" :stopAutoPlay="previewOff" :imgKey="bannerKey" :loadComplete="loadComplete" :noDataObject="swiperNoDataObject"></swiper-component>
<swiper-component
:moduleList="moduleList"
@click="swiperClick"
:stopAutoPlay="previewOff"
:imgKey="bannerKey"
:loadComplete="loadComplete"
:noDataObject="swiperNoDataObject"
></swiper-component>
</view>
</view>
<view class="tool-box box-class">
......@@ -28,19 +53,36 @@
<view class="content-right box-class">
<view class="common-title">服务中心</view>
<view class="content-box">
<MessageIndex class="message-box" ref="messageRef" />
<MessageIndex
class="message-box"
ref="messageRef"
/>
</view>
</view>
</view>
</view>
<view :class="['app-content-box right-content', { 'show-content-box': tabIndex == 99 }]">
<component :is="'Point'" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" />
<component
:is="'Point'"
ref="pointRef"
:userInfo="userInfo"
@showPage="handleShowPage"
/>
</view>
<template v-if="tabIndex != 0 && tabIndex != 99">
<component :is="componentName" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" :isPermissionFunction="isPermission" />
<component
:is="componentName"
ref="pointRef"
:userInfo="userInfo"
@showPage="handleShowPage"
:isPermissionFunction="isPermission"
/>
</template>
</view>
<view class="store-addr" v-if="footerBox">
<view
class="store-addr"
v-if="footerBox"
>
<view class="icon-addr sprite-icon icon-addr"></view>
<view class="addr-text">{{ userInfo.shopMerchantName }}</view>
</view>
......@@ -48,17 +90,41 @@
<view :class="['detail', { show: id }]">
<slot name="detail" />
</view>
<view class="point-page" v-if="!showHome">
<component :is="pointComponentName" @backHome="backHome" @jump="jump" :transfer="transfer" />
<view
class="point-page"
v-if="!showHome"
>
<component
:is="pointComponentName"
@backHome="backHome"
@jump="jump"
:transfer="transfer"
/>
</view>
<!-- 未点击开始接待,弹窗 -->
<MessageBox ref="previewRef" @confirm="previewHandler('preview', true)" :popupW="704" content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」" confirmBtnText="预览素材" @cancel="previewHandler('previewCancel')" @close="previewHandler('previewClose')"></MessageBox>
<MessageBox
ref="previewRef"
@confirm="previewHandler('preview', true)"
:popupW="704"
content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」"
confirmBtnText="预览素材"
@cancel="previewHandler('previewCancel')"
@close="previewHandler('previewClose')"
></MessageBox>
<!-- 停留弹框 -->
<!-- <MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox> -->
<!-- 退出弹框 -->
<MessageBox :popupW="704" ref="finish" :content="finishContene" :isFooter="false">
<MessageBox
:popupW="704"
ref="finish"
:content="finishContene"
:isFooter="false"
>
<view class="footer">
<view class="footer-btn confirm flex" @click="$emit('openStep')">
<view
class="footer-btn confirm flex"
@click="$emit('openStep')"
>
<template v-if="finishDoneText">
{{ finishDoneText }}
</template>
......@@ -67,7 +133,10 @@
<text>(推荐)</text>
</template>
</view>
<view class="footer-btn cancel flex" @click="$emit('backHome')">
<view
class="footer-btn cancel flex"
@click="$emit('backHome')"
>
仍要退出
<text>(不推荐)</text>
</view>
......@@ -76,7 +145,11 @@
<!-- 升级弹框 -->
<update-box />
<slot name="content" />
<web-view @message="handlerMessage" ref="webview" src="/hybrid/html/index.html"></web-view>
<web-view
@message="handlerMessage"
ref="webview"
src="/hybrid/html/index.html"
></web-view>
<!-- <web-view
ref="studyWebview"
:src="jumpUrl"
......@@ -130,7 +203,7 @@ export default {
loadComplete: Boolean,
swiperNoDataObject: Object
},
data() {
data () {
return {
studyUrl: '',
jumpUrl: '',
......@@ -146,35 +219,35 @@ export default {
previewOff: false
}
},
mounted() {
mounted () {
const userInfo = uni.$storage.get('userInfo') || {}
this.userInfo = userInfo
permision.requestAndroidPermission('android.permission.RECORD_AUDIO') // 进入界面时检查权限
},
provide() {
provide () {
return {
showPage: this.handleShowPage,
hideFooter: this.handleFooter
}
},
computed: {
previewRef() {
previewRef () {
return this.$refs.previewRef
},
finishRef() {
finishRef () {
return this.$refs.finish
},
componentName() {
componentName () {
let tabs = this.$refs.leftBox?.tabs
return tabs ? tabs[this.tabIndex].name : ''
},
sceneType() {
sceneType () {
const { sceneType } = uni.$storage.get('userInfo')
return sceneType
}
},
methods: {
async changeTab({ item, index }) {
async changeTab ({ item, index }) {
if (index == 0) this.$refs.messageRef.getMessageSummary()
this.previewOff = index != 0
this.$emit('changeTab', index)
......@@ -193,16 +266,16 @@ export default {
// this.jumpUrl = ''
// }
},
handleFooter(val) {
handleFooter (val) {
this.footerBox = val
},
backHome() {
backHome () {
this.showHome = true
Promise.resolve().then(() => {
this.$refs.pointRef?.$refs?.centerRef?.init && this.$refs.pointRef.$refs.centerRef.init()
})
},
jump(val) {
jump (val) {
this.showHome = true
if (val == 'CustomerFile') {
this.tabIndex = 2
......@@ -210,12 +283,12 @@ export default {
}
this.start()
},
handleShowPage(name, transfer) {
handleShowPage (name, transfer) {
this.transfer = transfer
this.showHome = false
this.pointComponentName = name
},
handleOperation(val, data) {
handleOperation (val, data) {
const { type } = val
// 提取公共的webview设置逻辑
......@@ -285,32 +358,32 @@ export default {
}
},
// 学习中心修改阅读状态,打开后才修改
async getStudyCenterRead(id) {
async getStudyCenterRead (id) {
const res = await uni.$api.commonApi.getStudyCenterRead({ id })
},
showReadCountTips(res) {
showReadCountTips (res) {
this.tipsObject = res
},
closeTips() {
closeTips () {
this.$refs.leftBox.readCount = 0
this.tipsObject = {
style: '',
text: ''
}
},
swiperClick(e) {
swiperClick (e) {
uni.$track.add({
eventCode: 'app_product_Introduction'
})
this.previewOff = true
this.$emit('swiperClick', e)
},
previewHandler(name, off = false) {
previewHandler (name, off = false) {
this.previewOff = off
this.$emit(name)
},
start() {
start () {
const { sceneType } = this
if (sceneType == 7) return //二手车无接待功能
uni.$track.add({
......@@ -318,12 +391,17 @@ export default {
})
this.$emit('start')
},
async updateApp(requested = false) {
async updateApp (requested = false) {
if (!requested) await uni.$api.systemApi.getMockData(true)
this.checkVersion()
},
async entranceClick(item) {
async entranceClick (item) {
// 清除评估单的图片视频资源缓存
const noInterceptPage = ['DailyReport'],
{ sceneType } = this
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport(sceneType != 7)))) return
if (sceneType != 7 && await this.inspectionOfProhibitionBill()) return
if (item.name === 'EvaluationFormList') {
mediaResourceManager.cleanupExpired()
uni.navigateTo({
......@@ -331,8 +409,6 @@ export default {
})
return
}
const noInterceptPage = ['DailyReport']
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
let pageName = {
1: 'boutique',
7: 'usedCar'
......
......@@ -25,7 +25,8 @@ export default {
if (checkWW) eventRequest.push(this.clockedIntoWork())
let apiName = {
0: this.equityStaffDailyReport,
1: this.staffDailyReport
1: this.staffDailyReport,
7: this.usedCarDailyReport
}
eventRequest.push(apiName[sceneType]())
}
......@@ -59,6 +60,9 @@ export default {
})
}
},
/**
* 轻改日报
*/
staffDailyReport () {
let { userInfo } = this
return new Promise((resolve, reject) => {
......@@ -103,6 +107,51 @@ export default {
})
})
},
/**
* 二手车日报
*/
usedCarDailyReport () {
let { userInfo } = this
return new Promise(async (resolve, reject) => {
const data = await uni.$api.interceptionApi.checkUsedCarStaffIsNew({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
staffPhone: userInfo.phone,
sceneType: 7
})
if (!data) resolve(false) //检测是否新员工或调店 flase不检测日报 true检测日报
else {
const _data = await uni.$api.interceptionApi.checkUsedCarStaffDailyReportValid({
sellerMerchantId: userInfo.shopMerchantId,
}) //true 已填写 false 未填写
if (!_data) {
// 获取当前日期
let currentDate = new Date()
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
this.addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 2, res => {
if (res.confirm) {
const pages = getCurrentPages(),
currentPage = pages[pages.length - 1]
if (currentPage.route == 'pages/usedCar/tool/index') uni.$emit('jumpToDailyReport', formattedDate)
else uni.navigateTo({
url: `/pages/usedCar/tool/index?componentName=DailyReport&currentDate=${formattedDate}`
})
}
})
resolve(true)
} else resolve(false)
}
})
},
clockedIntoWork () {
return new Promise((resolve, reject) => {
uni.$api.interceptionApi
......@@ -129,6 +178,7 @@ export default {
})
})
},
/**延保日报 */
equityStaffDailyReport () { },
addModalToQueue (title, content, confirmText, showCancel, priority, eventCallback) {
if (modalQueue.findIndex(val => val.content == content) < 0)
......
......@@ -127,7 +127,7 @@ export default {
userInfo = {
...userInfo,
openSceneArr: [...openSceneArr, 7], //❗7 为联调写死,提测要删 ❗
openSceneArr,
shopMerchantName,
shopMerchantId,
default4SStoreInfo: {
......
......@@ -32,7 +32,7 @@
:endDate="endDate"
:showMonth="false"
@monthSwitch="currentMonth = `${$event.year}-${$event.month}`"
@change="currentDate = $event.fulldate"
@change="changeDate"
backgroundColor="transparent"
:selected="selectedDays"
:date="currentDate"
......@@ -153,10 +153,12 @@ export default {
// name:跳转组件名,val:跳转参数
jump (name, val) {
this.toolComponentName = name
console.log(this.toolComponentName, val)
if (val) {
this.transmissionOfData = val
}
},
changeDate(e){
this.currentDate = e.fulldate
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!