Authored by htoooth

fix

... ... @@ -40,7 +40,7 @@ const request = async({url, method, reqParams, context}) => {
cache: cache,
code: 200,
headers
});
}).catch(console.log);
} else if (apiInfo.ufo) {
return await ufoAPI[method](`${apiInfo.path || ''}`, params, {
cache: cache,
... ... @@ -52,7 +52,7 @@ const request = async({url, method, reqParams, context}) => {
code: 200,
cache: cache,
headers
});
}).catch(console.log);
}
};
... ...
<template>
<div class="filter-item">
<template v-for="(item, index) in list">
<button @click="">{{item.filter_name}}</button>
<button @click="onClick(item)">{{item.filter_name}}</button>
</template>
</div>
</template>
... ... @@ -15,11 +15,16 @@ export default {
default() {
return [];
}
},
value: {
type: String,
default() {
return '';
}
}
},
data() {
return {
};
},
methods: {
... ...
... ... @@ -44,14 +44,14 @@ export default {
}
},
async fetchUfoList({commit}, {limit, page}) {
async fetchUfoList({commit}) {
commit(Types.FETCH_YOHO_COUPON_REQUEST);
const result = await this.$api.get('/api/coupon/ufo/list', {limit: 20, page: 1});
const result = await this.$api.get('/api/coupon/ufo/list');
if (result && result.code === 200) {
commit(Types.FETCH_UFO_COUPON_SUCCESS, {
list: result.data.couponList.map(_handleCoupon),
list: []
});
} else {
commit(Types.FETCH_YOHO_COUPON_FAILED);
... ...
... ... @@ -16,7 +16,7 @@ export default {
[Types.FETCH_YOHO_COUPON_NUM_SUCCESS](state, data) {
state.num = data;
},
[Types.FETCH_UFO_COUPON_SUCCESS](state, {list}) {
[Types.FETCH_UFO_COUPON_SUCCESS](state, {list = []}) {
state.fetching = false;
state.ufoList = list;
},
... ...