|
@@ -85,25 +85,44 @@ export default <LibMixins>{
|
|
|
popup.$loading('获取中');
|
|
|
},500);
|
|
|
|
|
|
- Promise.all([this.getPlayInfo(),this.getPlayList()]).then(([info,playData])=>{
|
|
|
+ Promise.all([this.getPlayInfo(),this.getPlayList(),this.getDetail()]).then(([info,playData,detail])=>{
|
|
|
this.clearTargetDetail();
|
|
|
|
|
|
playData = playData.data.palyer_game_list || [];
|
|
|
|
|
|
- playData = playData.map((item,index)=>{
|
|
|
- return {
|
|
|
+ let unshiftData;
|
|
|
+
|
|
|
+ let resultData = [];
|
|
|
+
|
|
|
+ playData.map((item,index)=>{
|
|
|
+
|
|
|
+ let resultItem = {
|
|
|
label: item.game_name,
|
|
|
slot: 'tab-'+index,
|
|
|
pid: item.pid,
|
|
|
price: item.price
|
|
|
}
|
|
|
+
|
|
|
+ if (item.pid === this.item.pid) {
|
|
|
+ unshiftData = resultItem;
|
|
|
+ } else {
|
|
|
+ resultData.push(resultItem);
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
|
|
|
+ unshiftData && resultData.unshift(unshiftData);
|
|
|
+
|
|
|
info = info.data || {};
|
|
|
|
|
|
- info.gameList = playData;
|
|
|
+ info.gameList = resultData;
|
|
|
+
|
|
|
+ if (detail) {
|
|
|
+ info.gameInfo = {
|
|
|
+ [this.item.pid]:detail
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- console.log(info);
|
|
|
|
|
|
// info
|
|
|
if (!info.images) {
|
|
@@ -156,6 +175,34 @@ export default <LibMixins>{
|
|
|
},
|
|
|
token:true
|
|
|
})
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取陪玩当前游戏的详情
|
|
|
+ getDetail(){
|
|
|
+
|
|
|
+ return new Promise((resolve)=>{
|
|
|
+ this.$request({
|
|
|
+ url:'player/get_player_info',
|
|
|
+ data:{
|
|
|
+ pid: this.item.pid
|
|
|
+ },
|
|
|
+ cache:{
|
|
|
+ type: InstructionsCacheType.memory
|
|
|
+ },
|
|
|
+ token:true
|
|
|
+ }).then((data)=>{
|
|
|
+ data = data.data || {};
|
|
|
+
|
|
|
+ data.game_info.skill_level_list.map((item)=>{
|
|
|
+ if (item.lid === data.lid) {
|
|
|
+ data.game_level_name = item.game_level_name;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ resolve(data);
|
|
|
+
|
|
|
+ }).catch(()=> resolve(undefined));
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
},
|