Browse Source

创新挑战

master
aBin 4 years ago
parent
commit
9427eee5c9
  1. 6
      src/views/Business/components/SearchBox.vue
  2. 2
      src/views/Challenge/Children/Release.vue
  3. 74
      src/views/Challenge/Children/components/Publish.vue

6
src/views/Business/components/SearchBox.vue

@ -1,6 +1,6 @@
<template> <template>
<div class="search-list"> <div class="search-list">
<span style="font-size: 20px; font-weight: blod; color: rgba(0, 0, 0, 0.85)">栏目</span> <span style="height: 28px; line-height: 28px; font-size: 20px; font-weight: bold; color: rgba(0, 0, 0, 0.85)">栏目</span>
<!-- <a-select allow-clear style="width: 120px" @change="handleChange"> <!-- <a-select allow-clear style="width: 120px" @change="handleChange">
<a-select-option v-for="(item, index) in bannerList" :key="index" :value="index + 1"> {{ item }} </a-select-option> <a-select-option v-for="(item, index) in bannerList" :key="index" :value="index + 1"> {{ item }} </a-select-option>
</a-select> --> </a-select> -->
@ -14,7 +14,7 @@
{{ item }} {{ item }}
</span> </span>
<br /> <br />
<span style="font-size: 20px; font-weight: blod; color: rgba(0, 0, 0, 0.85)">类型</span> <span style="font-size: 20px; font-weight: bold; color: rgba(0, 0, 0, 0.85)">类型</span>
<span <span
class="ban-style" class="ban-style"
:class="typeNum === index + 1 ? 'ban-act' : ''" :class="typeNum === index + 1 ? 'ban-act' : ''"
@ -25,7 +25,7 @@
{{ item }} {{ item }}
</span> </span>
<br /> <br />
<span style="font-size: 20px; font-weight: blod; color: rgba(0, 0, 0, 0.85)">时间</span> <span style="font-size: 20px; font-weight: bold; color: rgba(0, 0, 0, 0.85)">时间</span>
<span <span
class="ban-style" class="ban-style"
:class="timeNum === index + 1 ? 'ban-act' : ''" :class="timeNum === index + 1 ? 'ban-act' : ''"

2
src/views/Challenge/Children/Release.vue

@ -4,7 +4,7 @@
<div class="d-flex flex-wrap" v-if="lists.length > 0"> <div class="d-flex flex-wrap" v-if="lists.length > 0">
<div :class="(index + 1) % 4 === 0 ? 'margin-0' : ''" :key="index" class="pro-box" v-for="(item, index) in lists"> <div :class="(index + 1) % 4 === 0 ? 'margin-0' : ''" :key="index" class="pro-box" v-for="(item, index) in lists">
<p class="pro-title">{{ item.title }}</p> <p class="pro-title">{{ item.title }}</p>
<p class="pro-content">{{ item.content }}</p> <div class="pro-content" v-dompurify-html="item.content"></div>
<p class="pro-time">时间{{ item.deadline }}</p> <p class="pro-time">时间{{ item.deadline }}</p>
<unveiling :pro-id="item.id" class="pro-btn" type="primary" /> <unveiling :pro-id="item.id" class="pro-btn" type="primary" />
</div> </div>

74
src/views/Challenge/Children/components/Publish.vue

@ -35,6 +35,16 @@
ref="myQuillEditor" ref="myQuillEditor"
v-model="needContent" v-model="needContent"
></quill-editor> ></quill-editor>
<a-upload
accept="image/png, image/jpeg"
name="files"
:multiple="false"
style="display: none"
:action="action"
@change="fileChange"
>
<a-button id="upload-img"> <a-icon type="upload" /></a-button>
</a-upload>
</a-form-item> </a-form-item>
<!-- 现有基础 --> <!-- 现有基础 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="现有基础"> <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" class="mb-3" label="现有基础">
@ -53,6 +63,7 @@ import { quillEditor } from 'vue-quill-editor'; //调用编辑器
import 'quill/dist/quill.core.css'; import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css'; import 'quill/dist/quill.bubble.css';
import { upload, addTelease } from 'config/api';
const formItemLayout = { const formItemLayout = {
labelCol: { span: 5 }, labelCol: { span: 5 },
@ -87,6 +98,7 @@ export default {
form: this.$form.createForm(this, { name: 'submit' }), form: this.$form.createForm(this, { name: 'submit' }),
visible: false, visible: false,
title: '发榜', title: '发榜',
action: upload,
formItemLayout, formItemLayout,
formTailLayout, formTailLayout,
confirmLoading: false, confirmLoading: false,
@ -99,7 +111,8 @@ export default {
handlers: { handlers: {
image: function(value) { image: function(value) {
if (value) { if (value) {
alert('自定义图片'); // alert('');
document.getElementById('upload-img').click();
} else { } else {
this.quill.format('image', false); this.quill.format('image', false);
} }
@ -122,6 +135,7 @@ export default {
type: [], type: [],
buildTime: '', buildTime: '',
}, },
hideMessage: null,
}; };
}, },
@ -147,12 +161,19 @@ export default {
// //
fileChange(info) { fileChange(info) {
console.log(info); console.log(info);
if (info.file.status === 'uploading') {
if (!this.hideMessage) {
this.hideMessage = this.$message.loading('上传中...');
}
}
// this.fileList = info.fileList; // this.fileList = info.fileList;
// if (info.file.status === 'done') { if (info.file.status === 'done') {
// this.files = []; this.files = [];
// this.files = info.fileList[0].response.data[0].id; const img = `<img src=${info.file.response.data[0].visitUrl} >`;
// console.log(this.files); this.needContent += img;
// } setTimeout(this.hideMessage, 0);
this.$message.success('上传成功');
}
}, },
// //
@ -166,28 +187,35 @@ export default {
// //
handleOk() { handleOk() {
console.log(this.needContent); this.subMitAdd();
// this.subMitAdd();
}, },
// //
async subMitAdd() { async subMitAdd() {
this.confirmLoading = true; this.confirmLoading = true;
try { try {
// const params = { param: {} }; const params = {
// const res = await apply(params); param: {
// const { code, msg, data } = res.data; title: this.platform.needName,
// if (code === 200) { content: this.needContent,
// this.$message.success(''); servics: this.platform.technicalField,
// this.visible = false; deadline: this.platform.buildTime,
// this.confirmLoading = false; existingBasis: this.platform.basics,
// for (let key in this.platform) { models: this.platform.type,
// this.platform[key] = ''; },
// } };
// this.platform.isTel = false; const res = await addTelease(params);
// } else { const { code, msg, data } = res.data;
// throw msg; if (code === 200) {
// this.confirmLoading = false; this.$message.success('发榜成功');
// } this.visible = false;
this.confirmLoading = false;
for (let key in this.platform) {
this.platform[key] = '';
}
} else {
throw msg;
this.confirmLoading = false;
}
} catch (error) { } catch (error) {
this.$message.error(error); this.$message.error(error);
this.confirmLoading = false; this.confirmLoading = false;

Loading…
Cancel
Save