Browse Source

申请加入,意向填报,加入购物车表单

master
aBin 5 years ago
parent
commit
6423797b16
  1. 29
      src/components/HeadNav/HeadNav.vue
  2. 94
      src/components/Introduce/AddShopping.vue
  3. 232
      src/components/Introduce/IntentionModel.vue
  4. 15
      src/components/PlatformList/Fruit.vue
  5. 3
      src/components/PlatformList/PlatformList.vue
  6. 6
      src/config/api.js
  7. 10
      src/router/index.js
  8. 2
      src/views/FirstPage/FirstPage.vue
  9. 2
      src/views/IncubationPlatform/Children/components/SenNav.vue
  10. 6
      src/views/Industry/Children/Union.vue
  11. 10
      src/views/Industry/Children/components/HNav.vue
  12. 2
      src/views/Knowledge/Knowledge.vue
  13. 22
      src/views/NewPlatform/Children/AchDet.vue
  14. 5
      src/views/NewPlatform/Children/Core.vue
  15. 6
      src/views/NewPlatform/Children/Develop.vue
  16. 2
      src/views/NewPlatform/Children/Platform.vue
  17. 65
      src/views/NewPlatform/Children/ServiceDet.vue
  18. 14
      src/views/NewPlatform/Children/ShareChild/InsDet.vue
  19. 2
      src/views/NewPlatform/Children/ShareChild/Institute.vue
  20. 2
      src/views/NewPlatform/Children/components/SenNav.vue
  21. 204
      src/views/NewPlatform/components/NewModel.vue

29
src/components/HeadNav/HeadNav.vue

@ -2,23 +2,13 @@
<div class="head">
<img @click="jumUrl('/')" alt class="logo-img" src="@/assets/logo.png" style="cursor: pointer" />
<div class="li-box">
<a-dropdown
:disabled="item.children.length > 0 ? false : true"
:key="a"
class="list-down"
v-for="(item, a) in list"
>
<a-dropdown :disabled="item.children.length > 0 ? false : true" :key="a" class="list-down" v-for="(item, a) in list">
<a @click="jumUrl(item.url)" class="ant-dropdown-link">
{{ item.name }}&nbsp;&nbsp;
<a-icon type="down" v-show="item.children.length > 0" />
</a>
<a-menu slot="overlay">
<a-menu-item
:key="b"
class="px-6 py-3"
style="text-align: center"
v-for="(con, b) in item.children"
>
<a-menu-item :key="b" class="px-6 py-3" style="text-align: center" v-for="(con, b) in item.children">
<a @click="jumUrl(con.url)">{{ con.title }}</a>
</a-menu-item>
</a-menu>
@ -29,12 +19,7 @@
<template slot="title">
<span>点击查看购物车</span>
</template>
<a-icon
@click="$router.push('/Cart')"
class="icon-head baseColor"
style="right: 100px"
type="shopping-cart"
/>
<a-icon @click="$router.push('/Cart')" class="icon-head baseColor" style="right: 100px" type="shopping-cart" />
</a-tooltip>
<router-link tag="span" to="/login">
<a-icon class="icon-head" style="right: 50px" type="user" />
@ -133,18 +118,18 @@ export default {
children: [
{
title: '产业创新联盟',
url: '/Challenge/Union',
url: '/Industry/Union',
},
{
title: '产业服务',
url: '/Challenge/Serve',
url: '/Industry/Serve',
},
{
title: '衍生企业',
url: '/Challenge/Enterprise',
url: '/Industry/Enterprise',
},
],
url: '/Challenge/Union',
url: '/Industry/Union',
},
{
name: '知识平台',

94
src/components/Introduce/AddShopping.vue

@ -0,0 +1,94 @@
<template>
<div>
<a-button type="primary" @click="showModal">
{{ str }}
</a-button>
<a-modal width="50%" :title="title" :visible="visible" :confirm-loading="confirmLoading" @ok="handleOk" @cancel="handleCancel">
<a-form :form="form">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="项目信息简述">
<a-textarea v-model.trim="describe" style="height: 120px" placeholder="请输入项目信息简述..." />
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex';
import { addCar } from 'config/api';
const formItemLayout = {
labelCol: { span: 5 },
wrapperCol: { span: 18 },
};
const formTailLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 18, offset: 6 },
};
export default {
name: 'NewModel',
props: {
typeData: {
type: Object,
default: null,
},
},
data() {
return {
form: this.$form.createForm(this, { name: 'submit' }),
title: '加入购物车',
str: '加入购物车',
visible: false,
formItemLayout,
formTailLayout,
confirmLoading: false,
describe: '', //
};
},
methods: {
//
showModal() {
this.visible = true;
},
//
handleCancel(e) {
this.visible = false;
},
//
async handleOk() {
this.confirmLoading = true;
try {
const params = {
param: {
description: this.describe,
serviceId: this.typeData.Id,
type: this.typeData.type,
},
};
const res = await addCar(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('加入购物车成功');
this.visible = false;
this.confirmLoading = false;
this.describe = '';
} else {
this.$message.error(msg);
}
} catch (error) {
this.$message.error(error);
}
},
},
};
</script>
<style lang="stylus" scoped>
.must-color {
color: red;
}
.code_img {
height: 32px;
width: 120px;
}
</style>

