Browse Source

修改

master
ljc 5 years ago
parent
commit
d944e669b1
11 changed files with 40 additions and 14 deletions
  1. +2
    -2
      laomenkuang_project/pages/TicketDetails/TicketDetails.js
  2. +3
    -3
      laomenkuang_project/pages/buyTicket/buyTicket.js
  3. +1
    -1
      laomenkuang_project/pages/givePage/givePage.js
  4. +1
    -1
      laomenkuang_project/pages/index/index.js
  5. +2
    -2
      laomenkuang_project/pages/personalCenter/personalCenter.js
  6. +1
    -1
      laomenkuang_project/pages/receiveTicket/receiveTicket.js
  7. +11
    -3
      laomenkuang_project/pages/register/register.js
  8. +2
    -1
      laomenkuang_project/pages/register/register.json
  9. +8
    -0
      laomenkuang_project/pages/shop/shop.js
  10. +1
    -0
      laomenkuang_project/pages/shop/shop.wxml
  11. +8
    -0
      laomenkuang_project/pages/shop/shop.wxss

+ 2
- 2
laomenkuang_project/pages/TicketDetails/TicketDetails.js View File

this.getTicketUser(options.id, 1) this.getTicketUser(options.id, 1)
this.getCodeFn(options.id) this.getCodeFn(options.id)
} else { } 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) {//获取优惠券信息 getTicketUser: function (id,from) {//获取优惠券信息

+ 3
- 3
laomenkuang_project/pages/buyTicket/buyTicket.js View File

if (app.globalData.openid) { if (app.globalData.openid) {
this.getTicketUser(options.index, 1) this.getTicketUser(options.index, 1)
} else { } else {
this.globalData.openidSuccessFuc = this.getTicketUser;
app.globalData.openidSuccessFuc = this.getTicketUser;
} }
}, },


app.wxRequest(app.globalData.httpUrl + 'order/paid', { sign_num: this.data.sign_num}, e => { app.wxRequest(app.globalData.httpUrl + 'order/paid', { sign_num: this.data.sign_num}, e => {
console.log(e) console.log(e)
if (e.code == 200) { if (e.code == 200) {
wx.switchTab({
url: '../buyTicket/buyTicket'
wx.reLaunch({
url: '/pages/personalCenter/personalCenter'
}) })
} }
}, this,"POST") }, this,"POST")

+ 1
- 1
laomenkuang_project/pages/givePage/givePage.js View File

if (app.globalData.openid) { if (app.globalData.openid) {
this.getTicketUser(options.id, 2) this.getTicketUser(options.id, 2)
} else { } else {
this.globalData.openidSuccessFuc = this.getTicketUser;
app.globalData.openidSuccessFuc = this.getTicketUser;
} }
this.data.sellId = options.id; this.data.sellId = options.id;
}, },

+ 1
- 1
laomenkuang_project/pages/index/index.js View File

if (app.globalData.openid){ if (app.globalData.openid){
this.getDataList(); this.getDataList();
}else{ }else{
this.globalData.openidSuccessFuc = this.getDataList;
app.globalData.openidSuccessFuc = this.getDataList;
} }
}, },

+ 2
- 2
laomenkuang_project/pages/personalCenter/personalCenter.js View File

this.myTicket(); this.myTicket();
this.historyTicket(); this.historyTicket();
} else { } else {
this.globalData.openidSuccessFuc = this.myTicket;
this.globalData.openidSuccessFuc = this.historyTicket;
app.globalData.openidSuccessFuc = this.myTicket;
app.globalData.openidSuccessFuc = this.historyTicket;
} }
}, },
myTicket:function(){//获取我的优惠券列表 myTicket:function(){//获取我的优惠券列表

+ 1
- 1
laomenkuang_project/pages/receiveTicket/receiveTicket.js View File

if (app.globalData.openid) { if (app.globalData.openid) {
this.getTicketUser(options.shareId, options.number); this.getTicketUser(options.shareId, options.number);
} else { } else {
this.globalData.openidSuccessFuc = this.getTicketUser;
app.globalData.openidSuccessFuc = this.getTicketUser;
} }
}, },



+ 11
- 3
laomenkuang_project/pages/register/register.js View File

num:60, num:60,
phone: "",//手机号 phone: "",//手机号
phoneCode: "",//验证码 phoneCode: "",//验证码
yesRegister:false,//防止重复点击注册
}, },


/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {

if (wx.canIUse('hideHomeButton')) {
wx.hideHomeButton()
}
}, },


/** /**
if (app.globalData.openid) { if (app.globalData.openid) {
this.yesCodeFn(); this.yesCodeFn();
} else { } else {
this.globalData.openidSuccessFuc = this.yesCodeFn;
app.globalData.openidSuccessFuc = this.yesCodeFn;
} }
}, },
if (app.globalData.openid) { if (app.globalData.openid) {
this.registerFn(); this.registerFn();
} else { } else {
this.globalData.openidSuccessFuc = this.registerFn;
app.globalData.openidSuccessFuc = this.registerFn;
} }
}, },
registerFn:function(){//注册接口 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 => { app.wxRequest(app.globalData.httpUrl + 'register', { user_phone: this.data.phone, code_num: this.data.phoneCode }, e => {
console.log(e) console.log(e)
if (e.code == 200) { if (e.code == 200) {
clearInterval(time); clearInterval(time);
app.globalData.userInfo = e.data.user_phone app.globalData.userInfo = e.data.user_phone
this.data.yesRegister = false;
this.setData({ this.setData({
minter: 60, minter: 60,
num: 60 num: 60

+ 2
- 1
laomenkuang_project/pages/register/register.json View File

{ {
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "注册"
} }

+ 8
- 0
laomenkuang_project/pages/shop/shop.js View File

this.data.dataArr = []; this.data.dataArr = [];
this.searchShop(true); this.searchShop(true);
}, },
deleteVal:function(){//清空搜索框
this.setData({
inputVal:""
})
this.data.pageNum = 1;
this.data.dataArr = [];
this.searchShop(true);
},
}) })

+ 1
- 0
laomenkuang_project/pages/shop/shop.wxml View File

<view class="searchView"> <view class="searchView">
<image class="searchIcon" src="../images/searchIcon.png"></image> <image class="searchIcon" src="../images/searchIcon.png"></image>
<input class="int" bindinput="getInputVal" value="{{inputVal}}" placeholder="输入搜索内容" placeholder-class="placeholderInt"></input> <input class="int" bindinput="getInputVal" value="{{inputVal}}" placeholder="输入搜索内容" placeholder-class="placeholderInt"></input>
<image class="delete" bindtap="deleteVal" src="../images/delete.png"></image>
</view> </view>
<view class="searchBtn" bindtap="searchFn">搜索</view> <view class="searchBtn" bindtap="searchFn">搜索</view>
</view> </view>

+ 8
- 0
laomenkuang_project/pages/shop/shop.wxss View File

margin-bottom: 40rpx; margin-bottom: 40rpx;
} }


.delete{
width: 35rpx;
height: 38rpx;
position: absolute;
right: 0;
top: 12rpx;
z-index: 9;
}

Loading…
Cancel
Save