From e2d3950055ca1a427c27f6243a988eaa57b07d55 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Wed, 27 Dec 2023 18:39:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=80=82=E9=85=8D=E6=8A=96?= =?UTF-8?q?=E9=9F=B3=E9=80=9A=E7=94=A8=E8=A1=8C=E4=B8=9A=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/cart/cart.vue | 6 ++- components/payment/payment.vue | 38 ++++++++++++++++++- pages/goods-category/goods-category.css | 3 ++ pages/goods-category/goods-category.vue | 7 +++- pages/index/index.css | 6 --- pages/plugins/realstore/detail/detail.vue | 3 ++ .../wallet/cash-create/cash-create.vue | 2 +- pages/user/user.css | 33 +++++----------- 8 files changed, 61 insertions(+), 37 deletions(-) diff --git a/components/cart/cart.vue b/components/cart/cart.vue index 2c9d5286..ce03bd92 100644 --- a/components/cart/cart.vue +++ b/components/cart/cart.vue @@ -34,8 +34,10 @@ - - + + + + diff --git a/components/payment/payment.vue b/components/payment/payment.vue index 97e56f9c..718a62aa 100644 --- a/components/payment/payment.vue +++ b/components/payment/payment.vue @@ -347,9 +347,17 @@ case 0: var data = res.data.data; // #ifdef APP - this.app_pay_handle(this, data, order_id); + this.app_pay_handle(this, data, order_id); + // #endif + // #ifdef MP-TOUTIAO + // 头条是否非普通版本支持 + if(parseInt(data.data.pay_type || 0) == 1) { + this.toutiao_transaction_pay_handle(this, data, order_id); + } else { + this.mp_pay_handle(this, data, order_id); + } // #endif - // #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU || MP-TOUTIAO + // #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU this.mp_pay_handle(this, data, order_id); // #endif // #ifdef MP-KUAISHOU @@ -465,6 +473,32 @@ self.order_item_pay_fail_handle(data, order_id, '支付失败'); }, }); + }, + // 头条小程序非普通交易支付处理 + toutiao_transaction_pay_handle(self, data, order_id) { + if(!uni.canIUse('requestOrder') || !uni.canIUse('getOrderPayment')) { + app.globalData.showToast('请使用真机操作、或小程序基础版本太低!'); + return false; + } + uni.requestOrder({ + data: data.data.data, + byteAuthorization: data.data.auth, + success: (res) => { + uni.getOrderPayment({ + orderId: res.orderId, + success: (res) => { + // 数据设置 + self.order_item_pay_success_handle(data, order_id); + }, + fail: (res) => { + self.order_item_pay_fail_handle(data, order_id, '支付失败'); + } + }); + }, + fail: (res) => { + app.globalData.showToast(res.errMsg+'('+res.errNo+')'); + } + }); }, // 小程序: 微信、支付宝、百度、头条、QQ mp_pay_handle(self, data, order_id) { diff --git a/pages/goods-category/goods-category.css b/pages/goods-category/goods-category.css index e0e54278..c2dd7bbd 100644 --- a/pages/goods-category/goods-category.css +++ b/pages/goods-category/goods-category.css @@ -168,7 +168,10 @@ * 商品列表模式 */ .category-content { + height: 100vh; + /* #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || MP-ALIPAY || APP */ height: calc(100vh - 134rpx - var(--window-bottom)); + /* #endif */ /* #ifdef H5 */ height: calc(100vh - 104rpx - var(--window-bottom)); /* #endif */ diff --git a/pages/goods-category/goods-category.vue b/pages/goods-category/goods-category.vue index 5db79c43..3f91d531 100644 --- a/pages/goods-category/goods-category.vue +++ b/pages/goods-category/goods-category.vue @@ -471,8 +471,11 @@ popup_status: false, // 获取搜索框高度 search_height: 0, - // 底部tab高度 - 只有H5下有值 - window_bottom_height: uni.getWindowInfo().windowBottom || 0, + // 底部tab高度 - 只有H5下有值 + window_bottom_height: 0, + // #ifdef H5 + window_bottom_height: uni.getWindowInfo().windowBottom || 0, + // #endif }; }, diff --git a/pages/index/index.css b/pages/index/index.css index b6a482a0..f177abbb 100644 --- a/pages/index/index.css +++ b/pages/index/index.css @@ -51,15 +51,9 @@ */ .search-fixed-seat { padding-top: 78rpx; - /* #ifdef MP-TOUTIAO */ - padding-top: 58rpx; - /* #endif */ } .search-fixed-seat.nav-enable-search { padding-top: 146rpx; - /* #ifdef MP-TOUTIAO */ - padding-top: 88rpx; - /* #endif */ } .search-content-fixed { position: fixed !important; diff --git a/pages/plugins/realstore/detail/detail.vue b/pages/plugins/realstore/detail/detail.vue index 2b5c945c..ccb8ed3b 100644 --- a/pages/plugins/realstore/detail/detail.vue +++ b/pages/plugins/realstore/detail/detail.vue @@ -316,6 +316,9 @@ is_single_page: app.globalData.is_current_single_page() || 0, // 顶部导航返回按钮 is_realstore_top_nav_back: app.globalData.data.is_realstore_top_nav_back || 0, + // #ifdef MP-TOUTIAO + is_realstore_top_nav_back : 0, + // #endif is_realstore_top_search_scan: app.globalData.data.is_realstore_top_search_scan || 0, }; }, diff --git a/pages/plugins/wallet/cash-create/cash-create.vue b/pages/plugins/wallet/cash-create/cash-create.vue index a075d224..c5be1254 100644 --- a/pages/plugins/wallet/cash-create/cash-create.vue +++ b/pages/plugins/wallet/cash-create/cash-create.vue @@ -228,7 +228,7 @@ app.globalData.showToast(res.data.msg, 'success'); setTimeout(function () { uni.redirectTo({ - url: '/pages/plugins/wallet/user-cash/user-cash', + url: '/pages/plugins/wallet/user/user?type=2', }); }, 1000); } else { diff --git a/pages/user/user.css b/pages/user/user.css index 6bdcb3f8..4aa8da56 100644 --- a/pages/user/user.css +++ b/pages/user/user.css @@ -8,42 +8,41 @@ min-height: 300rpx; } .top-content .content .user-top { + /* #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || MP-ALIPAY || H5 || APP */ padding-top: var(--status-bar-height); + /* #endif */ } - + /** * 头部 */ .head-base { padding: 40rpx 40rpx 22rpx 40rpx; - /* #ifdef MP */ + /* #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || MP-ALIPAY || H5 || APP */ padding-top: 120rpx; /* #endif */ } - .head-base .head-id { height: 36rpx; line-height: 36rpx; background: linear-gradient(90deg, #FFE3DC 0%, #FF9F67 100%); } - .head-avatar { width: 116rpx; height: 116rpx !important; } - + /** * 头部右上角 */ .head-right { z-index: 10; } - .head-right .item .badge-icon { top: -10px; right: -2px; } - + /** * 会员码 */ @@ -53,25 +52,22 @@ background-size: 100% 100%; color: #FEF6CF; } - .qrcode-content.divider-r::after { right: 50%; height: 30%; background: #FEF6CF; } - .qrcode .icon { width: 48rpx; margin-right: 18rpx; position: relative; top: 6rpx; } - .qrcode .iconfont { top: calc(50% - 10rpx); right: 48rpx; } - + /** * 底部内容 */ @@ -83,7 +79,7 @@ .user-bottom.box-shadow { box-shadow: 0px -8px 8px 2px rgba(0, 0, 0, 0.2); } - + /** * 行内导航列表 */ @@ -91,7 +87,6 @@ width: 138rpx; padding: 16rpx 16rpx 16rpx 12rpx; } - .nav-content .nav-all-order-goods::before { content: ''; width: 26rpx; @@ -105,42 +100,35 @@ top: 50%; transform: translateY(-50%); } - .nav-list .nav-item { box-sizing: border-box; } - .nav-list .nav-item .item-icon { width: 40rpx; height: 40rpx; } - .nav-list .nav-item .item-desc { margin-right: 50rpx; margin-top: 2rpx; width: calc(100% - 300rpx); } - .nav-list .nav-item .item-arrow { width: 25rpx; } - .nav-list-sub { padding: 16rpx 16rpx 16rpx 0; } - .nav-content .nav-all-order-goods .item .item-icon, .nav-list-sub .item .item-icon { width: 56rpx; height: 56rpx; } - .nav-list-sub .item .badge-icon { top: -2px; left: calc(50% + 35rpx); z-index: 1; } - + /** * 聚合导航 */ @@ -148,18 +136,15 @@ box-sizing: border-box; width: 25%; } - .nav-box .nav-item .item-icon { width: 52rpx; height: 52rpx !important; } - .nav-box .nav-item .item-desc { margin-right: 50rpx; margin-top: 2rpx; width: calc(100% - 300rpx); } - .service-nav .show-type-submit { width: 50rpx; height: 50rpx !important;