const product = {
    /**
     * 生成產品詳情地址
     * @param {*} productInfo 產品信息（必須包含Id和ProductType）
     */
    genernalUrl(productInfo) {
        let t = productInfo.productType ? productInfo.productType : productInfo.ProductType;
        let configId = productInfo.configId ? productInfo.configId : productInfo.ConfigId;
        let url = ''
        if (t && configId) {
            if (t === 4) {
                // 接送机，包车
                url = "/detailCar/" + configId
            } else if (t === 3) {
                url = "/detailHotal/" + configId + '/' + productInfo.b2CPrice
            } else if (t === 2) {
                url = "/detailsScenicSpotTicket/" + configId
            } else if (t === 1) {
                url = "/detail/" + encodeURIComponent(productInfo.id ? productInfo.id : productInfo.ID) + "/" + 0 + "/" + configId
            } else if (t === 5) {
                url = "/detailHotal/" + configId + '/' + productInfo.b2CPrice
            }
        } else {
            throw new Error("參數不合法");
        }
        return url
    },
};

export default product