提交 bb8d187a authored 作者: lihuihui's avatar lihuihui

fix: 修改bug

上级 069a7af4
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<el-step title="查看营销数据"></el-step> <el-step title="查看营销数据"></el-step>
</el-steps> </el-steps>
<div class="content-box"> <div class="content-box">
<div class="step-content1" v-if="stepsIndex === 0"> <div class="step-content1" v-show="stepsIndex === 0">
<div class="video-box"> <div class="video-box">
<div class="dy-box" v-if="!registerIndex"> <div class="dy-box" v-if="!registerIndex">
<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" />
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
</div> </div>
<div class="text">{{ registerText }}</div> <div class="text">{{ registerText }}</div>
</div> </div>
<div class="step-content2" v-if="stepsIndex === 1"> <div class="step-content2" v-show="stepsIndex === 1">
<div class="form-box"> <div class="form-box">
<el-form ref="form" :model="form" label-width="80px" :disabled="$route.query.type !== 1 ? false : true"> <el-form ref="form" :model="form" label-width="80px" :disabled="$route.query.type == 1 ? true : false ">
<el-form-item label="标题"> <el-form-item label="标题">
<el-input v-model="form.title"></el-input> <el-input v-model="form.title"></el-input>
</el-form-item> </el-form-item>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<video :src="form.url" width="375px" class="video"></video> <video :src="form.url" width="375px" class="video"></video>
</div> </div>
</div> </div>
<div class="step-content1 step-content3" v-if="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">
<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" />
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<div class="text">{{ registerText }}</div> <div class="text">{{ registerText }}</div>
</div> </div>
<div class="mian-btn"> <div class="mian-btn">
<el-button type="primary" @click="cacheReport" 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="stepsIndex--" 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>
...@@ -93,7 +93,11 @@ export default { ...@@ -93,7 +93,11 @@ export default {
} }
}, },
mounted() { mounted() {
if (this.$route.query.type) {
this.getReportDetail(this.$route.query.id)
} else {
this.checkRecord() this.checkRecord()
}
}, },
methods: { methods: {
// 验证是否有未完成的答题记录 // 验证是否有未完成的答题记录
...@@ -111,7 +115,8 @@ export default { ...@@ -111,7 +115,8 @@ export default {
} else { } else {
if (this.registerIndex === 4) { if (this.registerIndex === 4) {
this.stepsIndex++ this.stepsIndex++
this.registerIndex = 0 this.cacheReport()
// this.registerIndex = 0
} else { } else {
this.$message({ message: '请完成当前步骤', type: 'warning' }) this.$message({ message: '请完成当前步骤', type: 'warning' })
} }
...@@ -126,6 +131,7 @@ export default { ...@@ -126,6 +131,7 @@ 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' })
} }
...@@ -166,7 +172,7 @@ export default { ...@@ -166,7 +172,7 @@ export default {
}) })
}, },
// 保存报告 // 保存报告
cacheReport() { cacheReport(num) {
const commitReport = [ const commitReport = [
this.form, this.form,
{ steps: this.stepsIndex, registerIndex: this.registerIndex, dataIndex: this.dataIndex } { steps: this.stepsIndex, registerIndex: this.registerIndex, dataIndex: this.dataIndex }
...@@ -174,7 +180,7 @@ export default { ...@@ -174,7 +180,7 @@ export default {
const param = { type: 1, commit_report: commitReport } const param = { type: 1, commit_report: commitReport }
cacheReport(this.cases.id, { reports: JSON.stringify(param) }) cacheReport(this.cases.id, { reports: JSON.stringify(param) })
.then(res => { .then(res => {
this.$message({ type: 'success', message: '保存成功' }) if (num) this.$message({ type: 'success', message: '保存成功' })
}) })
.catch(err => { .catch(err => {
this.$message.error(err.message || '稍后再试') this.$message.error(err.message || '稍后再试')
...@@ -184,10 +190,12 @@ export default { ...@@ -184,10 +190,12 @@ export default {
getReportDetail(id) { getReportDetail(id) {
getReportDetail(id).then(res => { getReportDetail(id).then(res => {
const cachData = res.data.detail.answer.commit_report const cachData = res.data.detail.answer.commit_report
if (this.$route.query.type === 0) { if (this.$route.query.type !== '1') {
this.stepsIndex = cachData[1].steps this.stepsIndex = cachData[1].steps
this.registerIndex = cachData[1].registerIndex this.registerIndex = cachData[1].registerIndex
this.dataIndex = cachData[1].dataIndex this.dataIndex = cachData[1].dataIndex
if (this.stepsIndex === 0) this.registerNext(1)
if (this.stepsIndex === 2) this.dataNext(1)
} }
this.form.title = cachData[0].title this.form.title = cachData[0].title
this.form.dec = cachData[0].dec this.form.dec = cachData[0].dec
...@@ -196,30 +204,38 @@ export default { ...@@ -196,30 +204,38 @@ export default {
}) })
}, },
// 查看营销数据教程 // 查看营销数据教程
dataNext() { dataNext(num) {
const styles = { const styles = {
1: { w: '50px', t: '30px', l: '320px', text: '第二步:点击右上角,进入菜单' }, 1: { w: '50px', t: '30px', l: '320px', text: '第二步:点击右上角,进入菜单' },
2: { w: '200px', t: '300px', l: '100px', text: '第三步:点击”创作者服务中心“' }, 2: { w: '200px', t: '300px', l: '100px', text: '第三步:点击”创作者服务中心“' },
3: { w: '50px', t: '190px', l: '290px', text: '第四步:点击”数据中心“' }, 3: { w: '50px', t: '190px', l: '290px', text: '第四步:点击”数据中心“' },
4: { w: '0px', t: '0px', l: '0px', text: '完成' } 4: { w: '0px', t: '0px', l: '0px', text: '完成' }
} }
if (num !== 1) {
if (this.dataIndex < 4) this.dataIndex++ if (this.dataIndex < 4) this.dataIndex++
}
const getStyle = styles[this.dataIndex] const getStyle = styles[this.dataIndex]
this.$nextTick(() => {
const getDom = this.$refs.dataBtn.style const getDom = this.$refs.dataBtn.style
this.setStyle(getStyle, getDom) this.setStyle(getStyle, getDom)
}, 1000)
}, },
// 注册教程 // 注册教程
registerNext() { registerNext(num) {
const styles = { const styles = {
1: { w: '310px', t: '380px', l: '30px', text: '第二步:点击其他手机号登录' }, 1: { w: '310px', t: '380px', l: '30px', text: '第二步:点击其他手机号登录' },
2: { w: '310px', t: '280px', l: '30px', text: '第三步:输入手机号点击获取手机验证码' }, 2: { w: '310px', t: '280px', l: '30px', text: '第三步:输入手机号点击获取手机验证码' },
3: { w: '310px', t: '340px', l: '30px', text: '第四步:点击登录' }, 3: { w: '310px', t: '340px', l: '30px', text: '第四步:点击登录' },
4: { w: '0px', t: '0px', l: '0px', text: '第五步:登录成功之后,在右下角点击“我”,就可以修改自己的头像和资料了' } 4: { w: '0px', t: '0px', l: '0px', text: '第五步:登录成功之后,在右下角点击“我”,就可以修改自己的头像和资料了' }
} }
if (num !== 1) {
if (this.registerIndex < 4) this.registerIndex++ if (this.registerIndex < 4) this.registerIndex++
}
const getStyle = styles[this.registerIndex] const getStyle = styles[this.registerIndex]
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
......
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
<div class="tit-box"> <div class="tit-box">
<span class="title">{{ title }}</span> <span class="title">{{ title }}</span>
<slot name="tips"></slot> <slot name="tips"></slot>
<span class="err-btn" v-if="isErrorBtn && $route.path !== '/product-analysis/report'" @click="$emit('errorResolution')">错误解析</span> <span
class="err-btn"
v-if="isErrorBtn && $route.path !== '/product-analysis/report'"
@click="$emit('errorResolution')"
>错题解析</span
>
</div> </div>
<slot></slot> <slot></slot>
</div> </div>
......
<template> <template>
<box title="业绩比较基准" class="compares-box" :id="firstItem.id" :isErrorBtn="isErrorBtn()" @errorResolution="errorResolution"> <box title="业绩比较基准" class="compares-box" :id="firstItem.id" :isErrorBtn="isErrorBtn()" @errorResolution="errorResolution">
<div slot="tips" class="tips"> <div slot="tips" class="tips" v-if="cases.tag === 'index_fund_1'">
<i class="el-icon-warning-outline"></i> <i class="el-icon-warning-outline"></i>
<div class="text">提示:本案例中所出现的指数为单一参照指数,故比重默认为100%。</div> <div class="text">提示:本案例中所出现的指数为单一参照指数,故比重默认为100%。</div>
</div> </div>
...@@ -38,6 +38,9 @@ export default { ...@@ -38,6 +38,9 @@ export default {
firstItem() { firstItem() {
const [first = {}] = this.data.completions const [first = {}] = this.data.completions
return first return first
},
cases() {
return this.$store.state.case
} }
}, },
methods: { methods: {
......
...@@ -2,23 +2,71 @@ ...@@ -2,23 +2,71 @@
<div class="report-box"> <div class="report-box">
<slot></slot> <slot></slot>
<template v-if="Object.keys(titleData).length"> <template v-if="Object.keys(titleData).length">
<div class="title">产品分析报告<span @click="errorResolutionTit" v-if="$route.path !== '/product-analysis/report' && !this.titleData.completions[0].is_correct">错误解析</span></div> <div class="title">
<input v-if="$route.path !== '/product-analysis/result'" type="text" class="code isDomActive" placeholder="请输入基金简称+基金代码" v-model="titleValue"/> 产品分析报告<span
<input v-else type="text" :class="`code isDomActive ${titleData.completions[0].is_correct ? '' : 'active'}`" placeholder="请输入基金简称+基金代码" v-model="titleValue"/> @click="errorResolutionTit"
v-if="$route.path !== '/product-analysis/report' && !this.titleData.completions[0].is_correct"
>错题解析</span
>
</div>
<input
v-if="$route.path !== '/product-analysis/result'"
type="text"
class="code isDomActive"
placeholder="请输入基金简称+基金代码"
v-model="titleValue"
/>
<input
v-else
type="text"
:class="`code isDomActive ${titleData.completions[0].is_correct ? '' : 'active'}`"
placeholder="请输入基金简称+基金代码"
v-model="titleValue"
/>
</template> </template>
<div v-for="(item, index) in completions" :key="index"> <div v-for="(item, index) in completions" :key="index">
<!-- 产品概括 --> <!-- 产品概括 -->
<product @errorResolution="errorResolution" ref="product" v-if="item.tag === 'product_overview'" :data="item"></product> <product
@errorResolution="errorResolution"
ref="product"
v-if="item.tag === 'product_overview'"
:data="item"
></product>
<!-- 投资目标 --> <!-- 投资目标 -->
<invest-target @errorResolution="errorResolution" ref="investTarget" v-if="item.tag === 'investment_objectives'" :data="item"></invest-target> <invest-target
@errorResolution="errorResolution"
ref="investTarget"
v-if="item.tag === 'investment_objectives'"
:data="item"
></invest-target>
<!-- 投资目标 --> <!-- 投资目标 -->
<invest-strategy @errorResolution="errorResolution" ref="investStrategy" v-if="item.tag === 'investment_strategy'" :data="item"></invest-strategy> <invest-strategy
@errorResolution="errorResolution"
ref="investStrategy"
v-if="item.tag === 'investment_strategy'"
:data="item"
></invest-strategy>
<!-- 业绩比较基准 --> <!-- 业绩比较基准 -->
<compares @errorResolution="errorResolution" ref="compares" v-if="item.tag === 'performance_benchmark'" :data="item"></compares> <compares
@errorResolution="errorResolution"
ref="compares"
v-if="item.tag === 'performance_benchmark'"
:data="item"
></compares>
<!-- 风险收益特征 --> <!-- 风险收益特征 -->
<features @errorResolution="errorResolution" ref="features" v-if="item.tag === 'risk_return_characteristics'" :data="item"></features> <features
@errorResolution="errorResolution"
ref="features"
v-if="item.tag === 'risk_return_characteristics'"
:data="item"
></features>
<!-- 基金涉及费用 --> <!-- 基金涉及费用 -->
<cost @errorResolution="errorResolution" ref="cost" v-if="item.tag === 'fund_related_expenses'" :data="item"></cost> <cost
@errorResolution="errorResolution"
ref="cost"
v-if="item.tag === 'fund_related_expenses'"
:data="item"
></cost>
</div> </div>
<!-- 提交 --> <!-- 提交 -->
<div class="tool-btn"> <div class="tool-btn">
...@@ -74,8 +122,12 @@ export default { ...@@ -74,8 +122,12 @@ export default {
cacheCaseAnswer() { cacheCaseAnswer() {
const data = this.getAnswer(1) const data = this.getAnswer(1)
cacheCaseAnswer(this.cases.id, { answers: JSON.stringify(data) }) cacheCaseAnswer(this.cases.id, { answers: JSON.stringify(data) })
.then(res => { this.$message({ type: 'success', message: '保存成功' }) }) .then(res => {
.catch(err => { this.$message.error(err.message || '稍后再试') }) this.$message({ type: 'success', message: '保存成功' })
})
.catch(err => {
this.$message.error(err.message || '稍后再试')
})
}, },
// 模板 数据回显 // 模板 数据回显
caseCompletions(id) { caseCompletions(id) {
...@@ -86,7 +138,7 @@ export default { ...@@ -86,7 +138,7 @@ export default {
const findData = this.resultCompletions.answer.find(fItem => { const findData = this.resultCompletions.answer.find(fItem => {
return fItem.id === cItem.id return fItem.id === cItem.id
}) })
findData ? cItem = Object.assign(cItem, findData) : cItem.commit_answer = '' findData ? (cItem = Object.assign(cItem, findData)) : (cItem.commit_answer = '')
} else { } else {
cItem.commit_answer = '' cItem.commit_answer = ''
} }
...@@ -132,19 +184,24 @@ export default { ...@@ -132,19 +184,24 @@ export default {
const investStrategyCount = [{ id: strategyData.id, commit_answer: strategyData.commit_answer }] const investStrategyCount = [{ id: strategyData.id, commit_answer: strategyData.commit_answer }]
// 业绩比较基准数据 // 业绩比较基准数据
const comparesCount = [] const comparesCount = []
let comparesData = {}
if (this.$refs.compares) {
this.$refs.compares[0].inputList.forEach(item => { this.$refs.compares[0].inputList.forEach(item => {
comparesCount.push(`${item.input1.split(';').join('')},${item.input2.split(';').join('')}`) comparesCount.push(`${item.input1.split(';').join('')},${item.input2.split(';').join('')}`)
}) })
const comparesData = { comparesData = {
id: this.$refs.compares[0].data.completions[0].id, id: this.$refs.compares[0].data.completions[0].id,
commit_answer: comparesCount.join(';') commit_answer: comparesCount.join(';')
} }
this.$refs.compares[0].data.completions[0].commit_answer = comparesCount.join(';') this.$refs.compares[0].data.completions[0].commit_answer = comparesCount.join(';')
}
// 风险收益特征数据 // 风险收益特征数据
const featuresCount = [] const featuresCount = []
if (this.$refs.compares) {
this.$refs.features[0].data.completions.forEach(item => { this.$refs.features[0].data.completions.forEach(item => {
featuresCount.push({ id: item.id, commit_answer: item.commit_answer }) featuresCount.push({ id: item.id, commit_answer: item.commit_answer })
}) })
}
// 基金涉及费用数据 // 基金涉及费用数据
const costCount = [] const costCount = []
this.$refs.cost[0].data.completions.forEach(item => { this.$refs.cost[0].data.completions.forEach(item => {
...@@ -164,6 +221,7 @@ export default { ...@@ -164,6 +221,7 @@ export default {
...costCount, ...costCount,
...investStrategyCount ...investStrategyCount
] ]
allAnswer = allAnswer.filter(item => Object.keys(item).length !== 0)
if (isCache) { if (isCache) {
allAnswer = allAnswer.filter(item => item.commit_answer !== '') allAnswer = allAnswer.filter(item => item.commit_answer !== '')
} }
...@@ -174,6 +232,7 @@ export default { ...@@ -174,6 +232,7 @@ export default {
// 空数据的索引 // 空数据的索引
let emptyDataIndex = this.getAnswer().findIndex(item => item.commit_answer === '') let emptyDataIndex = this.getAnswer().findIndex(item => item.commit_answer === '')
// 判断业绩比较基准是否为空 // 判断业绩比较基准是否为空
if (this.$refs.compares) {
const hasEmptyInput = !!this.$refs.compares[0].inputList.find(item => { const hasEmptyInput = !!this.$refs.compares[0].inputList.find(item => {
return item.input1 === '' || item.input2 === '' return item.input1 === '' || item.input2 === ''
}) })
...@@ -182,6 +241,7 @@ export default { ...@@ -182,6 +241,7 @@ export default {
const dataIndex = this.getAnswer().findIndex(item => item.id === dataId) const dataIndex = this.getAnswer().findIndex(item => item.id === dataId)
emptyDataIndex = emptyDataIndex > dataIndex && emptyDataIndex !== -1 ? dataIndex : emptyDataIndex emptyDataIndex = emptyDataIndex > dataIndex && emptyDataIndex !== -1 ? dataIndex : emptyDataIndex
} }
}
if (emptyDataIndex === -1) { if (emptyDataIndex === -1) {
commitCase({ answers: JSON.stringify(this.getAnswer()) }) commitCase({ answers: JSON.stringify(this.getAnswer()) })
.then(res => { .then(res => {
...@@ -200,7 +260,7 @@ export default { ...@@ -200,7 +260,7 @@ export default {
// 空数据的元素 // 空数据的元素
const emptyElement = document.querySelector(`[id="${this.getAnswer()[emptyDataIndex].id}"]`) const emptyElement = document.querySelector(`[id="${this.getAnswer()[emptyDataIndex].id}"]`)
// 空的情况,所有的高亮 // 空的情况,所有的高亮
$('.isDomActive').each(function() { $('.isDomActive').each(function () {
$(this).removeClass('active') $(this).removeClass('active')
if (this.tagName === 'INPUT' || this.tagName === 'TEXTAREA') { if (this.tagName === 'INPUT' || this.tagName === 'TEXTAREA') {
if ($(this).val() === '') $(this).addClass('active') if ($(this).val() === '') $(this).addClass('active')
...@@ -211,7 +271,7 @@ export default { ...@@ -211,7 +271,7 @@ export default {
}) })
$('.tag-input').css('border-bottom', '1px solid rgba(219, 38, 38, 1)') $('.tag-input').css('border-bottom', '1px solid rgba(219, 38, 38, 1)')
// 监听输入,去掉高亮 // 监听输入,去掉高亮
$('.isDomActive').bind('input propertychange', function() { $('.isDomActive').bind('input propertychange', function () {
$(this).removeClass('active') $(this).removeClass('active')
}) })
let top = 140 let top = 140
...@@ -235,8 +295,8 @@ input { ...@@ -235,8 +295,8 @@ input {
background: none; background: none;
border: none; border: none;
outline: none; outline: none;
&.active{ &.active {
border-bottom: 1px solid #C11818 !important; border-bottom: 1px solid #c11818 !important;
} }
} }
.code { .code {
...@@ -269,7 +329,7 @@ input { ...@@ -269,7 +329,7 @@ input {
text-align: center; text-align: center;
margin-top: 27px; margin-top: 27px;
position: relative; position: relative;
span{ span {
position: absolute; position: absolute;
right: 25px; right: 25px;
top: 0; top: 0;
...@@ -279,7 +339,7 @@ input { ...@@ -279,7 +339,7 @@ input {
z-index: 999; z-index: 999;
} }
} }
.tool-btn{ .tool-btn {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
<div class="analysis-box" v-if="isShow"> <div class="analysis-box" v-if="isShow">
<div class="content"> <div class="content">
<div class="close" @click="close">×</div> <div class="close" @click="close">×</div>
<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}` }}</div> <div class="title">{{ `${index + 1}.${item.subject}` }}:(分值:{{ 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>
...@@ -78,6 +78,8 @@ export default { ...@@ -78,6 +78,8 @@ export default {
background: #FFFFFF; background: #FFFFFF;
opacity: 1; opacity: 1;
border-radius: 16px; border-radius: 16px;
max-height: 500px;
overflow-y: scroll;
.close{ .close{
position: absolute; position: absolute;
top: 10px; top: 10px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论