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

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

@ -65,7 +65,8 @@ export default {
}, },
methods: { methods: {
toInfo(e){ 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){ showModal(e){
util.showModal({ util.showModal({

Loading…
Cancel
Save