expectedday.js 937 B

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