
export default class OppoShareCtrl{
    static _instance: OppoShareCtrl;
    static get instance() {
       
        return OppoShareCtrl._instance || (OppoShareCtrl._instance = new OppoShareCtrl())
    }
    // share(callBack?:Function){
    //     console.log('oppo端内分享',window['RainbowBridge']);
    //     if(/oppocommunity/i.test(navigator.userAgent)){
    //         window['RainbowBridge'].callMethod("OPlusJSCommondMethod", "setH5ShareCover", {
    //             title: window['shareData'].title,
    //             desc: window['shareData'].desc,
    //             img_url: window['shareData'].imgUrl,
    //             link: window['oppoShareLink']
    //         }, function () { console.log('分享回调');
    //                         if(callBack){
    //                             callBack();
    //                         }});
    //     }
    // }
    share(){
        console.log('端内分享',window['oppoShareLink']);
        if (/oppocommunity/i.test(navigator.userAgent)) {
            window['rBridge'].call('controlTopRightBtn', null, {
              showType: 1
            })
      
            window['rBridge'].call('getClientContext', function (res) {
              console.log(res)
            })
      
            window['rBridge'].OPlus('setH5ShareCover', function (res) {
                console.log(res)
            }, {
              title: window['shareData'].title,
              desc: window['shareData'].desc,
              url: window['oppoShareLink'],
              img_url: window['shareData'].imgUrl
            })
          }
    }

}