Authored by htoooth

Merge branch 'feature/ufo' of http://git.yoho.cn/fe/yoho-app-web into feature/ufo

@@ -36,19 +36,19 @@ const request = async({url, method, reqParams, context}) => { @@ -36,19 +36,19 @@ const request = async({url, method, reqParams, context}) => {
36 }; 36 };
37 37
38 if (apiInfo.service) { 38 if (apiInfo.service) {
39 - return await serviceApi.get(apiInfo.api, params, { 39 + return await serviceApi.get(`${apiInfo.api}${apiInfo.path}`, params, {
40 cache: cache, 40 cache: cache,
41 code: 200, 41 code: 200,
42 headers 42 headers
43 }); 43 });
44 } else if (apiInfo.ufo) { 44 } else if (apiInfo.ufo) {
45 - return await ufoAPI[method]('', params, { 45 + return await ufoAPI[method](`${apiInfo.path}`, params, {
46 cache: cache, 46 cache: cache,
47 code: 200, 47 code: 200,
48 headers 48 headers
49 }); 49 });
50 } else { 50 } else {
51 - return await yohoApi[method]('', params, { 51 + return await yohoApi[method](`${apiInfo.path}`, params, {
52 code: 200, 52 code: 200,
53 cache: cache, 53 cache: cache,
54 headers 54 headers
@@ -104,7 +104,8 @@ export default { @@ -104,7 +104,8 @@ export default {
104 } 104 }
105 ], 105 ],
106 scrollOptions: { 106 scrollOptions: {
107 - directionLockThreshold: 0 107 + directionLockThreshold: 0,
  108 + stopPropagation: true
108 }, 109 },
109 slideOptions: { 110 slideOptions: {
110 listenScroll: true, 111 listenScroll: true,
@@ -21,4 +21,13 @@ export default { @@ -21,4 +21,13 @@ export default {
21 [Types.POST_NOSALE_SUCCESS](state) { 21 [Types.POST_NOSALE_SUCCESS](state) {
22 state.fetchingNoSale = false; 22 state.fetchingNoSale = false;
23 }, 23 },
  24 + [Types.POST_CHANGEPRICE_REQUEST](state) {
  25 + state.fetchingNoSale = true;
  26 + },
  27 + [Types.POST_CHANGEPRICE_FAILD](state) {
  28 + state.fetchingNoSale = false;
  29 + },
  30 + [Types.POST_NOSALE_SUCCESS](state) {
  31 + state.fetchingNoSale = false;
  32 + },
24 }; 33 };
@@ -18,7 +18,7 @@ export default function() { @@ -18,7 +18,7 @@ export default function() {
18 pageVisible: false, 18 pageVisible: false,
19 touchStatus: '', 19 touchStatus: '',
20 scrollTime: 0, 20 scrollTime: 0,
21 - direction: 'forword' 21 + direction: 'forword',
22 }, 22 },
23 mutations: { 23 mutations: {
24 [Types.SET_ENV]() { 24 [Types.SET_ENV]() {
  1 +export default err => {
  2 +
  3 +}
@@ -48,6 +48,7 @@ module.exports = async(req, res, next) => { @@ -48,6 +48,7 @@ module.exports = async(req, res, next) => {
48 } else if (apiInfo.ufo) { 48 } else if (apiInfo.ufo) {
49 result = await apiCtx[method]({ 49 result = await apiCtx[method]({
50 api: ufoAPI, 50 api: ufoAPI,
  51 + url: apiInfo.path,
51 data: params, 52 data: params,
52 param: { 53 param: {
53 code: 200, 54 code: 200,
@@ -57,6 +58,7 @@ module.exports = async(req, res, next) => { @@ -57,6 +58,7 @@ module.exports = async(req, res, next) => {
57 } else { 58 } else {
58 result = await apiCtx[method]({ 59 result = await apiCtx[method]({
59 data: params, 60 data: params,
  61 + url: apiInfo.path,
60 param: { 62 param: {
61 code: 200, 63 code: 200,
62 cache: cache 64 cache: cache
@@ -56,12 +56,11 @@ const handlerError = (err = {}, req, res, next) => { @@ -56,12 +56,11 @@ const handlerError = (err = {}, req, res, next) => {
56 } else if (err.code === 500) { 56 } else if (err.code === 500) {
57 return res.redirect('/error/500'); 57 return res.redirect('/error/500');
58 } 58 }
59 - console.log(err)  
60 return next(err); 59 return next(err);
61 }; 60 };
62 61
63 const getCacheKey = (urlPath, cackeKey = '') => { 62 const getCacheKey = (urlPath, cackeKey = '') => {
64 - const urlObj = url.parse(urlPath); 63 + const urlObj = url.parse(urlPath);
65 64
66 return md5(cackeKey 65 return md5(cackeKey
67 .replace('$url', urlObj.pathname) 66 .replace('$url', urlObj.pathname)