Commit 6eb36465 by 岑成威

feat:新增车况信息

1 parent 8b7bd5d0

3.02 MB | W: | H:

3.04 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -88,6 +88,13 @@ export default { ...@@ -88,6 +88,13 @@ export default {
sceneType: [7] sceneType: [7]
}, },
{ {
icon: 'carInfoIcon',
label: '车况信息',
name: 'CarConditionInfo',
page: '/pages/usedCar/inspectionReport/index?h5Entry=carInfo',
sceneType: [7]
},
{
icon: 'delivery-management', icon: 'delivery-management',
label: '交付管理', label: '交付管理',
name: 'DeliveryManagement', name: 'DeliveryManagement',
......
...@@ -651,7 +651,7 @@ export default { ...@@ -651,7 +651,7 @@ export default {
async entranceClick(item) { async entranceClick(item) {
console.log(item, 'item') console.log(item, 'item')
// 清除评估单的图片视频资源缓存 // 清除评估单的图片视频资源缓存
const noInterceptPage = ['DailyReport', 'DeliveryManagement', 'ReportManagement', 'WageAppeal','InspectionReport'], const noInterceptPage = ['DailyReport', 'DeliveryManagement', 'ReportManagement', 'WageAppeal', 'InspectionReport'],
{ sceneType } = this { sceneType } = this
if (!noInterceptPage.includes(item.name)) { if (!noInterceptPage.includes(item.name)) {
if (sceneType != 7) { if (sceneType != 7) {
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 1 const index = 2
/** /**
* *
0本地 0本地
...@@ -86,6 +86,15 @@ const venusUsedcarH5BaseUrl = { ...@@ -86,6 +86,15 @@ const venusUsedcarH5BaseUrl = {
prod: 'https://aus.glsx.com.cn/venus-usedcar-h5/home' prod: 'https://aus.glsx.com.cn/venus-usedcar-h5/home'
}[target[index]] }[target[index]]
/** 二手车车况信息 WebView H5(vehicle-list 查询参数在 inspectionReport 页拼接) */
const venusUsedcarH5CarInfoBaseUrl = {
ip: 'http://192.168.1.139:8082/vehicle-list',
dev: 'http://192.168.1.139:8082/vehicle-list',
uat: 'https://aus.test.glsx.com.cn/venus-usedcar-h5/vehicle-list',
beta: 'https://aus.test.glsx.com.cn/venus-usedcar-h5/vehicle-list',
prod: 'https://aus.glsx.com.cn/venus-usedcar-h5/vehicle-list'
}[target[index]]
const djSecretKey = { const djSecretKey = {
ip: { appKey: '48e5e13229b82c1b4e6e8c96151f0637', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' }, ip: { appKey: '48e5e13229b82c1b4e6e8c96151f0637', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' },
dev: { dev: {
...@@ -190,5 +199,6 @@ module.exports = { ...@@ -190,5 +199,6 @@ module.exports = {
djSecretKey, djSecretKey,
signSecretKey, signSecretKey,
evaluationDomain, evaluationDomain,
venusUsedcarH5BaseUrl venusUsedcarH5BaseUrl,
venusUsedcarH5CarInfoBaseUrl
} }
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</template> </template>
<script> <script>
import { venusUsedcarH5BaseUrl } from '@/env.js' import { venusUsedcarH5BaseUrl, venusUsedcarH5CarInfoBaseUrl } from '@/env.js'
export default { export default {
name: 'InspectionReport', name: 'InspectionReport',
...@@ -59,18 +59,51 @@ export default { ...@@ -59,18 +59,51 @@ export default {
} }
}, },
onLoad(options) { onLoad(options) {
const isCarInfo = options.h5Entry === 'carInfo'
if (options.pageTitle) { if (options.pageTitle) {
this.title = options.pageTitle this.title = options.pageTitle
} else if (isCarInfo) {
this.title = '车况信息'
} }
const baseUrl = venusUsedcarH5BaseUrl const baseUrl = isCarInfo ? venusUsedcarH5CarInfoBaseUrl : venusUsedcarH5BaseUrl
if (!baseUrl || typeof baseUrl !== 'string') { if (!baseUrl || typeof baseUrl !== 'string') {
uni.showToast({ title: '检测报告地址未配置', icon: 'none' }) uni.showToast({
title: isCarInfo ? '车况信息地址未配置' : '检测报告地址未配置',
icon: 'none'
})
return return
} }
const userInfo = uni.$storage.get('userInfo') || {} const userInfo = uni.$storage.get('userInfo') || {}
if (isCarInfo) {
const sessionId = uni.$storage.get('sessionId') || ''
const str = v => (v == null || v === '' ? '' : String(v))
const params = {
source: '1',
sessionId,
phone: str(userInfo.phone || userInfo.mobile),
operator: str(userInfo.name),
operatorId: str(userInfo.uuid),
conversionUserId: str(userInfo.uuid),
conversionName: str(userInfo.name),
conversionMerchantId: str(userInfo.shopMerchantId),
conversionMerchantName: str(userInfo.shopMerchantName),
merchantId: str(userInfo.merchantId),
merchantName: str(userInfo.merchantName)
}
const qs = Object.keys(params)
.map(k => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`)
.join('&')
const token = userInfo.token || ''
const sep = baseUrl.includes('?') ? '&' : '?'
this.webviewUrl = token
? `${baseUrl}${sep}${qs}&token=${encodeURIComponent(token)}`
: `${baseUrl}${sep}${qs}`
} else {
const token = userInfo.token || '' const token = userInfo.token || ''
const sep = baseUrl.includes('?') ? '&' : '?' const sep = baseUrl.includes('?') ? '&' : '?'
this.webviewUrl = token ? `${baseUrl}${sep}token=${encodeURIComponent(token)}` : baseUrl this.webviewUrl = token ? `${baseUrl}${sep}token=${encodeURIComponent(token)}` : baseUrl
}
console.log('[inspectionReport] webviewUrl', this.webviewUrl)
}, },
onReady() { onReady() {
this.measureHeaderThenInset() this.measureHeaderThenInset()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!