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

厦门小羽佳网站建设开发宁波seo公司网站推广

厦门小羽佳网站建设开发,宁波seo公司网站推广,网页设计用到的软件,班级网站素材下载支付成功后给指定人员(导购)发送微信公众号消息 微信openid已录入数据库表 调用后台接口发送消息接口调用代码如下: //----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?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>
http://www.15wanjia.com/news/28631.html

相关文章:

  • 有专业做外贸的网站吗泰州seo推广
  • 南明区住房和城乡建设局网站上百度小说风云榜首页
  • 网站提交了被收录后改怎么做百度一下官网首页百度一下
  • 网站建设科技有限公司网络口碑营销的成功案例
  • 总做总结 网站维护的收获网页在线生成
  • 59网站一起做网店普宁怎样建立个人网站
  • 怎么做钓鱼网站aso榜单优化
  • 关键字搜索站长工具seo排名
  • 沧州模板建站开源项盿网页设计框架图
  • 怎样编辑网站标题巩义网络推广
  • 用什么做网站方便广西壮族自治区
  • wordpress修改手机端幻灯片长沙seo排名外包
  • 网站建设综合实训日志长沙seo
  • 汽车网站制作模板icp备案查询官网
  • 企业网站产品优化怎么做seo排名赚app多久了
  • 网站建设是几个点的发票产品运营主要做什么
  • 厦门建设工程信息造价网站重庆网络推广平台
  • wordpress前台注册登入厦门百度seo排名
  • 爱情表白制作网页的网站有道搜索引擎入口
  • 惠州做网站的搜索引擎查重
  • 四川人防工程建设网站关键词百度网盘
  • 主要b2b网站淘宝关键词排名查询
  • 网站建设翻译英文无锡网站seo顾问
  • 网站建设 开发票艺人百度指数排行榜
  • 网站建设及经营应解决好的问题软文推广发布平台
  • 宁夏网站建设电话免费seo工具
  • mui做浏览器网站跳转精品成品网站1688
  • 可以做旅行行程的网站广西seo公司
  • 石材做网站站长统计app软件大全
  • 做营销型网站一般要多少钱免费的外贸网站推广方法