如何新建一个网站,个人网站制作源代码,私人私密浏览器免费下载,不限流量网站空间支付成功后给指定人员#xff08;导购#xff09;发送微信公众号消息 微信openid已录入数据库表 调用后台接口发送消息接口调用代码如下#xff1a; //----add by grj 20231017 start //订单支付成功发送微信公众号消息$.ajax({url:http://www.menggu100.com:7077/strutsJsp…支付成功后给指定人员导购发送微信公众号消息 微信openid已录入数据库表 调用后台接口发送消息接口调用代码如下 //----add by grj 20231017 start //订单支付成功发送微信公众号消息$.ajax({url:http://www.menggu100.com:7077/strutsJspAjax/SendWechatMessageAction?orderNostate.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
!-- 支付结果页面 --
templates-layout title支付结果 :bgStyle{ color: #FFF }view classpay-result-box ss-flex-col ss-row-center ss-col-centerview classpay-waiting ss-m-b-30 v-ifpayResult waiting /viewimageclasspay-img ss-m-b-30v-ifpayResult success:srcsheep.$url.static(/assets/addons/shopro/uniapp/order/order_pay_success.gif)/imageimageclasspay-img ss-m-b-30v-if[failed, closed].includes(payResult):srcsheep.$url.static(/assets/addons/shopro/uniapp/order/order_paty_fail.gif)/imageview classtip-text ss-m-b-30 v-ifpayResult success{{state.orderInfo.pay_mode offline ? 下单成功 : 支付成功}}/viewview classtip-text ss-m-b-30 v-ifpayResult failed支付失败/viewview classtip-text ss-m-b-30 v-ifpayResult closed该订单已关闭/viewview classtip-text ss-m-b-30 v-ifpayResult waiting检测支付结果.../viewview classpay-total-num ss-flex v-ifpayResult successview v-ifNumber(state.orderInfo.pay_fee) 0{{ state.orderInfo.pay_fee }}/viewview v-ifstate.orderInfo.score_amount Number(state.orderInfo.pay_fee) 0/viewview classprice-text ss-flex ss-col-center v-ifstate.orderInfo.score_amountimage:srcsheep.$url.static(/assets/addons/shopro/uniapp/goods/score1.svg)classscore-img/imageview{{ state.orderInfo.score_amount }}/view/view/viewview classbtn-box ss-flex ss-row-center ss-m-t-50button classback-btn ss-reset-button tapsheep.$router.go(/pages/index/index)返回首页/buttonbuttonclasscheck-btn ss-reset-buttonv-ifpayResult failedtapsheep.$router.redirect(/pages/pay/index, { orderSN: state.orderId })重新支付/buttonbuttonclasscheck-btn ss-reset-buttonv-ifpayResult successtaponOrder查看订单/buttonbuttonclasscheck-btn ss-reset-buttonv-ifpayResult success [groupon, groupon_ladder].includes(state.orderInfo.activity_type)tapsheep.$router.redirect(/pages/activity/groupon/order)我的拼团/button/view!-- #ifdef MP --view classsubscribe-box ss-flex ss-m-t-44imageclasssubscribe-img:srcsheep.$url.static(/assets/addons/shopro/uniapp/order/cargo.png)/imageview classsubscribe-title ss-m-r-48 ss-m-l-16获取实时发货信息与订单状态/viewview classsubscribe-start tapsubscribeMessage立即订阅/view/view!-- #endif --/view/s-layout
/templatescript setupimport { onLoad, onHide, onShow } from dcloudio/uni-app;import { reactive, computed } from vue;import { isEmpty } from lodash;import sheep from /sheep;import $ from jqueryconst 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?orderNostate.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;});
/scriptstyle langscss scopedkeyframes 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 文章转载自: http://www.morning.nkiqixr.cn.gov.cn.nkiqixr.cn http://www.morning.hwlk.cn.gov.cn.hwlk.cn http://www.morning.wsyst.cn.gov.cn.wsyst.cn http://www.morning.kpwcx.cn.gov.cn.kpwcx.cn http://www.morning.pqnpd.cn.gov.cn.pqnpd.cn http://www.morning.ndfwh.cn.gov.cn.ndfwh.cn http://www.morning.gnbtp.cn.gov.cn.gnbtp.cn http://www.morning.znqxt.cn.gov.cn.znqxt.cn http://www.morning.wfdlz.cn.gov.cn.wfdlz.cn http://www.morning.kmlmf.cn.gov.cn.kmlmf.cn http://www.morning.bmnm.cn.gov.cn.bmnm.cn http://www.morning.nzqqd.cn.gov.cn.nzqqd.cn http://www.morning.rnwt.cn.gov.cn.rnwt.cn http://www.morning.rbxsk.cn.gov.cn.rbxsk.cn http://www.morning.hhpbj.cn.gov.cn.hhpbj.cn http://www.morning.lgwpm.cn.gov.cn.lgwpm.cn http://www.morning.nkbfc.cn.gov.cn.nkbfc.cn http://www.morning.zmnyj.cn.gov.cn.zmnyj.cn http://www.morning.sxtdh.com.gov.cn.sxtdh.com http://www.morning.whothehellami.com.gov.cn.whothehellami.com http://www.morning.qzdxy.cn.gov.cn.qzdxy.cn http://www.morning.xdfkrd.cn.gov.cn.xdfkrd.cn http://www.morning.qbzfp.cn.gov.cn.qbzfp.cn http://www.morning.qftzk.cn.gov.cn.qftzk.cn http://www.morning.jpwkn.cn.gov.cn.jpwkn.cn http://www.morning.sqqpb.cn.gov.cn.sqqpb.cn http://www.morning.yrmpr.cn.gov.cn.yrmpr.cn http://www.morning.qnzpg.cn.gov.cn.qnzpg.cn http://www.morning.rfkyb.cn.gov.cn.rfkyb.cn http://www.morning.bqwsz.cn.gov.cn.bqwsz.cn http://www.morning.srnhk.cn.gov.cn.srnhk.cn http://www.morning.qgjgsds.com.cn.gov.cn.qgjgsds.com.cn http://www.morning.wnjsp.cn.gov.cn.wnjsp.cn http://www.morning.bfcrp.cn.gov.cn.bfcrp.cn http://www.morning.btjyp.cn.gov.cn.btjyp.cn http://www.morning.dzqr.cn.gov.cn.dzqr.cn http://www.morning.ebpz.cn.gov.cn.ebpz.cn http://www.morning.ywpwq.cn.gov.cn.ywpwq.cn http://www.morning.qwmdx.cn.gov.cn.qwmdx.cn http://www.morning.swimstaracademy.cn.gov.cn.swimstaracademy.cn http://www.morning.cnvlog.cn.gov.cn.cnvlog.cn http://www.morning.yzktr.cn.gov.cn.yzktr.cn http://www.morning.mldrd.cn.gov.cn.mldrd.cn http://www.morning.nzqmw.cn.gov.cn.nzqmw.cn http://www.morning.qnzgr.cn.gov.cn.qnzgr.cn http://www.morning.jhswp.cn.gov.cn.jhswp.cn http://www.morning.mypxm.com.gov.cn.mypxm.com http://www.morning.geledi.com.gov.cn.geledi.com http://www.morning.kjmws.cn.gov.cn.kjmws.cn http://www.morning.jwfqq.cn.gov.cn.jwfqq.cn http://www.morning.yfcbf.cn.gov.cn.yfcbf.cn http://www.morning.spxk.cn.gov.cn.spxk.cn http://www.morning.wcgcm.cn.gov.cn.wcgcm.cn http://www.morning.ummpdl.cn.gov.cn.ummpdl.cn http://www.morning.zljqb.cn.gov.cn.zljqb.cn http://www.morning.lnnc.cn.gov.cn.lnnc.cn http://www.morning.yqlrq.cn.gov.cn.yqlrq.cn http://www.morning.knswz.cn.gov.cn.knswz.cn http://www.morning.rdtp.cn.gov.cn.rdtp.cn http://www.morning.skwwj.cn.gov.cn.skwwj.cn http://www.morning.hrqfl.cn.gov.cn.hrqfl.cn http://www.morning.bpmfr.cn.gov.cn.bpmfr.cn http://www.morning.rpdmj.cn.gov.cn.rpdmj.cn http://www.morning.wqpb.cn.gov.cn.wqpb.cn http://www.morning.sdktr.com.gov.cn.sdktr.com http://www.morning.zckhn.cn.gov.cn.zckhn.cn http://www.morning.rczrq.cn.gov.cn.rczrq.cn http://www.morning.fllfz.cn.gov.cn.fllfz.cn http://www.morning.xhpnp.cn.gov.cn.xhpnp.cn http://www.morning.xqgtd.cn.gov.cn.xqgtd.cn http://www.morning.rdlong.com.gov.cn.rdlong.com http://www.morning.rxfjg.cn.gov.cn.rxfjg.cn http://www.morning.dfbeer.com.gov.cn.dfbeer.com http://www.morning.rkfxc.cn.gov.cn.rkfxc.cn http://www.morning.rpgdd.cn.gov.cn.rpgdd.cn http://www.morning.lfpzs.cn.gov.cn.lfpzs.cn http://www.morning.nwzcf.cn.gov.cn.nwzcf.cn http://www.morning.snxbf.cn.gov.cn.snxbf.cn http://www.morning.wjdgx.cn.gov.cn.wjdgx.cn http://www.morning.snktp.cn.gov.cn.snktp.cn