C端小程序
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

118 lignes
2.5 KiB

  1. var config = require("../../config/config.js");
  2. var app = getApp();
  3. const Http = require("../../utils/HttpBasics");
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. canIUse: wx.canIUse('official-account'),
  10. flag: 'hidden',
  11. score:'0',
  12. name:"",
  13. birthdate:"",
  14. sex:""
  15. },
  16. /**
  17. * 跳转到成长值的页面
  18. */
  19. gotograde:function(){
  20. wx.navigateTo({
  21. url: '/pages/grade/grade',
  22. })
  23. },
  24. // getrun:function(){
  25. // let that = this;
  26. // wx.getWeRunData({
  27. // success: function (res) {
  28. // console.log(res);
  29. // Http.post({
  30. // url: config.api.getWeRunData,
  31. // data: {
  32. // encryptedData: res.encryptedData,
  33. // iv: res.iv
  34. // }
  35. // }).then(res => {
  36. // console.log(res);
  37. // that.setData({
  38. // step: res.data.stepInfoList[30].step
  39. // })
  40. // })
  41. // }
  42. // })
  43. // },
  44. /**
  45. *
  46. */
  47. // getxinghao:function(){
  48. // wx.getSystemInfo({
  49. // success:function(res){
  50. // console.log(res);
  51. // wx.showModal({
  52. // content: res.brand,
  53. // })
  54. // }
  55. // })
  56. // },
  57. navigateTo() {
  58. wx.navigateTo({
  59. url: `/pages/login/index`
  60. });
  61. },
  62. showVersion: function() {
  63. /**
  64. * 长按显示版本号
  65. */
  66. let that = this;
  67. if (that.data.flag == 'hidden') {
  68. that.setData({
  69. flag: 'show'
  70. });
  71. }
  72. console.log(that.data.flag)
  73. },
  74. gotoedit:function(){
  75. wx.navigateTo({
  76. url: '/pages/edit/edit',
  77. })
  78. },
  79. /**
  80. * 生命周期函数--监听页面显示
  81. */
  82. onShow: function() {
  83. let that = this;
  84. let num = wx.getStorageSync('couponNum');
  85. wx.hideTabBarRedDot({
  86. index: 2
  87. });
  88. console.log("我是渲染")
  89. if (num == 'couponNum1') {
  90. wx.setStorage({
  91. key: 'couponNum',
  92. data: "couponNum1",
  93. })
  94. that.setData({
  95. couponNum: "couponNum1"
  96. })
  97. } else if (num == 'couponNum') {
  98. that.setData({
  99. couponNum: "couponNum"
  100. })
  101. };
  102. Http.get({
  103. url: config.api.getScore,
  104. data: {}
  105. }).then(res=>{
  106. console.log(res);
  107. that.setData({
  108. score: res.data.score,
  109. levelName: res.data.levelName,
  110. address: res.data.address,
  111. birthdate: res.data.birthdate,
  112. name: res.data.name,
  113. address: res.data.sex,
  114. })
  115. });
  116. // that.getrun();
  117. }
  118. });