Authored by 李奇

fix part of eslint errors

... ... @@ -5,7 +5,9 @@
},
"rules": {
"camelcase": "off",
"new-cap": "off"
"new-cap": "off",
"radix": "off",
"array-callback-return": "off"
},
"globals": {
"App": true,
... ...
... ... @@ -85,7 +85,7 @@ Component({
this.setData({
curGender: gender,
showSubGender: false,
subFilterText: gender === '' ? '全部' : (gender === '1,3' ? '男生' : '女生')
subFilterText: gender === '' ? '全部' : (gender === '1,3' ? '男生' : '女生') // eslint-disable-line
});
}
... ...
... ... @@ -166,11 +166,11 @@ Page({
payment_type: 1, // 支付方式,1 在线支付 2 货到付款
}).then(res => {
if (res.code === 200) {
let data = res.data || {};
let comp = res.data || {};
this.setData({
promotionList: data.promotion_formula_list,
paymentAmount: data.last_order_amount
promotionList: comp.promotion_formula_list,
paymentAmount: comp.last_order_amount
});
}
... ...
... ... @@ -207,7 +207,7 @@ Page({
return;
}
addressList.map((item, index) => {
addressList.map(item => {
item.is_default = addr.address_id === item.address_id ? 'Y' : 'N';
});
... ...
... ... @@ -40,7 +40,7 @@ Page({
},
copyExpressNo: function() {
wx.setClipboardData({data: this.data.orderID})
.then(res => {
.then(() => {
wx.showModal({
content: '已复制到剪贴板!',
showCancel: false,
... ...
... ... @@ -111,12 +111,11 @@ export default {
orderModel.getRefundSeason().then(res => {
if (res.code === 200) {
return callback && callback(res.data);
wx.setStorage({
key: REASON_CACHE_KEY,
data: JSON.stringify(res.data)
});
return callback && callback(res.data);
}
});
},
... ...
... ... @@ -16,8 +16,7 @@ let {windowHeight} = app.getSystemInfo();
let yas;
Page({
...Actionsheet,
Page(Object.assign({
data: {
shopId: 0,
productSkn: 0,
... ... @@ -299,7 +298,7 @@ Page({
pickData.view.goodPrice = res.data.format_sales_price;
let default_image = formatImage.image(ImgUrls.length > 0 ? ImgUrls[0].image_url : '', 750, 1000);
let product_qrCode = config.domains.api + '/wechat/miniapp/img-check.jpg?param=' + res.data.product_skn;
let product_qrCode = config.domains.api + '/wechat/miniapp/img-check.jpg?param=' + res.data.product_skn; // eslint-disable-line
let snapData = {
product_name: res.data.product_name,
... ... @@ -334,8 +333,8 @@ Page({
// bundle_type: res.data.bundle_type,
// store_show_status: res.data.store_show_status,
// attribute: res.data.attribute,
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',
productOnlyProvideByYohoStore: res.data.store_show_status === 3 || res.data.store_show_status === 4,
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
productOnlyProvideByYohoStore: res.data.store_show_status === 3 || res.data.store_show_status === 4, // eslint-disable-line
productNotForSale: res.data.attribute === 2,
showBottomTipView: true
});
... ... @@ -384,7 +383,7 @@ Page({
});
},
buyImmediate: function() {
if (this.data.productOnlyProvideByYohoAPP || this.data.productOnlyProvideByYohoStore || this.data.productNotForSale) {
if (this.data.productOnlyProvideByYohoAPP || this.data.productOnlyProvideByYohoStore || this.data.productNotForSale) { // eslint-disable-line
return wx.showToast({
title: '该商品暂时不支持当前小程序购买,请到Yoho!Buy有货查看',
icon: 'none',
... ... @@ -466,7 +465,7 @@ Page({
pickData.view.sizeList[parseInt(event.currentTarget.id)] = tempItem;
// 设置数量加减按钮启用状态
pickData.view.plusButtonEnable = (!pickData.view.buy_limit_number || pickData.view.buy_limit_number > 1) && tempItem.storage_number > 1;
pickData.view.plusButtonEnable = (!pickData.view.buy_limit_number || pickData.view.buy_limit_number > 1) && tempItem.storage_number > 1; // eslint-disable-line
pickData.view.minusButtonEnable = false;
pickData.view.buyButtonEnable = true;
... ... @@ -597,7 +596,7 @@ Page({
minReachedLimitAction: function(n) {
return wx.showToast({
title: n + '件' + '起售',
title: n + '件起售',
icon: 'none',
duration: 1000
});
... ... @@ -637,4 +636,4 @@ Page({
PRD_ID: this.data.selectedProductId
});
}
});
}, Actionsheet));
... ...
... ... @@ -10,8 +10,7 @@ let { windowHeight } = app.getSystemInfo();
let yas;
Page({
...Actionsheet, // eslint-disable-line
Page(Object.assign({
data: {
query: '',
order: '',
... ... @@ -185,7 +184,7 @@ Page({
});
shopModel.shopInfo(params)
.then(data => {
if (!data || !data.code || data.code != 200) {
if (!data || !data.code || data.code !== 200) {
this.setData({
info: {
isLoading: false,
... ... @@ -204,17 +203,17 @@ Page({
}
let shopInfo = data.data;
let logoUrl = shopInfo.shop_logo.replace(/{width}/g, 100).replace(/{height}/g, 100).replace('{mode}', 2);
let logoUrl = shopInfo.shop_logo.replace(/{width}/g, 100).replace(/{height}/g, 100).replace('{mode}', 2); // eslint-disable-line
shopInfo.shop_logo = logoUrl;
var shareData = this.data.snapshootShareData;
let shareData = this.data.snapshootShareData;
shareData.shop_logo = logoUrl;
shareData.shop_intro_simple = shopInfo.shop_intro_simple;
shareData.shop_id = shopInfo.shops_id;
shareData.shop_name = shopInfo.shop_name;
shareData.shop_qrCode = config.domains.api + '/wechat/miniapp/img-check.jpg?miniQrType=3&param=' + shopInfo.shops_id;
shareData.shop_qrCode = config.domains.api + '/wechat/miniapp/img-check.jpg?miniQrType=3&param=' + shopInfo.shops_id; // eslint-disable-line
this.setData({
info: {
... ... @@ -246,7 +245,7 @@ Page({
if (data && data.length > 0) {
let resource = data[0];
var shareData = this.data.snapshootShareData;
let shareData = this.data.snapshootShareData;
shareData.bannerUrl = resource.pic;
this.setData({
... ... @@ -307,4 +306,4 @@ Page({
});
}
}
});
}, Actionsheet));
... ...
... ... @@ -93,6 +93,8 @@ global.router = {
case OPEN_BY_TYPE.GO_DETAIL:
this.go('productDetail', {productSkn: openBy.params.product_skn});
break;
default:
break;
}
}
}
... ...