diff --git a/commons/js/config.js b/commons/js/config.js index ab78a51..5abaa49 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -25,6 +25,7 @@ api = { upImg: baseUrl + "upimg", //上传图片 appUserUkey: "app/user/ukey", //登录/退出登录 appUser: "app/user", //用户信息 + appUserMenu: "app/user/menu", //用户菜单 appSms: "app/sms", //获取验证码 appUserTel: "app/user/tel", //获取用户手机号 appSeriesAttrs: "app/series/attrs", //获取车型属性 @@ -178,6 +179,7 @@ api = { appClues: "app/clues", //获取线索列表 获取线索详情 appCluesLogs: "app/clueslogs", //线索日志 + appCluesLock: "app/clues/unlock", //解锁线索 appSignConf: "app/sign/conf", //签到配置信息 appUserConf: "app/sign/userConf", //用户签到配置信息 diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index faef756..5b16d8a 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -1094,4 +1094,16 @@ apiQuery.appPaic = function(params){ }) } +//获取用户中心菜单 +apiQuery.getUserMenu = function(params){ + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appUserMenu, 2, params, "GET", resolve, reject) + }) +} +//解锁线索 +apiQuery.putAppCluesLock = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(true, Config.api.appCluesLock, 2, params, "PUT", resolve, reject) + }) +} export default apiQuery; \ No newline at end of file diff --git a/pages/clues/detail/index.js b/pages/clues/detail/index.js index 201d3c2..dff80a9 100644 --- a/pages/clues/detail/index.js +++ b/pages/clues/detail/index.js @@ -26,7 +26,6 @@ Page({ [key]: options[key] }) } - this.getAppCluesDetails() this.getAppCluesLogs() innerAudioContext.onEnded(() => { diff --git a/pages/clues/detail/index.wxml b/pages/clues/detail/index.wxml index 292ef36..8280dee 100644 --- a/pages/clues/detail/index.wxml +++ b/pages/clues/detail/index.wxml @@ -81,8 +81,8 @@ - 返回列表 + 返回列表 - + \ No newline at end of file diff --git a/pages/customer/index.js b/pages/customer/index.js index 8580115..b7aff48 100644 --- a/pages/customer/index.js +++ b/pages/customer/index.js @@ -3,107 +3,109 @@ import popularData from '../../commons/js/lib/popularData'; const app = getApp() Page({ data: { - key:'',//tab状态值 - list: [],//客户列表 + key: '', //tab状态值 + list: [], //客户列表 pageNo: 1, noData: false, end: false, load: true, loading: false, - flag:1, - cus_id:'',//客户编号 - name:'',//名字 - mobile:'',//手机号 - s_time:'',//开始时间 - e_time:'',//结束时间 - if_driver:'',//是否试驾 - level:'',//客户顶级 + flag: 1, + cus_id: '', //客户编号 + name: '', //名字 + mobile: '', //手机号 + s_time: '', //开始时间 + e_time: '', //结束时间 + if_driver: '', //是否试驾 + level: '', //客户顶级 // brand_id:'',//品牌 // s_id:'',//车型id // v_id:'',//车辆版本id - cfrom:'',//客户来源 - o_type:'',//排序类型 - isShowfilter:false,//是否显示筛查 - timeSlotIndex:-1,//常用时间索引 - s_visit_time:'',//跟进时间段开始 - e_visit_time:'',//跟进时间段结束 - timeSlot:[//常用时间数组 + cfrom: '', //客户来源 + o_type: '', //排序类型 + isShowfilter: false, //是否显示筛查 + timeSlotIndex: -1, //常用时间索引 + s_visit_time: '', //跟进时间段开始 + e_visit_time: '', //跟进时间段结束 + timeSlot: [ //常用时间数组 { - title:'今天', + title: '今天', }, { - title:'明天', + title: '明天', }, { - title:'未来三天', + title: '未来三天', }, { - title:'未来七天', + title: '未来七天', }, ], - testDriveIndex:-1,//是否试驾索引 - testDrive:[//是否试驾数组 + testDriveIndex: -1, //是否试驾索引 + testDrive: [ //是否试驾数组 { - title:'全部', + title: '全部', }, { - title:'是', + title: '是', }, { - title:'否', + title: '否', }, ], - sortList:['建卡日期','最近联系','特别关注',],//排序数组 - sortListIndex:0,//排序索引 - levelIndex:-1,//意向等级索引 - brandIndex:-1,//车辆品牌索引 - modelIndex:-1,//车系车型索引 - cfromIndex:-1,//客户来源索引 - isShowMessage:false,//是否显示短信弹窗 - content:'',//短信内容 - isRefresh:false,//判断返回是否需要刷新 + sortList: ['建卡日期', '最近联系', '特别关注', ], //排序数组 + sortListIndex: 0, //排序索引 + levelIndex: -1, //意向等级索引 + brandIndex: -1, //车辆品牌索引 + modelIndex: -1, //车系车型索引 + cfromIndex: -1, //客户来源索引 + isShowMessage: false, //是否显示短信弹窗 + content: '', //短信内容 + isRefresh: false, //判断返回是否需要刷新 isShowMobile: false, staffArray: [], staffobj: [], - staffIndex:-1, - userInfo:'', + staffIndex: -1, + userInfo: '', - of_id:'', - of2_id:'', - of1Index:-1, - of2Index:-1, + of_id: '', + of2_id: '', + of1Index: -1, + of2Index: -1, - cid:[],//分配客户ID - employee_id:'',//分配销售ID - employeeIndex:-1,//分配销售索引 + cid: [], //分配客户ID + employee_id: '', //分配销售ID + employeeIndex: -1, //分配销售索引 - isShowTimePicker:false, - weekList:['日','一','二','三','四','五','六'], - dateList:[], - nextIndex:-1,//计划回访时间 + isShowTimePicker: false, + weekList: ['日', '一', '二', '三', '四', '五', '六'], + dateList: [], + nextIndex: -1, //计划回访时间 - distTabId:1, - distBizIndex:-1, - distBiz_id:'', + distTabId: 1, + distBizIndex: -1, + distBiz_id: '', bizArray: [], bizobj: [], - tag_ids:'', + tag_ids: '', - cityIndex:-1, - city_id:'', - countyIndex:-1, - county_id:'', + cityIndex: -1, + city_id: '', + countyIndex: -1, + county_id: '', - isShowCall:false,//是否显示拨打电话确认弹框 - phoneNumber:'',//拨打的电话号码 + isShowCall: false, //是否显示拨打电话确认弹框 + phoneNumber: '', //拨打的电话号码 - brand_page_show:false, - brand_name:'', + brand_page_show: false, + brand_name: '', brand_id: '', series_id: '', //车系id modelArray: [], modelIndex: -1, //车系车型索引 - isShowLock: false + isShowLock: false, + cluesTabKey: 1000, //线索tabkey + cluesId: 0 //当前操作线索id }, onLoad(options) { for (let key in options) { @@ -113,7 +115,7 @@ Page({ } this.setData({ - userInfo:app.getStorageByKey("userInfo"), + userInfo: app.getStorageByKey("userInfo"), }) //客户-tab @@ -136,7 +138,7 @@ Page({ }, - onShow(){ + onShow() { //获取常用时间段 this.getDateLater() }, @@ -145,8 +147,8 @@ Page({ getAppCustomersTabs() { _.apiQuery.getAppCustomersTabs().then(res => { this.setData({ - tab:res.data, - key:this.data.key==''?res.data[0].key:this.data.key, + tab: res.data, + key: this.data.key == '' ? res.data[0].key : this.data.key, }) this.getAppCustomersList() @@ -156,7 +158,7 @@ Page({ }, //获取销售顾问 - getAppUserAdmins(){ + getAppUserAdmins() { let params = {}; params['page'] = 1; params['size'] = 1000; @@ -170,17 +172,17 @@ Page({ bizArray.push(item.name) }) this.setData({ - staffArray:staffArray, + staffArray: staffArray, staffobj: res.data.list, - distributetabs:res.data.tabs, - bizArray:bizArray, + distributetabs: res.data.tabs, + bizArray: bizArray, bizobj: res.data.bizs, }) }); }, //切换tab - changeTab(e){ + changeTab(e) { this.setData({ key: this.data.tab[e.currentTarget.dataset.index].key, }) @@ -188,50 +190,50 @@ Page({ }, // 显示弹框 - showMobileMsg(){ + showMobileMsg() { this.setData({ isShowMobile: true }) }, //获取列表筛选条件 - getAppCustomersFilter(){ + getAppCustomersFilter() { _.apiQuery.getAppCustomersFilter().then(res => { this.setData({ - filter:res.data, + filter: res.data, }) }); }, //获取车型品牌 - getAppSeriesBrands(){ + getAppSeriesBrands() { _.apiQuery.getAppSeriesBrands().then(res => { - if(res.data.list.length>0){ + if (res.data.list.length > 0) { let brandArray = [] res.data.list.forEach(item => { brandArray.push(item.name) }) this.setData({ - brandArray:brandArray, - brandList:res.data.list, + brandArray: brandArray, + brandList: res.data.list, }) } }); }, //获取车系车型 - getAppSeries(){ + getAppSeries() { let params = {}; params['brand_id'] = this.data.brand_id; _.apiQuery.getAppSeries(params).then(res => { - if(res.data.list.length>0){ + if (res.data.list.length > 0) { let modelArray = [] res.data.list.forEach(item => { modelArray.push(item.name) }) this.setData({ - modelArray:modelArray, - modelList:res.data.list, + modelArray: modelArray, + modelList: res.data.list, }) } }); @@ -253,75 +255,75 @@ Page({ let admin_ids = '' this.data.staffobj.forEach(item => { - if(item.checked){ - if(admin_ids==''){ - admin_ids=item.id - }else{ - admin_ids=admin_ids+','+item.id + if (item.checked) { + if (admin_ids == '') { + admin_ids = item.id + } else { + admin_ids = admin_ids + ',' + item.id } } }) - + let params = {}; params['page'] = this.data.pageNo; params['size'] = 3; params['status'] = this.data.key; - if(this.data.cus_id != ''){ + if (this.data.cus_id != '') { params['cus_id'] = this.data.cus_id; } - if(this.data.name != ''){ + if (this.data.name != '') { params['name'] = this.data.name; } - if(this.data.mobile != ''){ + if (this.data.mobile != '') { params['mobile'] = this.data.mobile; } - if(this.data.s_time != ''&&this.data.e_time != ''){ + if (this.data.s_time != '' && this.data.e_time != '') { params['s_time'] = this.data.s_time; params['e_time'] = this.data.e_time; } - if(this.data.if_driver != ''){ + if (this.data.if_driver != '') { params['if_driver'] = this.data.if_driver; } - if(this.data.level != ''){ + if (this.data.level != '') { params['level'] = this.data.level; } - if(this.data.brand_id != ''){ + if (this.data.brand_id != '') { params['brand_id'] = this.data.brand_id; } - if(this.data.series_id != ''){ + if (this.data.series_id != '') { params['series_id'] = this.data.series_id; } // if(this.data.v_id != ''){ // params['v_id'] = this.data.v_id; // } - if(this.data.cfrom != ''){ + if (this.data.cfrom != '') { params['cfrom'] = this.data.cfrom; } - if(this.data.o_type != ''){ + if (this.data.o_type != '') { params['o_type'] = this.data.o_type; } - if(this.data.of_id != ''){ + if (this.data.of_id != '') { params['of_id'] = this.data.of_id; } - if(this.data.of2_id != ''){ + if (this.data.of2_id != '') { params['of2_id'] = this.data.of2_id; } - if(admin_ids!=''){ + if (admin_ids != '') { params['admin_ids'] = admin_ids; } - if(this.data.tag_ids!=''){ + if (this.data.tag_ids != '') { params['tag_ids'] = this.data.tag_ids; } // if(this.data.staffIndex>-1){ // params['admin_id'] = this.data.staffobj[this.data.staffIndex].id; // } - if(this.data.city_id!=''){ + if (this.data.city_id != '') { params['city_id'] = this.data.city_id; } - if(this.data.county_id!=''){ + if (this.data.county_id != '') { params['county_id'] = this.data.county_id; } - if(this.data.s_visit_time != ''&&this.data.e_visit_time != ''){ + if (this.data.s_visit_time != '' && this.data.e_visit_time != '') { params['s_visit_time'] = this.data.s_visit_time; params['e_visit_time'] = this.data.e_visit_time; } @@ -352,37 +354,37 @@ Page({ }, //置顶操作 - optTop(e){ + optTop(e) { let params = {}; params['id'] = this.data.list[e.currentTarget.dataset.index].id; - params['is_top'] = this.data.list[e.currentTarget.dataset.index].is_top==1?0:1; - _.apiQuery.putAppCustomers(params).then(res=>{ + params['is_top'] = this.data.list[e.currentTarget.dataset.index].is_top == 1 ? 0 : 1; + _.apiQuery.putAppCustomers(params).then(res => { this.setData({ - ['list['+e.currentTarget.dataset.index+'].is_top']:this.data.list[e.currentTarget.dataset.index].is_top==1?0:1, + ['list[' + e.currentTarget.dataset.index + '].is_top']: this.data.list[e.currentTarget.dataset.index].is_top == 1 ? 0 : 1, }) }) }, //获取常用时间段 - getDateLater(){ - popularData.getDateLater(0,0).then(res => { + getDateLater() { + popularData.getDateLater(0, 0).then(res => { this.setData({ - today:res, + today: res, }) }) - popularData.getDateLater(-1,0).then(res => { + popularData.getDateLater(-1, 0).then(res => { this.setData({ - tomorrow:res, + tomorrow: res, }) }) - popularData.getDateLater(-3,2).then(res => { + popularData.getDateLater(-3, 2).then(res => { this.setData({ - next3:res, + next3: res, }) }) - popularData.getDateLater(-7,6).then(res => { + popularData.getDateLater(-7, 6).then(res => { this.setData({ - next7:res, + next7: res, }) }) // popularData.getDateLater(0,6).then(res => { @@ -402,16 +404,16 @@ Page({ let params = {}; params['id'] = e.currentTarget.dataset.id; params['type'] = 0; - _.apiQuery.getAppXz(params).then(res=>{ + _.apiQuery.getAppXz(params).then(res => { this.setData({ - isShowCall:true, - phoneNumber:res.data.mobile, + isShowCall: true, + phoneNumber: res.data.mobile, }) }) }, //提交搜索 - searchSubmit(){ + searchSubmit() { this.setData({ list: [], pageNo: 1, @@ -425,12 +427,12 @@ Page({ }, //排序方式 - changeSortList(e){ + changeSortList(e) { let o_type = '' - if(e.detail.value == 0){ + if (e.detail.value == 0) { o_type = 1 - }else if(e.detail.value == 1){ + } else if (e.detail.value == 1) { o_type = 2 } @@ -442,87 +444,87 @@ Page({ }, //建卡时间 - startDate(e){ + startDate(e) { this.setData({ s_time: e.detail.value, }) }, //建卡时间 - endDate(e){ + endDate(e) { this.setData({ e_time: e.detail.value, }) }, //单选 - radioPicker(e){ - if(e.currentTarget.dataset.type == 'timeSlot'){ + radioPicker(e) { + if (e.currentTarget.dataset.type == 'timeSlot') { this.setData({ - timeSlotIndex:e.currentTarget.dataset.index, + timeSlotIndex: e.currentTarget.dataset.index, }) switch (e.currentTarget.dataset.index) { case 0: this.setData({ - s_visit_time:this.data.today[0], - e_visit_time:this.data.today[1], + s_visit_time: this.data.today[0], + e_visit_time: this.data.today[1], }) break; case 1: this.setData({ - s_visit_time:this.data.tomorrow[0], - e_visit_time:this.data.tomorrow[1], + s_visit_time: this.data.tomorrow[0], + e_visit_time: this.data.tomorrow[1], }) break; case 2: this.setData({ - s_visit_time:this.data.next3[0], - e_visit_time:this.data.next3[1], + s_visit_time: this.data.next3[0], + e_visit_time: this.data.next3[1], }) break; case 3: this.setData({ - s_visit_time:this.data.next7[0], - e_visit_time:this.data.next7[1], + s_visit_time: this.data.next7[0], + e_visit_time: this.data.next7[1], }) break; } - } else if(e.currentTarget.dataset.type == 'testDrive'){ + } else if (e.currentTarget.dataset.type == 'testDrive') { let if_driver = '' - if(e.currentTarget.dataset.index == 1){ + if (e.currentTarget.dataset.index == 1) { if_driver = 1 - }else if(e.currentTarget.dataset.index == 2){ + } else if (e.currentTarget.dataset.index == 2) { if_driver = 0 } this.setData({ - if_driver:if_driver, - testDriveIndex:e.currentTarget.dataset.index, + if_driver: if_driver, + testDriveIndex: e.currentTarget.dataset.index, }) } }, //客户等级 - changeLevel(e){ + changeLevel(e) { let level = '' - if(e.detail.value >= 0){ + if (e.detail.value >= 0) { level = this.data.filter.level[e.detail.value] } this.setData({ - level:level, + level: level, levelIndex: e.detail.value, }) }, //选择品牌 changeBrand(e) { - if(this.data.brandIndex != e.detail.value && e.detail.value >= 0){ + if (this.data.brandIndex != e.detail.value && e.detail.value >= 0) { this.setData({ - brand_id:this.data.brandList[e.detail.value].id, - brandIndex:e.detail.value, - s_id:'',//车系id - modelIndex:-1,//车系车型索引 + brand_id: this.data.brandList[e.detail.value].id, + brandIndex: e.detail.value, + s_id: '', //车系id + modelIndex: -1, //车系车型索引 }) this.getAppSeries() } @@ -530,30 +532,30 @@ Page({ //选择车型 changeModel(e) { - if(this.data.modelIndex != e.detail.value && e.detail.value >= 0){ + if (this.data.modelIndex != e.detail.value && e.detail.value >= 0) { this.setData({ - series_id:this.data.modelList[e.detail.value].id, - modelIndex:e.detail.value, + series_id: this.data.modelList[e.detail.value].id, + modelIndex: e.detail.value, }) } }, //客户来源 - changeCfrom(e){ + changeCfrom(e) { let cfrom = '' - if(e.detail.value >= 0){ + if (e.detail.value >= 0) { cfrom = this.data.filter.cfrom[e.detail.value] } this.setData({ - cfrom:cfrom, + cfrom: cfrom, cfromIndex: e.detail.value, }) }, //显示隐藏高级搜索 - optfilter(){ + optfilter() { this.setData({ isShowfilter: !this.data.isShowfilter }) @@ -561,16 +563,16 @@ Page({ }, //显示高级搜索 - showfilter(){ + showfilter() { this.setData({ - isShowfilter:true, + isShowfilter: true, }) }, //确定高级搜索 submitFilter() { this.setData({ - isShowfilter:false, + isShowfilter: false, }) this.searchSubmit() }, @@ -584,52 +586,52 @@ Page({ this.setData({ staffobj, - cus_id:'',//编号 - name:'',//名字 - mobile:'',//手机号 - s_time:'', - e_time:'', - if_driver:'', - level:'', - brand_id:'', - series_id:'', - cfrom:'', - of_id:'', - of2_id:'', - of1Index:-1, - of2Index:-1, - timeSlotIndex:-1, - s_visit_time:'',//跟进时间段开始 - e_visit_time:'',//跟进时间段结束 - testDriveIndex:-1, - levelIndex:-1, - brandIndex:-1, - modelIndex:-1, - cfromIndex:-1, - staffIndex:-1, - tag_ids:'', - cityIndex:-1, - city_id:'', - countyIndex:-1, - county_id:'', - brand_name:'', + cus_id: '', //编号 + name: '', //名字 + mobile: '', //手机号 + s_time: '', + e_time: '', + if_driver: '', + level: '', + brand_id: '', + series_id: '', + cfrom: '', + of_id: '', + of2_id: '', + of1Index: -1, + of2Index: -1, + timeSlotIndex: -1, + s_visit_time: '', //跟进时间段开始 + e_visit_time: '', //跟进时间段结束 + testDriveIndex: -1, + levelIndex: -1, + brandIndex: -1, + modelIndex: -1, + cfromIndex: -1, + staffIndex: -1, + tag_ids: '', + cityIndex: -1, + city_id: '', + countyIndex: -1, + county_id: '', + brand_name: '', }) this.getAppCustomersTag() }, //显示短信弹框 - showMessage(e){ + showMessage(e) { this.setData({ - messageId:e.currentTarget.dataset.id, - isShowMessage:true, - content:'', + messageId: e.currentTarget.dataset.id, + isShowMessage: true, + content: '', }) }, //关闭短信弹框 - hideMessage(e){ + hideMessage(e) { this.setData({ - isShowMessage:false, + isShowMessage: false, }) }, @@ -642,7 +644,7 @@ Page({ }, //发短信 - postAppSmsCustomer(){ + postAppSmsCustomer() { if (this.data.submitFlag) return; if (this.data.content == '') { wx.showToast({ @@ -656,11 +658,11 @@ Page({ let params = {}; params['id'] = this.data.messageId; params['content'] = this.data.content; - _.apiQuery.postAppSmsCustomer(params).then(res=>{ + _.apiQuery.postAppSmsCustomer(params).then(res => { this.setData({ - isShowMessage:false, - submitFlag:false, - content:'', + isShowMessage: false, + submitFlag: false, + content: '', }) wx.showToast({ title: res.msg, @@ -671,14 +673,14 @@ Page({ }, //推送链接 - pushLink(e){ - if(e.currentTarget.dataset.url){ + pushLink(e) { + if (e.currentTarget.dataset.url) { _.$router.openUrlScheme(e.currentTarget.dataset.url) } }, //客户来源 - getAppCustomersOffline_sources(){ + getAppCustomersOffline_sources() { _.apiQuery.getAppCustomersOffline_sources().then(res => { let of1Arr = [] res.data.sources.forEach(item => { @@ -686,57 +688,57 @@ Page({ }) this.setData({ of1Arr, - sources:res.data.sources + sources: res.data.sources }) }); }, //客户来源 changeOf1(e) { - if(this.data.of1Index!=e.detail.value){ + if (this.data.of1Index != e.detail.value) { let of2Arr = [] this.data.sources[e.detail.value].list.forEach(item => { of2Arr.push(item.name) }) this.setData({ of2Arr, - of2Index:-1, - of_id:this.data.sources[e.detail.value].id, - of1Index:e.detail.value, + of2Index: -1, + of_id: this.data.sources[e.detail.value].id, + of1Index: e.detail.value, }) } }, changeOf2(e) { - if(this.data.of2Index!=e.detail.value){ + if (this.data.of2Index != e.detail.value) { this.setData({ - of2_id:this.data.sources[this.data.of1Index].list[e.detail.value].id, - of2Index:e.detail.value, + of2_id: this.data.sources[this.data.of1Index].list[e.detail.value].id, + of2Index: e.detail.value, }) } }, //销售弹窗显示隐藏 - optEmployees(e){ - if(e.currentTarget.dataset.cid){ + optEmployees(e) { + if (e.currentTarget.dataset.cid) { this.setData({ - isShowEmployees:true, - employeeIndex:-1, - employee_id:'', - cid:[e.currentTarget.dataset.cid], - optLevel:e.currentTarget.dataset.level, + isShowEmployees: true, + employeeIndex: -1, + employee_id: '', + cid: [e.currentTarget.dataset.cid], + optLevel: e.currentTarget.dataset.level, }) - }else{ + } else { this.setData({ - isShowEmployees:!this.data.isShowEmployees, - employeeIndex:-1, - employee_id:'', - cid:[], - optLevel:'', - nextIndex:-1, - distTabId:1, - distBiz_id:'', - distBizIndex:-1, + isShowEmployees: !this.data.isShowEmployees, + employeeIndex: -1, + employee_id: '', + cid: [], + optLevel: '', + nextIndex: -1, + distTabId: 1, + distBiz_id: '', + distBizIndex: -1, }) } }, @@ -744,47 +746,44 @@ Page({ //选择店员 changeEmployee(e) { let employee_id = '' - if(e.detail.value >= 0){ + if (e.detail.value >= 0) { employee_id = this.data.staffobj[e.detail.value].id } this.setData({ employee_id, - employeeIndex:e.detail.value, + employeeIndex: e.detail.value, }) }, //分配客户 - putAppCustomersAdmins(){ + putAppCustomersAdmins() { let that = this - if (that.data.distTabId==1&&that.data.employeeIndex == -1 ) { + if (that.data.distTabId == 1 && that.data.employeeIndex == -1) { wx.showToast({ title: '请选择店员', icon: 'none' }) - } - else if (that.data.distTabId==1&&that.data.nextIndex == -1 ) { + } else if (that.data.distTabId == 1 && that.data.nextIndex == -1) { wx.showToast({ title: '请选择计划回访时间', icon: 'none' }) - } - else if (that.data.distTabId==2&&that.data.distBizIndex == -1 ) { + } else if (that.data.distTabId == 2 && that.data.distBizIndex == -1) { wx.showToast({ title: '请选择门店', icon: 'none' }) - } - else{ + } else { that.setData({ submitFlag: true, }) let params = {}; params['ids'] = that.data.cid; - if(that.data.distTabId==1){ + if (that.data.distTabId == 1) { params['admin_id'] = that.data.employee_id; - params['visit_time'] = that.data.dateList[that.data.nextIndex].year +'-'+ that.data.dateList[that.data.nextIndex].month +'-'+ that.data.dateList[that.data.nextIndex].day; + params['visit_time'] = that.data.dateList[that.data.nextIndex].year + '-' + that.data.dateList[that.data.nextIndex].month + '-' + that.data.dateList[that.data.nextIndex].day; } - if(that.data.distTabId==2){ + if (that.data.distTabId == 2) { params['biz_id'] = that.data.distBiz_id; } _.apiQuery.putAppCustomersAdmins(params).then(res => { @@ -795,13 +794,13 @@ Page({ duration: 2000 }) that.setData({ - isShowEmployees:false, - submitFlag:false, - nextIndex:-1, + isShowEmployees: false, + submitFlag: false, + nextIndex: -1, }) that.onPullDownRefresh() - }).catch(res=>{ + }).catch(res => { that.setData({ submitFlag: false, }) @@ -810,69 +809,69 @@ Page({ }, //候取当前月日历 - getTimePicker(){ + getTimePicker() { let date = new Date(); let cYear = date.getFullYear(); //年份 - let cMonth = date.getMonth()+1; //当前月份 - let cDay = date.getDate();//当前日期 - let fweek = new Date(cYear,cMonth-1,1).getDay();//本月第一天星期几 - let days = new Date(cYear,cMonth,-1) - let cn = days.getDate()+1 //当月天数 - let rn = ''//上个月天数 + let cMonth = date.getMonth() + 1; //当前月份 + let cDay = date.getDate(); //当前日期 + let fweek = new Date(cYear, cMonth - 1, 1).getDay(); //本月第一天星期几 + let days = new Date(cYear, cMonth, -1) + let cn = days.getDate() + 1 //当月天数 + let rn = '' //上个月天数 if (cMonth === 1) { rn = 31 } else { - rn = new Date(cYear,cMonth-1,-1).getDate()+1 + rn = new Date(cYear, cMonth - 1, -1).getDate() + 1 } let dateList = [] - for(let i=0;i29){//相差15天以上不用特意补下个月 - let lweek = new Date(cYear,cMonth-1,cn).getDay();//本月最后天星期几 + if ((cn - cDay) > 29) { //相差15天以上不用特意补下个月 + let lweek = new Date(cYear, cMonth - 1, cn).getDay(); //本月最后天星期几 let sbu = 6 - lweek //最后一周补齐 - for(let i=1;i<=sbu;i++){ + for (let i = 1; i <= sbu; i++) { dateList.push({ - isopt:false, - checked:false, - year:cMonth == 12?cYear+1:cYear, - month:cMonth == 12?1:cMonth+1, - day:i + isopt: false, + checked: false, + year: cMonth == 12 ? cYear + 1 : cYear, + month: cMonth == 12 ? 1 : cMonth + 1, + day: i }) } - }else{ - let zbu = 30 - (cn-cDay) //至少要补多少天 - let bweek = ''//至少要补的最后一天星期几 - if(cMonth==12){ - bweek = new Date(cYear+1,1,zbu).getDay() - }else{ - bweek = new Date(cYear,cMonth,zbu).getDay() + } else { + let zbu = 30 - (cn - cDay) //至少要补多少天 + let bweek = '' //至少要补的最后一天星期几 + if (cMonth == 12) { + bweek = new Date(cYear + 1, 1, zbu).getDay() + } else { + bweek = new Date(cYear, cMonth, zbu).getDay() } let sbu = zbu + 6 - bweek //最后一周补齐 - for(let i=1;i<=sbu;i++){ + for (let i = 1; i <= sbu; i++) { dateList.push({ - isopt:false, - checked:false, - year:cMonth == 12?cYear+1:cYear, - month:cMonth == 12?1:cMonth+1, - day:i + isopt: false, + checked: false, + year: cMonth == 12 ? cYear + 1 : cYear, + month: cMonth == 12 ? 1 : cMonth + 1, + day: i }) } } @@ -887,31 +886,31 @@ Page({ }, //显示隐藏时间选择器 - optShowTimePicker(){ + optShowTimePicker() { this.setData({ - isShowTimePicker:!this.data.isShowTimePicker, + isShowTimePicker: !this.data.isShowTimePicker, }) let kd = 15 //可操作天数 - if(this.data.optLevel=='H'){ + if (this.data.optLevel == 'H') { kd = 3 - }else if(this.data.optLevel=='A'){ + } else if (this.data.optLevel == 'A') { kd = 7 - }else if(this.data.optLevel=='B'){ + } else if (this.data.optLevel == 'B') { kd = 15 - }else if(this.data.optLevel=='C'){ + } else if (this.data.optLevel == 'C') { kd = 30 } let cindex = '' let dateList = this.data.dateList - dateList.forEach((item,index) => { - if(item.year == this.data.cYear&&item.month == this.data.cMonth&&item.day == this.data.cDay){ + dateList.forEach((item, index) => { + if (item.year == this.data.cYear && item.month == this.data.cMonth && item.day == this.data.cDay) { cindex = index } }) - dateList.forEach((item,index) => { + dateList.forEach((item, index) => { item.isopt = false - if(cindex<=index&&index= 0){ + if (e.detail.value >= 0) { distBiz_id = this.data.bizobj[e.detail.value].id } this.setData({ distBiz_id, - distBizIndex:e.detail.value, + distBizIndex: e.detail.value, }) }, //多选 - checkPicker(e){ + checkPicker(e) { this.setData({ - ['staffobj['+e.currentTarget.dataset.index+'].checked']:!this.data.staffobj[e.currentTarget.dataset.index].checked, + ['staffobj[' + e.currentTarget.dataset.index + '].checked']: !this.data.staffobj[e.currentTarget.dataset.index].checked, }) }, //客户标签 - getAppCustomersTag(){ + getAppCustomersTag() { _.apiQuery.getAppCustomersTag().then(res => { this.setData({ - taglList:res.data.tags&&res.data.tags.length>0?res.data.tags:[], + taglList: res.data.tags && res.data.tags.length > 0 ? res.data.tags : [], }) }); }, //单选 - tagRadioPicker(e){ + tagRadioPicker(e) { let taglList = this.data.taglList taglList[e.currentTarget.dataset.i].list.forEach(item => { - item.checked=false + item.checked = false }) - taglList[e.currentTarget.dataset.i].list[e.currentTarget.dataset.j].checked=true + taglList[e.currentTarget.dataset.i].list[e.currentTarget.dataset.j].checked = true this.setData({ taglList, }) this.tagforEach() }, - + //多选 - tagCheckPicker(e){ + tagCheckPicker(e) { this.setData({ - ['taglList['+e.currentTarget.dataset.i+'].list['+e.currentTarget.dataset.j+'].checked']:!this.data.taglList[e.currentTarget.dataset.i].list[e.currentTarget.dataset.j].checked, + ['taglList[' + e.currentTarget.dataset.i + '].list[' + e.currentTarget.dataset.j + '].checked']: !this.data.taglList[e.currentTarget.dataset.i].list[e.currentTarget.dataset.j].checked, }) this.tagforEach() }, //tag遍历 - tagforEach(){ + tagforEach() { let taglList = this.data.taglList let tag_ids = '' taglList.forEach(itemA => { itemA.list.forEach(itemB => { - if(itemB.checked){ - itemA.have=true - if(tag_ids==''){ - tag_ids=itemB.id - }else{ - tag_ids=tag_ids+','+itemB.id + if (itemB.checked) { + itemA.have = true + if (tag_ids == '') { + tag_ids = itemB.id + } else { + tag_ids = tag_ids + ',' + itemB.id } } }) @@ -1014,13 +1013,13 @@ Page({ }, //获取城市 - getAppCityArea_city(){ + getAppCityArea_city() { let params = {}; params['type'] = 'city'; _.apiQuery.getAppCityArea(params).then(res => { let cityArr = [] let cityIndex = -1 - res.data.list.forEach((item,index) => { + res.data.list.forEach((item, index) => { cityArr.push(item.name) // if(this.data.city_id == item.id){ // cityIndex = index @@ -1029,39 +1028,39 @@ Page({ this.setData({ cityIndex, cityArr, - city:res.data.list + city: res.data.list }) }); }, //获取行政区 - getAppCityArea_county(){ + getAppCityArea_county() { let params = {}; params['pid'] = this.data.city_id; params['type'] = 'county'; _.apiQuery.getAppCityArea(params).then(res => { let countyArr = [] let countyIndex = -1 - res.data.list.forEach((item,index) => { + res.data.list.forEach((item, index) => { countyArr.push(item.name) - if(this.data.county_id == item.id){ + if (this.data.county_id == item.id) { countyIndex = index } }) this.setData({ countyIndex, countyArr, - county:res.data.list + county: res.data.list }) }); }, //选择城市 changeCity(e) { - if(this.data.cityIndex!=e.detail.value){ + if (this.data.cityIndex != e.detail.value) { this.setData({ - cityIndex:e.detail.value, - city_id:this.data.city[e.detail.value].id, + cityIndex: e.detail.value, + city_id: this.data.city[e.detail.value].id, }) this.getAppCityArea_county() } @@ -1069,30 +1068,30 @@ Page({ //选择地区 changeCounty(e) { - if(this.data.countyIndex!=e.detail.value){ + if (this.data.countyIndex != e.detail.value) { this.setData({ - countyIndex:e.detail.value, - county_id:this.data.county[e.detail.value].id, + countyIndex: e.detail.value, + county_id: this.data.county[e.detail.value].id, }) } }, //隐藏电话弹框 - hideCall(){ + hideCall() { this.setData({ - isShowCall:false, + isShowCall: false, }) }, //拨打电话 - makePhoneCall(){ + makePhoneCall() { wx.makePhoneCall({ phoneNumber: this.data.phoneNumber, }) }, //页面相关事件处理函数--监听用户下拉动作 - onPullDownRefresh(){ + onPullDownRefresh() { this.setData({ list: [], pageNo: 1, @@ -1106,20 +1105,20 @@ Page({ }, //页面上拉触底事件的处理函数 - onReachBottom(){ - if (this.data.noData || this.data.end||!this.data.load) return; + onReachBottom() { + if (this.data.noData || this.data.end || !this.data.load) return; this.setData({ flag: this.data.flag + 1 }) this.getAppCustomersList() }, - bindShowBrand(){ + bindShowBrand() { this.setData({ - brand_page_show:true + brand_page_show: true }) }, - //获取品牌信息 - getBrandData(e) { + //获取品牌信息 + getBrandData(e) { console.log(e.detail) if (e.detail.index > -1 && e.detail.item) { this.setData({ @@ -1133,4 +1132,40 @@ Page({ this.getAppSeries() } }, + //显示解锁 + showUnlock(e) { + this.setData({ + isShowLock: true, + cluesId: e.currentTarget.dataset.id + }) + }, + hideLock() { + this.setData({ + isShowLock: false + }) + }, + //解绑 + bindLock(){ + let that = this; + let params = { + 'id' : this.data.cluesId + }; + _.apiQuery.putAppCluesLock(params).then(res => { + wx.showToast({ + title: res.msg, + icon: 'success', + duration: 2000 + }) + that.hideLock(); + that.onPullDownRefresh(); + }) + }, + //跳转线索池详情 + goClues(e){ + let row = e.currentTarget.dataset.row; + let url = "/pages/clues/detail/index?id="+row.id+"&from=customer" + if(row.un_lock){ + _.$router.openUrlScheme(url); + } + } }) \ No newline at end of file diff --git a/pages/customer/index.wxml b/pages/customer/index.wxml index 15c89f7..deda417 100644 --- a/pages/customer/index.wxml +++ b/pages/customer/index.wxml @@ -11,9 +11,6 @@ - - {{'线索池'}} - {{item.name}} @@ -26,18 +23,19 @@ {{total}} - 排序: - - {{sortList[sortListIndex]}} - - + + 排序: + + {{sortList[sortListIndex]}} + + + - + 客户建卡 - {{cus_id}} {{name}} @@ -68,80 +66,85 @@ - - - - {{'客户'}} - ({{'12233336666'}}) - - - {{'距转派还剩4小时23分'}} - - - - - {{'入池时间'}} - {{'2023-04-12'}} - - - {{'意向车型'}} - {{'比亚迪·宋·2023款'}} - - - - - - - - - - - - {{item.defeat}} - {{item.orders_pay}} - - - - {{item.name}} - ({{item.mobile}}) - - + + + + + + {{item.name}} + ({{item.mobile}}) + + + {{'距转派还剩'+item.left_time+'秒'}} + - - 编号 {{item.cid}} - - {{tag}} - - - ... - - - - - - + + + 入池时间 + {{ item.c_time }} + + + 意向车型 + {{item.brand_detail}} + + + + - - - - {{key}} - - - {{value}} - 待分配 - {{value?'重新分配':'分配'}} - - - {{value}} - - - - + + + + + + {{item.defeat}} + {{item.orders_pay}} + + + + {{item.name}} + ({{item.mobile}}) + + + + + 编号 {{item.cid}} + + {{tag}} + + + ... + + + + + + + + + + + + + {{key}} + + + {{value}} + 待分配 + {{value?'重新分配':'分配'}} + + + {{value}} + + + + + + diff --git a/pages/mine/index.js b/pages/mine/index.js index eea3b17..73cf110 100644 --- a/pages/mine/index.js +++ b/pages/mine/index.js @@ -63,27 +63,29 @@ Page({ ] } // 20250624 - let mock_data = [{ - icon:'https://img.liche.cn/lichebao/menu-1.png', - title:'积分余额', - tip:'7999', - url:'/pages/customer/score/index' - },{ - icon:'https://img.liche.cn/lichebao/menu-2.png', - title:'核销记录', - url:'/pages/customer/score/exchange' - },{ - icon:'https://img.liche.cn/lichebao/menu-3.png', - title:'联系客服', - type:1, - url:'13455556666' - }] - let menu_list = mock_data.concat(list) - + // let mock_data = [{ + // icon:'https://img.liche.cn/lichebao/menu-1.png', + // title:'积分余额', + // tip:'7999', + // url:'/pages/customer/score/index' + // },{ + // icon:'https://img.liche.cn/lichebao/menu-2.png', + // title:'核销记录', + // url:'/pages/customer/score/exchange' + // },{ + // icon:'https://img.liche.cn/lichebao/menu-3.png', + // title:'联系客服', + // type:1, + // url:'13455556666' + // }] + // let menu_list = mock_data.concat(list) + // this.setData({ + // list: menu_list, + // }) this.setData({ - list: menu_list, + list: list, }) - + this.otherMenu() this.getUserInfo() console.log(this.data) wx.getSystemInfo({ @@ -120,17 +122,17 @@ Page({ this.setData({ userInfo: res }) - if (res.group_id != 4) { - let list = this.data.list - list.push({ - icon: 'https://qs.liche.cn/lichebao/mine/icon-sucai2.png', - title: '签到码', - url: '/pages/signup/code', - }) - this.setData({ - list, - }) - } + // let list = this.data.list + // if (res.group_id != 4) { + // list.push({ + // icon: 'https://qs.liche.cn/lichebao/mine/icon-sucai2.png', + // title: '签到码', + // url: '/pages/signup/code', + // }) + // this.setData({ + // list, + // }) + // } }); }, @@ -204,5 +206,17 @@ Page({ console.log(res) } }) + }, + //其他菜单 + otherMenu(){ + _.apiQuery.getUserMenu().then(res => { + let list = res.data + if(list){ + let menu_list = this.data.list.concat(list) + this.setData({ + list: menu_list + }) + } + }); } }) \ No newline at end of file