const httpApiPath = "http://www.91cdkey.com/";
//获取活动列表
let getSingleActivityList = httpApiPath + 'product/getSingleActivityList',
//获取商品分类列表（全部分类）
    getCategoryList = httpApiPath + 'product/getCategoryList',
//获取商品列表
    getPage = httpApiPath + 'product/getPage';

// 过滤价格
function price(val, type) {
    if (!val || val.length === 0) {
        return "0.00"
    }
    if (type === 1) {
        return (val / 10000).toFixed(1);
    }
    if (type === 3) {
        return (val / 10000).toFixed(3);
    }
    if (type === 'discount') {
        return val.toFixed(1);
    }
    return (val / 10000).toFixed(2);
}

//JS调用C++接口
function JsCallCpp(productId) {
    let data = {
        "code": "200",
        "data": {
            "cmd": "50",
            "url": productId ? httpApiPath + "detail/" + productId : 'http://zuhao.91cdkey.com',
        }
    };
    try {
        // alert("JS调用了C++");
        // let data = {code: 0, info: "", data: ""};
        window.mbQuery(0, JSON.stringify(data), onJsCallCppResponse)
    } catch (e) {
        console.log(e)
    }
}

//JS调用C++函数的返回结果
function onJsCallCppResponse(customMsg, res) {
    // alert(res);
}

const ossUrl = 'https://wbyixiu.oss-cn-hangzhou.aliyuncs.com/';
