Commit 98522799 by 梁建民

js

parent 3477776c
......@@ -27,9 +27,7 @@ const mutations = {
},
aggs(state, payload) {
console.log(payload)
if (!payload.reset) {
var arr = [];
var obj = Object.keys(payload.data.aggs);
......@@ -49,19 +47,21 @@ const mutations = {
payload.data.aggs[k].list[i].check = !payload.data.aggs[k].list[i].check;
payload.data.aggs[k].list[i].flag = !payload.data.aggs[k].list[i].flag;
}
if (payload.reset) {
payload.data.aggs[k].list[i].check = false;
payload.data.aggs[k].list[i].flag = false;
}
}
}
state.aggs = payload.data;
}
}
} else {
state.aggs = [];
state.aggs = payload.data;
}
},
aggSample(state, payload) {
......
......@@ -4338,7 +4338,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue_
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es7.object.get-own-property-descriptors */ \"./node_modules/_core-js@2.6.11@core-js/modules/es7.object.get-own-property-descriptors.js\");\n/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es6.object.assign */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.object.assign.js\");\n/* harmony import */ var core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty */ \"./node_modules/_@babel_runtime@7.7.7@@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es6.regexp.split */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.regexp.split.js\");\n/* harmony import */ var core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom.iterable */ \"./node_modules/_core-js@2.6.11@core-js/modules/web.dom.iterable.js\");\n/* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es6.array.iterator */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.array.iterator.js\");\n/* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es6.object.keys */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.object.keys.js\");\n/* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.11@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.4.1@vant/es/index.js\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../api/index */ \"./src/api/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../util */ \"./src/util/index.js\");\n\n\n\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_7__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"]);\nvar state = {\n classList: [],\n goodList: [],\n loading: false,\n finished: false,\n goodCount: 0,\n aggSample: [],\n aggs: {},\n aggsFlag: [],\n ziYingIndex: {},\n smaple_class_id: '',\n getsamplebanner: []\n};\nvar mutations = {\n ziYingIndex: function ziYingIndex(state, payload) {\n state.ziYingIndex = payload.data;\n },\n aggs: function aggs(state, payload) {\n console.log(payload);\n\n if (!payload.reset) {\n var arr = [];\n var obj = Object.keys(payload.data.aggs);\n\n if (payload.id) {\n arr = payload.id.split(\",\");\n }\n\n for (var k in payload.data.aggs) {\n for (var i = 0; i < payload.data.aggs[k].list.length; i++) {\n payload.data.aggs[k].list[i].check = false;\n\n for (var j = 0; j < arr.length; j++) {\n if (payload.data.aggs[k].list[i].id == arr[j]) {\n payload.data.aggs[k].list[i].check = !payload.data.aggs[k].list[i].check;\n payload.data.aggs[k].list[i].flag = !payload.data.aggs[k].list[i].flag;\n }\n }\n }\n }\n\n state.aggs = payload.data;\n } else {\n state.aggs = [];\n state.aggs = payload.data;\n }\n },\n aggSample: function aggSample(state, payload) {\n state.smaple_class_id = payload.data[0].smaple_class_id;\n state.aggSample = payload.data;\n },\n classListM: function classListM(state, payload) {\n state.classList = payload.data;\n },\n goodList: function goodList(state, payload) {\n var arr = [];\n\n for (var k in payload.data) {\n arr.push(payload.data[k]);\n }\n\n state.goodList = state.goodList.concat(arr);\n },\n getsamplebanner: function getsamplebanner(state, payload) {\n state.getsamplebanner = payload.data;\n }\n};\nvar actions = {\n ziYingIndex: function ziYingIndex(_ref, payload) {\n var commit = _ref.commit;\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].loading({\n message: '加载中...',\n forbidClick: true,\n loadingType: 'spinner'\n });\n\n var obj = _objectSpread({}, payload.params, {\n 'offset': 100,\n 'sample_status/eq': 1\n });\n\n var params = _util__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getParams(obj);\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].ZiYingIndex(params).then(function (res) {\n var data = res.data;\n\n if (data.error_code == 0) {\n commit({\n type: 'ziYingIndex',\n data: data.data\n });\n } else if (data.error_code == 3) {} else {\n Object(vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"])({\n message: data.error_msg,\n duration: 3000\n });\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].clear();\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].clear();\n });\n },\n aggs: function aggs(_ref2, payload) {\n var commit = _ref2.commit;\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].loading({\n message: '加载中...',\n forbidClick: true,\n loadingType: 'spinner'\n });\n var param = {\n 'sample_status/eq': 1\n };\n var obj = Object.assign({}, param, payload.params);\n var params = _util__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getParams(obj);\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].aggs(params).then(function (res) {\n var data = res.data;\n\n if (data.error_code == 0) {\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].clear();\n commit({\n type: 'aggs',\n data: data.data,\n reset: payload.params.reset,\n id: payload.params.id\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"])({\n message: data.error_msg,\n duration: 3000\n });\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].clear();\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].clear();\n });\n },\n aggSample: function aggSample(_ref3, payload) {\n var commit = _ref3.commit;\n var params = _util__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getParams();\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].aggSample(params).then(function (res) {\n var data = res.data;\n\n if (data.error_code == 0) {\n commit({\n type: 'aggSample',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"])({\n message: data.error_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n getClasslist: function getClasslist(_ref4, payload) {\n var commit = _ref4.commit;\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].sampleClassList().then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit(\"classListM\", {\n data: data.data || []\n });\n } else {\n commit(\"classListM\", {\n data: []\n });\n }\n }).catch(function (err) {\n commit(\"classListM\", {\n data: []\n });\n });\n },\n getGoodList: function getGoodList(_ref5, payload) {\n var commit = _ref5.commit;\n state.loading = true;\n state.finished = false;\n var p = payload.data.p;\n\n if (p == 1) {\n state.goodList = [];\n }\n\n var params = _objectSpread({}, payload.data, {\n limit: 10\n });\n\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].sampleList(params).then(function (res) {\n state.loading = false;\n var data = res.data;\n\n if (data.err_code == 0) {\n var totalPage = 0;\n\n if (data.data.total) {\n totalPage = Math.ceil(data.data.total / 10);\n }\n\n if (p == totalPage || !totalPage) {\n state.finished = true;\n }\n\n if (data.data.total) {\n commit('goodList', {\n data: data.data.data\n });\n }\n } else {\n state.loading = false;\n state.finished = true;\n }\n }).catch(function (err) {\n state.loading = false;\n state.finished = true;\n });\n },\n getsamplebanner: function getsamplebanner(_ref6, payload) {\n var commit = _ref6.commit;\n var params = _util__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getParams();\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].getsamplebanner(params).then(function (res) {\n state.loading = false;\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'getsamplebanner',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"])({\n message: data.error_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n state: state,\n actions: actions,\n mutations: mutations\n});\n\n//# sourceURL=webpack:///./src/store/modules/sample/index.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es7.object.get-own-property-descriptors */ \"./node_modules/_core-js@2.6.11@core-js/modules/es7.object.get-own-property-descriptors.js\");\n/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es6.object.assign */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.object.assign.js\");\n/* harmony import */ var core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty */ \"./node_modules/_@babel_runtime@7.7.7@@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es6.regexp.split */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.regexp.split.js\");\n/* harmony import */ var core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom.iterable */ \"./node_modules/_core-js@2.6.11@core-js/modules/web.dom.iterable.js\");\n/* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es6.array.iterator */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.array.iterator.js\");\n/* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es6.object.keys */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.object.keys.js\");\n/* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.11@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.4.1@vant/es/index.js\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../api/index */ \"./src/api/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../util */ \"./src/util/index.js\");\n\n\n\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_7__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"]);\nvar state = {\n classList: [],\n goodList: [],\n loading: false,\n finished: false,\n goodCount: 0,\n aggSample: [],\n aggs: {},\n aggsFlag: [],\n ziYingIndex: {},\n smaple_class_id: '',\n getsamplebanner: []\n};\nvar mutations = {\n ziYingIndex: function ziYingIndex(state, payload) {\n state.ziYingIndex = payload.data;\n },\n aggs: function aggs(state, payload) {\n var arr = [];\n var obj = Object.keys(payload.data.aggs);\n\n if (payload.id) {\n arr = payload.id.split(\",\");\n }\n\n for (var k in payload.data.aggs) {\n for (var i = 0; i < payload.data.aggs[k].list.length; i++) {\n payload.data.aggs[k].list[i].check = false;\n\n for (var j = 0; j < arr.length; j++) {\n if (payload.data.aggs[k].list[i].id == arr[j]) {\n payload.data.aggs[k].list[i].check = !payload.data.aggs[k].list[i].check;\n payload.data.aggs[k].list[i].flag = !payload.data.aggs[k].list[i].flag;\n\n if (payload.reset) {\n payload.data.aggs[k].list[i].check = false;\n payload.data.aggs[k].list[i].flag = false;\n }\n }\n }\n }\n }\n\n state.aggs = payload.data;\n },\n aggSample: function aggSample(state, payload) {\n state.smaple_class_id = payload.data[0].smaple_class_id;\n state.aggSample = payload.data;\n },\n classListM: function classListM(state, payload) {\n state.classList = payload.data;\n },\n goodList: function goodList(state, payload) {\n var arr = [];\n\n for (var k in payload.data) {\n arr.push(payload.data[k]);\n }\n\n state.goodList = state.goodList.concat(arr);\n },\n getsamplebanner: function getsamplebanner(state, payload) {\n state.getsamplebanner = payload.data;\n }\n};\nvar actions = {\n ziYingIndex: function ziYingIndex(_ref, payload) {\n var commit = _ref.commit;\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].loading({\n message: '加载中...',\n forbidClick: true,\n loadingType: 'spinner'\n });\n\n var obj = _objectSpread({}, payload.params, {\n 'offset': 100,\n 'sample_status/eq': 1\n });\n\n var params = _util__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getParams(obj);\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].ZiYingIndex(params).then(function (res) {\n var data = res.data;\n\n if (data.error_code == 0) {\n commit({\n type: 'ziYingIndex',\n data: data.data\n });\n } else if (data.error_code == 3) {} else {\n Object(vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"])({\n message: data.error_msg,\n duration: 3000\n });\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].clear();\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].clear();\n });\n },\n aggs: function aggs(_ref2, payload) {\n var commit = _ref2.commit;\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].loading({\n message: '加载中...',\n forbidClick: true,\n loadingType: 'spinner'\n });\n var param = {\n 'sample_status/eq': 1\n };\n var obj = Object.assign({}, param, payload.params);\n var params = _util__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getParams(obj);\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].aggs(params).then(function (res) {\n var data = res.data;\n\n if (data.error_code == 0) {\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].clear();\n commit({\n type: 'aggs',\n data: data.data,\n reset: payload.params.reset,\n id: payload.params.id\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"])({\n message: data.error_msg,\n duration: 3000\n });\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].clear();\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"].clear();\n });\n },\n aggSample: function aggSample(_ref3, payload) {\n var commit = _ref3.commit;\n var params = _util__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getParams();\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].aggSample(params).then(function (res) {\n var data = res.data;\n\n if (data.error_code == 0) {\n commit({\n type: 'aggSample',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"])({\n message: data.error_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n getClasslist: function getClasslist(_ref4, payload) {\n var commit = _ref4.commit;\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].sampleClassList().then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit(\"classListM\", {\n data: data.data || []\n });\n } else {\n commit(\"classListM\", {\n data: []\n });\n }\n }).catch(function (err) {\n commit(\"classListM\", {\n data: []\n });\n });\n },\n getGoodList: function getGoodList(_ref5, payload) {\n var commit = _ref5.commit;\n state.loading = true;\n state.finished = false;\n var p = payload.data.p;\n\n if (p == 1) {\n state.goodList = [];\n }\n\n var params = _objectSpread({}, payload.data, {\n limit: 10\n });\n\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].sampleList(params).then(function (res) {\n state.loading = false;\n var data = res.data;\n\n if (data.err_code == 0) {\n var totalPage = 0;\n\n if (data.data.total) {\n totalPage = Math.ceil(data.data.total / 10);\n }\n\n if (p == totalPage || !totalPage) {\n state.finished = true;\n }\n\n if (data.data.total) {\n commit('goodList', {\n data: data.data.data\n });\n }\n } else {\n state.loading = false;\n state.finished = true;\n }\n }).catch(function (err) {\n state.loading = false;\n state.finished = true;\n });\n },\n getsamplebanner: function getsamplebanner(_ref6, payload) {\n var commit = _ref6.commit;\n var params = _util__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getParams();\n _api_index__WEBPACK_IMPORTED_MODULE_9__[\"services\"].getsamplebanner(params).then(function (res) {\n state.loading = false;\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'getsamplebanner',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_8__[\"Toast\"])({\n message: data.error_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n state: state,\n actions: actions,\n mutations: mutations\n});\n\n//# sourceURL=webpack:///./src/store/modules/sample/index.js?");
/***/ }),
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment