Browse Source

add collection stadium_id_filter

organize
刘嘉炜 3 years ago
parent
commit
5f20fb54ea
  1. 25
      src/pages/collection/info/info.vue
  2. 3
      src/pages/collection/list/list.vue

25
src/pages/collection/info/info.vue

@ -82,7 +82,10 @@ export default {
},
data(){
return {
optionsQuery: {},
optionsQuery: {
// stadium_id_filter
// brand_id
},
stadiumList: [],
curStadium: {},
sceneList: [],
@ -98,7 +101,7 @@ export default {
onReachBottom(){
let { curStadium, optionsQuery, curScene, curDate, curType, page } = this;
let _query = {
brand_id: optionsQuery.brand_id,
brand_id: optionsQuery.brand_id || '',
stadium_id: curStadium.val || '',
time_str: curDate,
scene: curScene.scene,
@ -119,7 +122,7 @@ export default {
this.$nextTick(_=>this.refreshList());
},
async initPage(options){
let _stadiumLs = await this.getStoreList(options.stadium_id);
let _stadiumLs = await this.getStoreList(options.stadium_id_filter);
let _sceneLs = await this.getSceneList();
this.curDate = util.formatDate({});
this.$nextTick(_=>this.refreshList());
@ -130,7 +133,7 @@ export default {
this.recordLs = [];
let _query = {
brand_id: optionsQuery.brand_id,
brand_id: optionsQuery.brand_id || '',
stadium_id: curStadium.val || '',
time_str: curDate,
scene: curScene.scene,
@ -192,12 +195,12 @@ export default {
})
},
//
getStoreList(stadium_id = ''){
getStoreList(stadium_id_filter = ''){
let { optionsQuery } = this;
return servers.get({
url: API.consumeCountStadiumList,
data: {
brand_id: optionsQuery.brand_id,
brand_id: optionsQuery.brand_id || '',
},
failMsg: '加载店铺列表失败!',
@ -205,16 +208,14 @@ export default {
.then(res=>{
let _list = res || [];
let _cur = null;
if(!!stadium_id){
let _fiLs = _list.filter(e=> +e.val == stadium_id);
// undefined => 'undefined'
if(stadium_id_filter != undefined&&stadium_id_filter != 'undefined'){
let _fiLs = _list.filter(e=> e.val == stadium_id_filter);
if(_fiLs.length)_cur = _fiLs[0];
}
if(_cur&&_cur.val){
this.curStadium = _cur;
}else if(optionsQuery.stadium_id == 0){
let _fLs = _list.filter(e=> +e.val == -1);
if(_fLs.length)this.curStadium = _fLs[0] || {};
}else{
this.curStadium = _list[0] || {};
}
@ -227,7 +228,7 @@ export default {
return servers.get({
url: API.consumeCountGetScene,
data: {
brand_id: optionsQuery.brand_id,
brand_id: optionsQuery.brand_id || '',
stadium_id: curStadium.val || '',
},
failMsg: '加载场景列表失败!',

3
src/pages/collection/list/list.vue

@ -65,7 +65,8 @@ export default {
},
methods: {
toInfo(e){
util.routeTo(`/pages/collection/info/info?stadium_id=${e.stadium_id}&brand_id=${e.brand_id}`, 'nT')
let _qyStr = `stadium_id_filter=${e.stadium_id_filter}&brand_id=${e.brand_id}`
util.routeTo(`/pages/collection/info/info?${_qyStr}`, 'nT')
},
showModal(e){
util.showModal({

Loading…
Cancel
Save