uniapp 微信支付

		payDocker(id, phone) {
			let that = this;
			if (uni.getStorageSync('userinfo')) {
				let payData = {
					userId: uni.getStorageSync('userinfo').id,
					doctorId: id,
					payType: 1,
					payEquipment: 'JSAPI'
				};
				console.log(payData)
				uni.showModal({
					title: '支付提示',
					content: '确认支付吗?',
					success: function(res) {
						if (res.confirm) {
							that.$LoadingMsg('正在支付')
							that.$Request.post(that.$api.userDockerCreateOrder, payData).then(res => {
								if (res.code == 200) {
									uni.hideLoading()
									uni.requestPayment({
										timeStamp: res.data.timeStamp,
										nonceStr: res.data.nonceStr,
										package: res.data.package,
										signType: 'MD5',
										paySign: res.data.paySign,
										success() {
											uni.makePhoneCall({
												phoneNumber: phone
											});
										},
										fail(res) {
											uni.showToast({
												title: '取消支付',
												icon: 'none'
											})
										}
									})
								} else if (res.code == 202) {
									uni.showToast({
										title: res.msg,
										icon: 'none',
										success() {
											setTimeout(function() {
												that.binding()
											}, 2000)
										}
									})
								}
								if (res.code == 500) {
									uni.showToast({
										title: res.msg,
										icon: 'none'
									})
								}
							})
						} else if (res.cancel) {}
					}
				});
			} else {
				uni.showModal({
					title: '提示',
					content: '你还未登录,是否登录?',
					success: function(res) {
						if (res.confirm) {
							uni.navigateTo({
								url: '/pages/login/login'
							})
						}
					}
				})
			}
		},**加粗样式**
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值