东风启辰小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 5 година
пре 5 година
пре 5 година
пре 5 година
пре 5 година
пре 5 година
пре 5 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // pages/coupon/coupon.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. imgUrl: app.globalData.urlStatic,//图片路径
  9. friendOpenid:null,//朋友的openid
  10. countNum:0,
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad: function (options) {
  16. app.globalData.nowPage = 2;
  17. if (options.friendOpenid) {
  18. this.data.friendOpenid = options.friendOpenid;
  19. }
  20. if (app.globalData.openid) {
  21. this.getOrderInfo();
  22. } else {
  23. app.globalData.openidSuccessFuc = this.getOrderInfo;
  24. }
  25. },
  26. /**
  27. * 生命周期函数--监听页面初次渲染完成
  28. */
  29. onReady: function () {
  30. },
  31. /**
  32. * 生命周期函数--监听页面显示
  33. */
  34. onShow: function () {
  35. },
  36. /**
  37. * 生命周期函数--监听页面隐藏
  38. */
  39. onHide: function () {
  40. },
  41. /**
  42. * 生命周期函数--监听页面卸载
  43. */
  44. onUnload: function () {
  45. },
  46. /**
  47. * 页面相关事件处理函数--监听用户下拉动作
  48. */
  49. onPullDownRefresh: function () {
  50. },
  51. /**
  52. * 页面上拉触底事件的处理函数
  53. */
  54. onReachBottom: function () {
  55. },
  56. /**
  57. * 用户点击右上角分享
  58. */
  59. onShareAppMessage: function () {
  60. return app.sharePack();
  61. },
  62. receive: function () {//立即领取
  63. wx.reLaunch({
  64. url: '/pages/index/index',
  65. })
  66. },
  67. getOrderInfo: function () {//查询是否已注册
  68. app.wxRequest(app.globalData.urlRoot +"userInfo/getOrderInfo",{},res=>{
  69. if(res.code==200){
  70. if(res.data){
  71. wx.reLaunch({
  72. url: '/pages/index/index',
  73. })
  74. }else{
  75. this.getTotalOrder();
  76. wx.setStorageSync("friendOpenid", this.data.friendOpenid);
  77. app.globalData.friendOpenid = this.data.friendOpenid;
  78. }
  79. }
  80. },this)
  81. },
  82. getTotalOrder:function(){//获取预约人数
  83. app.wxRequest(app.globalData.urlRoot + "userInfo/getTotalOrder", {}, res => {
  84. if (res.code == 200) {
  85. if (res.data) {
  86. this.setData({
  87. countNum: res.data.total
  88. })
  89. }
  90. }
  91. }, this)
  92. }
  93. })