| @@ -22,8 +22,8 @@ Page({ | |||
| this.getTicketUser(options.id, 1) | |||
| this.getCodeFn(options.id) | |||
| } else { | |||
| this.globalData.openidSuccessFuc = this.getTicketUser; | |||
| this.globalData.openidSuccessFuc = this.getCodeFn; | |||
| app.globalData.openidSuccessFuc = this.getTicketUser; | |||
| app.globalData.openidSuccessFuc = this.getCodeFn; | |||
| } | |||
| }, | |||
| getTicketUser: function (id,from) {//获取优惠券信息 | |||
| @@ -22,7 +22,7 @@ Page({ | |||
| if (app.globalData.openid) { | |||
| this.getTicketUser(options.index, 1) | |||
| } else { | |||
| this.globalData.openidSuccessFuc = this.getTicketUser; | |||
| app.globalData.openidSuccessFuc = this.getTicketUser; | |||
| } | |||
| }, | |||
| @@ -126,8 +126,8 @@ Page({ | |||
| app.wxRequest(app.globalData.httpUrl + 'order/paid', { sign_num: this.data.sign_num}, e => { | |||
| console.log(e) | |||
| if (e.code == 200) { | |||
| wx.switchTab({ | |||
| url: '../buyTicket/buyTicket' | |||
| wx.reLaunch({ | |||
| url: '/pages/personalCenter/personalCenter' | |||
| }) | |||
| } | |||
| }, this,"POST") | |||
| @@ -25,7 +25,7 @@ Page({ | |||
| if (app.globalData.openid) { | |||
| this.getTicketUser(options.id, 2) | |||
| } else { | |||
| this.globalData.openidSuccessFuc = this.getTicketUser; | |||
| app.globalData.openidSuccessFuc = this.getTicketUser; | |||
| } | |||
| this.data.sellId = options.id; | |||
| }, | |||
| @@ -11,7 +11,7 @@ Page({ | |||
| if (app.globalData.openid){ | |||
| this.getDataList(); | |||
| }else{ | |||
| this.globalData.openidSuccessFuc = this.getDataList; | |||
| app.globalData.openidSuccessFuc = this.getDataList; | |||
| } | |||
| }, | |||
| @@ -32,8 +32,8 @@ Page({ | |||
| this.myTicket(); | |||
| this.historyTicket(); | |||
| } else { | |||
| this.globalData.openidSuccessFuc = this.myTicket; | |||
| this.globalData.openidSuccessFuc = this.historyTicket; | |||
| app.globalData.openidSuccessFuc = this.myTicket; | |||
| app.globalData.openidSuccessFuc = this.historyTicket; | |||
| } | |||
| }, | |||
| myTicket:function(){//获取我的优惠券列表 | |||
| @@ -27,7 +27,7 @@ Page({ | |||
| if (app.globalData.openid) { | |||
| this.getTicketUser(options.shareId, options.number); | |||
| } else { | |||
| this.globalData.openidSuccessFuc = this.getTicketUser; | |||
| app.globalData.openidSuccessFuc = this.getTicketUser; | |||
| } | |||
| }, | |||
| @@ -13,6 +13,7 @@ Page({ | |||
| num:60, | |||
| phone: "",//手机号 | |||
| phoneCode: "",//验证码 | |||
| yesRegister:false,//防止重复点击注册 | |||
| }, | |||
| /** | |||
| @@ -33,7 +34,9 @@ Page({ | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| if (wx.canIUse('hideHomeButton')) { | |||
| wx.hideHomeButton() | |||
| } | |||
| }, | |||
| /** | |||
| @@ -102,7 +105,7 @@ Page({ | |||
| if (app.globalData.openid) { | |||
| this.yesCodeFn(); | |||
| } else { | |||
| this.globalData.openidSuccessFuc = this.yesCodeFn; | |||
| app.globalData.openidSuccessFuc = this.yesCodeFn; | |||
| } | |||
| }, | |||
| @@ -131,15 +134,20 @@ Page({ | |||
| if (app.globalData.openid) { | |||
| this.registerFn(); | |||
| } else { | |||
| this.globalData.openidSuccessFuc = this.registerFn; | |||
| app.globalData.openidSuccessFuc = this.registerFn; | |||
| } | |||
| }, | |||
| registerFn:function(){//注册接口 | |||
| if (this.data.yesRegister){ | |||
| return; | |||
| } | |||
| this.data.yesRegister = true; | |||
| app.wxRequest(app.globalData.httpUrl + 'register', { user_phone: this.data.phone, code_num: this.data.phoneCode }, e => { | |||
| console.log(e) | |||
| if (e.code == 200) { | |||
| clearInterval(time); | |||
| app.globalData.userInfo = e.data.user_phone | |||
| this.data.yesRegister = false; | |||
| this.setData({ | |||
| minter: 60, | |||
| num: 60 | |||
| @@ -1,3 +1,4 @@ | |||
| { | |||
| "usingComponents": {} | |||
| "usingComponents": {}, | |||
| "navigationBarTitleText": "注册" | |||
| } | |||
| @@ -232,4 +232,12 @@ Page({ | |||
| this.data.dataArr = []; | |||
| this.searchShop(true); | |||
| }, | |||
| deleteVal:function(){//清空搜索框 | |||
| this.setData({ | |||
| inputVal:"" | |||
| }) | |||
| this.data.pageNum = 1; | |||
| this.data.dataArr = []; | |||
| this.searchShop(true); | |||
| }, | |||
| }) | |||
| @@ -12,6 +12,7 @@ | |||
| <view class="searchView"> | |||
| <image class="searchIcon" src="../images/searchIcon.png"></image> | |||
| <input class="int" bindinput="getInputVal" value="{{inputVal}}" placeholder="输入搜索内容" placeholder-class="placeholderInt"></input> | |||
| <image class="delete" bindtap="deleteVal" src="../images/delete.png"></image> | |||
| </view> | |||
| <view class="searchBtn" bindtap="searchFn">搜索</view> | |||
| </view> | |||
| @@ -139,3 +139,11 @@ page{ | |||
| margin-bottom: 40rpx; | |||
| } | |||
| .delete{ | |||
| width: 35rpx; | |||
| height: 38rpx; | |||
| position: absolute; | |||
| right: 0; | |||
| top: 12rpx; | |||
| z-index: 9; | |||
| } | |||