From d80b56524386e4e72e8d0f141c783c18760a4369 Mon Sep 17 00:00:00 2001 From: Hope Date: Thu, 5 Oct 2017 20:34:18 +0800 Subject: [PATCH 01/24] =?UTF-8?q?=E9=A2=9C=E8=89=B2=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/workbook/pages/books/add.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/workbook/pages/books/add.vue b/src/features/workbook/pages/books/add.vue index bd7f99ed..9a8d3b34 100644 --- a/src/features/workbook/pages/books/add.vue +++ b/src/features/workbook/pages/books/add.vue @@ -44,9 +44,9 @@

没有更多的习题册了~

- +

没有我想要的习题册? - 点我提交 + 点我提交

From 99b4e623dcd99eb07febf7253a9a4c09b064a085 Mon Sep 17 00:00:00 2001 From: Hope Date: Sun, 8 Oct 2017 22:29:17 +0800 Subject: [PATCH 02/24] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E9=A2=98?= =?UTF-8?q?=E5=BD=92=E7=BA=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/report/modules/mutationTypes.js | 1 - .../statistics/index/modules/action.js | 32 +++++++++++++++ .../statistics/index/modules/mutationTypes.js | 2 + .../statistics/index/modules/store.js | 24 ++++++++++++ .../statistics/index/pages/layout.vue | 39 +++++++++++++++++++ src/features/statistics/layout.vue | 19 +++++++++ src/features/statistics/router.js | 21 ++++++++++ 7 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 src/features/statistics/index/modules/action.js create mode 100644 src/features/statistics/index/modules/mutationTypes.js create mode 100644 src/features/statistics/index/modules/store.js create mode 100644 src/features/statistics/index/pages/layout.vue create mode 100644 src/features/statistics/layout.vue create mode 100644 src/features/statistics/router.js diff --git a/src/features/report/modules/mutationTypes.js b/src/features/report/modules/mutationTypes.js index 92ab5e2e..77abdecf 100644 --- a/src/features/report/modules/mutationTypes.js +++ b/src/features/report/modules/mutationTypes.js @@ -10,4 +10,3 @@ export const REPORT_SCROLL = 'REPORT_SCROLL' export const REPORT_DETAIL = 'REPORT_DETAIL' /** 清除详细成绩报告单数据 */ export const REPORT_DETAIL_CLEAR = 'REPORT_DETAIL_CLEAR' - diff --git a/src/features/statistics/index/modules/action.js b/src/features/statistics/index/modules/action.js new file mode 100644 index 00000000..9280b006 --- /dev/null +++ b/src/features/statistics/index/modules/action.js @@ -0,0 +1,32 @@ +import axios from '@/components/axios/' +import * as types from './mutationTypes' + +function getSubjectId (name) { + let subjectId = '' + if (name.indexOf('math') >= 0) { + subjectId = '2' + } else if (name.indexOf('physics') >= 0) { + subjectId = '7' + } else if (name.indexOf('chemistry') >= 0) { + subjectId = '8' + } + return subjectId +} + +/** 获取统计数据 */ +export const getStatistics = ({ rootState, commit }, params) => { + return new Promise((resolve, reject) => { + axios({ + method: 'get', + url: 'report', + params: { + token: rootState.common.user.token, + subject_id: getSubjectId(rootState.route.name) + } + }) + .then((response) => { + commit(types.STATISTICS, {'subject': subject, 'data': response.data.data}) + resolve(response) + }) + }) +} diff --git a/src/features/statistics/index/modules/mutationTypes.js b/src/features/statistics/index/modules/mutationTypes.js new file mode 100644 index 00000000..196d6325 --- /dev/null +++ b/src/features/statistics/index/modules/mutationTypes.js @@ -0,0 +1,2 @@ +/** 获取课本章节 */ +export const STATISTICS = 'STATISTICS' diff --git a/src/features/statistics/index/modules/store.js b/src/features/statistics/index/modules/store.js new file mode 100644 index 00000000..89f8af54 --- /dev/null +++ b/src/features/statistics/index/modules/store.js @@ -0,0 +1,24 @@ +import * as types from './mutationTypes' +import * as getters from './getters' +import * as actions from './actions' + +const state = { + index: { + math: [{}], + physics: [{}], + chemistry: [{}] + } +} + +const mutations = { + [types.STATISTICS] (state, payload) { + state['index'][payload.subject] = payload.data + } +} + +export default { + state, + mutations, + getters, + actions +} diff --git a/src/features/statistics/index/pages/layout.vue b/src/features/statistics/index/pages/layout.vue new file mode 100644 index 00000000..26218497 --- /dev/null +++ b/src/features/statistics/index/pages/layout.vue @@ -0,0 +1,39 @@ + + + diff --git a/src/features/statistics/layout.vue b/src/features/statistics/layout.vue new file mode 100644 index 00000000..21799c3c --- /dev/null +++ b/src/features/statistics/layout.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/features/statistics/router.js b/src/features/statistics/router.js new file mode 100644 index 00000000..3e52f05d --- /dev/null +++ b/src/features/statistics/router.js @@ -0,0 +1,21 @@ +export default { + path: '/statistics', + component: r => require.ensure([], () => r(require('./pages/layout')), '/statistics'), + children: [ + { + path: '/', + name: 'statistics', + component: r => require.ensure([], () => r(require('./pages/index')), '/statistics/') + }, + { + path: 'physics', + name: 'statistics_physics', + component: r => require.ensure([], () => r(require('./pages/physics')), '/statistics/physics') + }, + { + path: 'math', + name: 'statistics_math', + component: r => require.ensure([], () => r(require('./pages/math')), '/statistics/math') + } + ] +} From e6c58464a2f46d508366c9088e2905a4527eefc0 Mon Sep 17 00:00:00 2001 From: Hope Date: Mon, 9 Oct 2017 22:13:16 +0800 Subject: [PATCH 03/24] update --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index ffba28d1..bc90ddbb 100644 --- a/src/main.js +++ b/src/main.js @@ -7,7 +7,7 @@ import VueLazyload from 'vue-lazyload' import { ToastPlugin, LoadingPlugin, ConfirmPlugin, dateFormat, AlertPlugin } from 'vux' import App from './App' -Vue.use(ToastPlugin) // 使用提醒 +Vue.use(ToastPlugin) // 使用轻提醒框 Vue.use(AlertPlugin) Vue.use(VueLazyload, { attempt: 3 }) // 图片异步加载 Vue.use(LoadingPlugin) // 使用Loading From 1a7e974b3bb35fbb389b7a26e23782c94b7ab4f3 Mon Sep 17 00:00:00 2001 From: Hope Date: Tue, 10 Oct 2017 21:54:12 +0800 Subject: [PATCH 04/24] =?UTF-8?q?feat:=20=E6=88=91=E7=9A=84=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=A8=A1=E5=9D=97=E8=B7=AF=E7=94=B1=E6=96=B0=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + src/components/share/index.vue | 133 ++++++++++++++++++ src/features/download/modules/actions.js | 131 +++++++++++++++++ src/features/download/modules/getters.js | 6 + .../download/modules/mutationTypes.js | 10 ++ src/features/download/modules/store.js | 47 +++++++ src/features/download/pages/camera.vue | 98 +++++++++++++ src/features/download/pages/cameraDetail.vue | 79 +++++++++++ src/features/download/pages/good.vue | 98 +++++++++++++ src/features/download/pages/goodDetail.vue | 83 +++++++++++ src/features/download/pages/index.vue | 28 ++++ src/features/download/pages/layout.vue | 19 +++ src/features/download/pages/remember.vue | 98 +++++++++++++ .../download/pages/rememberDetail.vue | 79 +++++++++++ src/features/download/router.js | 41 ++++++ src/router.js | 8 +- src/router/assets/download.jpg | Bin 0 -> 8802 bytes src/router/pages/index.less | 5 + src/router/pages/index.vue | 3 + 19 files changed, 964 insertions(+), 3 deletions(-) create mode 100644 src/components/share/index.vue create mode 100644 src/features/download/modules/actions.js create mode 100644 src/features/download/modules/getters.js create mode 100644 src/features/download/modules/mutationTypes.js create mode 100644 src/features/download/modules/store.js create mode 100644 src/features/download/pages/camera.vue create mode 100644 src/features/download/pages/cameraDetail.vue create mode 100644 src/features/download/pages/good.vue create mode 100644 src/features/download/pages/goodDetail.vue create mode 100644 src/features/download/pages/index.vue create mode 100644 src/features/download/pages/layout.vue create mode 100644 src/features/download/pages/remember.vue create mode 100644 src/features/download/pages/rememberDetail.vue create mode 100644 src/features/download/router.js create mode 100644 src/router/assets/download.jpg diff --git a/README.md b/README.md index cfcd700c..d3f2fa01 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ ├── collect # 收藏本模块 ├── correct # 纠错 ├── myclass # 我的班级 + ├── download # 下载中心 ├── error # 错题本 ├── errorCamera # 拍照错题本 ├── homework # 我的作业 diff --git a/src/components/share/index.vue b/src/components/share/index.vue new file mode 100644 index 00000000..25abca6c --- /dev/null +++ b/src/components/share/index.vue @@ -0,0 +1,133 @@ + + + diff --git a/src/features/download/modules/actions.js b/src/features/download/modules/actions.js new file mode 100644 index 00000000..463e9d7b --- /dev/null +++ b/src/features/download/modules/actions.js @@ -0,0 +1,131 @@ +import * as types from './mutationTypes' +import axios from '@/components/axios/' + +/** 获取拍错题下载列表 */ +export const getDownloadCamera = ({ rootState, commit }, params) => { + return new Promise((resolve, reject) => { + axios({ + method: 'get', + url: ' download/camera', + params: { + token: rootState.common.user.token, + subject: params.subject + } + }).then((response) => { + commit(types.DOWNLOAD, {data: response.data.data, type: 'camera'}) + resolve(response) + }).catch((e) => { + reject(e) + }) + }) +} + +/** 获取拍错题试卷详情 */ +export const getDownloadCameraDetail = ({ rootState, commit }) => { + return new Promise((resolve, reject) => { + axios({ + method: 'get', + url: 'download/camera/detail', + params: { + token: rootState.common.user.token, + downloadId: rootState.route.params.id + } + }).then((response) => { + commit(types.DOWNLOAD_DETAIL, {data: response.data.data, type: 'camera'}) + resolve(response) + }).catch((e) => { + reject(e) + }) + }) +} + +/** 获取记错题下载列表 */ +export const getDownloadRemember = ({ rootState, commit }, params) => { + return new Promise((resolve, reject) => { + axios({ + method: 'get', + url: ' download/remember', + params: { + token: rootState.common.user.token, + subject: params.subject + } + }).then((response) => { + commit(types.DOWNLOAD, {data: response.data.data, type: 'remember'}) + resolve(response) + }).catch((e) => { + reject(e) + }) + }) +} + +/** 获取记错题试卷详情 */ +export const getDownloadRememberDetail = ({ rootState, commit }) => { + return new Promise((resolve, reject) => { + axios({ + method: 'get', + url: 'download/remember/detail', + params: { + token: rootState.common.user.token, + downloadId: rootState.route.params.id + } + }).then((response) => { + commit(types.DOWNLOAD_DETAIL, {data: response.data.data, type: 'remember'}) + resolve(response) + }).catch((e) => { + reject(e) + }) + }) +} + +/** 获取精选题下载列表 */ +export const getDownloadGood = ({ rootState, commit }, params) => { + return new Promise((resolve, reject) => { + axios({ + method: 'get', + url: ' download/good', + params: { + token: rootState.common.user.token, + subject: params.subject + } + }).then((response) => { + commit(types.DOWNLOAD, {data: response.data.data, type: 'good'}) + resolve(response) + }).catch((e) => { + reject(e) + }) + }) +} + +/** 获取精选题试卷详情 */ +export const getDownloadGoodDetail = ({ rootState, commit }) => { + return new Promise((resolve, reject) => { + axios({ + method: 'get', + url: 'download/good/detail', + params: { + token: rootState.common.user.token, + downloadId: rootState.route.params.id + } + }).then((response) => { + commit(types.DOWNLOAD_DETAIL, {data: response.data.data, type: 'good'}) + resolve(response) + }).catch((e) => { + reject(e) + }) + }) +} + +/** 清空下载列表 */ +export const clearDownload = ({rootState, commit}, params) => { + commit(types.DOWNLOAD_RESET, params) +} + +/** 试卷高度保存 */ +export const setDownloadDetailScroll = ({commit}, params) => { + commit(types.DOWNLOAD_DETAIL_SCROLL, params) +} + +/** 清空试卷 */ +export const clearDownloadDetail = ({rootState, commit}, params) => { + commit(types.DOWNLOAD_DETAIL_RESET, params) +} diff --git a/src/features/download/modules/getters.js b/src/features/download/modules/getters.js new file mode 100644 index 00000000..9b638787 --- /dev/null +++ b/src/features/download/modules/getters.js @@ -0,0 +1,6 @@ +/** 下载拍错题 */ +export const DownloadCamera = (state) => state.camera +/** 下载记错题 */ +export const DownloadRemember = (state) => state.remember +/** 下载精选题 */ +export const DownloadGood = (state) => state.good diff --git a/src/features/download/modules/mutationTypes.js b/src/features/download/modules/mutationTypes.js new file mode 100644 index 00000000..c8c2563e --- /dev/null +++ b/src/features/download/modules/mutationTypes.js @@ -0,0 +1,10 @@ +/** 我的下载 */ +export const DOWNLOAD = 'DOWNLOAD' +/** 我的下载清空 */ +export const DOWNLOAD_RESET = 'DOWNLOAD_RESET' +/** 试题 */ +export const DOWNLOAD_DETAIL = 'DOWNLOAD_DETAIL' +/** 试题高度 */ +export const DOWNLOAD_DETAIL_SCROLL = 'DOWNLOAD_DETAIL_SCROLL' +/** 试题清空 */ +export const DOWNLOAD_DETAIL_RESET = 'DOWNLOAD_DETAIL_RESET' diff --git a/src/features/download/modules/store.js b/src/features/download/modules/store.js new file mode 100644 index 00000000..376479c5 --- /dev/null +++ b/src/features/download/modules/store.js @@ -0,0 +1,47 @@ +import * as types from './mutationTypes' +import * as getters from './getters' +import * as actions from './actions' + +const state = { + camera: { + list: [{}], + detail: [{}], + scroll: 0 + }, + good: { + list: [{}], + detail: [{}], + scroll: 0 + }, + remember: { + list: [{}], + detail: [{}], + scroll: 0 + } +} + +const mutations = { + [types.DOWNLOAD] (state, payload) { + state[payload.type]['list'] = payload.data + }, + [types.DOWNLOAD_RESET] (state, payload) { + state[payload.type]['list'] = [] + }, + [types.DOWNLOAD_DETAIL] (state, payload) { + state[payload.type]['detail'] = payload.data + }, + [types.DOWNLOAD_DETAIL_SCROLL] (state, payload) { + state[payload.type]['scroll'] = payload.scroll + }, + [types.DOWNLOAD_DETAIL_RESET] (state, payload) { + state[payload.type]['detail'] = [] + state[payload.type]['scroll'] = 0 + } +} + +export default { + state, + getters, + actions, + mutations +} diff --git a/src/features/download/pages/camera.vue b/src/features/download/pages/camera.vue new file mode 100644 index 00000000..c1072307 --- /dev/null +++ b/src/features/download/pages/camera.vue @@ -0,0 +1,98 @@ + + + diff --git a/src/features/download/pages/cameraDetail.vue b/src/features/download/pages/cameraDetail.vue new file mode 100644 index 00000000..8fc236af --- /dev/null +++ b/src/features/download/pages/cameraDetail.vue @@ -0,0 +1,79 @@ + + + diff --git a/src/features/download/pages/good.vue b/src/features/download/pages/good.vue new file mode 100644 index 00000000..62abc755 --- /dev/null +++ b/src/features/download/pages/good.vue @@ -0,0 +1,98 @@ + + + diff --git a/src/features/download/pages/goodDetail.vue b/src/features/download/pages/goodDetail.vue new file mode 100644 index 00000000..907653a4 --- /dev/null +++ b/src/features/download/pages/goodDetail.vue @@ -0,0 +1,83 @@ + + + diff --git a/src/features/download/pages/index.vue b/src/features/download/pages/index.vue new file mode 100644 index 00000000..24967204 --- /dev/null +++ b/src/features/download/pages/index.vue @@ -0,0 +1,28 @@ + + + diff --git a/src/features/download/pages/layout.vue b/src/features/download/pages/layout.vue new file mode 100644 index 00000000..91288bcb --- /dev/null +++ b/src/features/download/pages/layout.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/features/download/pages/remember.vue b/src/features/download/pages/remember.vue new file mode 100644 index 00000000..b266b705 --- /dev/null +++ b/src/features/download/pages/remember.vue @@ -0,0 +1,98 @@ + + + diff --git a/src/features/download/pages/rememberDetail.vue b/src/features/download/pages/rememberDetail.vue new file mode 100644 index 00000000..2bfc6a90 --- /dev/null +++ b/src/features/download/pages/rememberDetail.vue @@ -0,0 +1,79 @@ + + + diff --git a/src/features/download/router.js b/src/features/download/router.js new file mode 100644 index 00000000..ac20acaa --- /dev/null +++ b/src/features/download/router.js @@ -0,0 +1,41 @@ +export default { + path: '/download', + component: r => require.ensure([], () => r(require('./pages/layout')), '/download'), + children: [ + { + path: '/', + name: 'download', + component: r => require.ensure([], () => r(require('./pages/index')), '/download/index') + }, + { + path: '/camera', + name: 'downloadCamera', + component: r => require.ensure([], () => r(require('./pages/camera')), '/download/camera') + }, + { + path: '/camera/:id', + name: 'downloadCamera_detail', + component: r => require.ensure([], () => r(require('./pages/cameraDetail')), '/download/camera/detail') + }, + { + path: '/good', + name: 'downloadGood', + component: r => require.ensure([], () => r(require('./pages/good')), '/download/good') + }, + { + path: '/good/:id', + name: 'downloadGood_detail', + component: r => require.ensure([], () => r(require('./pages/goodDetail')), '/download/good/detail') + }, + { + path: '/remember', + name: 'downloadRemember', + component: r => require.ensure([], () => r(require('./pages/remember')), '/download/remember') + }, + { + path: '/remember/:id', + name: 'downloadRemember_detail', + component: r => require.ensure([], () => r(require('./pages/rememberDetail')), '/download/remember/detail') + } + ] +} diff --git a/src/router.js b/src/router.js index e953948d..9e39f833 100644 --- a/src/router.js +++ b/src/router.js @@ -4,18 +4,19 @@ import { sync } from 'vuex-router-sync' import store from './store' import index from './router/router' import login from './features/login/router' -import camera from './features/camera/router' import about from './features/about/router' +import camera from './features/camera/router' import collect from './features/collect/router' import correct from './features/correct/router' +import download from './features/download/router' import error from './features/error/router' import errorCamera from './features/errorCamera/router' import example from './features/example/router' -import message from './features/message/router' import homework from './features/homework/router' +import induce from './features/induce/router' +import message from './features/message/router' import myclass from './features/myclass/router' import mybook from './features/mybook/router' -import induce from './features/induce/router' import settings from './features/settings/router' import workbook from './features/workbook/router' @@ -27,6 +28,7 @@ let router = new Router({ collect, camera, correct, + download, ...error, errorCamera, example, diff --git a/src/router/assets/download.jpg b/src/router/assets/download.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0ba53c16345e685799a2d0aecd849eebbf6d5acb GIT binary patch literal 8802 zcmd6McUY5Iw{MW5C?H)#YG~3)LMRb%=p^(I0clDJkU$8%BaQ_G1f+M65}Fk09aKQN zNQWRD1ZmPm5I8vB%$zfG=YID&_n&jtA8+>Bd;M11Ywc&hZ_dWg<^U|J-WXc|01g)d zTmt+jovj1tR6ML5d;lZ>vh!&@0N`wn6mReD?hF$bcXAW6w82}U#jNo-ac@g!agdmV zI6&^Ux3i_S1KOR-3T=mRk_UcmXaRCzY~+DPP;CiqXJxcKM#I+?ZQ!eevi5bbmbC%i zR^XEJhI!+hacFl-E^nNplN-!i9{8Jb*!lS9v^bFKHxYLSd7$D?t6av~dR)qQS2Pz? z3@U0Z0g~jBmK6g*L6R~c5iYO<2qG>45eGp;L137KEDQwY`kjF1)?96DVMrCV-))_9 z^1$DN^78T$^MZ)sUG2m{va+(`5@2yKSoB;%)Xm4q-O^js$&Kd^4Jv3iYgdf3I|lE> z^;4sz72d;L9(eBQze2z{Yis|h_#d-{!~KlwH)%I_B>F$y_(y3sl#er79Eo6JRZ_ZngMgYpQvKg^>8V0OonSt%)h`of6ml zxzmDjMUPjQ@P?aqa$BG~U}Q}rddrzRjhk(;a;x!2mior09}Cw9SvDraj|7nhb^FHx zk^YiF574y}Hw!d$BjC;r61O`+6G7X_mgys^!4iD)gY|I@ldOGcQ8$%}XPrItavI;R zQzM%n{$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EssM427TEBdzV0_f`u6FLP)Urjd?53yn=YcSH{U+DnqZLJDwUprI#!P@B-c>7ScKWPNGDiiV@XY73Vi!?YQ?S;Hqo=bRL0cqc`dYtaKNU#yQpeH=#tiT zP`Iwd)^gXo=YJW<)t&)@D>)&KWX*G>$W3kiV*4};P4TyNlGEAe<7NrG-M*%wn*0l&_y=pk zMYCb$FQZd+0ql)`t6y^e&u;3%CL4sXp(E;mFsrPk)?bQ%HQZt%Nvf=Q950JP?7P&e z7_J*szJ_$LKNMjBTw3a~BYK6Q-iu9Q6Wq#FQ$y4EKVj%umAjD0dA-#x zAz)jX9Kf}HGv3H-^oY4!PhjYVc12#CgHVQJk8*M5a$%g1|9pUMC1OtM-F-SV@6EB4 ztE5y~{Du}8P$!g-m$qx}tHLut?G0sUL-FU3Xf4}VESBoh_jr9PDO=n4!EC57Q+*8^ zX!l5O>)M+Bx7IMEru5Lai%v_b228uXDPa z(DO-sI}-n20M6#XLB#v?ne*?pzIWC@LiauhzmtEEbV1kw{w{<*i8*x$FY0aQqRI(c z(jgx$p1t)EKn35jy2I6%JItb$&&13YE+zEC=(-PoFm1_vw5{5OXoI?oLp=`|edRNY zj+SjE_2{*cq6p^9k*uMY<)+EcKcHIOMV=W5g1%nkH{TtG?vJQkYXW_^Fru mKe;&!@w9qbCE<{aa3By$@50jxem#9*{Ndkr?thRyoA?iVWzA0j literal 0 HcmV?d00001 diff --git a/src/router/pages/index.less b/src/router/pages/index.less index 2848451e..1e38f590 100644 --- a/src/router/pages/index.less +++ b/src/router/pages/index.less @@ -32,6 +32,11 @@ background-size: 100% 100%; height:100%; } + .download{ + background: url("../assets/download.jpg") no-repeat; + background-size: 100% 100%; + height:100%; + } } .user{ diff --git a/src/router/pages/index.vue b/src/router/pages/index.vue index bc82ceed..37138ee3 100644 --- a/src/router/pages/index.vue +++ b/src/router/pages/index.vue @@ -18,6 +18,9 @@ + + + From b3634d3399c0d4b5e2a1e646ae7b5de0b73eb205 Mon Sep 17 00:00:00 2001 From: Hope Date: Wed, 11 Oct 2017 10:25:25 +0800 Subject: [PATCH 05/24] =?UTF-8?q?feat:=E6=94=B6=E8=97=8F=E6=9C=AC=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BB=83=E4=B9=A0=E9=A2=98=E6=94=B6=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/features/about/pages/index.vue | 2 +- src/features/collect/modules/actions.js | 3 +- src/features/collect/pages/chemistry.vue | 2 +- src/features/collect/pages/math.vue | 2 +- src/features/collect/pages/physics.vue | 2 +- src/features/correct/pages/index.vue | 10 +- src/features/download/pages/camera.vue | 4 +- src/features/download/pages/good.vue | 4 +- src/features/download/pages/index.vue | 5 - src/features/download/pages/remember.vue | 4 +- .../example/pages/{index.vue => example.vue} | 8 +- src/features/example/pages/practise.vue | 94 +++++++++++++++++++ src/features/example/router.js | 17 +++- 14 files changed, 128 insertions(+), 31 deletions(-) rename src/features/example/pages/{index.vue => example.vue} (92%) create mode 100644 src/features/example/pages/practise.vue diff --git a/package.json b/package.json index 9dbb0dd3..b9ba03b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "guinaben", - "version": "3.4.0", + "version": "3.5.0", "description": "A H5+ hybird app", "author": "Hope ", "private": true, diff --git a/src/features/about/pages/index.vue b/src/features/about/pages/index.vue index e33959cd..a098222e 100644 --- a/src/features/about/pages/index.vue +++ b/src/features/about/pages/index.vue @@ -3,7 +3,7 @@ -

