Commit 1db3bef1 by zhangxw Committed by chenwq

报告管理/客户签约修改需求开发

1 parent 575f1034
...@@ -249,7 +249,9 @@ ...@@ -249,7 +249,9 @@
"pages/evaluationForm/signInfo/signInfo", "pages/evaluationForm/signInfo/signInfo",
"pages/indexPage/dailyReport/dailyReport", "pages/indexPage/dailyReport/dailyReport",
"pages/deliveryNote/deliveryDetail/deliveryDetail", "pages/deliveryNote/deliveryDetail/deliveryDetail",
"pages/ocrUsedCarModules/ocrUsedCarModules" "pages/ocrUsedCarModules/ocrUsedCarModules",
"pages/indexPage/reportManage/reportList/reportList",
"pages/indexPage/reportManage/addReport/addReport"
] ]
}, },
{ {
......
...@@ -1663,6 +1663,7 @@ Page({ ...@@ -1663,6 +1663,7 @@ Page({
['owner.carSeriesName']: res.vehicleSeriesName ['owner.carSeriesName']: res.vehicleSeriesName
}) })
}) })
wx.$track.setTrackData(0, 'submit_order', {}, '', 0)
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
......
...@@ -1411,12 +1411,20 @@ Component({ ...@@ -1411,12 +1411,20 @@ Component({
) { ) {
wx.$track.setTrackData(0, 'supervisor_daily_page', {}, '', 0) wx.$track.setTrackData(0, 'supervisor_daily_page', {}, '', 0)
} }
// 接待记录埋点
if (item.path == 'packageEquity.receptionRecords') {
wx.$track.setTrackData(0, 'reception_records', {}, '', 0)
}
return wx.$router.go(item.path, { return wx.$router.go(item.path, {
scene: 0, scene: 0,
params: item.params || {} params: item.params || {}
}) })
} }
} else { } else {
// 场景集市添加埋点
if (item.menuText == '场景集市') {
wx.$track.setTrackData(0, 'scenario_marketplace', {}, '', 0)
}
if (item.navigateToUrl) { if (item.navigateToUrl) {
wx.navigateTo({ wx.navigateTo({
url: item.navigateToUrl url: item.navigateToUrl
......
...@@ -338,4 +338,20 @@ module.exports = { ...@@ -338,4 +338,20 @@ module.exports = {
returnAll: true, returnAll: true,
}); });
}, },
/** 报告管理列表数据 */
getReportListData(data) {
return newApi.post('/checkReport/pageList', data, {returnAll: true})
},
/** 报告管理列表tab项统计数据 */
getReportStaticsData(data) {
return newApi.post('/checkReport/numCount', data, {returnAll: true})
},
/** 新增报告 */
addReportAPI(data) {
return newApi.post('/checkReport/create', data, {returnAll: true})
},
/** 校验是否有进入权限 */
checkPermissionsAPI(data) {
return newApi.post('/permissionAccess/checkVisitButton', data, {returnAll: true})
}
}; };
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
margin-top: var(--fontSize14); margin-top: var(--fontSize14);
box-sizing: border-box; box-sizing: border-box;
color: #5A5E66; color: #5A5E66;
border-bottom: var(--fontSize1) solid #F2F3F5;
width: 100%; width: 100%;
display: flex; display: flex;
line-height: var(--fontSize88); line-height: var(--fontSize88);
......
...@@ -159,9 +159,12 @@ Page({ ...@@ -159,9 +159,12 @@ Page({
key: "signingInfo.saleContract.fullPrice", key: "signingInfo.saleContract.fullPrice",
cell: "元", cell: "元",
}, },
{ label: "签署人类型", key: "signingInfo.saleContract.signerTypeStr" },
{ label: "签约车主", key: "signingInfo.saleContract.partAName" }, { label: "签约车主", key: "signingInfo.saleContract.partAName" },
{ label: "手机号码", key: "signingInfo.saleContract.phone" }, { label: "手机号码", key: "signingInfo.saleContract.phone" },
{ label: "经办人", key: "signingInfo.saleContract.handler" },
{ label: "身份证号", key: "signingInfo.saleContract.idCard" }, { label: "身份证号", key: "signingInfo.saleContract.idCard" },
{ label: "营业执照号", key: "signingInfo.saleContract.orgLicenseNumber" },
{ {
label: "合同模版名称", label: "合同模版名称",
key: "signingInfo.saleContract.docTemplateName", key: "signingInfo.saleContract.docTemplateName",
...@@ -177,6 +180,11 @@ Page({ ...@@ -177,6 +180,11 @@ Page({
type: "images", type: "images",
}, },
{ {
label: "营业执照图片",
key: "signingInfo.saleContract.orgLicenseUrl",
type: "imageArr"
},
{
label: "三方/委托交易凭证", label: "三方/委托交易凭证",
key: "signingInfo.saleContract.thirdPartyTransactionVoucher", key: "signingInfo.saleContract.thirdPartyTransactionVoucher",
type: "image", type: "image",
...@@ -538,7 +546,7 @@ Page({ ...@@ -538,7 +546,7 @@ Page({
return; return;
} }
const { url, type } = e.currentTarget.dataset; const { url, type, index } = e.currentTarget.dataset;
// 设置正在预览标志 // 设置正在预览标志
this.setData({ this.setData({
...@@ -548,8 +556,8 @@ Page({ ...@@ -548,8 +556,8 @@ Page({
if (type === 1 || type === "1") { if (type === 1 || type === "1") {
// 图片预览 // 图片预览
wx.previewImage({ wx.previewImage({
current: url, current: !((index ?? '') === '') ? url[index] : url,
urls: [url], urls: !((index ?? '') === '') ? url : [url],
success: () => { success: () => {
// 预览成功后,延迟重置标志位(给用户时间关闭预览) // 预览成功后,延迟重置标志位(给用户时间关闭预览)
setTimeout(() => { setTimeout(() => {
...@@ -1038,6 +1046,7 @@ Page({ ...@@ -1038,6 +1046,7 @@ Page({
tabs.find((i) => i.key === "payment").hidden = false; tabs.find((i) => i.key === "payment").hidden = false;
} }
if (detailsInfo.signingInfo.saleContract) { if (detailsInfo.signingInfo.saleContract) {
detailsInfo.signingInfo.saleContract.signerTypeStr = detailsInfo.signingInfo.saleContract.signerType == 0 ? '个人' : detailsInfo.signingInfo.saleContract.signerType == 1 ? '企业委托' : '企业'
// 判断签约信息 // 判断签约信息
tabs.find((i) => i.key === "contract").hidden = false; tabs.find((i) => i.key === "contract").hidden = false;
} }
......
<!-- packageUsedCar/pages/evaluationForm/evaluationFormDetails/evaluationFormDetails.wxml --> <!-- packageUsedCar/pages/evaluationForm/evaluationFormDetails/evaluationFormDetails.wxml -->
<wxs module="utils"> <wxs module="utils">
// 根据路径获取对象值 // 根据路径获取对象值
var getValueByPath = function(obj, path) { var getValueByPath = function(obj, path, arrFlag) {
if (!obj || !path) return '-'; if (!obj || !path) return '-';
var keys = path.split('.'); var keys = path.split('.');
var value = obj; var value = obj;
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
return '-'; return '-';
} }
} }
if (arrFlag) return value.split(',')
return value !== '' && value !== null && value !== undefined ? value : '-'; return value !== '' && value !== null && value !== undefined ? value : '-';
}; };
...@@ -222,6 +223,27 @@ ...@@ -222,6 +223,27 @@
return false; return false;
} }
} }
var signerType = getValueByPath(data, 'signingInfo.saleContract.signerType')
// 如果签署人类型是个人/企业委托,隐藏经办人字段
if (signerType == 0 || signerType == 1) {
if (item.key == 'signingInfo.saleContract.handler') return false
}
// 如果签署人类型是个人,隐藏营业执照号/营业执照图片字段
if (signerType == 0) {
if (item.key == 'signingInfo.saleContract.orgLicenseNumber' || item.key == 'signingInfo.saleContract.orgLicenseUrl') return false
}
// 如果签署人类型是企业, 隐藏身份证号/身份证图片
if (signerType == 2) {
if (item.key == 'signingInfo.saleContract.idCard') return false
var keys = item.keys
if (keys && keys.length > 0) {
for (var i = 0; i < keys.length; i++) {
if (keys[i] == 'signingInfo.saleContract.idCardFrontUrl') {
return false
}
}
}
}
return true; return true;
}; };
...@@ -556,6 +578,12 @@ ...@@ -556,6 +578,12 @@
<image wx:if="{{!utils.isValueEmpty(detailsInfo, imgKey)}}" src="{{ utils.getValueByPath(detailsInfo, imgKey) }}" mode="aspectFill" class="cert-image mr-16" catchtap="previewMedia" data-url="{{ utils.getValueByPath(detailsInfo, imgKey) }}" data-type="1" /> <image wx:if="{{!utils.isValueEmpty(detailsInfo, imgKey)}}" src="{{ utils.getValueByPath(detailsInfo, imgKey) }}" mode="aspectFill" class="cert-image mr-16" catchtap="previewMedia" data-url="{{ utils.getValueByPath(detailsInfo, imgKey) }}" data-type="1" />
</block> </block>
</view> </view>
<!-- 单字段多图片 -->
<view wx:elif="{{item.type == 'imageArr'}}" class="flex flex-wrap">
<block wx:for="{{utils.getValueByPath(detailsInfo, item.key, true)}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex">
<image wx:if="{{subItem}}" src="{{subItem}}" mode="aspectFill" class="cert-image mr-16" catchtap="previewMedia" data-url="{{ utils.getValueByPath(detailsInfo, item.key, true)}}" data-index="{{subIndex}}" data-type="1"/>
</block>
</view>
<!-- 单张图片或视频(根据文件类型判断) --> <!-- 单张图片或视频(根据文件类型判断) -->
<block wx:elif="{{item.type == 'image'}}"> <block wx:elif="{{item.type == 'image'}}">
<!-- 判断是否是视频 --> <!-- 判断是否是视频 -->
......
...@@ -189,6 +189,18 @@ page { ...@@ -189,6 +189,18 @@ page {
height: 32rpx; height: 32rpx;
margin-left: 8rpx; margin-left: 8rpx;
} }
.radio-item {
display: flex;
align-items: center;
&.mr-20 {
margin-right: 20rpx;
}
.radio-icon {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
}
} }
.form-textarea { .form-textarea {
margin-top: 16rpx; margin-top: 16rpx;
...@@ -367,9 +379,9 @@ page { ...@@ -367,9 +379,9 @@ page {
} }
.title-label-see { .title-label-see {
flex-shrink: 0; flex-shrink: 0;
width: 180rpx; width: 168rpx;
color: #999EA8; color: #999EA8;
margin-right: 4rpx; margin-right: 16rpx;
} }
.image-box { .image-box {
width: 196rpx; width: 196rpx;
......
// packageUsedCar/pages/indexPage/index/index.js // packageUsedCar/pages/indexPage/index/index.js
import newApi from '~/packageUsedCar/api' import newApi from '~/packageUsedCar/api'
const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/" const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/"
function throttle(func, delay) {
let timeoutId;
let lastExecTime = 0;
return function (...args) {
const currentTime = Date.now();
// Calculate the time elapsed since the last execution
const timeSinceLastExec = currentTime - lastExecTime;
// If the elapsed time is greater than the delay, execute the function immediately
if (timeSinceLastExec >= delay) {
func.apply(this, args);
lastExecTime = currentTime;
} else {
// If there is a pending timeout, cancel it
if (timeoutId) {
clearTimeout(timeoutId);
}
// Schedule the function execution after the remaining delay
timeoutId = setTimeout(() => {
func.apply(this, args);
lastExecTime = Date.now();
}, delay - timeSinceLastExec);
}
};
}
Component({ Component({
/** /**
...@@ -44,7 +72,14 @@ Component({ ...@@ -44,7 +72,14 @@ Component({
userInfo: {}, userInfo: {},
menuList: [{ menuList: [{
menuText: "驻店日报", menuText: "驻店日报",
icon: "supplementary_order" icon: "crowdFunding/supplementary_order",
path: "dailyReport"
}, {
menuText: "报告管理",
icon: "usedCar/report_manage",
path: "reportList",
parentPath: "reportManage",
buttonCode: 'quotation'
}], }],
current: 0, current: 0,
itemDataList: [{ itemDataList: [{
...@@ -111,11 +146,17 @@ Component({ ...@@ -111,11 +146,17 @@ Component({
this.getStatic() this.getStatic()
}) })
}, },
// 驻店日报 navGo: throttle(async function (e) {
navGo() { let { item } = e.currentTarget.dataset
if (item.buttonCode) { // 校验是否有进入权限
wx.$util.showLoading('加载中')
const res = await newApi.checkPermissionsAPI({buttonCode: item.buttonCode})
wx.$util.hideLoading()
if (!res.data.data) return wx.$util.showToast('功能暂未开放')
}
wx.navigateTo({ wx.navigateTo({
url: '/packageUsedCar/pages/indexPage/dailyReport/dailyReport', url: item.parentPath ? `/packageUsedCar/pages/indexPage/${item.parentPath}/${item.path}/${item.path}` : `/packageUsedCar/pages/indexPage/${item.path}/${item.path}`
}) })
} })
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<block wx:for="{{ menuList }}" wx:key="index"> <block wx:for="{{ menuList }}" wx:key="index">
<view class="menu_item" bindtap="navGo" data-item="{{ item }}"> <view class="menu_item" bindtap="navGo" data-item="{{ item }}">
<view class="icon"> <view class="icon">
<image src="{{ IMG_URL}}crowdFunding/{{item.icon }}.png" mode="widthFix" /> <image src="{{ IMG_URL}}/{{item.icon }}.png" mode="widthFix" />
</view> </view>
<view class="text">{{item.menuText}}</view> <view class="text">{{item.menuText}}</view>
<view class="hot_icon" wx:if="{{ item.tipsNum }}">{{item.tipsNum}}</view> <view class="hot_icon" wx:if="{{ item.tipsNum }}">{{item.tipsNum}}</view>
......
// packageUsedCar/pages/indexPage/reportManage/addReport/addReport.js
const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/"
import api from '~/api/api.js'
import { validateVin, formatVinInput } from "~/utils/vinVaildate"
import newApi from '~/packageUsedCar/api'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
navBarHeight: 0,
btns: [{
label: '事故报告',
icon: 'accident_icon',
tips: '含出险,理赔记录',
active: true,
activeColor: '#797AFC',
activeBorder: '2rpx solid #797afc',
activeBackground: '#F5F5FF'
}, {
label: '维保报告',
icon: 'maintenance_icon',
tips: '含出险,理赔记录',
active: false,
activeColor: '#3785FF',
activeBorder: '2rpx solid #3785FF',
activeBackground: '#EFF6FF'
}],
agreeChecked: false,
vin: '',
motorRegistrationCertificateUrl: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
back() {
wx.navigateBack()
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
changeTabBtn(e) {
let { index } = e.currentTarget.dataset
let { btns } = this.data
btns.forEach((val, idx) => {
val.active = false
if (index == idx) val.active = true
})
this.setData({
btns,
vin: '',
motorRegistrationCertificateUrl: '',
agreeChecked: false
})
},
handleOCR() {
wx.navigateTo({
url: '/packageUsedCar/pages/ocrUsedCarModules/ocrUsedCarModules?type=vin',
})
},
handleVinInput(e) {
let { value } = e.detail
let filteredValue = value.replace(/[^A-Za-z0-9]/g, '')
// 将小写转为大写
const upperVin = formatVinInput(filteredValue)
this.setData({
vin: upperVin
})
// 当输入满17位时,进行实时校验(防抖500ms)
if (upperVin.length === 17) {
validateVin(upperVin)
.then((res) => {
let { valid } = res.data.data
this.setData({
vinValid: valid,
})
})
.catch(() => {
// 校验失败时,设置为 false
this.setData({
vinValid: false,
})
})
} else {
// 长度不足17位时,重置校验状态
this.setData({
vinValid: null,
})
}
},
reWrite(type, data) {
// 车架号识别
// vinOcr API 返回的数据结构中包含 vin 字段
const vin = data?.vin || data || ""
if (vin) {
// 转换为大写
const upperVin = formatVinInput(vin)
// 先验证车架号
validateVin(upperVin)
.then((result) => {
// validateVin 返回 { success, message, data, vin }
// data 中包含后端接口返回的完整数据
let { valid } = result.data.data || {}
this.setData({
vinValid: valid
})
if (valid) {
// 验证通过,赋值到表单
this.setData(
{
vin: upperVin,
},
() => {
wx.showToast({
title: "车架号识别完成并已自动填写到表单中",
icon: "none",
duration: 2000,
})
}
)
} else {
// 验证未通过,仍然赋值但提示用户
this.setData(
{
vin: upperVin,
},
() => {
wx.showToast({
title: "车架号识别完成,但校验未通过,请检查",
icon: "none",
duration: 2000,
})
}
)
}
})
.catch((error) => {
// 验证失败(接口异常等),仍然赋值但提示用户
this.setData(
{
vin: upperVin,
},
() => {
wx.showToast({
title: "车架号识别完成,但校验异常,请检查",
icon: "none",
duration: 2000,
})
}
)
})
}
},
// 上传图片
handleImageUpload(e) {
let _this = this
wx.chooseImage({
count: 1,
success(res) {
for (const file of res.tempFiles) {
if (file.size > 10 * 1024 * 1024) {
return wx.showToast({
title: '图片上传最大10MB',
icon: 'none'
})
}
}
const upload = async (tempFiles) => {
wx.$util.showLoading('上传中')
try {
for (const item of tempFiles) {
const val = item.path
const imgType = val.split('.')[1]
const type = imgType === 'unknown' ? 'jpg' : imgType
const _res = await new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({
filePath: val, // 选择图片返回的相对路径
encoding: 'base64', // 编码格式
success: resolve,
fail: reject
})
})
const img = await api.uploadImg({
file: `${type}@${_res.data}`
})
const { code, data, message } = img
if (code == 0) {
wx.$util.showToast('图片上传成功')
_this.setData({
motorRegistrationCertificateUrl: data
})
} else {
wx.$util.showToast(message)
}
}
} catch (error) {
wx.$util.showToast("上传失败,请重试")
} finally {
wx.hideLoading()
}
}
upload(res?.tempFiles)
}
})
},
// 删除图片
removeMedia(e) {
wx.showModal({
title: '确认删除',
content: `确定要删除此图片吗?`,
complete: (res) => {
if (res.confirm) {
this.setData({
motorRegistrationCertificateUrl: ''
})
}
}
})
},
// 预览图片
previewImage(e) {
let { motorRegistrationCertificateUrl } = this.data
wx.previewImage({
urls: [motorRegistrationCertificateUrl],
current: motorRegistrationCertificateUrl
})
},
agree() {
this.setData({
agreeChecked: !this.data.agreeChecked
})
},
confirm() {
let { vin, vinValid, motorRegistrationCertificateUrl, agreeChecked, btns } = this.data
if (!vin || !motorRegistrationCertificateUrl || !agreeChecked) return
if (!vin) return wx.$util.showToast('请填写车架号(VIN)')
if (!vinValid) return wx.$util.showToast('车架号校验未通过,请重新输入')
if (!motorRegistrationCertificateUrl) return wx.$util.showToast('请上传行驶证照片')
if (!agreeChecked) return wx.$util.showToast('请确认信息真实有效')
wx.$util.showLoading('加载中')
if (this.data.confirmFlag) return
this.setData({confirmFlag: true})
newApi.addReportAPI({
reportType: btns?.findIndex(val => val.active),
vin: vin,
licenseUrl: motorRegistrationCertificateUrl
}).then(res => {
wx.$util.hideLoading()
if (res.data.code == 0) {
wx.navigateBack()
} else {
wx.$util.showToast(res.data.msg || '请求失败')
}
}).catch(error => {
wx.$util.hideLoading()
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
/* packageUsedCar/pages/indexPage/reportManage/addReport/addReport.wxss */
.title-text {
font-weight: 500;
}
.bg {
width: 100%;
height: var(--fontSize800);
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/evaluationForm-bg.png');
background-size: 100% 100%;
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
.container {
box-sizing: border-box;
padding: 0 28rpx;
.flex {
display: flex;
align-items: center;
}
.content-title {
margin: 24rpx 0;
color: #999EA8;
font-size: 24rpx;
image {
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
}
.tab-btn {
gap: 16rpx;
padding-bottom: 8rpx;
}
.btn-item {
flex: 1;
padding: 24rpx 28rpx;
border-radius: 24rpx;
background: #FFFFFF;
font-size: 28rpx;
font-width: 500;
image {
width: 36rpx;
height: 36rpx;
margin-right: 24rpx;
flex-shrink: 0;
}
.tips {
font-size: 26rpx;
color: #666666 !important;
margin: 8rpx 0 0 60rpx;
font-weight: 400;
}
}
.form-box {
.form-item {
font-size: 28rpx;
.label {
color: #333333;
.requiredLabel {
color: #F24724;
margin-left: 8rpx;
}
}
.value-input {
margin: 24rpx 0 28rpx 0;
width: 100%;
height: 84rpx;
background: #F7F7F7;
border-radius: 16rpx;
.input {
width: calc(100% - 120rpx);
height: 100%;
padding: 0 24rpx;
}
.ocr-btn {
flex-shrink: 0;
width: var(--fontSize108);
height: var(--fontSize72);
position: relative;
.ocr-icon {
position: absolute;
left: var(--fontSize24);
top: var(--fontSize18);
width: var(--fontSize60);
height: var(--fontSize40);
}
}
}
.upload-container {
.form-item {
background: #ffffff;
padding: 24rpx 0;
box-sizing: border-box;
.upload-item {
width: 192rpx;
height: 192rpx;
border-radius: 16rpx;
background: #F5F8FF;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
.upload-icon {
width: 192rpx;
height: 192rpx;
}
}
}
// 已上传图片样式
.uploaded-item {
margin-top: 16rpx;
position: relative;
width: 196rpx;
height: 196rpx;
border-radius: 16rpx;
overflow: hidden;
background: #f5f5f5;
display: flex;
align-items: center;
justify-content: center;
image {
width: 100%;
height: 100%;
object-fit: contain;
}
}
.delete-icon {
position: absolute;
top: 12rpx;
right: 12rpx;
.delete-img {
width: 40rpx;
height: 40rpx;
}
}
}
}
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.footerBtn {
position: fixed;
left: 0;
width: 100%;
bottom: 0;
min-height: var(--fontSize100);
background: #FFFFFF;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize32);
font-weight: 500;
z-index: 99;
padding: 20rpx 32rpx;
.btn {
width: 320rpx;
height: 80rpx;
border-radius: 12rpx;
text-align: center;
line-height: 80rpx;
font-size: 32rpx;
}
.btn-check {
font-size: 24rpx;
font-weight: 400;
color: #333333;
.check-icon {
width: 24rpx;
height: 24rpx;
flex-shrink: 0;
margin-right: 12rpx;
}
}
.confirm {
color: #ffffff;
font-weight: 500;
height: 80rpx;
line-height: 80rpx;
background: #347BFF;
&.disabled {
background: #347bff80;
}
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageUsedCar/pages/indexPage/reportManage/addReport/addReport.wxml-->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{true}}" navStyle="{{'background-color: rgba(0,0,0,0);box-shadow:none;' }}" bindback="back">
<view class="title-text">新增报告</view>
</navigation-bar>
<view class="bg"></view>
<view class="container" style="padding-top: {{navBarHeight}}px;">
<view class="content-title flex">
<image src="{{IMG_URL}}usedCar/report_type_icon.png" mode=""/>
<view>报告类型</view>
</view>
<view class="tab-btn flex">
<view class="btn-item" bindtap="changeTabBtn" data-index="{{index}}" style="border: {{item.active ? item.activeBorder : '2rpx solid #FFFFFF'}};color: {{item.active ? item.activeColor : '#292D33'}};background: {{item.active ? item.activeBackground : '#FFFFFF'}};" wx:for="{{btns}}" wx:key="index">
<view class="flex">
<image src="{{IMG_URL}}usedCar/{{item.icon}}.png" mode=""/>
<view>{{item.label}}</view>
</view>
<view class="tips">{{item.tips}}</view>
</view>
</view>
<view class="content-title flex">
<image src="{{IMG_URL}}usedCar/vehicle _report_icon.png" mode=""/>
<view>车辆资料</view>
</view>
<view class="form-box">
<view class="form-item">
<view class="label">
车架号(VIN)
<text class="requiredLabel">*</text>
</view>
<view class="value-input flex">
<input value="{{vin}}" class="input" placeholder="请输入17位VIN" bindinput="handleVinInput" maxlength="17"/>
<view bindtap="handleOCR" class="ocr-btn">
<image src="{{IMG_URL}}usedCar/vin_icon.png" class="ocr-icon" />
</view>
</view>
</view>
<view class="form-item">
<view class="label">
行驶证照片
<text class="requiredLabel">*</text>
</view>
<view class="upload-container">
<view class="form-item">
<view wx:if="{{motorRegistrationCertificateUrl}}" class="uploaded-item">
<image src="{{motorRegistrationCertificateUrl}}" bindtap="previewImage" mode="aspectFit"></image>
<view class="delete-icon" bindtap="removeMedia">
<image src="{{IMG_URL}}zy_paf_del_icon.png" class="delete-img"></image>
</view>
</view>
<view wx:else class="upload-item" bindtap="handleImageUpload">
<view class="upload-placeholder flex align-center justify-center flex-col">
<image src="{{IMG_URL}}usedCar/upload-icon.png" class="upload-icon"></image>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="footerBtn {{ isFullSucreen?'isFullSucreen-btn':'' }}">
<view class="btn-check flex" bindtap="agree">
<image class="check-icon" wx:if="{{agreeChecked}}" src="{{IMG_URL}}check.png" mode=""/>
<image class="check-icon" wx:else src="{{IMG_URL}}no-check.png" mode=""/>
<view>确认信息真实有效</view>
</view>
<view class="btn confirm {{vin && motorRegistrationCertificateUrl && agreeChecked ? '' : 'disabled'}}" bindtap="confirm">提交申请</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageUsedCar/pages/indexPage/reportManage/reportList/reportList.js
const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/"
import newApi from '~/packageUsedCar/api'
let timeoutId
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
navBarHeight: 0,
tabList: [
{ text: "全部", count: 0, keyNum: "allCount", key: "" },
{ text: "事故报告", count: 0, keyNum: "accidentCount", key: "0" },
{ text: "维保报告", count: 0, keyNum: "maintainCount", key: "1" }
],
tabIndex: 0,
flag: true,
list: [],
showIcon1: true,
statusMap: {
0: {
text: '生成中'
},
1: {
text: '生成成功'
},
2: {
text: '生成失败'
}
},
formItems: [{
label: '车架号',
key: 'vin'
}, {
label: '报告时间',
key: 'acquireTime'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.search()
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
back() {
wx.navigateBack()
},
onScroll: function (e) {
const { scrollTop } = e.detail
// 滚动时隐藏第一个图标,显示第二个图标
this.setData({
showIcon1: false
})
// 清除之前的定时器
if (timeoutId) {
clearTimeout(timeoutId)
}
// 设置一个定时器,在滚动停止后一定时间后恢复两个图标的显示状态
timeoutId = setTimeout(() => {
this.setData({
showIcon1: true
})
}, 1000) // 在这里设置等待的时间,单位是毫秒
},
searchInput(e) {
let { value } = e.detail
let filteredValue = value.replace(/[^A-Za-z0-9]/g, '')
// 将小写转为大写
filteredValue = filteredValue.toUpperCase()
this.setData({
keyWord: filteredValue
})
},
handleOCR() {
wx.navigateTo({
url: '/packageUsedCar/pages/ocrUsedCarModules/ocrUsedCarModules?type=vin',
})
},
reWrite(type, data) {
// 车架号识别
// vinOcr API 返回的数据结构中包含 vin 字段
const vin = data?.vin || data || ""
if (vin) {
// 转换为大写
const upperVin = vin.toUpperCase(vin)
// 赋值到输入框内
this.setData({
keyWord: upperVin
})
}
},
// 获取状态数据
getStatByStatus() {
let { keyWord, tabList } = this.data
const userInfo = wx.$util.getUserInfo()
newApi
.getReportStaticsData({
t: { vin: keyWord}
})
.then((res) => {
if (res.data.code == 0) {
tabList.forEach((item) => {
item.count = res.data.data[item.keyNum] || 0
})
this.setData({
tabList,
})
} else {
wx.$util.showToast(res.data.msg || "请求失败")
}
})
},
searchConfirm() {
this.search()
},
// 搜索清空
handleReset() {
this.setData(
{
keyWord: "",
},
() => {
this.search()
}
)
},
tabClick(e) {
this.setData(
{
reportType: e?.detail || "",
},
() => {
this.search()
}
)
},
search() {
this.setData(
{
currentPage: 1,
list: [],
nothing: false,
flag: false,
},
() => {
this.getList(true)
this.getStatByStatus()
}
)
},
async getList(isReset = false) {
let { keyWord, reportType, currentPage, nothing } = this.data
if (nothing) return
wx.$util.showLoading("加载中")
const res = await newApi.getReportListData({
t: { vin: keyWord, reportType},
currentPage: currentPage,
pageSize: 10,
})
wx.hideLoading()
if (res.data.code == 0) {
this.setData({
[`list[${currentPage - 1}]`]: res.data.data.records,
currentPage: currentPage + 1,
nothing: currentPage == res.data.data.pages,
triggered: false,
flag: true,
})
if (isReset) {
this.setData({
scrollTop: 0,
})
}
} else {
this.setData({
list: [],
nothing: false,
flag: true,
})
wx.$util.showToast(res.data.msg || "请求失败")
}
},
onBottomRefresh() {
this.getList();
},
addReport() {
wx.navigateTo({
url: '/packageUsedCar/pages/indexPage/reportManage/addReport/addReport'
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"tab-bar": "/packageUsedCar/components/TabBar/TabBar"
},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
/* packageUsedCar/pages/indexPage/reportManage/reportList/reportList.wxss */
.title-text {
font-weight: 500;
}
.bg {
width: 100%;
height: var(--fontSize800);
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/evaluationForm-bg.png');
background-size: 100% 100%;
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
.container {
height: calc(100vh - 10rpx);
box-sizing: border-box;
.search-box {
width: 100%;
padding: var(--fontSize18) var(--fontSize20) 0;
display: flex;
align-items: center;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
.search-input {
background: #FFFFFF;
border-radius: var(--fontSize38);
width: calc(100vw - var(--fontSize40));
height: var(--fontSize72);
display: flex;
align-items: center;
.input {
font-size: var(--fontSize28);
width: calc(100% - var(--fontSize236));
height: var(--fontSize38);
line-height: var(--fontSize38);
}
.input-placeholder {
color: #BEC1C7;
}
.search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin: 0 var(--fontSize10) 0 var(--fontSize26);
}
.clearBtn {
width: var(--fontSize60);
height: var(--fontSize72);
position: relative;
.search-clear {
position: absolute;
left: var(--fontSize20);
top: 50%;
transform: translateY(-50%);
width: var(--fontSize36);
height: var(--fontSize36);
}
}
.ocr-btn {
flex-shrink: 0;
width: var(--fontSize108);
height: var(--fontSize72);
position: relative;
position: absolute;
top: var(--fontSize18);
right: var(--fontSize20);
}
.ocr-icon {
position: absolute;
left: var(--fontSize24);
top: 50%;
transform: translateY(-50%);
width: var(--fontSize60);
height: var(--fontSize40);
}
}
}
.order-box {
height: calc(100% - var(--fontSize190));
.list {
box-sizing: border-box;
width: 100%;
padding-bottom: 0;
height: 100%;
.list-item {
margin: 0 20rpx 24rpx 20rpx;
border-radius: 24rpx;
background: #ffffff;
box-shadow: 0 6rpx 24rpx 0 #2a61eb1a;
padding: 28rpx;
.flex {
display: flex;
align-items: center;
}
.top {
justify-content: space-between;
margin-bottom: 28rpx;
.type-icon {
width: 36rpx;
height: 36rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
.type-title {
font-size: 30rpx;
font-weight: 500;
color: #292D33;
}
.status-box {
border-radius: 12rpx;
padding: 4rpx 16rpx;
font-size: 24rpx;
font-weight: 500;
}
.status-0 {
background: #FEF4E8;
color: #F59619;
}
.status-1 {
background: #E9F9F1;
color: #2CCA74;
}
.status-2 {
background: #FDEDED;
color: #EB4E4E;
}
}
.form-item {
display: flex;
align-items: center;
font-size: 28rpx;
margin-bottom: 24rpx;
&:last-child {
margin-bottom: 0;
}
.label {
flex-shrink: 0;
width: 128rpx;
color: #999EA8;
margin-right: 16rpx;
}
.value {
color: #666666;
}
}
}
.list-nothing {
text-align: center;
padding: 0 0 var(--fontSize20);
}
.no-data {
text-align: center;
padding-top: var(--fontSize220);
.no-data-img {
width: var(--fontSize226);
height: var(--fontSize156);
}
.list-not {
margin-top: var(--fontSize24);
color: #BEC1C7;
}
}
.top-empty {
height: var(--fontSize20);
width: 100%;
}
}
}
.addBtn {
width: 144rpx;
height: 144rpx;
border-radius: 24rpx;
opacity: 1;
border: 4rpx solid #ffffff;
background: #ffffff;
background: linear-gradient(180deg, #4673ff1a 0%, #4673ff00 100%);
box-shadow: 0 6rpx 24rpx 0 #2a61eb1a;
position: fixed;
bottom: var(--fontSize220);
right: var(--fontSize4);
font-size: 24rpx;
font-weight: 500;
color: #4673FF;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
image {
width: 56rpx;
height: 56rpx;
margin-bottom: 12rpx;
}
}
.arrowIcon {
width: var(--fontSize36);
height: var(--fontSize144);
opacity: 1;
position: fixed;
bottom: var(--fontSize220);
right: 0;
border-radius: 16rpx 0 0 16rpx;
border: 2rpx solid #eff0f2;
background: #ffffff;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
display: flex;
align-items: center;
justify-content: center;
.image {
width: var(--fontSize32);
height: var(--fontSize32);
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageUsedCar/pages/indexPage/reportManage/reportList/reportList.wxml-->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{true}}" navStyle="{{'background-color: rgba(0,0,0,0);box-shadow:none;' }}" bindback="back">
<view class="title-text">报告管理</view>
</navigation-bar>
<view class="bg"></view>
<view class="container" style="padding-top: {{navBarHeight}}px;">
<view class="search-box">
<view class="search-input">
<image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="请输入车架号" class="input" confirm-type="search" value="{{ keyWord }}" placeholder-class="input-placeholder" bindinput="searchInput" bindconfirm="searchConfirm" />
<block wx:if="{{ keyWord }}">
<view bindtap="handleReset" class="clearBtn">
<image src="/images/clear.png" class="search-clear" />
</view>
</block>
<view bindtap="handleOCR" class="ocr-btn">
<image src="{{IMG_URL}}usedCar/vin_icon.png" class="ocr-icon" />
</view>
</view>
</view>
<view>
<tab-bar tabList="{{ tabList }}" bindclick="tabClick" scroll activeIndex="{{ tabIndex }}" />
</view>
<view wx:if="{{ flag }}" class="order-box">
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{ true }}" bindrefresherrefresh="search" bindscroll="onScroll" bindscrolltolower="onBottomRefresh" class="list" scroll-top="{{ scrollTop }}" lower-threshold="400" refresher-threshold="104" refresher-triggered="{{ triggered }}">
<block wx:if="{{ list.length && list[0].length }}">
<view class="top-empty"></view>
<block wx:for="{{ list }}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<block wx:for="{{ i }}" wx:key="index">
<view class="list-item">
<view class="top flex">
<view class="flex">
<image class="type-icon" src="{{IMG_URL}}usedCar/{{item.reportType == 1 ? 'maintenance_icon' : 'accident_icon'}}.png" mode=""/>
<view class="type-title">{{item.reportTypeName}}</view>
</view>
<view class="status-box status-{{item.status}}">{{item.statusName}}</view>
</view>
<view class="form-item" wx:for="{{formItems}}" wx:for-item="subI" wx:for-index="subIdx" wx:key="subIdx">
<view class="label">{{subI.label}}</view>
<view class="value">{{item[subI.key] || '-'}}</view>
</view>
</view>
</block>
</block>
<block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<view class="no-data" wx:else>
<image class="no-data-img" src="{{IMG_URL}}usedCar/empty-icon.png" />
<view class="list-not">暂无数据</view>
</view>
</scroll-view>
</view>
<block wx:if="{{showIcon1}}">
<view class="addBtn" bindtap="addReport">
<image src="{{IMG_URL}}usedCar/add_report.png" mode=""/>
<view>新增报告</view>
</view>
</block>
<block wx:else>
<view class="arrowIcon">
<image class="image" src="{{ IMG_URL }}usedCar/arrow-right.png" />
</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -455,6 +455,10 @@ Page({ ...@@ -455,6 +455,10 @@ Page({
async jump(e) { async jump(e) {
console.log('jump') console.log('jump')
let { item, type } = e.currentTarget.dataset let { item, type } = e.currentTarget.dataset
// 场景集市添加埋点
if (item.name == '场景集市') {
wx.$track.setTrackData(0, 'scenario_marketplace', {}, '', 1)
}
let { userInfo, taskId, mentorFlag } = this.data let { userInfo, taskId, mentorFlag } = this.data
if (userInfo) { if (userInfo) {
if (userInfo.merchantAccountList && userInfo.merchantAccountList.length) { if (userInfo.merchantAccountList && userInfo.merchantAccountList.length) {
......
...@@ -1170,6 +1170,8 @@ Page({ ...@@ -1170,6 +1170,8 @@ Page({
if (options.orderCode) { if (options.orderCode) {
this.onRoute(options); this.onRoute(options);
} }
// 添加埋点
wx.$track.setTrackData(0, 'submit_order', {}, '', 1)
}, },
init(userInfo) { init(userInfo) {
let { let {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!