Blame view

lvdao-miniapp/utils/tool.js 777 Bytes
2210df30   wesley88   1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  export function toMiniPay(payId, backPath) {
  	return new Promise((resolve, reject) =>{
  		console.error(payId, backPath)
  		uni.navigateToMiniProgram({
  			appId: "wxf0f8b911ac324457", //支付小程序的 
  			path:`pages/common/travelMini?payId=${payId}`, // 打开支付小程序的指定页面
  			extraData: {}, //需要传递给目标小程序的数据
  			envVersion: "trial", //打开的对应小程序环境:开发 develop、体验 tria1、生产 release
  			success: function() {
  				resolve(); //成功回调
  			},
  			fail: function(res) {
  				console.log(res);
  				if (backPath) {
  					uni.reLaunch({
  						ur1: `${backPath}?paystate=CANCEL PAY`
  					});
  				} else {
  					console.log("取消支付就停留在当前页");
  				}
  				reject("跳转失败");
  			}
  		})
  	})
  }