归纳本学生端 3.4.0

+

归纳本学生端 3.5.0

diff --git a/src/features/collect/modules/actions.js b/src/features/collect/modules/actions.js index fc336c4e..ff227786 100644 --- a/src/features/collect/modules/actions.js +++ b/src/features/collect/modules/actions.js @@ -10,7 +10,8 @@ export const getCollect = ({ rootState, commit, state }, params) => { params: { token: rootState.common.user.token, subject_id: params.id, - offset: state[params.subject]['offset'] + offset: state[params.subject]['offset'], + from: params.from } }) .then((response) => { diff --git a/src/features/collect/pages/chemistry.vue b/src/features/collect/pages/chemistry.vue index 6bc5332e..dbfbd1ab 100644 --- a/src/features/collect/pages/chemistry.vue +++ b/src/features/collect/pages/chemistry.vue @@ -7,7 +7,7 @@ 难度: {{item.degree}} -
+
{{ key }}:

diff --git a/src/features/collect/pages/math.vue b/src/features/collect/pages/math.vue index a2831197..316d003d 100644 --- a/src/features/collect/pages/math.vue +++ b/src/features/collect/pages/math.vue @@ -7,7 +7,7 @@ 难度: {{item.degree}}
-
+
{{ key }}:

diff --git a/src/features/collect/pages/physics.vue b/src/features/collect/pages/physics.vue index da8d5d60..36374b18 100644 --- a/src/features/collect/pages/physics.vue +++ b/src/features/collect/pages/physics.vue @@ -7,7 +7,7 @@ 难度: {{item.degree}}
-
+
@@ -175,29 +131,18 @@ export default { .weui-btn + .weui-btn{ margin-top:0; } -.popover-demo-content { - padding: 5px 10px; -} -.checker-popup{ - background: #fff; -} -.check-item { - background-color: #ddd; - color: #222; - font-size: 14px; - padding: 8px 0; - width:32.3%; - margin-right: 0px; - line-height: 18px; - text-align:center; - margin-bottom: 10px; - border-radius: 15px; -} -.check-item-selected { - background-color: #4cc0be; - color: #fff; -} -.check-item-disabled { - color: #999; +.assembleCount{ + position: fixed; + background:#4cc0be; + color:#fff; + font-size: .9rem; + height: 3.5rem; + width: 3.5rem; + box-sizing: border-box; + padding:.5rem .75rem; + border-radius: 50%; + bottom: 10%; + right: 5%; + text-align: center; } diff --git a/src/features/statistics/assemble/pages/rememberAssemble.vue b/src/features/statistics/assemble/pages/rememberAssemble.vue new file mode 100644 index 00000000..a3847fcb --- /dev/null +++ b/src/features/statistics/assemble/pages/rememberAssemble.vue @@ -0,0 +1,133 @@ + + + diff --git a/src/features/statistics/assemble/pages/rememberOptions.vue b/src/features/statistics/assemble/pages/rememberOptions.vue index 7b975e33..7d3a172f 100644 --- a/src/features/statistics/assemble/pages/rememberOptions.vue +++ b/src/features/statistics/assemble/pages/rememberOptions.vue @@ -21,7 +21,7 @@ import {Checker, CheckerItem, XHeader, ViewBox} from 'vux' import {mapGetters, mapActions} from 'vuex' export default { - name: 'options', + name: 'rememberOptions', components: { Checker, CheckerItem, XHeader, ViewBox }, @@ -36,14 +36,17 @@ export default { methods: { ...mapActions(['setStatisticsRememberOptions']), _finish () { - this.setStatisticsRememberOptions({ - degree: this.degree - }) + this.setStatisticsRememberOptions({degree: this.degree}) this.$router.go(-1) } }, - created () { - this.degree = this.AssembleRemember.index.options.degree + beforeRouteEnter (to, from, next) { + next(vm => { + vm.degree = vm.AssembleRemember.index.options.degree.toString() + }) + }, + beforeRouteLeave (to, from, next) { + next() } } diff --git a/src/features/statistics/assemble/rememberAssemble.vue b/src/features/statistics/assemble/rememberAssemble.vue new file mode 100644 index 00000000..a3847fcb --- /dev/null +++ b/src/features/statistics/assemble/rememberAssemble.vue @@ -0,0 +1,133 @@ + + + diff --git a/src/features/statistics/assemble/router.js b/src/features/statistics/assemble/router.js index 4b1a754d..708f5509 100644 --- a/src/features/statistics/assemble/router.js +++ b/src/features/statistics/assemble/router.js @@ -13,43 +13,35 @@ export default [ name: 'statisticsRemember', component: r => require.ensure([], () => r(require('./pages/remember')), '/statistics/remember') }, - // { - // path: 'remember/assemble/:subject', - // name: 'statisticsRemember_assemble', - // component: r => require.ensure([], () => r(require('./pages/rememberAssemble')), '/statistics/remember/assemble') - // }, { path: 'good/:subject/:chapterId/:name', name: 'statisticsGood', component: r => require.ensure([], () => r(require('./pages/good')), '/statistics/good') } - // { - // path: 'good/assemble/:subject', - // name: 'statisticsGood_assemble', - // component: r => require.ensure([], () => r(require('./pages/goodAssemble')), '/statistics/good/assemble') - // }, ] }, + // 记错题筛选 { - // 记错题筛选 path: '/statistics/assemble/remember/assemble/options', name: 'statisticsRemember_options', component: r => require.ensure([], () => r(require('./pages/rememberOptions')), '/statistics/remember/options') }, + // 精选题筛选 { - // 精选题筛选 path: '/statistics/assemble/good/assemble/options', name: 'statisticsGood_options', component: r => require.ensure([], () => r(require('./pages/goodOptions')), '/statistics/good/options') + }, + // 记错题组卷 + { + path: '/statistics/remember/assemble/:subject', + name: 'statisticsRemember_assemble', + component: r => require.ensure([], () => r(require('./pages/rememberAssemble')), '/statistics/remember/assemble') + }, + // 拍错题组卷 + { + path: '/statistics/camera/assemble/:subject', + name: 'statisticsCamera_assemble', + component: r => require.ensure([], () => r(require('./pages/cameraAssemble')), '/statistics/camera/assemble') } - // { - // path: '/statistics/camera/assemble/:subject', - // name: 'statisticsCamera_assemble', - // component: r => require.ensure([], () => r(require('./pages/camera')), '/statistics/camera/assemble') - // } - // { - // path: '/statistics/camera/assemble/:subject', - // name: 'statisticsCamera_assemble', - // component: r => require.ensure([], () => r(require('./pages/camera')), '/statistics/camera/assemble') - // } ] diff --git a/src/features/statistics/index/layout.vue b/src/features/statistics/index/layout.vue index 2e67edd6..edea7db9 100644 --- a/src/features/statistics/index/layout.vue +++ b/src/features/statistics/index/layout.vue @@ -19,7 +19,8 @@ From 704b20d873440bb5c4853e52c31d1e2d94a0c357 Mon Sep 17 00:00:00 2001 From: Hope Date: Fri, 20 Oct 2017 22:04:47 +0800 Subject: [PATCH 15/24] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E7=B2=BE?= =?UTF-8?q?=E9=80=89=E9=A2=98=E7=BB=84=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statistics/assemble/modules/actions.js | 19 ++- .../statistics/assemble/modules/store.js | 28 ++-- .../statistics/assemble/pages/camera.vue | 1 + .../assemble/pages/cameraAssemble.vue | 14 +- .../statistics/assemble/pages/good.vue | 5 +- .../assemble/pages/goodAssemble.vue | 136 ++++++++++++++++++ .../statistics/assemble/pages/remember.vue | 1 + .../assemble/pages/rememberAssemble.vue | 12 +- .../statistics/assemble/rememberAssemble.vue | 133 ----------------- src/features/statistics/assemble/router.js | 6 + .../workbook/pages/exercise/answer.vue | 8 +- 11 files changed, 195 insertions(+), 168 deletions(-) create mode 100644 src/features/statistics/assemble/pages/goodAssemble.vue delete mode 100644 src/features/statistics/assemble/rememberAssemble.vue diff --git a/src/features/statistics/assemble/modules/actions.js b/src/features/statistics/assemble/modules/actions.js index 90eef41c..2b4137c9 100644 --- a/src/features/statistics/assemble/modules/actions.js +++ b/src/features/statistics/assemble/modules/actions.js @@ -32,7 +32,8 @@ export const getStatisticsRememberAssemble = ({ state, rootState, commit }, para method: 'get', url: 'statistics/remember/assemble', params: { - token: rootState.common.user.token + token: rootState.common.user.token, + subject: rootState.route.params.subject } }) .then((response) => { @@ -103,7 +104,8 @@ export const getStatisticsCameraAssemble = ({ state, rootState, commit }, params method: 'get', url: 'statistics/camera/assemble', params: { - token: rootState.common.user.token + token: rootState.common.user.token, + subject: rootState.route.params.subject } }) .then((response) => { @@ -170,7 +172,8 @@ export const getStatisticsGoodAssemble = ({ state, rootState, commit }, params) method: 'get', url: 'statistics/good/assemble', params: { - token: rootState.common.user.token + token: rootState.common.user.token, + subject: rootState.route.params.subject } }) .then((response) => { @@ -239,8 +242,14 @@ export const setStatisticsGoodAssembleList = ({ rootState, state, commit }, para } /** 精选题排序 */ -export const setStatisticsGoodAssembleOrder = ({ commit }, params) => { - commit(types.STATISTICS_GOOD_ASSEMBLE_ORDER, {type: params.type, index: params.index, pindex: params.pindex}) +export const setStatisticsGoodAssembleOrder = ({ state, commit }, params) => { + if (params.index === 0 && params.type === 'up') { + Vue.$vux.toast.show({text: '不能再上移了', type: 'text', time: 1000, position: 'bottom'}) + } else if ((params.index === (state.good.download[params.pindex].list - 1)) && params.type === 'down') { + Vue.$vux.toast.show({text: '不能再下移了', type: 'text', time: 1000, position: 'bottom'}) + } else { + commit(types.STATISTICS_GOOD_ASSEMBLE_ORDER, {type: params.type, index: params.index, pindex: params.pindex}) + } } /** 列表高度保存 */ diff --git a/src/features/statistics/assemble/modules/store.js b/src/features/statistics/assemble/modules/store.js index edb94e55..a2f9869b 100644 --- a/src/features/statistics/assemble/modules/store.js +++ b/src/features/statistics/assemble/modules/store.js @@ -17,9 +17,9 @@ const mutations = { } state.remember.index.reset = true }, - [types.STATISTICS_REMEMBER_ASSEMBLE] (state, data) { - state.remember.download = data.list - state.remember.count = data.count + [types.STATISTICS_REMEMBER_ASSEMBLE] (state, payload) { + state.remember.download = payload.data.list + state.remember.count = payload.data.count }, [types.STATISTICS_REMEMBER_ASSEMBLE_UPDATE] (state, payload) { state['remember']['index']['list'][payload.index]['isAssembly'] = payload.data.isAssembly @@ -32,9 +32,9 @@ const mutations = { state.camera.index.offset = payload.data.offset state.camera.count = payload.data.count }, - [types.STATISTICS_CAMERA_ASSEMBLE] (state, data) { - state.camera.download = data.list - state.camera.count = data.count + [types.STATISTICS_CAMERA_ASSEMBLE] (state, payload) { + state.camera.download = payload.data.list + state.camera.count = payload.data.count }, [types.STATISTICS_CAMERA_ASSEMBLE_UPDATE] (state, payload) { state['camera']['index']['list'][payload.index]['isAssembly'] = payload.data.isAssembly @@ -54,17 +54,23 @@ const mutations = { } state.good.index.reset = false }, - [types.STATISTICS_GOOD_ASSEMBLE] (state, data) { - state.good.download = data.list - state.good.count = data.count + [types.STATISTICS_GOOD_ASSEMBLE] (state, payload) { + state.good.download = payload.data.block + state.good.count = payload.data.count }, [types.STATISTICS_GOOD_ASSEMBLE_UPDATE] (state, payload) { state['good']['index']['list'][payload.index]['isAssembly'] = payload.data.isAssembly payload.data.isAssembly ? ++state.good.count : --state.good.count }, [types.STATISTICS_GOOD_ASSEMBLE_ORDER] (state, payload) { - let arr = state.good.index.download.block[payload.pindex].list - arr[payload.index] = (payload.type === 'up' ? arr.splice((payload.index - 1), 1, arr[payload.index])[0] : arr[payload.index] = arr.splice((payload.index + 1), 1, arr[payload.index])[0]) + let arr = state.good.download[payload.pindex].list + if (payload.type === 'up') { + arr[payload.index] = arr.splice((payload.index - 1), 1, arr[payload.index])[0] + } else if (payload.type === 'down') { + arr[payload.index] = arr.splice((payload.index + 1), 1, arr[payload.index])[0] + } else { + arr[payload.index].splice(payload.index, 1) + } }, [types.STATISTICS_SCROLL] (state, payload) { state[payload.type]['index']['scroll'] = payload.height diff --git a/src/features/statistics/assemble/pages/camera.vue b/src/features/statistics/assemble/pages/camera.vue index b28e11e3..b1dfae23 100644 --- a/src/features/statistics/assemble/pages/camera.vue +++ b/src/features/statistics/assemble/pages/camera.vue @@ -135,6 +135,7 @@ export default { border-radius: 50%; bottom: 10%; right: 5%; + box-shadow: 2px 2px 7px #4cc0be; text-align: center; } diff --git a/src/features/statistics/assemble/pages/cameraAssemble.vue b/src/features/statistics/assemble/pages/cameraAssemble.vue index ed87a67f..5a7b4b5f 100644 --- a/src/features/statistics/assemble/pages/cameraAssemble.vue +++ b/src/features/statistics/assemble/pages/cameraAssemble.vue @@ -1,13 +1,13 @@ diff --git a/src/features/statistics/assemble/pages/good.vue b/src/features/statistics/assemble/pages/good.vue index dfe7eebc..f225f9f2 100644 --- a/src/features/statistics/assemble/pages/good.vue +++ b/src/features/statistics/assemble/pages/good.vue @@ -4,7 +4,7 @@
+ @click="this.$router.push({name:'statisticsGood_options'})">
@@ -36,7 +36,7 @@
+ @click="$router.push({name: 'statisticsGood_assemble', params: {subject: $route.params.subject}})"> 已选
{{AssembleGood.count}}
@@ -114,6 +114,7 @@ export default { border-radius: 50%; bottom: 10%; right: 5%; + box-shadow: 2px 2px 7px #4cc0be; text-align: center; } diff --git a/src/features/statistics/assemble/pages/goodAssemble.vue b/src/features/statistics/assemble/pages/goodAssemble.vue new file mode 100644 index 00000000..55f3d1a2 --- /dev/null +++ b/src/features/statistics/assemble/pages/goodAssemble.vue @@ -0,0 +1,136 @@ + + + + diff --git a/src/features/statistics/assemble/pages/remember.vue b/src/features/statistics/assemble/pages/remember.vue index 7f665d51..2da18327 100644 --- a/src/features/statistics/assemble/pages/remember.vue +++ b/src/features/statistics/assemble/pages/remember.vue @@ -138,6 +138,7 @@ export default { font-size: .9rem; height: 3.5rem; width: 3.5rem; + box-shadow: 2px 2px 7px #4cc0be; box-sizing: border-box; padding:.5rem .75rem; border-radius: 50%; diff --git a/src/features/statistics/assemble/pages/rememberAssemble.vue b/src/features/statistics/assemble/pages/rememberAssemble.vue index a3847fcb..0f295733 100644 --- a/src/features/statistics/assemble/pages/rememberAssemble.vue +++ b/src/features/statistics/assemble/pages/rememberAssemble.vue @@ -1,5 +1,5 @@ diff --git a/src/features/statistics/assemble/rememberAssemble.vue b/src/features/statistics/assemble/rememberAssemble.vue deleted file mode 100644 index a3847fcb..00000000 --- a/src/features/statistics/assemble/rememberAssemble.vue +++ /dev/null @@ -1,133 +0,0 @@ - - - diff --git a/src/features/statistics/assemble/router.js b/src/features/statistics/assemble/router.js index 708f5509..5ac8904d 100644 --- a/src/features/statistics/assemble/router.js +++ b/src/features/statistics/assemble/router.js @@ -38,6 +38,12 @@ export default [ name: 'statisticsRemember_assemble', component: r => require.ensure([], () => r(require('./pages/rememberAssemble')), '/statistics/remember/assemble') }, + // 精选题组卷 + { + path: '/statistics/good/assemble/:subject', + name: 'statisticsGood_assemble', + component: r => require.ensure([], () => r(require('./pages/goodAssemble')), '/statistics/good/assemble') + }, // 拍错题组卷 { path: '/statistics/camera/assemble/:subject', diff --git a/src/features/workbook/pages/exercise/answer.vue b/src/features/workbook/pages/exercise/answer.vue index cd451653..58ad1b71 100644 --- a/src/features/workbook/pages/exercise/answer.vue +++ b/src/features/workbook/pages/exercise/answer.vue @@ -1,5 +1,5 @@ From 22ef7627d95ae0ea1eff6c020f2ef938d44058a6 Mon Sep 17 00:00:00 2001 From: Hope Date: Sat, 21 Oct 2017 13:52:40 +0800 Subject: [PATCH 16/24] =?UTF-8?q?feat:=20=E7=BB=84=E5=8D=B7=E8=AF=84?= =?UTF-8?q?=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +- src/components/axios/index.js | 4 +- src/features/comment/modules/actions.js | 24 +++++ src/features/comment/modules/getters.js | 1 + src/features/comment/modules/mutationTypes.js | 4 + src/features/comment/modules/store.js | 23 +++++ src/features/comment/pages/comment.vue | 98 +++++++++++++++++++ src/features/comment/router.js | 5 + src/features/download/modules/actions.js | 18 +++- src/features/statistics/assemble/layout.vue | 2 +- .../statistics/assemble/modules/actions.js | 8 +- .../statistics/assemble/modules/store.js | 4 +- .../statistics/assemble/pages/camera.vue | 5 +- .../statistics/assemble/pages/good.vue | 10 +- .../assemble/pages/goodAssemble.vue | 20 ++-- .../statistics/assemble/pages/goodOptions.vue | 3 + .../statistics/assemble/pages/remember.vue | 19 ++-- src/router.js | 11 ++- 18 files changed, 221 insertions(+), 41 deletions(-) create mode 100644 src/features/comment/modules/actions.js create mode 100644 src/features/comment/modules/getters.js create mode 100644 src/features/comment/modules/mutationTypes.js create mode 100644 src/features/comment/modules/store.js create mode 100644 src/features/comment/pages/comment.vue create mode 100644 src/features/comment/router.js diff --git a/README.md b/README.md index d3f2fa01..e3e4ced9 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,9 @@ ├── camera # 拍错题 ├── workbook # 查答案 ├── example # 例题 - ├── collect # 收藏本模块 + ├── collect # 收藏模块 ├── correct # 纠错 + ├── comment # 教师评价 ├── myclass # 我的班级 ├── download # 下载中心 ├── error # 错题本 diff --git a/src/components/axios/index.js b/src/components/axios/index.js index b12ea7af..91baf80c 100644 --- a/src/components/axios/index.js +++ b/src/components/axios/index.js @@ -4,8 +4,8 @@ import qs from 'qs' axios.defaults.timeout = 10000 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8' -axios.defaults.baseURL = 'https://www.guinaben.com/student/' - +// axios.defaults.baseURL = 'https://www.guinaben.com/student/' +axios.defaults.baseURL = 'http://www.guinaben.com:8070/test/student/' // POST传参序列化 axios.interceptors.request.use((config) => { config.params = { diff --git a/src/features/comment/modules/actions.js b/src/features/comment/modules/actions.js new file mode 100644 index 00000000..04b5a410 --- /dev/null +++ b/src/features/comment/modules/actions.js @@ -0,0 +1,24 @@ +import axios from '@/components/axios/' +import * as types from './mutationTypes' + +/** 获取错题评价 */ +export const getComment = ({ rootState, commit, state }, params) => { + return new Promise((resolve, reject) => { + axios({ + method: 'get', + url: 'error/getComment', + params: { + token: rootState.common.user.token, + wbeid: rootState.route.params.wbeid + } + }).then((response) => { + commit(types.COMMENT, { data: response.data.data }) + resolve(response) + }) + }) +} + +/** 错题评价清空 */ +export const clearComment = ({ commit }) => { + commit(types.COMMENT_RELOAD) +} diff --git a/src/features/comment/modules/getters.js b/src/features/comment/modules/getters.js new file mode 100644 index 00000000..f6f7ff73 --- /dev/null +++ b/src/features/comment/modules/getters.js @@ -0,0 +1 @@ +export const Comment = (state) => state.comment diff --git a/src/features/comment/modules/mutationTypes.js b/src/features/comment/modules/mutationTypes.js new file mode 100644 index 00000000..2ee90dbd --- /dev/null +++ b/src/features/comment/modules/mutationTypes.js @@ -0,0 +1,4 @@ +/** 错题评价 */ +export const COMMENT = 'COMMENT' +/** 错题评价清空 */ +export const COMMENT_RELOAD = 'COMMENT_RELOAD' diff --git a/src/features/comment/modules/store.js b/src/features/comment/modules/store.js new file mode 100644 index 00000000..ffb729d5 --- /dev/null +++ b/src/features/comment/modules/store.js @@ -0,0 +1,23 @@ +import * as types from './mutationTypes' +import * as getters from './getters' +import * as actions from './actions' + +const state = { + comment: {} +} + +const mutations = { + [types.COMMENT] (state, payload) { + state.comment = payload.data + }, + [types.COMMENT_RELOAD] (state) { + state.comment = [] + } +} + +export default { + state, + mutations, + getters, + actions +} diff --git a/src/features/comment/pages/comment.vue b/src/features/comment/pages/comment.vue new file mode 100644 index 00000000..6f55a770 --- /dev/null +++ b/src/features/comment/pages/comment.vue @@ -0,0 +1,98 @@ + + + diff --git a/src/features/comment/router.js b/src/features/comment/router.js new file mode 100644 index 00000000..4883ff0e --- /dev/null +++ b/src/features/comment/router.js @@ -0,0 +1,5 @@ +export default { + path: '/comment/:wbeid', + name: 'comment', + component: r => require.ensure([], () => r(require('./pages/comment')), '/comment') +} diff --git a/src/features/download/modules/actions.js b/src/features/download/modules/actions.js index 463e9d7b..4986884b 100644 --- a/src/features/download/modules/actions.js +++ b/src/features/download/modules/actions.js @@ -1,6 +1,18 @@ import * as types from './mutationTypes' import axios from '@/components/axios/' +function getSubjectId (val) { + let subject = '' + if (val.toString() === '2') { + subject = 'math' + } else if (val.toString() === '7') { + subject = 'physics' + } else if (val.toString() === '8') { + subject = 'chemistry' + } + return subject +} + /** 获取拍错题下载列表 */ export const getDownloadCamera = ({ rootState, commit }, params) => { return new Promise((resolve, reject) => { @@ -9,7 +21,7 @@ export const getDownloadCamera = ({ rootState, commit }, params) => { url: ' download/camera', params: { token: rootState.common.user.token, - subject: params.subject + subject: getSubjectId(params.subject) } }).then((response) => { commit(types.DOWNLOAD, {data: response.data.data, type: 'camera'}) @@ -47,7 +59,7 @@ export const getDownloadRemember = ({ rootState, commit }, params) => { url: ' download/remember', params: { token: rootState.common.user.token, - subject: params.subject + subject: getSubjectId(params.subject) } }).then((response) => { commit(types.DOWNLOAD, {data: response.data.data, type: 'remember'}) @@ -85,7 +97,7 @@ export const getDownloadGood = ({ rootState, commit }, params) => { url: ' download/good', params: { token: rootState.common.user.token, - subject: params.subject + subject: getSubjectId(params.subject) } }).then((response) => { commit(types.DOWNLOAD, {data: response.data.data, type: 'good'}) diff --git a/src/features/statistics/assemble/layout.vue b/src/features/statistics/assemble/layout.vue index 53f4e2ff..478986ca 100644 --- a/src/features/statistics/assemble/layout.vue +++ b/src/features/statistics/assemble/layout.vue @@ -14,7 +14,7 @@ 拍错题 - + 精选练习 diff --git a/src/features/statistics/assemble/modules/actions.js b/src/features/statistics/assemble/modules/actions.js index 2b4137c9..451dcee7 100644 --- a/src/features/statistics/assemble/modules/actions.js +++ b/src/features/statistics/assemble/modules/actions.js @@ -213,11 +213,11 @@ export const setStatisticsGoodAssembleUpdate = ({ rootState, commit }, params) = } /** 精选题题目排序 */ -export const setStatisticsGoodAssembleList = ({ rootState, state, commit }, params) => { +export const setStatisticsGoodAssembleList = ({ state, rootState, commit }, params) => { let ids = [] - let array = state.good.index.list + let array = state.good.download for (let pindex = 0; pindex < array.length; pindex++) { - for (let index = 0; index < array[pindex].list.length; index++) { + for (let index = 0; index < array[pindex]['list'].length; index++) { ids.push({id: array[pindex]['list'][index].exercisesId, form: array[pindex]['list'][index].form}) } } @@ -245,7 +245,7 @@ export const setStatisticsGoodAssembleList = ({ rootState, state, commit }, para export const setStatisticsGoodAssembleOrder = ({ state, commit }, params) => { if (params.index === 0 && params.type === 'up') { Vue.$vux.toast.show({text: '不能再上移了', type: 'text', time: 1000, position: 'bottom'}) - } else if ((params.index === (state.good.download[params.pindex].list - 1)) && params.type === 'down') { + } else if ((params.index === (state.good.download[params.pindex].list.length - 1)) && params.type === 'down') { Vue.$vux.toast.show({text: '不能再下移了', type: 'text', time: 1000, position: 'bottom'}) } else { commit(types.STATISTICS_GOOD_ASSEMBLE_ORDER, {type: params.type, index: params.index, pindex: params.pindex}) diff --git a/src/features/statistics/assemble/modules/store.js b/src/features/statistics/assemble/modules/store.js index a2f9869b..bf9dbc1a 100644 --- a/src/features/statistics/assemble/modules/store.js +++ b/src/features/statistics/assemble/modules/store.js @@ -52,7 +52,7 @@ const mutations = { degree: payload.degree, type: payload.type } - state.good.index.reset = false + state.good.index.reset = true }, [types.STATISTICS_GOOD_ASSEMBLE] (state, payload) { state.good.download = payload.data.block @@ -69,7 +69,7 @@ const mutations = { } else if (payload.type === 'down') { arr[payload.index] = arr.splice((payload.index + 1), 1, arr[payload.index])[0] } else { - arr[payload.index].splice(payload.index, 1) + arr.splice(payload.index, 1) } }, [types.STATISTICS_SCROLL] (state, payload) { diff --git a/src/features/statistics/assemble/pages/camera.vue b/src/features/statistics/assemble/pages/camera.vue index b1dfae23..5b2aca01 100644 --- a/src/features/statistics/assemble/pages/camera.vue +++ b/src/features/statistics/assemble/pages/camera.vue @@ -6,7 +6,8 @@
- {{error.time | ymd}} + {{error.chapterName}} + {{error.time | ymd}}
@@ -88,7 +89,7 @@ export default { _getData () { this.loading = true this.getStatisticsCamera().then((res) => { - if (!res.data.data.offset) { + if (res.data.data.offset.length === 0) { this.loadingNoData = true } this.loading = false diff --git a/src/features/statistics/assemble/pages/good.vue b/src/features/statistics/assemble/pages/good.vue index f225f9f2..05056e0c 100644 --- a/src/features/statistics/assemble/pages/good.vue +++ b/src/features/statistics/assemble/pages/good.vue @@ -4,7 +4,7 @@
+ @click="$router.push({name:'statisticsGood_options'})">
@@ -22,10 +22,10 @@