diff --git a/pagesB/consulted/consulted.scss b/pagesB/consulted/consulted.scss index b0eee72..1a458d8 100644 --- a/pagesB/consulted/consulted.scss +++ b/pagesB/consulted/consulted.scss @@ -5,7 +5,46 @@ color: #000000; padding-top: 20rpx; // overflow: scroll; - + .buy { + background: #FFFFFF; + position: fixed; + bottom: 0; + height: 100rpx; + width: 100%; + height: 125rpx; + background: #FFFFFF; + box-shadow: 0rpx -3rpx 13rpx 0rpx rgba(0,0,0,0.1); + border-radius: 20rpx; + .logistics{ + width: 216rpx; + height: 68rpx; + text-align: center; + color: #ffffff; + border-radius: 5rpx; + font-size: 36rpx; + line-height: 68rpx; + position: absolute; + right: 260rpx; + top: 50%; + background: #E1AE3C; + transform: translateY(-50%); + z-index: 999; + } + .pay { + width: 216rpx; + height: 68rpx; + text-align: center; + color: #ffffff; + background:#26A888; + border-radius: 5rpx; + font-size: 36rpx; + line-height: 68rpx; + position: absolute; + right: 20rpx; + top: 50%; + transform: translateY(-50%); + } + } .time{ height: 80rpx; width: 95%; diff --git a/pagesB/consulted/consulted.vue b/pagesB/consulted/consulted.vue index 7842ec1..d4eb668 100644 --- a/pagesB/consulted/consulted.vue +++ b/pagesB/consulted/consulted.vue @@ -99,8 +99,14 @@ 更多 取消订单 + + + + 去支付 + + - + @@ -124,6 +130,9 @@ ssgoodsOrder, } from '@/api/pagesB/CommodityOrder/index.js' import baseurl from '@/api/baseurl.js' + import { + appletGoodsOrderPay + } from '@/api/pagesB/confirmOrder/index.js' export default { data() { return { @@ -157,7 +166,7 @@ onLoad(options) { // if(options.item){ this.list = JSON.parse(options.item) - console.log(this.list.goodsOrderId, '555') + console.log(this.list, '555') this.orderTypeList.goodsOrderId = this.list.goodsOrderId // else if(options.goodsOrderId){ @@ -174,7 +183,6 @@ // } this.goodsOrderinfo() // console.log(this.list, '99') - // console.log(options,'88') this.baseurl = baseurl }, @@ -184,6 +192,50 @@ delta: 1 }) }, + //支付 + pay() { + var that = this + let paydata = this.list + paydata.openid = this.orderTypeList.openid + paydata.payType = "WECHAT_PAY" + paydata.paymentPrice = this.list.totalPrice + paydata.orderChannel = 'WECHAT_APPLET' + paydata.orderNo = this.list.goOrderNo + appletGoodsOrderPay(paydata).then(response => { + if (response.code == 200) { + uni.requestPayment({ + timeStamp: response.data.timeStamp, + nonceStr: response.data.nonceStr, + package: response.data.prepayId, + signType: response.data.signType, + paySign: response.data.paySign, + success: function(res) { + uni.setStorageSync("Refresh", 'Refresh') + that.goodsOrderinfo() + that.$refs.uToast.show({ + title: '支付成功', + type: 'success', + duration: 1500, + url: `/pagesB/paysuccess/paysuccess?delta=${2}` + }) + }, + fail: function(err) { + that.$refs.uToast.show({ + title: '取消支付', + type: 'error', + duration: 1500 + }) + } + }); + } else { + that.$refs.uToast.show({ + title: response.msg, + type: 'error', + duration: 1500 + }) + } + }) + }, goodsOrderinfo() { ssgoodsOrder(this.orderTypeList).then( res => {