修改小程序新增客户池

This commit is contained in:
lcc
2025-03-11 00:06:11 +08:00
committed by lcc
parent 1051691f80
commit e843ab4e11
8 changed files with 155 additions and 56 deletions
+2
View File
@@ -189,6 +189,8 @@ api = {
appScoreLists: "app/score/lists", //运营分排行
appScoreDetail: "app/score/detail", //运营分详情
appRadar: "app/score/radar", //雷达图数据
appPaic: "app/paic", //平安用户
}
//远程图片存储地址
+7
View File
@@ -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;
+32 -23
View File
@@ -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
})
})
}
}
}
})
+2 -2
View File
@@ -4,7 +4,7 @@
<view class="detail-page fn-flex" style="flex-direction:column;">
<view class="inner30">
<view class="ulib-r20 bds-2-eb text-center pt15 pb15">
<input placeholder="请输入品牌名" value="{{keyword}}" bindinput="bindInputKeyword"/>
<input placeholder="请输入{{title}}" value="{{keyword}}" bindinput="bindInputKeyword"/>
</view>
</view>
<view class="list fn-flex-item relative">
@@ -21,7 +21,7 @@
</scroll-view>
</view>
<!-- <view class="color-fff">请输入品牌名</view> -->
<listmore wx:else isMiddle="{{true}}" noDataMsg="请输入品牌名" isNoData="{{true}}"></listmore>
<listmore wx:else isMiddle="{{true}}" noDataMsg="请输入{{title}}" isNoData="{{true}}"></listmore>
</view>
<view class="pb150 pl80 pr80 fn-flex">
<button class="btn btn-36afa2 color-fff fn-flex-item" style="transition: .2s all ease;" hover-class="btn-36afa2-hover" bindtap="exit" disabled="{{!(cur>-1)}}">我选好了</button>
+46 -13
View File
@@ -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: ''
})
}
}
}
},
})
+11 -2
View File
@@ -154,7 +154,7 @@
<view class="relative bbs-1-eb last-b-none pl190" wx:if="{{status==0}}">
<view class="absolute left-0 box-middle font-28 color-333">重点关注车型</view>
<view class="pt30 pb30 text-right font-28 color-666">
<view class="pt30 pb30 text-right font-28 color-666" bindtap="bindShowBrand">
<view bindtap="bindShowBrand">
<text wx:if="{{brand_name}}}">{{brand_name||'请选择'}}</text>
<text class="color-ccc" wx:else>请选择</text>
<i class="iconfont ml5 icon-gengduo"></i>
@@ -171,6 +171,15 @@
</picker>
</view>
</view>
<!--平安推荐-->
<view class="relative bbs-1-eb last-b-none pl190">
<view class="absolute left-0 box-middle font-28 color-333">平安推荐</view>
<view class="pt30 pb30 text-right font-28 color-666" bindtap="bindShowCfPid">
<text wx:if="{{cf_name}}}">{{cf_name||'请选择'}}</text>
<text class="color-ccc" wx:else>请选择</text>
<i class="iconfont ml5 icon-gengduo"></i>
</view>
</view>
<!--
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{modelIndex != -1}}">
<view class="absolute left-0 box-middle font-28 color-333">车辆版本</view>
@@ -233,4 +242,4 @@
</view>
</lcb-msg>
<brandSelect show="{{brand_page_show}}" bindleave="getBrandData"></brandSelect>
<brandSelect show="{{brand_page_show}}" title="{{searchTitle}}" loadAll="{{loadAll}}" apiType="{{apiType}}" bindleave="getBrandData"></brandSelect>
+41 -9
View File
@@ -52,6 +52,12 @@ Page({
series_id: '', //车系id
modelArray: [],
modelIndex: -1, //车系车型索引
cf_pid: '', //平安用户id
cf_name: '', //平安用户名
cf_pid_page_show: false,
searchTitle: '品牌名',
loadAll: false,
apiType: 'brand',
},
//生命周期函数--监听页面加载
onLoad: function (options) {
@@ -83,6 +89,8 @@ Page({
brand_id: res.data.baseinfo.brand.id ? res.data.baseinfo.brand.id : 0,
brand_name: res.data.baseinfo.brand.name ? res.data.baseinfo.brand.name : '',
series_id: res.data.baseinfo.series_id ? res.data.baseinfo.series_id : '',
cf_pid: res.data.baseinfo.cf_pid ? res.data.baseinfo.cf_pid : '',
cf_name: res.data.baseinfo.cf_name ? res.data.baseinfo.cf_name : '',
})
// this.data.c_brandArray.forEach((item,index) => {
@@ -465,6 +473,7 @@ Page({
}
params['brand_id'] = that.data.brand_id;
params['series_id'] = that.data.series_id;
params['cf_pid'] = that.data.cf_pid;
_.apiQuery.putAppCustomerData(params).then(res => {
//刷新列表页
@@ -759,19 +768,42 @@ Page({
brand_page_show: true
})
},
//显示选择平安用户
bindShowCfPid() {
this.setData({
searchTitle: '用户名',
loadAll: false,
apiType: 'appPaic',
brand_page_show: true
})
},
//获取品牌信息
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, //车系车型索引
})
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, //车系车型索引
})
}
this.getAppSeries()
} else {
if (this.data.apiType == 'appPaic') {
this.setData({
cf_pid: '',
cf_name: ''
})
}
}
this.getAppSeries()
},
})
+14 -7
View File
@@ -142,12 +142,10 @@
<!--车型库品牌-->
<view class="relative bbs-1-eb last-b-none pl190">
<view class="absolute left-0 box-middle font-28 color-333">重点关注车型</view>
<view class="pt30 pb30 text-right font-28 color-666">
<view class="pt30 pb30 text-right font-28 color-666" bindtap="bindShowBrand">
<text wx:if="{{brand_name}}}">{{brand_name||'请选择'}}</text>
<text class="color-ccc" wx:else>请选择</text>
<i class="iconfont ml5 icon-gengduo"></i>
</view>
<view class="pt30 pb30 text-right font-28 color-666" bindtap="bindShowBrand">
<text wx:if="{{brand_name}}}">{{brand_name||'请选择'}}</text>
<text class="color-ccc" wx:else>请选择</text>
<i class="iconfont ml5 icon-gengduo"></i>
</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{brand_id}}">
@@ -160,6 +158,15 @@
</picker>
</view>
</view>
<!--平安推荐-->
<view class="relative bbs-1-eb last-b-none pl190">
<view class="absolute left-0 box-middle font-28 color-333">平安推荐</view>
<view class="pt30 pb30 text-right font-28 color-666" bindtap="bindShowCfPid">
<text wx:if="{{cf_name}}}">{{cf_name||'请选择'}}</text>
<text class="color-ccc" wx:else>请选择</text>
<i class="iconfont ml5 icon-gengduo"></i>
</view>
</view>
<block wx:for='{{taglList}}' wx:for-item='list' wx:for-index='i' wx:key='i'>
<view class="relative mt30">
<view class="font-28">
@@ -193,4 +200,4 @@
</view>
<lcb-footer></lcb-footer>
<lcb-backChannel></lcb-backChannel>
<brandSelect show="{{brand_page_show}}" bindleave="getBrandData"></brandSelect>
<brandSelect show="{{brand_page_show}}" title="{{searchTitle}}" loadAll="{{loadAll}}" apiType="{{apiType}}" bindleave="getBrandData"></brandSelect>