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) {
......
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