Commit 757fbed4 by 李伟康

commit 新增场景

1 parent d734759f
...@@ -12,7 +12,9 @@ const serverConfig = { ...@@ -12,7 +12,9 @@ const serverConfig = {
mockCache: null mockCache: null
}, },
configModule = 'app-tape', configModule = 'app-tape',
appConfigModule = 'app-config-url',
boutiqueConfigModule = 'boutique-pad-config', boutiqueConfigModule = 'boutique-pad-config',
appConfigUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=${appConfigModule}&env=${env}`,
configUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=${configModule}&env=${env}`, configUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=${configModule}&env=${env}`,
boutiqueConfigUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=${boutiqueConfigModule}&env=${env}` boutiqueConfigUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=${boutiqueConfigModule}&env=${env}`
/**获取APP配置 */ /**获取APP配置 */
...@@ -102,21 +104,21 @@ const getImageVersion = async () => { ...@@ -102,21 +104,21 @@ const getImageVersion = async () => {
const accountInfo = await getMockData() const accountInfo = await getMockData()
return accountInfo?.version || Date.now() return accountInfo?.version || Date.now()
} }
/**获取延保素材配置 */ /**获取素材配置 */
const getSoureData = async (channelType = 1, shopMerchantId) => { const getSoureData = async (channelType = 1, shopMerchantId, sceneType = 0) => {
const appConfigUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=app-config-url&env=${env}`, const sceneData = await http.uni_request({ url: appConfigUrl }),
{ brandIds, merchantIds, caseCenterIds } = await http.uni_request({ url: appConfigUrl }) { brandIds, merchantIds, caseCenterIds } = sceneData[sceneType]
let targetUrl, let targetUrl,
storageName = 'source_data_' storageName = `source_${sceneType}_data_`
if (merchantIds.hasOwnProperty(shopMerchantId)) { if (merchantIds.hasOwnProperty(shopMerchantId)) {
targetUrl = `${merchantIds[shopMerchantId]}&env=${env}` targetUrl = merchantIds[shopMerchantId]
storageName += `merchantId_${shopMerchantId}` storageName += `merchantId_${shopMerchantId}`
} }
else { else {
targetUrl = `${brandIds[channelType]}&env=${env}` targetUrl = brandIds[channelType]
storageName += `channelType_${channelType}` storageName += `channelType_${channelType}`
} }
let data = await http.uni_request({ url: targetUrl }), let data = await http.uni_request({ url: `${targetUrl}&env=${env}` }),
{ moduleList, toolList } = data { moduleList, toolList } = data
/**全损无忧 */ /**全损无忧 */
if (caseCenterIds.includes(channelType)) { if (caseCenterIds.includes(channelType)) {
...@@ -157,7 +159,7 @@ const getSoureData = async (channelType = 1, shopMerchantId) => { ...@@ -157,7 +159,7 @@ const getSoureData = async (channelType = 1, shopMerchantId) => {
} }
/**批量图片转base64 */ /**批量图片转base64 */
const imgTransformBase64 = async (imgList = [], keyList = []) => { const imgTransformBase64 = async (imgList = [], keyList = []) => {
const list = await Promise.all( return await Promise.all(
imgList.map(async e => { imgList.map(async e => {
await Promise.all( await Promise.all(
Object.keys(e).map(async key => { Object.keys(e).map(async key => {
...@@ -194,8 +196,6 @@ const imgTransformBase64 = async (imgList = [], keyList = []) => { ...@@ -194,8 +196,6 @@ const imgTransformBase64 = async (imgList = [], keyList = []) => {
return e return e
}) })
) )
return list
} }
/**转base64 */ /**转base64 */
const getBase64 = async (url) => { const getBase64 = async (url) => {
......
...@@ -93,6 +93,10 @@ export default { ...@@ -93,6 +93,10 @@ export default {
shopMerchantId () { shopMerchantId () {
const { shopMerchantId } = uni.$storage.get('userInfo') const { shopMerchantId } = uni.$storage.get('userInfo')
return shopMerchantId return shopMerchantId
},
sceneType () {
const { sceneType } = uni.$storage.get('userInfo')
return sceneType
} }
}, },
onBackPress (options) { onBackPress (options) {
...@@ -164,13 +168,13 @@ export default { ...@@ -164,13 +168,13 @@ export default {
}, },
// 查询素材 // 查询素材
async getSoure (loadStorage = true) { async getSoure (loadStorage = true) {
const { channelType, shopMerchantId } = this const { channelType, shopMerchantId, sceneType } = this
if (loadStorage) { if (loadStorage) {
let data = uni.getStorageSync(`source_data_merchantId_${shopMerchantId}`) let data = uni.getStorageSync(`source_${sceneType}_data_merchantId_${shopMerchantId}`)
if (!data) data = uni.getStorageSync(`source_data_channelType_${channelType}`) if (!data) data = uni.getStorageSync(`source_${sceneType}_data_channelType_${channelType}`)
if (data) this.setViewInfo(data) if (data) this.setViewInfo(data)
} }
let requestData = await uni.$api.systemApi.getSoureData(channelType, shopMerchantId) let requestData = await uni.$api.systemApi.getSoureData(channelType, shopMerchantId, sceneType)
this.setViewInfo(requestData) this.setViewInfo(requestData)
}, },
errorImg (index) { errorImg (index) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!