城市筛查

This commit is contained in:
老叶
2023-03-07 11:07:16 +08:00
parent 289a764026
commit 89c27cb9e0
5 changed files with 112 additions and 4 deletions
+1 -1
View File
@@ -104,7 +104,7 @@
</picker>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{city_id}}">
<view class="absolute left-0 box-middle">所在地区</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeCounty" value="{{countyIndex}}" range="{{countyArr}}">
+1 -1
View File
@@ -85,7 +85,7 @@
</picker>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{city_id}}">
<view class="absolute left-0 box-middle">所在地区</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeCounty" value="{{countyIndex}}" range="{{countyArr}}">
+82
View File
@@ -88,6 +88,11 @@ Page({
bizArray: [],
bizobj: [],
tag_ids:'',
cityIndex:-1,
city_id:'',
countyIndex:-1,
county_id:'',
},
onLoad(options) {
for (let key in options) {
@@ -115,6 +120,9 @@ Page({
this.getAppCustomersTag()
//获取城市列表
this.getAppCityArea_city()
},
onShow(){
@@ -296,6 +304,12 @@ Page({
// if(this.data.staffIndex>-1){
// params['admin_id'] = this.data.staffobj[this.data.staffIndex].id;
// }
if(this.data.city_id!=''){
params['city_id'] = this.data.city_id;
}
if(this.data.county_id!=''){
params['county_id'] = this.data.county_id;
}
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;
@@ -582,6 +596,10 @@ Page({
cfromIndex:-1,
staffIndex:-1,
tag_ids:'',
cityIndex:-1,
city_id:'',
countyIndex:-1,
county_id:'',
})
this.getAppCustomersTag()
},
@@ -980,6 +998,70 @@ Page({
})
},
//获取城市
getAppCityArea_city(){
let params = {};
params['type'] = 'city';
_.apiQuery.getAppCityArea(params).then(res => {
let cityArr = []
let cityIndex = -1
res.data.list.forEach((item,index) => {
cityArr.push(item.name)
// if(this.data.city_id == item.id){
// cityIndex = index
// }
})
this.setData({
cityIndex,
cityArr,
city:res.data.list
})
});
},
//获取行政区
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) => {
countyArr.push(item.name)
if(this.data.county_id == item.id){
countyIndex = index
}
})
this.setData({
countyIndex,
countyArr,
county:res.data.list
})
});
},
//选择城市
changeCity(e) {
if(this.data.cityIndex!=e.detail.value){
this.setData({
cityIndex:e.detail.value,
city_id:this.data.city[e.detail.value].id,
})
this.getAppCityArea_county()
}
},
//选择地区
changeCounty(e) {
if(this.data.countyIndex!=e.detail.value){
this.setData({
countyIndex:e.detail.value,
county_id:this.data.county[e.detail.value].id,
})
}
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh(){
this.setData({
+27 -1
View File
@@ -39,6 +39,12 @@
<view class="inline-block text-middle bg-f6 color-666 mb15 ml5 mr5 pt5 pb5 pl20 pr20 ulib-r10 font-22" wx:if="{{cus_id}}">{{cus_id}}</view>
<view class="inline-block text-middle bg-f6 color-666 mb15 ml5 mr5 pt5 pb5 pl20 pr20 ulib-r10 font-22" wx:if="{{name}}">{{name}}</view>
<view class="inline-block text-middle bg-f6 color-666 mb15 ml5 mr5 pt5 pb5 pl20 pr20 ulib-r10 font-22" wx:if="{{mobile}}">{{mobile}}</view>
<block wx:for="{{city}}" wx:key='index'>
<view class="inline-block text-middle bg-f6 color-666 mb15 ml5 mr5 pt5 pb5 pl20 pr20 ulib-r10 font-22" wx:if="{{item.id==city_id}}">{{item.name}}</view>
</block>
<block wx:for="{{county}}" wx:key='index'>
<view class="inline-block text-middle bg-f6 color-666 mb15 ml5 mr5 pt5 pb5 pl20 pr20 ulib-r10 font-22" wx:if="{{item.id==county_id}}">{{item.name}}</view>
</block>
<block wx:if="{{s_time&&e_time}}">
<view class="inline-block text-middle bg-f6 color-666 mb15 ml5 mr5 pt5 pb5 pl20 pr20 ulib-r10 font-22">{{s_time}}</view>
<view class="inline-block text-middle bg-f6 color-666 mb15 ml5 mr5 pt5 pb5 pl20 pr20 ulib-r10 font-22">{{e_time}}</view>
@@ -149,6 +155,26 @@
<input class="wp100 height-90 text-right font-28" placeholder-class="color-ccc" type="number" placeholder="请输入客户手机号" bindinput='inputTx' data-key="mobile" name='mobile' value='{{mobile}}' />
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">所在城市</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeCity" value="{{cityIndex}}" range="{{cityArr}}">
<text class="color-ccc" wx:if="{{cityIndex == -1}}">请选择</text>
<text wx:else>{{cityArr[cityIndex]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{city_id}}">
<view class="absolute left-0 box-middle">所在地区</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeCounty" value="{{countyIndex}}" range="{{countyArr}}">
<text class="color-ccc" wx:if="{{countyIndex == -1}}">请选择</text>
<text wx:else>{{countyArr[countyIndex]}}</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 color-333">建卡开始时间</view>
<view class="pt25 pb25 text-right font-28 color-666">
@@ -295,7 +321,7 @@
</view>
<view class="pt50 pb100"></view>
</scroll-view>
<view class="absolute left-0 bottom-0 right-0 fn-flex mb180 pt20 pb20 pl60 pr60 bg-fff-op90 text-center">
<view class="absolute left-0 bottom-0 right-0 fn-flex pt20 pb200 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="resetFilter">重置</view>
<view class="fn-flex-item ml20 pt15 pb15 bg-36afa2 font-32 color-fff ulib-r750" bindtap="submitFilter">确定</view>
</view>
+1 -1
View File
@@ -220,7 +220,7 @@
</view>
<view class="pt50 pb100"></view>
</scroll-view>
<view class="absolute left-0 bottom-0 right-0 fn-flex mb180 pt20 pb20 pl60 pr60 bg-fff-op90 text-center">
<view class="absolute left-0 bottom-0 right-0 fn-flex pb200 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="resetFilter">重置</view>
<view class="fn-flex-item ml20 pt15 pb15 bg-36afa2 font-32 color-fff ulib-r750" bindtap="submitFilter">确定</view>
</view>