Commit 4689bc39 by 前端

案例

1 parent a56c2962
......@@ -4,27 +4,23 @@
"version" : "0.0",
"configurations" : [
{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"provider" : "aliyun",
"type" : "uniCloud"
"app-plus" : {
"launchtype" : "local"
},
"default" : {
"launchtype" : "local"
},
"h5" : {
"launchtype" : "local"
},
"mp-weixin" : {
"launchtype" : "local"
},
"provider" : "aliyun",
"type" : "uniCloud"
},
{
"playground" : "standard",
"playground" : "custom",
"type" : "uni-app:app-android"
}
]
......
......@@ -2,12 +2,13 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-07 17:09:53
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-10-31 11:01:19
* @LastEditTime: 2024-12-11 13:56:12
* @FilePath: \gl_tape\App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script>
const PATH = ['/pages/common/caseDetail']
const keepAlive = uni.requireNativePlugin('Ba-KeepAliveSuit')
import { mapState } from 'vuex'
import { Ws } from '@/ws/Ws.js'
export default {
......@@ -16,6 +17,7 @@ export default {
},
onLoad() {},
onLaunch: async function () {
this.onKeep()
// this.init()
this.setAPPVersion()
setTimeout(() => {
......@@ -28,6 +30,18 @@ export default {
new Ws().connect()
},
methods: {
onKeep() { //通用保活
keepAlive.onKeep({
//channelId: "Ba-KeepAlive",
//channelName: "Ba-KeepAlive",
title: "测试",
content: "常驻通知描述",
},
(res) => {
console.log(res);
});
},
init() {
uni.addInterceptor('navigateTo', {
//监听跳转
......
import http from "../request/http";
import environment from "@/env";
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-11-22 20:44:58
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-12-13 14:48:50
* @FilePath: \gl-tape\api\module\customerApi.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import http from '../request/http'
import environment from '@/env'
module.exports = {
/**查询当前门店是否有客户档案权限 */
haveCustomerAccess (data) {
haveCustomerAccess(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.findPermissionsMerchantList',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
/**查询当前门店客户档案列表 */
getCustomerFileList (data) {
getCustomerFileList(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.customerInfoPage',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
/* 删除客户档案*/
delCustomerFile (data) {
delCustomerFile(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.deleteVisitsInfo',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
/** 根据业务查询接待场景 */
findAllSence (data) {
findAllSence(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.findAllSence',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
/**根据业务查询客户标签 */
findCustomerTags (data) {
findCustomerTags(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.findSenceTag',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
/**
* 查询客户档案详情
*/
findVisitsInfo (data) {
findVisitsInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.findVisitsInfo',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
/*
* 保存客户档案
*/
saveVisitsInfo (data) {
* 保存客户档案
*/
saveVisitsInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.saveVisitsInfo',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
/**
* 更新客户档案
*/
updateVisitsInfo (data) {
updateVisitsInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.updateVisitsInfo',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
/**查询客户档案列表 */
getCustomerInfoList (data) {
getCustomerInfoList(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.customerInfoList',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
/**接待客户素材
*
*
*/
getMaterialResponsePage (data) {
getMaterialResponsePage(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.getMaterialResponsePage',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
/**素材详情 查询素材详情 */
getMaterialDetail (data) {
getMaterialDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.customervisits.getMaterialById',
projectName: "boutique",
...data,
});
},
}
\ No newline at end of file
projectName: 'boutique',
...data
})
}
}
......@@ -2,19 +2,19 @@ import http from '../request/http'
import { env } from '../../env'
const serverConfig = {
mockRequestCount: null,
mockTimer: {},
mockCache: null,
},
mockRequestCount: null,
mockTimer: {},
mockCache: null
},
bydServerConfig = {
mockRequestCount: null,
mockTimer: {},
mockCache: null,
mockCache: null
},
boutiqueServerConfig = {
mockRequestCount: null,
mockTimer: {},
mockCache: null,
mockCache: null
},
configModule = 'app-tape',
bydConfigModule = 'byd-pad-config',
......@@ -28,38 +28,38 @@ const getMockData = async (immediate = false) => {
const MOCKDATA = uni.$storage.get('mock_data')
try {
if (!immediate && MOCKDATA && Date.now() - MOCKDATA.createTime < 5 * 60e3) {
return Promise.resolve(MOCKDATA);
return Promise.resolve(MOCKDATA)
} else {
if (!serverConfig.mockRequestCount || immediate) {
serverConfig.mockCache = null;
serverConfig.mockRequestCount = Date.now();
const data = await http.uni_request({ url: configUrl });
data.createTime = Date.now();
serverConfig.mockCache = null
serverConfig.mockRequestCount = Date.now()
const data = await http.uni_request({ url: configUrl })
data.createTime = Date.now()
data.moduleList = await imgToBase64(data.moduleList, 'thumbnail')
data.default_moduleList = await imgToBase64(data.default_moduleList, 'thumbnail')
serverConfig.mockCache = data;
uni.$storage.set('mock_data', data);
return Promise.resolve(data);
serverConfig.mockCache = data
uni.$storage.set('mock_data', data)
return Promise.resolve(data)
} else {
const key = Date.now();
return new Promise((resolve) => {
const key = Date.now()
return new Promise(resolve => {
serverConfig.mockTimer[key] = setInterval(() => {
if (serverConfig.mockCache) {
clearInterval(serverConfig.mockTimer[key]);
serverConfig.mockRequestCount = null;
resolve(serverConfig.mockCache);
clearInterval(serverConfig.mockTimer[key])
serverConfig.mockRequestCount = null
resolve(serverConfig.mockCache)
}
}, 1e3);
});
}, 1e3)
})
}
}
} catch (error) {
console.log(error)
if (serverConfig.mockTimer[key]) clearInterval(serverConfig.mockTimer[key]);
serverConfig.mockRequestCount = null;
return Promise.reject(error);
if (serverConfig.mockTimer[key]) clearInterval(serverConfig.mockTimer[key])
serverConfig.mockRequestCount = null
return Promise.reject(error)
}
};
}
const imgToBase64 = (list, urlKey) => {
return new Promise((resolve, reject) => {
let arr = [],
......@@ -71,20 +71,20 @@ const imgToBase64 = (list, urlKey) => {
url: urlKey ? e[urlKey] : e,
method: 'GET',
responseType: 'arraybuffer',
success: (res) => {
success: res => {
const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}`
newList[index][urlKey] = base64
newList[index][`original_${urlKey}`] = e[urlKey]
arr.push(e)
if (arr.length === list.length) resolve(newList)
},
fail: (err) => {
fail: err => {
reject(err)
}
})
})
})
};
}
const updateMockData = (dataList, keyList, storageName = 'mock_data') => {
const mockData = uni.$storage.get(storageName)
keyList.map(key => {
......@@ -101,37 +101,44 @@ const getBydMockData = async (immediate = false) => {
const MOCKDATA = uni.$storage.get('byd_mock_data')
try {
if (!immediate && MOCKDATA && Date.now() - MOCKDATA.createTime < 5 * 60e3) {
return Promise.resolve(MOCKDATA);
return Promise.resolve(MOCKDATA)
} else {
if (!bydServerConfig.mockRequestCount || immediate) {
bydServerConfig.mockCache = null;
bydServerConfig.mockRequestCount = Date.now();
const data = await http.uni_request({ url: bydConfigUrl });
data.createTime = Date.now();
bydServerConfig.mockCache = null
bydServerConfig.mockRequestCount = Date.now()
const data = await http.uni_request({ url: bydConfigUrl })
data.createTime = Date.now()
data.moduleList = await imgToBase64(data.moduleList, 'thumbnail')
bydServerConfig.mockCache = data;
uni.$storage.set('byd_mock_data', data);
return Promise.resolve(data);
bydServerConfig.mockCache = data
uni.$storage.set('byd_mock_data', data)
return Promise.resolve(data)
} else {
const key = Date.now();
return new Promise((resolve) => {
const key = Date.now()
return new Promise(resolve => {
bydServerConfig.mockTimer[key] = setInterval(() => {
if (bydServerConfig.mockCache) {
clearInterval(bydServerConfig.mockTimer[key]);
bydServerConfig.mockRequestCount = null;
resolve(bydServerConfig.mockCache);
clearInterval(bydServerConfig.mockTimer[key])
bydServerConfig.mockRequestCount = null
resolve(bydServerConfig.mockCache)
}
}, 1e3);
});
}, 1e3)
})
}
}
} catch (error) {
console.log(error)
if (bydServerConfig.mockTimer[key]) clearInterval(bydServerConfig.mockTimer[key]);
bydServerConfig.mockRequestCount = null;
return Promise.reject(error);
if (bydServerConfig.mockTimer[key]) clearInterval(bydServerConfig.mockTimer[key])
bydServerConfig.mockRequestCount = null
return Promise.reject(error)
}
}
const findReceptionpriproConfigList = data => {
return http.post({
method: 'dj.api.smartcarlife.recepiton.customer.findReceptionpriproConfigList',
projectName: 'boutique',
...data
})
}
/**
*获取轻改配置
*/
......@@ -139,34 +146,34 @@ const getBoutiqueMockData = async (immediate = false) => {
const MOCKDATA = uni.$storage.get('boutique_mock_data')
try {
if (!immediate && MOCKDATA && Date.now() - MOCKDATA.createTime < 5 * 60e3) {
return Promise.resolve(MOCKDATA);
return Promise.resolve(MOCKDATA)
} else {
if (!boutiqueServerConfig.mockRequestCount || immediate) {
boutiqueServerConfig.mockCache = null;
boutiqueServerConfig.mockRequestCount = Date.now();
const data = await http.uni_request({ url: boutiqueConfigUrl });
data.createTime = Date.now();
boutiqueServerConfig.mockCache = data;
uni.$storage.set('boutique_mock_data', data);
return Promise.resolve(data);
boutiqueServerConfig.mockCache = null
boutiqueServerConfig.mockRequestCount = Date.now()
const data = await http.uni_request({ url: boutiqueConfigUrl })
data.createTime = Date.now()
boutiqueServerConfig.mockCache = data
uni.$storage.set('boutique_mock_data', data)
return Promise.resolve(data)
} else {
const key = Date.now();
return new Promise((resolve) => {
const key = Date.now()
return new Promise(resolve => {
boutiqueServerConfig.mockTimer[key] = setInterval(() => {
if (boutiqueServerConfig.mockCache) {
clearInterval(boutiqueServerConfig.mockTimer[key]);
boutiqueServerConfig.mockRequestCount = null;
resolve(boutiqueServerConfig.mockCache);
clearInterval(boutiqueServerConfig.mockTimer[key])
boutiqueServerConfig.mockRequestCount = null
resolve(boutiqueServerConfig.mockCache)
}
}, 1e3);
});
}, 1e3)
})
}
}
} catch (error) {
console.log(error)
if (boutiqueServerConfig.mockTimer[key]) clearInterval(boutiqueServerConfig.mockTimer[key]);
boutiqueServerConfig.mockRequestCount = null;
return Promise.reject(error);
if (boutiqueServerConfig.mockTimer[key]) clearInterval(boutiqueServerConfig.mockTimer[key])
boutiqueServerConfig.mockRequestCount = null
return Promise.reject(error)
}
}
// 图片版本号
......@@ -181,5 +188,6 @@ module.exports = {
imgToBase64,
updateMockData,
getBydMockData,
getBoutiqueMockData
}
\ No newline at end of file
getBoutiqueMockData,
findReceptionpriproConfigList
}
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 2
const index = 1
/**
*
0本地
......
{
"name": "展业助手",
"appid": "__UNI__D3BD3DF",
"description": "",
"versionName": "2.1.0",
"versionCode": "100",
"transformPx": false,
"name" : "展业助手",
"appid" : "__UNI__D3BD3DF",
"description" : "",
"versionName" : "2.1.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus": {
"bounce": "none",
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"screenOrientation": "landscape",
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
"app-plus" : {
"bounce" : "none",
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"screenOrientation" : "landscape",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules": {
"Camera": {},
"Record": {},
"VideoPlayer": {},
"AudioPlayer": {}
"modules" : {
"Camera" : {},
"Record" : {},
"VideoPlayer" : {},
"AudioPlayer" : {}
},
/* 应用发布信息 */
"distribute": {
"distribute" : {
/* android打包配置 */
"android": {
"permissions": [
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
......@@ -44,59 +44,76 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters": [
"armeabi-v7a",
"arm64-v8a",
"x86"
],
"targetSdkVersion": 30
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"targetSdkVersion" : 30
},
/* ios打包配置 */
"ios": {
"dSYMs": false,
"UIBackgroundModes": "audio"
"ios" : {
"dSYMs" : false,
"UIBackgroundModes" : "audio"
},
/* SDK配置 */
"sdkConfigs": {
"ad": {},
"speech": {}
"sdkConfigs" : {
"ad" : {},
"speech" : {},
"geolocation" : {
"system" : {
"__platform__" : [ "ios", "android" ]
}
}
},
"icons": {
"android": {
"hdpi": "static/72.png",
"xhdpi": "static/96.png",
"xxhdpi": "static/144.png"
"icons" : {
"android" : {
"hdpi" : "static/72.png",
"xhdpi" : "static/96.png",
"xxhdpi" : "static/144.png"
}
}
},
"nativePlugins" : {
"Ba-KeepAliveSuit" : {
"__plugin_info__" : {
"name" : "安卓保活套装(通用、常驻通知、电池优化、自启管理、后台运行等)",
"description" : "在Ba-KeepAlive的基础上,新增了忽略电池优化、自启管理、常驻通知。为定位、推送、websocket、定时任务、蓝牙、聊天等保驾护航(**注意:**不保证支持所有机型和场景,建议先试用再购买)",
"platforms" : "Android",
"url" : "https://ext.dcloud.net.cn/plugin?id=11765",
"android_package_name" : "uni.gltap",
"ios_bundle_id" : "",
"isCloud" : true,
"bought" : 1,
"pid" : "11765",
"parameters" : {}
}
}
}
},
/* 快应用特有相关 */
"quickapp": {},
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin": {
"appid": "wx79d1ff39bee3d047",
"setting": {
"urlCheck": false
"mp-weixin" : {
"appid" : "wx79d1ff39bee3d047",
"setting" : {
"urlCheck" : false
},
"usingComponents": true
"usingComponents" : true
},
"mp-alipay": {
"usingComponents": true
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu": {
"usingComponents": true
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao": {
"usingComponents": true
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics": {
"enable": false
"uniStatistics" : {
"enable" : false
},
"vueVersion": "2",
"h5": {
"devServer": {
"port": 8080,
"https": false
"vueVersion" : "2",
"h5" : {
"devServer" : {
"port" : 8080,
"https" : false
}
}
}
\ No newline at end of file
}
<template>
<view :class="['layout',{ 'byd-layout':isByd } ]">
<view :class="['layout', { 'byd-layout': isByd }, { 'other-layout': !isByd }]">
<view class="title">{{ title }}</view>
<template v-if="views&&views.length > 1">
<template v-if="views && views.length > 1">
<view class="tabs-box">
<tabs
:list="views"
@tabclick="changeTab"
></tabs>
<tabs :list="views" @tabclick="changeTab"></tabs>
</view>
</template>
<template v-if="list.length > 0">
<scroll-view
:class="['record-box',{'has-tabs':views && views.length > 1} ]"
scroll-y
:scroll-top="scrollTop"
@scrolltolower="pageonReachBottom"
>
<scroll-view :class="['record-box', { 'has-tabs': views && views.length > 1 }]" scroll-y :scroll-top="scrollTop" @scrolltolower="pageonReachBottom">
<view class="card-list">
<view
class="card-item"
v-for="item in list"
:key="item.id"
>
<view class="card-item" v-for="item in list" :key="item.id">
<template>
<image
v-if="item.vdQuotationPaymentDoc && item.vdQuotationPaymentDoc.paymentDocUrl"
class="image-box"
:src="item.vdQuotationPaymentDoc.paymentDocUrl"
/>
<image
v-else
class="image-box"
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/pay.webp"
/>
<image v-if="item.vdQuotationPaymentDoc && item.vdQuotationPaymentDoc.paymentDocUrl" class="image-box" :src="item.vdQuotationPaymentDoc.paymentDocUrl" />
<image v-else class="image-box" src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/pay.webp" />
<view class="gradient-overlay"></view>
</template>
<view>
......@@ -41,7 +21,7 @@
<view class="goods-name">{{ item.goodsName }}</view>
<view class="card-info">
<view class="label">车架号</view>
<view class="value">{{ item.carVin || "-" }}</view>
<view class="value">{{ item.carVin || '-' }}</view>
</view>
<view class="card-info">
<view class="label">工单号</view>
......@@ -54,35 +34,28 @@
<view class="card-info">
<view class="label">实收金额</view>
<view class="price">
<view class="flag">¥</view>{{ accDiv(item.equityPrice) }}
<view class="flag">¥</view>
{{ accDiv(item.equityPrice) }}
</view>
</view>
</view>
</view>
</view>
<view
class="end-text"
v-if="list.length > 0 && isEnd"
>我是一个有底线的人</view>
<view class="end-text" v-if="list.length > 0 && isEnd">我是一个有底线的人</view>
</scroll-view>
</template>
<template v-else>
<view class="no-data">
<glsx-image
class="no-data-img"
src="media/no-data.png"
mode="scaleToFill"
/>
<glsx-image class="no-data-img" src="media/no-data.png" mode="scaleToFill" />
<view class="no-data-text">暂无数据</view>
</view>
</template>
</view>
</template>
<script>
import utils from '@/utils/utils';
import Record from "@/mixin/record";
import utils from '@/utils/utils'
import Record from '@/mixin/record'
import Tabs from './Tabs.vue'
export default {
components: {
......@@ -95,9 +68,9 @@ export default {
madiaId: Number,
show: Boolean,
isByd: Boolean,
views: Array,
views: Array
},
data () {
data() {
return {
shopMerchantId: '',
goodsName: null,
......@@ -105,41 +78,41 @@ export default {
}
},
watch: {
show (n) {
show(n) {
if (n) this.init()
else this.scrollTop = 0
},
watchStatus: {
immediate: true,
handler (newval) {
handler(newval) {
this.pageNum = 1
this.scrollTop = 1000
this.list = []
setTimeout(() => {
this.scrollTop = 0
}, 100);
}, 100)
}
},
}
},
computed: {
watchStatus () {
watchStatus() {
return this.$store.state.user.historyStatus
},
}
},
mounted () {
mounted() {
if (this.show) this.init()
},
methods: {
init () {
const { shopMerchantId } = uni.$storage.get("userInfo");
init() {
const { shopMerchantId } = uni.$storage.get('userInfo')
this.shopMerchantId = shopMerchantId
if (this.list.length == 0) {
this.list = uni.getStorageSync(`${this.shopMerchantId}-historyList`)
this.isEnd = true
}
if (this.pageNum == 1) this.getQuotationList();
if (this.pageNum == 1) this.getQuotationList()
},
async getQuotationList () {
async getQuotationList() {
const { goodsName, shopMerchantId, pageNum, pageSize } = this
try {
await this.getList('getQuotationList', {
......@@ -147,14 +120,14 @@ export default {
pageNum,
pageSize,
goodsName,
orderStatus: 3,
orderStatus: 3
})
if (!goodsName && this.pageNum == 1 && this.list.length) uni.setStorageSync(`${shopMerchantId}-historyList`, this.list)
} catch (error) {
if (!goodsName && this.pageNum == 1) this.list = uni.getStorageSync(`${this.shopMerchantId}-historyList`)
}
},
pageonReachBottom () {
pageonReachBottom() {
this.isEnd = false
let { pageNum, total, isEnd, pageSize } = this
if (!isEnd) isEnd = false
......@@ -164,13 +137,13 @@ export default {
} else this.isEnd = true
},
// 脱敏
nameHide (name) {
return name.substring(0, 1) + '*';
nameHide(name) {
return name.substring(0, 1) + '*'
},
accDiv (val) {
accDiv(val) {
return utils.accDiv(val || 0, 100)
},
changeTab (index) {
changeTab(index) {
let { views } = this,
goodsName = index == 0 ? null : views[index].tabName
if (this.goodsName == goodsName) return
......@@ -191,6 +164,9 @@ export default {
background-image: url('@/assets/images/media/media-bg.webp');
background-size: 100%;
position: relative;
&.other-layout {
background-image: none;
}
.tabs-box {
width: 1160rpx;
position: absolute;
......@@ -346,4 +322,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -2,93 +2,43 @@
* @Description:
* @Author: huyue
* @Date: 2024-04-08 11:30:30
* @LastEditors: huyue
* @LastEditTime: 2024-07-01 16:38:24
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-12-10 10:41:10
-->
<template>
<view
class="detail-box"
@dblclick="dbClick"
>
<view class="detail-box" @dblclick="dbClick">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
</view>
<template v-for="(item, index) in media">
<view
:class="['view', { showView: id == item.id }, modeName]"
:key="index"
@touchstart.stop="touchStart"
@touchend.stop="touchEnd"
>
<component
:is="item.componentName"
:views="item.receptionSourceDetailList || []"
:penSwitch="penSwitch"
:show="id == item.id"
:ref="'media' + item.id"
:title="item.detailTitle || ''"
:madiaId="item.id"
@scale="scale"
:ulList="item.ulList"
:screenList="item.screenList"
@onProductModel="productModelStatus = $event"
:isPreview="isPreview"
:isByd="isByd"
/>
<view :class="['view', { showView: id == item.id }, modeName]" :key="index" @touchstart.stop="touchStart" @touchend.stop="touchEnd">
<component :is="item.componentName" :detail="item" :views="item.receptionSourceDetailList || []" :penSwitch="penSwitch" :show="id == item.id" :ref="'media' + item.id" :title="item.detailTitle || ''" :madiaId="item.id" @scale="scale" :ulList="item.ulList" :screenList="item.screenList" @onProductModel="productModelStatus = $event" :isPreview="isPreview" :isByd="isByd" />
</view>
</template>
<template v-if="type != 'preview'">
<tool-box
ref="toolRef"
:data="toolList"
:type="type"
@choose="choose"
@finish="open"
:id="id"
@toPay="toPay"
:showPayBtn="watchPayInfo"
/>
<view
class="pen-box"
@click="drawStatus = !drawStatus"
>
<view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view>
<tool-box ref="toolRef" :data="toolList" :type="type" @choose="choose" @finish="open" :id="id" @toPay="toPay" :showPayBtn="watchPayInfo" />
<view class="pen-box" @click="drawStatus = !drawStatus">
<view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"></view>
</view>
</template>
<pay-pop
ref="pay"
@jumpPay="showPayPage = true"
></pay-pop>
<finish-step
ref="stepRef"
@submit="done"
:titleTips="finishTips"
/>
<informationEntry
:showPayPage.sync="showPayPage"
@finish="open"
/>
<pay-pop ref="pay" @jumpPay="showPayPage = true"></pay-pop>
<finish-step ref="stepRef" @submit="done" :titleTips="finishTips" />
<informationEntry :showPayPage.sync="showPayPage" @finish="open" />
</view>
</template>
<script>
import ToolBox from "@/components/ToolBox.vue";
import Reception from "./components/Reception.vue";
import MediaComponent from "./components/MediaComponent.vue";
import History from "./components/History.vue";
import ThreeGuarantees from "./components/ThreeGuarantees.vue";
import Guarantee from './components/Guarantee.vue';
import payPop from "./components/payPop.vue";
import FinishStep from '@/components/FinishStep.vue';
import { mapMutations } from "vuex";
import ToolBox from '@/components/ToolBox.vue'
import Reception from './components/Reception.vue'
import MediaComponent from './components/MediaComponent.vue'
import History from './components/History.vue'
import CaseCenter from './components/CaseCenter.vue'
import ThreeGuarantees from './components/ThreeGuarantees.vue'
import Guarantee from './components/Guarantee.vue'
import payPop from './components/payPop.vue'
import FinishStep from '@/components/FinishStep.vue'
import { mapMutations } from 'vuex'
import informationEntry from './components/informationEntry.vue'
import insurance from '@/components/Insurance/Insurance.vue'
import { receptionTrackMixin } from '@/mixin/index.js'
......@@ -101,6 +51,7 @@ export default {
FinishStep,
Guarantee,
History,
CaseCenter,
ThreeGuarantees,
informationEntry,
insurance
......@@ -115,7 +66,7 @@ export default {
toolList: Array
},
mixins: [receptionTrackMixin],
data () {
data() {
return {
drawStatus: false,
startX: null,
......@@ -125,59 +76,58 @@ export default {
showPayPage: false,
productModelStatus: false,
modeName: ''
};
}
},
computed: {
watchStatus () {
watchStatus() {
return this.$store.state.user.historyStatus
},
penSwitch () {
penSwitch() {
return !this.isPreview && this.drawStatus
},
watchPayInfo () {
watchPayInfo() {
return this.$store.state.user.paymentType.length ? true : false
},
title () {
title() {
let { id } = this,
name = this.media.find((e) => e.id == id)?.detailTitle || ""
return name;
name = this.media.find(e => e.id == id)?.detailTitle || ''
return name
},
finishTips () {
const { channelType } = uni.$storage.get("userInfo")
finishTips() {
const { channelType } = uni.$storage.get('userInfo')
let text = ''
if (channelType == 3) text = '检测到“汽车保险告知书”中未填写客户档案,请填写后再完成接待。'
return text
},
isByd () {
const { channelType } = uni.$storage.get("userInfo")
isByd() {
const { channelType } = uni.$storage.get('userInfo')
return channelType == 2
},
isPreview () {
isPreview() {
return this.type == 'preview'
}
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
handler(newval) {
if (newval) this.drawStatus = false
}
},
}
},
mounted () {
mounted() {
const systemInfo = uni.getSystemInfoSync()
this.screenWidth = systemInfo.screenWidth
},
methods: {
...mapMutations("audio", ["setReceptionStatus"]),
open () {
...mapMutations('audio', ['setReceptionStatus']),
open() {
this.$refs.stepRef.open()
},
/**切换素材 */
choose (e) {
choose(e) {
Object.keys(this.$refs).map(refKey => {
let ref = this.$refs[refKey];
let ref = this.$refs[refKey]
if (ref) {
if (Array.isArray(ref)) ref = ref[0]
ref.closeAllPopup && ref.closeAllPopup()
......@@ -187,30 +137,30 @@ export default {
this.$emit('update:id', e.id)
uni.$logger.local.info(`预览${e.title}`)
},
back () {
back() {
this.$refs?.toolRef?.hide()
this.$emit('back')
},
done (e) {
done(e) {
this.showPayPage = false
this.$refs.toolRef.hide()
this.$refs.stepRef.close()
this.receptionTrackLeave()
this.$emit('done', e)
},
toPay () {
toPay() {
this.$refs.pay.show()
},
dbClick () {
dbClick() {
if (!this.isPreview) this.drawStatus = !this.drawStatus
},
touchStart (e) {
touchStart(e) {
if (!this.drawStatus && e.changedTouches?.length) {
this.startX = e.changedTouches[0].pageX
this.startY = e.changedTouches[0].pageY
}
},
touchEnd (e) {
touchEnd(e) {
if (this.modeName) return
try {
let { toolList, drawStatus, startX, screenWidth, id, scaleValueObject, productModelStatus } = this
......@@ -235,14 +185,14 @@ export default {
console.log(error)
}
},
getNextId (index, toolList, startX, halfScreenWidth) {
getNextId(index, toolList, startX, halfScreenWidth) {
let nextItem = {},
modeName = ''
if (startX > halfScreenWidth) {
nextItem = index === toolList.length - 1 ? toolList[0] : toolList[index + 1];
nextItem = index === toolList.length - 1 ? toolList[0] : toolList[index + 1]
modeName = 'to-right'
} else {
nextItem = index === 0 ? toolList[toolList.length - 1] : toolList[index - 1];
nextItem = index === 0 ? toolList[toolList.length - 1] : toolList[index - 1]
modeName = 'to-left'
}
return {
......@@ -251,14 +201,12 @@ export default {
title: nextItem.title
}
},
scale (e) {
scale(e) {
let { id } = this
this.scaleValueObject[id] = e
},
},
};
}
}
}
</script>
<style scoped lang="scss">
.detail-box {
......
<template>
<view>
<home-frame
@preview="preview"
@start="start"
ref="home"
:id="id"
@openStep="openStep"
@backHome="backHome"
@changeTab="changeTab"
>
<view
class="module-box"
slot="module"
>
<home-frame @preview="preview" @start="start" ref="home" :id="id" @openStep="openStep" @backHome="backHome" @changeTab="changeTab">
<view class="module-box" slot="module">
<template v-for="(i, index) in moduleList">
<view
:key="index"
:class="['item', i.class]"
:style="i.style"
@click="toDetail(i)"
v-if="!i.hide"
>
<view :key="index" :class="['item', i.class]" :style="i.style" @click="toDetail(i)" v-if="!i.hide">
<template v-if="i.showAlt">
<view class="item-text flex">{{ i.title }}</view>
</template>
<template v-else>
<image
class="item-img"
:src="i.thumbnail"
mode="scaleToFill"
@error="errorImg(index)"
/>
<image class="item-img" :src="i.thumbnail" mode="scaleToFill" @error="errorImg(index)" />
</template>
</view>
</template>
</view>
<template slot="detail">
<detail
:id.sync="id"
:media="moduleList"
:type.sync="type"
:toolList="toolList"
@back="back"
@done="done"
ref="detail"
/>
<detail :id.sync="id" :media="moduleList" :type.sync="type" :toolList="toolList" @back="back" @done="done" ref="detail" />
</template>
<template slot="content">
<!-- <novice-guide
......@@ -72,7 +42,7 @@ import HomeFrame from '@/components/HomeFrame/index.vue'
export default {
// mixins: [storge],
components: { HomeFrame, detail, NoviceGuide },
data () {
data() {
return {
moduleList: [],
toolList: [],
......@@ -84,12 +54,12 @@ export default {
}
},
computed: {
channelType () {
channelType() {
const { channelType } = uni.$storage.get('userInfo')
return channelType || 1 //默认问界
}
},
onBackPress (options) {
onBackPress(options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
......@@ -99,12 +69,12 @@ export default {
// 其他情况允许正常返回
return false
},
onLoad () {
onLoad() {
this.setViewInfo()
this.getSoure()
this.get_Vehicle_Sales_Data()
},
onShow () {
onShow() {
const userInfo = uni.$storage.get('userInfo')
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm('userInfo')
......@@ -118,11 +88,11 @@ export default {
},
methods: {
...mapMutations('audio', ['setReceptionStatus']),
init () {
init() {
this.findPayInfo()
},
/**获取车型&销售数据 */
get_Vehicle_Sales_Data () {
get_Vehicle_Sales_Data() {
const userInfo = uni.$storage.get('userInfo'),
storageCarBrandList = uni.$storage.get('carBrandList'),
storageEmployeeList = uni.$storage.get('employeeList'),
......@@ -157,10 +127,37 @@ export default {
})
},
// 查询素材
async getSoure () {
async getSoure() {
/**比亚迪 */
if (this.channelType == 2) {
let { moduleList, toolList } = await uni.$api.systemApi.getBydMockData(true)
let configList
try {
configList = await uni.$api.systemApi.findReceptionpriproConfigList({})
uni.$storage.set('findReceptionpriproConfigList', configList)
} catch (error) {
configList = uni.$storage.get('findReceptionpriproConfigList')
}
const toolOtherList = configList.map(i => {
return {
id: 10 + i.id,
shortTitle: i.productName,
shortTitleUrl: i.procuctLog
}
})
toolList = toolList.concat(toolOtherList)
const moduleOtherList = configList.map(i => {
return {
id: 10 + i.id,
title: i.productName,
shortTitleUrl: i.procuctLog,
productPoster: i.productPoster,
showAlt: false,
componentName: 'CaseCenter',
receptionpriproCusCaseList: i.receptionpriproCusCaseList
}
})
moduleList = moduleList.concat(moduleOtherList)
moduleList = await Promise.all(
moduleList.map(async e => ({
...e,
......@@ -181,6 +178,35 @@ export default {
} else {
let { moduleList, toolList, default_moduleList, default_toolList, boutiqueDefaultCarBrandId } = await uni.$api.systemApi.getMockData(true)
if (this.channelType == 3) {
let configList
try {
configList = await uni.$api.systemApi.findReceptionpriproConfigList({})
uni.$storage.set('findReceptionpriproConfigList', configList)
} catch (error) {
configList = uni.$storage.get('findReceptionpriproConfigList')
console.log(configList, 'configList')
}
const toolOtherList = configList.map(i => {
return {
id: 10 + i.id,
shortTitle: i.productName,
shortTitleUrl: i.procuctLog
}
})
default_toolList = default_toolList.concat(toolOtherList)
const moduleOtherList = configList.map(i => {
return {
id: 10 + i.id,
title: i.productName,
shortTitleUrl: i.procuctLog,
productPoster: i.productPoster,
showAlt: false,
componentName: 'CaseCenter',
receptionpriproCusCaseList: i.receptionpriproCusCaseList
}
})
default_moduleList = default_moduleList.concat(moduleOtherList)
/**其他品牌 */
default_toolList = await uni.$api.systemApi.imgToBase64(default_toolList, 'shortTitleUrl')
uni.$api.systemApi.updateMockData(
......@@ -214,11 +240,11 @@ export default {
}
}
},
errorImg (index) {
errorImg(index) {
this.moduleList[index].showAlt = true
},
async start () {
async start() {
if (this.recording) return
uni.showLoading({
mask: true
......@@ -241,14 +267,14 @@ export default {
uni.hideLoading()
}, 1e3)
},
toDetail (item) {
toDetail(item) {
this.chooseItem = item
this.$refs.home.previewRef.open()
},
cancel () {
cancel() {
this.$refs.home.previewRef.close()
},
preview () {
preview() {
let { id, title } = this.chooseItem
this.type = 'preview'
this.id = id
......@@ -256,7 +282,7 @@ export default {
this.cancel()
},
// 完成接待
done (e) {
done(e) {
this.$refs.home.finishRef.close()
if (this.recording) this.$refs.home.stopAudio()
this.recording = false
......@@ -268,14 +294,14 @@ export default {
this.$store.dispatch('clearReceptionTrack')
}, 1500)
},
back () {
back() {
const detailRef = this.$refs.detail
if (detailRef.showPayPage) return (detailRef.showPayPage = false)
if (!this.id) return uni.navigateBack()
if (this.type != 'preview') return this.$refs.home.finishRef.open()
this.backHome()
},
backHome () {
backHome() {
if (this.recording) this.$refs.home.stopAudio(true)
this.$refs.home.finishRef.close()
this.id = ''
......@@ -284,23 +310,23 @@ export default {
this.init()
this.recording = false
},
nextStep () {
nextStep() {
let { id } = this.moduleList[0]
this.type = 'preview'
this.id = id
},
clearHistory () {
clearHistory() {
this.$store.dispatch('clearCustomerInfo')
this.$store.dispatch('clearHistory')
this.$refs.home.setBooks([])
this.$store.dispatch('clearReceptionTrack')
},
openStep () {
openStep() {
this.$refs.home.finishRef.close()
this.$refs.detail.open()
},
// 查询门店支付配置
async findPayInfo () {
async findPayInfo() {
const { shopMerchantId } = uni.$storage.get('userInfo')
const data = await uni.$api.commonApi.findPayInfo({
merchantId: shopMerchantId
......@@ -324,13 +350,13 @@ export default {
})
this.$store.dispatch('setPaymentType', paymentType)
},
changeTab (index) {
changeTab(index) {
this.tabIndex = index
if (index == 0) this.init()
},
/**按序加载车型 */
async getCarBrandsList (carBrandList, index) {
async getCarBrandsList(carBrandList, index) {
const item = carBrandList[index]
if (!item) return
const carList = uni.getStorageSync(`${item.id}_${item.brandId}_carlist`)
......@@ -347,7 +373,7 @@ export default {
}
},
/**素材内容 */
setViewInfo (_moduleList, _toolList) {
setViewInfo(_moduleList, _toolList) {
if (_moduleList && _toolList) {
this.moduleList = _moduleList
this.toolList = _toolList
......
......@@ -25,5 +25,6 @@ export const STORAGE_OBJECTKEY = {
historyList: 'historyList',
storageVersion: 'storageVersion',
byd_mock_data: 'byd_mock_data',
boutique_mock_data: 'boutique_mock_data'
boutique_mock_data: 'boutique_mock_data',
findReceptionpriproConfigList: 'findReceptionpriproConfigList'
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!