PlatformDianHunWeChat.ts 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. /**
  2. * 变态版电魂小游戏版本 sdk配置
  3. *
  4. */
  5. import Mint from "../utils/mintFilter/index";
  6. import { gameMethod } from "../common/gameMethod";
  7. import { PlayerLogin, PlayerLoginPram } from "../common/Xyc";
  8. import { SevBack } from "../common/Xys";
  9. import Config from "../Config";
  10. import { GameEvent, LoadEvent } from "../data/const/EventConst";
  11. import { GameErrCode, PayProductParam, ReportRoleType } from "../data/const/TypeConst";
  12. import GameDataCenter from "../data/GameDataCenter";
  13. import GameController from "../GameController";
  14. import UIHelp from "../logic/ui/UIHelp";
  15. import EventMng from "../manager/EventMng";
  16. import PlatformBase from "./PlatformBase";
  17. export default class PlatformDianHunWeChat extends PlatformBase {
  18. isGoPay: boolean
  19. mint: Mint;
  20. constructor() {
  21. super()
  22. // 屏幕常亮
  23. wx.setKeepScreenOn({
  24. keepScreenOn: true
  25. })
  26. // 热启动,或唤醒时触发
  27. wx.onShow(res => {
  28. if (this.isGoPay) {
  29. this.isGoPay = false
  30. if (Config.paySuccAdokId != null) {
  31. clearInterval(Config.paySuccAdokId)
  32. Config.paySuccAdokId = null
  33. }
  34. Config.paySuccAdokIndex = 0
  35. Config.paySuccAdokId = setInterval(() => {
  36. Config.paySuccAdokIndex++
  37. if (Config.paySuccAdokIndex >= 5) {
  38. clearInterval(Config.paySuccAdokId)
  39. Config.paySuccAdokId = null
  40. }
  41. GameDataCenter.time.sendAdok()
  42. }, 1000)
  43. }
  44. GameDataCenter.audio.resumeMusic()
  45. // IOS系统,在后台切回时似乎回失去常亮功能,这里再调用一次
  46. wx.setKeepScreenOn({
  47. keepScreenOn: true
  48. })
  49. EventMng.emit(GameEvent.ON_SHOW_APP)
  50. console.log("-----wx.onShow 回调触发:", res)
  51. })
  52. // 切到后台时触发
  53. wx.onHide(res => {
  54. GameDataCenter.plat.instance.reportRole(ReportRoleType.offline)
  55. // this.dealQuery(res)
  56. GameDataCenter.audio.stopAllEffects()
  57. GameDataCenter.audio.pauseMusic()
  58. })
  59. // cc.game.on(cc.game.EVENT_SHOW, () => {
  60. // if (this.isGoPay) {
  61. // this.isGoPay = false
  62. // if (Config.paySuccAdokId != null) {
  63. // clearInterval(Config.paySuccAdokId)
  64. // Config.paySuccAdokId = null
  65. // }
  66. // Config.paySuccAdokIndex = 0
  67. // Config.paySuccAdokId = setInterval(() => {
  68. // Config.paySuccAdokIndex++
  69. // if (Config.paySuccAdokIndex >= 5) {
  70. // clearInterval(Config.paySuccAdokId)
  71. // Config.paySuccAdokId = null
  72. // }
  73. // GameDataCenter.time.sendAdok()
  74. // }, 1000)
  75. // }
  76. // })
  77. // 小程序更新机制 https://developers.weixin.qq.com/minigame/dev/guide/runtime/update-mechanism.html
  78. const updateManager = wx.getUpdateManager()
  79. updateManager.onCheckForUpdate((res) => {
  80. // 请求完新版本信息的回调
  81. console.log("请求完新版本信息的回调", res.hasUpdate)
  82. })
  83. updateManager.onUpdateReady(() => {
  84. wx.showModal({
  85. title: '更新提示',
  86. content: '新版本已经准备好,是否重启应用?',
  87. success(res) {
  88. if (res.confirm) {
  89. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  90. updateManager.applyUpdate()
  91. }
  92. }
  93. })
  94. })
  95. updateManager.onUpdateFailed(() => {
  96. // 新版本下载失败
  97. })
  98. //需要初始化广告
  99. if (gameMethod.isEmpty(GameController.rewardedVideoAd)) {
  100. this.initRewardedVideoAd("adunit-7684634ced33efb2")
  101. }
  102. }
  103. showLoginView(): void {
  104. console.log("初始化&登录SDK => ", window['dhSDK'].system.platform)
  105. EventMng.emit(LoadEvent.LOAD_PROGRESS, 0.25, "login")
  106. GameDataCenter.plat.instance.deviceOS = window['dhSDK'].system.platform
  107. try {
  108. setTimeout(() => {
  109. // console.log("----拉取登录----")
  110. window['dhSDK'].login({
  111. success: response => {
  112. // console.log("用户信息如下:");
  113. // console.log(response.data);
  114. // console.log("用户微信唯一标识openId如下:");
  115. // console.log(response.data.openId)
  116. // console.log("login data=",JSON.stringify(response))
  117. // EventMng.emit(LoadEvent.LOAD_MESSAGE, JSON.stringify(result))
  118. let data = response.data
  119. EventMng.emit(LoadEvent.LOAD_PROGRESS, 0.75, "login")
  120. let params: PlayerLoginPram = {
  121. pid: Config.pid,
  122. param: [data.accountId, data.loginType, data.token, window['dhSDK'].deviceOS, window['dhSDK'].deviceId, window['dhSDK'].channel, window['dhSDK'].mainChannel, window['dhSDK'].secondChannel]
  123. }
  124. setTimeout(() => {
  125. //电魂sdk漏斗打点
  126. if (window['dhSDK']) {
  127. // 事件ID
  128. let eventId = "420000::GAME_CLIENT_LOGIN_START"; // 表示SDK客户端上报的启动事件
  129. // 事件参数
  130. let eventParams = {};
  131. // 必填参数
  132. eventParams["logLevel"] = "d";
  133. eventParams["logContent"] = "SDK启动";
  134. // 执行上报
  135. window['dhSDK'].trackEvent(eventId, eventParams);
  136. }
  137. GameController.network.send(PlayerLogin.url, params, (result: SevBack) => {
  138. console.log("后段验证返回")
  139. if (result.type != 1) {
  140. if (gameMethod.isEmpty(result.win) || gameMethod.isEmpty(result.win.msgOut)) {
  141. GameDataCenter.plat.showErrDialog(GameErrCode.errGamePlatLogin)
  142. }
  143. return
  144. }
  145. EventMng.emit(LoadEvent.LOAD_PROGRESS, 1, "login")
  146. if (result.type == 1 && result.platBack) {
  147. this.openId = result.platBack.openid
  148. this.loginParams = [result.platBack.token]
  149. console.log("后端验证成功", this.openId)
  150. this.login()
  151. //电魂sdk漏斗打点
  152. if (window['dhSDK']) {
  153. // 事件ID
  154. let eventId = "450000::GAME_CLIENT_LOGIN_SUCCESS"; // 表示SDK客户端上报的启动事件
  155. // 事件参数
  156. let eventParams = {};
  157. // 必填参数
  158. eventParams["logLevel"] = "d";
  159. eventParams["logContent"] = "游戏客户端登录成功";
  160. // 执行上报
  161. window['dhSDK'].trackEvent(eventId, eventParams);
  162. }
  163. } else {
  164. console.log("PlayerLogin.url 返回数据异常")
  165. if (gameMethod.isEmpty(result.win) || gameMethod.isEmpty(result.win.msgOut)) {
  166. GameDataCenter.plat.showErrDialog(GameErrCode.errGamePlatLogin)
  167. }
  168. }
  169. })
  170. // 首先通过 sdk.getSetting 查询用户是否已授权获取昵称头像
  171. window['dhSDK'].getSetting({
  172. success: setting => {
  173. // 判断用户之前是否已同意授权获取其个人信息
  174. // 若已经授权,可以直接调用 sdk.getUserInfo 获取昵称头像
  175. if (setting.authSetting && setting.authSetting["scope.userInfo"]) {
  176. console.log("已授权")
  177. GameDataCenter.plat.instance.hasAuthUserInfo = true
  178. } else {
  179. wx.getUserInfo({
  180. lang: "zh_CN",
  181. success: function (res) {
  182. GameDataCenter.plat.instance.reportUserInfo(res)
  183. },
  184. fail: function () { }
  185. })
  186. }
  187. // 整理订阅消息
  188. if (setting.subscriptionsSetting && setting.subscriptionsSetting.itemSettings) {
  189. GameDataCenter.subscribe.recordSubscribeAlwaysSettings(setting.subscriptionsSetting.itemSettings)
  190. }
  191. }
  192. });
  193. }, 1000)
  194. },
  195. fail: error => {
  196. console.log(error);
  197. UIHelp.ShowTips(error["message"])
  198. },
  199. complete: () => {
  200. // do something here...
  201. }
  202. });
  203. window["dhSDK"].setShare({
  204. title: "",
  205. imageUrl: "https://mmocgame.qpic.cn/wechatgame/IPo1swnSw7jm37KrqskuianLoGjy7jJ0XyAFbowVKTNicA5TIibl71JQS5D9ZrJvbQZ/0",
  206. imageUrlId: "2+FmTyUWS9CB3UmprmJE7A==",
  207. imagePreviewUrl: "https://mmocgame.qpic.cn/wechatgame/IPo1swnSw7jm37KrqskuianLoGjy7jJ0XyAFbowVKTNicA5TIibl71JQS5D9ZrJvbQZ/0",
  208. imagePreviewUrlId: "2+FmTyUWS9CB3UmprmJE7A==",
  209. query: ""
  210. });
  211. }, 1000)
  212. } catch (error) {
  213. UIHelp.ShowTips("----" + error)
  214. }
  215. }
  216. pay(orderId: string, order10cs: string, param: PayProductParam): void {
  217. let successFunc = () => {
  218. //拉取支付成功
  219. console.log("电魂支付成功")
  220. window['dhSDK'].uploadRoleInfo({
  221. type: "PAY_SUCCESS", // 登录游戏服时传LOGIN_GAME,创角时传CREATE_ROLE,升级时传LEVEL_UP,充值成功时传PAY_SUCCESS
  222. areaId: parseInt(GameDataCenter.sevBack.userInfo?.a?.sid), // 游戏大区ID,若游戏无大区概念,可不填,默认值为 1,表示初始大区编号
  223. areaName: GameDataCenter.sevBack.qufuList[GameDataCenter.sevBack.userInfo?.a?.sid].name, // 游戏大区名称
  224. roleId: GameDataCenter.sevBack.userInfo?.a?.uuid, // 角色ID,若游戏无角色概念,可不填,默认值同 accountId 账号ID
  225. roleName: GameDataCenter.sevBack.userInfo?.a?.name, // 角色名
  226. roleLevel: GameDataCenter.sevBack.userInfo?.a?.level, // 角色等级,若游戏无角色及等级概念,可填关卡等级或不填,默认值为 1
  227. roleVipLevel: 1, // 角色VIP等级
  228. // 以下参数仅在 type 为 PAY_SUCCESS 时所需,以上为通用参数
  229. itemId: param.productId, // 商品ID
  230. itemName: param.productName, // 商品名称
  231. orderId: orderId, // 订单唯一编号
  232. orderPrice: param.price * 100, // 商品总价,即实际支付价格,单位为分!!!
  233. currency: "CNY", // 货币类型
  234. payType: "weixinpay" // 支付方式
  235. }, (params: any) => {
  236. console.log(params);
  237. });
  238. this.isGoPay = false;
  239. if (Config.paySuccAdokId != null) {
  240. clearInterval(Config.paySuccAdokId)
  241. Config.paySuccAdokId = null
  242. }
  243. Config.paySuccAdokIndex = 0
  244. Config.paySuccAdokId = setInterval(() => {
  245. Config.paySuccAdokIndex++
  246. if (Config.paySuccAdokIndex >= 5) {
  247. clearInterval(Config.paySuccAdokId)
  248. Config.paySuccAdokId = null
  249. }
  250. GameDataCenter.time.sendAdok()
  251. }, 1000)
  252. }
  253. let time = GameDataCenter.time.sevTime
  254. let orderInfo = {
  255. cardMessageTitle: param.productName, // 该选项仅在使用跳转H5网页支付时必填,一般此参数必填,因iOS设备仅支持跳转H5网页支付
  256. cardMessageImage: "http://static.m3guo.com/om/minigame/wx/payment.png", // 该选项仅在使用跳转H5网页支付时必填,一般此参数必填,因iOS设备仅支持跳转H5网页支付
  257. areaId: parseInt(GameDataCenter.sevBack.userInfo?.a?.sid),
  258. areaName: GameDataCenter.sevBack.qufuList[GameDataCenter.sevBack.userInfo?.a?.sid].name,//parseInt(GameDataCenter.sevBack.userInfo?.a?.sid),
  259. roleId: parseInt(GameDataCenter.sevBack.userInfo?.a?.uuid),
  260. roleName: GameDataCenter.sevBack.userInfo?.a?.name,
  261. roleLevel: GameDataCenter.sevBack.userInfo?.a?.level,
  262. itemId: param.productId,
  263. itemName: param.productName,
  264. itemNum: 1, // 一般固定传1
  265. itemPrice: param.price * 100, // 商品单价单位为分,请注意换算!例如此示例中的600表示600分,即6元
  266. currency: "CNY",
  267. rate: 10,
  268. memo: orderId,//JSON.stringify({ orderId: orderId }), // 透传参数,字符串类型;支付完成后,SDK服务器将通过支付回调原样返回给游戏服务器;这里演示透传游戏业务订单号
  269. remark: Config.pid, // 备用透传参数
  270. success: successFunc,
  271. fail: (error) => {
  272. // 此处返回接口调用失败的错误信息,error.code为cancel时,表示用户主动点击了取消按钮,此时可以不向用户弹出提示
  273. if (error.code == "cancel") {
  274. return;
  275. }
  276. // 此处可向用户弹出接口返回的错误消息或统一弹出“支付失败”
  277. window['dhSDK'].modal.message(error.message);
  278. },
  279. complete: (result) => {
  280. // do something here...
  281. }
  282. }
  283. console.log("调用电魂支付接口=>", JSON.stringify(orderInfo))
  284. this.isGoPay = true;
  285. window['dhSDK'].pay(orderInfo)
  286. }
  287. // 上报角色数据
  288. reportRole(event: ReportRoleType): void {
  289. // • 初始化成功后调⽤. • 进⼊区服、创⻆、⻆⾊等级更新、战⼒更新时调⽤.
  290. if (GameDataCenter.sevBack == null) { return }
  291. if (GameDataCenter.sevBack.userInfo == null) { return }
  292. console.log("上报角色数据:", event)
  293. let onlineTime = 0
  294. if (GameDataCenter.time.onlineTime > 0) {
  295. onlineTime = GameDataCenter.time.sevTime - GameDataCenter.time.onlineTime
  296. }
  297. let isCreateRole = false
  298. switch (event) {
  299. case ReportRoleType.create:
  300. isCreateRole = true
  301. //电魂sdk漏斗打点
  302. if (window['dhSDK']) {
  303. // 事件ID
  304. let eventId = "450001::GAME_CLIENT_CREATING_A_ROLE"; // 表示SDK客户端上报的启动事件
  305. // 事件参数
  306. let eventParams = {};
  307. // 必填参数
  308. eventParams["logLevel"] = "d";
  309. eventParams["logContent"] = "游戏客户端创角成功";
  310. // 执行上报
  311. window['dhSDK'].trackEvent(eventId, eventParams);
  312. }
  313. window['dhSDK'].uploadRoleInfo({
  314. type: "CREATE_ROLE", // 登录游戏服时传LOGIN_GAME,创角时传CREATE_ROLE,升级时传LEVEL_UP,充值成功时传PAY_SUCCESS
  315. areaId: parseInt(GameDataCenter.sevBack.userInfo?.a?.sid), // 游戏大区ID,若游戏无大区概念,可不填,默认值为 1,表示初始大区编号
  316. areaName: GameDataCenter.sevBack.qufuList[GameDataCenter.sevBack.userInfo?.a?.sid].name, // 游戏大区名称
  317. roleId: GameDataCenter.sevBack.userInfo?.a?.uuid, // 角色ID,若游戏无角色概念,可不填,默认值同 accountId 账号ID
  318. roleName: GameDataCenter.sevBack.userInfo?.a?.name, // 角色名
  319. roleLevel: GameDataCenter.sevBack.userInfo?.a?.level, // 角色等级,若游戏无角色及等级概念,可填关卡等级或不填,默认值为 1
  320. roleVipLevel: 1, // 角色VIP等级
  321. }, (params: any) => {
  322. console.log(params);
  323. });
  324. break;
  325. case ReportRoleType.levelup:
  326. window['dhSDK'].uploadRoleInfo({
  327. type: "LEVEL_UP", // 登录游戏服时传LOGIN_GAME,创角时传CREATE_ROLE,升级时传LEVEL_UP,充值成功时传PAY_SUCCESS
  328. areaId: parseInt(GameDataCenter.sevBack.userInfo?.a?.sid), // 游戏大区ID,若游戏无大区概念,可不填,默认值为 1,表示初始大区编号
  329. areaName: GameDataCenter.sevBack.qufuList[GameDataCenter.sevBack.userInfo?.a?.sid].name, // 游戏大区名称
  330. roleId: GameDataCenter.sevBack.userInfo?.a?.uuid, // 角色ID,若游戏无角色概念,可不填,默认值同 accountId 账号ID
  331. roleName: GameDataCenter.sevBack.userInfo?.a?.name, // 角色名
  332. roleLevel: GameDataCenter.sevBack.userInfo?.a?.level, // 角色等级,若游戏无角色及等级概念,可填关卡等级或不填,默认值为 1
  333. roleVipLevel: 1, // 角色VIP等级
  334. }, (params: any) => {
  335. console.log(params);
  336. });
  337. break;
  338. case ReportRoleType.offline:
  339. break;
  340. case ReportRoleType.online:
  341. break;
  342. case ReportRoleType.other:
  343. break;
  344. default:
  345. break;
  346. }
  347. if (isCreateRole) {
  348. // window['dhSDK'].analytics.register({
  349. // accountId: window['dhSDK'].userInfo.accountId,
  350. // extendParams: {}
  351. // }, () => {
  352. // // console.log(params);
  353. // });
  354. }
  355. }
  356. openService() {
  357. window['dhSDK'].openCustomerService({
  358. areaId: parseInt(GameDataCenter.sevBack.userInfo?.a?.sid),
  359. roleId: GameDataCenter.sevBack.userInfo?.a?.uuid,
  360. roleName: GameDataCenter.sevBack.userInfo?.a?.name,
  361. roleLevel: GameDataCenter.sevBack.userInfo?.a?.level,
  362. success: (response) => {
  363. console.log(response);
  364. },
  365. fail: (error) => {
  366. console.log(error);
  367. },
  368. complete: (result) => {
  369. // do something here...
  370. }
  371. });
  372. }
  373. // 订阅消息
  374. setSubscribe(tmplIds: string[], ids: string[]) {
  375. }
  376. initRewardedVideoAd(adkey: string) {
  377. console.log("初始化广告实例")
  378. //创建激励视频广告实例;建议提前创建好广告实例,在需要展示的时候直接调用实例的 show 方法展示即可
  379. GameController.rewardedVideoAd = window['dhSDK'].createRewardedVideoAd({
  380. adUnitId: adkey, // 请联系相关运营人员于微信公众平台后台创建并生成
  381. adPlatform: "weixin",
  382. adPosition: "",
  383. onLoad: (response) => {
  384. console.log("initRewardedVideoAd:" + response.code); // 响应状态码,此处为0,表示加载成功
  385. },
  386. onClose: (response) => {
  387. console.log(response.code); // 响应状态码,此处为0
  388. console.log(response.data); // 响应数据
  389. console.log(response.data.isCompleted); // 广告任务是否已完成,true 表示已完成,false 表示未完成
  390. // 用户已完成广告任务,即广告正常播放结束
  391. if (response.data.isCompleted) {
  392. // 这里可以通知游戏服务器下发广告奖励
  393. GameDataCenter.adVideo.onXiadanSucc()
  394. }
  395. // 用户未完成广告任务,即广告播放中途退出
  396. else {
  397. // 这里可以提示用户尚未完成广告播放
  398. }
  399. },
  400. onError: (error) => {
  401. console.log(error.code); // 响应状态码,此处为非0状态码
  402. console.log(error.message); // 错误消息
  403. }
  404. });
  405. }
  406. //视频广告
  407. showRewardAd(adkey: string, kid: string, order11Id: string): void {
  408. //用于加载广告
  409. const loadRewardedVideoAd = (options: any, times: number) => {
  410. // 先判断 rewardedVideoAd 是否存在再使用
  411. // 因为当用户的客户端基础库版本低于 2.0.4 时,调用 sdkInstance.createRewardedVideoAd 接口将返回 undefined
  412. if (!GameController.rewardedVideoAd) {
  413. return window['dhSDK'].modal.message("暂不支持激励视频广告");
  414. }
  415. // 手动重新加载广告
  416. GameController.rewardedVideoAd.load((response: any) => {
  417. // 响应状态码 response.code 为 0 时表示加载成功,可再次调用 show 方法进行展示
  418. if (response.code == 0) {
  419. showRewardedVideoAd(options, times);
  420. }
  421. // 其他非 0 状态码均表示加载失败,可向用户弹出错误消息 response.message,亦可自定义失败提示
  422. else {
  423. window['dhSDK'].modal.message(response.message);
  424. }
  425. });
  426. };
  427. //用于展示广告
  428. const showRewardedVideoAd = (options: any, times: number) => {
  429. // 先判断 rewardedVideoAd 是否存在再使用
  430. // 因为当用户的客户端基础库版本低于 2.0.4 时,调用 sdkInstance.createRewardedVideoAd 接口将返回 undefined
  431. if (!GameController.rewardedVideoAd) {
  432. return window['dhSDK'].modal.message("暂不支持激励视频广告");
  433. }
  434. // 广告实例的 show 方法用于展示广告,默认是隐藏的
  435. GameController.rewardedVideoAd.show(options, (response: any) => {
  436. // 响应状态码 response.code 为 0 时表示展示成功
  437. if (response.code == 0) {
  438. console.log("广告展示成功");
  439. }
  440. // 其他非 0 状态码均表示展示失败,可尝试利用实例的 load 方法手动重新加载,并在加载成功后再次调用 show 方法进行展示
  441. else {
  442. // 重试次数大于0时进行重试
  443. if (times > 0) {
  444. loadRewardedVideoAd(options, times--);
  445. }
  446. // 反之弹出错误消息 response.message,亦可自定义失败提示
  447. else {
  448. window['dhSDK'].modal.message(response.message);
  449. }
  450. }
  451. });
  452. };
  453. showRewardedVideoAd({ adPosition: "" }, 3);
  454. }
  455. checkMsg(str: string, cb: Function): void {
  456. // if (gameMethod.isEmpty(this.mint)) {
  457. // let cfg = Gamecfg.sensitiveInfo.pool
  458. // let sessionidInfo = Object.values(cfg)
  459. // let allSessionidStr = []
  460. // for (let i = 0; i < sessionidInfo.length; i++) {
  461. // allSessionidStr.push(sessionidInfo[i].desc)
  462. // }
  463. // this.mint = new Mint(allSessionidStr)
  464. // }
  465. // try {
  466. // let tempStr = str.replace(" ","")
  467. // tempStr = tempStr.replace("&","")
  468. // const status = this.mint.verify(tempStr)
  469. // console.log(status) // false
  470. // if (status) {
  471. // cb()
  472. // } else {
  473. // UIHelp.ShowTips("输入文字带有敏感词,请重新输入")
  474. // }
  475. // } catch (error) {
  476. // UIHelp.ShowTips("输入文字带有敏感词,请重新输入")
  477. // }
  478. cb()
  479. }
  480. }