客户列表筛查
This commit is contained in:
@@ -43,7 +43,6 @@ App({
|
||||
this.errorPageRedirect('/pages/index/index', '抱歉,该页面已迁移,请在搜索页查询...')
|
||||
|
||||
} else if (res.path == 'pages/card/card' || res.path == 'pages/mine/mine') {
|
||||
console.log(1)
|
||||
this.errorPageRedirect('/pages/mine/index')
|
||||
} else {
|
||||
this.errorPageRedirect('/pages/index/index', '抱歉,该页面无法访问,正在回到首页...')
|
||||
@@ -67,7 +66,6 @@ App({
|
||||
try {
|
||||
wx.setStorageSync(key, data);
|
||||
this.globalData[key] = data;
|
||||
// console.log(`Method:setStorage(success)`);
|
||||
callback(data)
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
@@ -134,7 +132,6 @@ App({
|
||||
const updateManager = wx.getUpdateManager()
|
||||
updateManager.onCheckForUpdate(function (res) {
|
||||
// 请求完新版本信息的回调
|
||||
console.log(res.hasUpdate)
|
||||
})
|
||||
updateManager.onUpdateReady(function () {
|
||||
wx.showModal({
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"contactPlugin": {
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.1",
|
||||
"provider": "wx104a1a20c3f81ec2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//常用时间 /start 距离当前时间几天前,later往前延续几天
|
||||
let getDateLater = function(start=0,later=0) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
let dateArr = [];
|
||||
let date = new Date();
|
||||
date.setDate(date.getDate() - start);
|
||||
let todate = date.getFullYear() + "-" + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth()+1) + "-" + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
|
||||
date.setDate(date.getDate() - later);
|
||||
let laterdate = date.getFullYear() + "-" + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth()+1) + "-" + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
|
||||
dateArr.push(laterdate)
|
||||
dateArr.push(todate)
|
||||
resolve(dateArr);
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getDateLater,
|
||||
}
|
||||
@@ -28,7 +28,6 @@ function HttpNoUkeyRequest(loading, url, sessionChoose, params, method, callBack
|
||||
header: paramSession,
|
||||
method: method,
|
||||
success: function (res) {
|
||||
// console.log(res.data);
|
||||
if (loading == true) {
|
||||
wx.hideLoading(); //隐藏提示框
|
||||
}
|
||||
@@ -94,7 +93,6 @@ function HttpRequest(loading, url, sessionChoose, params, method, callBack, reje
|
||||
header: paramSession,
|
||||
method: method,
|
||||
success: function (res) {
|
||||
// console.log(res.data);
|
||||
if (loading == true) {
|
||||
wx.hideLoading(); //隐藏提示框
|
||||
}
|
||||
|
||||
+186
-48
@@ -1,4 +1,5 @@
|
||||
import _ from '../../commons/js/commons'
|
||||
import popularData from '../../commons/js/lib/popularData';
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
@@ -21,7 +22,7 @@ Page({
|
||||
|
||||
|
||||
isShowMessage:false,
|
||||
isShowSort:true,
|
||||
isShowfilter:true,
|
||||
|
||||
timeSlotIndex:-1,
|
||||
timeSlot:[
|
||||
@@ -53,8 +54,12 @@ Page({
|
||||
|
||||
sortList:['建卡日期','最近联系','特别关注',],
|
||||
sortListIndex:0,
|
||||
|
||||
levelIndex:-1,
|
||||
modelIndex:-1,
|
||||
cfromlndex:-1,
|
||||
},
|
||||
onLoad: function (options) {
|
||||
onLoad(options) {
|
||||
for (let key in options) {
|
||||
this.setData({
|
||||
[key]: options[key]
|
||||
@@ -62,6 +67,12 @@ Page({
|
||||
}
|
||||
this.getAppCustomersTabs()
|
||||
this.getAppCustomersFilter()
|
||||
this.getAppSeriesCars()
|
||||
|
||||
},
|
||||
|
||||
onShow(){
|
||||
this.getDateLater()
|
||||
},
|
||||
|
||||
//客户-tab
|
||||
@@ -87,6 +98,22 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
//获取车型库
|
||||
getAppSeriesCars(){
|
||||
_.apiQuery.getAppSeriesCars().then(res => {
|
||||
if(res.data.length>0){
|
||||
let modelArray = []
|
||||
res.data.forEach(item => {
|
||||
modelArray.push(item.title)
|
||||
})
|
||||
this.setData({
|
||||
modelArray:modelArray,
|
||||
modelList:res.data,
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//获取客户列表
|
||||
getAppCustomers() {
|
||||
this.setData({
|
||||
@@ -147,6 +174,29 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
getDateLater(){
|
||||
popularData.getDateLater(0,0).then(res => {
|
||||
this.setData({
|
||||
today:res,
|
||||
})
|
||||
})
|
||||
popularData.getDateLater(1,0).then(res => {
|
||||
this.setData({
|
||||
tomorrow:res,
|
||||
})
|
||||
})
|
||||
popularData.getDateLater(0,6).then(res => {
|
||||
this.setData({
|
||||
last7:res,
|
||||
})
|
||||
})
|
||||
popularData.getDateLater(0,29).then(res => {
|
||||
this.setData({
|
||||
last30:res,
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
//切换tab
|
||||
changeTab(e){
|
||||
this.setData({
|
||||
@@ -207,61 +257,44 @@ Page({
|
||||
//建卡时间
|
||||
startDate(e){
|
||||
this.setData({
|
||||
s_time: e.detail.value
|
||||
s_time: e.detail.value,
|
||||
})
|
||||
this.searchSubmit()
|
||||
this.matchDate()
|
||||
},
|
||||
|
||||
|
||||
bindEndDateChange: function(e) {
|
||||
//建卡时间
|
||||
endDate(e){
|
||||
this.setData({
|
||||
r_time: e.detail.value
|
||||
e_time: e.detail.value,
|
||||
})
|
||||
this.searchSubmit()
|
||||
this.matchDate()
|
||||
},
|
||||
|
||||
//状态tab
|
||||
getCustomerStatus(){
|
||||
let params = {};
|
||||
params['type'] = this.data.type;
|
||||
_.apiQuery.getCustomerStatus(params).then(res=>{
|
||||
|
||||
//匹配选择时间是否等于常用时间
|
||||
matchDate(){
|
||||
this.setData({
|
||||
timeSlotIndex:-1,
|
||||
})
|
||||
if(this.data.s_time == this.data.today[0] && this.data.e_time == this.data.today[1] ){
|
||||
this.setData({
|
||||
if_ub:res.data.rolevel,
|
||||
tab:res.data.list,
|
||||
status_pid: this.data.status_pid == -2?res.data.list[0].id:this.data.status_pid
|
||||
timeSlotIndex:0,
|
||||
})
|
||||
|
||||
this.searchSubmit()
|
||||
})
|
||||
},
|
||||
|
||||
//选择标签
|
||||
changeTag(e){
|
||||
this.setData({
|
||||
tag_id: e.currentTarget.dataset.id,
|
||||
})
|
||||
this.searchSubmit()
|
||||
},
|
||||
|
||||
bindUserPicker(e) {
|
||||
this.setData({
|
||||
userindex: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
//隐藏高级搜索
|
||||
hidesearch() {
|
||||
this.setData({
|
||||
isShowSort: false
|
||||
})
|
||||
},
|
||||
|
||||
//显示高级搜索
|
||||
showSort(){
|
||||
this.setData({
|
||||
isShowSort: !this.data.isShowSort
|
||||
})
|
||||
}
|
||||
if(this.data.s_time == this.data.tomorrow[0] && this.data.e_time == this.data.tomorrow[1] ){
|
||||
this.setData({
|
||||
timeSlotIndex:1,
|
||||
})
|
||||
}
|
||||
if(this.data.s_time == this.data.last7[0] && this.data.e_time == this.data.last7[1] ){
|
||||
this.setData({
|
||||
timeSlotIndex:2,
|
||||
})
|
||||
}
|
||||
if(this.data.s_time == this.data.last30[0] && this.data.e_time == this.data.last30[1] ){
|
||||
this.setData({
|
||||
timeSlotIndex:3,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//单选
|
||||
@@ -270,13 +303,118 @@ Page({
|
||||
this.setData({
|
||||
timeSlotIndex:e.currentTarget.dataset.index,
|
||||
})
|
||||
switch (e.currentTarget.dataset.index) {
|
||||
case 0:
|
||||
this.setData({
|
||||
s_time:this.data.today[0],
|
||||
e_time:this.data.today[1],
|
||||
})
|
||||
break;
|
||||
case 1:
|
||||
this.setData({
|
||||
s_time:this.data.tomorrow[0],
|
||||
e_time:this.data.tomorrow[1],
|
||||
})
|
||||
break;
|
||||
case 2:
|
||||
this.setData({
|
||||
s_time:this.data.last7[0],
|
||||
e_time:this.data.last7[1],
|
||||
})
|
||||
break;
|
||||
case 3:
|
||||
this.setData({
|
||||
s_time:this.data.last30[0],
|
||||
e_time:this.data.last30[1],
|
||||
})
|
||||
break;
|
||||
}
|
||||
} else if(e.currentTarget.dataset.type == 'testDrive'){
|
||||
let if_driver = ''
|
||||
if(e.currentTarget.dataset.index == 1){
|
||||
if_driver = 1
|
||||
}else if(e.currentTarget.dataset.index == 2){
|
||||
if_driver = 0
|
||||
}
|
||||
this.setData({
|
||||
if_driver:if_driver,
|
||||
testDriveIndex:e.currentTarget.dataset.index,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//客户顶级
|
||||
changeLevel(e){
|
||||
|
||||
let level = ''
|
||||
if(e.detail.value >= 0){
|
||||
level = this.data.filter.level[e.detail.value]
|
||||
}
|
||||
|
||||
this.setData({
|
||||
level:level,
|
||||
levelIndex: e.detail.value,
|
||||
})
|
||||
},
|
||||
|
||||
//选择车型
|
||||
changeModel(e) {
|
||||
let s_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
s_id = this.data.modelList[e.detail.value].id
|
||||
}
|
||||
this.setData({
|
||||
s_id:s_id,
|
||||
modelIndex:e.detail.value,
|
||||
})
|
||||
},
|
||||
|
||||
//客户来源
|
||||
changeCfrom(e){
|
||||
|
||||
let cfrom = ''
|
||||
if(e.detail.value >= 0){
|
||||
cfrom = this.data.filter.cfrom[e.detail.value]
|
||||
}
|
||||
|
||||
this.setData({
|
||||
cfrom:cfrom,
|
||||
cfromIndex: e.detail.value,
|
||||
})
|
||||
},
|
||||
|
||||
//显示高级搜索
|
||||
showfilter(){
|
||||
this.setData({
|
||||
isShowfilter: !this.data.isShowfilter
|
||||
})
|
||||
},
|
||||
|
||||
//确定高级搜索
|
||||
submitFilter() {
|
||||
this.setData({
|
||||
isShowfilter:false,
|
||||
})
|
||||
this.searchSubmit()
|
||||
},
|
||||
|
||||
//重置高级搜索
|
||||
resetFilter() {
|
||||
this.setData({
|
||||
s_time:'',
|
||||
e_time:'',
|
||||
if_driver:'',
|
||||
level:'',
|
||||
s_id:'',
|
||||
cfrom:'',
|
||||
timeSlotIndex:-1,
|
||||
testDriveIndex:-1,
|
||||
levelIndex:-1,
|
||||
modelIndex:-1,
|
||||
cfromlndex:-1,
|
||||
})
|
||||
},
|
||||
|
||||
//显示短信弹框
|
||||
showMessage(e){
|
||||
this.setData({
|
||||
|
||||
+22
-22
@@ -29,7 +29,7 @@
|
||||
</picker>
|
||||
</view>
|
||||
<view class="fn-fr pr180 relative">
|
||||
<text bindtap="showSort" class="inner5 iconfont icon-gaojisousuo ml10"></text>
|
||||
<text bindtap="showfilter" class="inner5 iconfont icon-gaojisousuo ml10"></text>
|
||||
<view bindtap="pushLink" data-url="/pages/customer/addCard/index" class="absolute right-0 box-middle pt5 pb5 pl10 pr30 space-nowrap bg-333 font-22 color-fff ulib-rl750"><i class="iconfont mr5 icon-jia"></i>客户建卡</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -89,7 +89,7 @@
|
||||
</view>
|
||||
</lcb-msg>
|
||||
|
||||
<view class="search-sort {{!isShowSort?'fn-hide':''}} {{!isShowSort?'sortout':'sortin'}} bg-fff fixed top-0 bottom-0 z-index-2 ulib-rl20 overflowhidden">
|
||||
<view class="search-sort {{!isShowfilter?'fn-hide':''}} {{!isShowfilter?'sortout':'sortin'}} bg-fff fixed top-0 bottom-0 z-index-2 ulib-rl20 overflowhidden">
|
||||
<scroll-view class="wp100" scroll-y="true" style="height:100%">
|
||||
<view class="inner30">
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
@@ -105,9 +105,9 @@
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28">建卡结束时间</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker mode="date" value="{{c_time}}" bindchange="bindStartDateChange">
|
||||
<text class="color-ccc" wx:if="{{c_time == ''}}">请选择</text>
|
||||
<text wx:else>{{c_time}}</text>
|
||||
<picker mode="date" value="{{e_time}}" bindchange="endDate">
|
||||
<text class="color-ccc" wx:if="{{e_time == ''}}">请选择</text>
|
||||
<text wx:else>{{e_time}}</text>
|
||||
<i class="iconfont ml10 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
@@ -135,34 +135,34 @@
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28">意向等级</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker mode="date" value="{{c_time}}" bindchange="bindStartDateChange">
|
||||
<text class="color-ccc" wx:if="{{c_time == ''}}">请选择</text>
|
||||
<text wx:else>{{c_time}}</text>
|
||||
<i class="iconfont ml10 icon-gengduo"></i>
|
||||
<picker bindchange="changeLevel" value="{{levelIndex}}" range="{{filter.level}}">
|
||||
<text class="color-ccc" wx:if="{{levelIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{filter.level[levelIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28">品牌车型</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker mode="date" value="{{c_time}}" bindchange="bindStartDateChange">
|
||||
<text class="color-ccc" wx:if="{{c_time == ''}}">请选择</text>
|
||||
<text wx:else>{{c_time}}</text>
|
||||
<i class="iconfont ml10 icon-gengduo"></i>
|
||||
<picker bindchange="changeModel" value="{{modelIndex}}" range="{{modelArray}}">
|
||||
<text class="color-ccc" wx:if="{{modelIndex == -1}}">请选择</text>
|
||||
<text wx:else> {{modelArray[modelIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28">客户来源</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker mode="date" value="{{c_time}}" bindchange="bindStartDateChange">
|
||||
<text class="color-ccc" wx:if="{{c_time == ''}}">请选择</text>
|
||||
<text wx:else>{{c_time}}</text>
|
||||
<i class="iconfont ml10 icon-gengduo"></i>
|
||||
<picker bindchange="changeCfrom" value="{{cfromlndex}}" range="{{filter.cfrom}}">
|
||||
<text class="color-ccc" wx:if="{{cfromlndex == -1}}">请选择</text>
|
||||
<text wx:else>{{filter.cfrom[cfromlndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<!-- <view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28">到店次数</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker mode="date" value="{{c_time}}" bindchange="bindStartDateChange">
|
||||
@@ -171,14 +171,14 @@
|
||||
<i class="iconfont ml10 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="pt50 pb100"></view>
|
||||
</scroll-view>
|
||||
<view class="absolute left-0 bottom-0 right-0 fn-flex pt20 pb20 pl60 pr60 bg-fff-op90 text-center">
|
||||
<view class="fn-flex-item mr20 pt15 pb15 bds-2-36afa2 font-32 color-36afa2 ulib-r750" bindtap="resetsearch">重置</view>
|
||||
<view class="fn-flex-item ml20 pt15 pb15 bg-36afa2 font-32 color-fff ulib-r750" bindtap="hidesearch">确定</view>
|
||||
<view class="fn-flex-item mr20 pt15 pb15 bds-2-36afa2 font-32 color-36afa2 ulib-r750" bindtap="resetFilter">重置</view>
|
||||
<view class="fn-flex-item ml20 pt15 pb15 bg-36afa2 font-32 color-fff ulib-r750" bindtap="submitFilter">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="search-bg fixed left-0 right-0 top-0 bottom-0" hidden="{{!isShowSort}}" style="background-color:rgba(0,0,0,.5);" bindtap="hidesearch"></view>
|
||||
<view class="search-bg fixed left-0 right-0 top-0 bottom-0" hidden="{{!isShowfilter}}" style="background-color:rgba(0,0,0,.5);"></view>
|
||||
Reference in New Issue
Block a user