예제 #1
0
    /// <summary>
    /// 获取热搜关键字
    /// </summary>
    public void GetHotWordsJsonData()
    {
        JGetHotWordsRequest request = new JGetHotWordsRequest();

        request.request = mURLHotWords;

        string requestJson = JsonUtility.ToJson(request);
        string u3dName     = gameObject.name;
        string funcName    = "GetHotWordsJsonDataCallBack";

        string[] tParam = new string[3];
        tParam[0] = u3dName;
        tParam[1] = funcName;
        tParam[2] = requestJson;

#if !UNITY_EDITOR && UNITY_ANDROID
        AndroidInterface.CallAndroidFunction(mAndroidHttpRequest, tParam);
#elif UNITY_EDITOR
        JKeyWordsData data = new JKeyWordsData();
        data.hotKeywords    = new string[4];
        data.hotKeywords[0] = "五十度灰";
        data.hotKeywords[1] = "钢铁侠";
        data.hotKeywords[2] = "蜘蛛侠";
        data.hotKeywords[3] = "变形金刚";
        CacheVoiceSearchData.Instance.HotWords = data;
#endif
    }
예제 #2
0
    /// <summary>
    /// 获取搜索结果
    /// </summary>
    /// <param name="keyword"></param>
    public void GetSearchJsonData(string keyword, string goname, string funname)
    {
        JSearchRequest request = new JSearchRequest();

        request.request = mURLSearch;
        JSearchRequestParams param = new JSearchRequestParams();

        param.keyWords = keyword;
        request.param  = param;

        string requestJson = JsonUtility.ToJson(request);
        string u3dName     = goname;
        string funcName    = funname;

        string[] tParam = new string[3];
        tParam[0] = u3dName;
        tParam[1] = funcName;
        tParam[2] = requestJson;

#if !UNITY_EDITOR && UNITY_ANDROID
        AndroidInterface.CallAndroidFunction(mAndroidHttpRequest, tParam);
#elif UNITY_EDITOR
        string      mainJsonStr = LoadJsonStrFromFile(mainpageJFileName);
        JMainPage   page        = JsonUtility.FromJson <JMainPage>(mainJsonStr);
        JSearchData data        = new JSearchData();
        //page.data.feedStream
        data.videoList = new JFeedItem[20];
        for (int i = 0; i < data.videoList.Length; i++)
        {
            data.videoList[i] = page.data.feedStream[0];
        }
        CacheVoiceSearchData.Instance.FeedList = data;
#endif
    }
예제 #3
0
    /// <summary>
    /// 获取历史数据
    /// </summary>
    public void GetTabHistoryJsonData()
    {
        JPageRequest request = new JPageRequest();

        request.request = mURLTabHistory;
        request.tag     = Constant.TAB_PAGE_HTTPTAG;
        JPageRequestParams param = new JPageRequestParams();

        param.pageCategory = "";
        param.offset       = "";
        //param.vRFormat = vRFormat;
        request.param = param;

        string requestJson = JsonUtility.ToJson(request);

        //string funcName = "AddTabPageDataOnce";

        string[] tParam = new string[3];
        tParam[0] = gameObject.name;
        tParam[1] = "AddTabPageDataOnceCallBack";
        tParam[2] = requestJson;

#if !UNITY_EDITOR && UNITY_ANDROID
        AndroidInterface.CallAndroidFunction(mAndroidHttpRequest, tParam);
#elif UNITY_EDITOR || UNITY_IOS
        AddTabPageDataOnceCallBack(LoadJsonStrFromFile(historyJFileName));
#endif
    }
예제 #4
0
    private void AndroidLoadImg(string url)
    {
        string[] tParam = new string[4];
        tParam[0] = this.gameObject.name;
        tParam[1] = "LoadImg";
        tParam[2] = url;
        tParam[3] = mParam;

        AndroidInterface.CallAndroidFunction("imageRequest", tParam);
    }
예제 #5
0
    private void AndroidLoadLocalvideoImg(string imgurl, string videourl)
    {
        string[] tParam = new string[4];
        tParam[0] = this.gameObject.name;
        tParam[1] = "LoadImg";
        tParam[2] = imgurl;
        tParam[3] = videourl;

        AndroidInterface.CallAndroidFunction("getLocalVideoThumbnail", tParam);
    }
예제 #6
0
    /// <summary>
    /// 获取主页数据
    /// </summary>
    public void GetMainPageJsonData()
    {
        JMainPageRequest request = new JMainPageRequest();

        request.request = mURLMainPage;
        request.tag     = mURLMainPage;
        string requestJson = JsonUtility.ToJson(request);

        string[] tParam = new string[3];
        tParam[0] = this.gameObject.name;
        tParam[1] = "GetMainPageJsonDataCallBack";
        tParam[2] = requestJson;

#if !UNITY_EDITOR && UNITY_ANDROID
        AndroidInterface.CallAndroidFunction(mAndroidHttpRequest, tParam);
#elif UNITY_EDITOR || UNITY_IOS
        GetMainPageJsonDataCallBack(LoadJsonStrFromFile(mainpageJFileName));
#endif
    }
예제 #7
0
    /// <summary>
    /// 根据剧集或者合集id来获取详细数据
    /// </summary>
    /// <param name="videosetId"></param>
    public void GetVideoList(string videosetId, string goname, string funname)
    {
        JVideoSetRequest tmp = new JVideoSetRequest();

        tmp.request = mURLVideoList;
        tmp.tag     = videosetId;
        JVideoSetParam jParam = new JVideoSetParam();

        jParam.setId = videosetId;
        tmp.param    = jParam;


        string param = JsonUtility.ToJson(tmp);

        string[] tParam = new string[3];
        tParam[0] = goname;
        tParam[1] = funname;
        tParam[2] = param;

#if !UNITY_EDITOR && UNITY_ANDROID
        AndroidInterface.CallAndroidFunction("httpRequest", tParam);
#endif
    }