From a685888a5bce9e6633a9c0150516d391cc0cda82 Mon Sep 17 00:00:00 2001 From: shengliang Date: Wed, 4 Mar 2020 16:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=E7=BA=BF?= =?UTF-8?q?=E4=B8=8B=E6=94=AF=E4=BB=98=E7=9A=84=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 3 +- pages/order-check/index.js | 43 +++++++++-- pages/order-check/index.wxml | 6 +- pages/order-check/index.wxss | 22 ++++++ pages/payOffline/index.js | 39 ++++++++++ pages/payOffline/index.json | 3 + pages/payOffline/index.wxml | 28 +++++++ pages/payOffline/index.wxss | 109 ++++++++++++++++++++++++++++ pages/ucenter/order-list/index.wxml | 5 +- pages/ucenter/order-list/index.wxss | 24 +++++- 10 files changed, 272 insertions(+), 10 deletions(-) create mode 100755 pages/payOffline/index.js create mode 100755 pages/payOffline/index.json create mode 100755 pages/payOffline/index.wxml create mode 100755 pages/payOffline/index.wxss diff --git a/app.json b/app.json index 14e0fdd..cd66e98 100644 --- a/app.json +++ b/app.json @@ -18,7 +18,8 @@ "pages/ucenter/order-details/index", "pages/ucenter/express-info/index", "pages/ucenter/footprint/index", - "pages/payResult/payResult" + "pages/payResult/payResult", + "pages/payOffline/index" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/order-check/index.js b/pages/order-check/index.js index d928c87..9875cf4 100755 --- a/pages/order-check/index.js +++ b/pages/order-check/index.js @@ -65,8 +65,7 @@ Page({ this.setData({ 'addressId': addressId }); - } catch (e) { - } + } catch (e) {} this.getCheckoutInfo(); }, onPullDownRefresh: function () { @@ -117,8 +116,7 @@ Page({ wx.setStorageSync('addressId', addressId); if (res.data.outStock == 1) { util.showErrorToast('有部分商品缺货或已下架'); - } - else if (res.data.numberChange == 1){ + } else if (res.data.numberChange == 1) { util.showErrorToast('部分商品库存有变动'); } } @@ -135,13 +133,13 @@ Page({ let postscript = this.data.postscript; let freightPrice = this.data.freightPrice; let actualPrice = this.data.actualPrice; - let goodsTotalPrice = this.data.goodsTotalPrice; util.request(api.OrderSubmit, { addressId: addressId, postscript: postscript, freightPrice: freightPrice, formId: formId, actualPrice: actualPrice, + offlinePay:0 }, 'POST').then(res => { console.log(res); if (res.errno === 0) { @@ -161,5 +159,40 @@ Page({ util.showErrorToast(res.errmsg); } }); + }, + offlineOrder: function (e) { + let formId = e.detail.formId; + console.log(e) + let offlinePay = e.currentTarget.dataset.off; + if (this.data.addressId <= 0) { + util.showErrorToast('请选择收货地址'); + return false; + } + let addressId = this.data.addressId; + let postscript = this.data.postscript; + let freightPrice = this.data.freightPrice; + let actualPrice = this.data.actualPrice; + util.request(api.OrderSubmit, { + addressId: addressId, + postscript: postscript, + freightPrice: freightPrice, + formId: formId, + actualPrice: actualPrice, + offlinePay:offlinePay + }, 'POST').then(res => { + console.log(res); + if (res.errno === 0) { + wx.removeStorageSync('orderId'); + wx.setStorageSync('addressId', 0); + wx.redirectTo({ + url: '/pages/payOffline/index?status=1', + }) + } else { + util.showErrorToast(res.errmsg); + wx.redirectTo({ + url: '/pages/payOffline/index?status=0', + }) + } + }); } }) \ No newline at end of file diff --git a/pages/order-check/index.wxml b/pages/order-check/index.wxml index 853714d..20e0f0c 100644 --- a/pages/order-check/index.wxml +++ b/pages/order-check/index.wxml @@ -55,6 +55,10 @@ 实付: ¥ {{actualPrice}} - + + + + + \ No newline at end of file diff --git a/pages/order-check/index.wxss b/pages/order-check/index.wxss index 55d1d53..9a46ec3 100644 --- a/pages/order-check/index.wxss +++ b/pages/order-check/index.wxss @@ -289,6 +289,24 @@ page { background-color: #fff; } +.settle-box .offline-pay-btn { + display: block; + width: 300rpx; + text-align: center; + height: 100%; + line-height: 100rpx; + background: linear-gradient(to right, #111, #000); + font-size: 32rpx; + color: #fff; + border-radius: 0; + margin: 0 auto; + padding: 0; +} + +.settle-box .offline-pay-btn::after{ + border: none; +} + .settle-box .to-pay-btn { display: block; width: 300rpx; @@ -303,6 +321,10 @@ page { padding: 0; } +.settle-box .to-pay-btn::after{ + border: none; +} + .settle-box .left-price { display: flex; width: 500rpx; diff --git a/pages/payOffline/index.js b/pages/payOffline/index.js new file mode 100755 index 0000000..1914f56 --- /dev/null +++ b/pages/payOffline/index.js @@ -0,0 +1,39 @@ +var util = require('../../utils/util.js'); +var api = require('../../config/api.js'); +const pay = require('../../services/pay.js'); + +var app = getApp(); +Page({ + data: { + status: 0, + orderId: 0, + is_over:0, + productId:0, + imageUrl:'' + }, + onLoad: function(options) { + // 页面初始化 options为页面跳转所带来的参数 + this.setData({ + status: options.status + }) + }, + toOrderListPage: function(event) { + wx.switchTab({ + url: '/pages/ucenter/index/index', + }); + }, + toIndex: function() { + wx.switchTab({ + url: '/pages/index/index' + }); + }, + payOrder() { + pay.payOrder(parseInt(this.data.orderId)).then(res => { + this.setData({ + status: true + }); + }).catch(res => { + util.showErrorToast(res.errmsg); + }); + } +}) \ No newline at end of file diff --git a/pages/payOffline/index.json b/pages/payOffline/index.json new file mode 100755 index 0000000..513fb53 --- /dev/null +++ b/pages/payOffline/index.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "付款结果" +} \ No newline at end of file diff --git a/pages/payOffline/index.wxml b/pages/payOffline/index.wxml new file mode 100755 index 0000000..622bd5f --- /dev/null +++ b/pages/payOffline/index.wxml @@ -0,0 +1,28 @@ + + + + + + + 订单提交成功 + 请线下支付 + + + 继续逛逛 + + 返回我的页面 + + + + + + + 提交失败 + + + 返回我的页面 + + \ No newline at end of file diff --git a/pages/payOffline/index.wxss b/pages/payOffline/index.wxss new file mode 100755 index 0000000..7a68f9c --- /dev/null +++ b/pages/payOffline/index.wxss @@ -0,0 +1,109 @@ +page { + height: 100%; + background: #fafafa; +} + +.container { + background-color: #fafafa; + align-items: flex-start; + overflow-x: hidden; +} + +.result-wrap { + width: 100%; + height: 40%; + background: #fff; + padding: 40rpx 0 60rpx 0; +} + +.image-wrap { + width: 100%; + height: 100rpx; + margin: 40rpx 0; + display: flex; + justify-content: center; +} + +.success-img { + width: 100rpx; + height: 100rpx; + margin: 0 auto; +} + +.text-wrap { + width: 100%; + margin-bottom: 40rpx; +} +.success-text { + font-size: 30rpx; + color: #233445; + text-align: center; + line-height: 60rpx; + margin-bottom: 20rpx; +} +.text { + font-size: 30rpx; + color: #999; + text-align: center; + line-height: 60rpx; + margin-bottom: 20rpx; +} +.btn-go-order{ + color: #999; + width: 300rpx; + height: 100rpx; + line-height: 100rpx; + text-align: center; + font-size: 28rpx; + margin: 0 auto; +} +.to-order-btn { + color: #fff; + background: linear-gradient(to right, #ff3456, #ff347d); + border-radius: 0px; + width: 300rpx; + height: 80rpx; + line-height: 80rpx; + text-align: center; + font-size: 28rpx; + margin: 0 auto; +} +.tips{ + display: flex; + flex-direction: column; +} +.tips .p{ + width: 100%; + text-align: center; + line-height: 40rpx; + height: 40rpx; + font-size: 28rpx; + color: #233445; +} +.p .time{ + color: #ff3456; +} + +.contact-wrap{ + height: 100rpx; + line-height: 100rpx; + width: 100%; + display: flex; + justify-content: center; + align-items: center; + background: none; +} +.contact-wrap::after{ + border: none; +} +.contact-wrap .contact-icon{ + width: 40rpx; + height: 40rpx; + margin-right: 10rpx; + background: url('http://lucky-icon.meiweiyuxian.com/hio/contact.png') no-repeat; + background-size: 40rpx auto; +} +.contact-wrap .contact{ + font-size: 28rpx; + color: #1296db; +} diff --git a/pages/ucenter/order-list/index.wxml b/pages/ucenter/order-list/index.wxml index a4d6595..3d4ee12 100644 --- a/pages/ucenter/order-list/index.wxml +++ b/pages/ucenter/order-list/index.wxml @@ -28,7 +28,10 @@ {{item.add_time}} - {{item.order_status_text}} + + 线下支付订单 + {{item.order_status_text}} + diff --git a/pages/ucenter/order-list/index.wxss b/pages/ucenter/order-list/index.wxss index 4d36d5f..43f3fa5 100644 --- a/pages/ucenter/order-list/index.wxss +++ b/pages/ucenter/order-list/index.wxss @@ -36,7 +36,8 @@ page { position: relative; border-bottom: 3px solid #fff; } -.list-num{ + +.list-num { position: absolute; top: -2rpx; right: -12rpx; @@ -72,9 +73,11 @@ page { text-align: center; padding-top: 203rpx; } + .show { display: block; } + .no-order-img { width: 100rpx; height: 100rpx; @@ -126,6 +129,23 @@ page { } .list-top-wrap .status { + display: flex; + justify-content: flex-end; + align-items: center; +} + +.list-top-wrap .status .pay-status { + color: #fff; + border-radius: 8rpx; + background: #594d72; + height: 30rpx; + line-height: 30rpx; + padding: 8rpx 20rpx; + font-size: 24rpx; + margin-right: 20rpx; +} + +.list-top-wrap .status .order-status { color: #ff3456; font-size: 28rpx; } @@ -242,4 +262,4 @@ page { font-size: 28rpx; margin: 20rpx 0 30rpx 0; color: #999; -} +} \ No newline at end of file