Commit badf03c89115f5e3e94d5c816c3b8f5ff553cab6
1 parent
35e87dd4
抢红包问题修改
Showing
5 changed files
with
49 additions
and
19 deletions
packageA/pages/hongBao/hongBao.js
| @@ -322,6 +322,10 @@ Page({ | @@ -322,6 +322,10 @@ Page({ | ||
| 322 | 322 | ||
| 323 | 323 | ||
| 324 | gotoDetails() { | 324 | gotoDetails() { |
| 325 | + // this.data.qiangHongBao = false; | ||
| 326 | + this.setData({ | ||
| 327 | + qiangHongBao: false | ||
| 328 | + }); | ||
| 325 | app.goto('/packageA/pages/hongBaoDetails/hongBaoDetails?redid=' + this.data.hongBaoData.id); | 329 | app.goto('/packageA/pages/hongBaoDetails/hongBaoDetails?redid=' + this.data.hongBaoData.id); |
| 326 | }, | 330 | }, |
| 327 | 331 |
packageA/pages/hongBaoDetails/hongBaoDetails.js
| @@ -22,27 +22,35 @@ Page({ | @@ -22,27 +22,35 @@ Page({ | ||
| 22 | onLoad: function (options) { | 22 | onLoad: function (options) { |
| 23 | _this = this; | 23 | _this = this; |
| 24 | console.log('options', options); | 24 | console.log('options', options); |
| 25 | - this.data.options = options; | ||
| 26 | - reqData.url = '/api/weshop/redmoney/redRecord/page', | ||
| 27 | - reqData.data = { | ||
| 28 | - store_id: app.globalData.setting.stoid, | ||
| 29 | - redid: this.data.options.redid, | ||
| 30 | - }; | ||
| 31 | - reqData.data2 = { | ||
| 32 | - store_id: app.globalData.setting.stoid, | ||
| 33 | - user_id: app.globalData.user_id, | ||
| 34 | - redid: this.data.options.redid, | ||
| 35 | - pageSize: 1, | ||
| 36 | - page: 1, | ||
| 37 | - }; | ||
| 38 | - this.getData(true, reqData.url, reqData.data); | ||
| 39 | - this.requestData(reqData.url, reqData.data2) | 25 | + |
| 26 | + this.isLogin() | ||
| 40 | .then(function(data) { | 27 | .then(function(data) { |
| 41 | - _this.setData({ | ||
| 42 | - myRed: data.data.data.pageData[0] | 28 | + |
| 29 | + _this.data.options = options; | ||
| 30 | + reqData.url = '/api/weshop/redmoney/redRecord/page', | ||
| 31 | + reqData.data = { | ||
| 32 | + store_id: app.globalData.setting.stoid, | ||
| 33 | + redid: _this.data.options.redid, | ||
| 34 | + }; | ||
| 35 | + reqData.data2 = { | ||
| 36 | + store_id: app.globalData.setting.stoid, | ||
| 37 | + user_id: app.globalData.user_id, | ||
| 38 | + redid: _this.data.options.redid, | ||
| 39 | + pageSize: 1, | ||
| 40 | + page: 1, | ||
| 41 | + }; | ||
| 42 | + _this.getData(true, reqData.url, reqData.data); | ||
| 43 | + _this.requestData(reqData.url, reqData.data2) | ||
| 44 | + .then(function(data) { | ||
| 45 | + _this.setData({ | ||
| 46 | + myRed: data.data.data.pageData[0] | ||
| 47 | + }); | ||
| 48 | + // console.log('123', data.data.data.pageData[0]); | ||
| 43 | }); | 49 | }); |
| 44 | - // console.log('123', data.data.data.pageData[0]); | 50 | + |
| 45 | }); | 51 | }); |
| 52 | + | ||
| 53 | + | ||
| 46 | }, | 54 | }, |
| 47 | 55 | ||
| 48 | /** | 56 | /** |
| @@ -94,6 +102,20 @@ Page({ | @@ -94,6 +102,20 @@ Page({ | ||
| 94 | 102 | ||
| 95 | }, | 103 | }, |
| 96 | 104 | ||
| 105 | + // 判断是否授权登录 | ||
| 106 | + isLogin() { | ||
| 107 | + return new Promise((resolve, reject) => { | ||
| 108 | + let user_info = app.globalData.userInfo; | ||
| 109 | + if(user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 110 | + wx.navigateTo({ | ||
| 111 | + url: '/pages/togoin/togoin', | ||
| 112 | + }) | ||
| 113 | + } else { | ||
| 114 | + resolve(); | ||
| 115 | + }; | ||
| 116 | + }); | ||
| 117 | + }, | ||
| 118 | + | ||
| 97 | // 请求数据 | 119 | // 请求数据 |
| 98 | requestData(url, data) { | 120 | requestData(url, data) { |
| 99 | return new Promise((resolve, reject) => { | 121 | return new Promise((resolve, reject) => { |
packageA/pages/hongBaoDetails/hongBaoDetails.json
| 1 | { | 1 | { |
| 2 | "usingComponents": { | 2 | "usingComponents": { |
| 3 | - "nodata": "/components/nodata/nodata" | 3 | + "nodata": "/components/nodata/nodata", |
| 4 | + "nav_box": "/components/nav_box/nav_box" | ||
| 4 | }, | 5 | }, |
| 5 | "enablePullDownRefresh": false, | 6 | "enablePullDownRefresh": false, |
| 6 | "navigationBarTitleText": "抢红包" | 7 | "navigationBarTitleText": "抢红包" |
packageA/pages/hongBaoDetails/hongBaoDetails.wxml
| @@ -45,6 +45,8 @@ | @@ -45,6 +45,8 @@ | ||
| 45 | <!-- <view class="no-more txt-center" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 没有更多了 -</view> --> | 45 | <!-- <view class="no-more txt-center" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 没有更多了 -</view> --> |
| 46 | </view> | 46 | </view> |
| 47 | 47 | ||
| 48 | +<nav_box></nav_box> | ||
| 49 | + | ||
| 48 | <!-- 弹窗 --> | 50 | <!-- 弹窗 --> |
| 49 | <!-- <view class="popup-container"> | 51 | <!-- <view class="popup-container"> |
| 50 | <view class="popup"> | 52 | <view class="popup"> |
pages/index/index/index.js