Explorar o código

'合作项目'

chending1994 %!s(int64=4) %!d(string=hai) anos
pai
achega
6cb5fb842c
Modificáronse 4 ficheiros con 127 adicións e 44 borrados
  1. 32 14
      components/common/form.vue
  2. 56 8
      pages/campus/index.vue
  3. 31 14
      pages/cooperate/index.vue
  4. 8 8
      pages/merchants/index.vue

+ 32 - 14
components/common/form.vue

@@ -56,45 +56,63 @@ export default {
             trigger: "blur",
           },
         ],
-        email: [
-          { required: true, message: "请输入邮箱地址", trigger: "blur" },
-          {
-            type: "email",
-            message: "请输入正确的邮箱地址",
-            trigger: ["blur", "change"],
-          },
-        ],
+        // 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,
-          title: '逻辑狗·探索小镇'
+          value: 1,
+          title: '家庭(专柜)'
         },
         {
           id: 2,
-          title: '逻辑狗专柜'
+          value: 1,
+          title: '逻辑狗思维游戏HOME&PLUS馆'
         },
         {
           id: 3,
-          title: '逻辑狗思维体验Plus'
+          value: 2,
+          title: '思维芯游戏室'
         },
         {
           id: 4,
-          title: '逻辑狗思维体验Home'
+          value: 2,
+          title: '“思维芯”四大课程体系'
         },
         {
           id: 5,
-          title: '逻辑狗体验中心'
+          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`,{

+ 56 - 8
pages/campus/index.vue

@@ -23,6 +23,16 @@
               <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>
               <div class="submit" @click="handleSubmit('ruleForm')">提交申请</div>
             </el-form>
           </div>
@@ -150,16 +160,44 @@ export default {
             trigger: "blur",
           },
         ],
-        email: [
-          { required: true, message: "请输入邮箱地址", trigger: "blur" },
-          {
-            type: "email",
-            message: "请输入正确的邮箱地址",
-            trigger: ["blur", "change"],
-          },
-        ],
+        // email: [
+        //   { required: true, message: "请输入邮箱地址", trigger: "blur" },
+        //   {
+        //     type: "email",
+        //     message: "请输入正确的邮箱地址",
+        //     trigger: ["blur", "change"],
+        //   },
+        // ],
         city: [{ required: true, message: "请输入加盟城市", trigger: "blur" }],
       },
+      // 1-家庭(专柜)1-逻辑狗思维游戏HOME&PLUS馆 2-思维芯游戏室 2-“思维芯”四大课程体系 4-逻辑狗·探索小镇
+      projectList: [
+        {
+          id: 1,
+          value: 1,
+          title: '家庭(专柜)'
+        },
+        {
+          id: 2,
+          value: 1,
+          title: '逻辑狗思维游戏HOME&PLUS馆'
+        },
+        {
+          id: 3,
+          value: 2,
+          title: '思维芯游戏室'
+        },
+        {
+          id: 4,
+          value: 2,
+          title: '“思维芯”四大课程体系'
+        },
+        {
+          id: 5,
+          value: 4,
+          title: '逻辑狗·探索小镇'
+        }
+      ],
     }
   },
   head() {
@@ -194,6 +232,16 @@ export default {
     async handleSubmit(formName) {
       this.$refs[formName].validate(async (valid) => {
         if (valid) {
+          // const index = this.projectList.findIndex(item => {
+          //   return item.id === this.form.project;
+          // })
+          // if(index == -1) {
+          //   this.$notify({
+          //     title: '失败',
+          //     message: '选择数据有误',
+          //     type: 'info'
+          //   });
+          // }
           const { data } = await axios.post(`${this.$store.state.wordpressAPI}/official-api/joinIn`,{
             ...this.form
           });

+ 31 - 14
pages/cooperate/index.vue

@@ -120,7 +120,7 @@
                     v-for="(item, index) in projectList"
                     :key="index"
                     :label="item.title"
-                    :value="item.title">
+                    :value="item.id">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -337,26 +337,32 @@ export default {
           imgUrlSel: require("~/assets/images/cooperate/coopreate_03_sel@2x.png")
         }
       ],
+      // 1-家庭(专柜)1-逻辑狗思维游戏HOME&PLUS馆 2-思维芯游戏室 2-“思维芯”四大课程体系 4-逻辑狗·探索小镇
       projectList: [
         {
           id: 1,
-          title: '逻辑狗·探索小镇'
+          value: 1,
+          title: '家庭(专柜)'
         },
         {
           id: 2,
-          title: '逻辑狗专柜'
+          value: 1,
+          title: '逻辑狗思维游戏HOME&PLUS馆'
         },
         {
           id: 3,
-          title: '逻辑狗思维体验Plus'
+          value: 2,
+          title: '思维芯游戏室'
         },
         {
           id: 4,
-          title: '逻辑狗思维体验Home'
+          value: 2,
+          title: '“思维芯”四大课程体系'
         },
         {
           id: 5,
-          title: '逻辑狗体验中心'
+          value: 4,
+          title: '逻辑狗·探索小镇'
         }
       ],
       rules: {
@@ -369,14 +375,14 @@ export default {
             trigger: "blur",
           },
         ],
-        email: [
-          { required: true, message: "请输入邮箱地址", trigger: "blur" },
-          {
-            type: "email",
-            message: "请输入正确的邮箱地址",
-            trigger: ["blur", "change"],
-          },
-        ],
+        // email: [
+        //   { required: true, message: "请输入邮箱地址", trigger: "blur" },
+        //   {
+        //     type: "email",
+        //     message: "请输入正确的邮箱地址",
+        //     trigger: ["blur", "change"],
+        //   },
+        // ],
         city: [{ required: true, message: "请输入加盟城市", trigger: "blur" }],
         project: [{ required: true, message: "请选择合作项目", trigger: "blur" }]
       },
@@ -408,6 +414,17 @@ export default {
     async handleSubmit(formName) {
       this.$refs[formName].validate(async (valid) => {
         if (valid) {
+          // 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`,{

+ 8 - 8
pages/merchants/index.vue

@@ -71,14 +71,14 @@ export default {
             trigger: "blur",
           },
         ],
-        email: [
-          { required: true, message: "请输入邮箱地址", trigger: "blur" },
-          {
-            type: "email",
-            message: "请输入正确的邮箱地址",
-            trigger: ["blur", "change"],
-          },
-        ],
+        // email: [
+        //   { required: true, message: "请输入邮箱地址", trigger: "blur" },
+        //   {
+        //     type: "email",
+        //     message: "请输入正确的邮箱地址",
+        //     trigger: ["blur", "change"],
+        //   },
+        // ],
         city: [{ required: true, message: "请输入加盟城市", trigger: "blur" }],
       },
     }