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

网站建设需求文案平台推广文案

网站建设需求文案,平台推广文案,易语言编程可以做网站么,怎么做刷东西的网站时间:2023/2/17 背景:微信在推出点金计划后,原本window.WeixinJSBridge.invoke方法的回调失效了,需要在微信支付服务商平台|平台开放更多能力,与服务商一起成长这里进行配置,配置流程跟着官方给…

时间:2023/2/17

背景:微信在推出点金计划后,原本window.WeixinJSBridge.invoke方法的回调失效了,需要在微信支付服务商平台|平台开放更多能力,与服务商一起成长这里进行配置,配置流程跟着官方给出的文档一步步进行就好。

一.坑点:

        ①如果想要跳回原来商家页面,必须要根据官方文档配置“商家小票”页面,不然只有自己手动关掉网页。

        ②“商家小票”调试工具里面的,“从业机构商户号”是银行/服务商的商户号,底部的2个单号,可以在微信支付的“账单”里面点进去查询到。

        ③“商家小票”页面是微信用iframe嵌入的一个模块,要注意是否根据文档要求,将微信设置为了白名单(我们这里是通过nginx配置)

二.前端代码

tips:因为各种原因,手撸了一个html页面,其实用vue页面也是可以的

​
<!-- 此页面是放到服务器下,可以直接访问,供微信支付回调 -->
<!DOCTYPE html>
<html lang="cn"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="referrer" content="origin"><meta name="viewport"content="width=device-width, viewport-fit=cover, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"><meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /><title>砼联数科支付</title><script type="text/javascript" charset="UTF-8" src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"></script><script src="./jsapiResult/jsFiles/vue.js"></script><script type="text/javascript" src="./jsapiResult/jsFiles/element.js"></script><script type="text/javascript" src="./jsapiResult/jsFiles/axios.js"></script><link rel="stylesheet" href="./jsapiResult/cssFiles/jsapiResult.css"><link rel="stylesheet" href="./jsapiResult/cssFiles/theme.css">
</head><body><div class="gold-pay-result" id="goldPayResult"><div class="top-logo middle-center"><el-button type="success" icon="el-icon-check" circle size="large"></el-button></div><div class="custom-name middle-center">{{ pageInfo.payerName }}</div><div class="co-line vertical-center"><div class="left-title">订单状态</div><div class="right-info">支付成功</div></div><div class="co-line vertical-center"><div class="left-title">支付流水尾号</div><div class="right-info">{{pageInfo.txnNo}}</div></div><div class="cut-line"></div><div class="co-line vertical-center"><div class="left-title">支付总额</div><div class="right-info money-cl">¥{{ pageInfo.amount }}</div></div><div class="bottom-btn middle-center"><el-button class="return-btn" type="primary" icon="el-icon-position" size="small" @click="backBusiness">返回商家平台</el-button></div><script>let app = new Vue({el: '#goldPayResult',data: {pageInfo: {payerName: '',txnNo: '',amount: ''}},mounted: function () {this.openCustomPage();this.getTraderInfo();},methods: {getTraderInfo() {const out_trade_no = this.glGetUrlParam('out_trade_no');const sub_mch_id = this.glGetUrlParam('sub_mch_id');const check_code = this.glGetUrlParam('check_code');// 判断如果字段都有值try {if (out_trade_no && sub_mch_id && check_code) {let url = "";let postData = {pmcNo: sub_mch_id}axios({method: 'POST',url: url, //   data: postData, //加密,headers: {"Content-Type": "application/json"},}).then((res) => {_re = res.data.message;_re.txnNo = _re.txnNo.substr(-4);Object.assign(this.pageInfo, _re);}).catch(err => {this.$message.error('调取信息接口异常!')})} else {this.$message.error('微信订单信息缺失!')}} catch (error) {this.$message.error('获取订单基本信息异常!');}},backBusiness() {// 跳转到指定的h5页面/小程序,智选平台要做特殊化处理,小程序直接跳网页let _addr = "";let jsapiJump = [];if (this.pageInfo.tradeType == 'JSAPI' || jsapiJump.indexOf(this.pageInfo.channelNo) !=-1) {_addr = this.pageInfo.jumpAddress1;} else {_addr =``  //跳小程序}this.$message.info(`即将跳回的地址信息为:${_addr}`);const mchData = {action: "jumpOut",jumpOutUrl: _addr,}; // 跳转到指定的页面并携带参数const postData = JSON.stringify(mchData);window.parent.postMessage(postData, "*");},openCustomPage() {let mchData = {action: 'onIframeReady',displayStyle: 'SHOW_CUSTOM_PAGE'}let postData = JSON.stringify(mchData)window.parent.postMessage(postData, '*')},glGetUrlParam(name) {var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配var context = "";if (r != null)context = decodeURIComponent(r[2]);reg = null;r = null;return context == null || context == "" || context == "undefined" ? "" : context;}},})</script>
</body></html>​

引入的头部文件,除了./jsapiResult/cssFiles/jsapiResult.css这个文件外,其他直接去网上扒拉资源就好,我这里都是自己下载下来放置为静态文件调用,这个样式文件如下

.gold-pay-result {padding: 10px 20px 20px 20px;width: calc(100% - 40px);font-size: 14px;margin-bottom: 10px;background: white;
}.gold-pay-result .top-logo {width: 100%;margin: 10px 0px;
}.gold-pay-result .success-cl {font-size: 20px;font-weight: bold;
}.gold-pay-result .custom-name {width: 100%;margin: 10px 0px 25px 0px;
}.gold-pay-result .cut-line {height: 2px;width: 100%;margin: 5px 0px;border-bottom: 1px solid lightgray;
}.gold-pay-result .co-line {width: 100%;margin: 12px 0px;
}.gold-pay-result .left-title {color: gray;
}.gold-pay-result .return-btn {font-size: 14px;margin-top: 15px;
}.gold-pay-result .right-info {margin-left: auto;
}.gold-pay-result .money-cl {font-size: 18px;}.gold-pay-result.bottom-btn {width: 100%;margin-top: 25px;
}.vertical-center {display: flex;align-items: center;
}.middle-center {display: flex;align-items: center;justify-content: center;
}

 三.因为微信的前端回调没有跳转小程序的方法,所以设置了一个空白页面,先跳转到空白页面,空白页面再跳转到小程序,空白页面代码如下

<!-- 小程序的结果页面,空白页,主要负责跳转回小程序 -->
<template><div class="mini-pay-result full-page"></div>
</template><script setup>
import { onMounted } from "vue";
import { getUrlParam } from "@/utils/tools.js"
import { ElMessage } from 'element-plus';
onMounted(() => {jumpToMiniPro();
});function jumpToMiniPro() {try {let params = getUrlParam('jumpAddress');if (!params.jumpAddress) {ElMessage.error('获取小程序跳转地址失败,请关闭后重新进入!');return;}wx.miniProgram.redirectTo({ url: params.jumpAddress });} catch (error) {ElMessage.error('小程序跳转失败,即将关闭当前页');setTimeout(() => {window.close();}, 2000);}
}
</script><style lang="scss" scoped>
.mini-pay-result {}
</style>

getUrlParam方法就是一个很普通的获取url参数的方法

wx.miniProgram.redirectTo需要引入

<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>

这个文件,我目前是放置在index.html里面


文章转载自:
http://collate.bbrf.cn
http://hyp.bbrf.cn
http://perai.bbrf.cn
http://poise.bbrf.cn
http://grandee.bbrf.cn
http://bonn.bbrf.cn
http://shoreless.bbrf.cn
http://anhydration.bbrf.cn
http://unabiding.bbrf.cn
http://understaffed.bbrf.cn
http://ushership.bbrf.cn
http://delaine.bbrf.cn
http://saltando.bbrf.cn
http://reman.bbrf.cn
http://eventuality.bbrf.cn
http://allogamous.bbrf.cn
http://ambo.bbrf.cn
http://repoint.bbrf.cn
http://camorrism.bbrf.cn
http://walsall.bbrf.cn
http://transferror.bbrf.cn
http://planting.bbrf.cn
http://horsebean.bbrf.cn
http://creepie.bbrf.cn
http://baculum.bbrf.cn
http://disperse.bbrf.cn
http://haoma.bbrf.cn
http://snipping.bbrf.cn
http://ingratiate.bbrf.cn
http://typographical.bbrf.cn
http://parotid.bbrf.cn
http://acathisia.bbrf.cn
http://juvenal.bbrf.cn
http://planetabler.bbrf.cn
http://apogeotropically.bbrf.cn
http://tullibee.bbrf.cn
http://contractility.bbrf.cn
http://armet.bbrf.cn
http://germinator.bbrf.cn
http://interminable.bbrf.cn
http://annoy.bbrf.cn
http://subastringent.bbrf.cn
http://extemporization.bbrf.cn
http://longways.bbrf.cn
http://labourious.bbrf.cn
http://fete.bbrf.cn
http://wretch.bbrf.cn
http://sircar.bbrf.cn
http://vow.bbrf.cn
http://lightsome.bbrf.cn
http://fustiness.bbrf.cn
http://youthfully.bbrf.cn
http://hematoxylic.bbrf.cn
http://sadism.bbrf.cn
http://perithelium.bbrf.cn
http://salome.bbrf.cn
http://bicentenary.bbrf.cn
http://glyceryl.bbrf.cn
http://tragic.bbrf.cn
http://latigo.bbrf.cn
http://pirozhki.bbrf.cn
http://zine.bbrf.cn
http://unmechanized.bbrf.cn
http://allowance.bbrf.cn
http://picked.bbrf.cn
http://actinodermatitis.bbrf.cn
http://rancher.bbrf.cn
http://haussmannize.bbrf.cn
http://protogine.bbrf.cn
http://nares.bbrf.cn
http://etep.bbrf.cn
http://photosetting.bbrf.cn
http://sportswear.bbrf.cn
http://khanate.bbrf.cn
http://convocation.bbrf.cn
http://dipnet.bbrf.cn
http://gazoomph.bbrf.cn
http://metathesis.bbrf.cn
http://quadrifoliate.bbrf.cn
http://systematician.bbrf.cn
http://cuprous.bbrf.cn
http://diplont.bbrf.cn
http://spiderling.bbrf.cn
http://klavern.bbrf.cn
http://scilly.bbrf.cn
http://diaphanous.bbrf.cn
http://ileum.bbrf.cn
http://bracing.bbrf.cn
http://pothouse.bbrf.cn
http://nonstandard.bbrf.cn
http://sulfarsenide.bbrf.cn
http://implead.bbrf.cn
http://pertinently.bbrf.cn
http://centimetre.bbrf.cn
http://polyglottism.bbrf.cn
http://obturator.bbrf.cn
http://cockney.bbrf.cn
http://surprising.bbrf.cn
http://genevieve.bbrf.cn
http://smithy.bbrf.cn
http://www.15wanjia.com/news/98898.html

相关文章:

  • 精湛的赣州网站建设杭州网站外包
  • 建发公司简介北京做seo的公司
  • 安徽省建设工程信息网官方网站短视频推广公司
  • 哪个网站可以做创意短视频网站石家庄网站建设案例
  • 如何认识软件开发模型北京网站优化企业
  • wordpress 响应式模版手机系统优化软件
  • 做网络投票网站好做吗图片seo优化是什么意思
  • 网站中文章内图片做超链接seo门户网站优化
  • ps做图游戏下载网站武汉关键词排名推广
  • 免费做网站周口seo公司
  • 五华网站建设互联网推广方案
  • 长沙网站seo外包网络营销到底是个啥
  • 西安网站建设设计公司哪个平台可以接推广任务
  • 学做美食视频网站长沙百度seo
  • 日照网站建建设关键词优化公司哪家好
  • No餐饮网站建设店铺推广软文案例
  • 北京到安阳高铁时刻表优化器
  • 诸城网站建设哪家好seo排名优化课程
  • 华为公司网站建设分析评价贵州网站seo
  • 快速模仿一个网站成人教育培训机构十大排名
  • 衢州市建设局网站投放广告的渠道有哪些
  • 照片管理网站模板下载怎么推广软件
  • 网站开发和app开发怎样和政府交换友链
  • 顺德网站建设公司西安seo网站关键词
  • 对于协会的新年祝贺语网站模板百度小说搜索风云榜排行榜
  • 网站设计的基本知识结构如何设计网站
  • 做网站专业公司站长工具查询域名信息
  • 建设一个网站的过程中国企业500强最新排名
  • wordpress站点如何加速外链link
  • 贴吧做网站软文撰写公司