Authored by htoooth

fix

@@ -40,7 +40,7 @@ const request = async({url, method, reqParams, context}) => { @@ -40,7 +40,7 @@ const request = async({url, method, reqParams, context}) => {
40 cache: cache, 40 cache: cache,
41 code: 200, 41 code: 200,
42 headers 42 headers
43 - }); 43 + }).catch(console.log);
44 } else if (apiInfo.ufo) { 44 } else if (apiInfo.ufo) {
45 return await ufoAPI[method](`${apiInfo.path || ''}`, params, { 45 return await ufoAPI[method](`${apiInfo.path || ''}`, params, {
46 cache: cache, 46 cache: cache,
@@ -52,7 +52,7 @@ const request = async({url, method, reqParams, context}) => { @@ -52,7 +52,7 @@ const request = async({url, method, reqParams, context}) => {
52 code: 200, 52 code: 200,
53 cache: cache, 53 cache: cache,
54 headers 54 headers
55 - }); 55 + }).catch(console.log);
56 } 56 }
57 }; 57 };
58 58
1 <template> 1 <template>
2 <div class="filter-item"> 2 <div class="filter-item">
3 <template v-for="(item, index) in list"> 3 <template v-for="(item, index) in list">
4 - <button @click="">{{item.filter_name}}</button> 4 + <button @click="onClick(item)">{{item.filter_name}}</button>
5 </template> 5 </template>
6 </div> 6 </div>
7 </template> 7 </template>
@@ -15,11 +15,16 @@ export default { @@ -15,11 +15,16 @@ export default {
15 default() { 15 default() {
16 return []; 16 return [];
17 } 17 }
  18 + },
  19 + value: {
  20 + type: String,
  21 + default() {
  22 + return '';
  23 + }
18 } 24 }
19 }, 25 },
20 data() { 26 data() {
21 return { 27 return {
22 -  
23 }; 28 };
24 }, 29 },
25 methods: { 30 methods: {
@@ -44,14 +44,14 @@ export default { @@ -44,14 +44,14 @@ export default {
44 } 44 }
45 }, 45 },
46 46
47 - async fetchUfoList({commit}, {limit, page}) { 47 + async fetchUfoList({commit}) {
48 commit(Types.FETCH_YOHO_COUPON_REQUEST); 48 commit(Types.FETCH_YOHO_COUPON_REQUEST);
49 49
50 - const result = await this.$api.get('/api/coupon/ufo/list', {limit: 20, page: 1}); 50 + const result = await this.$api.get('/api/coupon/ufo/list');
51 51
52 if (result && result.code === 200) { 52 if (result && result.code === 200) {
53 commit(Types.FETCH_UFO_COUPON_SUCCESS, { 53 commit(Types.FETCH_UFO_COUPON_SUCCESS, {
54 - list: result.data.couponList.map(_handleCoupon), 54 + list: []
55 }); 55 });
56 } else { 56 } else {
57 commit(Types.FETCH_YOHO_COUPON_FAILED); 57 commit(Types.FETCH_YOHO_COUPON_FAILED);
@@ -16,7 +16,7 @@ export default { @@ -16,7 +16,7 @@ export default {
16 [Types.FETCH_YOHO_COUPON_NUM_SUCCESS](state, data) { 16 [Types.FETCH_YOHO_COUPON_NUM_SUCCESS](state, data) {
17 state.num = data; 17 state.num = data;
18 }, 18 },
19 - [Types.FETCH_UFO_COUPON_SUCCESS](state, {list}) { 19 + [Types.FETCH_UFO_COUPON_SUCCESS](state, {list = []}) {
20 state.fetching = false; 20 state.fetching = false;
21 state.ufoList = list; 21 state.ufoList = list;
22 }, 22 },