Commit bea74aea by 李伟康

commit 提交

1 parent 000ed1e0
...@@ -31,7 +31,7 @@ const getMockData = async (immediate = false) => { ...@@ -31,7 +31,7 @@ const getMockData = async (immediate = false) => {
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();
...@@ -78,7 +78,7 @@ const imgToBase64 = (list, urlKey) => { ...@@ -78,7 +78,7 @@ const imgToBase64 = (list, urlKey) => {
}) })
}) })
}; };
const updateMockData = (dataList, keyList, storageName) => { 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 => {
mockData[key] = dataList[key] mockData[key] = dataList[key]
...@@ -103,7 +103,7 @@ const getBydMockData = async (immediate = false) => { ...@@ -103,7 +103,7 @@ const getBydMockData = async (immediate = false) => {
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();
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
.icon-avatar { width: 96rpx; height: 96rpx; background-position: -381rpx -726rpx;} .icon-avatar { width: 96rpx; height: 96rpx; background-position: -381rpx -726rpx;}
.icon-back { width: 128rpx; height: 50rpx; background-position: -111rpx -853rpx;} .icon-back { width: 128rpx; height: 50rpx; background-position: -111rpx -853rpx;}
.icon-bao { width: 196rpx; height: 220rpx; background-position: -830rpx -382rpx;} .icon-bao { width: 196rpx; height: 220rpx; background-position: -830rpx -382rpx;}
.icon-byd { width: 184rpx; height: 36rpx; background-position: -1041rpx -557rpx;}
.icon-change-account { width: 32rpx; height: 32rpx; background-position: -1212rpx -617rpx;} .icon-change-account { width: 32rpx; height: 32rpx; background-position: -1212rpx -617rpx;}
.icon-clone { width: 24rpx; height: 24rpx; background-position: -1285rpx -668rpx;} .icon-clone { width: 24rpx; height: 24rpx; background-position: -1285rpx -668rpx;}
.icon-customer-1 { width: 400rpx; height: 400rpx; background-position: 0rpx 0rpx;} .icon-customer-1 { width: 400rpx; height: 400rpx; background-position: 0rpx 0rpx;}
...@@ -50,4 +51,3 @@ ...@@ -50,4 +51,3 @@
.icon-tool-pay { width: 60rpx; height: 60rpx; background-position: -229rpx -964rpx;} .icon-tool-pay { width: 60rpx; height: 60rpx; background-position: -229rpx -964rpx;}
.icon-total { width: 32rpx; height: 32rpx; background-position: -1269rpx -773rpx;} .icon-total { width: 32rpx; height: 32rpx; background-position: -1269rpx -773rpx;}
.icon-visible { width: 40rpx; height: 40rpx; background-position: -995rpx -668rpx;} .icon-visible { width: 40rpx; height: 40rpx; background-position: -995rpx -668rpx;}
\ No newline at end of file \ No newline at end of file
.icon-byd { width: 184rpx; height: 36rpx; background-position: -1041rpx -557rpx;}
\ No newline at end of file \ No newline at end of file
No preview for this file type
<template> <template>
<view class="layout"> <view :class="['layout',{'byd-layout':isByd}]">
<wnCanvas <wnCanvas
canvasId="c-5" canvasId="c-5"
:drawStatus="penSwitch" :drawStatus="penSwitch"
...@@ -81,7 +81,8 @@ export default { ...@@ -81,7 +81,8 @@ export default {
penSwitch: Boolean, penSwitch: Boolean,
show: Boolean, show: Boolean,
title: String, title: String,
isPreview: Boolean isPreview: Boolean,
isByd: Boolean
}, },
name: 'Reception', name: 'Reception',
data () { data () {
...@@ -276,4 +277,13 @@ export default { ...@@ -276,4 +277,13 @@ export default {
} }
} }
} }
.byd-layout{
background-image: url('@/assets/images/media/byd-insurance-bg.webp') !important;
.title{
padding: 120rpx 128rpx 48rpx;
.text{
text-align: center;
}
}
}
</style> </style>
const target = ["ip", "dev", "uat", "prod", "beta"]; const target = ["ip", "dev", "uat", "prod", "beta"];
const index = 1; const index = 4;
/** /**
* *
0本地 0本地
......
...@@ -73,11 +73,13 @@ export default { ...@@ -73,11 +73,13 @@ export default {
.feature-title { .feature-title {
font-weight: 500; font-weight: 500;
font-size: 40rpx; font-size: 40rpx;
line-height: 56rpx;
} }
.feature-description { .feature-description {
font-size: 28rpx; font-size: 28rpx;
margin-top: 8rpx; margin-top: 8rpx;
color: rgba(255, 255, 255, 0.7); color: rgba(255, 255, 255, 0.7);
line-height: 40rpx;
} }
} }
} }
...@@ -92,6 +94,7 @@ export default { ...@@ -92,6 +94,7 @@ export default {
font-size: 26rpx; font-size: 26rpx;
color: #141414; color: #141414;
border-radius: 0 0 40rpx 40rpx; border-radius: 0 0 40rpx 40rpx;
line-height: 40rpx;
.notice-title { .notice-title {
color: #666666; color: #666666;
} }
......
...@@ -165,78 +165,79 @@ export default { ...@@ -165,78 +165,79 @@ export default {
/**比亚迪 */ /**比亚迪 */
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)
await moduleList.map(async e => { moduleList = await Promise.all(
if (e.receptionSourceDetailList) moduleList.map(async e => ({
e.receptionSourceDetailList = await uni.$api.systemApi.imgToBase64( ...e,
receptionSourceDetailList: e.receptionSourceDetailList ? await uni.$api.systemApi.imgToBase64(
e.receptionSourceDetailList, e.receptionSourceDetailList,
"detailUrl" "detailUrl"
); ) : undefined,
}) screenList: e.screenList ? await uni.$api.systemApi.imgToBase64(
e.screenList,
"url"
) : undefined
}))
)
toolList = await uni.$api.systemApi.imgToBase64(toolList, "shortTitleUrl") toolList = await uni.$api.systemApi.imgToBase64(toolList, "shortTitleUrl")
uni.$api.systemApi.updateMockData({ uni.$api.systemApi.updateMockData({
moduleList, moduleList,
toolList, toolList,
}, ['moduleList', 'toolList'], 'byd_mock_data') }, ['moduleList', 'toolList'],'byd_mock_data')
this.setViewInfo(moduleList, toolList) this.setViewInfo(moduleList, toolList)
} else { } else {
let { moduleList, toolList, let { moduleList, toolList,
default_moduleList, default_toolList, default_moduleList, default_toolList,
} = await uni.$api.systemApi.getMockData(true), } = await uni.$api.systemApi.getMockData(true)
_moduleList,
_toolList
if (this.channelType == 3) { if (this.channelType == 3) {
/**其他品牌 */ /**其他品牌 */
default_toolList = await uni.$api.systemApi.imgToBase64(default_toolList, "shortTitleUrl"); default_toolList = await uni.$api.systemApi.imgToBase64(default_toolList, "shortTitleUrl");
_moduleList = default_moduleList uni.$api.systemApi.updateMockData({
_toolList = default_toolList default_moduleList,
default_toolList,
}, ['default_moduleList', 'default_toolList'])
this.setViewInfo(default_moduleList, default_toolList)
} else { } else {
/**默认问界 */ /**默认问界 */
await moduleList.map(async (e) => { moduleList = await Promise.all(
if (e.receptionSourceDetailList) moduleList.map(async e => ({
e.receptionSourceDetailList = await uni.$api.systemApi.imgToBase64( ...e,
receptionSourceDetailList: e.receptionSourceDetailList ? await uni.$api.systemApi.imgToBase64(
e.receptionSourceDetailList, e.receptionSourceDetailList,
"detailUrl" "detailUrl"
); ) : undefined,
if (e.carTypeList) carTypeList: e.carTypeList ? await uni.$api.systemApi.imgToBase64(
e.carTypeList = await uni.$api.systemApi.imgToBase64(
e.carTypeList, e.carTypeList,
"url" "url"
); ) : undefined,
if (e.screenList) screenList: e.screenList ? await uni.$api.systemApi.imgToBase64(
e.screenList = await uni.$api.systemApi.imgToBase64(
e.screenList, e.screenList,
"url" "url"
) : undefined
}))
) )
});
toolList = await uni.$api.systemApi.imgToBase64(toolList, "shortTitleUrl") toolList = await uni.$api.systemApi.imgToBase64(toolList, "shortTitleUrl")
_moduleList = moduleList
_toolList = toolList
}
uni.$api.systemApi.updateMockData({ uni.$api.systemApi.updateMockData({
default_moduleList,
default_toolList,
moduleList, moduleList,
toolList toolList
}, ["moduleList", 'toolList', }, ["moduleList", 'toolList'])
'default_moduleList', 'default_toolList', this.setViewInfo(moduleList, toolList)
], 'mock_data') }
this.setViewInfo(_moduleList, _toolList)
} }
}, },
errorImg (index) { errorImg (index) {
this.moduleList[index].showAlt = true; this.moduleList[index].showAlt = true;
}, },
async start () { async start () {
const result = await this.$permision.requestAndroidPermission( // const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO" // "android.permission.RECORD_AUDIO"
); // );
if (result !== 1) { // if (result !== 1) {
uni.showToast({ // uni.showToast({
title: "为了记录语音通话,请打开录音权限", // title: "为了记录语音通话,请打开录音权限",
icon: "none", // icon: "none",
}); // });
return; // return;
} // }
this.getSoure(); this.getSoure();
this.clearHistory(); this.clearHistory();
this.$refs.home.startAudio(); this.$refs.home.startAudio();
...@@ -333,6 +334,7 @@ export default { ...@@ -333,6 +334,7 @@ export default {
/**按序加载车型 */ /**按序加载车型 */
async getCarBrandsList (carBrandList, index) { async getCarBrandsList (carBrandList, index) {
const item = carBrandList[index] const item = carBrandList[index]
if (!item) return
const carList = uni.getStorageSync( const carList = uni.getStorageSync(
`${item.id}_${item.brandId}_carlist` `${item.id}_${item.brandId}_carlist`
); );
......
...@@ -25,7 +25,7 @@ class Storage { ...@@ -25,7 +25,7 @@ class Storage {
* @param {*} type | 类型,是 get set rm * @param {*} type | 类型,是 get set rm
* @param {*} emptyFlag | 是否判断为空情况,默认判断 true,false 为不判断 * @param {*} emptyFlag | 是否判断为空情况,默认判断 true,false 为不判断
*/ */
checkKeyType(key, type, emptyFlag = true) { checkKeyType (key, type, emptyFlag = true) {
if (typeof key != 'string') { if (typeof key != 'string') {
throw new Error(`Storage ${this.types[type]} func: key must be string`) throw new Error(`Storage ${this.types[type]} func: key must be string`)
return false return false
...@@ -69,7 +69,7 @@ class Storage { ...@@ -69,7 +69,7 @@ class Storage {
* *
* @param {*} 空key返回默认定义数组的值 * @param {*} 空key返回默认定义数组的值
*/ */
getObjectKeyValue(key) { getObjectKeyValue (key) {
// ObjectList // ObjectList
if (typeof key == 'string') { if (typeof key == 'string') {
key = this.addEvnToKey(key) key = this.addEvnToKey(key)
...@@ -125,6 +125,8 @@ class Storage { ...@@ -125,6 +125,8 @@ class Storage {
} }
}) })
} }
const storageInfo = uni.getStorageInfoSync();
console.log(`Used storage size: ${storageInfo.currentSize} bytes`);
}) })
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!