Commit 909e46e1 by luyt

fix:处理分享时间的格式问题

1 parent eb06ae8f
import { util } from 'utils'
import dayjs from 'dayjs'
// 埋点上报
const commonUrl = '/rop-scrm-bigdatautil/router'
......@@ -25,12 +26,23 @@ const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method =
if (ISWXWORK) {
if (userInfo.loginList.length && userInfo.loginList[0].phone) userInfo.phone = userInfo.loginList[0].phone
}
// 处理分享时间格式(1.YYYY-MM-DD HH:mm:ss,2.时间戳)
let sharedTime
if (params.sharedTime) {
if (!params.sharedTime.includes('-')) {
sharedTime = dayjs(+params.sharedTime).format('YYYY-MM-DD HH:mm:ss')
} else {
sharedTime = decodeURIComponent(params.sharedTime)
}
} else {
sharedTime = ''
}
let data = {
open_id: userInfo.openid || userInfo.uuid,
staff_id: (params && params.staffId) || '',
staff_uuid: (params && params.shareStaffUuid) || '',
user_phone: (params && params.userPhone) || '',
create_time: firstEnter?enter_time:new Date().format('yyyy-MM-dd hh:mm:ss'), // 离开时间
create_time: firstEnter ? enter_time : new Date().format('yyyy-MM-dd hh:mm:ss'), // 离开时间
enter_time, // 进入时间
item_type: 3,
customer_phone: userInfo.phone || '',
......@@ -41,8 +53,9 @@ const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method =
merchant_id: (params && params.merchantId) || '',
user_open_id: (params && params.openId) || '',
share_channel,
sharedTime: (params && params.sharedTime) || ''
sharedTime
}
// 数据上报兼容
data = {
// method: 'entmicro.api.customercollect.reportCustomerList',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!