当前位置: 首页 > news >正文

支付成功后给指定人员发送微信公众号消息

支付成功后给指定人员(导购)发送微信公众号消息
微信openid已录入数据库表
调用后台接口发送消息接口调用代码如下:

	  //----add by grj 20231017 start //订单支付成功发送微信公众号消息$.ajax({url:'http://www.menggu100.com:7077/strutsJspAjax/SendWechatMessageAction?orderNo='+state.orderId,type:"POST",data:{},success(data){console.log("请求成功");console.log(data);},error(err){console.log(err);console.log("请求失败");},complete(){console.log("请求完成");}})//----add by grj 20231017 end 

整个页面如下
fa-uniapp-3.0.1\pages\pay\result.vue

<!-- 支付结果页面 -->
<template><s-layout title="支付结果" :bgStyle="{ color: '#FFF' }"><view class="pay-result-box ss-flex-col ss-row-center ss-col-center"><view class="pay-waiting ss-m-b-30" v-if="payResult === 'waiting'"> </view><imageclass="pay-img ss-m-b-30"v-if="payResult === 'success'":src="sheep.$url.static('/assets/addons/shopro/uniapp/order/order_pay_success.gif')"></image><imageclass="pay-img ss-m-b-30"v-if="['failed', 'closed'].includes(payResult)":src="sheep.$url.static('/assets/addons/shopro/uniapp/order/order_paty_fail.gif')"></image><view class="tip-text ss-m-b-30" v-if="payResult == 'success'">{{state.orderInfo.pay_mode === 'offline' ? '下单成功' : '支付成功'}}</view><view class="tip-text ss-m-b-30" v-if="payResult == 'failed'">支付失败</view><view class="tip-text ss-m-b-30" v-if="payResult == 'closed'">该订单已关闭</view><view class="tip-text ss-m-b-30" v-if="payResult == 'waiting'">检测支付结果...</view><view class="pay-total-num ss-flex" v-if="payResult === 'success'"><view v-if="Number(state.orderInfo.pay_fee) > 0">¥{{ state.orderInfo.pay_fee }}</view><view v-if="state.orderInfo.score_amount && Number(state.orderInfo.pay_fee) > 0">+</view><view class="price-text ss-flex ss-col-center" v-if="state.orderInfo.score_amount"><image:src="sheep.$url.static('/assets/addons/shopro/uniapp/goods/score1.svg')"class="score-img"></image><view>{{ state.orderInfo.score_amount }}</view></view></view><view class="btn-box ss-flex ss-row-center ss-m-t-50"><button class="back-btn ss-reset-button" @tap="sheep.$router.go('/pages/index/index')">返回首页</button><buttonclass="check-btn ss-reset-button"v-if="payResult === 'failed'"@tap="sheep.$router.redirect('/pages/pay/index', { orderSN: state.orderId })">重新支付</button><buttonclass="check-btn ss-reset-button"v-if="payResult === 'success'"@tap="onOrder">查看订单</button><buttonclass="check-btn ss-reset-button"v-if="payResult === 'success' &&['groupon', 'groupon_ladder'].includes(state.orderInfo.activity_type)"@tap="sheep.$router.redirect('/pages/activity/groupon/order')">我的拼团</button></view><!-- #ifdef MP --><view class="subscribe-box ss-flex ss-m-t-44"><imageclass="subscribe-img":src="sheep.$url.static('/assets/addons/shopro/uniapp/order/cargo.png')"></image><view class="subscribe-title ss-m-r-48 ss-m-l-16">获取实时发货信息与订单状态</view><view class="subscribe-start" @tap="subscribeMessage">立即订阅</view></view><!-- #endif --></view></s-layout>
</template><script setup>import { onLoad, onHide, onShow } from '@dcloudio/uni-app';import { reactive, computed } from 'vue';import { isEmpty } from 'lodash';import sheep from '@/sheep';import $ from 'jquery'const state = reactive({orderId: 0,orderType: 'goods',result: 'unpaid', // 支付状态orderInfo: {}, // 订单详情counter: 0, // 获取结果次数});const payResult = computed(() => {if (state.result === 'unpaid') {return 'waiting';}if (state.result === 'paid') {//----add by grj 20231017 start //订单支付成功发送微信公众号消息$.ajax({url:'http://www.menggu100.com:7077/strutsJspAjax/SendWechatMessageAction?orderNo='+state.orderId,type:"POST",data:{},success(data){console.log("请求成功");console.log(data);},error(err){console.log(err);console.log("请求失败");},complete(){console.log("请求完成");}})//----add by grj 20231017 end return 'success';}if (state.result === 'failed') {return 'failed';}if (state.result === 'closed') {return 'closed';}});async function getOrderInfo(orderId) {let checkPayResult;state.counter++;if (state.orderType === 'recharge') {checkPayResult = sheep.$api.trade.order;} else {checkPayResult = sheep.$api.order.detail;}const { data, code } = await checkPayResult(orderId);if (code === 1) {state.orderInfo = data;if (state.orderInfo.status === 'closed') {state.result = 'closed';return;}if (state.orderInfo.status !== 'unpaid') {state.result = 'paid';// #ifdef MPsubscribeMessage();// #endifreturn;}}if (state.counter < 3 && state.result === 'unpaid') {setTimeout(() => {getOrderInfo(orderId);}, 1500);}// 超过三次检测才判断为支付失败if (state.counter >= 3) {state.result = 'failed';}}function onOrder() {if(state.orderType === 'recharge') {sheep.$router.redirect('/pages/pay/recharge-log');}else {sheep.$router.redirect('/pages/order/list');}}// #ifdef MPfunction subscribeMessage() {let event = ['order_dispatched'];if (['groupon', 'groupon_ladder'].includes(state.orderInfo.activity_type)) {event.push('groupon_finish');event.push('groupon_fail');}sheep.$platform.useProvider('wechat').subscribeMessage(event);}// #endifonLoad(async (options) => {let id = '';// 支付订单号if (options.orderSN) {id = options.orderSN;}if (options.id) {id = options.id;}state.orderId = id;if (options.orderType === 'recharge') {state.orderType = 'recharge';}// 支付结果传值过来是失败,则直接显示失败界面if (options.payState === 'fail') {state.result = 'failed';} else {// 轮询三次检测订单支付结果getOrderInfo(state.orderId);}});onShow(() => {if(isEmpty(state.orderInfo)) return;getOrderInfo(state.orderId);})onHide(() => {state.result = 'unpaid';state.counter = 0;});
</script><style lang="scss" scoped>@keyframes rotation {0% {transform: rotate(0deg);}100% {transform: rotate(360deg);}}.score-img {width: 36rpx;height: 36rpx;margin: 0 4rpx;}.pay-result-box {padding: 60rpx 0;.pay-waiting {margin-top: 20rpx;width: 60rpx;height: 60rpx;border: 10rpx solid rgb(233, 231, 231);border-bottom-color: rgb(204, 204, 204);border-radius: 50%;display: inline-block;// -webkit-animation: rotation 1s linear infinite;animation: rotation 1s linear infinite;}.pay-img {width: 130rpx;height: 130rpx;}.tip-text {font-size: 30rpx;font-weight: bold;color: #333333;}.pay-total-num {font-size: 36rpx;font-weight: 500;color: #333333;font-family: OPPOSANS;}.btn-box {width: 100%;.back-btn {width: 190rpx;height: 70rpx;font-size: 28rpx;border: 2rpx solid #dfdfdf;border-radius: 35rpx;font-weight: 400;color: #595959;}.check-btn {width: 190rpx;height: 70rpx;font-size: 28rpx;border: 2rpx solid #dfdfdf;border-radius: 35rpx;font-weight: 400;color: #595959;margin-left: 32rpx;}}.subscribe-box {.subscribe-img {width: 44rpx;height: 44rpx;}.subscribe-title {font-weight: 500;font-size: 32rpx;line-height: 36rpx;color: #434343;}.subscribe-start {color: var(--ui-BG-Main);font-weight: 700;font-size: 32rpx;line-height: 36rpx;}}}
</style>

相关文章:

支付成功后给指定人员发送微信公众号消息

支付成功后给指定人员&#xff08;导购&#xff09;发送微信公众号消息 微信openid已录入数据库表 调用后台接口发送消息接口调用代码如下&#xff1a; //----add by grj 20231017 start //订单支付成功发送微信公众号消息$.ajax({url:http://www.menggu100.com:7077/strutsJsp…...

漏洞复现--安恒明御安全网关文件上传

免责声明&#xff1a; 文章中涉及的漏洞均已修复&#xff0c;敏感信息均已做打码处理&#xff0c;文章仅做经验分享用途&#xff0c;切勿当真&#xff0c;未授权的攻击属于非法行为&#xff01;文章中敏感信息均已做多层打马处理。传播、利用本文章所提供的信息而造成的任何直…...

简单的对称加密

异或 异或算法的好处便是数A和数B异或后&#xff0c;把结果再和数A异或便可得到B&#xff0c;或者和数B异或可重新得到数据A。利用异或的这个特性可简单实现数据的加密和解密算法。 恺撒密码 恺撒密码的替换方法是通过排列明文和密文字母表&#xff0c;密文字母表示通过将明…...

vue源码笔记之——响应系统

vue是一种声明式范式编程&#xff0c;使用vue者只需要告诉其想要什么结果&#xff0c;无需关心具体实现&#xff08;vue内部做了&#xff0c;底层是利用命令式范式&#xff09; 1. reactive为什么只能操作对象&#xff0c;对于基本数据类型&#xff0c;需要用ref&#xff1f; …...

Android Studio Giraffe | 2022.3.1

Android Gradle 插件和 Android Studio 兼容性 Android Studio 构建系统以 Gradle 为基础&#xff0c;并且 Android Gradle 插件 (AGP) 添加了几项专用于构建 Android 应用的功能。下表列出了各个 Android Studio 版本所需的 AGP 版本。 如果您的项目不受某个特定版本的 Andr…...

Spring Boot 3.0 已经就绪,您准备好了么?

Java 微服务开发框架王者 Spring 2014 年的 4 月&#xff0c;Spring Boot 1.0.0 正式发布。距离 1.0 版本的发布已经过去了 9 年多的时间&#xff0c;如今 Spring Boot 已经被 Java 开发者广泛使用&#xff0c;正如 JRebel 的 2022 年开发者生产力报告中提到的那样&#xff0c…...

5+非肿瘤分析,分型+WGCNA+机器学习筛选相关基因

今天给同学们分享一篇非肿瘤分型机器学习WGCNA实验的生信文章“Identification of diagnostic markers related to oxidative stress and inflammatory response in diabetic kidney disease by machine learning algorithms: Evidence from human transcriptomic data and mou…...

算法课作业2 OJ for Divide and Conquer

https://vjudge.net/contest/581947 A - Ultra-QuickSort 题意 每次给n个无序的数&#xff0c;互不重复&#xff0c;问最少需要多少次必要的交换操作使n个数有序。 思路 看一眼想到逆序数&#xff0c;然后验证了逆序数的个数符合样例&#xff0c;但想了一个3 2 1的话实际上…...

申请全国400电话的步骤及注意事项

导语&#xff1a;随着企业的发展&#xff0c;越来越多的公司开始意识到全国400电话的重要性。本文将介绍申请全国400电话的步骤及注意事项&#xff0c;帮助企业顺利办理相关手续。 一、了解全国400电话的概念和优势 全国400电话是一种统一的客服热线号码&#xff0c;以“400”…...

C++ 的设计模式之 工厂方法加单例

在下面的示例中&#xff0c;我将演示如何创建一个工厂类&#xff0c;该工厂类能够生成四个不同类型的单例对象&#xff0c;每个单例对象都通过单独的工厂方法进行创建。 #include <iostream> #include <mutex>// Singleton base class class Singleton { protecte…...

Deploy、Service与Ingress

Deployment 自愈 介绍:控制Pod&#xff0c;使Pod拥有多副本&#xff0c;自愈&#xff0c;扩缩容等能力 # 清除所有Pod&#xff0c;比较下面两个命令有何不同效果&#xff1f; kubectl run mynginx --imagenginxkubectl create deployment mytomcat --imagetomcat:8.5.68 # 自…...

定制化推送+精细化运营,Mobpush助力《迷你世界》用户留存率提升23%

随着智能设备的市场下沉&#xff0c;手游市场迎来了爆发式增长&#xff0c;《迷你世界》作为一款于2015年推出的手游&#xff0c;一经问世就饱受欢迎。上线短短三年&#xff0c;迷你世界在应用商店下载量已经高达2亿次&#xff0c;周下载量两千万&#xff0c;稳居第一名&#x…...

深度学习零基础教程

代码运行软件安装&#xff1a; anaconda:一个管理环境的软件–>https://blog.csdn.net/scorn_/article/details/106591160&#xff08;可选装&#xff09; pycharm&#xff1a;一个深度学习运行环境–>https://blog.csdn.net/scorn_/article/details/106591160&#xf…...

简单测试一下 展锐的 UDX710 性能

最近在接触 联通5G CPE VN007 &#xff0c;发现使用的是 展锐的Unisoc UDX710 CPU&#xff0c;正好简单的测试一下这颗CPU CPU信息 UDX710 是一颗 双核 ARM Cortex-A55 处理器&#xff0c;主频高达 1.35GHz processor : 0 BogoMIPS : 52.00 Features : fp…...

一百九十、Hive——Hive刷新分区MSCK REPAIR TABLE

一、目的 在用Flume采集Kafka中的数据直接写入Hive的ODS层静态分区表后&#xff0c;需要刷新表&#xff0c;才能导入分区和数据。原因很简单&#xff0c;就是Hive表缺乏分区的元数据 二、实施步骤 &#xff08;一&#xff09;问题——在Flume采集Kafka中的数据写入HDFS后&am…...

智慧公厕:探索未来城市环境卫生设施建设新标杆

智慧公厕是当代城市建设的一项重要举措&#xff0c;它集先进技术、人性化设计和智能管理于一体&#xff0c;为人们提供更为舒适、便捷和卫生的厕所环境。现代智慧公厕的功能异常丰富&#xff0c;从厕位监测到多媒体信息交互&#xff0c;从自动化清洁到环境调控&#xff0c;每一…...

高压放大器在无线电能中应用有哪些

高压放大器是一种用于放大电信号的放大器&#xff0c;可以将输入的低电压信号放大到更高的输出电压水平。在无线电通信和其他相关领域中&#xff0c;高压放大器具有广泛的应用。本文将详细介绍高压放大器在无线电能中的应用。 无线电发射&#xff1a;高压放大器在无线电发射中起…...

若依集成MybatisPlus

目录 一、依赖变更 1. MybatisPlus依赖 2. pagehelper依赖修改 二、相关配置 1. yml配置 1.1 注释掉原Mybatis配置 1.2 加入MybatisPlus的配置 1.3 注释掉原MybatisConfig.class 三、其他配置及功能实现 1. 自动补全create_time等信息 2. 实现MP分页 3. 实现Mybati…...

List小练习,实现添加图书,并且有序遍历

SuppressWarnings({"all"})public static void main(String[] args) {List list new LinkedList(); // List list new Vector(); // List list new ArrayList();list.add(new Book1("红楼小梦",35.5,"曹雪芹"));list.add(new B…...

代码随想录二刷 Day42

62.不同路径 简单题目自己就可以写出来&#xff0c;注意下创建二维vector的方法就可以&#xff0c; dp table如下 class Solution { public:int uniquePaths(int m, int n) {vector<vector<int>> dp(m,vector<int>(n,0));for (int i 0; i < n; i ) {dp[…...

超短脉冲激光自聚焦效应

前言与目录 强激光引起自聚焦效应机理 超短脉冲激光在脆性材料内部加工时引起的自聚焦效应&#xff0c;这是一种非线性光学现象&#xff0c;主要涉及光学克尔效应和材料的非线性光学特性。 自聚焦效应可以产生局部的强光场&#xff0c;对材料产生非线性响应&#xff0c;可能…...

中南大学无人机智能体的全面评估!BEDI:用于评估无人机上具身智能体的综合性基准测试

作者&#xff1a;Mingning Guo, Mengwei Wu, Jiarun He, Shaoxian Li, Haifeng Li, Chao Tao单位&#xff1a;中南大学地球科学与信息物理学院论文标题&#xff1a;BEDI: A Comprehensive Benchmark for Evaluating Embodied Agents on UAVs论文链接&#xff1a;https://arxiv.…...

如何为服务器生成TLS证书

TLS&#xff08;Transport Layer Security&#xff09;证书是确保网络通信安全的重要手段&#xff0c;它通过加密技术保护传输的数据不被窃听和篡改。在服务器上配置TLS证书&#xff0c;可以使用户通过HTTPS协议安全地访问您的网站。本文将详细介绍如何在服务器上生成一个TLS证…...

聊一聊接口测试的意义有哪些?

目录 一、隔离性 & 早期测试 二、保障系统集成质量 三、验证业务逻辑的核心层 四、提升测试效率与覆盖度 五、系统稳定性的守护者 六、驱动团队协作与契约管理 七、性能与扩展性的前置评估 八、持续交付的核心支撑 接口测试的意义可以从四个维度展开&#xff0c;首…...

【碎碎念】宝可梦 Mesh GO : 基于MESH网络的口袋妖怪 宝可梦GO游戏自组网系统

目录 游戏说明《宝可梦 Mesh GO》 —— 局域宝可梦探索Pokmon GO 类游戏核心理念应用场景Mesh 特性 宝可梦玩法融合设计游戏构想要素1. 地图探索&#xff08;基于物理空间 广播范围&#xff09;2. 野生宝可梦生成与广播3. 对战系统4. 道具与通信5. 延伸玩法 安全性设计 技术选…...

力扣热题100 k个一组反转链表题解

题目: 代码: func reverseKGroup(head *ListNode, k int) *ListNode {cur : headfor i : 0; i < k; i {if cur nil {return head}cur cur.Next}newHead : reverse(head, cur)head.Next reverseKGroup(cur, k)return newHead }func reverse(start, end *ListNode) *ListN…...

08. C#入门系列【类的基本概念】:开启编程世界的奇妙冒险

C#入门系列【类的基本概念】&#xff1a;开启编程世界的奇妙冒险 嘿&#xff0c;各位编程小白探险家&#xff01;欢迎来到 C# 的奇幻大陆&#xff01;今天咱们要深入探索这片大陆上至关重要的 “建筑”—— 类&#xff01;别害怕&#xff0c;跟着我&#xff0c;保准让你轻松搞…...

接口自动化测试:HttpRunner基础

相关文档 HttpRunner V3.x中文文档 HttpRunner 用户指南 使用HttpRunner 3.x实现接口自动化测试 HttpRunner介绍 HttpRunner 是一个开源的 API 测试工具&#xff0c;支持 HTTP(S)/HTTP2/WebSocket/RPC 等网络协议&#xff0c;涵盖接口测试、性能测试、数字体验监测等测试类型…...

认识CMake并使用CMake构建自己的第一个项目

1.CMake的作用和优势 跨平台支持&#xff1a;CMake支持多种操作系统和编译器&#xff0c;使用同一份构建配置可以在不同的环境中使用 简化配置&#xff1a;通过CMakeLists.txt文件&#xff0c;用户可以定义项目结构、依赖项、编译选项等&#xff0c;无需手动编写复杂的构建脚本…...

Unity中的transform.up

2025年6月8日&#xff0c;周日下午 在Unity中&#xff0c;transform.up是Transform组件的一个属性&#xff0c;表示游戏对象在世界空间中的“上”方向&#xff08;Y轴正方向&#xff09;&#xff0c;且会随对象旋转动态变化。以下是关键点解析&#xff1a; 基本定义 transfor…...