Commit a7849ff0 by 李伟康

提交客户线索

1 parent e43a80ed
...@@ -82,5 +82,11 @@ export default { ...@@ -82,5 +82,11 @@ export default {
/** 查询客户画像 */ /** 查询客户画像 */
portraitQuery(data) { portraitQuery(data) {
return api.post('dj.api.smartcarlife.customer.portrait.query', data) return api.post('dj.api.smartcarlife.customer.portrait.query', data)
} },
/**
* 客户线索状态统计
*/
getCustomerClueStatistics(data) {
return api.post('dj.api.smartcarlife.customer.clue.statistics.status', data)
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -568,9 +568,13 @@ Page({ ...@@ -568,9 +568,13 @@ Page({
back() { back() {
console.log('back') console.log('back')
let { let {
step step,
isClue
} = this.data } = this.data
console.log('step', step) console.log('step', step)
if(isClue) return wx.$router.back(pre =>{
pre.onLoad()
})
if (step == 'first') { if (step == 'first') {
wx.$router.reLaunch('packageEquity.equityPage') wx.$router.reLaunch('packageEquity.equityPage')
} else { } else {
...@@ -594,7 +598,8 @@ Page({ ...@@ -594,7 +598,8 @@ Page({
totalFee, totalFee,
accountDate, accountDate,
id, id,
resetOrder resetOrder,
isClue
} = options } = options
// outTradeNo // outTradeNo
if (outTradeNo) { if (outTradeNo) {
...@@ -614,6 +619,7 @@ Page({ ...@@ -614,6 +619,7 @@ Page({
} else { } else {
this.getQuotationInfo() this.getQuotationInfo()
} }
this.setData({isClue})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
......
// packageEquity/pages/clueDetail/clueDetail.js // packageEquity/pages/clueDetail/clueDetail.js
import carLifeApi from '../../carEquityApi' import carLifeApi from '../../carEquityApi'
import CONSTANTDATA from './data' import CONSTANTDATA from './data'
Page({ import itemMixin from '../clueList/components/itemMixins'
Page({
behaviors: [itemMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
flag: true,
customerObj: [{ customerObj: [{
label: '客户姓名', label: '客户姓名',
key: 'customerName' key: 'customerName'
...@@ -105,6 +106,7 @@ Page({ ...@@ -105,6 +106,7 @@ Page({
}) })
}, },
async getCustomerClueDetail(id) { async getCustomerClueDetail(id) {
wx.$util.showLoading()
try { try {
const { const {
sceneType, sceneType,
...@@ -119,25 +121,32 @@ Page({ ...@@ -119,25 +121,32 @@ Page({
merchantId: [merchantId] merchantId: [merchantId]
}) })
if (code == 0) { if (code == 0) {
wx.hideLoading()
if (data.records && data.records.length) { if (data.records && data.records.length) {
data.records.map(e => { data.records.map(e => {
let updatedDate = new Date(e.updatedDate) let createdDate = new Date(e.createdDate)
e.year = updatedDate.format('yyyy-MM-dd') e.year = createdDate.format('yyyy-MM-dd')
e.time = updatedDate.format('hh:mm:ss') e.time = createdDate.format('hh:mm:ss')
// 格式化跟进时间
let time = e.inviteDate
e.inviteDate = time ? `「${new Date(e.inviteDate).format('MM-dd hh:mm')}」` : ''
}) })
} }
const TimeFormat = 'yyyy.MM.dd hh:mm:ss'
data.boutiqueOrders.map(e => {
e.orderTime = new Date(e.orderTime).format(TimeFormat)
if (e.payOrder && e.payOrder.successDate) e.successDate = new Date(e.payOrder.successDate).format(TimeFormat)
})
data.vqOrders.map(e => {
if(e.payTime) e.payTime = new Date(e.payTime).format(TimeFormat)
})
// 用户画像 // 用户画像
this.dealPortrait(data.customerInfo.id) this.dealPortrait(data.customerInfo.id)
this.setData({ this.setData({
detail: data detail: data,
flag: true
}) })
} else throw message } else throw message
} catch (error) { } catch (error) {
wx.hideLoading()
if (error) wx.$util.showToast(error) if (error) wx.$util.showToast(error)
} }
}, },
...@@ -169,7 +178,7 @@ Page({ ...@@ -169,7 +178,7 @@ Page({
} }
}) })
this.setData({ this.setData({
['detail.userPortrait']: _userPortrait ['detail.customerInfo.userPortrait']: _userPortrait
}) })
}, },
/** /**
...@@ -184,7 +193,14 @@ Page({ ...@@ -184,7 +193,14 @@ Page({
}, },
editProtrait(e) { editProtrait(e) {
wx.$util.pointRecord(24) wx.$util.pointRecord(24)
wx.$router.go('tabDate.userPortrait', this.data.detail) const {
customerInfo,
portraitCustomerId
} = this.data.detail
wx.$router.go('tabDate.userPortrait', {
customer: customerInfo,
customerId: portraitCustomerId
})
}, },
onReady() { onReady() {
......
{ {
"usingComponents": { "usingComponents": {
"order-item":"./components/OrderItem/OrderItem" "order-item":"./components/OrderItem/OrderItem",
"equity-order-item":"./components/EquityOrderItem/EquityOrderItem"
}, },
"navigationBarTitleText": "客户详情" "navigationBarTitleText": "客户详情"
} }
\ No newline at end of file \ No newline at end of file
...@@ -57,17 +57,21 @@ ...@@ -57,17 +57,21 @@
<view class="title">订单信息</view> <view class="title">订单信息</view>
<view class="sub-title"> <view class="sub-title">
精品加装 精品加装
<view class="status">已加装</view> <view class="status">{{statusEnum[detail.sceneTypeStatusMap[1]]}}</view>
</view> </view>
<block wx:for="{{2}}" wx:key="index"> <block wx:if="{{detail.boutiqueOrders.length}}">
<order-item num="{{index}}"></order-item> <block wx:for="{{detail.boutiqueOrders}}" wx:key="index">
<order-item num="{{index}}" item="{{item}}"></order-item>
</block>
</block> </block>
<view class="sub-title equity-title"> <view class="sub-title equity-title">
权益服务 权益服务
<view class="status">已加装</view> <view class="status">{{statusEnum[detail.sceneTypeStatusMap[0]]}}</view>
</view> </view>
<block wx:for="{{2}}" wx:key="index"> <block wx:if="{{detail.vqOrders.length}}">
<order-item num="{{index}}"></order-item> <block wx:for="{{detail.vqOrders}}" wx:key="index">
<equity-order-item num="{{index}}" item="{{item}}"></equity-order-item>
</block>
</block> </block>
</view> </view>
<view class="box"> <view class="box">
......
// packageEquity/pages/clueDetail/components/OrderItem/OrderItem.js
Component({
/**
* 组件的属性列表
*/
properties: {
num: Number,
item: Object
},
/**
* 组件的初始数据
*/
data: {
orderObj: [{
label: '升级总价',
key: 'quotedPriceUpdate',
unit:'¥'
},
{
label: '转化人员',
key: 'transferName'
},
{
label: '工单编号',
key: 'payId'
},
{
label: '工单时间',
key: 'payTime'
},
],
//服务状态(0待报价、1待确认、2待支付、3已支付、4权益提单已完成、5已完成、-1战败)
orderStatusEnum:{
0:'待报价',
1:'待确认',
2:'待支付',
3:'已支付',
4:'权益提单已完成',
5:'完成',
'-1':'战败',
9:'已撤销',
11:'错误订单',
}
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/clueDetail/components/OrderItem/OrderItem.wxss */
.flex {
display: flex;
align-items: center;
}
.order-item {
background: #F7F8FA;
border-radius: 12rpx;
margin-top: 20rpx;
padding: 24rpx 32rpx 8rpx;
.order-title {
font-weight: 500;
font-size: 28rpx;
color: #292D33;
.status {
margin-left: 20rpx;
}
}
.goods-box {
padding: 24rpx 0 8rpx;
font-size: 28rpx;
color: #292D33;
.goods-item {
margin-bottom: 16rpx;
&::before {
width: 12rpx;
height: 12rpx;
background: #347BFF;
border-radius: 100%;
content: '';
display: block;
margin-right: 16rpx;
flex-shrink: 0;
}
.price {
margin-left: auto;
flex-shrink: 0;
color: #6C6C70;
}
}
}
.item {
font-size: 28rpx;
color: #999EA8;
margin-bottom: 16rpx;
.label{
flex-shrink: 0;
margin-right: 40rpx;
}
.value{
color: #292D33;
}
.price {
color: #347BFF;
}
}
}
\ No newline at end of file \ No newline at end of file
<view class="order-item">
<view class="order-title flex">
订单{{num + 1}}
<view class="status">{{orderStatusEnum[item.orderStatus]}}</view>
</view>
<block wx:if="{{item.vdQuotationGoodsList.length}}">
<view class="goods-box">
<block wx:for="{{item.vdQuotationGoodsList}}" wx:key="index" wx:for-item="i">
<view class="goods-item flex">
{{i.goodsName}}
<view class="price">¥{{i.goodsPrice}}</view>
</view>
</block>
</view>
</block>
<block wx:for="{{orderObj}}" wx:key="index" wx:for-item="i">
<block wx:if="{{item[i.key]}}">
<view class="item flex">
<view class="label">{{i.label}}</view>
<view class="value {{i.key == 'quotedPriceUpdate'?'price':''}}">
<block wx:if="{{i.key == 'transferName'}}">
{{item.merchantName}} | {{item.transferName}}
</block>
<block wx:else>
{{i.unit||''}}{{item[i.key] || ''}}
</block>
</view>
</view>
</block>
</block>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -5,35 +5,47 @@ Component({ ...@@ -5,35 +5,47 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
num: Number num: Number,
item: Object
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
orderObj:[ orderObj: [{
{ label: '升级总价',
label:'升级总价', key: 'totalPrice',
key:'' unit:'¥'
}, },
{ {
label:'转化人员', label: '转化人员',
key:'' key: 'sellerName'
}, },
{ {
label:'工单编号', label: '工单编号',
key:'' key: 'orderCode'
}, },
{ {
label:'工单时间', label: '工单时间',
key:'' key: 'orderTime'
}, },
{ {
label:'支付时间', label: '支付时间',
key:'' key: 'successDate'
} }
] ],
status:{
1:'待跟进',
2:'战败',
3:'待支付',
4:'已支付',
6:'已评价',
9:'已撤销',
10:'已关闭',
11:'已失效',
12:'已退款',
}
}, },
/** /**
......
...@@ -52,10 +52,14 @@ ...@@ -52,10 +52,14 @@
color: #999EA8; color: #999EA8;
margin-bottom: 16rpx; margin-bottom: 16rpx;
.label{ .label{
flex-shrink: 0;
margin-right: 40rpx; margin-right: 40rpx;
} }
.value{ .value{
color: #292D33; color: #292D33;
} }
.price {
color: #347BFF;
}
} }
} }
\ No newline at end of file \ No newline at end of file
<view class="order-item"> <view class="order-item">
<view class="order-title flex"> <view class="order-title flex">
订单{{num + 1}} 订单{{num + 1}}
<view class="status">已解决</view> <view class="status">{{status[item.status]}}</view>
</view> </view>
<view class="goods-box"> <block wx:if="{{item.subOrderList.length}}">
<block wx:for="{{3}}" wx:key="index"> <view class="goods-box">
<view class="goods-item flex"> <block wx:for="{{item.subOrderList}}" wx:key="index" wx:for-item="i">
哈哈哈 <view class="goods-item flex">
<view class="price">¥100.00</view> {{i.upgradeGoodsName}}
<view class="price">¥{{i.totalPrice}}</view>
</view>
</block>
</view>
</block>
<block wx:for="{{orderObj}}" wx:key="index" wx:for-item="i">
<block wx:if="{{item[i.key]}}">
<view class="item flex">
<view class="label">{{i.label}}</view>
<view class="value {{i.key == 'totalPrice'?'price':''}}">
<block wx:if="{{i.key == 'transferName'}}">
{{item.merchantName}} | {{item.transferName}}
</block>
<block wx:else>
{{i.unit||''}}{{item[i.key] || ''}}
</block>
</view>
</view> </view>
</block> </block>
</view>
<block wx:for="{{orderObj}}" wx:key="index">
<view class="item flex">
<view class="label">{{item.label}}</view>
<view class="value {{item.key == 'price'?'price':''}}">{{info[item.key] || ''}}</view>
</view>
</block> </block>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -9,20 +9,26 @@ Page({ ...@@ -9,20 +9,26 @@ Page({
pageNum: 1, pageNum: 1,
search: '', search: '',
list: [], list: [],
customerTips: '今日新增0客户',
tabList: [{ tabList: [{
text: '全部', text: '全部',
count: 0 count: 0,
key: 'total'
}, { }, {
text: '待跟进', text: '待跟进',
count: 0 count: 0,
key: 'waitFollow'
}, },
{ {
text: '已升级', text: '已升级',
count: 0 count: 0,
key: 'upgrade'
}, },
{ {
text: '战败', text: '战败',
count: 0 count: 0,
key: 'defeat'
} }
], ],
}, },
...@@ -45,7 +51,9 @@ Page({ ...@@ -45,7 +51,9 @@ Page({
search() { search() {
this.setData({ this.setData({
pageNum: 1, pageNum: 1,
list: [] list: [],
flag: false,
nothing: false
}) })
this.getCustomerClueList() this.getCustomerClueList()
}, },
...@@ -72,19 +80,47 @@ Page({ ...@@ -72,19 +80,47 @@ Page({
merchantId: [merchantId] merchantId: [merchantId]
} }
if (status !== null) params.status = status if (status !== null) params.status = status
wx.$util.showLoading()
const { const {
code, code,
data, data,
message message
} = await carLifeApi.getCustomerClueList(params) } = await carLifeApi.getCustomerClueList(params)
if (code == 0) { if (code == 0) {
wx.hideLoading()
data.list.map(e => {
let goodsList = [],
totalPrice = 0
if (sceneType == 1) {
e.vqOrders?.map(i => {
totalPrice = totalPrice + i.quotedPriceUpdate
i.vdQuotationGoodsList?.map(x => {
goodsList.push(x)
})
})
} else {
e.boutiqueOrders?.map(i => {
totalPrice = totalPrice + i.totalPrice
i.subOrderList?.map(x => {
goodsList.push(x)
})
})
}
e.goodsList = goodsList
e.totalPrice = totalPrice
})
list.push(data.list) list.push(data.list)
this.setData({ this.setData({
list, list,
total: data.total total: data.total,
flag: true
}) })
} else throw message } else throw message
} catch (error) { } catch (error) {
wx.hideLoading()
this.setData({
flag: true
})
console.log(error) console.log(error)
wx.$util.showToast(error) wx.$util.showToast(error)
} }
...@@ -92,11 +128,40 @@ Page({ ...@@ -92,11 +128,40 @@ Page({
async getCustomerClueTodayCount() { async getCustomerClueTodayCount() {
const { const {
sceneType, sceneType,
} = this.data, } = this.data, {
res = await carLifeApi.getCustomerClueTodayCount({ shopMerchantId: merchantId
sceneType } = wx.$util.getUserInfo(), {
data
} = await carLifeApi.getCustomerClueTodayCount({
sceneType,
merchantId: [merchantId]
})
if (data) this.setData({
customerTips: data
})
},
async getCustomerClueStatistics() {
const {
sceneType,
tabList
} = this.data, {
shopMerchantId: merchantId
} = wx.$util.getUserInfo(), {
data
} = await carLifeApi.getCustomerClueStatistics({
sceneType,
merchantId: [merchantId]
})
if (data) {
tabList.map(e => {
Object.keys(data).map(key => {
if (key == e.key) e.count = data[key]
})
}) })
console.log(res) this.setData({
tabList
})
}
}, },
input(e) { input(e) {
let { let {
...@@ -123,7 +188,7 @@ Page({ ...@@ -123,7 +188,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.getCustomerClueStatistics()
}, },
/** /**
......
...@@ -13,18 +13,22 @@ ...@@ -13,18 +13,22 @@
</view> </view>
<tab-bar tabList="{{tabList}}" bindclick="tabClick" /> <tab-bar tabList="{{tabList}}" bindclick="tabClick" />
</view> </view>
<view class="tips">今日新增客户·{{customerCount || 0}}</view> <view class="tips">{{customerTips}}</view>
<view class="content"> <view class="content">
<block wx:for="{{list}}" wx:key="index"> <block wx:if="{{flag}}">
<block wx:for="{{item}}" wx:key="ind" wx:for-item="i" wx:for-index="ind"> <block wx:for="{{list}}" wx:key="index">
<block wx:if="{{sceneType == 1}}"> <block wx:for="{{item}}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<upgrade-item data="{{i}}"></upgrade-item> <block wx:if="{{sceneType == 1}}">
</block> <upgrade-item data="{{i}}"></upgrade-item>
<block wx:else> </block>
<equity-item data="{{i}}"></equity-item> <block wx:else>
<equity-item data="{{i}}"></equity-item>
</block>
</block> </block>
</block> </block>
<block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view>
</block>
</block> </block>
<view class="list-nothing">到底了~</view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -36,11 +36,10 @@ Component({ ...@@ -36,11 +36,10 @@ Component({
}) })
}, },
jump() { jump() {
const { const [{id}] = this.data.data.vqOrders
id
} = this.data.data
wx.$router.go('createOrderCarQuotationSimple', { wx.$router.go('createOrderCarQuotationSimple', {
id id,
isClue: true
}) })
} }
} }
......
...@@ -119,9 +119,12 @@ ...@@ -119,9 +119,12 @@
.price { .price {
color: #6C6C70; color: #6C6C70;
margin-left: auto; margin-left: auto;
flex-shrink: 0;
} }
} }
.clear-margin{
margin-bottom: 0;
}
.show-all { .show-all {
font-size: 24rpx; font-size: 24rpx;
color: #347BFF; color: #347BFF;
......
<view class="item" bindtap="jumpDetail"> <view class="item" bindtap="jumpDetail">
<view class="status status-{{data.status}}">{{statusEnum[data.status]}}</view> <view class="status status-{{data.status}}">{{statusEnum[data.status]}}</view>
<view class="top flex"> <view class="top flex">
<view class="icon"> <view class="icon">
...@@ -42,31 +42,33 @@ ...@@ -42,31 +42,33 @@
</view> </view>
</block> </block>
</view> </view>
<view class="package-box"> <block wx:if="{{data.goodsList.length}}">
<block wx:for="{{package}}" wx:key="index"> <view class="package-box">
<block wx:if="{{index < 2 || showAll}}"> <block wx:for="{{data.goodsList}}" wx:key="index">
<view class="package-item flex"> <block wx:if="{{index < 2 || showAll}}">
哈哈哈 <view class="package-item flex {{data.goodsList.length == 1 ? 'clear-margin':'' }} {{data.goodsList.length == 2 && index == 1?'clear-margin':''}}">
<view class="price">¥1000.00</view> {{item.upgradeGoodsName}}
<view class="price">¥{{item.totalPrice}}</view>
</view>
</block>
</block>
<block wx:if="{{data.goodsList.length > 2}}">
<view class="show-all" catchtap="showAllFun">
<block wx:if="{{!showAll}}">
查看全部<text>(共{{data.goodsList.length}}件)</text>
</block>
<block wx:else>
收起
</block>
</view> </view>
</block> </block>
</block> </view>
<block wx:if="{{package.length > 2}}"> </block>
<view class="show-all" bindtap="showAllFun">
<block wx:if="{{!showAll}}">
查看全部<text>(共10件)</text>
</block>
<block wx:else>
收起
</block>
</view>
</block>
</view>
<view class="bottom flex"> <view class="bottom flex">
<view class="price flex"> <view class="price flex">
升级总价 升级总价
<view class="num flex"> <view class="num flex">
<view class="unit">¥</view> 5000.00 <view class="unit">¥</view> {{data.totalPrice}}
</view> </view>
</view> </view>
<block wx:if="{{data.status == 1}}"> <block wx:if="{{data.status == 1}}">
......
// packageEquity/pages/clueList/components/UpgradeItem/UpgradeItem.js // packageEquity/pages/clueList/components/UpgradeItem/UpgradeItem.js
import itemMixin from '../itemMixins' import itemMixin from '../itemMixins'
Component({ Component({
behaviors: [itemMixin], behaviors: [itemMixin],
/** /**
...@@ -13,8 +13,7 @@ Component({ ...@@ -13,8 +13,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
sceneTypeStatusMap:[ sceneTypeStatusMap: [{
{
label: '精品加装', label: '精品加装',
key: '1' key: '1'
}, },
...@@ -29,8 +28,14 @@ Component({ ...@@ -29,8 +28,14 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
jump(){ showAllFun() {
wx.$router.go('tabWorkOrder.createOrder') this.setData({
showAll: !this.data.showAll
})
},
jump() {
const item = this.data.data
wx.$router.go('tabWorkOrder.createOrder', item)
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -106,9 +106,12 @@ ...@@ -106,9 +106,12 @@
.price { .price {
color: #6C6C70; color: #6C6C70;
margin-left: auto; margin-left: auto;
flex-shrink: 0;
} }
} }
.clear-margin{
margin-bottom: 0;
}
.show-all { .show-all {
font-size: 24rpx; font-size: 24rpx;
color: #347BFF; color: #347BFF;
......
...@@ -32,31 +32,33 @@ ...@@ -32,31 +32,33 @@
</view> </view>
</block> </block>
</view> </view>
<view class="package-box"> <block wx:if="{{data.goodsList.length}}">
<block wx:for="{{package}}" wx:key="index"> <view class="package-box">
<block wx:if="{{index < 2 || showAll}}"> <block wx:for="{{data.goodsList}}" wx:key="index">
<view class="package-item flex"> <block wx:if="{{index < 2 || showAll}}">
哈哈哈 <view class="package-item flex {{data.goodsList.length == 1 ? 'clear-margin':'' }} {{data.goodsList.length == 2 && index == 1?'clear-margin':''}}">
<view class="price">¥1000.00</view> {{item.goodsName}}
<view class="price">¥{{item.goodsPrice}}</view>
</view>
</block>
</block>
<block wx:if="{{data.goodsList.length > 2}}">
<view class="show-all" catchtap="showAllFun">
<block wx:if="{{!showAll}}">
查看全部<text>(共{{data.goodsList.length}}件)</text>
</block>
<block wx:else>
收起
</block>
</view> </view>
</block> </block>
</block> </view>
<block wx:if="{{package.length > 2}}"> </block>
<view class="show-all" bindtap="showAllFun">
<block wx:if="{{!showAll}}">
查看全部<text>(共10件)</text>
</block>
<block wx:else>
收起
</block>
</view>
</block>
</view>
<view class="bottom flex"> <view class="bottom flex">
<view class="price flex"> <view class="price flex">
升级总价 升级总价
<view class="num flex"> <view class="num flex">
<view class="unit">¥</view> 5000.00 <view class="unit">¥</view> {{data.totalPrice}}
</view> </view>
</view> </view>
<block wx:if="{{data.status == 1}}"> <block wx:if="{{data.status == 1}}">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!