BaseSdk.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. import { log ,Node} from "cc";
  2. import SdkInterface from "./SdkInterface";
  3. export enum RecorderState{
  4. START,
  5. PAUSE,
  6. STOP,
  7. }
  8. export default class BaseSdk implements SdkInterface {
  9. getWindowInfo() {
  10. }
  11. openSetting(res){
  12. }
  13. showLoading(res?: any) {
  14. // throw new Error("Method not implemented.");
  15. }
  16. hideLoading(res?: any) {
  17. // throw new Error("Method not implemented.");
  18. }
  19. getUserInfo(cb: any, node?: Node, btnCb?: any) {
  20. // throw new Error("Method not implemented.");
  21. }
  22. showRankList(param: any) {
  23. }
  24. setImRankData(param: any){
  25. }
  26. getScope(str) {
  27. return undefined
  28. };
  29. // scope:any
  30. authorize(str?: any) {
  31. // throw new Error("Method not implemented.");
  32. }
  33. posMessge(messge?){
  34. }
  35. getMenuButtonBoundingClientRect() {
  36. }
  37. protected _recordState:RecorderState = RecorderState.STOP
  38. get recordState(){
  39. return this._recordState
  40. }
  41. recorderResume() {
  42. }
  43. recorderPause() {
  44. }
  45. vibrateShort(param: any) {
  46. log("BaseSdk vibrateShort");
  47. }
  48. setOpenScore(score: number): void {
  49. }
  50. getOpenRank(): void {
  51. }
  52. /**
  53. * 初始化
  54. * @param callback 初始化成功后回调
  55. * @param target 监听对象
  56. */
  57. public init(callback: Function, target: Object): void {
  58. log("BaseSdk init");
  59. }
  60. /**
  61. * 登录
  62. * @param callback 登录成功后回调
  63. * @param target 监听对象
  64. */
  65. public login(callback: Function, target: Object): void {
  66. log("BaseSdk login");
  67. }
  68. /**
  69. * 登出
  70. */
  71. public logout(): void {
  72. log("BaseSdk logout");
  73. }
  74. /**
  75. * 退出
  76. */
  77. public exit(): void {
  78. log("BaseSdk exit");
  79. }
  80. /**
  81. * 切换账号
  82. */
  83. public switchLogin(): void {
  84. log("BaseSdk switchLogin");
  85. }
  86. /**
  87. * 数据上报
  88. * @param param 参数
  89. */
  90. public report(...param: any[]): void {
  91. log("BaseSdk report");
  92. }
  93. /**
  94. * 数据上报
  95. * @param param 参数
  96. */
  97. public pay(...param: any[]): void {
  98. log("BaseSdk pay");
  99. }
  100. /**
  101. * 播放广告
  102. */
  103. createRewardAd(): void {
  104. }
  105. /**
  106. * 播放广告
  107. */
  108. playRewardAd(callback: Function, target: any): void {
  109. callback.call(target,true);
  110. // UIAlert.show_sure_cancel("",(sure)=>{
  111. // callback.call(target, sure);
  112. // },this);
  113. }
  114. /**
  115. * 显示banner广告
  116. */
  117. showBannerAd(show: boolean): void {
  118. }
  119. /**
  120. * 显示插屏广告
  121. */
  122. showInterstitialAd(): void { }
  123. /**
  124. * 显示自定义广告
  125. */
  126. showCustomAd(show, top?, left?): void { }
  127. /**
  128. * 主动拉起转发(小程序)
  129. */
  130. shareAppMessage(title: string, imageUrlId: string, imageUrl: string, query: any = null, shareCallback: any = null): void {
  131. if (shareCallback) {
  132. shareCallback();
  133. }
  134. }
  135. recorderStart(duration:number=30):void{
  136. }
  137. recorderStop():void{
  138. }
  139. shareRecord(title: string ,desc:string,path:string,topics:string[]): void {
  140. }
  141. public goToSidebar():void{
  142. }
  143. public checkHasSidebar():boolean{
  144. return true;
  145. }
  146. public checkFromSidebar():boolean{
  147. return true;
  148. }
  149. }