Commit 4689bc39 by 前端

案例

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