Browse Source

'小学同步辅导查询'

Rorschach 4 years ago
parent
commit
9648375738
5 changed files with 68 additions and 20 deletions
  1. 17 16
      config/dev.env.js
  2. 2 1
      config/prod.env.js
  3. 17 0
      src/api/skill.js
  4. 13 1
      src/pages/skill/Skill.vue
  5. 19 2
      src/store/modules/skill.js

+ 17 - 16
config/dev.env.js

@@ -2,21 +2,22 @@
 const merge = require('webpack-merge')
 const prodEnv = require('./prod.env')
 
-module.exports = merge(prodEnv, {
-  NODE_ENV: '"development"',
-  BASE_API: '"http://res.yifangjiaoyu.cn:81/cms"',
-  SKILL_API: '"http://audioskill.efunbox.cn/audio"',
-  ali_API: '"http://audio-skill-test.ai160.com:81/audio"',
-  XYYF_API: '"https://asxx.efunbox.cn:81"',
-  EFUN_API: '"http://ott80test-api.efunbox.cn:81"'
-})
-// module.exports = {
-//   NODE_ENV: '"production"',
-//   BASE_API: '"http://resources.ai160.com/cms"',
-//   SKILL_API: '"https://baidu-audio-skill.ai160.com/audio"',
-//   ali_API: '"https://ali-audio-skill.ai160.com/audio"',
-//   XYYF_API: '"http://xyyf-api.ai160.com"',
-//   EFUN_API: '"http://ott80-api.ai160.com"'
-// }
+// module.exports = merge(prodEnv, {
+//   NODE_ENV: '"development"',
+//   BASE_API: '"http://res.yifangjiaoyu.cn:81/cms"',
+//   SKILL_API: '"http://audioskill.efunbox.cn/audio"',
+//   ali_API: '"http://audio-skill-test.ai160.com:81/audio"',
+//   XYYF_API: '"https://asxx.efunbox.cn:81"',
+//   EFUN_API: '"http://ott80test-api.efunbox.cn:81"'
+// })
+module.exports = {
+  NODE_ENV: '"production"',
+  BASE_API: '"http://resources.ai160.com/cms"',
+  SKILL_API: '"https://baidu-audio-skill.ai160.com/audio"',
+  ali_API: '"https://ali-audio-skill.ai160.com/audio"',
+  XYYF_API: '"http://xyyf-api.ai160.com"',
+  EFUN_API: '"http://ott80-api.ai160.com"',
+  OPPO_API: '"http://xxtbfd-api.ai160.com"'
+}
 
 

+ 2 - 1
config/prod.env.js

@@ -5,5 +5,6 @@ module.exports = {
   SKILL_API: '"https://baidu-audio-skill.ai160.com/audio"',
   ali_API: '"https://ali-audio-skill.ai160.com/audio"',
   XYYF_API: '"http://xyyf-api.ai160.com"',
-  EFUN_API: '"http://ott80-api.ai160.com"'
+  EFUN_API: '"http://ott80-api.ai160.com"',
+  OPPO_API: '"http://xxtbfd-api.ai160.com"'
 }

+ 17 - 0
src/api/skill.js

@@ -101,3 +101,20 @@ export function getSkillData (params) {
 
 }
 
+
+export function getOppoData (params) {
+ 
+    console.log(123123123,params)
+    return service({
+      url: `${process.env.OPPO_API}/statistics`,
+      method: 'get',
+      params: {
+        channelCode: params.channel,
+        startDate: params.startDate,
+        endDate: params.endDate,
+      }
+    })
+  
+
+}
+

+ 13 - 1
src/pages/skill/Skill.vue

@@ -28,6 +28,7 @@
             class="pruductForm-skill"
             prop="skillId"
             label="技能选择"
+            v-if="skillParams.channel !== '6001'"
             :rules="[{ required: true, message: '请选择技能', trigger: 'blur' }]"
           >
           <!-- 兼容小度在家和学有义方不同的返回内容 -->
@@ -222,7 +223,9 @@ export default {
       skillChanneList: [
         { title: "百度-小度在家", code: "BAIDU" },
         // { title: "阿里-天猫精灵", code: "ALI" },
-        { title: "百度-义方小学堂", code: "XYYF" }
+        { title: "百度-义方小学堂", code: "XYYF" },
+        { title: "OPPO-小学同步辅导", code: "6001" }
+
       ],
       rules: {
         channel: [{ required: true, trigger: "blur" }],
@@ -256,7 +259,13 @@ export default {
         : "";
       this.$refs[formName].validate(valid => {
         if (valid) {
+          if(this.skillParams.channel === '6001'){
+          this.$store.dispatch("getOppoData", this.skillParams);
+
+          }else{
           this.$store.dispatch("getSkillData", this.skillParams);
+
+          }
         } else {
           console.log("error submit!!");
           return false;
@@ -282,6 +291,9 @@ export default {
       return formatDate(yesterday, 2);
     },
     channelChange(val) {
+      console.log(123123123)
+      console.log(123123,val)
+      console.log(this.skillParams)
       this.skillParams.skillId = "";
       this.$store.dispatch("getSkillList", val);
     },

+ 19 - 2
src/store/modules/skill.js

@@ -1,6 +1,7 @@
 import {
   getSkillList,
-  getSkillData
+  getSkillData,
+  getOppoData
 } from '../../api/skill'
 
 const skill = {
@@ -56,7 +57,23 @@ const skill = {
           reject(error);
         })
       })
-    }
+    },
+    getOppoData({
+      dispatch,
+      commit
+    }, data) {
+      return new Promise((resolve, reject) => {
+        getOppoData(data).then(res => {
+          console.log(res.data)
+          if (res.code == 200) {
+            resolve(res.data);
+            commit('GET_SKILL_DATA', res.data)
+          }
+        }).catch(error => {
+          reject(error);
+        })
+      })
+    },
   }
 }