Commit 7115df3a by 梁建民

js

parent c109081c
......@@ -26,6 +26,8 @@ const mutations = {
state.ziYingIndex = payload.data;
},
aggs(state, payload) {
var arr = [];
var obj = Object.keys(payload.data.aggs);
......@@ -37,11 +39,19 @@ const mutations = {
for (let i = 0; i < payload.data.aggs[k].list.length; i++) {
payload.data.aggs[k].list[i].check = false;
for (let j = 0; j < arr.length; j++) {
if (payload.data.aggs[k].list[i].id == arr[j]) {
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;
}
}
}
......@@ -101,8 +111,7 @@ const actions = {
} else if (data.error_code == 3) {
} else {
Toast({
......@@ -141,6 +150,7 @@ const actions = {
commit({
type: 'aggs',
data: data.data,
reset: payload.params.reset,
id: payload.params.id
});
} else {
......
......@@ -32,7 +32,7 @@
<div class="fx_text_three" v-else>分享可额外获得领取机会</div>
</div>
<div class="nav" v-if="aggSample.length">
<van-tabs :ellipsis="false" v-model="active" @click="onClick" :color="color" :swipe-threshold="swipeThreshold" :title-active-color="color" :title-inactive-color="defaultcolor" @change="changeTab">
<van-tabs :ellipsis="false" v-model="active" @click="onClick" :color="color" :swipe-threshold="swipeThreshold" :title-active-color="color" :title-inactive-color="defaultcolor" @change="changeTab">
<van-tab v-for="(v,k) in aggSample" :key="k" :title="v.smaple_class_name" :name="v.smaple_class_id"></van-tab>
</van-tabs>
<div class="sample-search" v-if="layer">
......@@ -63,7 +63,7 @@
</template>
</ul>
<div class="button">
<a class="cancel">重置</a>
<a class="cancel" @click="canel()">重置</a>
<a class="confirm" @click="submit()">确定</a>
</div>
</div>
......@@ -89,8 +89,8 @@
{{v.sample_max_number}}
</p>
<div class="btn-wrap clr">
<div class="btnw fl" v-shareMask>送朋友 </div>
<div class="btnx fr" @click="yaoqing(v)">领取样品 </div>
<div class="btnw fl" v-shareMask>送朋友</div>
<div class="btnx fr" @click="yaoqing(v)">领取样品</div>
</div>
</div>
</div>
......@@ -138,7 +138,7 @@
import wxShare from "@/views/common/wxShare.vue";
import {services as Services} from "../../api/index";
import util from "../../util/index";
import {Tab, Tabs, Lazyload, List, Toast,Swipe, SwipeItem,} from "vant";
import {Tab, Tabs, Lazyload, List, Toast, Swipe, SwipeItem,} from "vant";
Vue.use(Tab).use(Tabs).use(Lazyload).use(Toast).use(Swipe).use(SwipeItem);
......@@ -146,7 +146,7 @@
name: "sample",
data() {
return {
bannerHeight:173,
bannerHeight: 173,
title: "猎芯网-自营样片",
meaushow: true,
bgcolor: "#fafafa",
......@@ -157,7 +157,7 @@
getPop: false, //获得机会弹窗,没机会时展示
getPops: false,
quota: '',
finished:false,
finished: false,
quotaNum: '',
loadingYp: false,
applyCount: 0,
......@@ -226,7 +226,7 @@
this.$store.dispatch({
type: "ziYingIndex",
params: {'sample_class_id/eq':1}
params: {'sample_class_id/eq': 1}
});
this.$store.dispatch({
......@@ -266,13 +266,13 @@
this.$store.dispatch({
type: "ziYingIndex",
params: {'sample_class_id/eq':name}
params: {'sample_class_id/eq': name}
});
},
onLoad() {
this.p++;
this.finished=true;
this.finished = true;
},
getuserf() {
this.getPop = false;
......@@ -300,6 +300,15 @@
this.layer = false;
},
canel: function () {
let params = Object.assign({}, {reset: true, 'sample_class_id/eq': this.sample_class_id}, this.brand_id, this.packing, this.encap, this.attrs, {id: this.id.join(',')});
this.$store.dispatch({
type: "aggs",
params: params
});
},
screenFn: function (id, key, flag) {
if (key == 'brand_id') {
......@@ -389,7 +398,7 @@
return;
} else {
var stock=util.aggxde(item.stock);
var stock = util.aggxde(item.stock);
if (this.applyCount != 0) {
if (stock) {
......
......@@ -20,7 +20,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
/***/ (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_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_4__ = __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_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__ = __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 vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.11@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuex */ \"./node_modules/_vuex@3.1.2@vuex/dist/vuex.esm.js\");\n/* harmony import */ var _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/views/common/Header.vue */ \"./src/views/common/Header.vue\");\n/* harmony import */ var _views_common_wxShare_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/views/common/wxShare.vue */ \"./src/views/common/wxShare.vue\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../api/index */ \"./src/api/index.js\");\n/* harmony import */ var _util_index__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../util/index */ \"./src/util/index.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.4.1@vant/es/index.js\");\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_5__[\"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_6__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_12__[\"Tab\"]).use(vant__WEBPACK_IMPORTED_MODULE_12__[\"Tabs\"]).use(vant__WEBPACK_IMPORTED_MODULE_12__[\"Lazyload\"]).use(vant__WEBPACK_IMPORTED_MODULE_12__[\"Toast\"]).use(vant__WEBPACK_IMPORTED_MODULE_12__[\"Swipe\"]).use(vant__WEBPACK_IMPORTED_MODULE_12__[\"SwipeItem\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"sample\",\n data: function data() {\n return {\n bannerHeight: 173,\n title: \"猎芯网-自营样片\",\n meaushow: true,\n bgcolor: \"#fafafa\",\n color: \"#1080d0\",\n defaultcolor: \"#333\",\n swipeThreshold: 4,\n active: 0,\n getPop: false,\n //获得机会弹窗,没机会时展示\n getPops: false,\n quota: '',\n finished: false,\n quotaNum: '',\n loadingYp: false,\n applyCount: 0,\n inviteCount: 0,\n p: 1,\n classId: \"\",\n fxType: 0,\n layer: false,\n type: '',\n sample_class_id: '',\n brand_id: {},\n packing: {},\n encap: {},\n attrs: {},\n curr: false,\n id: [],\n shareUrl: window.location.origin + \"/v3/samplereg?uid=\" + _util_index__WEBPACK_IMPORTED_MODULE_11__[\"default\"].getCookie(\"Yo4teW_uid\")\n };\n },\n computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_7__[\"mapState\"])({\n aggSample: function aggSample(state) {\n return state.sample.aggSample;\n },\n ziYingIndex: function ziYingIndex(state) {\n return state.sample.ziYingIndex;\n },\n aggs: function aggs(state) {\n return state.sample.aggs;\n },\n goodList: function goodList(state) {\n return state.sample.goodList;\n },\n loading: function loading(state) {\n return state.sample.loading;\n },\n getsamplebanner: function getsamplebanner(state) {\n return state.sample.getsamplebanner;\n }\n })),\n watch: {\n loading: function loading(now) {\n this.loadingYp = now;\n },\n classList: function classList(now) {\n /* if (now.length) {\n this.p = 1;\n this.classId = now[0].id;\n this.getGoodList();\n }*/\n }\n },\n beforeCreate: function beforeCreate() {\n if (!/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {\n var url = \"\";\n var paramsStr = '';\n\n for (var k in this.$route.query) {\n paramsStr += k + '=' + this.$route.query[k] + '&';\n }\n\n paramsStr = paramsStr.slice(0, -1);\n\n switch (window.location.hostname) {\n case \"m.liexin.com\":\n window.location.href = paramsStr ? \"http://www.liexin.com/v3/sample?\" + paramsStr : \"http://www.liexin.com/v3/sample\";\n break;\n\n default:\n window.location.href = window.location.origin + (paramsStr ? \"/v3/sample?\" + paramsStr : \"/v3/sample\");\n break;\n }\n }\n },\n created: function created() {\n this.$store.dispatch({\n type: \"aggSample\"\n });\n this.$store.dispatch({\n type: \"ziYingIndex\",\n params: {\n 'sample_class_id/eq': 1\n }\n });\n this.$store.dispatch({\n type: \"getsamplebanner\"\n });\n this.judgeLogin();\n },\n methods: {\n judgeLogin: function judgeLogin() {\n if (getCookie(\"Yo4teW_uid\")) {\n this.getCount();\n } else {\n this.fxType = 3;\n }\n },\n getGoodList: function getGoodList() {\n this.$store.dispatch({\n type: \"getGoodList\",\n data: {\n p: this.p,\n class_id: this.classId\n }\n });\n },\n onClick: function onClick(name) {\n this.sample_class_id = name;\n this.layer = !this.layer;\n this.getAggData(name);\n },\n changeTab: function changeTab(name) {\n this.layer = false;\n this.sample_class_id = name;\n this.$store.dispatch({\n type: \"ziYingIndex\",\n params: {\n 'sample_class_id/eq': name\n }\n });\n },\n onLoad: function onLoad() {\n this.p++;\n this.finished = true;\n },\n getuserf: function getuserf() {\n this.getPop = false;\n },\n getAggData: function getAggData(id) {\n var params = Object.assign({}, {\n 'sample_class_id/eq': id\n });\n this.$store.dispatch(Object(E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__[\"default\"])({\n type: \"aggs\",\n params: params\n }, \"params\", params));\n },\n submit: function submit() {\n var params = Object.assign({}, {\n 'sample_class_id/eq': this.sample_class_id\n }, this.brand_id, this.packing, this.encap, this.attrs, {\n id: this.id.join(',')\n });\n this.$store.dispatch({\n type: \"ziYingIndex\",\n params: params\n });\n this.layer = false;\n },\n screenFn: function screenFn(id, key, flag) {\n if (key == 'brand_id') {\n //品牌\n this.brand_id = {\n 'brand_id/condition': id\n };\n\n if (flag) {\n this.brand_id = {};\n }\n } else if (key == 'packing') {\n //包装\n this.packing = {\n 'packing/condition': id\n };\n\n if (flag) {\n this.packing = {};\n }\n } else if (key == 'encap') {\n //封装\n this.encap = {\n 'encap/condition': id\n };\n\n if (flag) {\n this.encap = {};\n }\n } else {\n //其他属性\n var attrs = {};\n attrs[key] = [id];\n this.attrs = {\n 'attrs/nested': JSON.stringify(attrs)\n };\n\n if (flag) {\n this.attrs = {};\n }\n }\n\n this.id.push(id);\n var params = Object.assign({}, {\n 'sample_class_id/eq': this.sample_class_id\n }, this.brand_id, this.packing, this.encap, this.attrs, {\n id: this.id.join(',')\n });\n this.$store.dispatch({\n type: \"aggs\",\n params: params\n });\n },\n getCount: function getCount() {\n //获取用户领取机会、邀约人数\n var me = this;\n _api_index__WEBPACK_IMPORTED_MODULE_10__[\"services\"].getUserSampleInfo().then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n me.applyCount = data.data.apply_count || 0;\n me.inviteCount = data.data.invite_count || 0;\n\n if (me.inviteCount == 0) {\n me.fxType = 2;\n } else {\n me.fxType = 1;\n }\n } else if (data.err_code == \"11012\") {\n window.location.href = \"/v3/login?referer=\" + encodeURIComponent(window.location.href);\n }\n }).catch(function (err) {});\n },\n yaoqing: function yaoqing(item) {\n var loginpta = _util_index__WEBPACK_IMPORTED_MODULE_11__[\"default\"].isLogin(); //1强登入态\n\n if (loginpta != 1) {\n window.location.href = \"/v3/login?referer=\" + encodeURIComponent(window.location.href);\n return;\n } else {\n var stock = _util_index__WEBPACK_IMPORTED_MODULE_11__[\"default\"].aggxde(item.stock);\n\n if (this.applyCount != 0) {\n if (stock) {\n if (this.applyCount * 1 < item.quota * 1) {\n this.getPops = true;\n this.quota = item.quota;\n this.quotaNum = item.quota * 1 - this.applyCount * 1;\n } else {\n this.$router.push({\n path: \"/sampleapply\",\n query: {\n id: item.goods_id\n }\n });\n }\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_12__[\"Toast\"])(\"样品库存不足\");\n }\n } else {\n this.getPop = true;\n }\n }\n }\n },\n components: {\n Header: _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n wxShare: _views_common_wxShare_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n \"van-list\": vant__WEBPACK_IMPORTED_MODULE_12__[\"List\"]\n }\n});\n\n//# sourceURL=webpack:///./src/views/sample/sample.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.0.6@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.8.3@vue-loader/lib??vue-loader-options");
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_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_4__ = __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_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_assign__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__ = __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 vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.11@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuex */ \"./node_modules/_vuex@3.1.2@vuex/dist/vuex.esm.js\");\n/* harmony import */ var _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/views/common/Header.vue */ \"./src/views/common/Header.vue\");\n/* harmony import */ var _views_common_wxShare_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/views/common/wxShare.vue */ \"./src/views/common/wxShare.vue\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../api/index */ \"./src/api/index.js\");\n/* harmony import */ var _util_index__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../util/index */ \"./src/util/index.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.4.1@vant/es/index.js\");\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_5__[\"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_6__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_12__[\"Tab\"]).use(vant__WEBPACK_IMPORTED_MODULE_12__[\"Tabs\"]).use(vant__WEBPACK_IMPORTED_MODULE_12__[\"Lazyload\"]).use(vant__WEBPACK_IMPORTED_MODULE_12__[\"Toast\"]).use(vant__WEBPACK_IMPORTED_MODULE_12__[\"Swipe\"]).use(vant__WEBPACK_IMPORTED_MODULE_12__[\"SwipeItem\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"sample\",\n data: function data() {\n return {\n bannerHeight: 173,\n title: \"猎芯网-自营样片\",\n meaushow: true,\n bgcolor: \"#fafafa\",\n color: \"#1080d0\",\n defaultcolor: \"#333\",\n swipeThreshold: 4,\n active: 0,\n getPop: false,\n //获得机会弹窗,没机会时展示\n getPops: false,\n quota: '',\n finished: false,\n quotaNum: '',\n loadingYp: false,\n applyCount: 0,\n inviteCount: 0,\n p: 1,\n classId: \"\",\n fxType: 0,\n layer: false,\n type: '',\n sample_class_id: '',\n brand_id: {},\n packing: {},\n encap: {},\n attrs: {},\n curr: false,\n id: [],\n shareUrl: window.location.origin + \"/v3/samplereg?uid=\" + _util_index__WEBPACK_IMPORTED_MODULE_11__[\"default\"].getCookie(\"Yo4teW_uid\")\n };\n },\n computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_7__[\"mapState\"])({\n aggSample: function aggSample(state) {\n return state.sample.aggSample;\n },\n ziYingIndex: function ziYingIndex(state) {\n return state.sample.ziYingIndex;\n },\n aggs: function aggs(state) {\n return state.sample.aggs;\n },\n goodList: function goodList(state) {\n return state.sample.goodList;\n },\n loading: function loading(state) {\n return state.sample.loading;\n },\n getsamplebanner: function getsamplebanner(state) {\n return state.sample.getsamplebanner;\n }\n })),\n watch: {\n loading: function loading(now) {\n this.loadingYp = now;\n },\n classList: function classList(now) {\n /* if (now.length) {\n this.p = 1;\n this.classId = now[0].id;\n this.getGoodList();\n }*/\n }\n },\n beforeCreate: function beforeCreate() {\n if (!/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {\n var url = \"\";\n var paramsStr = '';\n\n for (var k in this.$route.query) {\n paramsStr += k + '=' + this.$route.query[k] + '&';\n }\n\n paramsStr = paramsStr.slice(0, -1);\n\n switch (window.location.hostname) {\n case \"m.liexin.com\":\n window.location.href = paramsStr ? \"http://www.liexin.com/v3/sample?\" + paramsStr : \"http://www.liexin.com/v3/sample\";\n break;\n\n default:\n window.location.href = window.location.origin + (paramsStr ? \"/v3/sample?\" + paramsStr : \"/v3/sample\");\n break;\n }\n }\n },\n created: function created() {\n this.$store.dispatch({\n type: \"aggSample\"\n });\n this.$store.dispatch({\n type: \"ziYingIndex\",\n params: {\n 'sample_class_id/eq': 1\n }\n });\n this.$store.dispatch({\n type: \"getsamplebanner\"\n });\n this.judgeLogin();\n },\n methods: {\n judgeLogin: function judgeLogin() {\n if (getCookie(\"Yo4teW_uid\")) {\n this.getCount();\n } else {\n this.fxType = 3;\n }\n },\n getGoodList: function getGoodList() {\n this.$store.dispatch({\n type: \"getGoodList\",\n data: {\n p: this.p,\n class_id: this.classId\n }\n });\n },\n onClick: function onClick(name) {\n this.sample_class_id = name;\n this.layer = !this.layer;\n this.getAggData(name);\n },\n changeTab: function changeTab(name) {\n this.layer = false;\n this.sample_class_id = name;\n this.$store.dispatch({\n type: \"ziYingIndex\",\n params: {\n 'sample_class_id/eq': name\n }\n });\n },\n onLoad: function onLoad() {\n this.p++;\n this.finished = true;\n },\n getuserf: function getuserf() {\n this.getPop = false;\n },\n getAggData: function getAggData(id) {\n var params = Object.assign({}, {\n 'sample_class_id/eq': id\n });\n this.$store.dispatch(Object(E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__[\"default\"])({\n type: \"aggs\",\n params: params\n }, \"params\", params));\n },\n submit: function submit() {\n var params = Object.assign({}, {\n 'sample_class_id/eq': this.sample_class_id\n }, this.brand_id, this.packing, this.encap, this.attrs, {\n id: this.id.join(',')\n });\n this.$store.dispatch({\n type: \"ziYingIndex\",\n params: params\n });\n this.layer = false;\n },\n canel: function canel() {\n var params = Object.assign({}, {\n reset: true,\n 'sample_class_id/eq': this.sample_class_id\n }, this.brand_id, this.packing, this.encap, this.attrs, {\n id: this.id.join(',')\n });\n this.$store.dispatch({\n type: \"aggs\",\n params: params\n });\n },\n screenFn: function screenFn(id, key, flag) {\n if (key == 'brand_id') {\n //品牌\n this.brand_id = {\n 'brand_id/condition': id\n };\n\n if (flag) {\n this.brand_id = {};\n }\n } else if (key == 'packing') {\n //包装\n this.packing = {\n 'packing/condition': id\n };\n\n if (flag) {\n this.packing = {};\n }\n } else if (key == 'encap') {\n //封装\n this.encap = {\n 'encap/condition': id\n };\n\n if (flag) {\n this.encap = {};\n }\n } else {\n //其他属性\n var attrs = {};\n attrs[key] = [id];\n this.attrs = {\n 'attrs/nested': JSON.stringify(attrs)\n };\n\n if (flag) {\n this.attrs = {};\n }\n }\n\n this.id.push(id);\n var params = Object.assign({}, {\n 'sample_class_id/eq': this.sample_class_id\n }, this.brand_id, this.packing, this.encap, this.attrs, {\n id: this.id.join(',')\n });\n this.$store.dispatch({\n type: \"aggs\",\n params: params\n });\n },\n getCount: function getCount() {\n //获取用户领取机会、邀约人数\n var me = this;\n _api_index__WEBPACK_IMPORTED_MODULE_10__[\"services\"].getUserSampleInfo().then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n me.applyCount = data.data.apply_count || 0;\n me.inviteCount = data.data.invite_count || 0;\n\n if (me.inviteCount == 0) {\n me.fxType = 2;\n } else {\n me.fxType = 1;\n }\n } else if (data.err_code == \"11012\") {\n window.location.href = \"/v3/login?referer=\" + encodeURIComponent(window.location.href);\n }\n }).catch(function (err) {});\n },\n yaoqing: function yaoqing(item) {\n var loginpta = _util_index__WEBPACK_IMPORTED_MODULE_11__[\"default\"].isLogin(); //1强登入态\n\n if (loginpta != 1) {\n window.location.href = \"/v3/login?referer=\" + encodeURIComponent(window.location.href);\n return;\n } else {\n var stock = _util_index__WEBPACK_IMPORTED_MODULE_11__[\"default\"].aggxde(item.stock);\n\n if (this.applyCount != 0) {\n if (stock) {\n if (this.applyCount * 1 < item.quota * 1) {\n this.getPops = true;\n this.quota = item.quota;\n this.quotaNum = item.quota * 1 - this.applyCount * 1;\n } else {\n this.$router.push({\n path: \"/sampleapply\",\n query: {\n id: item.goods_id\n }\n });\n }\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_12__[\"Toast\"])(\"样品库存不足\");\n }\n } else {\n this.getPop = true;\n }\n }\n }\n },\n components: {\n Header: _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n wxShare: _views_common_wxShare_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n \"van-list\": vant__WEBPACK_IMPORTED_MODULE_12__[\"List\"]\n }\n});\n\n//# sourceURL=webpack:///./src/views/sample/sample.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.0.6@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.8.3@vue-loader/lib??vue-loader-options");
/***/ }),
......@@ -44,7 +44,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"section\",\n { staticClass: \"sample\" },\n [\n _c(\"Header\", {\n attrs: {\n title: _vm.title,\n meaushow: _vm.meaushow,\n bgcolor: _vm.bgcolor\n }\n }),\n _c(\"wxShare\", { attrs: { url: _vm.shareUrl } }),\n _c(\n \"div\",\n { staticClass: \"banner\" },\n [\n _c(\n \"van-swipe\",\n {\n attrs: {\n autoplay: 3000,\n \"indicator-color\": \"white\",\n height: _vm.bannerHeight\n }\n },\n _vm._l(_vm.getsamplebanner, function(v, index) {\n return _c(\"van-swipe-item\", { key: index }, [\n _c(\n \"a\",\n {\n attrs: {\n href: v.url,\n target: v.window_open > 0 ? \"_blank\" : \"_self\"\n }\n },\n [_c(\"img\", { attrs: { src: v.images, alt: \"\" } })]\n )\n ])\n }),\n 1\n )\n ],\n 1\n ),\n _c(\n \"div\",\n { staticClass: \"zititle\" },\n [\n _c(\"span\", [_vm._v(\"猎芯自营\")]),\n _c(\"font\", [_vm._v(\"正品现货 1片起订 3小时发货\")])\n ],\n 1\n ),\n _vm.fxType\n ? _c(\"div\", { staticClass: \"fx_text\" }, [\n _vm.fxType == 1\n ? _c(\"div\", { staticClass: \"fx_text_one\" }, [\n _vm._v(\"\\n 我已邀请好友\\n \"),\n _c(\"span\", [_vm._v(_vm._s(_vm.inviteCount))]),\n _vm._v(\" 人,剩余领取次数\\n \"),\n _c(\"span\", [_vm._v(_vm._s(_vm.applyCount))]),\n _vm._v(\" 次\\n \")\n ])\n : _vm.fxType == 2\n ? _c(\"div\", { staticClass: \"fx_text_two\" }, [\n _vm._v(\"\\n 当前可领取次数为:\\n \"),\n _c(\"span\", [_vm._v(_vm._s(_vm.applyCount))]),\n _vm._v(\" 次,分享可额外获得领取机会\\n \")\n ])\n : _c(\"div\", { staticClass: \"fx_text_three\" }, [\n _vm._v(\"分享可额外获得领取机会\")\n ])\n ])\n : _vm._e(),\n _vm.aggSample.length\n ? _c(\n \"div\",\n { staticClass: \"nav\" },\n [\n _c(\n \"van-tabs\",\n {\n attrs: {\n ellipsis: false,\n color: _vm.color,\n \"swipe-threshold\": _vm.swipeThreshold,\n \"title-active-color\": _vm.color,\n \"title-inactive-color\": _vm.defaultcolor\n },\n on: { click: _vm.onClick, change: _vm.changeTab },\n model: {\n value: _vm.active,\n callback: function($$v) {\n _vm.active = $$v\n },\n expression: \"active\"\n }\n },\n _vm._l(_vm.aggSample, function(v, k) {\n return _c(\"van-tab\", {\n key: k,\n attrs: {\n title: v.smaple_class_name,\n name: v.smaple_class_id\n }\n })\n }),\n 1\n ),\n _vm.layer\n ? _c(\"div\", { staticClass: \"sample-search\" }, [\n _c(\n \"ul\",\n [\n _vm._l(_vm.aggs.aggs, function(item, key, index) {\n return [\n _c(\n \"li\",\n [\n key == \"brand_id\"\n ? [\n _c(\"p\", { staticClass: \"tit\" }, [\n _vm._v(\"制造商\")\n ])\n ]\n : key == \"class_id2\"\n ? [\n _c(\"p\", { staticClass: \"tit\" }, [\n _vm._v(\"分类筛选\")\n ])\n ]\n : key == \"encap\"\n ? [\n _c(\"p\", { staticClass: \"tit\" }, [\n _vm._v(\"封装规格\")\n ])\n ]\n : key == \"packing\"\n ? [\n _c(\"p\", { staticClass: \"tit\" }, [\n _vm._v(\"包装筛选\")\n ])\n ]\n : [\n _c(\"p\", { staticClass: \"tit\" }, [\n _vm._v(_vm._s(key))\n ])\n ],\n _c(\n \"dl\",\n { staticClass: \"boxsiz\" },\n [\n _vm._l(item.list, function(\n v,\n keys,\n indexs\n ) {\n return [\n _c(\n \"dd\",\n {\n staticClass: \"boxsiz\",\n class: { curr: v.check },\n on: {\n click: function($event) {\n return _vm.screenFn(\n v.id,\n key,\n v.flag\n )\n }\n }\n },\n [\n _vm._v(\n _vm._s(v.name) +\n \"(\" +\n _vm._s(v.num) +\n \")\"\n )\n ]\n )\n ]\n })\n ],\n 2\n )\n ],\n 2\n )\n ]\n })\n ],\n 2\n ),\n _c(\"div\", { staticClass: \"button\" }, [\n _c(\"a\", { staticClass: \"cancel\" }, [_vm._v(\"重置\")]),\n _c(\n \"a\",\n {\n staticClass: \"confirm\",\n on: {\n click: function($event) {\n return _vm.submit()\n }\n }\n },\n [_vm._v(\"确定\")]\n )\n ])\n ])\n : _vm._e()\n ],\n 1\n )\n : _vm._e(),\n _vm.ziYingIndex.data\n ? _c(\n \"div\",\n { staticClass: \"con\" },\n [\n _c(\n \"van-list\",\n {\n attrs: {\n finished: _vm.finished,\n \"finished-text\": \"我是有底线的噢\",\n \"immediate-check\": false\n },\n on: { load: _vm.onLoad },\n model: {\n value: _vm.loadingYp,\n callback: function($$v) {\n _vm.loadingYp = $$v\n },\n expression: \"loadingYp\"\n }\n },\n _vm._l(_vm.ziYingIndex.data[\"data_list\"], function(v, k) {\n return _c(\"div\", { staticClass: \"con-group clr\" }, [\n _c(\n \"div\",\n {\n directives: [\n {\n name: \"lazy-container\",\n rawName: \"v-lazy-container\",\n value: { selector: \"img\" },\n expression: \"{selector:'img'}\"\n }\n ],\n staticClass: \"fl img-box\"\n },\n [\n _c(\"img\", {\n staticClass: \"lazy img-lazy\",\n attrs: {\n alt: v.goods_name,\n \"data-src\": v.goods_images,\n \"data-error\":\n \"https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png\"\n }\n })\n ]\n ),\n _c(\n \"div\",\n { staticClass: \"fr cb-box van-hairline--bottom\" },\n [\n _c(\"div\", { staticClass: \"title\" }, [\n _vm._v(_vm._s(v.goods_name))\n ]),\n _c(\"p\", [\n _c(\"span\", [_vm._v(\"类别:\")]),\n _vm._v(\n \"\\n \" +\n _vm._s(v.class_id1_name) +\n \"\\n \"\n )\n ]),\n _c(\"p\", [\n _c(\"span\", [_vm._v(\"品牌:\")]),\n _vm._v(\n \"\\n \" +\n _vm._s(v.brand_name) +\n \"\\n \"\n )\n ]),\n _c(\"p\", [\n _c(\"span\", [_vm._v(\"最大可申请数量:\")]),\n _vm._v(\n \"\\n \" +\n _vm._s(v.sample_max_number) +\n \"\\n \"\n )\n ]),\n _c(\"div\", { staticClass: \"btn-wrap clr\" }, [\n _c(\n \"div\",\n {\n directives: [\n { name: \"shareMask\", rawName: \"v-shareMask\" }\n ],\n staticClass: \"btnw fl\"\n },\n [_vm._v(\"送朋友 \")]\n ),\n _c(\n \"div\",\n {\n staticClass: \"btnx fr\",\n on: {\n click: function($event) {\n return _vm.yaoqing(v)\n }\n }\n },\n [_vm._v(\"领取样品 \")]\n )\n ])\n ]\n )\n ])\n }),\n 0\n )\n ],\n 1\n )\n : _vm._e(),\n _c(\n \"div\",\n {\n directives: [{ name: \"shareMask\", rawName: \"v-shareMask\" }],\n staticClass: \"fix-btns\"\n },\n [_vm._v(\"立即分享\")]\n ),\n _vm.getPop\n ? _c(\"div\", { staticClass: \"get-user-pop\" }, [\n _c(\"div\", { staticClass: \"mask\" }),\n _c(\"div\", { staticClass: \"get-user-con\" }, [\n _c(\"h3\", [\n _vm._v(\n \"\\n 您已将所有样片机会用完\\n \"\n ),\n _c(\"i\", {\n staticClass: \"icon iconfont icon-guanbi\",\n on: { click: _vm.getuserf }\n })\n ]),\n _c(\"h2\", [\n _vm._v(\"邀请好友注册可额外获得一次样品申请机会,多邀多得\")\n ]),\n _c(\n \"span\",\n { directives: [{ name: \"shareMask\", rawName: \"v-shareMask\" }] },\n [_vm._v(\"点击邀请\")]\n )\n ])\n ])\n : _vm._e(),\n _vm.getPops\n ? _c(\"div\", { staticClass: \"get-user-pop\" }, [\n _c(\"div\", { staticClass: \"mask\" }),\n _c(\"div\", { staticClass: \"get-user-con\" }, [\n _c(\"h3\", [\n _vm._v(\n \"\\n 该样品需要邀请\" +\n _vm._s(_vm.quota) +\n \"个好友才能申请哦\\n \"\n ),\n _c(\"i\", {\n staticClass: \"icon iconfont icon-guanbi\",\n on: {\n click: function($event) {\n _vm.getPops = false\n }\n }\n })\n ]),\n _c(\"h2\", [\n _vm._v(\n \"再邀请\" +\n _vm._s(_vm.quotaNum) +\n \"个好友即可申请该样片,多邀多得\"\n )\n ]),\n _c(\n \"span\",\n { directives: [{ name: \"shareMask\", rawName: \"v-shareMask\" }] },\n [_vm._v(\"点击邀请\")]\n )\n ])\n ])\n : _vm._e()\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./src/views/sample/sample.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%22e2764c3a-vue-loader-template%22%7D!./node_modules/_vue-loader@15.8.3@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.8.3@vue-loader/lib??vue-loader-options");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"section\",\n { staticClass: \"sample\" },\n [\n _c(\"Header\", {\n attrs: {\n title: _vm.title,\n meaushow: _vm.meaushow,\n bgcolor: _vm.bgcolor\n }\n }),\n _c(\"wxShare\", { attrs: { url: _vm.shareUrl } }),\n _c(\n \"div\",\n { staticClass: \"banner\" },\n [\n _c(\n \"van-swipe\",\n {\n attrs: {\n autoplay: 3000,\n \"indicator-color\": \"white\",\n height: _vm.bannerHeight\n }\n },\n _vm._l(_vm.getsamplebanner, function(v, index) {\n return _c(\"van-swipe-item\", { key: index }, [\n _c(\n \"a\",\n {\n attrs: {\n href: v.url,\n target: v.window_open > 0 ? \"_blank\" : \"_self\"\n }\n },\n [_c(\"img\", { attrs: { src: v.images, alt: \"\" } })]\n )\n ])\n }),\n 1\n )\n ],\n 1\n ),\n _c(\n \"div\",\n { staticClass: \"zititle\" },\n [\n _c(\"span\", [_vm._v(\"猎芯自营\")]),\n _c(\"font\", [_vm._v(\"正品现货 1片起订 3小时发货\")])\n ],\n 1\n ),\n _vm.fxType\n ? _c(\"div\", { staticClass: \"fx_text\" }, [\n _vm.fxType == 1\n ? _c(\"div\", { staticClass: \"fx_text_one\" }, [\n _vm._v(\"\\n 我已邀请好友\\n \"),\n _c(\"span\", [_vm._v(_vm._s(_vm.inviteCount))]),\n _vm._v(\" 人,剩余领取次数\\n \"),\n _c(\"span\", [_vm._v(_vm._s(_vm.applyCount))]),\n _vm._v(\" 次\\n \")\n ])\n : _vm.fxType == 2\n ? _c(\"div\", { staticClass: \"fx_text_two\" }, [\n _vm._v(\"\\n 当前可领取次数为:\\n \"),\n _c(\"span\", [_vm._v(_vm._s(_vm.applyCount))]),\n _vm._v(\" 次,分享可额外获得领取机会\\n \")\n ])\n : _c(\"div\", { staticClass: \"fx_text_three\" }, [\n _vm._v(\"分享可额外获得领取机会\")\n ])\n ])\n : _vm._e(),\n _vm.aggSample.length\n ? _c(\n \"div\",\n { staticClass: \"nav\" },\n [\n _c(\n \"van-tabs\",\n {\n attrs: {\n ellipsis: false,\n color: _vm.color,\n \"swipe-threshold\": _vm.swipeThreshold,\n \"title-active-color\": _vm.color,\n \"title-inactive-color\": _vm.defaultcolor\n },\n on: { click: _vm.onClick, change: _vm.changeTab },\n model: {\n value: _vm.active,\n callback: function($$v) {\n _vm.active = $$v\n },\n expression: \"active\"\n }\n },\n _vm._l(_vm.aggSample, function(v, k) {\n return _c(\"van-tab\", {\n key: k,\n attrs: {\n title: v.smaple_class_name,\n name: v.smaple_class_id\n }\n })\n }),\n 1\n ),\n _vm.layer\n ? _c(\"div\", { staticClass: \"sample-search\" }, [\n _c(\n \"ul\",\n [\n _vm._l(_vm.aggs.aggs, function(item, key, index) {\n return [\n _c(\n \"li\",\n [\n key == \"brand_id\"\n ? [\n _c(\"p\", { staticClass: \"tit\" }, [\n _vm._v(\"制造商\")\n ])\n ]\n : key == \"class_id2\"\n ? [\n _c(\"p\", { staticClass: \"tit\" }, [\n _vm._v(\"分类筛选\")\n ])\n ]\n : key == \"encap\"\n ? [\n _c(\"p\", { staticClass: \"tit\" }, [\n _vm._v(\"封装规格\")\n ])\n ]\n : key == \"packing\"\n ? [\n _c(\"p\", { staticClass: \"tit\" }, [\n _vm._v(\"包装筛选\")\n ])\n ]\n : [\n _c(\"p\", { staticClass: \"tit\" }, [\n _vm._v(_vm._s(key))\n ])\n ],\n _c(\n \"dl\",\n { staticClass: \"boxsiz\" },\n [\n _vm._l(item.list, function(\n v,\n keys,\n indexs\n ) {\n return [\n _c(\n \"dd\",\n {\n staticClass: \"boxsiz\",\n class: { curr: v.check },\n on: {\n click: function($event) {\n return _vm.screenFn(\n v.id,\n key,\n v.flag\n )\n }\n }\n },\n [\n _vm._v(\n _vm._s(v.name) +\n \"(\" +\n _vm._s(v.num) +\n \")\"\n )\n ]\n )\n ]\n })\n ],\n 2\n )\n ],\n 2\n )\n ]\n })\n ],\n 2\n ),\n _c(\"div\", { staticClass: \"button\" }, [\n _c(\n \"a\",\n {\n staticClass: \"cancel\",\n on: {\n click: function($event) {\n return _vm.canel()\n }\n }\n },\n [_vm._v(\"重置\")]\n ),\n _c(\n \"a\",\n {\n staticClass: \"confirm\",\n on: {\n click: function($event) {\n return _vm.submit()\n }\n }\n },\n [_vm._v(\"确定\")]\n )\n ])\n ])\n : _vm._e()\n ],\n 1\n )\n : _vm._e(),\n _vm.ziYingIndex.data\n ? _c(\n \"div\",\n { staticClass: \"con\" },\n [\n _c(\n \"van-list\",\n {\n attrs: {\n finished: _vm.finished,\n \"finished-text\": \"我是有底线的噢\",\n \"immediate-check\": false\n },\n on: { load: _vm.onLoad },\n model: {\n value: _vm.loadingYp,\n callback: function($$v) {\n _vm.loadingYp = $$v\n },\n expression: \"loadingYp\"\n }\n },\n _vm._l(_vm.ziYingIndex.data[\"data_list\"], function(v, k) {\n return _c(\"div\", { staticClass: \"con-group clr\" }, [\n _c(\n \"div\",\n {\n directives: [\n {\n name: \"lazy-container\",\n rawName: \"v-lazy-container\",\n value: { selector: \"img\" },\n expression: \"{selector:'img'}\"\n }\n ],\n staticClass: \"fl img-box\"\n },\n [\n _c(\"img\", {\n staticClass: \"lazy img-lazy\",\n attrs: {\n alt: v.goods_name,\n \"data-src\": v.goods_images,\n \"data-error\":\n \"https://www.ichunt.com/v3/dist/res/m/images/materiel_img_3.png\"\n }\n })\n ]\n ),\n _c(\n \"div\",\n { staticClass: \"fr cb-box van-hairline--bottom\" },\n [\n _c(\"div\", { staticClass: \"title\" }, [\n _vm._v(_vm._s(v.goods_name))\n ]),\n _c(\"p\", [\n _c(\"span\", [_vm._v(\"类别:\")]),\n _vm._v(\n \"\\n \" +\n _vm._s(v.class_id1_name) +\n \"\\n \"\n )\n ]),\n _c(\"p\", [\n _c(\"span\", [_vm._v(\"品牌:\")]),\n _vm._v(\n \"\\n \" +\n _vm._s(v.brand_name) +\n \"\\n \"\n )\n ]),\n _c(\"p\", [\n _c(\"span\", [_vm._v(\"最大可申请数量:\")]),\n _vm._v(\n \"\\n \" +\n _vm._s(v.sample_max_number) +\n \"\\n \"\n )\n ]),\n _c(\"div\", { staticClass: \"btn-wrap clr\" }, [\n _c(\n \"div\",\n {\n directives: [\n { name: \"shareMask\", rawName: \"v-shareMask\" }\n ],\n staticClass: \"btnw fl\"\n },\n [_vm._v(\"送朋友\")]\n ),\n _c(\n \"div\",\n {\n staticClass: \"btnx fr\",\n on: {\n click: function($event) {\n return _vm.yaoqing(v)\n }\n }\n },\n [_vm._v(\"领取样品\")]\n )\n ])\n ]\n )\n ])\n }),\n 0\n )\n ],\n 1\n )\n : _vm._e(),\n _c(\n \"div\",\n {\n directives: [{ name: \"shareMask\", rawName: \"v-shareMask\" }],\n staticClass: \"fix-btns\"\n },\n [_vm._v(\"立即分享\")]\n ),\n _vm.getPop\n ? _c(\"div\", { staticClass: \"get-user-pop\" }, [\n _c(\"div\", { staticClass: \"mask\" }),\n _c(\"div\", { staticClass: \"get-user-con\" }, [\n _c(\"h3\", [\n _vm._v(\n \"\\n 您已将所有样片机会用完\\n \"\n ),\n _c(\"i\", {\n staticClass: \"icon iconfont icon-guanbi\",\n on: { click: _vm.getuserf }\n })\n ]),\n _c(\"h2\", [\n _vm._v(\"邀请好友注册可额外获得一次样品申请机会,多邀多得\")\n ]),\n _c(\n \"span\",\n { directives: [{ name: \"shareMask\", rawName: \"v-shareMask\" }] },\n [_vm._v(\"点击邀请\")]\n )\n ])\n ])\n : _vm._e(),\n _vm.getPops\n ? _c(\"div\", { staticClass: \"get-user-pop\" }, [\n _c(\"div\", { staticClass: \"mask\" }),\n _c(\"div\", { staticClass: \"get-user-con\" }, [\n _c(\"h3\", [\n _vm._v(\n \"\\n 该样品需要邀请\" +\n _vm._s(_vm.quota) +\n \"个好友才能申请哦\\n \"\n ),\n _c(\"i\", {\n staticClass: \"icon iconfont icon-guanbi\",\n on: {\n click: function($event) {\n _vm.getPops = false\n }\n }\n })\n ]),\n _c(\"h2\", [\n _vm._v(\n \"再邀请\" +\n _vm._s(_vm.quotaNum) +\n \"个好友即可申请该样片,多邀多得\"\n )\n ]),\n _c(\n \"span\",\n { directives: [{ name: \"shareMask\", rawName: \"v-shareMask\" }] },\n [_vm._v(\"点击邀请\")]\n )\n ])\n ])\n : _vm._e()\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./src/views/sample/sample.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%22e2764c3a-vue-loader-template%22%7D!./node_modules/_vue-loader@15.8.3@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.8.3@vue-loader/lib??vue-loader-options");
/***/ }),
......
......@@ -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 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 },\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': 200,\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 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': 200,\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