232
src/components/Introduce/IntentionModel.vue

@ -0,0 +1,232 @@
<template>
<div>
<a-button type="primary" @click="showModal">
{{ str }}
</a-button>
<a-modal width="50%" :title="title" :visible="visible" :confirm-loading="confirmLoading" @ok="handleOk" @cancel="handleCancel">
<a-form :form="form">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="公司名称">
<a-input v-model.trim="platform.companyName" placeholder="请输入公司名称..." />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="联系人" required>
<a-input v-model.trim="platform.manName" placeholder="请输入联系人..." />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="联系电话" required>
<a-input @change="changePhone" type="tel" v-decorator="['tel', { rules: phoneRules }]" placeholder="请输入联系电话.." />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片验证码" required>
<div class="d-flex flex-nowrap">
<a-input placeholder="图片验证码" type="number" v-model="codeNum" />
<img :src="picCode.imageBase64" @click="changePicCode" class="code_img ml-2" v-if="picCode && picCode.imageBase64" />
<a-button @click="changePicCode" class="code_img ml-2" size="small" v-else>获取验证码</a-button>
<!-- <a-input v-decorator="['account', { rules: rules.account }]" /> -->
</div>
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="短信验证码" required>
<div class="d-flex flex-nowrap">
<a-input placeholder="请输入验证码" type="number" v-model="platform.code" />
<a-button class="code_img ml-2" disabled type="primary" v-if="showInterval">重新发送 {{ interval }}</a-button>
<a-button :disabled="platform.isTel === false" @click="getCode" class="code_img ml-2" type="primary" v-else>
获取验证码
</a-button>
</div>
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="项目信息简述" required>
<a-textarea v-model.trim="platform.describe" style="height: 120px" placeholder="请输入项目信息简述..." />
</a-form-item>
<a-form-item
v-show="typeData.type === 0"
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="上传附件"
>
<a-upload :action="action" :default-file-list="fileList" @change="fileChange" list-type="picture" name="files">
<a-button> <a-icon type="upload" />点击上传附件 </a-button>
</a-upload>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex';
import { serviceApply, upload } from 'config/api';
const formItemLayout = {
labelCol: { span: 5 },
wrapperCol: { span: 18 },
};
const formTailLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 18, offset: 6 },
};
export default {
name: 'NewModel',
props: {
typeData: {
type: Object,
default: null,
},
},
data() {
return {
form: this.$form.createForm(this, { name: 'submit' }),
action: upload,
fileList: [],
visible: false,
title: '意向填报',
str: '意向填报',
formItemLayout,
formTailLayout,
confirmLoading: false,
platform: {
companyName: '', //
manName: '', //
tel: '', //
describe: '', //
code: '', //
files: [], // Id
isTel: false,
},
codeRules: [
{ required: true, message: '请输入验证码' },
{ min: 4, max: 4, message: '请输入4位短信验证码' },
],
codeNum: '',
showInterval: false,
codeTimer: null,
interval: 120, //
phoneRules: [
{ required: true, pattern: new RegExp(/^[1][3,4,5,6,7,8,9][0-9]{9}$/), whitespace: true, message: '请输入正确的手机号' },
],
};
},
computed: mapState('user', ['picCode']),
created() {
this.sendPicCode();
},
methods: {
...mapActions('user', ['sendCode', 'sendPicCode']),
//
showModal() {
this.visible = true;
},
//
handleCancel(e) {
this.visible = false;
},
//
changePhone(e) {
this.platform.tel = e.target.value;
this.platform.isTel = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.platform.tel);
},
//
handleOk() {
if (!this.platform.manName) {
this.$message.error('请输入联系人');
} else if (!this.platform.tel) {
this.$message.error('请输入联系电话');
} else if (!this.platform.code) {
this.$message.error('请输入验证码');
} else if (!this.platform.describe) {
this.$message.error('请输入项目信息简述');
} else {
if (this.platform.isTel) {
for (var i = 0; i < this.fileList.length; i++) {
this.platform.files = this.platform.files.concat(this.fileList[i].response.data[0].id);
}
this.subMitAdd();
// console.log(this.platform.files);
} else {
this.$message.error('请输入正确的联系电话');
}
}
},
//
async subMitAdd() {
this.confirmLoading = true;
try {
const params = {
param: {
code: this.platform.code,
companyName: this.platform.companyName,
contactName: this.platform.manName,
contactPhone: this.platform.tel,
description: this.platform.describe,
filesId: this.platform.files,
serviceId: this.typeData.Id,
type: this.typeData.type,
},
};
const res = await serviceApply(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('申请成功');
this.visible = false;
this.confirmLoading = false;
for (let key in this.platform) {
this.platform[key] = '';
}
this.platform.isTel = false;
} else {
throw msg;
this.confirmLoading = false;
}
} catch (error) {
this.$message.error(error);
this.confirmLoading = false;
}
},
//
async getCode() {
console.log(111);
try {
const params = {
phone: this.platform.tel,
verificationCodeId: this.picCode.verificationCodeId,
verificationCodeValue: this.codeNum,
};
await this.sendCode(params);
this.getCodeInterval();
} catch (error) {
// throw new Error(`SignIn.vue method getCode: ${error}`);
console.log(error);
}
},
//
getCodeInterval() {
this.showInterval = true;
this.codeTimer = setInterval(() => {
if (this.interval === 0) {
clearInterval(this.codeTimer);
this.codeTimer = null;
this.showInterval = false;
this.interval = 120;
return;
}
this.interval = this.interval - 1;
}, 1000);
},
//
changePicCode() {
this.sendPicCode();
},
fileChange(info) {
this.fileList = info.fileList;
},
},
};
</script>
<style lang="stylus" scoped>
.must-color {
color: red;
}
.code_img {
height: 32px;
width: 120px;
}
</style>

