|
@@ -55,28 +55,34 @@ export default class MoreGameNormalItem extends cc.Component {
|
|
|
this.labDes.string = this.data.introduction
|
|
this.labDes.string = this.data.introduction
|
|
|
this.spRed.active = false
|
|
this.spRed.active = false
|
|
|
|
|
|
|
|
- if (JsbSystem.ifCanStartGame(this.data.packageName, false)) {
|
|
|
|
|
- this.btnDown.active = false
|
|
|
|
|
- this.btnOpen.active = true
|
|
|
|
|
- } else {
|
|
|
|
|
- if (JsbSystem.isFileExist(this.data.nebulaAppId + ".apk")) {
|
|
|
|
|
|
|
+ if (this.data.appType == 1) {
|
|
|
|
|
+ if (JsbSystem.ifCanStartGame(this.data.packageName, false)) {
|
|
|
this.btnDown.active = false
|
|
this.btnDown.active = false
|
|
|
this.btnOpen.active = true
|
|
this.btnOpen.active = true
|
|
|
} else {
|
|
} else {
|
|
|
- this.btnDown.active = true
|
|
|
|
|
- this.btnOpen.active = false
|
|
|
|
|
- // this.spRed.active = true
|
|
|
|
|
-
|
|
|
|
|
- let info = gData.moreGame.getTaskInfo(this.data.nebulaAppId)
|
|
|
|
|
- if (info != null) {
|
|
|
|
|
- this.schedule(() => {
|
|
|
|
|
- this.showDownloadProgress()
|
|
|
|
|
- }, 0.5)
|
|
|
|
|
|
|
+ if (JsbSystem.isFileExist(this.data.nebulaAppId + ".apk")) {
|
|
|
|
|
+ this.btnDown.active = false
|
|
|
|
|
+ this.btnOpen.active = true
|
|
|
} else {
|
|
} else {
|
|
|
- this.progressLabel.string = "下载"
|
|
|
|
|
|
|
+ this.btnDown.active = true
|
|
|
|
|
+ this.btnOpen.active = false
|
|
|
|
|
+ // this.spRed.active = true
|
|
|
|
|
+
|
|
|
|
|
+ let info = gData.moreGame.getTaskInfo(this.data.nebulaAppId)
|
|
|
|
|
+ if (info != null) {
|
|
|
|
|
+ this.schedule(() => {
|
|
|
|
|
+ this.showDownloadProgress()
|
|
|
|
|
+ }, 0.5)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.progressLabel.string = "下载"
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ else if (this.data.appType == 2) {
|
|
|
|
|
+ this.btnDown.active = false
|
|
|
|
|
+ this.btnOpen.active = true
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
cool = false
|
|
cool = false
|
|
@@ -91,13 +97,19 @@ export default class MoreGameNormalItem extends cc.Component {
|
|
|
this.cool = false
|
|
this.cool = false
|
|
|
}, 3)
|
|
}, 3)
|
|
|
|
|
|
|
|
- let result = gData.moreGame.createNewTask(this.data)
|
|
|
|
|
- if (result != null) {
|
|
|
|
|
- this.schedule(() => {
|
|
|
|
|
- this.showDownloadProgress()
|
|
|
|
|
- }, 0.5)
|
|
|
|
|
- } else {
|
|
|
|
|
- this.progressLabel.string = ""
|
|
|
|
|
|
|
+ if (this.data.appType == 1) {
|
|
|
|
|
+ let result = gData.moreGame.createNewTask(this.data)
|
|
|
|
|
+ if (result != null) {
|
|
|
|
|
+ this.schedule(() => {
|
|
|
|
|
+ this.showDownloadProgress()
|
|
|
|
|
+ }, 0.5)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.progressLabel.string = ""
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (this.data.appType == 2) {
|
|
|
|
|
+ cc.sys.openURL(this.data.recommendLink);
|
|
|
|
|
+ // JsbSystem.sendEvent('hutuiEventLaunch_' + this.data.nebulaAppId, "互推启动" + this.data.title, 'hutuiEventLaunch')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|