|
|
@ -118,6 +118,7 @@ export default { |
|
|
|
occupyTypeInfo: { |
|
|
|
occupyType: 'normal', // normal:教练占场, exp_booking: 代表体验课占场 |
|
|
|
exp_booking_ids: [], // 体验课预约id数组 |
|
|
|
course_id: '', // 课程id |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
@ -130,19 +131,20 @@ export default { |
|
|
|
tipTimer = null; |
|
|
|
}, |
|
|
|
async onLoad(options){ |
|
|
|
let _optionsQuery = {}; |
|
|
|
if(options.query){ |
|
|
|
let _optionsQuery = util.jsonPar(options.query); |
|
|
|
_optionsQuery = util.jsonPar(options.query); |
|
|
|
if(!!_optionsQuery.occupyType)this.occupyTypeInfo = _optionsQuery; |
|
|
|
} |
|
|
|
try { |
|
|
|
util.showLoad(); |
|
|
|
let _storeInfo = await this.getStoreList(); |
|
|
|
let _storeInfo = await this.getStoreList(_optionsQuery.course_id); |
|
|
|
let _storeList = _storeInfo.stadium_data || []; |
|
|
|
if(!_storeList.length)return util.showNone('没有店铺信息!'); |
|
|
|
this.storeList = _storeList ; |
|
|
|
let _curStore = _storeList[0] || {}; |
|
|
|
this.curStoreInfo = _curStore; |
|
|
|
let _typeInfo = await this.getClassify({ stadium_id: _curStore.id }); |
|
|
|
let _typeInfo = await this.getClassify({ stadium_id: _curStore.id, course_id: _optionsQuery.course_id }); |
|
|
|
let _typeList = _typeInfo || []; |
|
|
|
this.typeList = _typeList; |
|
|
|
if(!_typeList.length)return util.showNone('没有球类信息!'); |
|
|
@ -324,18 +326,18 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 球类列表 |
|
|
|
getClassify({stadium_id}){ |
|
|
|
getClassify({stadium_id, course_id = ''}){ |
|
|
|
return servers.get({ |
|
|
|
url: API.venueTypes, |
|
|
|
data: {stadium_id}, |
|
|
|
data: { stadium_id, course_id }, |
|
|
|
failMsg: '加载分类失败!' |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 店铺列表 |
|
|
|
getStoreList(){ |
|
|
|
getStoreList( course_id = '' ){ |
|
|
|
return servers.get({ |
|
|
|
url: API.getHomeData, |
|
|
|
data: {}, |
|
|
|
data: { course_id }, |
|
|
|
failMsg: '加载店铺失败!' |
|
|
|
}) |
|
|
|
}, |
|
|
|