C端小程序
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

64 Zeilen
1.9 KiB

  1. const Http = require("../../utils/HttpBasics");
  2. const config = require("../../config/config");
  3. let app = getApp();
  4. Page({
  5. data: {
  6. token:'',
  7. url:''
  8. },
  9. bindGetMsg(e){
  10. console.log(e,1234565432)
  11. },
  12. onShareAppMessage: function (res) {
  13. let _this=this;
  14. return {
  15. title: '富茂小游戏',
  16. path: 'pages/game/index',
  17. success: function (res) {
  18. // 转发成功
  19. _this.setData({
  20. url: "https://game.youlane.cn/luckCard/index.html" + "?token=" + app.globalData.token + "&gameId=" + options.gameId + "&id=" + options.id,
  21. // url: "http://10.11.195.31:8080/luckCard/?token=" + app.globalData.token + '&forwardIf=true'
  22. });
  23. },
  24. fail: function (res) {
  25. // 转发失败
  26. console.log(666)
  27. _this.setData({
  28. url: "https://game.youlane.cn/luckCard/index.html?token=" + app.globalData.token +'&forwardIf=true',
  29. // url: "http://10.11.195.31:8080/luckCard/?token=" + app.globalData.token + '&forwardIf=true'
  30. });
  31. }
  32. }
  33. },
  34. onShow: function () {
  35. // console.log(app.globalData.havePlayEd)
  36. app.globalData.havePlayEd=true
  37. let num = wx.getStorageSync('couponNum');
  38. if (num == 'couponNum') {
  39. wx.showTabBarRedDot({
  40. index: 2
  41. })
  42. };
  43. },
  44. onLoad(options) {
  45. console.log(options,999999999)
  46. if (options.share){
  47. // wx.onShareAppMessage();
  48. }else{
  49. // Http.get({
  50. // url: config.api.getGame,
  51. // data: {
  52. // token: app.globalData.token,
  53. // }
  54. // })
  55. // .then(res => {
  56. // console.log(res.data, 333);
  57. // })
  58. this.setData({
  59. url: options.url + "?token=" + app.globalData.token + "&gameId=" + options.gameId + "&id=" + options.id,
  60. // url: "http://10.11.195.31:8080/luckCard/" + "?token=" + app.globalData.token + "&gameId=" + options.gameId + "&id=" + options.id,
  61. });
  62. }
  63. }
  64. });