<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">(function () {
/*
    å°†ç›¸åŒä»£ç&nbsp;æ‹†å‡ºæ¥æ–¹ä¾¿ç»´æŠ¤
 */
window.RongDemo = {
    common: function (WebIMWidget, config, $scope) {
        WebIMWidget.init(config);

        WebIMWidget.setUserInfoProvider(function(targetId, obj) {
            obj.onSuccess({
                name: "ç”¨æˆ·ï¼š" + targetId
                //name: $scope.user
            });
        });

        WebIMWidget.setGroupInfoProvider(function(targetId, obj){
            obj.onSuccess({
                name:'ç¾¤ç»„ï¼š' + targetId
            });
        })
        //è®¾ç½®å½“å‰ä¼šè¯(åªæœ‰åœ¨åˆå§‹åŒ–æˆåŠŸåŽæ‰å¯ä»¥ä½¿ç”¨)
        $scope.setconversation = function () {
            if (!!$scope.targetId) {
                WebIMWidget.setConversation(Number($scope.targetType), $scope.targetId, "ç”¨æˆ·ï¼š" + $scope.targetId);
                WebIMWidget.setConversation(Number($scope.targetType), $scope.targetId, $scope.user);
                WebIMWidget.show();
            }
        };

        $scope.customerserviceId = "KEFU145914839332836";
        $scope.setcustomerservice = function () {
            WebIMWidget.setConversation(Number(RongIMLib.ConversationType.CUSTOMER_SERVICE), $scope.customerserviceId);
            WebIMWidget.show();
        }

        $scope.show = function() {
            WebIMWidget.show();
        };

        $scope.hidden = function() {
            WebIMWidget.hidden();
        };

        //WebIMWidget.show();  //åˆå§‹æ˜¾ç¤ºï¼ˆè”ç³»äººèœå•ï¼‰
        

        // ç¤ºä¾‹ï¼šèŽ·å– userinfo.json ä¸­æ•°æ®ï¼Œæ&nbsp;¹æ® targetId èŽ·å–å¯¹åº”ç”¨æˆ·ä¿¡æ¯
        // WebIMWidget.setUserInfoProvider(function(targetId,obj){
        //     $http({
        //       url:"/userinfo.json"
        //     }).success(function(rep){
        //       var user;
        //       rep.userlist.forEach(function(item){
        //         if(item.id==targetId){
        //           user=item;
        //         }
        //       })
        //       if(user){
        //         obj.onSuccess({id:user.id,name:user.name,portraitUri:user.portraitUri});
        //       }else{
        //         obj.onSuccess({id:targetId,name:"ç”¨æˆ·ï¼š"+targetId});
        //       }
        //     })
        // });

        // ç¤ºä¾‹ï¼šèŽ·å– online.json ä¸­æ•°æ®ï¼Œæ&nbsp;¹æ®ä¼&nbsp;å…¥ç”¨æˆ· id æ•°ç»„èŽ·å–å¯¹åº”åœ¨çº¿çŠ¶æ€
        // WebIMWidget.setOnlineStatusProvider(function(arr, obj) {
        //     $http({
        //         url: "/online.json"
        //     }).success(function(rep) {
        //         obj.onSuccess(rep.data);
        //     })
        // });
    }
}

})()</pre></body></html>