birthday.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const app = getApp()
  2. var util = require("../../utils/util.js")
  3. Page({
  4. data: {
  5. date: '2019-06-01',
  6. enddate: '',
  7. },
  8. bindDateChange: function(e) {
  9. console.log('picker发送选择改变,携带值为', e.detail.value)
  10. this.setData({
  11. date: e.detail.value
  12. })
  13. wx.setStorageSync(
  14. 'xu_content_date', e.detail.value
  15. )
  16. },
  17. gomine() {
  18. const that = this
  19. // 更新用户推送内容信息
  20. let xu_content_type = wx.getStorageSync('xu_content_type')||'B01';
  21. console.log(that.data.date);
  22. util.postData('/updateWXUser', {
  23. xu_openid: app.globalData.openid,
  24. xu_content_type: xu_content_type,
  25. xu_content_date: that.data.date
  26. })
  27. .then(res => {
  28. if (res == 1) {
  29. wx.navigateTo({
  30. url: '/pages/supermama/supermama'
  31. })
  32. }
  33. })
  34. .catch(err => {
  35. console.log(err);
  36. })
  37. },
  38. onLoad() {
  39. console.log(app.globalData.openid)
  40. const that = this;
  41. let date = wx.getStorageSync('todayDate');
  42. that.setData({
  43. endate: date
  44. })
  45. that.setData({
  46. date: date
  47. })
  48. }
  49. })