|
@@ -1,10 +1,8 @@
|
|
|
import audio, {TriggerAudioListener,PlayStatus} from "$utils/tool/audio";
|
|
|
|
|
|
import popup from "$utils/tool/popup";
|
|
|
-import {InstructionsCacheType} from "$utils/request";
|
|
|
-import {PopupExportComponent} from "$popup/popup-export/const";
|
|
|
|
|
|
-import user from '$config/user';
|
|
|
+import personalDetail from '$utils/control/personal-detail';
|
|
|
|
|
|
export default <LibMixins>{
|
|
|
|
|
@@ -79,133 +77,138 @@ export default <LibMixins>{
|
|
|
|
|
|
triggerDetail(){
|
|
|
|
|
|
- if (!user.verificationLogin()) return;
|
|
|
-
|
|
|
- this.clearTargetDetail();
|
|
|
-
|
|
|
- this.detailTime = setTimeout(()=>{
|
|
|
- popup.$loading('获取中');
|
|
|
- },500);
|
|
|
-
|
|
|
- Promise.all([this.getPlayInfo(),this.getPlayList(),this.getDetail()]).then(([info,playData,detail])=>{
|
|
|
- this.clearTargetDetail();
|
|
|
-
|
|
|
- playData = playData.data.palyer_game_list || [];
|
|
|
-
|
|
|
- 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 = resultData;
|
|
|
-
|
|
|
- if (detail) {
|
|
|
- info.gameInfo = {
|
|
|
- [this.item.pid]:detail
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- // info
|
|
|
- if (!info.images) {
|
|
|
- info.images = [this.item.cover_image];
|
|
|
- } else {
|
|
|
- info.images = info.images.split(',');
|
|
|
- }
|
|
|
-
|
|
|
- popup.$popup.open(PopupExportComponent.detail,{
|
|
|
- option: info
|
|
|
- });
|
|
|
-
|
|
|
- }).catch(()=> this.clearTargetDetail('服务繁忙'));
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- clearTargetDetail(fail?:string){
|
|
|
- clearTimeout(this.detailTime);
|
|
|
- popup.hideLoading();
|
|
|
-
|
|
|
- if (fail) {
|
|
|
- popup.$toast(fail);
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- // 获取陪玩基本信息
|
|
|
- getPlayInfo() {
|
|
|
- return this.$request({
|
|
|
- url:'hxuser/get_base_user_info',
|
|
|
- data:{
|
|
|
- uid: this.item.uid
|
|
|
- },
|
|
|
- cache:{
|
|
|
- type: InstructionsCacheType.memory
|
|
|
- },
|
|
|
- token:true
|
|
|
+ console.log(this.item);
|
|
|
+ return personalDetail.openDetail({
|
|
|
+ uid: this.item.uid,
|
|
|
+ pid: this.item.pid
|
|
|
});
|
|
|
- },
|
|
|
+ // if (!user.verificationLogin()) return;
|
|
|
+ //
|
|
|
+ // this.clearTargetDetail();
|
|
|
+ //
|
|
|
+ // popup.$loading({
|
|
|
+ // title:'获取中',
|
|
|
+ // delay:1000
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // Promise.all([this.getPlayInfo(),this.getPlayList(),this.getDetail()]).then(([info,playData,detail])=>{
|
|
|
+ // this.clearTargetDetail();
|
|
|
+ //
|
|
|
+ // playData = playData.data.palyer_game_list || [];
|
|
|
+ //
|
|
|
+ // 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 = resultData;
|
|
|
+ //
|
|
|
+ // if (detail) {
|
|
|
+ // info.gameInfo = {
|
|
|
+ // [this.item.pid]:detail
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // // info
|
|
|
+ // if (!info.images) {
|
|
|
+ // info.images = [this.item.cover_image];
|
|
|
+ // } else {
|
|
|
+ // info.images = info.images.split(',');
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // popup.$popup.open(PopupExportComponent.detail,{
|
|
|
+ // option: info
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // }).catch(()=> this.clearTargetDetail('服务繁忙'));
|
|
|
|
|
|
- // 获取陪玩下的游戏列表
|
|
|
- getPlayList(){
|
|
|
- return this.$request({
|
|
|
- url:'player/get_player_game_lists',
|
|
|
- data:{
|
|
|
- pid: this.item.pid
|
|
|
- },
|
|
|
- cache:{
|
|
|
- type: InstructionsCacheType.memory
|
|
|
- },
|
|
|
- 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));
|
|
|
- });
|
|
|
- }
|
|
|
+ // clearTargetDetail(fail?:string){
|
|
|
+ // popup.hideLoading();
|
|
|
+ // if (fail) {
|
|
|
+ // popup.$toast(fail);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // },
|
|
|
+ //
|
|
|
+ // // 获取陪玩基本信息
|
|
|
+ // getPlayInfo() {
|
|
|
+ // return this.$request({
|
|
|
+ // url:'hxuser/get_base_user_info',
|
|
|
+ // data:{
|
|
|
+ // uid: this.item.uid
|
|
|
+ // },
|
|
|
+ // cache:{
|
|
|
+ // type: InstructionsCacheType.memory,
|
|
|
+ // id: 'get_base_user_info-'+this.item.uid
|
|
|
+ // },
|
|
|
+ // token:true
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ //
|
|
|
+ // // 获取陪玩下的游戏列表
|
|
|
+ // getPlayList(){
|
|
|
+ // return this.$request({
|
|
|
+ // url:'player/get_player_game_lists',
|
|
|
+ // data:{
|
|
|
+ // pid: this.item.pid
|
|
|
+ // },
|
|
|
+ // cache:{
|
|
|
+ // type: InstructionsCacheType.memory
|
|
|
+ // },
|
|
|
+ // 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));
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
},
|
|
|
|