diff --git a/pages/recharge/index.js b/pages/recharge/index.js index 992b4ca3..851710a3 100644 --- a/pages/recharge/index.js +++ b/pages/recharge/index.js @@ -27,11 +27,24 @@ Page({ }); }, + /** + * 点击充值优惠的充值送 + */ + rechargeAmount: function (e) { + var confine = e.currentTarget.dataset.confine; + var amount = confine; + this.setData({ + amount: amount + }); + wxpay.wxpay(app, amount, 0, "/pages/cashier/cashier"); + }, + + /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { - + }, /** @@ -44,43 +57,44 @@ Page({ _this.setData({ rechargeSendRules: res.data }); - } + } }) + }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { - + }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { - + }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { - + }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { - + }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { - + }, bindSave: function (e) { WXAPI.addTempleMsgFormid({ @@ -91,7 +105,7 @@ Page({ var that = this; var amount = e.detail.value.amount; - if (amount == "" || amount*1 < 0) { + if (amount == "" || amount * 1 < 0) { wx.showModal({ title: '错误', content: '请填写正确的充值金额', @@ -99,10 +113,10 @@ Page({ }) return } - if (amount * 1 < that.data.recharge_amount_min*1) { + if (amount * 1 < that.data.recharge_amount_min * 1) { wx.showModal({ title: '错误', - content: '单次充值金额至少' + that.data.recharge_amount_min +'元', + content: '单次充值金额至少' + that.data.recharge_amount_min + '元', showCancel: false }) return @@ -135,9 +149,9 @@ Page({ _this: that }) }) - } + } }, - saveToMobile: function(){ + saveToMobile: function () { wx.canvasToTempFilePath({ canvasId: 'myQrcode', success: function (res) { @@ -163,4 +177,4 @@ Page({ } }) } -}) \ No newline at end of file +}) diff --git a/pages/recharge/index.wxml b/pages/recharge/index.wxml index 00973933..881bce88 100644 --- a/pages/recharge/index.wxml +++ b/pages/recharge/index.wxml @@ -4,7 +4,7 @@ 充值金额 - + @@ -13,13 +13,31 @@ + + + + + + + + + + 充{{item.confine}} + 送{{item.send}} + + + + + + 保存以下二维码,使用支付宝扫码付款 @@ -35,4 +53,4 @@ - \ No newline at end of file + diff --git a/pages/recharge/index.wxss b/pages/recharge/index.wxss index da488618..309d8569 100644 --- a/pages/recharge/index.wxss +++ b/pages/recharge/index.wxss @@ -35,7 +35,7 @@ page{ padding-right: 30rpx; } .row-wrap .right-box{ - margin-right: 30rpx; + margin-right: 30rpx; } .arrow-right{ width: 15rpx; @@ -47,7 +47,7 @@ page{ height: 80rpx; line-height: 80rpx; text-align: center; - margin-top:30rpx; + margin-top:30rpx; border-radius: 6rpx; box-sizing: border-box; } @@ -85,6 +85,48 @@ picker { .hui{ color: #777; } + .weui-panel { width:740rpx; -} \ No newline at end of file +} + + +.charge-rule-wrap{ + background: white; + margin-top:20rpx; + padding:10rpx; + padding-left:20rpx; + display: flex; + flex-direction:row; + flex-wrap:wrap; +} +.btn{ + box-sizing: border-box; + text-align: center; + border-radius: 6rpx; + margin-left: 20rpx; +} +.charge-detail{ + width:220rpx; + height:100rpx; + color:rgba(99, 190, 133, 1); + background-color:white; + border:3rpx solid rgba(99, 190, 133, 1); + display:table-cell; + line-height:30rpx; + font-weight:300; + font-size:30rpx; + margin:10rpx; + align-items:flex-start; +} +.charge-detail text{ + vertical-align:middle; + font-size: 28rpx; + display: flex; + justify-content: center; + align-items: center; + margin-top:12rpx; +} +.button-hover{ + background-color:grey; +} diff --git a/wxapi/main.js b/wxapi/main.js index 54b0a4dc..50c5920f 100644 --- a/wxapi/main.js +++ b/wxapi/main.js @@ -295,4 +295,4 @@ module.exports = { rechargeSendRules: () => { return request('/user/recharge/send/rule', true, 'get') } -} \ No newline at end of file +}