|
- // pages/guessSecondPrize/guessSecondPrize.js
- const app = getApp();
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- imgUrl: app.globalData.urlStatic,//图片路径
- ruleShow:false,//是否显示竞猜规则
- inputValue:"",//输入的价格
- stringValue:"",
- focusState:false,
- tipImgShow:true,
-
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- app.globalData.nowPage = 3;
- if (app.globalData.openid) {
- this.loadFun();
- } else {
- app.globalData.openidSuccessFuc = this.loadFun;
- }
- },
- loadFun:function(){
-
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
-
- },
- enterLucky:function(){//每日抽奖
- wx.navigateTo({
- url: '/pages/luckyStar/luckyStar'
- })
- },
- ruleControl:function(){//规则显示控制
- this.setData({
- ruleShow:!this.data.ruleShow
- })
- },
- focusControl:function(){
- this.setData({
- focusState:true
- })
- },
- focusControl2:function(){
- this.setData({
- focusState:false
- })
- },
- getValue:function(e){
- this.data.inputValue = e.detail.value;
- if(e.detail.value){
- this.setData({
- tipImgShow:false
- })
- }else{
- this.setData({
- tipImgShow:true
- })
- }
- this.setData({
- stringValue:e.detail.value
- })
- },
- submitPrice2:function(){
- if(this.data.inputValue>150000 || this.data.inputValue<110000){
- this.tipWindowControl();
- }else{
- this.data.guessPrice = this.data.inputValue;
- this.data.guessPriceArr = this.data.guessPrice.toString().split("");
- for(let i=0;i<this.data.guessPriceArr.length;i++){
- this.data.guessPriceArr[i] = parseInt(this.data.guessPriceArr[i]);
- }
- this.setData({
- guessPriceArr:this.data.guessPriceArr
- })
- console.log(this.data.guessPrice);
- console.log(this.data.guessPriceArr);
- this.tipWindowControl2();
- }
- // this.submitFirstGuessInfo();
- },
- tipWindowControl:function(){
- this.setData({
- tipWindow:!this.data.tipWindow
- })
- if(!this.data.tipWindow){
- this.setData({
- stringValue:"",
- tipImgShow:true
- })
- }
- },
- tipWindowControl2:function(){
- this.setData({
- tipWindow2:!this.data.tipWindow2
- })
- },
- tipWindowControl3:function(){
- this.setData({
- stringValue:"",
- tipImgShow:true
- })
- this.setData({
- tipWindow2:!this.data.tipWindow2
- })
- }
- })
|