东风启辰小程序端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

guessSecondPrize.js 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. // pages/guessSecondPrize/guessSecondPrize.js
  2. const app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. imgUrl: app.globalData.urlStatic,//图片路径
  9. ruleShow:false,//是否显示竞猜规则
  10. inputValue:"",//输入的价格
  11. stringValue:"",
  12. focusState:false,
  13. tipImgShow:true,
  14. },
  15. /**
  16. * 生命周期函数--监听页面加载
  17. */
  18. onLoad: function (options) {
  19. app.globalData.nowPage = 3;
  20. if (app.globalData.openid) {
  21. this.loadFun();
  22. } else {
  23. app.globalData.openidSuccessFuc = this.loadFun;
  24. }
  25. },
  26. loadFun:function(){
  27. },
  28. /**
  29. * 生命周期函数--监听页面初次渲染完成
  30. */
  31. onReady: function () {
  32. },
  33. /**
  34. * 生命周期函数--监听页面显示
  35. */
  36. onShow: function () {
  37. },
  38. /**
  39. * 生命周期函数--监听页面隐藏
  40. */
  41. onHide: function () {
  42. },
  43. /**
  44. * 生命周期函数--监听页面卸载
  45. */
  46. onUnload: function () {
  47. },
  48. /**
  49. * 页面相关事件处理函数--监听用户下拉动作
  50. */
  51. onPullDownRefresh: function () {
  52. },
  53. /**
  54. * 页面上拉触底事件的处理函数
  55. */
  56. onReachBottom: function () {
  57. },
  58. /**
  59. * 用户点击右上角分享
  60. */
  61. onShareAppMessage: function () {
  62. },
  63. enterLucky:function(){//每日抽奖
  64. wx.navigateTo({
  65. url: '/pages/luckyStar/luckyStar'
  66. })
  67. },
  68. ruleControl:function(){//规则显示控制
  69. this.setData({
  70. ruleShow:!this.data.ruleShow
  71. })
  72. },
  73. focusControl:function(){
  74. this.setData({
  75. focusState:true
  76. })
  77. },
  78. focusControl2:function(){
  79. this.setData({
  80. focusState:false
  81. })
  82. },
  83. getValue:function(e){
  84. this.data.inputValue = e.detail.value;
  85. if(e.detail.value){
  86. this.setData({
  87. tipImgShow:false
  88. })
  89. }else{
  90. this.setData({
  91. tipImgShow:true
  92. })
  93. }
  94. this.setData({
  95. stringValue:e.detail.value
  96. })
  97. },
  98. submitPrice2:function(){
  99. if(this.data.inputValue>150000 || this.data.inputValue<110000){
  100. this.tipWindowControl();
  101. }else{
  102. this.data.guessPrice = this.data.inputValue;
  103. this.data.guessPriceArr = this.data.guessPrice.toString().split("");
  104. for(let i=0;i<this.data.guessPriceArr.length;i++){
  105. this.data.guessPriceArr[i] = parseInt(this.data.guessPriceArr[i]);
  106. }
  107. this.setData({
  108. guessPriceArr:this.data.guessPriceArr
  109. })
  110. console.log(this.data.guessPrice);
  111. console.log(this.data.guessPriceArr);
  112. this.tipWindowControl2();
  113. }
  114. // this.submitFirstGuessInfo();
  115. },
  116. tipWindowControl:function(){
  117. this.setData({
  118. tipWindow:!this.data.tipWindow
  119. })
  120. if(!this.data.tipWindow){
  121. this.setData({
  122. stringValue:"",
  123. tipImgShow:true
  124. })
  125. }
  126. },
  127. tipWindowControl2:function(){
  128. this.setData({
  129. tipWindow2:!this.data.tipWindow2
  130. })
  131. },
  132. tipWindowControl3:function(){
  133. this.setData({
  134. stringValue:"",
  135. tipImgShow:true
  136. })
  137. this.setData({
  138. tipWindow2:!this.data.tipWindow2
  139. })
  140. }
  141. })