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

feat: 营销工具开发完成

上级 b33cdaf0
import httpRequest from '@/utils/axios'
/**
* 获取产品类型列表
*/
export function getReport() {
return httpRequest.get('/api/xtraining/api/v1/marketing/report-detail').then({})
}
// 提交报告
export function submitReport(data) {
return httpRequest.post('/api/xtraining/api/v1/marketing/report', data, {
headers: { 'Content-Type': 'application/json' }
})
}
......@@ -8,7 +8,12 @@
<div class="content-box">
<div class="step-content1" v-if="stepsIndex === 0">
<div class="video-box">
<img src="https://webapp-pub.ezijing.com/x-training-new/dy-bg.png" v-if="!registerIndex" />
<div class="dy-box" v-if="!registerIndex">
<img src="https://webapp-pub.ezijing.com/x-training-new/dy-bg.png" />
<div class="works-title">{{ form.title }}</div>
<div class="works-dec">{{ form.dec }}</div>
<video :src="form.url" width="375px" class="video"></video>
</div>
<div class="register-step" v-else>
<img :src="`https://webapp-pub.ezijing.com/x-training-new/register${registerIndex}.JPG`" />
</div>
......@@ -40,7 +45,7 @@
<div class="step-content1 step-content3" v-if="stepsIndex === 2">
<div class="video-box">
<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" />
<div class="works-title">{{ form.title }}</div>
<div class="works-dec">{{ form.dec }}</div>
<video :src="form.url" width="375px" class="video"></video>
......@@ -53,14 +58,16 @@
<div class="text">{{ registerText }}</div>
</div>
<div class="mian-btn">
<el-button type="primary" @click="stepsIndex++" v-if="stepsIndex != 2">继续</el-button>
<el-button type="primary" @click="stepsIndex++" v-else>确认提交</el-button>
<el-button type="primary" @click="stepsIndex--" v-if="stepsIndex != 0">上一步</el-button>
<el-button type="primary" @click="stepsIndex++" v-if="stepsIndex != 2">下一步</el-button>
<el-button type="primary" @click="submitReport" v-else>完成</el-button>
</div>
</div>
</div>
</template>
<script>
import { getReport, submitReport } from '../api'
import UploadVideo from '@/components/upload/UploadVideo.vue'
export default {
components: { UploadVideo },
......@@ -78,7 +85,35 @@ export default {
dataText: '第一步:点击“我”,进入个人主页'
}
},
mounted() {
this.getReport()
},
methods: {
// 提交报告
submitReport() {
const isNull = Object.values(this.form).findIndex(item => { return item === '' })
if (isNull !== -1) {
this.$message('请在发布视频完善信息')
return false
}
const params = [{ type: 1, commit_report: this.form }]
submitReport({ reports: JSON.stringify(params) }).then(res => {
this.$message({
message: '保存成功!你可以在作品展示中查看/编辑报告,查看成绩',
type: 'success'
})
setTimeout(() => {
this.$router.push({ path: '/works-show' })
}, 3000)
})
},
// 获取报告
getReport() {
getReport().then(res => {
this.form = res.data.reports[0].answer.commit_report
})
},
// 查看营销数据教程
dataNext() {
const styles = {
1: { w: '50px', t: '30px', l: '320px', text: '第二步:点击右上角,进入菜单' },
......@@ -90,26 +125,18 @@ export default {
const getDom = this.$refs.dataBtn.style
this.setStyle(getStyle, getDom)
},
// 注册教程
registerNext() {
const styles = {
0: { w: '60px', t: '600px', l: '300px', text: '第一步:打开抖音APP,点击底部“我”' },
1: { w: '310px', t: '380px', 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: '第五步:登录成功之后,在右下角点击“我”,就可以修改自己的头像和资料了' }
}
// if (this.registerIndex < 3) {
// this.registerIndex++
// } else {
// this.registerIndex = 0
// }
this.registerIndex < 3 ? this.registerIndex++ : this.registerIndex = 0
if (this.registerIndex < 4) this.registerIndex++
const getStyle = styles[this.registerIndex]
const getDom = this.$refs.registerBtn.style
this.setStyle(getStyle, getDom)
// getDom.width = getStyle.w
// getDom.top = getStyle.t
// getDom.left = getStyle.l
// this.registerText = getStyle.text
},
setStyle(sty, dom) {
dom.width = sty.w
......@@ -153,15 +180,11 @@ export default {
margin-left: 30px;
max-width: 300px;
}
}
.step-content2 {
display: flex;
.dy-box {
min-width: 375px;
width: 375px;
height: 667px;
background: #000;
margin-left: 80px;
position: relative;
img {
position: absolute;
......@@ -202,18 +225,15 @@ export default {
transform: translateY(-50%);
}
}
.form-box {
flex: 1;
}
}
.step-content3 {
.step-content2 {
display: flex;
justify-content: center;
.dy-box {
min-width: 375px;
width: 375px;
height: 667px;
background: #000;
margin-left: 80px;
position: relative;
img {
position: absolute;
......@@ -254,6 +274,13 @@ export default {
transform: translateY(-50%);
}
}
.form-box {
flex: 1;
}
}
.step-content3 {
display: flex;
justify-content: center;
}
.content-box {
padding-top: 30px;
......
......@@ -16,13 +16,3 @@ export function getCasesList(id) {
export function selectCase(id) {
return httpRequest.post(`/api/xtraining/api/v1/${id}/select-case`, {})
}
// 发票充值
export function deposit() {
return httpRequest.post('/api/finance/v1/invoices/deposit')
}
// 下载发票列表
export function downloadInvoices(params) {
return httpRequest.get('/api/finance/v1/invoices/download', { params, responseType: 'blob' })
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论