Commit f1ae7840 by 张立顺

Merge branch 'SAAS+V5.3.0-1117' of 192.168.3.233:saas_plus/sales-assistant into SAAS+V5.3.0-1117

2 parents 91bc6336 01111065
Showing 47 changed files with 582 additions and 724 deletions
...@@ -29,7 +29,7 @@ module.exports = { ...@@ -29,7 +29,7 @@ module.exports = {
method: `${common}uploadImg`, method: `${common}uploadImg`,
...data, ...data,
noSignAttr: ['file'] noSignAttr: ['file']
}) }, false, 'scrm')
}, },
/**视频上传 /**视频上传
*/ */
......
...@@ -14,6 +14,13 @@ class CustomerApi { ...@@ -14,6 +14,13 @@ class CustomerApi {
...data ...data
}) })
} }
// 获取主营品牌车型数据
getCarBrandList(data) {
return api.post({
method: "dj.api.sale.getCarBrandTree",
...data
})
}
// 获取门店的KPI进度数据 // 获取门店的KPI进度数据
getKPIData(data) { getKPIData(data) {
return api.post({ return api.post({
...@@ -40,35 +47,28 @@ class CustomerApi { ...@@ -40,35 +47,28 @@ class CustomerApi {
return api.post({ return api.post({
method: "dj.api.sale.potential.customer.add", method: "dj.api.sale.potential.customer.add",
...data ...data
}) }, true)
} }
// 信息完善 // 信息完善
editCustomer(data) { editCustomer(data) {
return api.post({ return api.post({
method: "dj.api.sale.potential.customer.edit", method: "dj.api.sale.potential.customer.edit",
...data ...data
}) }, true)
}
// 获取省市区数据
getAreaData(data) {
return api.post({
method: "dj.api.sale.map.districts",
...data
})
} }
// 新增拜访 // 新增拜访
addVisit(data) { addVisit(data) {
return api.post({ return api.post({
method: "dj.api.sale.potential.customer.visit.add", method: "dj.api.sale.potential.customer.visit.add",
...data ...data
}) }, true)
} }
// 结果反馈 // 结果反馈
reslutFeedbackApi(data) { reslutFeedbackApi(data) {
return api.post({ return api.post({
method: "dj.api.sale.potential.customer.result.feedback", method: "dj.api.sale.potential.customer.result.feedback",
...data ...data
}) }, true)
} }
// 拜访记录列表 // 拜访记录列表
getVisitList(data) { getVisitList(data) {
...@@ -112,6 +112,45 @@ class CustomerApi { ...@@ -112,6 +112,45 @@ class CustomerApi {
...data ...data
}) })
} }
// 获取门店信息-盈亏情况展业情况预警
getStoreOverviewData(data) {
return api.post({
method: "dj.api.sale.store.overview",
...data
})
}
// 门店经营分析-门店总产值和客单价
queryMerchantOutputAndAtv(data) {
return api.get({
apiProjectName: 'sale',
projectName: 'sale',
...data
}, true, 'merchant', '/merchant/queryMerchantOutputAndAtv')
}
// 门店经营分析-产值趋势
queryMerchantOutputTrend(data) {
return api.get({
apiProjectName: 'sale',
projectName: 'sale',
...data
}, true, 'merchant', '/merchant/queryMerchantOutputTrend')
}
// 门店经营分析-新车交付数、新车到店流量、售后到店流量、成交量
queryMerchantBuyAndTostore(data) {
return api.get({
apiProjectName: 'sale',
projectName: 'sale',
...data
}, true, 'merchant', '/merchant/queryMerchantBuyAndTostore')
}
// 门店经营分析-销售人员
queryServiceSupervisionSale(data) {
return api.get({
apiProjectName: 'sale',
projectName: 'sale',
...data
}, true, 'merchant', '/merchant/queryServiceSupervisionSale')
}
} }
export default CustomerApi export default CustomerApi
\ No newline at end of file \ No newline at end of file
// packageMine/components/CarBrand/CarBrand.js // packageMine/components/CarBrand/CarBrand.js
import mineApi from '~/api/mineApi/index' import CustomerApi from '~/api/customerApi/index'
import Util from '~/utils/util' import Util from '~/utils/util'
Component({ Component({
/** /**
...@@ -92,7 +92,7 @@ Component({ ...@@ -92,7 +92,7 @@ Component({
this.formatData(brandlist) this.formatData(brandlist)
}) })
} else { } else {
mineApi.getCarBrandList().then(data => { CustomerApi.getCarBrandList().then(data => {
wx.$storage.set('car_brand_list', data) wx.$storage.set('car_brand_list', data)
this.dealSelectedList(Util.deepClone(data)).then(brandlist => { this.dealSelectedList(Util.deepClone(data)).then(brandlist => {
this.formatData(brandlist) this.formatData(brandlist)
...@@ -164,7 +164,7 @@ Component({ ...@@ -164,7 +164,7 @@ Component({
height: _res.bottom height: _res.bottom
}) })
}) })
}) }, true)
}, },
dealSelectList(index, pidx, cidx) { dealSelectList(index, pidx, cidx) {
let { selectingList } = this.data let { selectingList } = this.data
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
display: grid; display: grid;
align-items: center; align-items: center;
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #5A5E66;
position: relative; position: relative;
} }
......
...@@ -11,7 +11,7 @@ Component({ ...@@ -11,7 +11,7 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
merchantId: Number
}, },
/** /**
...@@ -63,7 +63,6 @@ Component({ ...@@ -63,7 +63,6 @@ Component({
weekList: [], weekList: [],
weekColumns: [], weekColumns: [],
currentWeek: {}, currentWeek: {},
merchantId: '',
boardData: {}, boardData: {},
leftCurrent: false, leftCurrent: false,
rightCurrent: false, rightCurrent: false,
...@@ -72,19 +71,12 @@ Component({ ...@@ -72,19 +71,12 @@ Component({
keys: ['stattime', 'output'], keys: ['stattime', 'output'],
color: '#69C9FF', color: '#69C9FF',
lineColr: '#6ED0BE', lineColr: '#6ED0BE',
tickCount: 8, tickCount: 8
lineList: [],
barList: [],
}, },
}, },
lifetimes: { lifetimes: {
attached() { attached() {
// 获取当前页面的merchantId
const merchantId = wx.$router.getPageInstance().options.merchantId
this.setData({
merchantId
})
// 初始化日期为昨天 // 初始化日期为昨天
this.initDate() this.initDate()
// 周数据 // 周数据
...@@ -111,7 +103,6 @@ Component({ ...@@ -111,7 +103,6 @@ Component({
selectDate(event) { selectDate(event) {
const { index } = event.currentTarget.dataset; const { index } = event.currentTarget.dataset;
const {timeTypeEnum} = this.data const {timeTypeEnum} = this.data
console.log(index, 'dateCurrent')
this.setData({ this.setData({
dateCurrent: index, dateCurrent: index,
timeType: timeTypeEnum[index], timeType: timeTypeEnum[index],
...@@ -125,15 +116,69 @@ Component({ ...@@ -125,15 +116,69 @@ Component({
} }
this.initDate(timeTypeEnum[index]) this.initDate(timeTypeEnum[index])
}, },
getAnalysisData() { async getAnalysisData() {
try {
let params = this.getParams()
const [outputData, buyAndToStoreData, chartData, supervisionSale] = await Promise.all([
CustomerApi.queryMerchantOutputAndAtv(params),
CustomerApi.queryMerchantBuyAndTostore(params),
CustomerApi.queryMerchantOutputTrend(params),
CustomerApi.queryServiceSupervisionSale(params)
])
console.log(chartData)
this.setData({
outputData: outputData?.data?.list || [],
buyAndToStoreData: buyAndToStoreData?.data?.list || [],
supervisionSale: supervisionSale?.data?.list || [],
lineData: chartData?.data?.list || []
})
} catch (error) {
console.error()
}
},
getParams() {
let { merchantId, current, dateCurrent, date, currentWeek } = this.data
const currentPar = ['yanbao', 'quanyi', 'qinggai']
const dateCurrentPar = ['day', 'week', 'month', 'self']
const obj = {
merchantid: merchantId,
business_type: currentPar[current],
queryType: dateCurrentPar[dateCurrent],
brand: "全部",
province: "全部",
city: "全部",
service: "全部",
supervision: "全部",
salesman: "全部"
}
switch (dateCurrent) {
case 0:
obj.startDay = obj.endDay = dayjs(date).format('YYYY-MM-DD')
break;
case 1:
obj.startDay = dayjs(currentWeek.startDate).format('YYYY-MM-DD')
obj.endDay = dayjs(currentWeek.endDate).format('YYYY-MM-DD')
break;
case 2:
obj.startDay = dayjs(date).startOf('month').format('YYYY-MM-DD')
obj.endDay = dayjs(date).endOf('month').format('YYYY-MM-DD')
break;
case 3: {
const [start, end] = date.split('-').map(d => dayjs(d.trim()))
obj.startDay = start.format('YYYY-MM-DD')
obj.endDay = end.format('YYYY-MM-DD')
break;
}
default:
console.warn('[getUsedCarBusinessData] 未知 timeType:', timeType)
}
return obj
}, },
initDate(type = 'date') { initDate(type = 'date') {
const now = dayjs(); const now = dayjs();
const {current} = this.data
const setData = (payload) => { const setData = (payload) => {
this.setData(payload); this.setData(payload);
if (current == 0) this.getAnalysisData(this.data.merchantId); this.getAnalysisData()
}; };
switch (type) { switch (type) {
...@@ -180,8 +225,8 @@ Component({ ...@@ -180,8 +225,8 @@ Component({
const result = await CustomerApi.getWeekSelectData() const result = await CustomerApi.getWeekSelectData()
const weekColumns = result.map((item, index) => ({ const weekColumns = result.map((item, index) => ({
label: `${item.startDate}至${item.endDate}`, label: `${item.startDate}至${item.endDate}`,
startDate: dayjs(item.startDate).format('YYYY/MM/DD'), startDate: dayjs(item.startDate).format('YYYY-MM-DD'),
endDate: dayjs(item.endDate).format('YYYY/MM/DD'), endDate: dayjs(item.endDate).format('YYYY-MM-DD'),
index index
})) }))
this.setData({ this.setData({
...@@ -197,7 +242,6 @@ Component({ ...@@ -197,7 +242,6 @@ Component({
}, },
// 日历的确认 // 日历的确认
onConfirm(event) { onConfirm(event) {
console.log(event)
const {current} = this.data const {current} = this.data
const start = event.detail[0] const start = event.detail[0]
const end = event.detail[1] const end = event.detail[1]
...@@ -205,7 +249,6 @@ Component({ ...@@ -205,7 +249,6 @@ Component({
show: false, show: false,
date: `${dayjs(start).format('YYYY/MM/DD')}-${dayjs(end).format('YYYY/MM/DD')}`, date: `${dayjs(start).format('YYYY/MM/DD')}-${dayjs(end).format('YYYY/MM/DD')}`,
}); });
console.log(current, 'current')
if (current == 0) this.getAnalysisData() if (current == 0) this.getAnalysisData()
}, },
// 日选择 // 日选择
...@@ -232,8 +275,6 @@ Component({ ...@@ -232,8 +275,6 @@ Component({
const _date = date.split('/') const _date = date.split('/')
if (c_value[0] != _date[0] || c_value[1] != _date[1] || c_value[2] != _date[2]) { if (c_value[0] != _date[0] || c_value[1] != _date[1] || c_value[2] != _date[2]) {
const picker = this.selectComponent("#datePicker") const picker = this.selectComponent("#datePicker")
console.log(picker.picker, 'picker')
console.log(date)
this.setData({ this.setData({
minDate: dayjs().subtract(1, 'year').valueOf(), minDate: dayjs().subtract(1, 'year').valueOf(),
maxDate: dayjs().valueOf(), maxDate: dayjs().valueOf(),
...@@ -247,8 +288,6 @@ Component({ ...@@ -247,8 +288,6 @@ Component({
const _date = date.split('/') const _date = date.split('/')
if (c_value[0] != _date[0] || c_value[1] != _date[1]) { if (c_value[0] != _date[0] || c_value[1] != _date[1]) {
const picker = this.selectComponent("#datePicker") const picker = this.selectComponent("#datePicker")
console.log(picker.picker, 'picker')
console.log(date)
this.setData({ this.setData({
minDate: dayjs().subtract(1, 'year').valueOf(), minDate: dayjs().subtract(1, 'year').valueOf(),
maxDate: dayjs().valueOf(), maxDate: dayjs().valueOf(),
...@@ -260,10 +299,8 @@ Component({ ...@@ -260,10 +299,8 @@ Component({
} else if (timeType == 'week') { } else if (timeType == 'week') {
const { date, weekColumns} = this.data const { date, weekColumns} = this.data
const picker = this.selectComponent("#weekPicker") const picker = this.selectComponent("#weekPicker")
console.log(picker.getColumnIndex(0), 'picker')
const label = date.replace('-', '至').replace(/\//g, '-'); const label = date.replace('-', '至').replace(/\//g, '-');
const index = weekColumns.findIndex(i => i.label == label) const index = weekColumns.findIndex(i => i.label == label)
console.log(label, index)
setTimeout(() => { setTimeout(() => {
picker.setColumnIndex(0, index) picker.setColumnIndex(0, index)
}, 0) }, 0)
...@@ -324,17 +361,14 @@ Component({ ...@@ -324,17 +361,14 @@ Component({
dateShow: false, dateShow: false,
date: (formatMap[timeType] || (() => ''))() date: (formatMap[timeType] || (() => ''))()
}); });
console.log(current, 'current')
if (current == 0) this.getAnalysisData(this.data.merchantId); if (current == 0) this.getAnalysisData(this.data.merchantId);
}, },
onChange(e) { onChange(e) {
console.log(e, e.detail.getValues(), 'onChange')
currentObj = e.detail currentObj = e.detail
}, },
// 日选择 // 日选择
onInput(event) { onInput(event) {
console.log(dayjs(event.detail).format('YYYY/MM/DD'), 'onInput')
// 防止选择之后,取消选择,导致日期不变 // 防止选择之后,取消选择,导致日期不变
this.setData({ this.setData({
selectedDate: event.detail selectedDate: event.detail
...@@ -342,7 +376,6 @@ Component({ ...@@ -342,7 +376,6 @@ Component({
}, },
// 周选择 // 周选择
onWeekChange(event) { onWeekChange(event) {
console.log(event, 'weekChange')
const {value} = event.detail const {value} = event.detail
const currentWeek = value const currentWeek = value
this.setData({ this.setData({
...@@ -406,7 +439,6 @@ Component({ ...@@ -406,7 +439,6 @@ Component({
leftCurrent: false, leftCurrent: false,
rightCurrent rightCurrent
}); });
console.log(currentDisplayDate, 'currentDisplayDate')
} else if (timeType == 'date') { } else if (timeType == 'date') {
// 日选择 // 日选择
// 获取当前显示的日期 // 获取当前显示的日期
...@@ -424,10 +456,8 @@ Component({ ...@@ -424,10 +456,8 @@ Component({
}); });
} else if (timeType == 'week') { } else if (timeType == 'week') {
const {currentWeek, weekColumns} = this.data const {currentWeek, weekColumns} = this.data
console.log(currentWeek)
if (currentWeek.index < weekColumns.length) { if (currentWeek.index < weekColumns.length) {
const nextWeek = weekColumns[currentWeek.index - 1] const nextWeek = weekColumns[currentWeek.index - 1]
console.log(nextWeek)
const nextDate = dayjs(nextWeek.startDate, 'YYYY/MM/DD'); const nextDate = dayjs(nextWeek.startDate, 'YYYY/MM/DD');
this.setData({ this.setData({
date: `${nextWeek.startDate}-${nextWeek.endDate}`, date: `${nextWeek.startDate}-${nextWeek.endDate}`,
...@@ -437,10 +467,8 @@ Component({ ...@@ -437,10 +467,8 @@ Component({
rightCurrent: nextWeek.index == 0, rightCurrent: nextWeek.index == 0,
leftCurrent: false leftCurrent: false
}) })
console.log(nextWeek == 0, this.data.currentDate)
} }
} }
console.log(current, 'current')
if (current == 0) this.getAnalysisData(merchantId) if (current == 0) this.getAnalysisData(merchantId)
}, },
handleShow(e) { handleShow(e) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</block> </block>
</view> </view>
</view> </view>
<view class="person-section">销售:{{'迪丽热巴·迪力木拉提'}}</view> <view class="person-section">销售:{{supervisionSale[0] && supervisionSale[0].saleman}}</view>
<view class="tab-section"> <view class="tab-section">
<block wx:for="{{dateList}}" wx:key="index"> <block wx:for="{{dateList}}" wx:key="index">
<view class="tab {{item.index==dateCurrent?'active':''}}" data-index="{{item.index}}" bind:tap="selectDate">{{item.title}}</view> <view class="tab {{item.index==dateCurrent?'active':''}}" data-index="{{item.index}}" bind:tap="selectDate">{{item.title}}</view>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="cell {{item.full ? 'cell-full' : (item.span === 2 ? 'cell-span2' : '')}}"> <view class="cell {{item.full ? 'cell-full' : (item.span === 2 ? 'cell-span2' : '')}}">
<view class="cell-label">{{item.label}}</view> <view class="cell-label">{{item.label}}</view>
<view class="cell-value {{item.highlight ? 'highlight' : ''}}"> <view class="cell-value {{item.highlight ? 'highlight' : ''}}">
<text class="value-text">{{item.value}}</text> <text class="value-text">{{item.value || '-'}}</text>
<image wx:if="{{item.isLong}}" class="more-icon" src="{{IMG_URL}}/customer/more-icon.png" mode="aspectFit" data-index="{{index}}" bindtap="onMoreTap" /> <image wx:if="{{item.isLong}}" class="more-icon" src="{{IMG_URL}}/customer/more-icon.png" mode="aspectFit" data-index="{{index}}" bindtap="onMoreTap" />
</view> </view>
</view> </view>
......
...@@ -8,7 +8,7 @@ Component({ ...@@ -8,7 +8,7 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
merchantId: Number
}, },
/** /**
...@@ -29,11 +29,6 @@ Component({ ...@@ -29,11 +29,6 @@ Component({
lifetimes: { lifetimes: {
attached() { attached() {
// 获取当前页面的merchantId
const merchantId = wx.$router.getPageInstance().options?.merchantId
this.setData({
merchantId
})
// 年份数据 // 年份数据
this.generateRecentYears() this.generateRecentYears()
}, },
...@@ -107,7 +102,6 @@ Component({ ...@@ -107,7 +102,6 @@ Component({
const { selectedYear, yearColumns } = this.data const { selectedYear, yearColumns } = this.data
if (selectedYear.index > -1) { if (selectedYear.index > -1) {
const prevYear = yearColumns[selectedYear.index - 1] const prevYear = yearColumns[selectedYear.index - 1]
console.log(selectedYear.index + 1,)
this.setData({ this.setData({
year: prevYear.value, year: prevYear.value,
rightCurrent: false, rightCurrent: false,
...@@ -164,28 +158,20 @@ Component({ ...@@ -164,28 +158,20 @@ Component({
merchantId, merchantId,
businessType: businessTypeObj[current] businessType: businessTypeObj[current]
} }
// TODO: 接入后端后替换为真实数据 CustomerApi.getKPIData(params).then(res => {
const mock = [ res?.map(m => {
{ month: 1, completed: 9666660000, target: 9666660000, completionRate: 100 },
{ month: 2, completed: 66000000, target: 66000000, completionRate: 100 },
{ month: 3, completed: 56000000, target: 99000000, completionRate: 65 },
{ month: 4, completed: 32000000, target: 66000000, completionRate: 100 },
{ month: 5, completed: 66000000, target: 99000000, completionRate: 100 },
{ month: 6, completed: 4000000, target: 20000000, completionRate: 100 },
{ month: 7, completed: 66000000, target: 66000000, completionRate: 100 },
{ month: 8, completed: 66000000, target: 66000000, completionRate: 100 },
{ month: 9, completed: 66000000, target: 99000000, completionRate: 100 },
{ month: 10, completed: 66000000, target: 300000, completionRate: 100 },
{ month: 11, completed: 90000, target: 2000, completionRate: 100 },
{ month: 12, completed: 2000, target: 2000, completionRate: 100 }
]
const rows = mock.map(m => {
const completed = this.formatCurrency(m.completed, ) const completed = this.formatCurrency(m.completed, )
const target = this.formatCurrency(m.target) const target = this.formatCurrency(m.target)
const completionRate = this.formatCurrency(m.completionRate, true) const completionRate = this.formatCurrency(m.completionRate, true)
return { ...m, completed, target, completionRate } return { ...m, completed, target, completionRate }
}) })
this.setData({ kpiRows: rows }) res?.sort((a, b) => {
return a.month - b.month
})
this.setData({
kpiRows: res
})
})
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
.KPI-progress { .KPI-progress {
padding-bottom: 150rpx; padding-bottom: 150rpx;
.header { .header {
margin-bottom: 20rpx;
background: #FFFFFF; background: #FFFFFF;
padding-bottom: 24rpx; padding-bottom: 24rpx;
.title-section { .title-section {
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
<block wx:for="{{kpiRows}}" wx:key="month"> <block wx:for="{{kpiRows}}" wx:key="month">
<view class="kpi-row"> <view class="kpi-row">
<view class="col month">{{item.month}}月</view> <view class="col month">{{item.month}}月</view>
<view class="col done number">{{item.completed}}</view> <view class="col done number">{{item.completed || '-'}}</view>
<view class="col target number">{{item.target}}</view> <view class="col target number">{{item.target || '-'}}</view>
<view class="col rate number">{{item.completionRate}}</view> <view class="col rate number">{{item.completionRate || '-'}}</view>
</view> </view>
</block> </block>
</view> </view>
......
// components/SelectArea/SelectArea.js // components/SelectArea/SelectArea.js
// 直接使用 Vant 的 areaData 作为默认数据源 // 直接使用 Vant 的 areaData 作为默认数据源
const { areaList: vantAreaList } = require('@vant/area-data') // const { areaList: vantAreaList } = require('@vant/area-data')
Component({ Component({
options: { options: {
...@@ -12,7 +12,7 @@ Component({ ...@@ -12,7 +12,7 @@ Component({
// 2 或 3,表示二级(省/市)或三级(省/市/区) // 2 或 3,表示二级(省/市)或三级(省/市/区)
columnsNum: { type: Number, value: 3 }, columnsNum: { type: Number, value: 3 },
value: { type: null, value: '' }, value: { type: null, value: '' },
areaList: { type: Object, value: vantAreaList }, areaList: { type: Object },
confirmOnSelect: { type: Boolean, value: false } confirmOnSelect: { type: Boolean, value: false }
}, },
data: { data: {
......
...@@ -77,7 +77,7 @@ Component({ ...@@ -77,7 +77,7 @@ Component({
const initSelected = multiple ? (Array.isArray(values) ? values.slice() : []) : (value !== null && value !== undefined ? value : []) const initSelected = multiple ? (Array.isArray(values) ? values.slice() : []) : (value !== null && value !== undefined ? value : [])
const display = (options || []).map(item => { const display = (options || []).map(item => {
const val = item[vKey] const val = item[vKey]
const checked = initSelected.some(v => v === val) const checked = initSelected?.some(v => v === val)
return { ...item, checked } return { ...item, checked }
}) })
this.setData({ this.setData({
......
// packageCustomer/components/StoreMessage/StoreMessage.js // packageCustomer/components/StoreMessage/StoreMessage.js
import CustomerApi from '~/api/customerApi/index'
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
Component({ Component({
options: { options: {
addGlobalClass: true addGlobalClass: true
}, },
properties: { properties: {
// 盈亏与展业等摘要信息 merchantId: Number
summary: {
type: Object,
value: {
profit: { ok: true, text: '盈利情况' },
business: { ok: true, text: '展业情况', warningCount: 0 },
bottomMetric: {
title: '渗透率临近业务兜底指标',
periodIndex: 0.1094, // 10.94%
bottomRequire: 0.5 // 50%
}
}
},
// 兜底指标预警列表
warnings: {
type: Array,
value: [
{ title: '轮胎转化率临近业务兜底指标预警', periodIndex: 0.1094, bottomRequire: 0.5 },
{ title: '安心包转化率临近业务兜底指标预警', periodIndex: 0.1094, bottomRequire: 0.5 },
{ title: '转化率临近业务兜底指标预警', periodIndex: 0.1094, bottomRequire: 0.5 }
]
},
// 驻店人员列表
residents: {
type: Array,
value: [
// { role: '店总', name: '李四', phone: '13510769158' },
// { role: '王五', name: '王五', phone: '13510769158' }
]
},
// 默认展开的折叠项(自定义折叠仍可参考该配置)
defaultActive: {
type: Array,
value: ['bottom', 'residents']
}
}, },
data: { data: {
...@@ -51,53 +18,13 @@ Component({ ...@@ -51,53 +18,13 @@ Component({
// 动画对象 // 动画对象
businessAnimation: {}, businessAnimation: {},
bottomAnimation: {}, bottomAnimation: {},
infoData: { infoData: {},
displaySituationWarningCount: 5, showPage: false
safetyIndexWarningCount: 2,
profitAndLoss: 2,
// 展业情况测试数据
displaySituationWarningList: [],
// 兜底指标预警测试数据
safetyIndexWarningList: [{
rule: '轮胎转化率临近业务兜底指标预警',
cycleIndicator: 50,
fallbackIndicator: 20
}, {
rule: '安心包转化率临近业务兜底指标预警',
cycleIndicator: 35,
fallbackIndicator: 25
}, {
rule: '保险产品转化率临近业务兜底指标预警',
cycleIndicator: 28,
fallbackIndicator: 30
}, {
rule: '增值服务转化率临近业务兜底指标预警',
cycleIndicator: 45,
fallbackIndicator: 40
}, {
rule: '客户满意度临近业务兜底指标预警',
cycleIndicator: 38,
fallbackIndicator: 35
}],
storePersonnel: [{
personnelName: '王五王五王五王五王五王五王五王五王五王五王五',
personnelMobile: 13510769158
}, {
personnelName: '王五',
personnelMobile: 13510769158
}]
}
}, },
lifetimes: { lifetimes: {
attached() { attached() {
// 初始化展开状态:仅在有数据时允许展开 this.getDetailData()
const hasBusiness = (this.data.infoData?.displaySituationWarningList || []).length > 0
const hasBottom = (this.data.infoData?.safetyIndexWarningList || []).length > 0
this.setData({
showBusiness: hasBusiness ? false : false,
showBottom: hasBottom ? false : false
})
} }
}, },
...@@ -135,13 +62,23 @@ Component({ ...@@ -135,13 +62,23 @@ Component({
} }
}, },
getDetailData() { getDetailData() {
let { infoData } = this.data let { merchantId } = this.data
infoData.safetyIndexWarningList?.forEach(val => { CustomerApi.getStoreOverviewData({id: merchantId}).then(res => {
res?.safetyIndexWarningList?.forEach(val => {
val.cycleIndicator = this.formatPercent(val.cycleIndicator) val.cycleIndicator = this.formatPercent(val.cycleIndicator)
val.fallbackIndicator = this.formatPercent(val.fallbackIndicator) val.fallbackIndicator = this.formatPercent(val.fallbackIndicator)
}) })
// 初始化展开状态:仅在有数据时允许展开
const hasBusiness = (res.displaySituationWarningList || []).length > 0
const hasBottom = (res?.safetyIndexWarningList || []).length > 0
this.setData({ this.setData({
infoData showBusiness: hasBusiness ? false : false,
showBottom: hasBottom ? false : false
})
this.setData({
infoData: res || {},
showPage: true
})
}) })
}, },
formatPercent(n) { formatPercent(n) {
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
.resident-item { .resident-item {
color: #292D33; color: #292D33;
display: flex; display: flex;
width: calc(100% - 260rpx);
justify-content: flex-end; justify-content: flex-end;
.name { .name {
margin-right: 30rpx; margin-right: 30rpx;
......
<!--packageCustomer/components/StoreMessage/StoreMessage.wxml--> <!--packageCustomer/components/StoreMessage/StoreMessage.wxml-->
<view class="store-message"> <view class="store-message" wx:if="{{showPage}}">
<!-- 盈亏情况 --> <!-- 盈亏情况 -->
<view class="cell-title"> <view class="cell-title">
<view class="title-text">盈亏情况</view> <view class="title-text">盈亏情况</view>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<view class="title-text">展业情况</view> <view class="title-text">展业情况</view>
<view class="status"> <view class="status">
<image src="{{IMG_URL}}customer/{{infoData.displaySituation == 1 ? 'success-icon' : 'warning-icon'}}.png" mode=""/> <image src="{{IMG_URL}}customer/{{infoData.displaySituation == 1 ? 'success-icon' : 'warning-icon'}}.png" mode=""/>
<text class="status-text mar-r20" wx:if="{{!infoData.displaySituationWarningCount}}">{{ infoData.displaySituation == 1 ? '正常' : '预警' }}</text> <text class="status-text {{!infoData.displaySituationWarningList.length ? 'mar-r20' : ''}}" wx:if="{{!infoData.displaySituationWarningCount}}">{{ infoData.displaySituation == 1 ? '正常' : '预警' }}</text>
<text class="status-text {{!infoData.displaySituationWarningList.length ? 'mar-r20' : ''}}" wx:if="{{infoData.displaySituationWarningCount}}">{{infoData.displaySituationWarningCount}}项预警</text> <text class="status-text {{!infoData.displaySituationWarningList.length ? 'mar-r20' : ''}}" wx:if="{{infoData.displaySituationWarningCount}}">{{infoData.displaySituationWarningCount}}项预警</text>
<image wx:if="{{infoData.displaySituationWarningList.length}}" src="{{IMG_URL}}customer/show-icon.png" class="arrow-icon {{showBusiness ? 'open' : ''}}" mode=""/> <image wx:if="{{infoData.displaySituationWarningList.length}}" src="{{IMG_URL}}customer/show-icon.png" class="arrow-icon {{showBusiness ? 'open' : ''}}" mode=""/>
</view> </view>
...@@ -38,9 +38,9 @@ ...@@ -38,9 +38,9 @@
<view class="title-text">兜底指标预警</view> <view class="title-text">兜底指标预警</view>
<view class="status"> <view class="status">
<image src="{{IMG_URL}}customer/{{infoData.safetyIndexWarning == 1 ? 'success-icon' : 'warning-icon'}}.png" mode=""/> <image src="{{IMG_URL}}customer/{{infoData.safetyIndexWarning == 1 ? 'success-icon' : 'warning-icon'}}.png" mode=""/>
<text class="status-text mar-r20" wx:if="{{!infoData.safetyIndexWarningCount}}">{{ infoData.safetyIndexWarning == 1 ? '正常' : '预警' }}</text> <text class="status-text {{!infoData.safetyIndexWarningList.length ? 'mar-r20' : ''}}" wx:if="{{!infoData.safetyIndexWarningCount}}">{{ infoData.safetyIndexWarning == 1 ? '正常' : '预警' }}</text>
<text wx:if="{{infoData.safetyIndexWarningCount}}">{{infoData.safetyIndexWarningCount}}项预警</text> <text class="status-text {{!infoData.safetyIndexWarningList.length ? 'mar-r20' : ''}}" wx:if="{{infoData.safetyIndexWarningCount}}">{{infoData.safetyIndexWarningCount}}项预警</text>
<image src="{{IMG_URL}}customer/show-icon.png" class="arrow-icon {{showBottom ? 'open' : ''}}" mode=""/> <image wx:if="{{infoData.safetyIndexWarningList.length}}" src="{{IMG_URL}}customer/show-icon.png" class="arrow-icon {{showBottom ? 'open' : ''}}" mode=""/>
</view> </view>
</view> </view>
<view wx:if="{{infoData.safetyIndexWarningList.length}}" class="collapsible-panel" animation="{{bottomAnimation}}"> <view wx:if="{{infoData.safetyIndexWarningList.length}}" class="collapsible-panel" animation="{{bottomAnimation}}">
......
...@@ -143,12 +143,12 @@ console.log(this.data.isUseNewCanvas) ...@@ -143,12 +143,12 @@ console.log(this.data.isUseNewCanvas)
.select('.ec-canvas') .select('.ec-canvas')
.fields({ node: true, size: true }) .fields({ node: true, size: true })
.exec(res => { .exec(res => {
const canvasNode = res[0].node const canvasNode = res[0]?.node
this.canvasNode = canvasNode this.canvasNode = canvasNode
const canvasDpr = wx.getSystemInfoSync().pixelRatio const canvasDpr = wx.getSystemInfoSync().pixelRatio
const canvasWidth = res[0].width const canvasWidth = res[0]?.width
const canvasHeight = res[0].height const canvasHeight = res[0]?.height
const ctx = canvasNode.getContext('2d') const ctx = canvasNode.getContext('2d')
......
...@@ -4,11 +4,6 @@ Component({ ...@@ -4,11 +4,6 @@ Component({
detail: { detail: {
type: Object, type: Object,
value: {} value: {}
},
// 动态联系人角色
managers: {
type: Array,
value: []
} }
}, },
data: {}, data: {},
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
align-items: flex-start; align-items: flex-start;
padding-bottom: 32rpx; padding-bottom: 32rpx;
.label { .label {
flex-shrink: 0;
width: 112rpx; width: 112rpx;
font-size: 28rpx; font-size: 28rpx;
color: #999EA8; color: #999EA8;
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
} }
.value { .value {
flex: 1; flex: 1;
word-break: break-all;
font-size: 28rpx; font-size: 28rpx;
color: #292D33; color: #292D33;
} }
......
...@@ -48,9 +48,10 @@ ...@@ -48,9 +48,10 @@
<view class="row image-row"> <view class="row image-row">
<view class="label">门店门头照片</view> <view class="label">门店门头照片</view>
<view class="value"> <view class="value">
<view class="photo-wrap"> <view class="photo-wrap" wx:if="{{detail.storePhoto}}">
<image class="photo" webp src="{{detail.storePhoto}}" /> <image class="photo" webp src="{{detail.storePhoto}}" />
</view> </view>
<view wx:else>-</view>
</view> </view>
</view> </view>
<view class="row note-row"> <view class="row note-row">
......
...@@ -38,103 +38,108 @@ Page({ ...@@ -38,103 +38,108 @@ Page({
// 获取潜客详情数据 // 获取潜客详情数据
this.getDetail(pageQuery) this.getDetail(pageQuery)
} }
// 假数据 // 获取行政区域数据
this.getDetail() this.getAreaData()
this.setData({ this.setData({
pageType pageType
}) })
}, },
onReady() { onReady() {
this.resultDialog = this.selectComponent('#resultDialog')
}, },
onShow() { onShow() {
}, },
getDetail(par) { getAreaData() {
// 假数据 CustomerApi.getAreaTreeList({}).then(res => {
const res = { const areaData = this.convertToVanAreaData(res)
code: 0, this.setData({
message: '', areaList: areaData || []
data: { })
status: 1, })
remark: '客户意向很高,门店运营里有觉得吃力的地方,希望互相搭把手,让门店生意再上一层楼', },
salePotentialCustomerPersonnelInfoDTOList: [{
personnelType: 1, convertToVanAreaData(originalData) {
personnelName: '张三', const result = {
personnelPhone: 1351076958 province_list: {},
}, { city_list: {},
personnelType: 2, county_list: {}
personnelName: '轮胎转化率临近业务兜底指标预警',
personnelPhone: 1351076958
}],
storeType: 1,
visitCount: 5,
provinceName: '广东',
city: '深圳',
districtName: '南山区',
address: '中海康城',
storeName: '杭州旺泽宝华哥桑纳尼汽车销售服务有限公司',
flowSituation: 2,
businessTypeList: [{
businessSceneType: 1
}, {
businessSceneType: 2
}, {
businessSceneType: 3
}, {
businessSceneType: 4
}, {
businessSceneType: 5
}],
brandList: [{
mainBrandId: 2978,
mainBrand: '鸿蒙智行',
subBrandName: '问界',
subBrandId: 3454
}],
expectedOperationDate: '2025-07-23',
cooperationModeList: [{
businessSceneType: 1,
directSalesFlag: 2
}],
districtId: 440305,
storePhoto: `${this.data.IMG_URL}customer/nothing.png`,
} }
function processDistricts(districts, level = 0) {
districts.forEach(item => {
if (item.level === 0) {
// 国家级,处理其子节点(省份)
processDistricts(item.districts, 1)
} else if (item.level === 1) {
// 省份级别
result.province_list[item.code] = item.name
// 处理城市
item.districts.forEach(city => {
if (city.level === 2) {
result.city_list[city.code] = city.name
// 处理区县
city.districts.forEach(county => {
if (county.level === 3) {
result.county_list[county.code] = county.name
} }
// 处理数据 })
this.progressData(res.data) }
return })
CustomerApi.getMaterialData({}).then(res => { }
})
}
processDistricts(originalData.districts)
return result
},
getDetail(par) {
CustomerApi.getCustomerData({id: par.id}).then(res => {
// 处理数据
this.progressData(res)
}) })
}, },
progressData(data) { progressData(data) {
console.log(data) let { baseForm, managerRoles } = this.data
const businessSceneNames = {0: '轻改', 1: '权益', 2: '延保'} data.bizType = data?.businessTypeList?.map(val => { return `${SCENELIST?.find(v => v.value == val).name}` })?.join('/')
data.bizType = data?.businessTypeList?.map(val => { return `${SCENELIST?.find(v => v.value == val.businessSceneType).name}` })?.join('/') data.bizType_value = data?.businessTypeList?.map(val => { return val })
data.bizType_value = data?.businessTypeList?.map(val => { return val.businessSceneType }) data.coopMode = COOPERATIONMODELIST.find(v => v.value == data.cooperationMode).name
data.coopMode = data?.cooperationModeList?.map(val => { return `${businessSceneNames[val.businessSceneType]}${COOPERATIONMODELIST.find(v => v.value == val.directSalesFlag).name}` }).join('/') data.coopMode_value = [data.cooperationMode]
data.coopMode_value = data?.cooperationModeList?.map(val => { return val.directSalesFlag }) data.mainCategory = data?.salePotentialCustomerBrandDTOList?.map(val => {return `${val.mainBrandName}${val.subBrandName}`})?.join('/')
data.mainCategory = data?.brandList?.map(val => {return `${val.mainBrand}${val.subBrandName}`})?.join('/')
let selectedMainBrand = [] let selectedMainBrand = []
data?.brandList?.forEach(val => { data?.salePotentialCustomerBrandDTOList?.forEach(val => {
val.children = [{id: val.subBrandId, name: val.subBrandName}] val.children = [{id: val.subBrandId, name: val.subBrandName}]
val.id = val.mainBrandId val.id = val.mainBrandId
val.name = val.mainBrand val.name = val.mainBrandName
selectedMainBrand.push(val) selectedMainBrand.push(val)
}) })
data.area_value = [data.provinceId, data.cityId, data.districtId]
data.area_name = [data.provinceName, data.city, data.districtName]
data.flowScale = TRSFFICSTATUSLIST?.find(val => val.value == data.flowSituation)?.name data.flowScale = TRSFFICSTATUSLIST?.find(val => val.value == data.flowSituation)?.name
data.flowScale_value = [data.flowSituation] data.flowScale_value = [data.flowSituation]
data.area = `${data.provinceName} ${data.city} ${data.districtName}` data.area = `${data.provinceName} ${data.city} ${data.districtName}`
data.attachmentList = [data.storePhoto] data.attachmentList = data.storePhoto ? [data.storePhoto] : []
managerRoles?.forEach(item => {
const obj = data.salePotentialCustomerPersonnelInfoDTOList?.find(val => val.personnelType == item.value)
item.checked = obj && Object.keys(obj)?.length
item.personnelName = obj?.personnelName || ''
item.personnelPhone = obj?.personnelPhone || ''
})
// 未保存数据,默认将店总选中
if (managerRoles?.findIndex(v => v.checked) < 0) managerRoles[0].checked = true
baseForm?.forEach(val => {
if (val.key == 'storeName' || val.key == 'mainCategory') val.disabled = true
})
this.setData({ this.setData({
infoData: data, infoData: data,
selectedMainBrand, selectedMainBrand,
remarkLength: data.remark?.length remarkLength: data.remark?.length,
baseForm,
managerRoles
}) })
}, },
...@@ -163,10 +168,9 @@ Page({ ...@@ -163,10 +168,9 @@ Page({
}) })
}, },
showPopup(e) { showPopup(e) {
let { type } = e.currentTarget.dataset let { target } = e.currentTarget.dataset
console.log(type) if (!target.callback || target.disabled) return
if (!type) return this[target.callback]()
this[type]()
}, },
// 选择主营品牌 // 选择主营品牌
changemainCategory() { changemainCategory() {
...@@ -187,14 +191,13 @@ Page({ ...@@ -187,14 +191,13 @@ Page({
let arr = [] let arr = []
selected?.forEach(val => { selected?.forEach(val => {
val.children?.forEach(v => { val.children?.forEach(v => {
arr.push(`${val.name}-${v.name}`) arr.push(`${val.name}${v.name}`)
}) })
}) })
this.setData({ this.setData({
'infoData.mainCategory': arr?.join('/'), 'infoData.mainCategory': arr?.join('/'),
selectedMainBrand: selected selectedMainBrand: selected
}) })
console.log(selected)
this.hideBrandPopup() this.hideBrandPopup()
}, },
...@@ -261,7 +264,6 @@ Page({ ...@@ -261,7 +264,6 @@ Page({
areaConfirm(e) { areaConfirm(e) {
const { names, codes } = e.detail const { names, codes } = e.detail
console.log(e.detail)
this.setData({ this.setData({
'infoData.area': names?.join(' '), 'infoData.area': names?.join(' '),
'infoData.area_value': codes, 'infoData.area_value': codes,
...@@ -289,7 +291,6 @@ Page({ ...@@ -289,7 +291,6 @@ Page({
wx.chooseImage({ wx.chooseImage({
count: 1, count: 1,
success(res) { success(res) {
console.log(res)
let [tempFiles] = res.tempFilePaths let [tempFiles] = res.tempFilePaths
let tempFilesList = tempFiles.split('.') let tempFilesList = tempFiles.split('.')
let imgType = tempFilesList[tempFilesList.length - 1] let imgType = tempFilesList[tempFilesList.length - 1]
...@@ -349,9 +350,8 @@ Page({ ...@@ -349,9 +350,8 @@ Page({
wx.navigateBack() wx.navigateBack()
}, },
handleConfirm() { handleConfirm() {
let { infoData, managerRoles } = this.data let { infoData, managerRoles, selectedMainBrand } = this.data
if (!infoData.storeName || !infoData.bizType || !infoData.coopMode || !infoData.mainCategory || !infoData.flowScale || !infoData.area || !infoData.address) return wx.$api.showToast('请填入必填信息') if (!infoData.storeName || !infoData.bizType || !infoData.coopMode || !infoData.mainCategory || !infoData.flowScale || !infoData.area || !infoData.address) return wx.$api.showToast('请填入必填信息')
console.log(managerRoles)
const phoneRex = /^[1]([3-9])[0-9]{9}$/ const phoneRex = /^[1]([3-9])[0-9]{9}$/
for (const item of (managerRoles || [])) { for (const item of (managerRoles || [])) {
if (item.checked && item.personnelPhone) { if (item.checked && item.personnelPhone) {
...@@ -375,8 +375,19 @@ Page({ ...@@ -375,8 +375,19 @@ Page({
// 空值处理函数 // 空值处理函数
const getValue = (value, defaultValue = '') => value ?? defaultValue const getValue = (value, defaultValue = '') => value ?? defaultValue
const brand = []
selectedMainBrand?.forEach(item => {
item.children?.forEach(val => {
brand.push({
mainBrandId: item.id,
mainBrandName: item.name,
subBrandId: val.id,
subBrandName: val.name
})
})
})
let params = { let params = {
id: infoData.id,
storeName: getValue(storeName), storeName: getValue(storeName),
businessTypeList: getValue(bizType_value?.join(',')), businessTypeList: getValue(bizType_value?.join(',')),
cooperationMode: getValue(coopMode_value?.[0]), cooperationMode: getValue(coopMode_value?.[0]),
...@@ -390,19 +401,48 @@ Page({ ...@@ -390,19 +401,48 @@ Page({
address: getValue(address), address: getValue(address),
storePhoto: getValue(attachmentList?.[0]), storePhoto: getValue(attachmentList?.[0]),
remark: getValue(remark), remark: getValue(remark),
alePotentialCustomerPersonnelInfoDTOList: managerRoles salePotentialCustomerPersonnelInfoDTOList: managerRoles
.filter(val => val.checked && (val.personnelName || val.personnelPhone)) .filter(val => val.checked && (val.personnelName || val.personnelPhone))
.map(val => ({ .map(val => ({
personnelName: getValue(val.personnelName), personnelName: getValue(val.personnelName),
personnelPhone: getValue(val.personnelPhone), personnelPhone: getValue(val.personnelPhone),
personnelType: getValue(val.value) personnelType: getValue(val.value)
})) })),
salePotentialCustomerBrandDTOList: brand
} }
console.log(params) if (this.data.confirmFlag) return
this.setData({confirmFlag: true})
wx.$api.showLoading()
const methodName = this.data.pageQuery ? 'editCustomer' : 'addCustomer' const methodName = this.data.pageQuery ? 'editCustomer' : 'addCustomer'
CustomerApi[methodName](params).then(res => { CustomerApi[methodName](params).then(res => {
wx.$api.hideLoading()
this.setData({
confirmFlag: false
})
let { code } = res
const okText = '我知道了'
if (this.resultDialog) {
if (code == 0) {
this.resultDialog.open({
type: 'success',
title: this.data.pageQuery ? '您的潜客信息已完善!' : '您的潜客添加完成!',
description: '',
okText
}) })
} else {
this.resultDialog.open({
type: 'error',
title: '修改失败,请稍后重试',
description: '',
okText
})
}
}
})
},
// 接口请求结果弹窗确认
onDialogOk() {
this.handleCancel()
}, },
onHide() { onHide() {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"usingComponents": { "usingComponents": {
"car-brand": "/components/CarBrand/CarBrand", "car-brand": "/components/CarBrand/CarBrand",
"select-popup": "../../components/SelectPopup/SelectPopup", "select-popup": "../../components/SelectPopup/SelectPopup",
"select-area": "../../components/SelectArea/SelectArea" "select-area": "../../components/SelectArea/SelectArea",
"result-dialog": "../../components/ResultDialog/index"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -67,6 +67,8 @@ ...@@ -67,6 +67,8 @@
.image_content { .image_content {
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
border-radius: 8rpx;
overflow: hidden;
position: relative; position: relative;
.image_box { .image_box {
width: 100%; width: 100%;
...@@ -124,6 +126,7 @@ ...@@ -124,6 +126,7 @@
color: #292D33; color: #292D33;
font-size: 26rpx; font-size: 26rpx;
padding: 0 40rpx; padding: 0 40rpx;
font-weight: 500;
image { image {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
...@@ -160,8 +163,7 @@ ...@@ -160,8 +163,7 @@
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: calc(100% - 64rpx); width: 100%;
height: 88rpx;
line-height: 88rpx; line-height: 88rpx;
text-align: center; text-align: center;
font-size: 32rpx; font-size: 32rpx;
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<navigation-bar showBack="{{true}}" bind:navbarReady="onNavbarReady">{{pageType == 'edit' ? '信息完善' : '新增潜客'}}</navigation-bar> <navigation-bar showBack="{{true}}" bind:navbarReady="onNavbarReady">{{pageType == 'edit' ? '信息完善' : '新增潜客'}}</navigation-bar>
<view class="potential-create" style="padding-top: {{navHeight}}px;"> <view class="potential-create" style="padding-top: {{navHeight}}px;">
<view class="card"> <view class="card">
<view class="section-title">基本信息</view> <view class="section-title">基础信息</view>
<block wx:for="{{baseForm}}" wx:key="index"> <block wx:for="{{baseForm}}" wx:key="index">
<view class="row"> <view class="row">
<view class="label">{{item.label}} <text class="star">*</text></view> <view class="label">{{item.label}} <text class="star">*</text></view>
<view class="value" bindtap="showPopup" data-type="{{item.callback}}"> <view class="value" bindtap="showPopup" data-target="{{item}}">
<block wx:if="{{item.type == 'textarea'}}"> <block wx:if="{{item.type == 'textarea'}}">
<textarea value="{{infoData[item.key]}}" class="textarea" placeholder="请输入" placeholder-class="placeholder-class" auto-height="true" maxlength="{{item.maxLength}}" cursor-spacing="16" bindinput="onInput" data-key="{{item.key}}"/> <textarea value="{{infoData[item.key]}}" class="textarea" placeholder="请输入" placeholder-class="placeholder-class" auto-height="true" maxlength="{{item.maxLength}}" disabled="{{item.disabled}}" cursor-spacing="16" bindinput="onInput" data-key="{{item.key}}"/>
</block> </block>
<block wx:else> <block wx:else>
<block wx:if="{{infoData[item.key]}}"> <block wx:if="{{infoData[item.key]}}">
...@@ -101,4 +101,6 @@ ...@@ -101,4 +101,6 @@
<car-brand id="car-brand" popupShow="{{carBrandPopupShow}}" multiple selectedList="{{selectedMainBrand}}"></car-brand> <car-brand id="car-brand" popupShow="{{carBrandPopupShow}}" multiple selectedList="{{selectedMainBrand}}"></car-brand>
</popup> </popup>
<select-popup show="{{showSelectPopup}}" options="{{selectOptions}}" multiple="{{selectMultiple}}" values="{{selectValues}}" value="{{selectValue}}" bindconfirm="handlePopupConfirm" title="{{selectTitle}}"></select-popup> <select-popup show="{{showSelectPopup}}" options="{{selectOptions}}" multiple="{{selectMultiple}}" values="{{selectValues}}" value="{{selectValue}}" bindconfirm="handlePopupConfirm" title="{{selectTitle}}"></select-popup>
<select-area show="{{showSelectArea}}" bindconfirm="areaConfirm" bindcancel="areaCancel" value="{{infoData.districtId || ''}}"></select-area>
\ No newline at end of file \ No newline at end of file
<select-area show="{{showSelectArea}}" areaList="{{areaList}}" bindconfirm="areaConfirm" bindcancel="areaCancel" value="{{infoData.districtId || ''}}"></select-area>
<!-- 结果弹窗组件:统一反馈弹窗 -->
<result-dialog id="resultDialog" bind:ok="onDialogOk" bind:close="onDialogClose" />
\ No newline at end of file \ No newline at end of file
...@@ -25,6 +25,11 @@ Page({ ...@@ -25,6 +25,11 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
if (options.id) {
this.setData({
potentialCustomerId: options.id
})
}
}, },
onReady() { onReady() {
...@@ -185,10 +190,13 @@ Page({ ...@@ -185,10 +190,13 @@ Page({
async getLocation() { async getLocation() {
try { try {
wx.$api.showLoading()
const loc = await wx.getLocation({ type: "gcj02" }) const loc = await wx.getLocation({ type: "gcj02" })
const { latitude, longitude } = loc const { latitude, longitude } = loc
const res = await mapApi.detailedAdrress([latitude, longitude]) const res = await mapApi.detailedAdrress([latitude, longitude])
const locationName = res?.formatted_addresses || res?.address || "已定位" console.log(res)
const locationName = res?.formatted_address || res?.address || "已定位"
wx.$api.hideLoading()
this.setData({ latitude, longitude, locationName }) this.setData({ latitude, longitude, locationName })
} catch (err) { } catch (err) {
wx.showToast({ title: "定位失败,请检查权限", icon: "none" }) wx.showToast({ title: "定位失败,请检查权限", icon: "none" })
...@@ -204,23 +212,26 @@ Page({ ...@@ -204,23 +212,26 @@ Page({
}, },
handleConfirm() { handleConfirm() {
const { infoData } = this.data const { infoData, potentialCustomerId, locationName } = this.data
if (!infoData.visitTimeText || !infoData.contactName || !infoData.content) return wx.$api.showToast("请输入必填信息") if (!infoData.visitTimeText || !infoData.contactName || !infoData.content) return wx.$api.showToast("请输入必填信息")
let params = { let params = {
potentialCustomerId,
visitTime: infoData.visitTimeText, visitTime: infoData.visitTimeText,
contactPerson: infoData.contactName, contactPerson: infoData.contactName,
visitContent: infoData.content, visitContent: infoData.content,
visitPhotos: infoData.attachmentList || [], visitPhotos: infoData.attachmentList && infoData.attachmentList[0],
checkInLocation: infoData.locationName checkInLocation: locationName
} }
console.log(params, this.resultDialog) if (this.data.confirmFlag) return
// CustomerApi.addVisit(params).then(res => { this.setData({confirmFlag: true})
wx.$api.showLoading()
// }) CustomerApi.addVisit(params).then(res => {
const res = {code: 0} this.setData({confirmFlag: false})
wx.$api.hideLoading()
const okText = '我知道了' const okText = '我知道了'
let { code } = res
if (this.resultDialog) { if (this.resultDialog) {
if (res.code == 0) { if (code == 0) {
this.resultDialog.open({ this.resultDialog.open({
type: 'success', type: 'success',
title: '新增拜访记录成功!', title: '新增拜访记录成功!',
...@@ -236,6 +247,7 @@ Page({ ...@@ -236,6 +247,7 @@ Page({
}) })
} }
} }
})
}, },
// 接口请求结果弹窗确认 // 接口请求结果弹窗确认
......
...@@ -56,6 +56,11 @@ page { ...@@ -56,6 +56,11 @@ page {
align-items: center; align-items: center;
} }
} }
.location-row {
padding: 32rpx 40rpx;
align-items: flex-start;
height: auto;
}
.textarea-wrap { .textarea-wrap {
position: relative; position: relative;
border-bottom: 1rpx solid #EFF0F280; border-bottom: 1rpx solid #EFF0F280;
...@@ -128,8 +133,7 @@ page { ...@@ -128,8 +133,7 @@ page {
position: fixed; position: fixed;
bottom: 16rpx; bottom: 16rpx;
left: 0; left: 0;
width: calc(100% - 64rpx); width: 100%;
height: 88rpx;
line-height: 88rpx; line-height: 88rpx;
text-align: center; text-align: center;
font-size: 32rpx; font-size: 32rpx;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="row no-border"> <view class="row no-border location-row">
<view class="label">拜访签到</view> <view class="label">拜访签到</view>
<view class="value location-value"> <view class="value location-value">
<text wx:if="{{locationName}}" class="value-text">{{locationName}}</text> <text wx:if="{{locationName}}" class="value-text">{{locationName}}</text>
......
...@@ -11,11 +11,11 @@ Page({ ...@@ -11,11 +11,11 @@ Page({
data: { data: {
IMG_URL: IMG_URL, IMG_URL: IMG_URL,
listTabs: ['KPI进度', '经营指标', '门店信息', '资料详情'], listTabs: ['KPI进度', '经营指标', '门店信息', '资料详情'],
tabIndex: 3, tabIndex: 0,
infoDetail: {}, infoDetail: {},
statusText: { statusText: {
1: {label: '老店', color: '#347BFF', background: '#347bff14'}, 1: {label: '新店', color: '#35C376', background: '#35c37614'},
2: {label: '新店', color: '#35C376', background: '#35c37614'} 2: {label: '老店', color: '#347BFF', background: '#347bff14'}
}, },
scrollTop: 0 scrollTop: 0
}, },
...@@ -24,12 +24,16 @@ Page({ ...@@ -24,12 +24,16 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// let { query } = options let { query } = options
// if (query) { if (query) {
// const pageQuery = JSON.parse(decodeURIComponent(query)) const pageQuery = JSON.parse(decodeURIComponent(query))
// this.setData({pageQuery}) this.setData({pageQuery})
// } this.getMerchantDetail(pageQuery)
this.getMerchantDetail() if (pageQuery.currentTab == 2) {
this.setData({tabIndex: 2})
}
this.setData({tabIndex: 2})
}
}, },
/** /**
...@@ -75,7 +79,7 @@ Page({ ...@@ -75,7 +79,7 @@ Page({
const items = [ const items = [
{ label: '主营品牌', value: infoDetail.mainCategory }, { label: '主营品牌', value: infoDetail.mainCategory },
{ label: '合作模式', value: infoDetail.coopMode }, { label: '合作模式', value: infoDetail.coopMode },
{ label: '拜访次数', value: infoDetail.visitCount, highlight: true }, { label: '拜访次数', value: infoDetail.visitCount != null ? `${infoDetail.visitCount}` : '', highlight: true },
{ label: '流量情况', value: infoDetail.flowScale }, { label: '流量情况', value: infoDetail.flowScale },
{ label: '展业时间', value: infoDetail.expectBizTime }, { label: '展业时间', value: infoDetail.expectBizTime },
{ label: '分润规则', value: infoDetail.profitRule }, { label: '分润规则', value: infoDetail.profitRule },
...@@ -84,53 +88,10 @@ Page({ ...@@ -84,53 +88,10 @@ Page({
this.setData({ infoBoardItems: items }) this.setData({ infoBoardItems: items })
}, },
getMerchantDetail() { getMerchantDetail(pageQuery) {
// 假数据 CustomerApi.getMaterialData({id: pageQuery.merchantId}).then(res => {
const res = {
code: 0,
message: '',
data: {
remark: '客户意向很高,门店运营里有觉得吃力的地方,希望互相搭把手,让门店生意再上一层楼',
salePotentialCustomerPersonnelInfoDTOList: [{
personnelType: 1,
personnelName: '张三',
personnelPhone: 1351076958
}, {
personnelType: 2,
personnelName: '轮胎转化率临近业务兜底指标预警',
personnelPhone: 1351076958
}],
storeType: 1,
visitCount: 5,
provinceName: '广东',
city: '深圳',
districtName: '南山区',
address: '中海康城',
storeName: '杭州旺泽宝华哥桑纳尼汽车销售服务有限公司',
flowSituation: 2,
businessTypeList: [{
businessSceneType: 1
}, {
businessSceneType: 2
}],
brandList: [{
mainBrand: '鸿蒙智行',
subBrandName: '问界',
}],
expectedOperationDate: '2025-07-23',
cooperationModeList: [{
businessSceneType: 1,
directSalesFlag: 2
}],
storePhoto: `${this.data.IMG_URL}customer/nothing.png`,
}
}
// 处理数据回显 // 处理数据回显
this.progressData(res.data) this.progressData(res)
return
CustomerApi.getMaterialData({merchantId}).then(res => {
}) })
}, },
...@@ -139,11 +100,19 @@ Page({ ...@@ -139,11 +100,19 @@ Page({
// 主营品牌 // 主营品牌
data.mainCategory = data?.brandList?.map(val => {return `${val.mainBrand}${val.subBrandName}`})?.join('/') data.mainCategory = data?.brandList?.map(val => {return `${val.mainBrand}${val.subBrandName}`})?.join('/')
// 合作模式 // 合作模式
data.coopMode = data?.cooperationModeList?.map(val => { return `${businessSceneNames[val.businessSceneType]}${COOPERATIONMODELIST.find(v => v.value == val.directSalesFlag).name}` }).join('/') data.coopMode = data?.cooperationModeList?.map(val => {
const sceneName = businessSceneNames[val.businessSceneType] || ''
const cooperationItem = COOPERATIONMODELIST.find(v =>
val.directSalesFlag && v.value == val.directSalesFlag
)
const cooperationName = cooperationItem?.name || ''
return `${sceneName}/${cooperationName}`
}).filter(item => item) // 过滤空字符串
.join(',')
// 流量情况 // 流量情况
data.flowScale = TRSFFICSTATUSLIST?.find(val => val.value == data.flowSituation)?.name data.flowScale = data.flowSituation ? TRSFFICSTATUSLIST?.find(val => val.value == data.flowSituation)?.name : ''
// 业务类型 // 业务类型
data.bizType = data?.businessTypeList?.map(val => { return `${SCENELIST?.find(v => v.value == val.businessSceneType).name}` })?.join('/') data.bizType = data?.businessTypeList?.map(val => { return `${SCENELIST?.find(v => v.value == val).name}` })?.join('/')
// 人员类型 // 人员类型
data.salePotentialCustomerPersonnelInfoDTOList?.forEach(val => { data.salePotentialCustomerPersonnelInfoDTOList?.forEach(val => {
val.roleName = ROLELIST?.find(v => v.value == val.personnelType)?.label val.roleName = ROLELIST?.find(v => v.value == val.personnelType)?.label
...@@ -157,6 +126,7 @@ Page({ ...@@ -157,6 +126,7 @@ Page({
}, },
tabClick(e) { tabClick(e) {
console.log(e)
const index = typeof e?.detail === 'number' ? e.detail : 0 const index = typeof e?.detail === 'number' ? e.detail : 0
this.setData({ this.setData({
tabIndex: index, tabIndex: index,
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</view> </view>
<view class="addr-row"> <view class="addr-row">
<image src="{{IMG_URL}}customer/location.png" mode=""/> <image src="{{IMG_URL}}customer/location.png" mode=""/>
<text class="addr-tag">{{infoDetail.provinceName}}{{infoDetail.city}}{{infoDetail.districtName}}{{infoDetail.address}}</text> <text class="addr-tag">{{infoDetail.address}}</text>
</view> </view>
<info-board items="{{infoBoardItems}}" threshold="{{24}}" clampLines="{{1}}" /> <info-board items="{{infoBoardItems}}" threshold="{{24}}" clampLines="{{1}}" />
</view> </view>
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
</view> </view>
<view class="tab-content-box" style="min-height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px);"> <view class="tab-content-box" style="min-height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px);">
<block wx:if="{{tabIndex == 0}}"> <block wx:if="{{tabIndex == 0}}">
<KPI-progress /> <KPI-progress merchantId="{{pageQuery.merchantId}}"/>
</block> </block>
<block wx:elif="{{tabIndex == 1}}"> <block wx:elif="{{tabIndex == 1}}">
<business-analysis /> <business-analysis merchantId="{{pageQuery.merchantId}}"/>
</block> </block>
<block wx:elif="{{tabIndex == 2}}"> <block wx:elif="{{tabIndex == 2}}">
<store-message /> <store-message merchantId="{{pageQuery.merchantId}}"/>
</block> </block>
<block wx:else> <block wx:else>
<material-details detail="{{infoDetail}}"/> <material-details detail="{{infoDetail}}"/>
......
import { IMG_URL, COOPERATIONMODELIST, TRSFFICSTATUSLIST, SCENELIST, ROLELIST } from '~/utils/constantData' import { IMG_URL, COOPERATIONMODELIST, TRSFFICSTATUSLIST, SCENELIST, ROLELIST } from '~/utils/constantData'
import CustomerApi from '~/api/customerApi/index' import CustomerApi from '~/api/customerApi/index'
import { getUserInfo } from '~/utils/cache/userInfo' import { getUserInfo } from '~/utils/cache/userInfo'
import dayjs from 'dayjs'
Page({ Page({
data: { data: {
IMG_URL: IMG_URL, IMG_URL: IMG_URL,
userInfo: getUserInfo(), userInfo: {},
navStyle: 'background: #fff;', navStyle: 'background: #fff;',
showVisitButton: true, showVisitButton: true,
infoBoardItems: [], // 信息看板数据 infoBoardItems: [], // 信息看板数据
...@@ -15,8 +16,8 @@ Page({ ...@@ -15,8 +16,8 @@ Page({
setScrollTop: 0, // scroll-view的滚动位置 setScrollTop: 0, // scroll-view的滚动位置
statusText: { statusText: {
1: {label: '跟进中', color: '#FF9D0A'}, 1: {label: '跟进中', color: '#FF9D0A'},
2: {label: '已签约', color: '#35C376'}, 3: {label: '已签约', color: '#35C376'},
3: {label: '未签约', color: '#F24724'}, 2: {label: '未签约', color: '#F24724'},
4: {label: '已绑定', color: '#347BFF'} 4: {label: '已绑定', color: '#347BFF'}
}, },
visitRecords: [], visitRecords: [],
...@@ -54,6 +55,9 @@ Page({ ...@@ -54,6 +55,9 @@ Page({
const pageQuery = JSON.parse(decodeURIComponent(query)) const pageQuery = JSON.parse(decodeURIComponent(query))
this.setData({pageQuery}) this.setData({pageQuery})
} }
this.setData({
userInfo: getUserInfo()
})
}, },
onShow() { onShow() {
...@@ -61,74 +65,27 @@ Page({ ...@@ -61,74 +65,27 @@ Page({
this.getPotentialDetail() this.getPotentialDetail()
// 初始加载数据 // 初始加载数据
this.resetAndLoad() this.resetAndLoad()
this.measureLayout()
}, },
getPotentialDetail() { getPotentialDetail() {
// 假数据 let { pageQuery } = this.data
const res = { CustomerApi.getCustomerData({id: pageQuery.id}).then(res => {
code: 0, if (res.isBind == 1) res.potentialCustomersStatus = 4
message: '',
data: {
status: 1,
remark: '客户意向很高,门店运营里有觉得吃力的地方,希望互相搭把手,让门店生意再上一层楼',
salePotentialCustomerPersonnelInfoDTOList: [{
personnelType: 1,
personnelName: '张三',
personnelPhone: 1351076958
}, {
personnelType: 2,
personnelName: '轮胎转化率临近业务兜底指标预警',
personnelPhone: 1351076958
}],
storeType: 1,
visitCount: 5,
provinceName: '广东',
city: '深圳',
districtName: '南山区',
address: '中海康城',
storeName: '杭州旺泽宝华哥桑纳尼汽车销售服务有限公司',
flowSituation: 2,
businessTypeList: [{
businessSceneType: 1
}, {
businessSceneType: 2
}, {
businessSceneType: 3
}, {
businessSceneType: 4
}, {
businessSceneType: 5
}],
brandList: [{
mainBrand: '鸿蒙智行',
subBrandName: '问界',
}],
expectedOperationDate: '2025-07-23',
cooperationModeList: [{
businessSceneType: 1,
directSalesFlag: 2
}],
storePhoto: `${this.data.IMG_URL}customer/nothing.png`,
}
}
// 处理数据回显 // 处理数据回显
this.progressData(res.data) this.progressData(res)
return
CustomerApi.getCustomerData({id}).then(res => {
}) })
}, },
progressData(data) { progressData(data) {
const businessSceneNames = {0: '轻改', 1: '权益', 2: '延保'}
// 主营品牌 // 主营品牌
data.mainCategory = data?.brandList?.map(val => {return `${val.mainBrand}${val.subBrandName}`})?.join('/') data.mainCategory = data?.salePotentialCustomerBrandDTOList?.map(val => {return `${val.mainBrandName}${val.subBrandName}`})?.join('/')
// 合作模式 // 合作模式
data.coopMode = data?.cooperationModeList?.map(val => { return `${businessSceneNames[val.businessSceneType]}${COOPERATIONMODELIST.find(v => v.value == val.directSalesFlag).name}` }).join('/') data.coopMode = COOPERATIONMODELIST.find(v => v.value == data.cooperationMode).name
// 流量情况 // 流量情况
data.flowScale = TRSFFICSTATUSLIST?.find(val => val.value == data.flowSituation)?.name data.flowScale = TRSFFICSTATUSLIST?.find(val => val.value == data.flowSituation)?.name
// 业务类型 // 业务类型
data.bizType = data?.businessTypeList?.map(val => { return `${SCENELIST?.find(v => v.value == val.businessSceneType).name}` })?.join('/') data.bizType = data?.businessTypeList?.map(val => { return `${SCENELIST?.find(v => v.value == val).name}` })?.join('/')
// 人员类型 // 人员类型
data.salePotentialCustomerPersonnelInfoDTOList?.forEach(val => { data.salePotentialCustomerPersonnelInfoDTOList?.forEach(val => {
val.roleName = ROLELIST?.find(v => v.value == val.personnelType)?.label val.roleName = ROLELIST?.find(v => v.value == val.personnelType)?.label
...@@ -159,79 +116,26 @@ Page({ ...@@ -159,79 +116,26 @@ Page({
const items = [ const items = [
{ label: '主营品牌', value: infoDetail.mainCategory }, { label: '主营品牌', value: infoDetail.mainCategory },
{ label: '合作模式', value: infoDetail.coopMode }, { label: '合作模式', value: infoDetail.coopMode },
{ label: '拜访次数', value: infoDetail.visitCount, highlight: true }, { label: '拜访次数', value: infoDetail.visitCount != null ? `${infoDetail.visitCount}` : '', highlight: true },
{ label: '流量情况', value: infoDetail.flowScale }, { label: '流量情况', value: infoDetail.flowScale },
[2, 4].includes(infoDetail.status) ? { label: '预计展业时间', value: infoDetail.expectBizTime } : null, // 已签约或已绑定展示 [3, 4].includes(infoDetail.potentialCustomersStatus) ? { label: '预计展业时间', value: dayjs(infoDetail.expectedOperationDate).format('YYYY-MM-DD') } : null, // 已签约或已绑定展示
[2, 4].includes(infoDetail.status) ? { label: '分润规则', value: infoDetail.profitRule } : null, // 已签约或已绑定展示 [3, 4].includes(infoDetail.potentialCustomersStatus) ? { label: '分润规则', value: infoDetail.profitRule } : null, // 已签约或已绑定展示
{ label: '业务类型', value: infoDetail.bizType, span: 2, full: [2, 4].includes(infoDetail.status), clampLines: 1, threshold: 16 }, { label: '业务类型', value: infoDetail.bizType, span: 2, full: [3, 4].includes(infoDetail.potentialCustomersStatus), clampLines: 1, threshold: 16 },
[2, 4].includes(infoDetail.status) ? { label: '上架商品', value: infoDetail.shelfProduct, full: true } : null [3, 4].includes(infoDetail.potentialCustomersStatus) ? { label: '上架商品', value: infoDetail.productShelfInfo, full: true } : null
].filter(Boolean) ].filter(Boolean)
this.setData({ infoBoardItems: items }) this.setData({ infoBoardItems: items })
}, },
// 加载逻辑 // 加载逻辑
resetAndLoad(cb) { resetAndLoad() {
// 假数据 let { pageQuery } = this.data
const res = {code: 0} CustomerApi.getVisitList({id: pageQuery.id}).then(res => {
let { code } = res
const list = this.mockFetch()
if (code == 0) {
this.setData({
visitRecords: list
})
} else {
wx.$api.showToast(message)
}
return
CustomerApi.getVisitList().then(res => {
let { code, data, message } = res
const list = this.mockFetch()
if (code == 0) {
this.setData({ this.setData({
visitRecords: list visitRecords: res || []
}) })
} else {
wx.$api.showToast(message)
}
}) })
}, },
loadMore(cb) {
this.setData({ loading: true })
const { pageNum, pageSize } = this.data
// TODO: 替换为真实接口请求
setTimeout(() => {
const { pageNum, pageSize } = this.data;
const list = this.mockFetch(pageNum, pageSize);
const hasMore = list.length === pageSize && pageNum < 5; // 假设最多 5 页
this.setData({
visitRecords: this.data.visitRecords.concat(list),
pageNum: pageNum + 1,
hasMore,
loading: false
});
cb && cb();
}, 400);
},
// 模拟数据
mockFetch() {
return Array.from({ length: 10 }).map((_, i) => {
const id = i + 1
return {
id,
createdBy: id % 2 ? '张三' : '迪丽热巴·迪力木拉提',
visitTime: `2025-09-2${(id % 10)}`,
contactPerson: id % 3 ? '王总' : '古力娜扎',
visitContent: id % 2 ? '客户意向很高。' : '客户意向很高,门店运营里有觉得吃力的地方,希望互相帮助下,让门店营再上一层楼',
checkInLocation: '广东省深圳市龙岗区中海康城 5 栋 26很长的地址',
visitPhotos: id % 4 ? '' : 'https://dummyimage.com/68x68/eeeeee/999999.png&text=\u25A1'
};
});
},
// 导航栏就绪,按需记录高度(如需吸顶或内容偏移可使用)
navbarReady(e) { navbarReady(e) {
let navBarHeight = e.detail.height let navBarHeight = e.detail.height
this.setData({ this.setData({
...@@ -242,8 +146,7 @@ Page({ ...@@ -242,8 +146,7 @@ Page({
tabClick(e) { tabClick(e) {
const index = typeof e?.detail === 'number' ? e.detail : 0 const index = typeof e?.detail === 'number' ? e.detail : 0
this.setData({ this.setData({
tabIndex: index, tabIndex: index
showVisitButton: index != 1
}) })
this.resetAndLoad() this.resetAndLoad()
wx.nextTick(() => { this.measureLayout() }) wx.nextTick(() => { this.measureLayout() })
...@@ -266,8 +169,9 @@ Page({ ...@@ -266,8 +169,9 @@ Page({
}, },
onCreateVisit() { onCreateVisit() {
let { pageQuery } = this.data
wx.navigateTo({ wx.navigateTo({
url: '/packageCustomer/pages/createVisit/createVisit' url: `/packageCustomer/pages/createVisit/createVisit?id=${pageQuery.id}`
}) })
} }
}); });
\ No newline at end of file \ No newline at end of file
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
<view class="container"> <view class="container">
<view class="card header-card"> <view class="card header-card">
<view class="title-row"> <view class="title-row">
<text class="shop-name">杭州旺泽宝华哥桑纳尼汽车销售服务有限公司</text> <text class="shop-name">{{infoDetail.storeName}}</text>
<text class="status" style="color: {{statusText[detailInfo.status].color}}">{{statusText[detailInfo.status].label}}</text> <text class="status" style="color: {{statusText[infoDetail.potentialCustomersStatus].color}}">{{statusText[infoDetail.potentialCustomersStatus].label}}</text>
</view> </view>
<view class="addr-row"> <view class="addr-row">
<image src="{{IMG_URL}}customer/location.png" mode=""/> <image src="{{IMG_URL}}customer/location.png" mode=""/>
<text class="addr-tag">广东省深圳市龙岗区中海康城 5栋 26F</text> <text class="addr-tag">{{infoDetail.provinceName}}{{infoDetail.city}}{{infoDetail.districtName}}{{infoDetail.address}}</text>
</view> </view>
<info-board items="{{infoBoardItems}}" threshold="{{24}}" clampLines="{{1}}" /> <info-board items="{{infoBoardItems}}" threshold="{{24}}" clampLines="{{1}}" />
<view class="fail-row" wx:if="{{detailInfo.status == 3}}"> <view class="fail-row" wx:if="{{infoDetail.potentialCustomersStatus == 2}}">
<view class="title">战败原因</view> <view class="title">战败原因</view>
<view class="content">{{detailInfo.reason}}</view> <view class="content">{{infoDetail.reason}}</view>
</view> </view>
</view> </view>
<view class="tabbar-anchor" id="tabbarAnchor"> <view class="tabbar-anchor" id="tabbarAnchor">
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<view wx:else class="value">-</view> <view wx:else class="value">-</view>
</block> </block>
<view class="value" wx:else>{{item[i.key]}}</view> <view class="value" wx:else>{{item[i.key] || '-'}}</view>
</view> </view>
</block> </block>
</view> </view>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</view> </view>
</block> </block>
<block wx:else> <block wx:else>
<view class="info-card"> <view class="info-card" style="min-height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px - 24rpx);">
<view id="markDetail"></view> <view id="markDetail"></view>
<material-details detail="{{infoDetail}}"></material-details> <material-details detail="{{infoDetail}}"></material-details>
</view> </view>
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
</view> </view>
</scroll-view> </scroll-view>
<!-- 底部固定操作条:新增拜访 --> <!-- 底部固定操作条:新增拜访 -->
<view class="bottom-bar" wx:if="{{showVisitButton && userInfo.loginRole != 1}}"> <!-- potentialCustomersStatus 4是根据isBind绑定状态方便处理造出来的值 -->
<view class="bottom-bar" wx:if="{{tabIndex != 0 && userInfo.loginRole != 1 && infoDetail.potentialCustomersStatus != 3 && infoDetail.potentialCustomersStatus != 4}}">
<view class="inner safe-area-bottom"> <view class="inner safe-area-bottom">
<view class="btn" bind:tap="onCreateVisit">新增拜访</view> <view class="btn" bind:tap="onCreateVisit">新增拜访</view>
</view> </view>
......
...@@ -154,28 +154,30 @@ Page({ ...@@ -154,28 +154,30 @@ Page({
}, },
handleConfirm() { handleConfirm() {
const { infoData } = this.data const { infoData, pageQuery } = this.data
if (infoData.result == 1) { if (infoData.result == 1) {
if (!infoData.expectTimeText || !infoData.profitRule || !infoData.productInfo ) return wx.$api.showToast('请填入必填信息') if (!infoData.expectTimeText || !infoData.profitRule || !infoData.productInfo ) return wx.$api.showToast('请填入必填信息')
} else { } else {
if (!infoData.failReason) return wx.$api.showToast('请填入必填信息') if (!infoData.failReason) return wx.$api.showToast('请填入必填信息')
} }
const params = { const params = {
id: pageQuery.id,
resultFeedbackStatus: infoData.result, resultFeedbackStatus: infoData.result,
expectedOperationDate: infoData.expectTimeText, expectedOperationDate: infoData.expectTimeText,
profitRule: infoData.profitRule, profitRule: infoData.profitRule,
productShelfInfo: infoData.productInfo, productShelfInfo: infoData.productInfo,
failureReason: infoData.result == 2 ? infoData.failReason : undefined failureReason: infoData.result == 2 ? infoData.failReason : undefined
} }
console.log(params) if (this.data.confirmFlag) return
// CustomerApi.reslutFeedbackApi(params).then(res => { this.setData({confirmFlag: true})
wx.$api.showLoading()
// }) CustomerApi.reslutFeedbackApi(params).then(res => {
// TODO: 接入后端提交接口 wx.$api.hideLoading()
const res = {code: 1} this.setData({confirmFlag: false})
const okText = '我知道了' const okText = '我知道了'
let { code } = res
if (this.resultDialog) { if (this.resultDialog) {
if (res.code == 0) { if (code == 0) {
this.resultDialog.open({ this.resultDialog.open({
type: 'success', type: 'success',
title: '结果反馈成功!', title: '结果反馈成功!',
...@@ -191,6 +193,7 @@ Page({ ...@@ -191,6 +193,7 @@ Page({
}) })
} }
} }
})
}, },
// 接口请求结果弹窗确认 // 接口请求结果弹窗确认
......
...@@ -79,8 +79,7 @@ page { ...@@ -79,8 +79,7 @@ page {
position: fixed; position: fixed;
bottom: 16rpx; bottom: 16rpx;
left: 0; left: 0;
width: calc(100% - 64rpx); width: 100%;
height: 88rpx;
line-height: 88rpx; line-height: 88rpx;
text-align: center; text-align: center;
font-size: 32rpx; font-size: 32rpx;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<view class="label">上架产品信息 <text class="star">*</text></view> <view class="label">上架产品信息 <text class="star">*</text></view>
</view> </view>
<view class="textarea-wrap"> <view class="textarea-wrap">
<textarea class="textarea" maxlength="50" placeholder="请输入" placeholder-class="input-ph" value="{{infoData.productInfo}}" bindinput="onProductInput" /> <textarea class="textarea" maxlength="50" placeholder="请输入" placeholder-class="input-ph" value="{{infoData.productShelfInfo}}" bindinput="onProductInput" />
<view class="counter">{{productLength}}/50</view> <view class="counter">{{productLength}}/50</view>
</view> </view>
</block> </block>
......
// pages/tabWorkOrder/components/OrderScreen/OrderScreen.js // pages/tabWorkOrder/components/OrderScreen/OrderScreen.js
import { IMG_URL, PROVINCES, SCENELIST, COOPERATIONMODELIST, TRSFFICSTATUSLIST } from '~/utils/constantData' import { IMG_URL, SCENELIST, COOPERATIONMODELIST, TRSFFICSTATUSLIST } from '~/utils/constantData'
import CustomerApi from '~/api/customerApi/index' import CustomerApi from '~/api/customerApi/index'
Component({ Component({
...@@ -18,6 +18,8 @@ Component({ ...@@ -18,6 +18,8 @@ Component({
if (userInfo.loginRole == 1) { if (userInfo.loginRole == 1) {
// 总监获取销售人员数据 // 总监获取销售人员数据
this.getSalesList() this.getSalesList()
// 总监获取省份数据
this.getAreaData()
} }
const page = wx.$router.getPageInstance() const page = wx.$router.getPageInstance()
const criteria = (this.data.currentTab === 1 ? page.data?.storeSearchObj : page.data?.searchObj) || {} const criteria = (this.data.currentTab === 1 ? page.data?.storeSearchObj : page.data?.searchObj) || {}
...@@ -53,11 +55,7 @@ Component({ ...@@ -53,11 +55,7 @@ Component({
active: true, active: true,
value: '' value: ''
}, ...TRSFFICSTATUSLIST], }, ...TRSFFICSTATUSLIST],
provinces: [{ provinces: [],
name: '全部',
active: true,
value: ''
}, ...PROVINCES],
salesStaffList: [], salesStaffList: [],
selectedMainBrand: [] selectedMainBrand: []
}, },
...@@ -121,7 +119,6 @@ Component({ ...@@ -121,7 +119,6 @@ Component({
wx.$api.getViewInfo( wx.$api.getViewInfo(
'.btn-box', '.btn-box',
res => { res => {
console.log(res)
this.setData({ this.setData({
height: navBarHeight, height: navBarHeight,
btnHeight: res[0].height btnHeight: res[0].height
...@@ -137,30 +134,44 @@ Component({ ...@@ -137,30 +134,44 @@ Component({
}) })
}, },
getSalesList() { getSalesList() {
// 假数据 CustomerApi.getSalesPersonList({}).then(res => {
const res = { res?.forEach(val => {
code: 0, val.value = val.userId,
message: '', val.staffName = val.userName
data: [{ })
staffName: '张四', res.unshift({
value: 1
}]
}
res.data.unshift({
staffName: '全部', staffName: '全部',
active: true, active: true,
value: '' value: ''
}) })
this.setData({ this.setData({
'form.salesStaffList': res.data || [] 'form.salesStaffList': res
}, () => {
const page = wx.$router.getPageInstance()
const criteria = (this.data.currentTab === 1 ? page.data?.storeSearchObj : page.data?.searchObj) || {}
this.applySelectedCriteria(criteria)
}) })
return
CustomerApi.getSalesPersonList({}).then(res => {
console.log(res)
}) })
}, },
init() { getAreaData() {
CustomerApi.getAreaTreeList({}).then(res => {
const data = res?.districts[0]?.districts
data.unshift({
name: '全部',
active: true,
value: ''
})
data?.forEach(v => {
v.value = v.code
})
this.setData({
'form.provinces': data
}, () => {
const page = wx.$router.getPageInstance()
const criteria = (this.data.currentTab === 1 ? page.data?.storeSearchObj : page.data?.searchObj) || {}
this.applySelectedCriteria(criteria)
})
})
}, },
showMore(e) { showMore(e) {
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
...@@ -210,11 +221,9 @@ Component({ ...@@ -210,11 +221,9 @@ Component({
'form.selectedMainBrand': [], 'form.selectedMainBrand': [],
isReset: true isReset: true
}) })
this.init()
}, },
brandConfirm() { brandConfirm() {
let brandMoudle = this.selectComponent('#car-brand') let brandMoudle = this.selectComponent('#car-brand')
console.log(brandMoudle)
this.setData({ this.setData({
'form.selectedMainBrand': brandMoudle && brandMoudle.handleConfirm() || [] 'form.selectedMainBrand': brandMoudle && brandMoudle.handleConfirm() || []
}) })
...@@ -268,6 +277,5 @@ Component({ ...@@ -268,6 +277,5 @@ Component({
windowWidth windowWidth
}) })
}) })
this.init()
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</view> </view>
<view class="list-box"> <view class="list-box">
<block wx:for="{{form.selectedMainBrand}}" wx:key="index"> <block wx:for="{{form.selectedMainBrand}}" wx:key="index">
<view class="item flex-1 text-center active" data-index="{{index}}">{{ (item.children && item.children[0] && item.children[0].name) || (item.name || '') }}</view> <view class="item flex-1 text-center active" data-index="{{index}}">{{item.name}}{{ (item.children && item.children[0] && item.children[0].name) || (item.name || '') }}</view>
</block> </block>
</view> </view>
</view> </view>
......
...@@ -40,15 +40,14 @@ Component({ ...@@ -40,15 +40,14 @@ Component({
// 保持原有的状态标签映射 // 保持原有的状态标签映射
statusText: { statusText: {
1: { label: '跟进中', color: '#FF9D0A' }, 1: { label: '跟进中', color: '#FF9D0A' },
2: { label: '已签约', color: '#35C376' }, 3: { label: '已签约', color: '#35C376' },
3: { label: '未签约', color: '#F24724' }, 2: { label: '未签约', color: '#F24724' },
4: { label: '已绑定', color: '#347BFF' } 4: { label: '已绑定', color: '#347BFF' }
} }
}, },
lifetimes: { lifetimes: {
attached() { attached() {
this.getPageData()
} }
}, },
...@@ -60,12 +59,11 @@ Component({ ...@@ -60,12 +59,11 @@ Component({
this.resetAndLoad() this.resetAndLoad()
}, },
getParams() { getParams() {
let { boardScopeActive, monthPickerValue, searchObj, statusIndex } = this.data let { boardScopeActive, monthPickerValue, searchObj, statusIndex, userInfo } = this.data
const statusMap = { const statusMap = {
0: 0, // 全部 0: 0, // 全部
1: 1, // 待跟进 1: 1, // 待跟进
2: 3, // 已签约 2: 3, // 已签约
3: 4, // 已绑定
4: 2 // 未签约 4: 2 // 未签约
} }
const obj = { const obj = {
...@@ -79,28 +77,26 @@ Component({ ...@@ -79,28 +77,26 @@ Component({
flowSituation: searchObj?.trafficStatusList?.value, flowSituation: searchObj?.trafficStatusList?.value,
provinceId: searchObj?.provinces?.value, provinceId: searchObj?.provinces?.value,
salesPersonId: searchObj?.salesStaffList?.value, salesPersonId: searchObj?.salesStaffList?.value,
status: statusMap[statusIndex] potentialCustomersStatus: statusIndex == 0 ? undefined : statusMap[statusIndex], // 状态
isBind: statusIndex == 3 ? 1 : undefined, // 是否绑定
isSuperior: userInfo.loginRole != 3 ? 1 : 0,
queryScoure: 3
} }
return obj return obj
}, },
getStatic() { getStatic() {
let params = this.getParams() let params = this.getParams()
delete params.status delete params.potentialCustomersStatus
console.log(params, '111111111') delete params.isBind
// CustomerApi.getPotentialStatic({}).then(res => { wx.$api.showLoading()
CustomerApi.getPotentialStatic(params).then(res => {
// }) wx.$api.hideLoading()
this.setData({ this.setData({
dashboard: { dashboard: res || {}
potentialCustomersCount: 900,
followUpCount: 60,
signedCount: 30,
notSignedCount: 30,
bindCount: 10
}
}, () => { }, () => {
this.recordTabTop() this.recordTabTop()
}) })
})
}, },
recordTabTop() { recordTabTop() {
const query = wx.createSelectorQuery().in(this) const query = wx.createSelectorQuery().in(this)
...@@ -161,14 +157,14 @@ Component({ ...@@ -161,14 +157,14 @@ Component({
}, },
tabClick(e) { tabClick(e) {
const index = typeof e?.detail === 'number' ? e.detail : 0 const index = typeof e?.detail === 'number' ? e.detail : 0
this.setData({ statusIndex: index }, () => { this.setData({ statusIndex: index, copyCustomerList: [] }, () => {
this.resetAndLoad(() => { this.resetAndLoad(() => {
this.triggerEvent('needScrollTop', this.data.initialTabTop) this.triggerEvent('needScrollTop', this.data.initialTabTop)
}) })
}) })
}, },
resetAndLoad(cb) { resetAndLoad(cb) {
this.setData({ currentPage: 1, hasMore: true }) this.setData({ currentPage: 1, hasMore: true, copyCustomerList: [] })
this.loadMore(cb) this.loadMore(cb)
}, },
...@@ -177,56 +173,33 @@ Component({ ...@@ -177,56 +173,33 @@ Component({
}, },
async loadMore(cb) { async loadMore(cb) {
let { hasMore, copyCustomerList } = this.data
if (!hasMore) return
this.setData({ loading: true }) this.setData({ loading: true })
try { try {
const { currentPage, pageSize } = this.data const { currentPage, pageSize } = this.data
const params = this.getParams() const params = this.getParams()
console.log({ const res = await CustomerApi.getPotentialList({ currentPage, pageSize, ...params })
currentPage,
pageSize,
...params
}, '222222222222')
// const res = await mineCustomerApi.getPotentialList({ currentPage, pageSize })
// 假数据
const res = {
list: [{
id: 1
}, {
id: 2
}, {
id: 2
}, {
id: 2
}, {
id: 2
}, {
id: 2
}, {
id: 2
}, {
id: 2
}, {
id: 2
}]
}
res.list?.forEach(val => { res.list?.forEach(val => {
val.status = 1 if (val.isBind == 1) val.potentialCustomersStatus = 4
}) })
const nextList = res?.list || [] const nextList = res?.list || []
const total = res?.total || res?.count || 0 const total = res?.total || res?.count || 0
const pages = res?.pages || (total ? Math.ceil(total / pageSize) : null) const pages = res?.pages || (total ? Math.ceil(total / pageSize) : null)
const hasMore = pages != null ? currentPage < pages : nextList.length === pageSize const hasMore = pages != null ? currentPage < pages : nextList.length === pageSize
const data = copyCustomerList.concat(nextList)
this.setData({ this.setData({
customerList: this.data.customerList.concat(nextList), customerList: data,
copyCustomerList: data,
currentPage: currentPage + 1, currentPage: currentPage + 1,
hasMore, hasMore,
loading: false loading: false
}) })
cb && cb()
} catch (err) { } catch (err) {
console.warn('获取客户列表失败:', err)
this.setData({ loading: false, hasMore: false }) this.setData({ loading: false, hasMore: false })
} }
cb && cb()
}, },
// 新增潜客 // 新增潜客
jump(e) { jump(e) {
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
font-size: 28rpx; font-size: 28rpx;
border-radius: 4rpx; border-radius: 4rpx;
opacity: 1; opacity: 1;
border: 1rpx solid #e0e0e0; border: 1rpx solid #e0e0e080;
box-shadow: 0 0 8rpx 0 #0000000f; box-shadow: 0 0 8rpx 0 #0000000f;
color: #757980; color: #999EA8;
position: relative; position: relative;
image { image {
width: 28rpx; width: 28rpx;
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
/* 列表卡片 */ /* 列表卡片 */
.list-section { .list-section {
box-sizing: border-box;
padding: 24rpx 20rpx 0; padding: 24rpx 20rpx 0;
background: #F7F8FA; background: #F7F8FA;
.list-card { .list-card {
...@@ -136,6 +135,9 @@ ...@@ -136,6 +135,9 @@
justify-content: center; justify-content: center;
} }
} }
.loading {
pointer-events: none;
}
.fixed-btns { .fixed-btns {
position: fixed; position: fixed;
right: 20rpx; right: 20rpx;
......
...@@ -44,43 +44,47 @@ ...@@ -44,43 +44,47 @@
<tab-bar tabList="{{ listTabs }}" bindclick="tabClick" activeIndex="{{ statusIndex }}" /> <tab-bar tabList="{{ listTabs }}" bindclick="tabClick" activeIndex="{{ statusIndex }}" />
</view> </view>
<!-- 列表(潜客) --> <!-- 列表(潜客) -->
<view class="list-section" id="" style="min-height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px - 24rpx - 172rpx);" > <view class="list-section {{loading ? 'loading' : ''}}" id="" style="min-height: calc(100vh - {{tabHeight}}px - {{navBarHeight}}px - 24rpx - 172rpx);" >
<block wx:if="{{customerList.length}}"> <block wx:if="{{customerList.length}}">
<block wx:for="{{customerList}}" wx:key="index"> <block wx:for="{{customerList}}" wx:key="index">
<view class="list-card" bindtap="goDetail" data-item="{{item}}"> <view class="list-card" bindtap="goDetail" data-item="{{item}}">
<view class="card-header"> <view class="card-header">
<view class="title">{{item.shopName || item.merchantName || '-'}} </view> <view class="title">{{item.storeName || '-'}} </view>
<view class="status-tag" style="color: {{statusText[item.status].color}}">{{statusText[item.status].label}}</view> <view class="status-tag" style="color: {{statusText[item.potentialCustomersStatus].color}}">{{statusText[item.potentialCustomersStatus].label}}</view>
</view> </view>
<view class="card-row"> <view class="card-row">
<view class="label">拜访次数</view> <view class="label">拜访次数</view>
<view class="value">{{item.visitCount || item.visitTimes || 0}}次</view> <view class="value">{{item.visitTimes != null ? item.visitTimes : '-'}}次</view>
</view> </view>
<view class="card-row"> <view class="card-row">
<view class="label">跟进人</view> <view class="label">跟进人</view>
<view class="value">{{item.followUser || item.follower || '-'}} </view> <view class="value">{{item.followUpPersonName || '-'}} </view>
</view> </view>
<block wx:if="{{item.status == 2 || item.status == 4}}"> <view class="card-row" wx:if="{{item.potentialCustomersStatus == 1}}">
<view class="label">最后跟进</view>
<view class="value">{{item.lastFollowUpTime || '-'}} </view>
</view>
<block wx:if="{{item.potentialCustomersStatus == 3 || item.potentialCustomersStatus == 4}}">
<view class="card-row" > <view class="card-row" >
<view class="label">预计展业时间</view> <view class="label">预计展业时间</view>
<view class="value">{{item.followUser || item.follower || '-'}} </view> <view class="value">{{item.expectedOperationDate || '-'}} </view>
</view> </view>
<view class="card-row"> <view class="card-row">
<view class="label">分润规则</view> <view class="label">分润规则</view>
<view class="value">{{item.followUser || item.follower || '-'}} </view> <view class="value">{{item.profitRule || '-'}} </view>
</view> </view>
<view class="card-row"> <view class="card-row">
<view class="label">上架产品信息</view> <view class="label">上架产品信息</view>
<view class="value">{{item.followUser || item.follower || '-'}} </view> <view class="value">{{item.productShelfInfo || '-'}} </view>
</view> </view>
</block> </block>
<view class="card-row" wx:if="{{item.status == 3}}"> <view class="card-row" wx:if="{{item.potentialCustomersStatus == 2}}">
<view class="label">战败原因</view> <view class="label">战败原因</view>
<view class="value">{{item.followUser || item.follower || '-'}} </view> <view class="value">{{item.failureReason || '-'}} </view>
</view> </view>
<view class="card-actions" wx:if="{{userInfo.loginRole != 1}}"> <view class="card-actions" wx:if="{{userInfo.loginRole != 1}}">
<view wx:if="{{item.status == 1 || item.status == 2}}" class="btn {{item.status == 1 ? 'ghost' : ''}}" catchtap="jump" data-item="{{item}}">信息完善</view> <view wx:if="{{item.potentialCustomersStatus == 1 || item.potentialCustomersStatus == 3}}" class="btn {{item.potentialCustomersStatus == 1 ? 'ghost' : ''}}" catchtap="jump" data-item="{{item}}">信息完善</view>
<view wx:if="{{item.status == 1}}" class="btn" catchtap="jump" data-item="{{item}}" data-name="resultFeedback">结果反馈</view> <view wx:if="{{item.potentialCustomersStatus == 1}}" class="btn" catchtap="jump" data-item="{{item}}" data-name="resultFeedback">结果反馈</view>
</view> </view>
</view> </view>
</block> </block>
......
...@@ -9,7 +9,8 @@ const __MIN_YM_TS__ = new Date(__NOW__.getFullYear(), __NOW__.getMonth() - 23, 1 ...@@ -9,7 +9,8 @@ const __MIN_YM_TS__ = new Date(__NOW__.getFullYear(), __NOW__.getMonth() - 23, 1
Component({ Component({
properties: { properties: {
navBarHeight: Number, navBarHeight: Number,
searchObj: Object searchObj: Object,
userInfo: Object
}, },
data: { data: {
...@@ -34,13 +35,11 @@ Component({ ...@@ -34,13 +35,11 @@ Component({
loading: false, loading: false,
// 门店状态 TabBar // 门店状态 TabBar
listTabs: ['全部', '新店', '老店'], listTabs: ['全部', '新店', '老店'],
statusIndex: 0, statusIndex: 0
activeStatus: 'all'
}, },
lifetimes: { lifetimes: {
attached() { attached() {
this.getPageData()
} }
}, },
...@@ -52,15 +51,7 @@ Component({ ...@@ -52,15 +51,7 @@ Component({
this.resetAndLoad() this.resetAndLoad()
}, },
getParams() { getParams() {
let { boardScopeActive, monthPickerValue, searchObj, statusIndex } = this.data let { boardScopeActive, monthPickerValue, searchObj, statusIndex, userInfo } = this.data
console.log(searchObj)
const statusMap = {
0: 0, // 全部
1: 1, // 待跟进
2: 3, // 已签约
3: 4, // 已绑定
4: 2 // 未签约
}
const obj = { const obj = {
isAll: boardScopeActive ? 1 : 0, isAll: boardScopeActive ? 1 : 0,
year: boardScopeActive ? undefined : new Date(monthPickerValue).getFullYear(), year: boardScopeActive ? undefined : new Date(monthPickerValue).getFullYear(),
...@@ -72,40 +63,27 @@ Component({ ...@@ -72,40 +63,27 @@ Component({
flowSituation: searchObj?.trafficStatusList?.value, flowSituation: searchObj?.trafficStatusList?.value,
provinceId: searchObj?.provinces?.value, provinceId: searchObj?.provinces?.value,
salesPersonId: searchObj?.salesStaffList?.value, salesPersonId: searchObj?.salesStaffList?.value,
status: statusMap[statusIndex] storeType: statusIndex ? statusIndex : undefined,
isSuperior: userInfo.loginRole != 3 ? 1 : 0
} }
return obj return obj
}, },
getStatic() { getStatic() {
const params = this.getParams() const params = this.getParams()
console.log(params, '11111') wx.$api.showLoading()
// 假数据 CustomerApi.getStoreStatic(params).then(res => {
const res = { wx.$api.hideLoading()
code: 0,
message: '',
data: {
total: 900,
newStore: 60,
oldStore: 30,
notOrdered: 30,
ordered: 10
}
}
this.setData({ this.setData({
dashboard: res.data || {} dashboard: res || {}
}, () => { }, () => {
this.recordTabTop() this.recordTabTop()
}) })
return
CustomerApi.getStoreStatic(params).then(res => {
}) })
}, },
recordTabTop() { recordTabTop() {
const query = wx.createSelectorQuery().in(this) const query = wx.createSelectorQuery().in(this)
query.select('.tabbar-anchor').boundingClientRect() query.select('.tabbar-anchor').boundingClientRect()
query.exec(res => { query.exec(res => {
console.log(res, '1111')
const top = res[0]?.top const top = res[0]?.top
const height = res[0]?.height const height = res[0]?.height
this.setData({ this.setData({
...@@ -155,7 +133,6 @@ Component({ ...@@ -155,7 +133,6 @@ Component({
this.closeMonthPicker() this.closeMonthPicker()
}, },
// 选择变化:严格参照 createVisit(使用 getValues 返回的带单位字符串)
onMonthChange(e) { onMonthChange(e) {
const values = e.detail.getValues() const values = e.detail.getValues()
const year = Number(String(values?.[0] || '').replace(/[年月日时分]/g, '')) const year = Number(String(values?.[0] || '').replace(/[年月日时分]/g, ''))
...@@ -168,8 +145,7 @@ Component({ ...@@ -168,8 +145,7 @@ Component({
// TabBar 点击(门店状态筛选) // TabBar 点击(门店状态筛选)
tabClick(e) { tabClick(e) {
const index = typeof e?.detail === 'number' ? e.detail : 0 const index = typeof e?.detail === 'number' ? e.detail : 0
const statusMap = ['all', 'new', 'old'] this.setData({ statusIndex: index, storeList: [] }, () => {
this.setData({ statusIndex: index, activeStatus: statusMap[index] || 'all' }, () => {
this.resetAndLoad(() => { this.resetAndLoad(() => {
this.triggerEvent('needScrollTop', this.data.initialTabTop) this.triggerEvent('needScrollTop', this.data.initialTabTop)
}) })
...@@ -178,12 +154,11 @@ Component({ ...@@ -178,12 +154,11 @@ Component({
// 列表加载逻辑 // 列表加载逻辑
resetAndLoad(cb) { resetAndLoad(cb) {
this.setData({ currentPage: 1, hasMore: true }) this.setData({ currentPage: 1, hasMore: true, storeList: [] })
this.loadMore(cb) this.loadMore(cb)
}, },
getMore() { getMore() {
console.log(222)
}, },
async loadMore(cb) { async loadMore(cb) {
...@@ -191,23 +166,10 @@ Component({ ...@@ -191,23 +166,10 @@ Component({
try { try {
const { currentPage, pageSize } = this.data const { currentPage, pageSize } = this.data
const params = this.getParams() const params = this.getParams()
console.log({ const res = await CustomerApi.getStorePageList({ currentPage, pageSize, ...params })
currentPage, const nextList = (res.list || []).map(val => {
pageSize, val.salesUser = val.salePersonnelInfoDTOList?.map(v => { return v.personnelName })?.join('/')
...params return val
}, '22222222')
// 暂用同一接口演示门店列表:真实项目可替换为门店专用接口
// const res = await CustomerApi.getStorePageList({ currentPage, pageSize })
// 假数据
const res = {
list: [{
id: 1
}]
}
const nextList = (res?.list || []).map((item, idx) => {
// 演示数据:根据当前门店状态索引打标 new/old(真实项目用后端字段)
const storeStatus = this.data.statusIndex === 1 ? 'new' : (this.data.statusIndex === 2 ? 'old' : (idx % 2 ? 'new' : 'old'))
return { ...item, storeStatus }
}) })
const total = res?.total || res?.count || 0 const total = res?.total || res?.count || 0
const pages = res?.pages || (total ? Math.ceil(total / pageSize) : null) const pages = res?.pages || (total ? Math.ceil(total / pageSize) : null)
...@@ -219,7 +181,6 @@ Component({ ...@@ -219,7 +181,6 @@ Component({
loading: false loading: false
}) })
} catch (err) { } catch (err) {
console.warn('获取门店列表失败:', err)
this.setData({ loading: false, hasMore: false }) this.setData({ loading: false, hasMore: false })
} }
cb && cb() cb && cb()
......
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
font-size: 28rpx; font-size: 28rpx;
border-radius: 4rpx; border-radius: 4rpx;
opacity: 1; opacity: 1;
border: 1rpx solid #e0e0e0; border: 1rpx solid #e0e0e080;
box-shadow: 0 0 8rpx 0 #0000000f; box-shadow: 0 0 8rpx 0 #0000000f;
color: #757980; color: #999EA8;
position: relative; position: relative;
image { image {
width: 28rpx; width: 28rpx;
...@@ -74,7 +74,6 @@ ...@@ -74,7 +74,6 @@
} }
.list-section { .list-section {
box-sizing: border-box;
padding: 24rpx 20rpx 0; padding: 24rpx 20rpx 0;
background: #F7F8FA; background: #F7F8FA;
.list-card { .list-card {
...@@ -113,7 +112,6 @@ ...@@ -113,7 +112,6 @@
} }
.card-row { .card-row {
display: flex; display: flex;
align-items: center;
margin-top: 16rpx; margin-top: 16rpx;
color: #999EA8; color: #999EA8;
font-size: 28rpx; font-size: 28rpx;
......
...@@ -17,23 +17,23 @@ ...@@ -17,23 +17,23 @@
<view class="board-grid"> <view class="board-grid">
<view class="grid-item"> <view class="grid-item">
<view class="label">门店总数</view> <view class="label">门店总数</view>
<view class="value">{{dashboard.total}}</view> <view class="value">{{dashboard.storeCount}}</view>
</view> </view>
<view class="grid-item"> <view class="grid-item">
<view class="label">新店</view> <view class="label">新店</view>
<view class="value">{{dashboard.newStore}}</view> <view class="value">{{dashboard.newStoreCount}}</view>
</view> </view>
<view class="grid-item"> <view class="grid-item">
<view class="label">老店</view> <view class="label">老店</view>
<view class="value">{{dashboard.oldStore}}</view> <view class="value">{{dashboard.oldStoreCount}}</view>
</view> </view>
<view class="grid-item"> <view class="grid-item">
<view class="label">未出单</view> <view class="label">未出单</view>
<view class="value">{{dashboard.notOrdered}}</view> <view class="value">{{dashboard.notSignedCount}}</view>
</view> </view>
<view class="grid-item"> <view class="grid-item">
<view class="label">已出单</view> <view class="label">已出单</view>
<view class="value">{{dashboard.ordered}}</view> <view class="value">{{dashboard.signedCount}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -50,28 +50,28 @@ ...@@ -50,28 +50,28 @@
<block wx:for="{{storeList}}" wx:key="index"> <block wx:for="{{storeList}}" wx:key="index">
<view class="list-card" bindtap="goDetail" data-item="{{item}}"> <view class="list-card" bindtap="goDetail" data-item="{{item}}">
<view class="card-header"> <view class="card-header">
<view class="status-tag {{item.storeStatus == 'new' ? 'new' : 'old'}}">{{ item.storeStatus == 'new' ? '新店' : '老店' }}</view> <view class="status-tag {{item.storeType == 1 ? 'new' : 'old'}}">{{ item.storeType == 1 ? '新店' : '老店' }}</view>
<view class="title">{{item.shopName || item.merchantName || '-'}} </view> <view class="title">{{item.merchantName || '-'}} </view>
</view> </view>
<view class="card-row"> <view class="card-row">
<view class="label">拜访次数</view> <view class="label">拜访次数</view>
<view class="value">{{item.visitCount || item.visitTimes || 0}}次</view> <view class="value">{{item.visitTimes != null ? item.visitTimes : '-'}}次</view>
</view> </view>
<view class="card-row"> <view class="card-row">
<view class="label">销售人员</view> <view class="label">销售人员</view>
<view class="value">{{item.salesUser || item.follower || '-'}} </view> <view class="value">{{item.salesUser || '-'}} </view>
</view> </view>
<view class="card-row"> <view class="card-row">
<view class="label">门店地址</view> <view class="label">门店地址</view>
<view class="value">{{item.address || item.shopAddress || '-'}} </view> <view class="value">{{item.address}}</view>
</view> </view>
<view class="card-row"> <view class="card-row">
<view class="label">签约时间</view> <view class="label">签约时间</view>
<view class="value">{{item.lastFollow || item.lastFollowTime || '-'}} </view> <view class="value">{{item.signedTime || '-'}} </view>
</view> </view>
<view class="card-row"> <view class="card-row">
<view class="label">展业时间</view> <view class="label">展业时间</view>
<view class="value">{{item.bizTime || item.expectBizTime || '-'}} </view> <view class="value">{{item.expectedOperationDate || '-'}} </view>
</view> </view>
</view> </view>
</block> </block>
......
...@@ -4,14 +4,14 @@ import { getUserInfo } from '~/utils/cache/userInfo' ...@@ -4,14 +4,14 @@ import { getUserInfo } from '~/utils/cache/userInfo'
const navStyleTransparent = 'background-color: transparent;' const navStyleTransparent = 'background-color: transparent;'
import reportPageTrackMixin from '~/mixins/reportPageTrackMixin' import reportPageTrackMixin from '~/mixins/reportPageTrackMixin'
Page({ Page({
// behaviors: [reportPageTrackMixin], behaviors: [reportPageTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_URL, IMG_URL,
navStyle: navStyleTransparent, navStyle: navStyleTransparent,
userInfo: getUserInfo(), userInfo: {},
tabList: [{ tabList: [{
id: 1, id: 1,
name: '潜客' name: '潜客'
...@@ -81,9 +81,14 @@ Page({ ...@@ -81,9 +81,14 @@ Page({
}, },
// 总监有查看某个员工的潜客数据,手动触发时,将员工过滤条件清除 // 总监有查看某个员工的潜客数据,手动触发时,将员工过滤条件清除
onTabItemTap(e) { onTabItemTap(e) {
console.log('2222')
// 点击埋点 // 点击埋点
wx.$track.setTrackData(0, 'customer_page', {}, '') wx.$track.setTrackData(0, 'customer_page', {}, '')
// 重新加载数据
this.setData({
myTabIdx: 0
}, () => {
this.onShow()
})
}, },
// 导航栏就绪,记录高度并进行一次测量 // 导航栏就绪,记录高度并进行一次测量
...@@ -106,9 +111,19 @@ Page({ ...@@ -106,9 +111,19 @@ Page({
}) })
}, },
onLoad(options) { onLoad(options) {
this.setData({
userInfo: getUserInfo()
})
}, },
onShow() { onShow() {
// this.onPageShow() let { myTabIdx } = this.data
const component = myTabIdx == 0 ? 'potentialSection' : 'storeSection'
this.setData({
setScrollTop: 0
})
const coms = this.selectComponent(`#${component}`)
if (coms.getPageData) coms.getPageData()
this.onPageShow()
}, },
getMore() { getMore() {
let { myTabIdx } = this.data let { myTabIdx } = this.data
...@@ -128,11 +143,14 @@ Page({ ...@@ -128,11 +143,14 @@ Page({
scrollToListTop(e) { scrollToListTop(e) {
let { scrollTop, navBarHeight, fixedHeight } = this.data let { scrollTop, navBarHeight, fixedHeight } = this.data
if (scrollTop > (e.detail - navBarHeight - fixedHeight)) { wx.nextTick(() => {
if (scrollTop >= (e.detail - navBarHeight - fixedHeight)) {
this.setData({ this.setData({
setScrollTop: e.detail - navBarHeight - fixedHeight setScrollTop: e.detail - navBarHeight - fixedHeight,
scrollTop: e.detail - navBarHeight - fixedHeight
}) })
} }
})
}, },
// 触底加载转发到当前组件 // 触底加载转发到当前组件
...@@ -168,7 +186,7 @@ Page({ ...@@ -168,7 +186,7 @@ Page({
} else if (key === 'selectedMainBrand') { } else if (key === 'selectedMainBrand') {
// 主营品牌为数组;为空不回显 // 主营品牌为数组;为空不回显
text = Array.isArray(val) text = Array.isArray(val)
? val.map(v => (v?.children?.[0]?.name || v?.name || '')) ? val.map(v => (`${v.name}${v?.children?.[0]?.name}`))
.filter(Boolean) .filter(Boolean)
.join('/') .join('/')
: '' : ''
...@@ -185,7 +203,7 @@ Page({ ...@@ -185,7 +203,7 @@ Page({
if (potential) potential.getPageData() if (potential) potential.getPageData()
}) })
} else { } else {
this.setData({ selectedScreenPotential: nextSelected }, () => { this.setData({ selectedScreenStore: nextSelected }, () => {
const storeSection = this.selectComponent('#storeSection') const storeSection = this.selectComponent('#storeSection')
if (storeSection) storeSection.getPageData() if (storeSection) storeSection.getPageData()
}) })
...@@ -205,25 +223,19 @@ Page({ ...@@ -205,25 +223,19 @@ Page({
wx.navigateTo({ url: '/packageCustomer/pages/createPotential/createPotential' }) wx.navigateTo({ url: '/packageCustomer/pages/createPotential/createPotential' })
}, },
// Tab 切换 + 重测量 + 列表刷新
changeMyTab(e) { changeMyTab(e) {
const index = e?.currentTarget?.dataset?.id const index = e?.currentTarget?.dataset?.id
const nextIdx = typeof index === 'number' ? index : 0 const nextIdx = typeof index === 'number' ? index : 0
if (nextIdx === this.data.myTabIdx) return if (nextIdx === this.data.myTabIdx) return
this.setData({ myTabIdx: nextIdx, setScrollTop: 0 }, () => { this.setData({ myTabIdx: nextIdx, setScrollTop: 0 })
if (nextIdx === 0) { const component = nextIdx == 0 ? 'potentialSection' : 'storeSection'
const comp = this.selectComponent('#potentialSection') const coms = this.selectComponent(`#${component}`)
comp && comp.resetAndLoad && comp.resetAndLoad() if (coms.getPageData) coms.getPageData()
} else {
const comp = this.selectComponent('#storeSection')
comp && comp.resetAndLoad && comp.resetAndLoad()
}
})
}, },
onHide() { onHide() {
// this.onPageHide() this.onPageHide()
}, },
onUnload() { onUnload() {
// this.onPageHide() this.onPageHide()
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<view class="bg_iamge"> <view class="bg_iamge">
<glsx-image src="{{'customer/top-bg.png'}}" class="image_class" /> <glsx-image src="{{'customer/top-bg.png'}}" class="image_class" />
</view> </view>
<scroll-view class="layout" style="padding-top: calc({{navBarHeight}}px + 172rpx);" scroll-top="{{setScrollTop}}" scroll-y bindscrolltolower="getMore" bindscroll="onPageScroll"> <scroll-view class="layout" style="padding-top: calc({{navBarHeight}}px + 172rpx);" scroll-top="{{setScrollTop}}" lower-threshold="104" scroll-y bindscrolltolower="getMore" bindscroll="onPageScroll">
<view class="container"> <view class="container">
<block wx:if="{{myTabIdx==0}}"> <block wx:if="{{myTabIdx==0}}">
<potential-section id="potentialSection" <potential-section id="potentialSection"
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
showAddIcon="{{showAddIcon}}" showAddIcon="{{showAddIcon}}"
navBarHeight="{{navBarHeight}}" navBarHeight="{{navBarHeight}}"
searchObj="{{storeSearchObj}}" searchObj="{{storeSearchObj}}"
userInfo="{{userInfo}}"
/> />
</block> </block>
</view> </view>
......
...@@ -27,43 +27,6 @@ export const IMG_VERSION = () => { ...@@ -27,43 +27,6 @@ export const IMG_VERSION = () => {
return accountInfo.miniProgram.version || '1.0.0' return accountInfo.miniProgram.version || '1.0.0'
} }
export const PROVINCES = [
{ value: '110000', name: '北京市' },
{ value: '120000', name: '天津市' },
{ value: '130000', name: '河北省' },
{ value: '140000', name: '山西省' },
{ value: '150000', name: '内蒙古自治区' },
{ value: '210000', name: '辽宁省' },
{ value: '220000', name: '吉林省' },
{ value: '230000', name: '黑龙江省' },
{ value: '310000', name: '上海市' },
{ value: '320000', name: '江苏省' },
{ value: '330000', name: '浙江省' },
{ value: '340000', name: '安徽省' },
{ value: '350000', name: '福建省' },
{ value: '360000', name: '江西省' },
{ value: '370000', name: '山东省' },
{ value: '410000', name: '河南省' },
{ value: '420000', name: '湖北省' },
{ value: '430000', name: '湖南省' },
{ value: '440000', name: '广东省' },
{ value: '450000', name: '广西壮族自治区' },
{ value: '460000', name: '海南省' },
{ value: '500000', name: '重庆市' },
{ value: '510000', name: '四川省' },
{ value: '520000', name: '贵州省' },
{ value: '530000', name: '云南省' },
{ value: '540000', name: '西藏自治区' },
{ value: '610000', name: '陕西省' },
{ value: '620000', name: '甘肃省' },
{ value: '630000', name: '青海省' },
{ value: '640000', name: '宁夏回族自治区' },
{ value: '650000', name: '新疆维吾尔自治区' },
{ value: '710000', name: '台湾省' },
{ value: '810000', name: '香港特别行政区' },
{ value: '820000', name: '澳门特别行政区' }
]
export const COOPERATIONMODELIST = [{ export const COOPERATIONMODELIST = [{
name: '直营', name: '直营',
value: 1 value: 1
......
...@@ -117,25 +117,30 @@ const domain = { ...@@ -117,25 +117,30 @@ const domain = {
ip: { ip: {
// dj: 'http://192.168.1.165:8292', // dj: 'http://192.168.1.165:8292',
dj: 'http://192.168.1.150:8293', dj: 'http://192.168.1.150:8293',
scrm: 'https://scrm.dev.glsx.com.cn' scrm: 'https://scrm.dev.glsx.com.cn',
merchant: 'http://192.168.1.144:8091'
// dj: 'http://192.168.3.189:8385', // dj: 'http://192.168.3.189:8385',
// scrm: 'http://192.168.1.165:8292' // scrm: 'http://192.168.1.165:8292'
}, },
dev: { dev: {
dj: 'http://192.168.3.189:8385', dj: 'http://192.168.3.189:8385',
scrm: 'https://scrm.dev.glsx.com.cn' scrm: 'https://scrm.dev.glsx.com.cn',
merchant: 'http://192.168.1.144:8091'
}, },
uat: { uat: {
dj: 'https://dj.test.glsx.com.cn', dj: 'https://dj.test.glsx.com.cn',
scrm: 'https://scrm.test.glsx.com.cn' scrm: 'https://scrm.test.glsx.com.cn',
merchant: 'https://glsx-bi-report.test.glsx.com.cn'
}, },
prod: { prod: {
dj: 'https://dj.glsx.com.cn', dj: 'https://dj.glsx.com.cn',
scrm: 'https://scrm.glsx.com.cn' scrm: 'https://scrm.glsx.com.cn',
merchant: 'https://glsx-bi-report.glsx.com.cn'
}, },
preRelease: { preRelease: {
dj: 'https://dj.beta.glsx.com.cn', dj: 'https://dj.beta.glsx.com.cn',
scrm: 'https://scrm.beta.glsx.com.cn' scrm: 'https://scrm.beta.glsx.com.cn',
merchant: 'https://glsx-bi-report.beta.glsx.com.cn'
} }
}[target[index]] }[target[index]]
......
...@@ -3,14 +3,20 @@ import { getSessionId } from '~/utils/cache/storageApi' ...@@ -3,14 +3,20 @@ import { getSessionId } from '~/utils/cache/storageApi'
import network from '~/utils/network' import network from '~/utils/network'
/**接口 */ /**接口 */
class Request { class Request {
get(params, returnAll = false, requestPath) { get(params, returnAll = false, requestPath, customeUrl) {
return this.request('GET', params, returnAll, requestPath) return this.request('GET', params, returnAll, requestPath, customeUrl)
} }
post(params, returnAll = false, requestPath) { post(params, returnAll = false, requestPath) {
// console.log(requestPath, 'requestPath') // console.log(requestPath, 'requestPath')
return this.request('POST', params, returnAll, requestPath) return this.request('POST', params, returnAll, requestPath)
} }
async request(RequestMethods, params, returnAll, requestPath = 'dj') { async request(
RequestMethods,
params,
returnAll,
requestPath = 'dj',
customeUrl
) {
const type = await network.getNetworkType() const type = await network.getNetworkType()
if (type == 'none') return if (type == 'none') return
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -33,9 +39,10 @@ class Request { ...@@ -33,9 +39,10 @@ class Request {
: `/rop-scrm-${projectName}/` : `/rop-scrm-${projectName}/`
} }
params = this.getData(params, requestPath) params = this.getData(params, requestPath)
// console.log(params.method,'params');
wx.request({ wx.request({
url: `${domain[requestPath]}${path}router?method=${params.method}`, url: customeUrl
? `${domain[requestPath]}${customeUrl}`
: `${domain[requestPath]}${path}router?method=${params.method}`,
data: params, data: params,
method: RequestMethods, method: RequestMethods,
header, header,
......
...@@ -132,12 +132,12 @@ class TRACK { ...@@ -132,12 +132,12 @@ class TRACK {
setTrackData(eventType, eventCode = '', businessParam = '', batchId, scene) { setTrackData(eventType, eventCode = '', businessParam = '', batchId, scene) {
// console.log(eventCode, 'eventCode'); // console.log(eventCode, 'eventCode');
let recordList = $Storage.get('recordList'), let recordList = $Storage.get('recordList'),
{ route } = this.getPageInstance(), { route } = this.getPageInstance?.() || {},
prePagePath = this.getPageInstance(2), prePagePath = this.getPageInstance(2),
userInfo = getUserInfo(), userInfo = getUserInfo(),
item = { item = {
loginAccount: userInfo.name, loginAccount: userInfo?.name,
uuid: userInfo.uuid, uuid: userInfo?.uuid,
systemSource: 5, systemSource: 5,
eventTime: new Date().format('yyyy-MM-dd hh:mm:ss'), eventTime: new Date().format('yyyy-MM-dd hh:mm:ss'),
eventType, eventType,
...@@ -179,7 +179,7 @@ class TRACK { ...@@ -179,7 +179,7 @@ class TRACK {
apiProjectName: 'clue', apiProjectName: 'clue',
recordList recordList
}, },
'', true,
'scrm' 'scrm'
) )
.then(({ code, data, message }) => { .then(({ code, data, message }) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!