Authored by 李奇

fix part of eslint errors

... ... @@ -9,8 +9,10 @@
},
"globals": {
"App": true,
"wx": true,
"getApp": true,
"Page": true,
"Component": true
"Component": true,
"getCurrentPages": true
}
}
... ...
... ... @@ -229,7 +229,7 @@ export default {
/**
* 是否需要验证码
*/
isNeedImgCheck(udid) {
isNeedImgCheck() {
return api.get({
url: '/smart/way',
});
... ...
... ... @@ -45,4 +45,4 @@ export default {
}
});
}
}
};
... ...
... ... @@ -14,4 +14,4 @@ export default {
}
});
},
}
};
... ...
... ... @@ -15,6 +15,7 @@ export default {
}
});
},
/**
* 个人中心数量信息
* @param params
... ...
... ... @@ -14,6 +14,7 @@ export default {
}
});
},
/**
* 删除订单
* @param params
... ... @@ -27,6 +28,7 @@ export default {
}
});
},
/**
* 取消订单
* @param params
... ... @@ -40,6 +42,7 @@ export default {
}
});
},
/**
* 申请退款
* @param params
... ... @@ -52,6 +55,7 @@ export default {
}
});
},
/**
* 确认收货
* @param params
... ... @@ -65,12 +69,13 @@ export default {
}
});
},
/**
* 物流详情
* @param params
* @returns {*}
*/
expressDetail (params) {
expressDetail(params) {
return api.get({
data: {
...params,
... ... @@ -78,6 +83,7 @@ export default {
}
});
},
/**
* 订单详情
* @param params
... ... @@ -91,6 +97,7 @@ export default {
}
});
},
/**
* 退款理由
* @param params
... ...
... ... @@ -27,4 +27,4 @@ export default {
}
});
}
}
};
... ...
... ... @@ -15,6 +15,7 @@ export default {
}
});
},
/**
* 支持的服务
* @param params
... ... @@ -29,6 +30,7 @@ export default {
}
});
},
/**
* 商品详情
* @param params
... ... @@ -43,4 +45,4 @@ export default {
}
});
}
}
};
... ...
... ... @@ -9,6 +9,7 @@ export default {
}
});
},
/**
* 店铺信息
* @param params
... ... @@ -23,6 +24,7 @@ export default {
}
});
},
/**
* 店铺装修
* @param params
... ... @@ -37,4 +39,4 @@ export default {
}
});
}
}
};
... ...
... ... @@ -235,9 +235,9 @@ Page({
/**
* 监听验证码组件
*/
onRefreshCode: function(event) {
onRefreshCode: function(e) {
this.setData({
degrees: event.detail.degrees.join(',')
degrees: e.detail.degrees.join(',')
});
}
});
... ...
... ... @@ -49,7 +49,7 @@ function formatPaymentData(data, yasInfo) {
selectTime;
if (info.deliveryWayList.length) {
info.deliveryWayList.map((value, index) => {
info.deliveryWayList.map(value => {
if (value.default === 'Y') {
value.checked = true;
selectWay = value;
... ... @@ -66,7 +66,7 @@ function formatPaymentData(data, yasInfo) {
}
if (info.deliveryTimeList.length) {
info.deliveryTimeList.map((value, index) => {
info.deliveryTimeList.map(value => {
if (value.default === 'Y') {
value.checked = true;
selectTime = value;
... ... @@ -114,7 +114,7 @@ Page({
yas = new Yas(app);
yas.pageOpenReport();
},
loadEnsurePayment(options, reload) {
loadEnsurePayment(options) {
if (options.productSku) {
this.orderType = ORDER_TYPE.BUYNOW;
... ... @@ -382,7 +382,7 @@ Page({
confirmText: '好的',
});
}
}).catch(e => {
}).catch(() => {
this.orderSubmiting = false;
});
}
... ...
... ... @@ -94,16 +94,16 @@ Page({
item.pay_lefttime = parseInt(item.pay_lefttime);
item.time_left = this.formatDate(parseInt(item.pay_lefttime));
if (item.counter_flag == 'Y' && item.is_cancel != 'Y' && parseInt(item.pay_lefttime) > 0) {
if (item.counter_flag === 'Y' && item.is_cancel !== 'Y' && parseInt(item.pay_lefttime) > 0) {
needTimer = true;
}
for (var i = 0; i < item.order_goods.length; i++) {
if (new Number(item.order_goods[i].real_pay_price).toFixed(2) == new Number(item.order_goods[i].sales_price).toFixed(2) || !item.order_goods[i].real_pay_price) {
for (let i = 0; i < item.order_goods.length; i++) {
if (Number(item.order_goods[i].real_pay_price).toFixed(2) === Number(item.order_goods[i].sales_price).toFixed(2) || !item.order_goods[i].real_pay_price) {
item.order_goods[i].real_pay_price = item.order_goods[i].goods_price ? item.order_goods[i].goods_price : item.order_goods[i].sales_price;
item.order_goods[i].sales_price = '';
}
if (item.order_goods[i].sales_price) {
item.order_goods[i].sales_price = new Number(item.order_goods[i].sales_price).toFixed(2);
item.order_goods[i].sales_price = Number(item.order_goods[i].sales_price).toFixed(2);
}
}
_orders.push(item);
... ... @@ -137,7 +137,7 @@ Page({
this.setData({
ordersList: orders,
showEmptyContainer: res.data.order_list == 0
showEmptyContainer: res.data.order_list.length === 0
});
wx.hideLoading();
}
... ... @@ -164,7 +164,7 @@ Page({
const code = e.target.dataset.code;
orderHandle.deleteOrder(code, res => {
if (res && res.code == 200) {
if (res && res.code === 200) {
this.getOrders(this.data.orderType);
}
});
... ... @@ -173,7 +173,7 @@ Page({
let code = e.currentTarget.dataset.code;
orderHandle.confirmReceive(code, res => {
if (res && res.code == 200) {
if (res && res.code === 200) {
this.getOrders(this.data.orderType);
}
});
... ... @@ -182,7 +182,7 @@ Page({
let code = e.currentTarget.dataset.code;
orderHandle.cancelOrder(code, res => {
if (res && res.code == 200) {
if (res && res.code === 200) {
this.getOrders(this.data.orderType);
}
});
... ... @@ -234,7 +234,7 @@ Page({
reasonSure() {
orderHandle.refundNow(this.refundOrderCode,
this.data.reason[this.reasonIndex || 0], res => {
if (res && res.code == 200) {
if (res && res.code === 200) {
this.getOrders(this.data.orderType);
}
});
... ...
... ... @@ -87,7 +87,7 @@ Page({
productOnlyProvideByYohoStore: false,
productNotForSale: false,
},
onLoad: function (options) {
onLoad: function(options) {
let productSkn = options.productSkn ? options.productSkn : '';
if (!productSkn) {
... ... @@ -103,7 +103,7 @@ Page({
yas = new Yas(app);
yas.pageOpenReport();
},
onPageScroll: function ({scrollTop}) {
onPageScroll: function({scrollTop}) {
const show = scrollTop > windowHeight * 2;
if (show !== this.data.showBackTop) {
... ... @@ -112,12 +112,12 @@ Page({
});
}
},
backTop: function () {
backTop: function() {
wx.pageScrollTo({
scrollTop: 0
});
},
onShareAppMessage: function (res) {
onShareAppMessage: function(res) {
let params = {
FROM: res.from,
SHARE_RESUIL: 0,
... ... @@ -130,18 +130,18 @@ Page({
return {
title: params.TITLE, // 分享标题
desc: params.DESC, // 分享描述
path: params.PATH , // 分享路径
success: function () {
path: params.PATH, // 分享路径
success: function() {
params.SHARE_RESUIL = 1;
yas.report('YB_SHARE_RESULT_L', params);
},
fail: function () {
fail: function() {
params.SHARE_RESUIL = 2;
yas.report('YB_SHARE_RESULT_L', params);
}
}
};
},
share: function () {
share: function() {
this.setData({
'actionSheet.show': true
});
... ... @@ -151,6 +151,7 @@ Page({
'actionSheet.show': false
});
},
// 当行动按钮中有一个被点击时触发
// index 代表被点击按钮在传入参数 actions 中的位置
handleZanActionsheetClick({index}) {
... ... @@ -164,12 +165,12 @@ Page({
});
}
},
hideSnap: function () {
hideSnap: function() {
this.setData({
showSnapshootShare: false
})
});
},
shopRecList: function (shopId) {
shopRecList: function(shopId) {
listModel.productList({
page: 1,
limit: 20,
... ... @@ -189,7 +190,7 @@ Page({
let item = {};
Object.keys(keyAdapter).forEach(key => {
item[key] = product[keyAdapter[key]]
item[key] = product[keyAdapter[key]];
});
list.push(item);
});
... ... @@ -199,7 +200,7 @@ Page({
}
});
},
preferList: function () {
preferList: function() {
listModel.productList({
page: 1,
limit: 20
... ... @@ -218,7 +219,7 @@ Page({
let item = {};
Object.keys(keyAdapter).forEach(key => {
item[key] = product[keyAdapter[key]]
item[key] = product[keyAdapter[key]];
});
list.push(item);
});
... ... @@ -228,7 +229,7 @@ Page({
}
});
},
productInfo: function () {
productInfo: function() {
detailModel.productInfo(this.data.productSkn)
.then(res => {
if (res.code === 200) {
... ... @@ -251,23 +252,24 @@ Page({
let isSoldOutSoon = false;
let tags = res.data.tags;
if (tags) {
isSoldOutSoon = tags.includes('is_soon_sold_out');
}
//pickerData
// pickerData
let pickData = this.data.pickerData;
pickData.view.goodsList = res.data.goods_list;
pickData.view.isSoldOutSoon = isSoldOutSoon;
//默认显示第一种颜色的尺码
// 默认显示第一种颜色的尺码
pickData.view.sizeList = res.data.goods_list.length ? res.data.goods_list[0].size_list : [];
let plusButtonEnable = false;
let minusButtonEnable = false;
//根据库存设置该尺码是否可以选择
// 根据库存设置该尺码是否可以选择
let size_length = 0;
if (pickData.view.sizeList) {
... ... @@ -277,7 +279,7 @@ Page({
pickData.view.sizeList && pickData.view.sizeList.map((item, index) => {
item.enable = item.storage_number > 0;
if (index === 0 && size_length === 1 && this.data.colorSelected) {
//当颜色被选中 并且只有一个size 时 才会自动 做选中尺码操作
// 当颜色被选中 并且只有一个size 时 才会自动 做选中尺码操作
pickData.view.buyButtonEnable = item.enable;
if (item.enable) {
item.selected = true;
... ... @@ -316,6 +318,7 @@ Page({
storage_sum: res.data.storage_sum,
snapshootShareData: snapData,
shopId: res.data.shop_id,
// 暂时没用
// brand_id: res.data.brand_id,
// isLimitBuy:res.data.isLimitBuy,
... ... @@ -331,9 +334,9 @@ 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',
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,
productNotForSale: res.data.attribute===2,
productNotForSale: res.data.attribute === 2,
showBottomTipView: true
});
... ... @@ -341,7 +344,7 @@ Page({
}
});
},
supportService: function () {
supportService: function() {
let params = {
product_skn: this.data.productSkn,
coupon_limit_status: 0
... ... @@ -354,7 +357,7 @@ Page({
});
});
},
productIntro: function () {
productIntro: function() {
let params = {
productskn: this.data.productSkn
};
... ... @@ -380,7 +383,7 @@ Page({
});
});
},
buyImmediate: function () {
buyImmediate: function() {
if (this.data.productOnlyProvideByYohoAPP || this.data.productOnlyProvideByYohoStore || this.data.productNotForSale) {
return wx.showToast({
title: '该商品暂时不支持当前小程序购买,请到Yoho!Buy有货查看',
... ... @@ -389,7 +392,9 @@ Page({
});
}
if (this.data.storage_sum === 0) return;
if (this.data.storage_sum === 0) {
return;
}
this.setData({buyImmediate: true});
if (app.getUid()) {
... ... @@ -398,15 +403,15 @@ Page({
tapToLogin();
}
},
hidePicker: function (e) {
hidePicker: function(e) {
if (e.target.id === 'picker-bg') {
Picker.pickerHide(this);
}
},
chooseColor: function (event) {
chooseColor: function(event) {
let pickData = this.data.pickerData;
//先遍历将所有颜色、尺码置为未选中状态
// 先遍历将所有颜色、尺码置为未选中状态
pickData.view.goodsList && pickData.view.goodsList.map(item => {
item.selected = false;
item.size_list.map(subItem => {
... ... @@ -415,20 +420,20 @@ Page({
});
});
//将当前颜色置为选中状态
// 将当前颜色置为选中状态
let tempItem = event.target.dataset.key;
//遍历颜色尺码,根据库存切换显示状态
// 遍历颜色尺码,根据库存切换显示状态
tempItem && tempItem.size_list && tempItem.size_list.map(item => {
item.enable = item.storage_number > 0;
});
tempItem.selected = true;
this.data.selectedProductId = tempItem.goods_id;
//设置标志位,表示已经选择颜色
// 设置标志位,表示已经选择颜色
let colorSelected = true;
//重置库存、当前选中sku的值
// 重置库存、当前选中sku的值
pickData.storageNumber = 0;
pickData.selectedSKU = 0;
this.data.selectedSKU = 0;
... ... @@ -437,7 +442,8 @@ Page({
pickData.view.sizeList = tempItem.size_list;
pickData.view.minusButtonEnable = false;
//将购买数量设为初始状态
// 将购买数量设为初始状态
pickData.view.buyNumber = 1;
this.setData({
... ... @@ -445,27 +451,28 @@ Page({
pickerData: pickData
});
},
chooseSize: function (event) {
chooseSize: function(event) {
let pickData = this.data.pickerData;
//现遍历将所有尺码置为未选中状态
// 现遍历将所有尺码置为未选中状态
pickData.view.sizeList && pickData.view.sizeList.map(item => {
item.selected = false
item.selected = false;
});
//将当前尺码置为选中状态
// 将当前尺码置为选中状态
let tempItem = event.currentTarget.dataset.key;
tempItem.selected = true;
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.minusButtonEnable = false;
pickData.view.buyButtonEnable = true;
if (pickData.view.bundle_count === 0) {
pickData.view.buyNumber = 1
pickData.view.buyNumber = 1;
}
if (tempItem.storage_number <= 0) {
... ... @@ -475,7 +482,7 @@ Page({
duration: 2000
});
pickData.view.buyButtonEnable = false
pickData.view.buyButtonEnable = false;
}
this.setData({
... ... @@ -484,7 +491,7 @@ Page({
storageNumber: tempItem.storage_number
});
},
bindMinus: function () {
bindMinus: function() {
let pickerData = this.data.pickerData;
let buyNumber = parseInt(pickerData.view.buyNumber);
... ... @@ -492,9 +499,9 @@ Page({
if (buyNumber > pickerData.view.bundle_count) {
pickerData.view.minusButtonEnable = true;
} else {
this.minReachedLimitAction(pickerData.view.bundle_count)
this.minReachedLimitAction(pickerData.view.bundle_count);
pickerData.view.minusButtonEnable = false;
return
return;
}
}
... ... @@ -520,8 +527,8 @@ Page({
this.setData({pickerData});
},
//增加购买数量
bindPlus: function () {
// 增加购买数量
bindPlus: function() {
if (!this.data.colorSelected) {
return wx.showToast({
title: '请选择颜色',
... ... @@ -571,7 +578,7 @@ Page({
this.setData({pickerData});
},
plusReachedMaxAction: function () {
plusReachedMaxAction: function() {
return wx.showToast({
title: '对不起,没有更多库存了',
icon: 'none',
... ... @@ -579,7 +586,7 @@ Page({
});
},
plusReachedLimitAction: function (n) {
plusReachedLimitAction: function(n) {
return wx.showToast({
title: '限购' + n + '件',
icon: 'none',
... ... @@ -588,14 +595,14 @@ Page({
},
minReachedLimitAction: function (n) {
minReachedLimitAction: function(n) {
return wx.showToast({
title: n + '件' + '起售',
icon: 'none',
duration: 1000
});
},
goPayment: function (e) {
goPayment: function(e) {
if (!this.data.colorSelected) {
return wx.showToast({
title: '请选择颜色',
... ... @@ -614,16 +621,16 @@ Page({
this._dataReport();
if (this.data.buyImmediate) {
this.payNow(e)
this.payNow(e);
}
},
payNow: function () {
payNow: function() {
router.go('cartEnsure', {
productSku: this.data.selectedSKU,
buyNumber: this.data.pickerData.view.buyNumber
});
},
_dataReport: function () {
_dataReport: function() {
yas.report('YB_GDS_DT_BILL', {
PRD_SKN: this.data.productSkn,
RPD_SKU: this.data.selectedSKU,
... ...
import wx from '../../../utils/wx';
import Yas from '../../../common/yas';
import listModel from '../../../models/product/list';
import {parse} from '../../../vendors/query-stringify';
const {windowHeight} = getApp().getSystemInfo();
let yas;
... ...
... ... @@ -11,7 +11,7 @@ let { windowHeight } = app.getSystemInfo();
let yas;
Page({
...Actionsheet,
...Actionsheet, // eslint-disable-line
data: {
query: '',
order: '',
... ... @@ -44,7 +44,7 @@ Page({
showNoMore: false,
isLoading: false
},
onLoad:function (options) {
onLoad: function(options) {
let shopId = options.shop_id || options.shopId;
this.data.shopId = shopId;
... ... @@ -58,7 +58,7 @@ Page({
yas = new Yas(app);
yas.pageOpenReport();
},
onReady: function () {
onReady: function() {
wx.createSelectorQuery().select('.shop-info').boundingClientRect(rect => {
this.setData({
shopInfoHeight: rect.height
... ... @@ -78,18 +78,20 @@ Page({
title: params.TITLE, // 分享标题
desc: params.DESC, // 分享描述
path: params.PATH, // 分享路径
success: function () {
success: function() {
params.SHARE_RESUIL = 1;
yas.report('YB_SHARE_RESULT_L', params);
},
fail: function () {
fail: function() {
params.SHARE_RESUIL = 2;
yas.report('YB_SHARE_RESULT_L', params);
}
};
},
productList: function (params) {
if (this.data.isLoading) return;
productList: function(params) {
if (this.data.isLoading) {
return;
}
this.data.isLoading = true;
wx.showLoading({title: '加载中'});
... ... @@ -111,7 +113,7 @@ Page({
let item = {};
Object.keys(keyAdapter).forEach(key => {
item[key] = product[keyAdapter[key]]
item[key] = product[keyAdapter[key]];
});
list.push(item);
});
... ... @@ -144,14 +146,14 @@ Page({
handleZanActionsheetCancel() {
this.setData({
'actionsheet.show': false
})
});
},
handleZanActionsheetClick() {
this.setData({
'actionsheet.show': false
});
},
sortChange: function (e) {
sortChange: function(e) {
let params;
let {curSort, gender} = e.detail;
... ... @@ -168,11 +170,12 @@ Page({
params.resetScroll = true;
this.productList(params);
},
//店铺信息
shopInfo: function () {
// 店铺信息
shopInfo: function() {
let params = {
shop_id: this.data.shopId,
fromePage: "iFP_RedPersonBrand"
fromePage: 'iFP_RedPersonBrand'
};
this.setData({
... ... @@ -193,7 +196,8 @@ Page({
}
if (data.data.shop_name !== null && data.data.shop_name !== undefined && data.data.shop_name !== '') {
let shopName = data.data.shop_name
let shopName = data.data.shop_name;
wx.setNavigationBarTitle({
title: shopName,
});
... ... @@ -201,9 +205,11 @@ Page({
let shopInfo = data.data;
let logoUrl = shopInfo.shop_logo.replace(/{width}/g, 100).replace(/{height}/g, 100).replace('{mode}', 2);
shopInfo.shop_logo = logoUrl;
var shareData = this.data.snapshootShareData;
shareData.shop_logo = logoUrl;
shareData.shop_intro_simple = shopInfo.shop_intro_simple;
shareData.shop_id = shopInfo.shops_id;
... ... @@ -229,20 +235,24 @@ Page({
shopModel.shopDecorator(params)
.then(res => {
let floor = res.data.modules;
if(floor && floor.length > 0){
if (floor && floor.length > 0) {
let shopBanner = floor[0];
if (shopBanner && shopBanner.module_type === 'ShopBanner'){
if (shopBanner && shopBanner.module_type === 'ShopBanner') {
let module_data = JSON.parse(shopBanner.module_data);
let data = module_data.data;
if(data && data.length > 0) {
if (data && data.length > 0) {
let resource = data[0];
var shareData = this.data.snapshootShareData;
shareData.bannerUrl = resource.pic;
this.setData({
bannerUrl: resource.pic,
snapshootShareData: shareData
})
});
}
}
}
... ... @@ -252,7 +262,7 @@ Page({
isLoading: false,
data: res.data
},
})
});
})
.catch(error =>{
this.setData({
... ... @@ -265,15 +275,15 @@ Page({
},
onPageScroll: function({scrollTop}) {
const floatSign = scrollTop >= this.data.shopInfoHeight;
if (floatSign !== this.data.fixedFilter) {
this.setData({
fixedFilter: floatSign
});
}
const backSign = scrollTop > windowHeight * 2;
if (backSign !== this.data.showBackTop) {
this.setData({
showBackTop: backSign
... ... @@ -285,12 +295,12 @@ Page({
scrollTop: 0
});
},
onReachBottom: function () {
onReachBottom: function() {
if (this.data.currentPage < this.data.totalPage) {
this.setData({
showLoading: true
});
this.productList({page: this.data.currentPage + 1, limit: 20, order: this.data.order})
this.productList({page: this.data.currentPage + 1, limit: 20, order: this.data.order});
} else {
this.setData({
showNoMore: true
... ...
... ... @@ -62,10 +62,11 @@ global.router = {
return Promise.reject('error url');
}
const search = url.split('?')[1];
const [uri, search] = url.split('?');
const path = uri.split(MINI_APP_DOMAIN)[1];
const qs = parse(search);
if (qs.app) {
if (qs.app && path) {
return jumpToMiniapp({
app: qs.app,
path: `${path}?${stringify(qs)}`
... ...
'use strict';
/* eslint-disable */
function getGoodInfo(data) {
let newData = [];
let idElement = '编号: ' + data.erpProductId;
... ...
'use strict';
// 获取应用实例
/* eslint-disable */
function formatNumber(n) {
n = n.toString();
return n[1] ? n : '0' + n;
}
function formatTime(date) {
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
var hour = date.getHours();
var minute = date.getMinutes();
var second = date.getSeconds();
let hour = date.getHours();
let minute = date.getMinutes();
let second = date.getSeconds();
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':');
}
function formatNumber(n) {
n = n.toString();
return n[1] ? n : '0' + n;
}
function getDeviceInfo(wx) {
let res = wx.getSystemInfoSync(),
... ... @@ -28,7 +28,7 @@ function getDeviceInfo(wx) {
}
function shouldDiscardTap(currentTimeStamp, lastTimeStamp) {
if (lastTimeStamp != 0 && currentTimeStamp - lastTimeStamp < 250) {
if (lastTimeStamp !== 0 && currentTimeStamp - lastTimeStamp < 250) {
return true;
}
... ... @@ -36,14 +36,12 @@ function shouldDiscardTap(currentTimeStamp, lastTimeStamp) {
}
function formatImgUrl(json) {
json.data && json.data.map((item, index) => {
json.data && json.data.map(item => {
let replaceStr = '{width}';
let url = item.src;
url = url.replace(new RegExp('{width}'), windowWidth * 2).replace(new RegExp('{height}'), 100).replace(new RegExp('{mode}'), '2');
item.src = url;
// console.log(url)
});
return json;
}
... ... @@ -71,7 +69,7 @@ function getImageUrlWithWH(image_url, image_width, image_height) {
function getBrandID(url) {
let params = url.split('openby:yohobuy=');
if (params.length == 2) {
if (params.length === 2) {
let jsonParam = JSON.parse(params[1]);
return jsonParam.params.brand_id;
... ... @@ -85,13 +83,12 @@ function isStringEmpty(str) {
} else {
return false;
}
return true;
}
function getGoodDetailParam(url) {
let params = url.split('openby:yohobuy=');
if (params.length == 2) {
if (params.length === 2) {
let jsonParam = JSON.parse(params[1]);
return JSON.stringify(jsonParam.params);
... ... @@ -100,22 +97,22 @@ function getGoodDetailParam(url) {
}
function formatDateTime(inputTime) {
var date = new Date();
let date = new Date();
date.setTime(inputTime * 1000);
var y = date.getFullYear();
var m = date.getMonth() + 1;
let y = date.getFullYear();
let m = date.getMonth() + 1;
m = m < 10 ? ('0' + m) : m;
var d = date.getDate();
let d = date.getDate();
d = d < 10 ? ('0' + d) : d;
return y + '.' + m + '.' + d;
}
function formateTimestamp(start, end) {
var startTime = formatDateTime(start);
var endTime = formatDateTime(end);
let startTime = formatDateTime(start);
let endTime = formatDateTime(end);
return startTime + '-' + endTime;
}
... ...