15
src/components/PlatformList/Fruit.vue

@ -5,7 +5,8 @@
<p class="font-24 my-3" style="cursor: pointer" @click="detail(item.id)">{{ item.name }}</p>
<p class="font-16" style="color: rgba(0, 0, 0, 0.45); cursor: pointer" @click="detail(item.id)">编号{{ item.identifier }}</p>
<p class="font-16 baseColor item-more">
<a-button type="primary" style="cursor: pointer">转化意向填报</a-button>
<!-- <a-button type="primary" style="cursor: pointer">转化意向填报</a-button> -->
<intention-model :type-data="getId(item.id)" />
</p>
</div>
</div>
@ -26,13 +27,19 @@
<script>
import { mapMutations, mapState } from 'vuex';
import { selRes } from 'config/api';
import IntentionModel from '../Introduce/IntentionModel.vue';
export default {
name: 'PlatformList',
components: { IntentionModel },
data() {
return {
list: [],
pageSize: 12,
total: 0,
typeData: {
type: 2,
Id: '',
},
};
},
computed: mapState('home', ['achList', 'achIpt', 'achCurrent']),
@ -82,6 +89,12 @@ export default {
this.setAchId(id);
this.$router.push('/NewPlatform/AchDet');
},
getId(Id) {
return (this.typeData = {
type: 2,
Id,
});
},
},
};
</script>

3
src/components/PlatformList/PlatformList.vue

@ -2,7 +2,8 @@
<div>
<div class="inner d-flex flex-wrap">
<div :class="(index + 1) % 4 === 0 ? 'margin-0' : ''" :key="index" class="item-box mb-6" v-for="(item, index) in list">
<img :src="item.imgUrl" style="height: 220px; width: 100%; border: 1px solid #ccc" />
<img v-if="item.picUrl" :src="item.picUrl" style="height: 220px; width: 100%" />
<img v-else :src="item.visitLocation" style="height: 220px; width: 100%" />
<p class="font-24 my-4 title">{{ item.name }}</p>
<p @click="jump(item.id)" class="font-16 baseColor" style="text-align: right; cursor: pointer">了解更多</p>
</div>

