jump-to-miniapp.js 708 Bytes
import wx from '../utils/wx';
import {stringify} from '../vendors/query-string';

const appData = {
    yohobuyLimitChannel: {
        appId: 'wxed31f9e8705fb8d1',
        page: {
            limitProductList: 'pages/index/index'
        }
    },
    groupBuy: { // 拼团
        appId: 'wx207f18be42db9028',
        page: {
            home: '/pages/group/home',
            detail: '/pages/group/detail',
        }
    }
};

export default function(params) {
    let navigateToMiniParams = {
        appId: appData[params.app].appId,
        path: params.path || `${appData[params.app].page[params.page]}?${stringify(params.data)}`
    };
    
    return wx.navigateToMiniProgram(navigateToMiniParams);
}