From 042c1b74c69395c2995c8c28a5cf6808f36d59b7 Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Mon, 28 Jan 2019 14:51:21 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BC=98=E6=83=A0=E5=8D=A1=EF=BC=8C=E5=81=9C?= =?UTF-8?q?=E8=BD=A6=EF=BC=8C=E9=A6=96=E9=A1=B5][=E4=BF=AE=E6=94=B9]:[?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=8D=A1=E8=BF=94=E5=9B=9E=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E5=88=B8=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E7=9A=84=E6=8C=89=E9=92=AE=EF=BC=8C=E5=81=9C=E8=BD=A6?= =?UTF-8?q?=E5=88=B8=E8=BF=94=E5=9B=9E=EF=BC=8C]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/bargain/bargainDatail/bargainDatail.js | 4 +- .../bargain/bargainDatail/bargainDatail.wxml | 14 +-- .../bargain/bargainDatail/bargainDatail.wxss | 20 ++-- pages/cardorder/index/index.wxml | 2 +- pages/coupon/detail/index.js | 5 + pages/coupon/detail/index.wxml | 1 + pages/coupon/detail/index.wxss | 23 +++- pages/couponorder/index/index.wxml | 2 +- pages/discountCardList/discountCardList.wxml | 2 +- pages/getuserinfo/index.js | 6 +- pages/index/index.js | 113 ++++++++---------- pages/login/index.js | 37 +----- pages/passCar/choicecoupon/choicecoupon.wxml | 2 +- pages/passCar/couponList/couponList.wxml | 2 +- pages/user/index.wxml | 2 +- 15 files changed, 110 insertions(+), 125 deletions(-) diff --git a/pages/bargain/bargainDatail/bargainDatail.js b/pages/bargain/bargainDatail/bargainDatail.js index 342f454..77d7fcb 100644 --- a/pages/bargain/bargainDatail/bargainDatail.js +++ b/pages/bargain/bargainDatail/bargainDatail.js @@ -52,8 +52,8 @@ Page({ }) }, goback:function(){ - wx.reLaunch({ - url: '/pages/index/index', + wx.switchTab({ + url: '/pages/login/index', }) }, /** diff --git a/pages/bargain/bargainDatail/bargainDatail.wxml b/pages/bargain/bargainDatail/bargainDatail.wxml index 9756b4d..e7647a5 100644 --- a/pages/bargain/bargainDatail/bargainDatail.wxml +++ b/pages/bargain/bargainDatail/bargainDatail.wxml @@ -1,3 +1,4 @@ + @@ -57,13 +58,12 @@ - - - - + + + diff --git a/pages/bargain/bargainDatail/bargainDatail.wxss b/pages/bargain/bargainDatail/bargainDatail.wxss index d4dd49b..b55b17a 100644 --- a/pages/bargain/bargainDatail/bargainDatail.wxss +++ b/pages/bargain/bargainDatail/bargainDatail.wxss @@ -217,29 +217,29 @@ z-index: 100; background: #fff; } -.btns > view,.btns > button{ - width: 330rpx; +.btns button{ + width: 320rpx!important; height: 95rpx; border-radius:48rpx; text-align: center; } .btns .fl{ - width: 250rpx; color: #fff; background:rgba(255,169,2,1); box-shadow:0px 8px 8px 1px rgba(255,169,2,0.32); - margin-left: 22rpx; } .goback{ - position: relative; - float: left; - width:122rpx!important; - height:95rpx; + position: fixed; + right: 38rpx; + top: 60rpx; + width:100rpx!important; + height:100rpx; + z-index: 100; background:rgba(255,255,255,1); line-height: 95rpx; border:1rpx solid rgba(227,227,227,1); box-shadow:0px 8px 8px 1px rgba(189,189,189,0.32); - border-radius:48rpx; + border-radius:50%; } .goback image{ position: absolute; @@ -262,7 +262,7 @@ font-size: 30rpx; color: #fff; line-height: 95rpx; - width: 271rpx; + width: 256rpx; background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%); box-shadow:0px 8px 8px 1px rgba(246,93,51,0.32); } diff --git a/pages/cardorder/index/index.wxml b/pages/cardorder/index/index.wxml index ee58c92..2859db6 100644 --- a/pages/cardorder/index/index.wxml +++ b/pages/cardorder/index/index.wxml @@ -8,7 +8,7 @@ 请您敬请期待 我们正在筹备一大波优惠活动 - + diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index f900f6d..f561ea1 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -54,6 +54,11 @@ Page({ phoneNumber: e.target.dataset.merchantlinkphone }); }, + goback: function () { + wx.switchTab({ + url: '/pages/login/index', + }) + }, /** * 点击提交问题单选 */ diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index fa76213..014d7fe 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -84,6 +84,7 @@ + diff --git a/pages/coupon/detail/index.wxss b/pages/coupon/detail/index.wxss index 8a21dbc..d2d876f 100644 --- a/pages/coupon/detail/index.wxss +++ b/pages/coupon/detail/index.wxss @@ -279,13 +279,34 @@ button::after{ border: none; } position: relative; background: #00c0ff; height: 94rpx; - width: 670rpx; + width: 560rpx; margin: 0 auto 30rpx; color: #fff; font-size: 36rpx; line-height: 94rpx; border-radius: 61rpx; } +.goback{ + position: relative; + float: left; + width:122rpx!important; + height:95rpx; + background:rgba(255,255,255,1); + line-height: 95rpx; + border:1rpx solid rgba(227,227,227,1); + box-shadow:0px 8px 8px 1px rgba(189,189,189,0.32); + border-radius:48rpx; + margin-left: 25rpx; +} +.goback image{ + position: absolute; + width: 60rpx; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin: auto; +} .tel { right: 0; diff --git a/pages/couponorder/index/index.wxml b/pages/couponorder/index/index.wxml index e03d5ab..00ba180 100644 --- a/pages/couponorder/index/index.wxml +++ b/pages/couponorder/index/index.wxml @@ -8,7 +8,7 @@ 请您敬请期待 我们正在筹备一大波优惠活动 - + diff --git a/pages/discountCardList/discountCardList.wxml b/pages/discountCardList/discountCardList.wxml index dac3ee4..eaec6d3 100644 --- a/pages/discountCardList/discountCardList.wxml +++ b/pages/discountCardList/discountCardList.wxml @@ -9,7 +9,7 @@ 请您敬请期待 我们正在筹备一大波优惠活动 - + diff --git a/pages/getuserinfo/index.js b/pages/getuserinfo/index.js index 11144a7..2c905d7 100755 --- a/pages/getuserinfo/index.js +++ b/pages/getuserinfo/index.js @@ -64,16 +64,16 @@ Page({ } else { //返回主页 if (that.data.couponChannelId && that.data.couponId) { - wx.redirectTo({ + wx.navigateTo({ url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&couponId=${that.data.couponId}` }); } else if (that.data.orderId) { - wx.redirectTo({ + wx.navigateTo({ url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}&from=${"friend"}` }); } else { wx.switchTab({ - url: "/pages/index/index" + url: "/pages/login/index" }); } } diff --git a/pages/index/index.js b/pages/index/index.js index 1887fd7..0135e6d 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -19,8 +19,6 @@ Page({ icon: "loading", duration: 2000 }) - console.log(options); - console.log("----------------------------------options---------------------------------------") wx.setStorageSync('options', JSON.stringify(options)) wx.setStorageSync('imgurl', imgurl) if (decodeURIComponent(options.scene) == "undefined") { @@ -39,6 +37,42 @@ Page({ that.userLogin() } }, + checkuerstatus(couponChannelId, couponId, orderId) { + let that = this; + Http.post({ + url: config.api.checkUserStatus, + data: {} + }) + .then(res => { + if (couponChannelId && couponId) { + wx.redirectTo({ + url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, + }) + } else if (orderId) { + wx.redirectTo({ + url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${orderId}&from='${"discount"}`, + }) + }else{ + wx.switchTab({ + url: '/pages/login/index' + }); + } + }) + .catch(err => { + if (err.code == 11004) { + // 用户昵称未授权 + if (couponChannelId && couponId) { + wx.redirectTo({ + url: `/pages/getuserinfo/index?couponChannelId=${couponChannelId}&couponId=${couponId}` + }); + } else if (orderId) { + wx.redirectTo({ + url: `/pages/getuserinfo/index?orderId=${orderId}&from='${"discount"}` + }); + } + } + }); + }, /** * 用户登录 */ @@ -84,71 +118,30 @@ Page({ }) app.globalData.token = res.data.token; Http.setToken(res.data.token); - if(orderId){ - wx.redirectTo({ - url: '/pages/bargain/bargainDatail/bargainDatail?orderId='+orderId, - }) + if (couponChannelId&&couponId || orderId){ + that.checkuerstatus(couponChannelId, couponId, orderId); }else{ - wx.switchTab({ - url: '/pages/login/index', - }) + that.checkuerstatus(); } }) .catch(err => { - wx.showToast({ - title: err.message, - icon: "none" + wx.showModal({ + title: '提示', + showCancel: false, + content: '登录失败,请重新尝试', + success:function(res){ + if (res.cancel) { + //点击取消,默认隐藏弹框 + } else { + //点击确定 + wx.reLaunch({ + url: '/pages/index/index', + }) + } + } }) }); } }); }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function() { - - } }) \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js index 9aaf4e4..7316359 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -244,7 +244,6 @@ Page({ if (app.businessListCallback) { app.businessListCallback(app.globalData.token); } - that.checkuerstatus(couponChannelId, couponId, orderId); Http.get({ url: config.api.getWeapNote, data: { @@ -266,41 +265,7 @@ Page({ }); }); }, - checkuerstatus(couponChannelId, couponId, orderId) { - Http.post({ - url: config.api.checkUserStatus, - data: {} - }) - .then(res => { - if (couponChannelId && couponId) { - wx.navigateTo({ - url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, - }) - } else if (orderId) { - wx.navigateTo({ - url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${orderId}&from='${"discount"}`, - }) - } - }) - .catch(err => { - if (err.code == 11004) { - // 用户昵称未授权 - if (couponChannelId && couponId) { - wx.redirectTo({ - url: `/pages/getuserinfo/index?couponChannelId=${couponChannelId}&couponId=${couponId}` - }); - } else if (orderId) { - wx.redirectTo({ - url: `/pages/getuserinfo/index?orderId=${orderId}&from='${"discount"}` - }); - } else { - wx.redirectTo({ - url: '/pages/getuserinfo/index' - }); - } - } - }); - }, + getStaticGame(token) { let _this = this; Http.get({ diff --git a/pages/passCar/choicecoupon/choicecoupon.wxml b/pages/passCar/choicecoupon/choicecoupon.wxml index 8cd65ce..e010693 100644 --- a/pages/passCar/choicecoupon/choicecoupon.wxml +++ b/pages/passCar/choicecoupon/choicecoupon.wxml @@ -4,7 +4,7 @@ 请您敬请期待 我们正在筹备一大波优惠活动 - + diff --git a/pages/passCar/couponList/couponList.wxml b/pages/passCar/couponList/couponList.wxml index 35abc23..8dd1bc9 100644 --- a/pages/passCar/couponList/couponList.wxml +++ b/pages/passCar/couponList/couponList.wxml @@ -8,7 +8,7 @@ 请您敬请期待 我们正在筹备一大波优惠活动 - + diff --git a/pages/user/index.wxml b/pages/user/index.wxml index 5363492..7cf5950 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -76,7 +76,7 @@ - 版本号:3.3.4 + 版本号:3.4.1