소스 검색

新增学有义方渠道

limengbo 3 년 전
부모
커밋
cb118327cc
7개의 변경된 파일2108개의 추가작업 그리고 2109개의 파일을 삭제
  1. 1 1
      build/webpack.base.conf.js
  2. 1 2
      build/webpack.dev.conf.js
  3. 2013 1914
      package-lock.json
  4. 3 3
      package.json
  5. 13 0
      src/api/skill.js
  6. 29 188
      src/pages/skill/Skill.vue
  7. 48 1
      src/store/modules/skill.js

+ 1 - 1
build/webpack.base.conf.js

@@ -53,7 +53,7 @@ module.exports = {
       filename: '[name]_[hash].js',
       path: './dll',
       entry: {
-        vendor: ['vue', 'vue-router', 'vuex', 'element-ui']
+        vendor: ['vue', 'vue-router', 'vuex']
       }
     }), //单独打包第三方库
     new VueLoaderPlugin(), // 它的职责是将你定义过的其它规则复制并应用到 .vue 文件里相应语言的块

+ 1 - 2
build/webpack.dev.conf.js

@@ -42,8 +42,7 @@ module.exports = merge(baseConfig, {
   devServer: {
     contentBase: path.resolve(__dirname, '../dist'), //告诉服务其从哪提供内容
     hot: true,
-    open: true,
-    host: '192.168.1.226'
+    open: true
   },
   plugins: [
     new webpack.HotModuleReplacementPlugin(), // 开启热更新

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2013 - 1914
package-lock.json


+ 3 - 3
package.json

@@ -21,17 +21,16 @@
     "babel-preset-env": "^1.7.0",
     "clean-webpack-plugin": "^2.0.1",
     "css-loader": "^2.1.1",
-    "element-ui": "^2.7.2",
     "eslint-plugin-vue": "^5.2.2",
     "file-loader": "^3.0.1",
     "html-webpack-plugin": "^3.2.0",
+    "less": "^3.9.0",
+    "less-loader": "^4.1.0",
     "mini-css-extract-plugin": "^0.5.0",
     "node-sass": "^4.11.0",
     "optimize-css-assets-webpack-plugin": "^5.0.1",
     "postcss-loader": "^3.0.0",
     "sass-loader": "^7.1.0",
-    "less": "^3.9.0",
-    "less-loader": "^4.1.0",
     "uglifyjs-webpack-plugin": "^2.1.2",
     "vue": "^2.6.10",
     "vue-loader": "^15.7.0",
@@ -43,6 +42,7 @@
     "webpack-merge": "^4.2.1"
   },
   "dependencies": {
+    "element-ui": "^2.7.2",
     "file-saver": "^2.0.2",
     "nprogress": "^0.2.0",
     "vue-router": "^3.0.3",

+ 13 - 0
src/api/skill.js

@@ -70,6 +70,19 @@ export function getSkillList (code) {
     })
   // }
 }
+export function getXyyfMobileList() {
+  return service({
+    url: 'http://m-xyyf-api.ai160.com/statistics/channel',
+    method: 'get'
+  })
+}
+export function getXyyfData(params) {
+  return service({
+    url: 'http://m-xyyf-api.ai160.com/statistics',
+    method: 'get',
+    params
+  })
+}
 export function getSkillData (params) {
   if (params.channel === 'BAIDU') {
     return service({

+ 29 - 188
src/pages/skill/Skill.vue

@@ -31,7 +31,6 @@
             v-if="hide(skillParams.channel)"
             :rules="[{ required: true, message: '请选择技能', trigger: 'blur' }]"
           >
-          <!-- 兼容小度在家和学有义方不同的返回内容 -->
             <el-select v-model="skillParams.skillId" placeholder="请选择技能" @change="skillChange" style="width:160px">
               <el-option
                 v-for="item in skillList"
@@ -41,23 +40,22 @@
               ></el-option>
             </el-select>
           </el-form-item>
-          <!-- <el-form-item
+          <el-form-item
             class="pruductForm-skill"
-            prop="classId"
+            prop="skillId"
             label="产品包选择"
-            v-if="skillParams.skillId === 0 || skillParams.skillId === 3"
+            v-if="skillParams.channel === 'XYYFMOBILE' "
             :rules="[{ required: true, message: '请选择产品包', trigger: 'blur' }]"
           >
-           兼容小度在家和学有义方不同的返回内容 
-             <el-select v-model="skillParams.classId" placeholder="请选择产品包" style="width:160px">
+            <el-select v-model="skillParams.skillId" placeholder="请选择产品包" @change="skillChange" style="width:160px">
               <el-option
-                v-for="item in baiduCourseList"
-                :key="item.id"
-                :label="item.fullName"
-                :value="item.id"
+                v-for="item in skillList"
+                :key="item.id" 
+                :label="item.name"
+                :value="item.code"
               ></el-option>
             </el-select>
-          </el-form-item> -->
+          </el-form-item>
           <el-form-item class="dateForm-skill" name="data" label="查询日期" style="display:flex">
             <el-date-picker
               style="width:140px"
@@ -78,7 +76,7 @@
         </el-form-item>
       </el-form>
       <el-button type="primary" @click="onExportExcel" style="float: right">导出</el-button>
-      <el-table id="table" :data="skillData" border style="width: 100%" :height="tableHeight" v-if="skillParams.channel === 'XYYF'" >
+      <el-table id="table" ref="table1" :data="skillData" border style="width: 100%" :height="tableHeight" >
         <el-table-column
           label="日期"
           fixed
@@ -131,6 +129,7 @@
             :render-header="renderheader"
             prop="vipCount"
             min-width="140px"
+            v-if="skillParams.channel === 'XYYF' || skillParams.channel === 'XYYFMOBILE'"
           ></el-table-column>
           <el-table-column
             label="VIP用户活跃率 | =UV1/V0"
@@ -139,6 +138,7 @@
             :render-header="renderheader"
             min-width="140px"
             prop="aliveVipProportion"
+            v-if="skillParams.channel === 'XYYF' || skillParams.channel === 'XYYFMOBILE'"
           >
           </el-table-column>
           <!-- <el-table-column
@@ -163,6 +163,7 @@
             :render-header="renderheader"
             prop="fealtyCount"
             min-width="140px"
+            v-if="skillParams.channel === 'XYYF' || skillParams.channel === 'XYYFMOBILE'"
           ></el-table-column>
           <el-table-column
             label="忠实用户占比"
@@ -171,6 +172,7 @@
             :render-header="renderheader"
             prop="fealtyProportion"
             min-width="140px"
+            v-if="skillParams.channel === 'XYYF' || skillParams.channel === 'XYYFMOBILE'"
           ></el-table-column>
           <el-table-column
             label="人均播放 | =VV/UV"
@@ -281,177 +283,6 @@
           </el-table-column>
         </el-table-column>
       </el-table>
-      <el-table id="table" :data="skillData" border style="width: 100%" :height="tableHeight" v-else>
-        <el-table-column
-          label="日期"
-          fixed
-          align="left"
-          header-align="center"
-          min-width="140px"
-        >
-            <template slot-scope="scope">
-                <span>{{changeDate(scope.row.day)}}</span>
-            </template>
-        </el-table-column>
-        <el-table-column label="流量与观看" header-align="center">
-          <el-table-column
-            label="UV"
-            prop="uv"
-            align="right"
-            header-align="center"
-            min-width="100px"
-          ></el-table-column>
-
-          <el-table-column
-            label="VIP用户 | -UV1"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="vipUv"
-            min-width="120px"
-          ></el-table-column>
-          <el-table-column
-            label="非VIP用户 | UV2=UV-UV1"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="waitVipUv"
-            min-width="140px"
-          ></el-table-column>
-
-          <el-table-column
-            label="VIP用户占比 | =UV1/UV"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="vipProportion"
-            min-width="140px"
-          ></el-table-column>
-          <!-- <el-table-column
-            label="VV"
-            prop="vv"
-            align="right"
-            header-align="center"
-            min-width="100px"
-          ></el-table-column>-->
-          <el-table-column
-            label="VV"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="totalPlay"
-            min-width="140px"
-          ></el-table-column>
-          <el-table-column
-            label="人均播放 | =VV/UV"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="perCapitaPlay"
-            min-width="140px"
-          ></el-table-column>
-        </el-table-column>
-
-        <el-table-column label="拉新,付费与转换率" header-align="center">
-          <el-table-column
-            label="连续包月 | -Qm1"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="consecutiveMonthly"
-            min-width="100px"
-          ></el-table-column>
-          <el-table-column
-            label="新增连续包月 | -Qm1-1"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            min-width="140px"
-          >
-              <template slot-scope="scope">
-                  <span>{{scope.row.appendConsecutiveMonthly || 0}}</span>
-              </template>
-          </el-table-column>
-          <el-table-column
-            label="续包月续费 | -Qm1-2"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="continueConsecutiveMonthly"
-            min-width="140px"
-          >
-              <template slot-scope="scope">
-                  <span>{{scope.row.continueConsecutiveMonthly || 0}}</span>
-              </template>
-          </el-table-column>
-          <el-table-column
-            label="月包 | -Qm2"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="monthlyPayment"
-            min-width="90px"
-          ></el-table-column>
-          <el-table-column
-            label="年包 | -Qy"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="yearlyPayment"
-          ></el-table-column>
-          <el-table-column
-            label="付费订单数量| Q=Qm1+Qm2+Qy"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="totalPayment"
-            min-width="160px"
-          ></el-table-column>
-          <el-table-column
-            label="r1 | =Qm1/Q"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="consecutiveConversion"
-            min-width="130px"
-          ></el-table-column>// 月包占比
-          <el-table-column
-            label="r2 | =Qm2/Q"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="monthlyConversion"
-            min-width="130px"
-          ></el-table-column>// 年包占比
-          <el-table-column
-            label="r3 | =Qy/Q"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="yearlyConversion"
-            min-width="130px"
-          ></el-table-column>
-          <el-table-column
-            label="R | =(Qm1+Qm2+Qy)/UV2"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            prop="totalConversion"
-            min-width="190px"
-          ></el-table-column>
-          <el-table-column
-            label="R1 | =(Qm1-1+Qm2+Qy)/UV2"
-            align="right"
-            header-align="center"
-            :render-header="renderheader"
-            min-width="190px"
-          >
-              <template slot-scope="scope">
-                  <span>{{scope.row.appendTotalConversion || 0}}</span>
-              </template>
-          </el-table-column>
-        </el-table-column>
-      </el-table>
       <!-- <el-pagination
       v-if="orderList.totalElements"
       background
@@ -484,8 +315,8 @@ export default {
         { title: "百度-小度在家", code: "BAIDU" },
         { title: "阿里-天猫精灵", code: "ALI" },
         { title: "百度-义方小学堂", code: "XYYF" },
-        { title: "OPPO-小学同步辅导", code: "6001" }
-
+        { title: "OPPO-小学同步辅导", code: "6001" },
+        { title: "学有义方", code: "XYYFMOBILE" }
       ],
       baiduCourseList: []
     };
@@ -524,14 +355,18 @@ export default {
 
           } else if(this.skillParams.channel === 'ALI') {
           this.$store.dispatch("getAliData", this.skillParams);
+          } else if(this.skillParams.channel === 'XYYFMOBILE') {
+            // console.log('学有义方')
+            this.$store.dispatch("getXyyfData", this.skillParams);
           } else{
-          this.$store.dispatch("getSkillData", this.skillParams);
+            this.$store.dispatch("getSkillData", this.skillParams);
           }
         } else {
           console.log("error submit!!");
           return false;
         }
       });
+      this.$refs.table1.doLayout();
     },
     // 渠道下课程分页
     changePage(e) {
@@ -553,7 +388,13 @@ export default {
     },
     channelChange(val) {
       this.skillParams.skillId = "";
-      val !== 'XYYF' && this.$store.dispatch("getSkillList", val);
+      if(val === 'XYYFMOBILE') {
+        this.$store.dispatch("getXyyfMobileList");
+      }else if (val === 'BAIDU' || val ==='ALI') {
+        this.$store.dispatch("getSkillList", val);
+      }
+      // 清空数据
+      this.$store.dispatch("clearList");
     },
     skillChange(val) {
       this.skillParams.classId = ''
@@ -586,7 +427,7 @@ export default {
       // if(row.)
     },
     hide (channel) {
-      if (channel === '6001' || channel === 'XYYF') {
+      if (channel === '6001' || channel === 'XYYF' || channel === 'XYYFMOBILE') {
         return false
       }
       return true

+ 48 - 1
src/store/modules/skill.js

@@ -1,9 +1,11 @@
 import {
   getSkillList,
+  getXyyfMobileList,
   getSkillData,
   getOppoData,
   getBaiduData,
-  getAliData
+  getAliData,
+  getXyyfData
 } from '../../api/skill'
 
 const skill = {
@@ -43,6 +45,51 @@ const skill = {
         })
       })
     },
+    // 获取学有义方渠道号
+    getXyyfMobileList({
+      dispatch,
+      commit
+    }) {
+      return new Promise((resolve, reject) => {
+        getXyyfMobileList().then(res => {
+          console.log(3333333, res.data)
+          if (res.code == 200) {
+            resolve(res.data);
+            commit('GET_SKILL_LIST', res.data)
+          }
+        }).catch(error => {
+          reject(error);
+        })
+      })
+    },
+    // 清空数据
+    clearList({
+      dispatch,
+      commit
+    }) {
+      commit('GET_SKILL_DATA', [])
+    },
+    getXyyfData({
+      dispatch,
+      commit
+    },data) {
+      return new Promise((resolve, reject) => {
+        console.log(data)
+        getXyyfData({
+          channel: data.skillId,
+          endDate: data.endDate,
+          startDate: data.startDate
+        }).then(res => {
+          console.log(res.data)
+          if (res.code == 200) {
+            resolve(res.data);
+            commit('GET_SKILL_DATA', res.data)
+          }
+        }).catch(error => {
+          reject(error);
+        })
+      })
+    },
     getSkillData({
       dispatch,
       commit