import RequestManager from '../request';
import common from '../common';
import { platform } from '@/common/platform/PlatformFactory'
import ConfigManager from './../config';
import { sleep } from '../util';
/**
 * 获取商品列表
 * @param {number} page 
 * @param {number} type 
 * @param {string} keyword 
 * @returns 
 */
export const getGoods = async (page, type, keyword) => {
    const res = await RequestManager.getCache("goods", {
        page,
        type,
        keyword
    });
    if (res.status == 1) {
        let isWXShenHe = ConfigManager.GetVersion();
        let _data = res.data.data;
        if (isWXShenHe) {
            let _data2 = [];
            for (let i = 0; i < _data.length; i++) {
                if (_data[i].title.indexOf('京东卡') == -1) {
                    _data2.push(_data[i]);
                }
            }
            _data = _data2;
        }
        return _data;
    }
    return null;
}