From 2de3af6a852e2ca4cc739cfd9ce48c002e41b160 Mon Sep 17 00:00:00 2001 From: lcc Date: Tue, 11 Mar 2025 00:06:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=B7=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/js/config.js | 2 + commons/js/utils/apiQuery.js | 7 ++++ components/brandSelect/index.js | 55 ++++++++++++++++------------ components/brandSelect/index.wxml | 4 +- pages/customer/addCard/index.js | 59 +++++++++++++++++++++++------- pages/customer/addCard/index.wxml | 13 ++++++- pages/customer/editCard/index.js | 50 ++++++++++++++++++++----- pages/customer/editCard/index.wxml | 21 +++++++---- 8 files changed, 155 insertions(+), 56 deletions(-) diff --git a/commons/js/config.js b/commons/js/config.js index 6532c79..ab78a51 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -189,6 +189,8 @@ api = { appScoreLists: "app/score/lists", //运营分排行 appScoreDetail: "app/score/detail", //运营分详情 appRadar: "app/score/radar", //雷达图数据 + + appPaic: "app/paic", //平安用户 } //远程图片存储地址 diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index d1829ed..faef756 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -1087,4 +1087,11 @@ apiQuery.appRadar = function(params){ }) } +//雷达图 +apiQuery.appPaic = function(params){ + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appPaic, 2, params, "GET", resolve, reject) + }) +} + export default apiQuery; \ No newline at end of file diff --git a/components/brandSelect/index.js b/components/brandSelect/index.js index 1c67f2c..a004682 100644 --- a/components/brandSelect/index.js +++ b/components/brandSelect/index.js @@ -35,7 +35,19 @@ Component({ overlayStyle: { type: String, value: 'background-color: rgba(0, 0, 0, 0.7)' + }, + title: { + type: String, + value: '品牌名' }, + loadAll: { + type: Boolean, + value: false + }, + apiType: { + type: String, + value: '' + } }, attached(){ debouncetimer = null @@ -57,25 +69,6 @@ Component({ data: { show_page: false, list: [], - // list: [{ - // id: 1, - // name: '宝马' - // },{ - // id: 1, - // name: '宝马' - // },{ - // id: 1, - // name: '宝马' - // },{ - // id: 1, - // name: '宝马' - // },{ - // id: 1, - // name: '宝马' - // },{ - // id: 1, - // name: '宝马' - // }], cur: -1, keyword: '', item: {} @@ -89,7 +82,14 @@ Component({ // console.log(res) }, onEnter(res) { + this.setData({ + keyword:'', + list:[] + }) // console.log(res) + if(this.data.loadAll){ + this.apiGetMbrand('') + } this.triggerEvent('enter') }, onAfterEnter(res) { @@ -158,11 +158,20 @@ Component({ //app/series/mbrand apiGetMbrand(keyword){ - _.apiQuery.getMbrand({keyword}).then(res => { - this.setData({ - list: res.data.list + if(this.data.apiType=='appPaic'){ + _.apiQuery.appPaic({keyword}).then(res => { + this.setData({ + list: res.data.list + }) }) - }) + }else{ + _.apiQuery.getMbrand({keyword}).then(res => { + this.setData({ + list: res.data.list + }) + }) + } + } } }) \ No newline at end of file diff --git a/components/brandSelect/index.wxml b/components/brandSelect/index.wxml index 1430a5c..d7da34c 100644 --- a/components/brandSelect/index.wxml +++ b/components/brandSelect/index.wxml @@ -4,7 +4,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/pages/customer/addCard/index.js b/pages/customer/addCard/index.js index d30c823..2d9c77a 100644 --- a/pages/customer/addCard/index.js +++ b/pages/customer/addCard/index.js @@ -61,6 +61,12 @@ Page({ car_id: '', //车型id carIndex: -1, //车型索引 carArray: [], + cf_pid: '', //平安用户id + cf_name: '', //平安用户名 + cf_pid_page_show: false, + searchTitle: '品牌名', + loadAll: false, + apiType: 'brand', }, //生命周期函数--监听页面加载 onLoad: function (options) { @@ -373,6 +379,7 @@ Page({ params['brand_id'] = this.data.brand_id; params['series_id'] = this.data.series_id; params['car_id'] = this.data.car_id; + params['cf_pid'] = this.data.cf_pid; _.apiQuery.postAppCustomers(params).then(res => { //刷新列表页 @@ -703,6 +710,18 @@ Page({ //显示选择品牌 bindShowBrand() { this.setData({ + searchTitle: '品牌名', + loadAll: false, + apiType: '', + brand_page_show: true + }) + }, + //显示选择平安用户 + bindShowCfPid() { + this.setData({ + searchTitle: '用户名', + loadAll: false, + apiType: 'appPaic', brand_page_show: true }) }, @@ -710,18 +729,32 @@ Page({ getBrandData(e) { console.log(e.detail) if (e.detail.index > -1 && e.detail.item) { - this.setData({ - brand_id: e.detail.item.id, - brand_name: e.detail.item.name, - brandIndex: e.detail.index, - series_id: '', //车系id - modelArray: [], - modelIndex: -1, //车系车型索引 - car_id: '', //车系id - carArray: [], //车辆版本列表 - carIndex: -1, //车辆版本索引 - }) - this.getAppSeries() + if (this.data.apiType == 'appPaic') { + this.setData({ + cf_pid: e.detail.item.id, + cf_name: e.detail.item.name + }) + } else { + this.setData({ + brand_id: e.detail.item.id, + brand_name: e.detail.item.name, + brandIndex: e.detail.index, + series_id: '', //车系id + modelArray: [], + modelIndex: -1, //车系车型索引 + car_id: '', //车系id + carArray: [], //车辆版本列表 + carIndex: -1, //车辆版本索引 + }) + this.getAppSeries() + } + } else { + if (this.data.apiType == 'appPaic') { + this.setData({ + cf_pid: '', + cf_name: '' + }) + } } - } + }, }) \ No newline at end of file diff --git a/pages/customer/addCard/index.wxml b/pages/customer/addCard/index.wxml index 0299c2f..581c86c 100644 --- a/pages/customer/addCard/index.wxml +++ b/pages/customer/addCard/index.wxml @@ -154,7 +154,7 @@ 重点关注车型 - + {{brand_name||'请选择'}} 请选择 @@ -171,6 +171,15 @@ + + + 平安推荐 + + {{cf_name||'请选择'}} + 请选择 + + + 重点关注车型 - - - {{brand_name||'请选择'}} - 请选择 - - + + {{brand_name||'请选择'}} + 请选择 + @@ -160,6 +158,15 @@ + + + 平安推荐 + + {{cf_name||'请选择'}} + 请选择 + + + @@ -193,4 +200,4 @@ - \ No newline at end of file + \ No newline at end of file