/**/ export default { template: `
{{item.title}}
{{item.describe}}
{{oneApp.name}}
{{oneApp.ratings}}
{{hasMap[oneApp.code]?'已安装':'去安装'}}
所有
{{secondCat}}
{{oneApp.name}}
{{oneApp.secondCat}}
{{oneApp.ratings}}
{{hasMap[oneApp.code]?'已安装':'去安装'}}
{{oneApp.name}}
{{oneApp.secondCat}}
已安装
{{detailApp.name}}
{{detailApp.author}}
安装
卸载
打开
升级
{{detailApp.average}}
平均分
{{detailApp.ratings}}
评论数
{{detailApp.descr}}
截图
描述
{{detailApp.descr}}
评级和评论
{{detailApp.average}}
{{detailApp.ratings}} 评论数
{{index}}
期待你的打分^_^
功能

                      
拖拽到这里或者 点我上传
保存 取消
`, props: [], data() { return { selectType: "house", detailApp: {}, detailPf: 0, types: ["house", "store-app", "store-game","store-local","download"], houseData: [ { className: "amzApps", title: "精选应用", describe: "使用这些必备应用程序将您的体验提升到新的高度", data: [] }, { className: "amzGames", title: "特色游戏", describe: "探索乐趣来玩xbox 游戏并找到一个新收藏", data: [] } ], appOrGame:{ param:{ current:1, pageSize:9999, firstCat:"app", secondCat:"", keyWord:"", orderField:"average", orderType:"desc" }, hasFinish:false, data:{ data:[], count:0 }, secondCats:[] }, hasMap:{}, hasList:[], addLocalApp:{ show:false, data:{}, type:0, title:"" } } }, methods: { selectTypeAction: function (type, oneApp) { var that = this; that.selectType = type; if (that.selectType == "house") { //首页点击 that.houseInit(); } else if (that.selectType == "detail") { //详情点击 that.showDetail(oneApp); } else if (that.selectType == "store-app" || that.selectType == "store-game") { //app列表 //游戏列表 if (that.selectType == "store-app") { //app列表 that.appOrGame.param.firstCat = "app"; } else if (that.selectType == "store-game") { //游戏列表 that.appOrGame.param.firstCat = "game"; } that.appOrGame.param.secondCat = ""; that.appOrGame.hasFinish = false; that.searchAppOrGame(true); }else if(that.selectType == "store-local"){ //本地列表 that.searchLocalApp(); }else if(that.selectType == "download"){ //已安装列表 that.hasMapInit(); } }, storeUrl: function () { }, searchLocalApp:async function (){ var that = this; var list = await webos.softUser.list(); if(list){ that.appOrGame.data.data = list; } }, searchAppOrGame:async function (isInit){ var that = this; if(isInit){ that.appOrGame.hasFinish = false; }; if(that.appOrGame.hasFinish){ return; }; if(isInit){ that.appOrGame.param.current = 1; that.appOrGame.data.data = []; that.appOrGame.data.count = 0; that.appOrGame.secondCats = await webos.softStore.secondCats({firstCat:that.appOrGame.param.firstCat}); } var data = await webos.softStore.list(that.appOrGame.param); if(!data){ that.appOrGame.hasFinish = true; return; } data.data = that.fliterApps(data.data); that.appOrGame.data.data = that.appOrGame.data.data.concat(data.data); that.appOrGame.data.count = data.count; var maxPage = Math.floor(data.count/that.appOrGame.param.pageSize); if(data.count%that.appOrGame.param.pageSize != 0){ maxPage++; } if(maxPage == 0){ maxPage = 1; } if(maxPage == that.appOrGame.param.current){ that.appOrGame.hasFinish = true; } }, showDetail:async function (oneApp){ var that = this; that.detailPf = 0; that.detailApp = oneApp; var storeData = await webos.softStore.info(that.detailApp.code); if(storeData){ storeData = that.fliterApps([storeData])[0]; } if(storeData){ that.detailApp = storeData; that.detailApp.isLocal = 2; if(storeData.type == 0){ //检查是否需要升级 that.detailApp.needUpdate = await webos.softUser.checkUpdate({code:that.detailApp.code,version:that.detailApp.version}); } }else{ that.detailApp.isLocal = 1; } if(that.detailApp.screenShots){ that.detailApp.screenShotsData = JSON.parse(that.detailApp.screenShots); } }, houseInit: async function () { var that = this; var cats = ["app", "game"]; for (var i = 0; i < cats.length; i++) { var cat = cats[i]; var data = await webos.softStore.indexList(cat); data = that.fliterApps(data); if (data) { that.houseData[i].data = data; } } }, fliterApps:function(data){ //因官方插件不兼容,屏蔽插件,仅保留轻应用 if(data && data.length > 0){ let tmp = []; for(let i=0;i