6
src/config/api.js

@ -77,6 +77,12 @@ export const selResMes = params => axios.post(`${achInstr}/selResMes`, params);
// 服务列表查询
export const selService = params => axios.post(`${greenvalley}/serviceProject/selService`, params);
// 服务详情查询
export const selContent = params => axios.post(`${greenvalley}/serviceProject/selContent`, params);
// 查询用户购物车
export const SearchCar = params => axios.post(`${service}/SearchCar`, params);
// 服务/设备/成果直接申请(意向填报)
export const serviceApply = params => axios.post(`${service}/serviceApply`, params);
// 加入购物车
export const addCar = params => axios.post(`${service}/addCar`, params);

10
src/router/index.js

@ -162,7 +162,7 @@ const routes = [
component: () => import(/* webpackChunkName: "cooperative-enterprise" */ 'views/NewPlatform/Children/Transfer.vue'),
},
{
// 资源开发利用平台
// 知识培训服务平台
path: '/NewPlatform/Develop',
name: 'Develop',
component: () => import(/* webpackChunkName: "cooperative-enterprise" */ 'views/NewPlatform/Children/Develop.vue'),
@ -255,23 +255,23 @@ const routes = [
],
},
{
// 创新挑战
// 产业平台
path: '/Industry/Union',
name: 'Industry',
component: () => import(/* webpackChunkName: "cooperative-enterprise" */ 'views/Industry/Industry.vue'),
children: [
{
path: '/Challenge/Union',
path: '/Industry/Union',
name: 'Union',
component: () => import(/* webpackChunkName: "cooperative-enterprise" */ 'views/Industry/Children/Union.vue'),
},
{
path: '/Challenge/Serve',
path: '/Industry/Serve',
name: 'Serve',
component: () => import(/* webpackChunkName: "cooperative-enterprise" */ 'views/Industry/Children/Serve.vue'),
},
{
path: '/Challenge/Enterprise',
path: '/Industry/Enterprise',
name: 'Enterprise',
component: () => import(/* webpackChunkName: "cooperative-enterprise" */ 'views/Industry/Children/Enterprise.vue'),
},

2
src/views/FirstPage/FirstPage.vue

@ -90,7 +90,7 @@ export default {
},
{
id: '08',
firstName: '资源开发利用平台',
firstName: '知识培训服务平台',
secondName: '',
},
],

2
src/views/IncubationPlatform/Children/components/SenNav.vue

@ -23,7 +23,7 @@ export default {
url: '/NewPlatform/Transfer',
},
{
title: '资源开发利用平台',
title: '知识培训服务平台',
url: '/NewPlatform/Develop',
},
],

6
src/views/Industry/Children/Union.vue

