|
@@ -10,9 +10,35 @@ class ImageWareFullScreenScene extends scene {
|
|
|
this.curImageIndex = 0;
|
|
|
}
|
|
|
|
|
|
+ renderLeftRightBtn() {
|
|
|
+ let btnRight = document.getElementById('imgRight');
|
|
|
+ let btnLeft = document.getElementById('imgLeft');
|
|
|
+ // 如果是最后一张,不显示向右按钮
|
|
|
+ if (this.curImageList.length - 1 === this.curImageIndex) {
|
|
|
+ if (btnRight) {
|
|
|
+ btnRight.style.display = 'none';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (btnRight) {
|
|
|
+ btnRight.style.display = 'block';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果是第一张,不显示向左按钮
|
|
|
+ if (this.curImageIndex === 0) {
|
|
|
+ if (btnLeft) {
|
|
|
+ btnLeft.style.display = 'none';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (btnLeft) {
|
|
|
+ btnLeft.style.display = 'block';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
renderImageView() {
|
|
|
const curImage = this.curImageList[this.curImageIndex];
|
|
|
document.getElementById('wareImg').setAttribute('src', curImage.url);
|
|
|
+ this.renderLeftRightBtn()
|
|
|
}
|
|
|
|
|
|
dynamicChangeWare(wareIndex, type) {
|
|
@@ -126,8 +152,21 @@ class ImageWareFullScreenScene extends scene {
|
|
|
|
|
|
}
|
|
|
|
|
|
- onOK() {
|
|
|
-
|
|
|
+ onOK(e) {
|
|
|
+ // 后退
|
|
|
+ if (e.target.con.classList.contains('goback')) {
|
|
|
+ this.hideScene({
|
|
|
+ curWareIndex: this.curWareIndex,
|
|
|
+ curImageList: this.curImageList,
|
|
|
+ curImageIndex: this.curImageIndex,
|
|
|
+ }, 'LessonScene');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (e.target.id === 'imgLeft') {
|
|
|
+ this.keyLeftHandler();
|
|
|
+ } else if (e.target.id === 'imgRight') {
|
|
|
+ this.keyRightHandler();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
onBack() {
|