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.

coupon.js 1.7KB

5 yıl önce
5 yıl önce
5 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // pages/coupon/coupon.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. type:2,//1券码核销 2手机号核销
  8. state:0,//核销未完成 1核销中 2核销已完成
  9. totalNums:50,//总数量
  10. nums:1,//核销数量
  11. },
  12. /**
  13. * 核销
  14. */
  15. writeOff:function(){
  16. console.log('核销')
  17. wx.switchTab({
  18. url: '../record/record'
  19. })
  20. },
  21. /**
  22. * 添加优惠券
  23. */
  24. addCoupon(){
  25. if (this.data.nums+1<=this.data.totalNums){
  26. this.setData({
  27. nums:this.data.nums+1
  28. })
  29. }
  30. },
  31. /**
  32. * 减少优惠券
  33. */
  34. reduceCoupon(){
  35. if (this.data.nums - 1 > 0) {
  36. this.setData({
  37. nums: this.data.nums - 1
  38. })
  39. }
  40. },
  41. /**
  42. * 生命周期函数--监听页面加载
  43. */
  44. onLoad: function (options) {
  45. wx.hideShareMenu();
  46. var code = options.code;
  47. var pohone = options.phone;
  48. if (code){//券码查询
  49. console.log('券码查询')
  50. }
  51. if (pohone){//手机号查询
  52. console.log('手机号查询')
  53. }
  54. },
  55. /**
  56. * 生命周期函数--监听页面初次渲染完成
  57. */
  58. onReady: function () {
  59. },
  60. /**
  61. * 生命周期函数--监听页面显示
  62. */
  63. onShow: function () {
  64. },
  65. /**
  66. * 生命周期函数--监听页面隐藏
  67. */
  68. onHide: function () {
  69. },
  70. /**
  71. * 生命周期函数--监听页面卸载
  72. */
  73. onUnload: function () {
  74. },
  75. /**
  76. * 页面相关事件处理函数--监听用户下拉动作
  77. */
  78. onPullDownRefresh: function () {
  79. },
  80. /**
  81. * 页面上拉触底事件的处理函数
  82. */
  83. onReachBottom: function () {
  84. },
  85. /**
  86. * 用户点击右上角分享
  87. */
  88. onShareAppMessage: function () {
  89. }
  90. })