|
@@ -96,8 +96,8 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="NNPE-operate" v-if="isShowTitle">
|
|
<div class="NNPE-operate" v-if="isShowTitle">
|
|
- <a class="btn-prev" @click="handleNNPEprev" />
|
|
|
|
- <a class="btn-next" @click="handleNNPEnext" />
|
|
|
|
|
|
+ <a class="btn-prev" :class="[preClick?'':'btn-prev-disabled']" @click="handleNNPEprev" />
|
|
|
|
+ <a class="btn-next" :class="[nextClick?'':'btn-next-disabled']" @click="handleNNPEnext" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
@@ -476,6 +476,14 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="NNPE-title NNPE-title-gray" v-if="isShowSave||isShowTitle">
|
|
|
|
+ <!-- 页眉 -->
|
|
|
|
+ <a class="submitAnswer" v-if="isShowSave" @click="submitUserAnswerNPC">提交</a>
|
|
|
|
+ <div class="NNPE-operate" v-if="isShowTitle">
|
|
|
|
+ <a class="btn-prev" :class="[preClick?'':'btn-prev-disabled']" @click="handleNNPEprev" />
|
|
|
|
+ <a class="btn-next" :class="[nextClick?'':'btn-next-disabled']" @click="handleNNPEnext" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -559,6 +567,7 @@ export default {
|
|
"isShowTitle",
|
|
"isShowTitle",
|
|
"bookAnswerContent",
|
|
"bookAnswerContent",
|
|
"TaskModel",
|
|
"TaskModel",
|
|
|
|
+ "isShowSave"
|
|
],
|
|
],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -600,6 +609,8 @@ export default {
|
|
idArr: [], //当前的pid
|
|
idArr: [], //当前的pid
|
|
oldCurrentTreeID: "",
|
|
oldCurrentTreeID: "",
|
|
refresh: true,
|
|
refresh: true,
|
|
|
|
+ preClick: false, // 上一页是否可点
|
|
|
|
+ nextClick: false, // 下一页是否可点
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
@@ -617,6 +628,22 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
_this.handleTitleData();
|
|
_this.handleTitleData();
|
|
|
|
+ if (_this.queIndex == _this.queTotal - 1) {
|
|
|
|
+ this.idArr.forEach((item, i) => {
|
|
|
|
+ if (item == _this.currentTreeID) {
|
|
|
|
+ if(i==0){
|
|
|
|
+ _this.preClick = false
|
|
|
|
+ _this.nextClick = true
|
|
|
|
+ }else if (i == this.idArr.length - 1) {
|
|
|
|
+ _this.nextClick = false
|
|
|
|
+ _this.preClick = true
|
|
|
|
+ } else {
|
|
|
|
+ _this.nextClick = true
|
|
|
|
+ _this.preClick = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
_this.$nextTick(() => {
|
|
_this.$nextTick(() => {
|
|
// 重新渲染组件
|
|
// 重新渲染组件
|
|
_this.refresh = true;
|
|
_this.refresh = true;
|
|
@@ -641,6 +668,22 @@ export default {
|
|
_this.FatherTreeData.forEach((item, itemIndex) => {
|
|
_this.FatherTreeData.forEach((item, itemIndex) => {
|
|
this.seekCurrentTree(item);
|
|
this.seekCurrentTree(item);
|
|
});
|
|
});
|
|
|
|
+ if (_this.queIndex == _this.queTotal - 1) {
|
|
|
|
+ this.idArr.forEach((item, i) => {
|
|
|
|
+ if (item == _this.currentTreeID) {
|
|
|
|
+ if(i==0){
|
|
|
|
+ _this.preClick = false
|
|
|
|
+ _this.nextClick = true
|
|
|
|
+ }else if (i == this.idArr.length - 1) {
|
|
|
|
+ _this.nextClick = false
|
|
|
|
+ _this.preClick = true
|
|
|
|
+ } else {
|
|
|
|
+ _this.nextClick = true
|
|
|
|
+ _this.preClick = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeCreate() {}, // 生命周期 - 创建之前
|
|
beforeCreate() {}, // 生命周期 - 创建之前
|
|
@@ -716,7 +759,8 @@ export default {
|
|
itemss.data.option
|
|
itemss.data.option
|
|
);
|
|
);
|
|
}
|
|
}
|
|
- let Bookanswer = localStorage.getItem("Bookanswer");
|
|
|
|
|
|
+ // let Bookanswer = localStorage.getItem("Bookanswer");
|
|
|
|
+ let Bookanswer = this.bookAnswerContent
|
|
//if (_this.TaskModel == "lookAnswer" && _this.bookAnswerContent) {
|
|
//if (_this.TaskModel == "lookAnswer" && _this.bookAnswerContent) {
|
|
if (Bookanswer) {
|
|
if (Bookanswer) {
|
|
// let answerData = JSON.parse(_this.bookAnswerContent);
|
|
// let answerData = JSON.parse(_this.bookAnswerContent);
|
|
@@ -747,12 +791,12 @@ export default {
|
|
this.idArr.forEach((item, i) => {
|
|
this.idArr.forEach((item, i) => {
|
|
if (item == _this.currentTreeID) {
|
|
if (item == _this.currentTreeID) {
|
|
if (i == 0) {
|
|
if (i == 0) {
|
|
- this.$message({
|
|
|
|
- message: "已经是第一题",
|
|
|
|
- type: "success",
|
|
|
|
- });
|
|
|
|
|
|
+ _this.preClick = false
|
|
|
|
+ _this.nextClick = true
|
|
} else {
|
|
} else {
|
|
_this.changeId(this.idArr[i - 1]);
|
|
_this.changeId(this.idArr[i - 1]);
|
|
|
|
+ _this.preClick = true
|
|
|
|
+ _this.nextClick = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -796,12 +840,12 @@ export default {
|
|
this.idArr.forEach((item, i) => {
|
|
this.idArr.forEach((item, i) => {
|
|
if (item == _this.currentTreeID) {
|
|
if (item == _this.currentTreeID) {
|
|
if (i == this.idArr.length - 1) {
|
|
if (i == this.idArr.length - 1) {
|
|
- this.$message({
|
|
|
|
- message: "已经是最后一题",
|
|
|
|
- type: "success",
|
|
|
|
- });
|
|
|
|
|
|
+ _this.nextClick = false
|
|
|
|
+ _this.preClick = true
|
|
} else {
|
|
} else {
|
|
_this.changeId(this.idArr[i + 1]);
|
|
_this.changeId(this.idArr[i + 1]);
|
|
|
|
+ _this.nextClick = true
|
|
|
|
+ _this.preClick = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -811,7 +855,7 @@ export default {
|
|
_this.cur = _this.queList[_this.queIndex];
|
|
_this.cur = _this.queList[_this.queIndex];
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- saveAnswer() {
|
|
|
|
|
|
+ submitUserAnswerNPC() {
|
|
let contextData = JSON.parse(JSON.stringify(this.contextData));
|
|
let contextData = JSON.parse(JSON.stringify(this.contextData));
|
|
let result = [];
|
|
let result = [];
|
|
contextData.cur_fn_data.forEach((item, index) => {
|
|
contextData.cur_fn_data.forEach((item, index) => {
|
|
@@ -837,8 +881,7 @@ export default {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
-
|
|
|
|
- return result;
|
|
|
|
|
|
+ this.$emit("finishTaskMaterial", JSON.stringify(result));
|
|
},
|
|
},
|
|
}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
};
|
|
};
|
|
@@ -858,6 +901,35 @@ export default {
|
|
height: 64px;
|
|
height: 64px;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
|
|
+ &.NNPE-title-gray{
|
|
|
|
+ background: #EEEEEE;
|
|
|
|
+ border-radius: 0;
|
|
|
|
+ margin-top: 24px;
|
|
|
|
+ .NNPE-operate {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 10px;
|
|
|
|
+ right: 20px;
|
|
|
|
+ a {
|
|
|
|
+ background: #fff url("../../assets/newImage/common/btn-pre-black.png")
|
|
|
|
+ center no-repeat;
|
|
|
|
+ background-size: 24px;
|
|
|
|
+ &.btn-next {
|
|
|
|
+ background: #fff url("../../assets/newImage/common/btn-next-black.png")
|
|
|
|
+ center no-repeat;
|
|
|
|
+ background-size: 24px;
|
|
|
|
+ }
|
|
|
|
+ &:hover {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ }
|
|
|
|
+ &:active {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ }
|
|
|
|
+ &.btn-prev-disabled,&.btn-next-disabled{
|
|
|
|
+ background-color: rgba(0, 0, 0, 0.25);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
h1 {
|
|
h1 {
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
@@ -943,6 +1015,10 @@ export default {
|
|
&:active {
|
|
&:active {
|
|
background-color: #d24444;
|
|
background-color: #d24444;
|
|
}
|
|
}
|
|
|
|
+ &.btn-prev-disabled,&.btn-next-disabled{
|
|
|
|
+ background-color: rgba(0, 0, 0, 0.25);
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1064,6 +1140,24 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .submitAnswer{
|
|
|
|
+ width: 160px;
|
|
|
|
+ height: 44px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ line-height: 44px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ font-family: robot;
|
|
|
|
+ background: #e35454;
|
|
|
|
+ color: #fff;
|
|
|
|
+ margin-left: 16px;
|
|
|
|
+ &:hover {
|
|
|
|
+ background-color: #f76565;
|
|
|
|
+ }
|
|
|
|
+ &:active {
|
|
|
|
+ background-color: #d24444;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.NPC-Big-Book-preview-green {
|
|
.NPC-Big-Book-preview-green {
|
|
.NNPE-title {
|
|
.NNPE-title {
|
|
@@ -1087,6 +1181,15 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .submitAnswer{
|
|
|
|
+ background: #24b99e;
|
|
|
|
+ &:hover {
|
|
|
|
+ background-color: #3dd4b8;
|
|
|
|
+ }
|
|
|
|
+ &:active {
|
|
|
|
+ background-color: #1fa189;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
.classTopic-box {
|
|
.classTopic-box {
|
|
background: #24b99e;
|
|
background: #24b99e;
|
|
}
|
|
}
|
|
@@ -1125,6 +1228,15 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .submitAnswer{
|
|
|
|
+ background: #bd8865;
|
|
|
|
+ &:hover {
|
|
|
|
+ background-color: #d6a687;
|
|
|
|
+ }
|
|
|
|
+ &:active {
|
|
|
|
+ background-color: #a37557;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
.classTopic-box {
|
|
.classTopic-box {
|
|
background: #bd8865;
|
|
background: #bd8865;
|
|
}
|
|
}
|