Commit 0d185f54 by 李伟康

流量有效性

1 parent 2b53f22a
......@@ -52,6 +52,13 @@ module.exports = {
/** 查询客户画像 */
portraitQuery(data) {
return api.post('dj.api.smartcarlife.customer.portrait.query', data)
},
/**
* 标记流量有效性
*
*/
updateTrafficEffectiveness(data) {
return api.post('dj.api.smartcarlife.inviteRecord.trafficEffectiveness.update', data)
}
}
import api from "../../api";
// tabDate/pages/detail/detail.js
import CONSTANTDATA from "../userPortrait/constant/data";
import { checkDailyReport } from "~/store/ModalToQueueControl";
import {
checkDailyReport
} from "~/store/ModalToQueueControl";
const app = getApp();
Page({
/**
......@@ -21,8 +23,7 @@ Page({
remark: "",
selectPayType: 2,
},
customerObj: [
{
customerObj: [{
label: "客户姓名",
key: "customerName",
},
......@@ -56,8 +57,7 @@ Page({
portrait: true,
},
],
recordObj: [
{
recordObj: [{
label: "跟进人",
key: "userName",
},
......@@ -80,42 +80,65 @@ Page({
remark: "",
isOrder: true,
selectType: 1,
sceneObj: {}
sceneObj: {},
trafficEffectivenessList: [{
name: '有效客户',
value: '1'
},
{
name: '无效客户',
value: '2'
}
]
},
// 确定是否要显示
showSelectType({ scene = "", item = {} }) {
showSelectType({
scene = "",
item = {}
}) {
wx.$modal(
this,
{
this, {
show: true,
title: "请选择录单入口",
tabTitleShow: false,
success: (res) => {
// 跳转新增订单页面 并带特定参数
let { selectType } = this.data;
let {
selectType
} = this.data;
if (selectType == 1) {
// wx.$router.go("tabWorkOrder.createOrder", {
// scene,
// ...item,
// });
this.setData({ showPromptDialog: true, sceneObj: item })
this.setData({
showPromptDialog: true,
sceneObj: item
})
} else {
console.log({ ...item }, "item");
console.log({
...item
}, "item");
wx.$router.go("tabWorkOrder.defeatOrder", {
scene,
...item,
});
}
},
error: () => { },
error: () => {},
},
"#modal2"
);
},
promptHandleConfirm(e) {
let { payFlag, payType } = e.detail
let { sceneObj } = this.data
let {
payFlag,
payType
} = e.detail
let {
sceneObj
} = this.data
let paymentMethod = payFlag != 2 ? 1 : payType
if (payFlag == 1 || payType == 3 || payType == 4 || payType == 6) {
let params = {
......@@ -136,7 +159,9 @@ Page({
})
},
selectType(e) {
let { type } = e.currentTarget.dataset;
let {
type
} = e.currentTarget.dataset;
console.log(e, e.currentTarget.dataset, type);
this.setData({
selectType: type,
......@@ -144,8 +169,12 @@ Page({
},
showPopup(e) {
let _this = this;
let { name } = e.currentTarget.dataset;
let { detail } = this.data;
let {
name
} = e.currentTarget.dataset;
let {
detail
} = this.data;
// if (detail.inviteStatus == 4 && name == 'showDate') return _this.showToast('已施工不可操作!')// 已施工预约单不可修改到店时间
this.setData({
[name]: !this.data[name],
......@@ -153,7 +182,9 @@ Page({
},
setCopyData(e) {
console.log(e);
let { content } = e.currentTarget.dataset;
let {
content
} = e.currentTarget.dataset;
wx.$util.setCopyData(`${content}`);
},
editProtrait(e) {
......@@ -162,7 +193,9 @@ Page({
},
makePhoneCall(e) {
console.log(e);
let { data } = e.currentTarget.dataset;
let {
data
} = e.currentTarget.dataset;
wx.makePhoneCall({
phoneNumber: data,
});
......@@ -190,7 +223,7 @@ Page({
}
let userInfo = wx.$util.getUserInfo();
this.setData({
isOrder: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6|| userInfo?.loginRole == 7),
isOrder: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6 || userInfo?.loginRole == 7),
});
this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig);
},
......@@ -198,7 +231,9 @@ Page({
console.log("config", config);
// 有就屏蔽手机号的显示
if (config) {
let { customerObj } = this.data;
let {
customerObj
} = this.data;
delete customerObj[1];
this.setData({
customerObj,
......@@ -207,7 +242,10 @@ Page({
},
async dealPortrait(id) {
let _userPortrait = [];
let { code, data: info } = await api.portraitQuery({
let {
code,
data: info
} = await api.portraitQuery({
id,
});
if (code != 0) return;
......@@ -256,7 +294,11 @@ Page({
})
.then((res) => {
console.log(res);
let { code, message, data } = res;
let {
code,
message,
data
} = res;
if (code == 0) {
wx.$util.hideLoading();
let detail = {};
......@@ -287,9 +329,9 @@ Page({
// 格式化跟进时间
let time = e.inviteDate;
e.inviteDate = time
? `「${new Date(e.inviteDate).format("MM-dd hh:mm")}」`
: "";
e.inviteDate = time ?
`「${new Date(e.inviteDate).format("MM-dd hh:mm")}」` :
"";
});
}
if (detail.carSeriesName)
......@@ -303,7 +345,20 @@ Page({
detail.inviteDate = new Date(detail.inviteDate).format(
"yyyy-MM-dd hh:mm:ss"
);
if (detail.trafficEffectiveness) {
detail.trafficEffectivenessName = {
1: '有效客户',
2: '无效客户'
} [detail.trafficEffectiveness]
}
let {
userInfo,
isOrder
} = this.data,
trafficEffectivenessDisabled = userInfo.isSuper && !userInfo.merchantType && userInfo.userType != 2 && !isOrder &&
detail.inviteStatus == 4 && detail.inviteStatus == 6 && detail.inviteStatus == 7
this.setData({
trafficEffectivenessDisabled,
detail,
flag: true,
});
......@@ -326,7 +381,10 @@ Page({
});
},
setInviteDate() {
let { detail, inviteDateStr } = this.data;
let {
detail,
inviteDateStr
} = this.data;
api
.setInviteDate({
id: detail.id,
......@@ -338,7 +396,11 @@ Page({
wx.$util.refreshPageData(true);
wx.hideLoading();
console.log(res);
let { code, data, message } = res;
let {
code,
data,
message
} = res;
if (code == 0) {
this.setData({
showDate: false,
......@@ -351,7 +413,9 @@ Page({
},
cancelInvite() {
let _this = this;
let { id } = this.data.detail;
let {
id
} = this.data.detail;
wx.showModal({
title: "温馨提示",
content: "是否取消预约?",
......@@ -367,7 +431,10 @@ Page({
})
.then((res) => {
console.log(res);
let { code, message } = res;
let {
code,
message
} = res;
if (code == 0) {
wx.hideLoading();
_this.showToast("取消成功!");
......@@ -384,8 +451,12 @@ Page({
},
remarkConfirm(e) {
let value = e.detail;
let { detail } = this.data;
let { id } = detail.remarks[0];
let {
detail
} = this.data;
let {
id
} = detail.remarks[0];
if (value) {
api
.followRecord({
......@@ -393,7 +464,10 @@ Page({
remark: value,
})
.then((res) => {
let { code, message } = res;
let {
code,
message
} = res;
if (code == 0) {
this.showToast("提交成功");
this.getInviteDetail(detail.id);
......@@ -409,23 +483,54 @@ Page({
let staffCheck = await checkDailyReport();
if (staffCheck) return false;
if (await wx.$globalDataFunction.inspectionOfProhibitionBill()) return
let { detail } = this.data;
let {
detail
} = this.data;
detail.isAppointment = true;
wx.$util.pointRecord(25);
// wx.$router.redirectTo('tabWorkOrder.createOrder', detail)
console.log(detail, "detail");
this.showSelectType({ item: detail });
this.showSelectType({
item: detail
});
},
async bindPickerChange(e) {
console.log(e)
let {
value
} = e.detail, {
trafficEffectivenessList,
detail: {
id
}
} = this.data,
trafficEffectiveness = trafficEffectivenessList[value].value,
trafficEffectivenessName = trafficEffectivenessList[value].name,
data = await api.updateTrafficEffectiveness({
id,
trafficEffectiveness,
inviteDateStr: 1,
inviteType: 1
})
if (data) this.setData({
['detail.trafficEffectiveness']: trafficEffectiveness,
['detail.trafficEffectivenessName']: trafficEffectivenessName
})
console.log(data)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { },
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let { options } = this.data;
let {
options
} = this.data;
if (options?.id) {
this.getInviteDetail(options.id);
}
......@@ -434,25 +539,25 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { },
});
onShareAppMessage: function () {},
});
\ No newline at end of file
......@@ -15,17 +15,26 @@ page {
background: #FFFFFF;
box-shadow: 0 var(--fontSize4) var(--fontSize20) 0 rgba(0, 0, 0, 0.10);
border-radius: var(--fontSize16);
padding: var(--fontSize32) var(--fontSize40) var(--fontSize20);
padding: var(--fontSize32) var(--fontSize32) var(--fontSize20);
position: relative;
margin-bottom: var(--fontSize20);
}
.box .title {
font-size: var(--fontSize36);
font-size: var(--fontSize32);
color: #333333;
font-weight: 700;
padding-bottom: var(--fontSize30);
border-bottom: var(--fontSize2) solid rgba(195, 195, 195, .3);
display: flex;
align-items: center;
&-tips {
font-size: 20rpx;
color: #999EA8;
font-weight: 400;
margin-left: auto;
}
}
.box .customer-list {
......@@ -384,6 +393,7 @@ page {
color: #292D33;
padding-left: 24rpx;
margin: 0 auto;
&+.modalbox {
margin-top: 16rpx;
}
......@@ -399,4 +409,42 @@ page {
.modatcontent {
box-sizing: border-box;
padding: var(--fontSize48) 0;
}
.picker-box {
width: 100%;
margin-top: 20rpx;
}
.picker {
display: flex;
align-items: center;
width: 100%;
height: 64rpx;
&-label {
flex-shrink: 0;
}
&-value {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
}
.placeholder {
font-size: 28rpx;
color: #BEC1C7;
}
.arrow {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/arrow.png');
background-size: 100% 100%;
margin-left: 4rpx;
}
\ No newline at end of file
......@@ -37,6 +37,24 @@
</view>
</view>
<view class="box">
<view class="title">流量有效性<view class="title-tips">如客户为二网/无法接通/或无效客户标记为无效流量</view>
</view>
<picker class="picker-box" mode="selector" range="{{trafficEffectivenessList}}" range-key="name" bindchange="bindPickerChange" value="{{detail.trafficEffectiveness - 1}}" disabled="{{trafficEffectivenessDisabled}}">
<view class="picker">
<view class="picker-label">
流量有效性
</view>
<view class="picker-value">
<view class="text-hide" wx:if="{{detail.trafficEffectiveness}}">
{{detail.trafficEffectivenessName}}
</view>
<text class="placeholder" wx:else>点击选择</text>
<view class="arrow"></view>
</view>
</view>
</picker>
</view>
<view class="box">
<block wx:if="{{ !userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2&&isOrder }}">
<!-- 已施工/已撤销/已支付 不显示 -->
<view wx:if="{{ detail.inviteStatus != 4&&detail.inviteStatus!=6&&detail.inviteStatus!=7 }}" class="icon date-icon" bindtap="showPopup" data-name="showDate">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!