@ -28,7 +28,8 @@
赋能健康中国筑梦绿色未来为愿景构建创新创业生态发展特色产业集群打造全链条一体化开放
式创新创业高地为使命大力推动建设共融共生共建 共创价值共同体
</div>
<a-button class="center-btn" type="primary">申请加入</a-button>
<new-model class="center-btn" />
<!-- <a-button class="center-btn" type="primary">申请加入</a-button> -->
</div>
<div class="center-box c-box" style="margin-bottom: 160px">
<div class="center-title">
@ -62,9 +63,10 @@
<script>
import HNav from './components/HNav.vue';
import BreadCrumb from 'components/BreadCrumb/BreadCrumb.vue';
import NewModel from '../../NewPlatform/components/NewModel.vue';
export default {
name: 'Union',
components: { HNav, BreadCrumb },
components: { HNav, BreadCrumb, NewModel },
data() {
return {
title: '产业创新联盟',

10
src/views/Industry/Children/components/HNav.vue

@ -16,24 +16,24 @@ export default {
list: [
{
title: '产业创新联盟',
url: '/Challenge/Union',
url: '/Industry/Union',
},
{
title: '产业服务',
url: '/Challenge/Serve',
url: '/Industry/Serve',
},
{
title: '衍生企业',
url: '/Challenge/Enterprise',
url: '/Industry/Enterprise',
},
],
};
},
created() {
console.log();
if (this.$route.fullPath === '/Challenge/Serve') {
if (this.$route.fullPath === '/Industry/Serve') {
this.activeNum = 1;
} else if (this.$route.fullPath === '/Challenge/Enterprise') {
} else if (this.$route.fullPath === '/Industry/Enterprise') {
this.activeNum = 2;
} else {
this.activeNum = 0;

2
src/views/Knowledge/Knowledge.vue

@ -14,7 +14,7 @@ export default {
components: { BreadCrumb },
data() {
return {
str: '这是资源开发利用平台',
str: '知识培训服务平台',
title: '知识平台',
typeOfPlatform: '知识平台',
arr: [{ name: '知识平台', url: '/Knowledge' }],

22
src/views/NewPlatform/Children/AchDet.vue

@ -28,10 +28,12 @@
<p>{{ obj.stage }}</p>
</div>
</div>
<p class="equ-btn">
<a-button style="margin-right: 20px">转化意向</a-button>
<a-button type="primary">加入购物车</a-button>
</p>
<div class="equ-btn">
<!-- <a-button style="margin-right: 20px">转化意向</a-button> -->
<intention-model :type-data="typeData" style="margin-right: 20px; float: left" />
<!-- <a-button type="primary">加入购物车</a-button> -->
<add-shopping :type-data="typeData" style="margin-right: 20px; float: right" />
</div>
</div>
</div>
<div class="content-box">
@ -43,13 +45,23 @@
<script>
import { mapState } from 'vuex';
import { selResMes } from 'config/api';
import IntentionModel from 'components/Introduce/IntentionModel.vue';
import AddShopping from 'components/Introduce/AddShopping.vue';
export default {
name: 'AchDet',
components: { IntentionModel, AddShopping },
data() {
return { obj: {} };
return {
obj: {},
typeData: {
type: 2,
Id: '',
},
};
},
computed: mapState('home', ['achId']),
created() {
this.typeData.Id = this.achId;
this.getData();
},
methods: {

5
src/views/NewPlatform/Children/Core.vue

@ -53,7 +53,7 @@
申请加入文字介绍申请加入文字介绍申请加入文字介绍申请加入文字介绍申请加入文字介绍申请加入文字介绍
申请加入文字介绍申请加入文字介绍申请加入文字介绍申请加入文字介绍申请加入文字介绍申请加入文字介绍申请加入文字介绍申请加入文字介绍
<div>
<a-button type="primary">申请加入</a-button>
<new-model />
</div>
</div>
</div>
@ -65,9 +65,10 @@ import '@/common/platform.styl';
import HNav from './../components/HNav.vue';
import BreadCrumb from 'components/BreadCrumb/BreadCrumb.vue';
import DeEnt from './components/DeEnt.vue';
import NewModel from './../components/NewModel.vue';
export default {
name: 'Core',
components: { HNav, BreadCrumb, DeEnt },
components: { HNav, BreadCrumb, DeEnt, NewModel },
data() {
return {
str: '这是中心界面',

6
src/views/NewPlatform/Children/Develop.vue

@ -16,13 +16,13 @@ export default {
components: { SenNav, BreadCrumb },
data() {
return {
str: '这是资源开发利用平台',
title: '资源开发利用平台',
str: '这是知识培训服务平台',
title: '知识培训服务平台',
typeOfPlatform: '创新平台',
arr: [
{ name: '创新平台', url: '/NewPlatform/NewCore' },
{ name: '创新资源平台', url: '/NewPlatform/News' },
{ name: '资源开发利用平台', url: '' },
{ name: '知识培训服务平台', url: '' },
],
list: [],
};

2
src/views/NewPlatform/Children/Platform.vue

@ -60,7 +60,7 @@ export default {
url: '/NewPlatform/Transfer',
},
{
title: '资源开发利用平台',
title: '知识培训服务平台',
content:
'山西绿谷生物科技股份有限公司立足功能食品、生物医药和大健康产业,聚焦“创新”、聚力“孵化”、聚合“产业”,' +
'致力建设集创新链、孵化链和产业链为一体,产学研协同、多学科交叉、大中小企业...',

65
src/views/NewPlatform/Children/ServiceDet.vue

@ -1,23 +1,61 @@
<template>
<div>
<rotation />
<div class="posi-name">
<p class="service-name">{{ obj.name }}</p>
<p class="service-eng">SERVICE</p>
</div>
<div class="inner service-box">
<div style="margin-bottom: 40px">简介</div>
<div style="margin-bottom: 40px" v-dompurify-html="obj.content"></div>
<div>
<a-button>直接申请</a-button>
<a-button type="primary">加入购物车</a-button>
<!-- <a-button>直接申请</a-button> -->
<intention-model style="float: left; margin-right: 20px" :type-data="typeData" />
<!-- <a-button type="primary">加入购物车</a-button> -->
<add-shopping :type-data="typeData" />
</div>
</div>
</div>
</template>
<script>
import { selContent } from 'config/api';
import IntentionModel from 'components/Introduce/IntentionModel.vue';
import Rotation from 'components/Rotation/Rotation.vue';
import AddShopping from 'components/Introduce/AddShopping.vue';
export default {
name: 'ServiceDet',
components: { IntentionModel, Rotation, AddShopping },
data() {
return {};
return {
obj: {
name: '',
id: '',
content: '',
},
typeData: {
type: 0,
Id: '',
},
};
},
created() {
console.log(this.$route.params.id);
this.typeData.Id = this.$route.params.id;
this.getData(this.$route.params.id);
},
methods: {
async getData(id) {
try {
const params = { param: { id } };
const res = await selContent(params);
const { code, msg, data } = res.data;
if (code === 200) {
console.log(data);
this.obj = data;
}
} catch (error) {
console.log(error);
}
},
},
};
</script>
@ -29,4 +67,21 @@ export default {
padding: 20px;
background: #fff;
}
.posi-name {
position: absolute;
left: 20%;
top: 300px;
color: #fff;
text-align: center;
}
.service-name {
font-size: 40px;
margin-bottom: 0 !important;
}
.service-eng {
font-size: 16px;
}
</style>

14
src/views/NewPlatform/Children/ShareChild/InsDet.vue

@ -29,8 +29,10 @@
</div>
</div>
<p class="equ-btn">
<a-button style="margin-right: 20px">转化意向</a-button>
<a-button type="primary">加入购物车</a-button>
<intention-model :type-data="typeData" style="margin-right: 20px; float: left" />
<!-- <a-button style="margin-right: 20px">转化意向</a-button> -->
<!-- <a-button type="primary">加入购物车</a-button> -->
<add-shopping :type-data="typeData" style="margin-right: 20px; float: right" />
</p>
</div>
</div>
@ -42,16 +44,24 @@
<script>
import { selInstrumentMes } from 'config/api';
import IntentionModel from 'components/Introduce/IntentionModel.vue';
import AddShopping from 'components/Introduce/AddShopping.vue';
export default {
name: 'InsDet',
components: { IntentionModel, AddShopping },
data() {
return {
obj: {},
typeData: {
type: 1,
Id: '',
},
id: 0,
};
},
created() {
this.id = this.$route.params.id;
this.typeData.Id = this.$route.params.id;
this.getData();
},
methods: {

2
src/views/NewPlatform/Children/ShareChild/Institute.vue

@ -9,7 +9,7 @@
<p class="font-bold-24 item-title">设备列表</p>
<div class="d-flex flex-wrap">
<div v-for="(item, index) in list" :key="index" class="item-box" :class="(index + 1) % 4 === 0 ? 'margin-0' : ''">
<img :src="item.imgUrl" style="height: 220px; width: 100%; border: 1px solid #ccc" />
<img :src="item.visitLocation" style="height: 220px; width: 100%" />
<p class="font-24 my-4">{{ item.name }}</p>
<p class="font-16 baseColor item-more" @click="jump(item.id)">了解更多</p>
</div>

2
src/views/NewPlatform/Children/components/SenNav.vue

@ -23,7 +23,7 @@ export default {
url: '/NewPlatform/Transfer',
},
{
title: '资源开发利用平台',
title: '知识培训服务平台',
url: '/NewPlatform/Develop',
},
],

204
src/views/NewPlatform/components/NewModel.vue

@ -0,0 +1,204 @@
<template>
<div>
<a-button type="primary" @click="showModal">
{{ str }}
</a-button>
<a-modal width="50%" :title="title" :visible="visible" :confirm-loading="confirmLoading" @ok="handleOk" @cancel="handleCancel">
<a-form :form="form">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="公司名称">
<a-input v-model.trim="platform.companyName" placeholder="请输入公司名称..." />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="联系人" required>
<a-input v-model.trim="platform.manName" placeholder="请输入联系人..." />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="联系电话" required>
<a-input @change="changePhone" type="tel" v-decorator="['tel', { rules: phoneRules }]" placeholder="请输入联系电话.." />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片验证码" required>
<div class="d-flex flex-nowrap">
<a-input placeholder="图片验证码" type="number" v-model="codeNum" />
<img :src="picCode.imageBase64" @click="changePicCode" class="code_img ml-2" v-if="picCode && picCode.imageBase64" />
<a-button @click="changePicCode" class="code_img ml-2" size="small" v-else>获取验证码</a-button>
<!-- <a-input v-decorator="['account', { rules: rules.account }]" /> -->
</div>
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="短信验证码" required>
<div class="d-flex flex-nowrap">
<a-input placeholder="请输入验证码" type="number" v-model="platform.code" />
<a-button class="code_img ml-2" disabled type="primary" v-if="showInterval">重新发送 {{ interval }}</a-button>
<a-button :disabled="platform.isTel === false" @click="getCode" class="code_img ml-2" type="primary" v-else>
获取验证码
</a-button>
</div>
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="项目信息简述" required>
<a-textarea v-model.trim="platform.describe" style="height: 120px" placeholder="请输入项目信息简述..." />
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex';
import { JoinPlatform } from 'config/api';
const formItemLayout = {
labelCol: { span: 5 },
wrapperCol: { span: 18 },
};
const formTailLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 18, offset: 6 },
};
export default {
name: 'NewModel',
data() {
return {
form: this.$form.createForm(this, { name: 'submit' }),
visible: false,
title: '协同创新中心加入申请',
str: '申请加入',
formItemLayout,
formTailLayout,
confirmLoading: false,
platform: {
companyName: '', //
manName: '', //
tel: '', //
describe: '', //
code: '', //
isTel: false,
},
codeRules: [
{ required: true, message: '请输入验证码' },
{ min: 4, max: 4, message: '请输入4位短信验证码' },
],
codeNum: '',
showInterval: false,
codeTimer: null,
interval: 120, //
phoneRules: [
{ required: true, pattern: new RegExp(/^[1][3,4,5,6,7,8,9][0-9]{9}$/), whitespace: true, message: '请输入正确的手机号' },
],
};
},
computed: mapState('user', ['picCode']),
created() {
this.sendPicCode();
},
methods: {
...mapActions('user', ['sendCode', 'sendPicCode']),
//
showModal() {
this.visible = true;
},
//
handleCancel(e) {
this.visible = false;
},
//
changePhone(e) {
this.platform.tel = e.target.value;
this.platform.isTel = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.platform.tel);
},
//
handleOk() {
if (!this.platform.manName) {
this.$message.error('请输入联系人');
} else if (!this.platform.tel) {
this.$message.error('请输入联系电话');
} else if (!this.platform.code) {
this.$message.error('请输入验证码');
} else if (!this.platform.describe) {
this.$message.error('请输入项目信息简述');
} else {
if (this.platform.isTel) {
this.subMitAdd();
} else {
this.$message.error('请输入正确的联系电话');
}
}
},
//
async subMitAdd() {
this.confirmLoading = true;
try {
const params = {
param: {
code: this.platform.code,
companyName: this.platform.companyName,
contactName: this.platform.manName,
contactPhone: this.platform.tel,
description: this.platform.describe,
type: 0,
},
};
const res = await JoinPlatform(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.$message.success('申请成功');
this.visible = false;
this.confirmLoading = false;
for (let key in this.platform) {
this.platform[key] = '';
}
this.platform.isTel = false;
} else {
throw msg;
this.confirmLoading = false;
}
} catch (error) {
this.$message.error(error);
this.confirmLoading = false;
}
},
//
async getCode() {
console.log(111);
try {
const params = {
phone: this.platform.tel,
verificationCodeId: this.picCode.verificationCodeId,
verificationCodeValue: this.codeNum,
};
await this.sendCode(params);
this.getCodeInterval();
} catch (error) {
// throw new Error(`SignIn.vue method getCode: ${error}`);
console.log(error);
}
},
//
getCodeInterval() {
this.showInterval = true;
this.codeTimer = setInterval(() => {
if (this.interval === 0) {
clearInterval(this.codeTimer);
this.codeTimer = null;
this.showInterval = false;
this.interval = 120;
return;
}
this.interval = this.interval - 1;
}, 1000);
},
//
changePicCode() {
this.sendPicCode();
},
},
};
</script>
<style lang="stylus" scoped>
.must-color {
color: red;
}
.code_img {
height: 32px;
width: 120px;
}
</style>
Loading…
Cancel
Save