Authored by 李奇

fix part of eslint errors

@@ -5,7 +5,9 @@ @@ -5,7 +5,9 @@
5 }, 5 },
6 "rules": { 6 "rules": {
7 "camelcase": "off", 7 "camelcase": "off",
8 - "new-cap": "off" 8 + "new-cap": "off",
  9 + "radix": "off",
  10 + "array-callback-return": "off"
9 }, 11 },
10 "globals": { 12 "globals": {
11 "App": true, 13 "App": true,
@@ -85,7 +85,7 @@ Component({ @@ -85,7 +85,7 @@ Component({
85 this.setData({ 85 this.setData({
86 curGender: gender, 86 curGender: gender,
87 showSubGender: false, 87 showSubGender: false,
88 - subFilterText: gender === '' ? '全部' : (gender === '1,3' ? '男生' : '女生') 88 + subFilterText: gender === '' ? '全部' : (gender === '1,3' ? '男生' : '女生') // eslint-disable-line
89 }); 89 });
90 } 90 }
91 91
@@ -166,11 +166,11 @@ Page({ @@ -166,11 +166,11 @@ Page({
166 payment_type: 1, // 支付方式,1 在线支付 2 货到付款 166 payment_type: 1, // 支付方式,1 在线支付 2 货到付款
167 }).then(res => { 167 }).then(res => {
168 if (res.code === 200) { 168 if (res.code === 200) {
169 - let data = res.data || {}; 169 + let comp = res.data || {};
170 170
171 this.setData({ 171 this.setData({
172 - promotionList: data.promotion_formula_list,  
173 - paymentAmount: data.last_order_amount 172 + promotionList: comp.promotion_formula_list,
  173 + paymentAmount: comp.last_order_amount
174 174
175 }); 175 });
176 } 176 }
@@ -207,7 +207,7 @@ Page({ @@ -207,7 +207,7 @@ Page({
207 return; 207 return;
208 } 208 }
209 209
210 - addressList.map((item, index) => { 210 + addressList.map(item => {
211 item.is_default = addr.address_id === item.address_id ? 'Y' : 'N'; 211 item.is_default = addr.address_id === item.address_id ? 'Y' : 'N';
212 }); 212 });
213 213
@@ -40,7 +40,7 @@ Page({ @@ -40,7 +40,7 @@ Page({
40 }, 40 },
41 copyExpressNo: function() { 41 copyExpressNo: function() {
42 wx.setClipboardData({data: this.data.orderID}) 42 wx.setClipboardData({data: this.data.orderID})
43 - .then(res => { 43 + .then(() => {
44 wx.showModal({ 44 wx.showModal({
45 content: '已复制到剪贴板!', 45 content: '已复制到剪贴板!',
46 showCancel: false, 46 showCancel: false,
@@ -111,12 +111,11 @@ export default { @@ -111,12 +111,11 @@ export default {
111 111
112 orderModel.getRefundSeason().then(res => { 112 orderModel.getRefundSeason().then(res => {
113 if (res.code === 200) { 113 if (res.code === 200) {
114 - return callback && callback(res.data);  
115 -  
116 wx.setStorage({ 114 wx.setStorage({
117 key: REASON_CACHE_KEY, 115 key: REASON_CACHE_KEY,
118 data: JSON.stringify(res.data) 116 data: JSON.stringify(res.data)
119 }); 117 });
  118 + return callback && callback(res.data);
120 } 119 }
121 }); 120 });
122 }, 121 },
@@ -16,8 +16,7 @@ let {windowHeight} = app.getSystemInfo(); @@ -16,8 +16,7 @@ let {windowHeight} = app.getSystemInfo();
16 16
17 let yas; 17 let yas;
18 18
19 -Page({  
20 - ...Actionsheet, 19 +Page(Object.assign({
21 data: { 20 data: {
22 shopId: 0, 21 shopId: 0,
23 productSkn: 0, 22 productSkn: 0,
@@ -299,7 +298,7 @@ Page({ @@ -299,7 +298,7 @@ Page({
299 pickData.view.goodPrice = res.data.format_sales_price; 298 pickData.view.goodPrice = res.data.format_sales_price;
300 299
301 let default_image = formatImage.image(ImgUrls.length > 0 ? ImgUrls[0].image_url : '', 750, 1000); 300 let default_image = formatImage.image(ImgUrls.length > 0 ? ImgUrls[0].image_url : '', 750, 1000);
302 - let product_qrCode = config.domains.api + '/wechat/miniapp/img-check.jpg?param=' + res.data.product_skn; 301 + let product_qrCode = config.domains.api + '/wechat/miniapp/img-check.jpg?param=' + res.data.product_skn; // eslint-disable-line
303 302
304 let snapData = { 303 let snapData = {
305 product_name: res.data.product_name, 304 product_name: res.data.product_name,
@@ -334,8 +333,8 @@ Page({ @@ -334,8 +333,8 @@ Page({
334 // bundle_type: res.data.bundle_type, 333 // bundle_type: res.data.bundle_type,
335 // store_show_status: res.data.store_show_status, 334 // store_show_status: res.data.store_show_status,
336 // attribute: res.data.attribute, 335 // attribute: res.data.attribute,
337 - productOnlyProvideByYohoAPP: res.data.is_secKill === 'Y' || res.data.is_advance === 'Y' || res.data.attribute === 3 || res.data.attribute === 4 || res.data.isLimitBuy || res.data.is_deposit_advance === 'Y',  
338 - productOnlyProvideByYohoStore: res.data.store_show_status === 3 || res.data.store_show_status === 4, 336 + productOnlyProvideByYohoAPP: res.data.is_secKill === 'Y' || res.data.is_advance === 'Y' || res.data.attribute === 3 || res.data.attribute === 4 || res.data.isLimitBuy || res.data.is_deposit_advance === 'Y', // eslint-disable-line
  337 + productOnlyProvideByYohoStore: res.data.store_show_status === 3 || res.data.store_show_status === 4, // eslint-disable-line
339 productNotForSale: res.data.attribute === 2, 338 productNotForSale: res.data.attribute === 2,
340 showBottomTipView: true 339 showBottomTipView: true
341 }); 340 });
@@ -384,7 +383,7 @@ Page({ @@ -384,7 +383,7 @@ Page({
384 }); 383 });
385 }, 384 },
386 buyImmediate: function() { 385 buyImmediate: function() {
387 - if (this.data.productOnlyProvideByYohoAPP || this.data.productOnlyProvideByYohoStore || this.data.productNotForSale) { 386 + if (this.data.productOnlyProvideByYohoAPP || this.data.productOnlyProvideByYohoStore || this.data.productNotForSale) { // eslint-disable-line
388 return wx.showToast({ 387 return wx.showToast({
389 title: '该商品暂时不支持当前小程序购买,请到Yoho!Buy有货查看', 388 title: '该商品暂时不支持当前小程序购买,请到Yoho!Buy有货查看',
390 icon: 'none', 389 icon: 'none',
@@ -466,7 +465,7 @@ Page({ @@ -466,7 +465,7 @@ Page({
466 pickData.view.sizeList[parseInt(event.currentTarget.id)] = tempItem; 465 pickData.view.sizeList[parseInt(event.currentTarget.id)] = tempItem;
467 466
468 // 设置数量加减按钮启用状态 467 // 设置数量加减按钮启用状态
469 - pickData.view.plusButtonEnable = (!pickData.view.buy_limit_number || pickData.view.buy_limit_number > 1) && tempItem.storage_number > 1; 468 + pickData.view.plusButtonEnable = (!pickData.view.buy_limit_number || pickData.view.buy_limit_number > 1) && tempItem.storage_number > 1; // eslint-disable-line
470 469
471 pickData.view.minusButtonEnable = false; 470 pickData.view.minusButtonEnable = false;
472 pickData.view.buyButtonEnable = true; 471 pickData.view.buyButtonEnable = true;
@@ -597,7 +596,7 @@ Page({ @@ -597,7 +596,7 @@ Page({
597 596
598 minReachedLimitAction: function(n) { 597 minReachedLimitAction: function(n) {
599 return wx.showToast({ 598 return wx.showToast({
600 - title: n + '件' + '起售', 599 + title: n + '件起售',
601 icon: 'none', 600 icon: 'none',
602 duration: 1000 601 duration: 1000
603 }); 602 });
@@ -637,4 +636,4 @@ Page({ @@ -637,4 +636,4 @@ Page({
637 PRD_ID: this.data.selectedProductId 636 PRD_ID: this.data.selectedProductId
638 }); 637 });
639 } 638 }
640 -}); 639 +}, Actionsheet));
@@ -10,8 +10,7 @@ let { windowHeight } = app.getSystemInfo(); @@ -10,8 +10,7 @@ let { windowHeight } = app.getSystemInfo();
10 10
11 let yas; 11 let yas;
12 12
13 -Page({  
14 - ...Actionsheet, // eslint-disable-line 13 +Page(Object.assign({
15 data: { 14 data: {
16 query: '', 15 query: '',
17 order: '', 16 order: '',
@@ -185,7 +184,7 @@ Page({ @@ -185,7 +184,7 @@ Page({
185 }); 184 });
186 shopModel.shopInfo(params) 185 shopModel.shopInfo(params)
187 .then(data => { 186 .then(data => {
188 - if (!data || !data.code || data.code != 200) { 187 + if (!data || !data.code || data.code !== 200) {
189 this.setData({ 188 this.setData({
190 info: { 189 info: {
191 isLoading: false, 190 isLoading: false,
@@ -204,17 +203,17 @@ Page({ @@ -204,17 +203,17 @@ Page({
204 } 203 }
205 204
206 let shopInfo = data.data; 205 let shopInfo = data.data;
207 - let logoUrl = shopInfo.shop_logo.replace(/{width}/g, 100).replace(/{height}/g, 100).replace('{mode}', 2); 206 + let logoUrl = shopInfo.shop_logo.replace(/{width}/g, 100).replace(/{height}/g, 100).replace('{mode}', 2); // eslint-disable-line
208 207
209 shopInfo.shop_logo = logoUrl; 208 shopInfo.shop_logo = logoUrl;
210 209
211 - var shareData = this.data.snapshootShareData; 210 + let shareData = this.data.snapshootShareData;
212 211
213 shareData.shop_logo = logoUrl; 212 shareData.shop_logo = logoUrl;
214 shareData.shop_intro_simple = shopInfo.shop_intro_simple; 213 shareData.shop_intro_simple = shopInfo.shop_intro_simple;
215 shareData.shop_id = shopInfo.shops_id; 214 shareData.shop_id = shopInfo.shops_id;
216 shareData.shop_name = shopInfo.shop_name; 215 shareData.shop_name = shopInfo.shop_name;
217 - shareData.shop_qrCode = config.domains.api + '/wechat/miniapp/img-check.jpg?miniQrType=3&param=' + shopInfo.shops_id; 216 + shareData.shop_qrCode = config.domains.api + '/wechat/miniapp/img-check.jpg?miniQrType=3&param=' + shopInfo.shops_id; // eslint-disable-line
218 217
219 this.setData({ 218 this.setData({
220 info: { 219 info: {
@@ -246,7 +245,7 @@ Page({ @@ -246,7 +245,7 @@ Page({
246 245
247 if (data && data.length > 0) { 246 if (data && data.length > 0) {
248 let resource = data[0]; 247 let resource = data[0];
249 - var shareData = this.data.snapshootShareData; 248 + let shareData = this.data.snapshootShareData;
250 249
251 shareData.bannerUrl = resource.pic; 250 shareData.bannerUrl = resource.pic;
252 this.setData({ 251 this.setData({
@@ -307,4 +306,4 @@ Page({ @@ -307,4 +306,4 @@ Page({
307 }); 306 });
308 } 307 }
309 } 308 }
310 -}); 309 +}, Actionsheet));
@@ -93,6 +93,8 @@ global.router = { @@ -93,6 +93,8 @@ global.router = {
93 case OPEN_BY_TYPE.GO_DETAIL: 93 case OPEN_BY_TYPE.GO_DETAIL:
94 this.go('productDetail', {productSkn: openBy.params.product_skn}); 94 this.go('productDetail', {productSkn: openBy.params.product_skn});
95 break; 95 break;
  96 + default:
  97 + break;
96 } 98 }
97 } 99 }
98 } 100 }