| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- <template>
- <div class="submit-area">
- <div class="label">加盟申请</div>
- <div class="phone-num">
- <img
- src="https://res.training.luojigou.vip/FmUjRlN7yn8o8HkXV21yOAJt-2C0?imageView2/0/q/50|imageslim"
- alt="" />
- <div class="num">400-6807300</div>
- </div>
- <div class="form">
- <el-form :model="form" :rules="rules" ref="ruleForm">
- <el-form-item prop="name">
- <el-input placeholder="姓名" v-model="form.name"></el-input>
- </el-form-item>
- <el-form-item prop="phone">
- <el-input placeholder="手机号" v-model="form.phone"></el-input>
- </el-form-item>
- <el-form-item prop="email">
- <el-input placeholder="邮箱地址" v-model="form.email"></el-input>
- </el-form-item>
- <el-form-item prop="city">
- <el-input placeholder="加盟城市" v-model="form.city"></el-input>
- </el-form-item>
- <el-form-item prop="project">
- <el-select placeholder="合作项目" v-model="form.project">
- <el-option
- v-for="(item, index) in projectList"
- :key="index"
- :label="item.title"
- :value="item.title">
- </el-option>
- </el-select>
- </el-form-item>
- <el-button class="submit" :loading="loading" :disabled="disabled" @click="handleSubmit('ruleForm')">提交申请</el-button>
- </el-form>
- </div>
- </div>
- </template>
- <script>
- import axios from "axios";
- export default {
- data() {
- return {
- form: {},
- loading: false,
- disabled: false,
- rules: {
- name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
- phone: [
- { required: true, message: "请输入手机号", trigger: "blur" },
- {
- pattern: /^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\d{8}$/,
- message: "请输入正确手机号",
- trigger: "blur",
- },
- ],
- // email: [
- // { required: true, message: "请输入邮箱地址", trigger: "blur" },
- // {
- // type: "email",
- // message: "请输入正确的邮箱地址",
- // trigger: ["blur", "change"],
- // },
- // ],
- city: [{ required: true, message: "请输入加盟城市", trigger: "blur" }],
- project: [{ required: true, message: "请选择合作项目", trigger: "blur" }]
- },
- // 1-家庭(专柜)1-逻辑狗思维游戏HOME&PLUS馆 2-思维芯游戏室 2-“思维芯”四大课程体系 4-逻辑狗·探索小镇
- projectList: [
- {
- id: 1,
- value: 1,
- title: '逻辑狗专柜'
- },
- {
- id: 2,
- value: 1,
- title: '逻辑狗创意馆'
- },
- {
- id: 3,
- value: 2,
- title: '思维芯游戏室'
- },
- {
- id: 4,
- value: 2,
- title: '“思维芯”四大课程体系'
- },
- {
- id: 5,
- value: 4,
- title: '逻辑狗·探索小镇'
- }
- ],
- }
- },
- methods: {
- async handleSubmit(formName) {
- this.$refs[formName].validate(async (valid) => {
- if (valid) {
- // 根据选项获取选项的value
- // const index = this.projectList.findIndex(item => {
- // return item.id === this.form.project;
- // })
- // if(index == -1) {
- // this.$notify({
- // title: '失败',
- // message: '选择数据有误',
- // type: 'info'
- // });
- // return
- // }
- this.loading = true;
- this.disabled = true;
- const { data } = await axios.post(`${this.$store.state.wordpressAPI}/official-api/joinIn`,{
- ...this.form
- });
- if(data.status == 200 ) {
- this.$notify({
- title: '成功',
- message: '提交成功',
- type: 'success'
- });
- this.$refs[formName].resetFields();
- } else {
- this.$notify({
- title: '失败',
- message: '提交失败',
- type: 'info'
- });
- }
- this.loading = false;
- this.disabled = false;
- // this.$message.success('提交成功');
- } else {
- this.loading = false;
- this.disabled = false;
- console.log('err');
- return false;
- }
- });
- }
- }
- }
- </script>
- <style lang="scss">
- .submit-area {
- background: #FFFFFF;
- border-radius: 20px;
- padding: 32px 38px 32px;
- .label {
- text-align: left;
- font-size: 14px;
- font-family: PingFangSC-Regular, sans-serif;
- font-weight: 400;
- color: #000000;
- margin-bottom: 7px;
- }
- .phone-num {
- display: flex;
- align-items: center;
- img {
- width: 22px;
- height: 22px;
- display: block;
- margin-right: 15px;
- }
- .num {
- font-size: 26px;
- font-family: PingFangSC-Medium, sans-serif;
- font-weight: bold;
- color: rgba(0, 0, 0, 1);
- }
- }
- .form {
- margin-top: 20px;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: center;
- .el-input {
- width: 250px;
- height: 44px;
- }
- .el-form-item__error {
- color: #cd2026;
- // left: 124px;
- }
- .el-form-item {
- &.is-error {
- .el-input__inner {
- border-color: #dcdfe6;
- }
- }
- }
- .el-button {
- border: none;
- }
- .submit {
- margin: 0 auto;
- text-align: center;
- font-size: 14px;
- color: #fff;
- width: 148px;
- height: 34px;
- background: linear-gradient(180deg, #4482FE 0%, #004DE7 100%);
- box-shadow: 0px 7px 14px 0px rgba(136, 176, 254, 0.79);
- border-radius: 32px;
- }
- img {
- width: 176px;
- height: 55px;
- }
- }
- }
- </style>
|