diff --git a/src/js/api.js b/src/js/api.js index 2d6b029..05dec09 100644 --- a/src/js/api.js +++ b/src/js/api.js @@ -2,6 +2,7 @@ // export const ORIGIN = `https://minimanage.ouxuanzhineng.cn`; // 正式 export const ORIGIN = `http://192.168.1.135:9090`; // 20210927 测试 + export const API = { wechatMiniAppLoginAndSync: `${ORIGIN}/assistant/WechatMiniAppGetToken`, // 小程序授权获取token,为空就登录 WechatMiniApplogin: `${ORIGIN}/assistant/WechatMiniApplogin`, // 小程序登录获取token diff --git a/src/pages/site/manage/manage.vue b/src/pages/site/manage/manage.vue index 91f2bbf..9e008d5 100644 --- a/src/pages/site/manage/manage.vue +++ b/src/pages/site/manage/manage.vue @@ -249,7 +249,6 @@ export default { }, timeSlotChange(e){ - console.log(e); let _timestamp = new Date(e.detail.value.replace(/\-/g, '/')).getTime(); // 当天0点时间 if(new Date().getTime() - _timestamp > 24*60*60*1000)return util.showNone('请选择正确时间!'); // 一天前 let _dateArr = this.getDateList({ @@ -257,7 +256,7 @@ export default { }) || []; this.dateList = _dateArr; this.curDateInfo = _dateArr[0] || {}; - console.log(_dateArr) + this.$nextTick(_=>this.refreshVenues()); }, // 刷新场地信息 @@ -267,6 +266,7 @@ export default { util.showLoad(); this.venueList = []; this.boardInfo = null; + this.selectedVenueList = []; let _res = await this.getVenueList({ type_key: curTypeInfo.key || '', stadium_id: curStoreInfo.id || '', @@ -395,10 +395,29 @@ export default { }, // - storePickerChange(e){ + async storePickerChange(e){ let { storeList } = this; - this.curStoreInfo = storeList[e.detail.value]; - this.$nextTick(_=>this.refreshVenues()); + let _curStore = storeList[e.detail.value] || {}; + this.curStoreInfo = _curStore; + this.venueList = []; + this.boardInfo = null; + this.typeList = []; // 类型列表 + this.curTypeInfo = {}; // 当前类型 + this.selectedVenueList = []; + try{ + let _typeInfo = await this.getClassify({ stadium_id: _curStore.id }); + let _typeList = _typeInfo || []; + this.typeList = _typeList; + if(!_typeList.length)return util.showNone('没有球类信息!'); + let _curType = _typeList[0]; + this.curTypeInfo = _curType; + this.$nextTick(_=>this.refreshVenues()); + }catch(err){ + util.showNone('切换门店失败!稍后重试!'); + } + + + }, typePckerChange(e){ console.log(e) @@ -428,10 +447,10 @@ export default { }) }, // 球类列表 - getClassify({stadium_id}){ + getClassify({ stadium_id }){ return servers.get({ url: API.venue.venueTypes, - data: {stadium_id}, + data: { stadium_id }, failMsg: '加载分类失败!' }) },