From d68baef0d0afb91f496754c093eb554b30938984 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Tue, 25 Jun 2024 12:06:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E9=9D=9E=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E5=BC=8F=E6=94=AF=E4=BB=98=20=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=88=B0=E4=B8=80=E4=B8=AA=E7=BB=84=E4=BB=B6=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=9C=A8=E6=AF=8F=E4=B8=AA=E9=A1=B5=E9=9D=A2=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/payment/pay.vue | 226 +++ pages/activity/activity/details.vue | 75 +- .../business/shareholder/confirm_join.vue | 76 +- pages/agent/delivery/payment.vue | 141 +- pages/agent/invite/index.vue | 78 +- pages/agent/user/order.vue | 333 +---- pages/points_mall/integral_order.vue | 1216 ++++++++--------- pages/users/invitation_code/activation.vue | 78 +- pages/users/invitation_code/exchange.vue | 77 +- pages/users/online_payment/exchange/index.vue | 80 +- .../online_payment/exchange/vegetable.vue | 148 +- pages/users/online_payment/payment/index.vue | 75 +- pages/users/order_confirm/index.vue | 94 +- 13 files changed, 872 insertions(+), 1825 deletions(-) create mode 100644 components/payment/pay.vue diff --git a/components/payment/pay.vue b/components/payment/pay.vue new file mode 100644 index 0000000..472b0f7 --- /dev/null +++ b/components/payment/pay.vue @@ -0,0 +1,226 @@ + + + + + diff --git a/pages/activity/activity/details.vue b/pages/activity/activity/details.vue index 207aa9e..375ca42 100644 --- a/pages/activity/activity/details.vue +++ b/pages/activity/activity/details.vue @@ -27,32 +27,7 @@ - 支付方式 - - - - - - - + @@ -86,11 +61,13 @@ import authorize from '@/components/Authorize'; import { activityDetail,activityJoin } from "@/api/activity"; import {getUserInfo} from "@/api/user"; import {searchMer} from '@/api/exchange.js'; +import pay from "@/components/payment/pay"; export default { name: 'business', components: { - authorize + authorize, + pay }, computed: { ...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor']) @@ -109,42 +86,6 @@ export default { lat: '', lng: '', //支付方式 - pay_list: [ - { - "name": "微信支付", - "icon": "icon-weixin2", - value: 'weixin', - title: '微信快捷支付', - payStatus: 1, - }, - { - name: "支付宝支付", - icon: "icon-icon34", - // #ifdef H5 || APP-PLUS - value: 'alipay', - // #endif - // #ifdef MP - value: 'alipayQr', - // #endif - title: '支付宝支付', - payStatus: this.$store.getters.globalData.alipay_open - }, - { - "name": "余额支付", - "icon": "icon-icon-test", - value: 'balance', - title: '可用余额:', - payStatus: this.$store.getters.globalData.yue_pay_status, - }, - { - "name": "线下支付", - "icon": "icon-yinhangqia", - value: 'offline', - title: '线下支付', - payStatus: 2, - }, - ], - now_money: 0, pay_money: 0,// 支付金额 pay_info: { pay_type: 'weixin', @@ -197,10 +138,6 @@ export default { // 授权成功 初始化 init () { let _this = this; - // 获取用户信息 - getUserInfo().then(res => { - _this.now_money = res.data.now_money - }); // 定位 _this.lat = uni.getStorageSync('user_latitude') || ''; _this.lng = uni.getStorageSync('user_longitude') || ''; @@ -512,8 +449,8 @@ export default { }); }, // 修改支付方式 - changePayType(e){ - this.pay_info.pay_type = e.detail.value || e.target.value; + changePayType(value){ + this.pay_info.pay_type = value; }, diff --git a/pages/admin/business/shareholder/confirm_join.vue b/pages/admin/business/shareholder/confirm_join.vue index fa0c098..5efb4b4 100644 --- a/pages/admin/business/shareholder/confirm_join.vue +++ b/pages/admin/business/shareholder/confirm_join.vue @@ -62,32 +62,7 @@ - 支付方式 - - - - - - - + @@ -107,12 +82,13 @@ import {mapGetters} from "vuex"; import authorize from '@/components/Authorize'; import {HTTP_REQUEST_URL} from '@/config/app.js'; import {merShareholderLevelInfo, merShareholderMerInfo, merShareholderSubmitJoinInfo, merShareholderGetJoinInfo} from "@/api/store"; -import {getUserInfo} from "@/api/user"; +import pay from "@/components/payment/pay"; export default { name: 'business', components: { - authorize + authorize, + pay }, computed: { ...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor']), @@ -147,42 +123,6 @@ export default { coupon_list: {}, join_info: {}, //支付方式 - pay_list: [ - { - "name": "微信支付", - "icon": "icon-weixin2", - value: 'weixin', - title: '微信快捷支付', - payStatus: 1, - }, - { - name: "支付宝支付", - icon: "icon-icon34", - // #ifdef H5 || APP-PLUS - value: 'alipay', - // #endif - // #ifdef MP - value: 'alipayQr', - // #endif - title: '支付宝支付', - payStatus: this.$store.getters.globalData.alipay_open - }, - { - "name": "余额支付", - "icon": "icon-icon-test", - value: 'balance', - title: '可用余额:', - payStatus: this.$store.getters.globalData.yue_pay_status, - }, - { - "name": "线下支付", - "icon": "icon-yinhangqia", - value: 'offline', - title: '线下支付', - payStatus: 2, - }, - ], - now_money: 0, pay_info: { pay_type: 'weixin', // #ifdef H5 @@ -237,10 +177,6 @@ export default { }, // 授权成功 初始化 init () { - // 获取用户信息 - getUserInfo().then(res => { - this.now_money = res.data.now_money - }); this.getJoinInfo(); this.getMerInfo(); this.getLevelInfo(); @@ -295,8 +231,8 @@ export default { }) }, // 修改支付方式 - changePayType(e){ - this.pay_info.pay_type = e.detail.value || e.target.value; + changePayType(value){ + this.pay_info.pay_type = value; }, // 提交加入申请信息 submitJoinApplyInfo(){ diff --git a/pages/agent/delivery/payment.vue b/pages/agent/delivery/payment.vue index bb87472..1f075c5 100644 --- a/pages/agent/delivery/payment.vue +++ b/pages/agent/delivery/payment.vue @@ -24,32 +24,7 @@ - 支付方式 - - - - - - - + 确认支付 @@ -82,14 +57,15 @@ import {mapGetters} from "vuex"; import authorize from '@/components/Authorize'; import emptyPage from '@/components/emptyPage.vue'; -import {getUserInfo} from "@/api/user"; import {deliveryPaymentList, deliveryCreateOrder} from "@/api/agent"; +import pay from "@/components/payment/pay"; const app = getApp(); export default { components: { authorize, emptyPage, + pay }, data() { return { @@ -98,42 +74,6 @@ export default { isAuto: false, //没有授权的不会自动授权 isShowAuth: false,//是否隐藏授权 //支付相关 - pay_list: [ - { - "name": "微信支付", - "icon": "icon-weixin2", - value: 'weixin', - title: '微信快捷支付', - payStatus: 1, - }, - { - name: "支付宝支付", - icon: "icon-icon34", - // #ifdef H5 || APP-PLUS - value: 'alipay', - // #endif - // #ifdef MP - value: 'alipayQr', - // #endif - title: '支付宝支付', - payStatus: this.$store.getters.globalData.alipay_open - }, - { - "name": "余额支付", - "icon": "icon-icon-test", - value: 'balance', - title: '可用余额:', - payStatus: this.$store.getters.globalData.yue_pay_status, - }, - { - "name": "线下支付", - "icon": "icon-yinhangqia", - value: 'offline', - title: '线下支付', - payStatus: 2, - }, - ], - now_money: 0, pay_info: { money: 0.00,// 买单金额 pay_type: 'weixin', @@ -193,11 +133,6 @@ export default { }, // 授权成功 获取用户信息 init () { - let _this = this; - // 获取用户信息 - getUserInfo().then(res => { - _this.now_money = res.data.now_money - }); // 获取用户缴费列表 this.getPaymentList(); }, @@ -229,8 +164,8 @@ export default { this.$refs.paymentListPopup.close(); }, // 修改支付方式 - changePayType(e){ - this.pay_info.pay_type = e.detail.value || e.target.value; + changePayType(value){ + this.pay_info.pay_type = value }, // 确认付款 confirmPayment(){ @@ -585,72 +520,6 @@ export default { } } } - // 支付方式 - .pay-type{ - - .box-content{ - .pay-label:not(:last-child){ - margin-bottom: 20rpx; - } - .pay-item{ - height: 120rpx; - padding: 20rpx; - width: 100%; - border: 2rpx solid #d9dce4; - border-radius: 15rpx; - display: inline-flex; - flex-direction: row; - flex-wrap: nowrap; - align-items: center; - justify-content: space-around; - .left{ - width: calc(100% - 80rpx); - display: inline-flex; - flex-direction: row; - flex-wrap: nowrap; - align-items: center; - justify-content: flex-start; - .animated{ - width: 44rpx; - height: 44rpx; - border-radius: 50%; - text-align: center; - line-height: 44rpx; - background-color: #fe960f; - color: #fff; - font-size: 30rpx; - margin-right: 15rpx; - } - .icon-weixin2 { - background-color: #41b035; - } - .icon-icon34 { - background-color: #4295D5; - } - .pay-item-info{ - .pay-name{ - text-align: left; - border-right: 1px solid #eee; - justify-content: left; - } - .tip{ - text-align: left; - font-size: 26rpx; - color: #aaa; - } - } - } - .right{ - width: 80rpx; - display: inline-flex; - flex-direction: row; - flex-wrap: nowrap; - align-items: center; - justify-content: flex-end; - } - } - } - } // 确认支付 .pay-btn{ width: calc(100% - (20rpx * 2)); diff --git a/pages/agent/invite/index.vue b/pages/agent/invite/index.vue index a543266..a97c95e 100644 --- a/pages/agent/invite/index.vue +++ b/pages/agent/invite/index.vue @@ -118,36 +118,9 @@ - - - 支付方式 - - - - - - - + @@ -179,13 +152,14 @@ import authorize from '@/components/Authorize'; import areaSelect from '@/components/areaSelect'; import {getSingleAgentInfo,getAgentConfig,submitAgentApplyInfo,agentApplyInfo} from "@/api/agent"; import { merClassifly,getStoreTypeApi } from '@/api/store.js'; -import {getUserInfo} from "@/api/user"; +import pay from "@/components/payment/pay"; export default { name: 'business', components: { authorize, - areaSelect + areaSelect, + pay }, computed: { ...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor']) @@ -225,42 +199,6 @@ export default { mer_type_index: 0, mer_type_name: '', //支付方式 - pay_list: [ - { - "name": "微信支付", - "icon": "icon-weixin2", - value: 'weixin', - title: '微信快捷支付', - payStatus: 1, - }, - { - name: "支付宝支付", - icon: "icon-icon34", - // #ifdef H5 || APP-PLUS - value: 'alipay', - // #endif - // #ifdef MP - value: 'alipayQr', - // #endif - title: '支付宝支付', - payStatus: this.$store.getters.globalData.alipay_open - }, - { - "name": "余额支付", - "icon": "icon-icon-test", - value: 'balance', - title: '可用余额:', - payStatus: this.$store.getters.globalData.yue_pay_status, - }, - { - "name": "线下支付", - "icon": "icon-yinhangqia", - value: 'offline', - title: '线下支付', - payStatus: 2, - }, - ], - now_money: 0, pay_info: { pay_type: 'weixin', // #ifdef H5 @@ -316,10 +254,6 @@ export default { this.getConfig(); this.getMerClass(); this.getMerType(); - // 获取用户信息 - getUserInfo().then(res => { - this.now_money = res.data.now_money - }); }, // 获取邀请人信息 getInviteAgentInfo(){ @@ -748,8 +682,8 @@ export default { }); }, // 修改支付方式 - changePayType(e){ - this.pay_info.pay_type = e.detail.value || e.target.value; + changePayType(value){ + this.pay_info.pay_type = value; }, // 查看申请记录 applyRecord(){ diff --git a/pages/agent/user/order.vue b/pages/agent/user/order.vue index 813036d..10a7e32 100644 --- a/pages/agent/user/order.vue +++ b/pages/agent/user/order.vue @@ -42,7 +42,7 @@ - + {{item.group_order_sn}} @@ -108,16 +108,13 @@ 共{{item.total_num || 0}}件商品,总金额 ¥{{item.pay_price}} - - - - + @@ -193,31 +190,6 @@ ¥{{item.pay_price}} - - - - - - - - - - - - - - - - - - - - - - - - - @@ -278,30 +250,8 @@ page: 1, limit: 20, domain: HTTP_REQUEST_URL, - payMode: [{ - name: "微信支付", - icon: "icon-weixinzhifu", - value: 'wechat', - title: '微信快捷支付', - payStatus: 1 - }, - { - name: "支付宝支付", - icon: "icon-zhifubao", - value: 'alipay', - title: '支付宝支付', - payStatus: this.$store.getters.globalData.alipay_open - }, - { - name: "余额支付", - icon: "icon-yuezhifu", - value: 'balance', - title: '可用余额:', - number: 0, - payStatus: this.$store.getters.globalData.yue_pay_status - } - ], - pay_close: false, + + pay_order_id: '', invoice_order_id: '', totalPrice: '0', @@ -329,14 +279,7 @@ ...mapGetters(['isLogin','uid','viewColor', 'shopIsLogin', 'shopMerId']), ...configMap(['hide_mer_status', 'community_status', 'alipay_open', 'yue_pay_status']), }, - watch: { - alipay_open(n){ - this.payMode[1].payStatus = n - }, - yue_pay_status(n){ - this.payMode[2].payStatus = n - } - }, + watch: {}, onShow() { if (this.isLogin) { this.page = 1; @@ -417,8 +360,6 @@ } } }, - - // 去商铺 goMall(item){ if(this.hide_mer_status == 0){ @@ -437,16 +378,7 @@ authColse: function(e) { this.isShowAuth = e }, - /** - * 事件回调 - * - */ - onChangeFun: function(e) { - let opt = e; - let action = opt.action || null; - let value = opt.value != undefined ? opt.value : null; - (action && this[action]) && this[action](value); - }, + /** * 获取用户信息 * @@ -455,7 +387,6 @@ let that = this; getUserInfo().then(res => { that.user_balance = res.data.now_money || 0.00; - that.payMode[2].number = res.data.now_money; }); if(that.shopIsLogin){ getStoreDetail(that.shopMerId).then(res => { @@ -463,149 +394,7 @@ }); } }, - /** - * 关闭支付组件 - * - */ - payClose: function() { - this.pay_close = false; - }, - - - - /** - * 取消订单 - * - */ - cancelOrder: function(index, order_id) { - let that = this; - if (!order_id) return that.$util.Tips({ - title: '缺少订单号无法取消订单' - }); - unOrderCancel(order_id).then(res => { - return that.$util.Tips({ - title: res.message, - icon: 'success' - }, function() { - that.orderList.splice(index, 1); - that.$set(that, 'orderList', that.orderList); - that.$set(that.orderData, 'unpaid_count', that.orderData.unpaid_count - 1); - that.getOrderData(); - }); - }).catch(err => { - return that.$util.Tips({ - title: err - }); - }); - }, - // 打开支付组件 - goPay: function(item) { - // 根据订单类型 判断显示用户余额还是商户余额 - if(item.activity_type == 35) this.payMode[2].number = this.mer_balance || 0.00; - else this.payMode[2].number = this.user_balance || 0.00; - // 显示支付弹框 - this.$set(this, 'pay_close', true); - this.order_id = item.group_order_id; - this.pay_order_id = item.group_order_id.toString() - this.$set(this, 'totalPrice', item.pay_price); - }, - /** - * 支付成功回调 - * - */ - pay_complete: function() { - this.loadend = false; - this.page = 1; - this.$set(this, 'orderList', []); - this.pay_close = false; - this.pay_order_id = ''; - this.getOrderData(); - this.getOrderList(); - }, - /** - * 支付失败回调 - * - */ - pay_fail: function() { - this.pay_close = false; - this.pay_order_id = ''; - }, - /** - * 去订单详情 - */ - goOrderDetails: function(order_id) { - - - return false; - let self = this - if (!order_id) return that.$util.Tips({ - title: '缺少订单号无法查看订单详情' - }); - // #ifdef MP - uni.showLoading({ - title: '正在加载', - }) - openOrderSubscribe().then(() => { - uni.hideLoading(); - if (self.orderStatus == 0) { - uni.navigateTo({ - url: '/pages/order_details/stay?order_id=' + order_id - }) - } else { - uni.navigateTo({ - url: '/pages/order_details/index?order_id=' + order_id - }) - } - }).catch(() => { - uni.hideLoading(); - }) - // #endif - // #ifndef MP - if (self.orderStatus == 0) { - uni.navigateTo({ - url: '/pages/order_details/stay?order_id=' + order_id - }) - } else { - uni.navigateTo({ - url: '/pages/order_details/index?order_id=' + order_id - }) - } - // #endif - }, - /** - * 点击去评价 - */ - goOrderDetails_Evaluation: function(order_id) { - let self = this - if (!order_id) return that.$util.Tips({ - title: '缺少订单号无法查看订单详情和评价' - }); - // #ifdef MP - if (self.orderStatus == 0) { - uni.navigateTo({ - url: '/pages/order_details/stay?order_id=' + order_id - }) - } else { - uni.navigateTo({ - url: '/pages/order_details/index?order_id=' + order_id - }) - } - // #endif - // #ifndef MP - if (self.orderStatus == 0) { - uni.navigateTo({ - url: '/pages/order_details/stay?order_id=' + order_id - }) - } else { - uni.navigateTo({ - url: '/pages/order_details/index?order_id=' + order_id - }) - } - // #endif - }, - /** - * 切换类型 - */ + // 切换类型 statusClick: function(status) { if (status == this.orderStatus) return; this.orderStatus = status; @@ -615,9 +404,7 @@ this.$set(this, 'orderList', []); this.getOrderList(); }, - /** - * 获取定金预售订单列表 - */ + // 获取定金预售订单列表 getpreSellOrderList: function() { let that = this; getOrderList({ @@ -630,9 +417,7 @@ that.$set(that, 'presellProList', list); }) }, - /** - * 获取单个订单商品数量 - */ + // 获取单个订单商品数量 getProductCount: function(){ if(this.orderStatus !== 0){ this.orderList.forEach((item,i) => { @@ -646,109 +431,11 @@ }) } }, - /** - * 删除订单 - */ - delOrder: function(order_id, index) { - let that = this; - orderDel(order_id).then(res => { - that.orderList.splice(index, 1); - that.$set(that, 'orderList', that.orderList); - that.$set(that.orderData, 'unpaid_count', that.orderData.unpaid_count - 1); - that.getOrderData(); - return that.$util.Tips({ - title: '删除成功', - icon: 'success' - }); - }).catch(err => { - return that.$util.Tips({ - title: err - }); - }) - }, - // 确认收货 - confirmOrder: function(item, index) { - let that = this; - uni.showModal({ - title: '确认收货', - content: '为保障权益,请收到货确认无误后,再确认收货', - success: function(res) { - if (res.confirm) { - orderTake(item.order_id).then(res => { - return that.$util.Tips({ - title: '操作成功', - icon: 'success' - }, function() { - that.orderList.splice(index, 1); - that.getOrderData(); - }); - }).catch(err => { - return that.$util.Tips({ - title: err - }); - }) - } - } - }) - }, - /*申请开票*/ - applyInvoice(order_id) { - let that = this; - that.invoice_order_id = order_id - that.invoice.invoice = true; - that.$refs.addInvoicing.popupTitle = false; - that.$refs.addInvoicing.getInvoiceDefault(); - that.$refs.addInvoicing.getInvoiceList(); - }, - // 关闭发票弹窗 - changeInvoiceClose: function(data) { - if(data)this.getInvoiceData(data); - this.$set(this.invoice, 'invoice', false); - }, - // 开票回调 - getInvoiceData(data) { - let that = this - applyInvoiceApi(that.invoice_order_id,data).then(res => { - return that.$util.Tips({ - title: res.message, - }); - }).catch(err => { - return that.$util.Tips({ - title: err - }); - }) - } + }, onReachBottom: function() { this.getOrderList(); }, - - // #ifdef MP - // 分享给好友 - onShareAppMessage () { - let pages = getCurrentPages(); - let page = pages[pages.length - 1] - let shareData = { - title: '订单列表', - path: page.$page.fullPath || '/' + page.route, - }; - // 判断:用户是否登录 已经登录则添加分享人信息,未登录则正常分享 - if (this.isLogin) shareData.path = shareData.path + '?spread=' + this.uid; - // 返回最终的分享配置信息 - return shareData - }, - // 分享到朋友圈 - onShareTimeline() { - let shareData = { - title: '订单列表', - query: {}, - }; - // 判断:用户是否登录 已经登录则添加分享人信息,未登录则正常分享 - if (this.isLogin) shareData.query.spread = this.uid; - // 返回最终的分享配置信息 - return shareData - }, - // #endif } diff --git a/pages/points_mall/integral_order.vue b/pages/points_mall/integral_order.vue index ccc7a4d..1233991 100644 --- a/pages/points_mall/integral_order.vue +++ b/pages/points_mall/integral_order.vue @@ -35,14 +35,14 @@ {{goods.product.store_name}} x{{goods.cart_num}} - + {{goods.productAttr.sku}} {{goods.productAttr.ot_price}}积分+{{goods.productAttr.price}}元 - + @@ -85,41 +85,7 @@ - 支付方式 - - - - - - {{item.name}} - - - {{item.title}} - - {{userInfo.now_money}} - - - - - - - - - {{item.name}} - - - {{item.title}} - - {{userInfo.now_money}} - - - - - + @@ -130,7 +96,7 @@ 立即兑换 - + @@ -140,616 +106,566 @@