Commit 21d1af54 authored by agping's avatar agping

总监周报 城市选择

parent 8f3f1a3c
......@@ -27,7 +27,7 @@
</header>
<!--总监周报 加城市选择-->
<div class="top-city-select-area flex-center" >
<select @changeCity="changeCity">
<select @change="changeCity($event)">
<option v-for="(item, index) in dataListCity" :value="item.id">{{item.name}}</option>
</select>
</div>
......
......@@ -7,14 +7,17 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
token: localStorage.getItem('token'),
dataList: [],
dataListCity:[],
hrefPre: 'weekly_image?imgsrc='
hrefPre: 'weekly_image?imgsrc=',
isShowCity:false,
},
created: function() {
var _this = this;
document.body.style.display = 'block';
if(localStorage.getItem('userlevel')*1 != 20){//总监周报
_this.getCity();
}else{
_this.isShowCity = true;
}else{//店长周报
_this.isShowCity = false;
_this.loadMain();
}
......@@ -60,24 +63,27 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
});
},
getCity: function(){//获取总监的城市
loadMainZj: function(id){
var _this =this;
$.ajax({
type: 'GET',
url: ServerHostTempC + '/broker/getAgentDistrictId',
url: ServerHostTempC + '/broker/getWeekOrDayV2',
data: {
'AuthToken': localStorage.getItem('token'),
'phone': localStorage.getItem('userphone')
'AuthToken': _this.token,
'type': 0,
'agent_id': id,
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {
document.querySelector('#loading_pic').style.display = 'block';
document.querySelector('#no_more').style.display = 'none';
},
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
_this.dataListCity = _data.data;
_this.dataList = _data.data.list;
} else {
layerTipsX(_data['msg']);
}
......@@ -89,6 +95,8 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
layerTipsX('enter error');
},
complete: function(xhr, textStatus) {
document.querySelector('#loading_pic').style.display = 'none';
document.querySelector('#no_more').style.display = 'block';
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('overtime');
......@@ -97,7 +105,7 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
});
},
changeCity: function(){//切换城市
getCity: function(){//获取总监的城市
var _this =this;
$.ajax({
type: 'GET',
......@@ -115,6 +123,7 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
if(typeof _data === 'object') {
if(_data['code'] == '200') {
_this.dataListCity = _data.data;
_this.loadMainZj(_data.data[0].id);//默认显示第一个城市的总监周报
} else {
layerTipsX(_data['msg']);
}
......@@ -134,6 +143,12 @@ require(['vue', 'css!style/daily_my.css', 'jquery0325', 'common'],function(Vue){
});
},
changeCity: function(e){//切换城市
var _this =this;
_this.loadMainZj(e.target.value);//总监周报 切换城市
},
}
});
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment