提交 993fe835 authored 作者: lihuihui's avatar lihuihui

fix: 修改bug

上级 dbd6d201
...@@ -44,14 +44,14 @@ ...@@ -44,14 +44,14 @@
</div> </div>
<div class="step-content1 step-content3" v-show="stepsIndex === 2"> <div class="step-content1 step-content3" v-show="stepsIndex === 2">
<div class="video-box"> <div class="video-box">
<div class="dy-box" v-if="!dataIndex"> <div class="dy-box" v-if="dataIndex == 4">
<img src="https://webapp-pub.ezijing.com/x-training-new/dy-bg.png" /> <img src="https://webapp-pub.ezijing.com/x-training-new/dy-bg.png" />
<div class="works-title">{{ form.title }}</div> <div class="works-title">{{ form.title }}</div>
<div class="works-dec">{{ form.dec }}</div> <div class="works-dec">{{ form.dec }}</div>
<video :src="form.url" width="375px" class="video"></video> <video :src="form.url" width="375px" class="video"></video>
</div> </div>
<div class="register-step" v-else> <div class="register-step" v-else>
<img :src="`https://webapp-pub.ezijing.com/x-training-new/data${dataIndex}.jpg`" /> <img :src="`https://webapp-pub.ezijing.com/x-training-new/data${dataIndex + 1}.jpg`" />
</div> </div>
<div class="register-btn" ref="dataBtn" @click="dataNext"></div> <div class="register-btn" ref="dataBtn" @click="dataNext"></div>
</div> </div>
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
</div> </div>
<div class="mian-btn"> <div class="mian-btn">
<el-button type="primary" @click="cacheReport(1)" v-if="$route.query.type != 1">保存</el-button> <el-button type="primary" @click="cacheReport(1)" v-if="$route.query.type != 1">保存</el-button>
<el-button type="primary" @click="stepsIndex--" v-if="stepsIndex != 0">上一步</el-button> <el-button type="primary" @click="prevBtn" v-if="stepsIndex != 0">上一步</el-button>
<el-button v-if="stepsIndex == 0" type="primary" @click="registerNextBtn">下一步</el-button> <el-button v-if="stepsIndex == 0" type="primary" @click="registerNextBtn">下一步</el-button>
<el-button v-if="stepsIndex == 1" type="primary" @click="formNextBtn">下一步</el-button> <el-button v-if="stepsIndex == 1" type="primary" @click="formNextBtn">下一步</el-button>
<el-button type="primary" @click="submitReport" v-if="stepsIndex == 2 && $route.query.type != 1">完成</el-button> <el-button type="primary" @click="submitReport" v-if="stepsIndex == 2 && $route.query.type != 1">完成</el-button>
...@@ -93,13 +93,19 @@ export default { ...@@ -93,13 +93,19 @@ export default {
} }
}, },
mounted() { mounted() {
if (this.$route.query.type) { if (parseInt(this.$route.query.type)) {
this.getReportDetail(this.$route.query.id) this.getReportDetail(this.$route.query.id)
} else { } else {
this.checkRecord() this.checkRecord()
} }
}, },
methods: { methods: {
prevBtn() {
this.stepsIndex--
if (this.stepsIndex === 0) {
this.registerNext(1)
}
},
// 验证是否有未完成的答题记录 // 验证是否有未完成的答题记录
checkRecord() { checkRecord() {
checkRecord(this.cases.id, 2) checkRecord(this.cases.id, 2)
...@@ -115,7 +121,6 @@ export default { ...@@ -115,7 +121,6 @@ export default {
} else { } else {
if (this.registerIndex === 4) { if (this.registerIndex === 4) {
this.stepsIndex++ this.stepsIndex++
this.cacheReport()
// this.registerIndex = 0 // this.registerIndex = 0
} else { } else {
this.$message({ message: '请完成当前步骤', type: 'warning' }) this.$message({ message: '请完成当前步骤', type: 'warning' })
...@@ -131,11 +136,13 @@ export default { ...@@ -131,11 +136,13 @@ export default {
}) })
if (isNull === -1) { if (isNull === -1) {
this.stepsIndex++ this.stepsIndex++
this.cacheReport()
} else { } else {
this.$message({ message: '请在发布视频完善信息', type: 'warning' }) this.$message({ message: '请在发布视频完善信息', type: 'warning' })
} }
} }
if (this.stepsIndex === 2) {
this.dataNext(1)
}
}, },
// 提交报告 // 提交报告
submitReport() { submitReport() {
...@@ -146,7 +153,7 @@ export default { ...@@ -146,7 +153,7 @@ export default {
this.$message({ message: '请在发布视频完善信息', type: 'warning' }) this.$message({ message: '请在发布视频完善信息', type: 'warning' })
return false return false
} }
if (this.dataIndex !== 4) { if (this.dataIndex !== 3) {
this.$message({ message: '请完成当前步骤', type: 'warning' }) this.$message({ message: '请完成当前步骤', type: 'warning' })
return false return false
} }
...@@ -200,25 +207,28 @@ export default { ...@@ -200,25 +207,28 @@ export default {
this.form.title = cachData[0].title this.form.title = cachData[0].title
this.form.dec = cachData[0].dec this.form.dec = cachData[0].dec
this.form.url = cachData[0].url this.form.url = cachData[0].url
// this.stepsIndex = cachData[1].steps
}) })
}, },
// 查看营销数据教程 // 查看营销数据教程
dataNext(num) { dataNext(num) {
console.log(this.dataIndex, '123=123')
const styles = { const styles = {
1: { w: '50px', t: '30px', l: '320px', text: '第二步:点击右上角,进入菜单' }, 0: { w: '50px', t: '30px', l: '320px', text: '第二步:点击右上角,进入菜单' },
2: { w: '200px', t: '300px', l: '100px', text: '第三步:点击”创作者服务中心“' }, 1: { w: '200px', t: '300px', l: '100px', text: '第三步:点击”创作者服务中心“' },
3: { w: '50px', t: '190px', l: '290px', text: '第四步:点击”数据中心“' }, 2: { w: '50px', t: '190px', l: '290px', text: '第四步:点击”数据中心“' },
4: { w: '0px', t: '0px', l: '0px', text: '完成' } 3: { w: '0px', t: '0px', l: '0px', text: '完成' }
} }
let getStyle = ''
if (num !== 1) { if (num !== 1) {
if (this.dataIndex < 4) this.dataIndex++ if (this.dataIndex < 3) this.dataIndex++
getStyle = styles[this.dataIndex]
} else {
getStyle = styles[this.dataIndex]
} }
const getStyle = styles[this.dataIndex]
this.$nextTick(() => { this.$nextTick(() => {
const getDom = this.$refs.dataBtn.style const getDom = this.$refs.dataBtn.style
this.setStyle(getStyle, getDom) this.setStyle(getStyle, getDom)
}, 1000) })
}, },
// 注册教程 // 注册教程
registerNext(num) { registerNext(num) {
...@@ -235,7 +245,7 @@ export default { ...@@ -235,7 +245,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
const getDom = this.$refs.registerBtn.style const getDom = this.$refs.registerBtn.style
this.setStyle(getStyle, getDom) this.setStyle(getStyle, getDom)
}, 1000) })
}, },
setStyle(sty, dom) { setStyle(sty, dom) {
dom.width = sty.w dom.width = sty.w
......
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
}) })
}, },
// 模板 数据回显 // 模板 数据回显
caseCompletions(id) { caseCompeltions(id) {
caseCompletions(id).then(res => { caseCompletions(id).then(res => {
res.data.items.map(item => { res.data.items.map(item => {
return item.completions.map(cItem => { return item.completions.map(cItem => {
...@@ -159,11 +159,11 @@ export default { ...@@ -159,11 +159,11 @@ export default {
if (id) { if (id) {
getCommitCase(id).then(res => { getCommitCase(id).then(res => {
this.resultCompletions = res.data.detail this.resultCompletions = res.data.detail
this.caseCompletions(this.cases.id) this.caseCompeltions(this.cases.id)
this.$emit('getScore', this.resultCompletions) this.$emit('getScore', this.resultCompletions)
}) })
} else { } else {
this.caseCompletions(this.cases.id) this.caseCompeltions(this.cases.id)
} }
}, },
input() { input() {
...@@ -253,7 +253,10 @@ export default { ...@@ -253,7 +253,10 @@ export default {
type: 'success' type: 'success'
}) })
setTimeout(() => { setTimeout(() => {
this.$router.push({ path: '/product-analysis/result', query: { id: res.data.answers.id } }) this.$router.push({
path: '/product-analysis/result',
query: { id: res.data.id || this.$route.query.id }
})
}, 2000) }, 2000)
}) })
.catch(err => { .catch(err => {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="trophy-box"> <div class="trophy-box">
<img src="https://webapp-pub.ezijing.com/x-training-new/trophy.png" /> <img src="https://webapp-pub.ezijing.com/x-training-new/trophy.png" />
<div class="text"> <div class="text">
你的得分是<span>{{ score }}</span 你的得分是<span>{{ parseInt(score) }}</span
> >
</div> </div>
</div> </div>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div class="tit">错题解析</div> <div class="tit">错题解析</div>
<ul> <ul>
<li v-for="(item, index) in answerList" :key="index"> <li v-for="(item, index) in answerList" :key="index">
<div class="title">{{ `${index + 1}.${item.subject}` }}:(分值:{{ item.sum_score }}</div> <div class="title">{{ `${index + 1}.${item.subject}` }}:(分值:{{ parseInt(item.sum_score) }}</div>
<div class="my">我的答案:{{ item.commit_answer }}</div> <div class="my">我的答案:{{ item.commit_answer }}</div>
<div class="answer">正确答案:{{ item.answer }}</div> <div class="answer">正确答案:{{ item.answer }}</div>
</li> </li>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论