feat: 支付

This commit is contained in:
黄泽群
2026-07-23 14:00:22 +08:00
committed by charles
parent 15dd3d7b5b
commit 3629555911
8 changed files with 1098 additions and 1018 deletions
@@ -1,13 +1,13 @@
<template>
<view class="mine_order_info_warp" :style="{
height: height,
}">
<view class="mine_order_info_warp">
<up-loading-page :loading="listLoading"></up-loading-page>
<view class="order_info_header">
<up-image src="/static/common/left_b.png" width="20" height="19" bgColor="#f1f6ff00" @click="jumpLeft"></up-image>
<up-image src="/static/common/left_b.png" width="20" height="19" bgColor="#f1f6ff00"
@click="jumpLeft"></up-image>
<view class="header_status">
<view style="margin-top: 10rpx">
<up-image src="/static/common/order_status_1.png" width="20" height="19" bgColor="#f1f6ff00"></up-image>
<up-image src="/static/common/order_status_1.png" width="20" height="19"
bgColor="#f1f6ff00"></up-image>
</view>
<text class="msg">{{ getValue(ORDER_STATUS, orderInfo.status) }}</text>
</view>
@@ -22,8 +22,8 @@
orderInfo.sumAmount
}}</text>
<text style="font-size: 20rpx; font-weight: bold; margin-left: 20rpx">订单</text>
<text style="font-size: 28rpx; font-weight: bold; margin-left: 10rpx">{{ formatDate1(orderInfo.expireTime)
}}</text>
<text
style="font-size: 28rpx; font-weight: bold; margin-left: 10rpx">{{ formatDate1(orderInfo.expireTime) }}</text>
<text style="font-size: 20rpx; font-weight: bold">&nbsp;自动取消</text>
</view>
</view>
@@ -33,7 +33,8 @@
<!-- 物流单号 -->
<view class="address_info">
<view class="address_data_warp">
<up-image src="/static/common/waybill.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
<up-image src="/static/common/waybill.png" width="20" height="20"
bgColor="#f1f6ff00"></up-image>
<view class="address_info_name">订单编号:</view>
<view class="address_info_mobile" style="margin-right: 20rpx">{{
orderInfo.orderNum
@@ -47,7 +48,8 @@
<view class="address_warp">
<view class="address_info">
<view class="address_data_warp">
<up-image src="/static/common/address.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
<up-image src="/static/common/address.png" width="20" height="20"
bgColor="#f1f6ff00"></up-image>
<view class="address_info_name">{{ orderInfo.name }}</view>
<view class="address_info_mobile">{{ orderInfo.phone }}</view>
</view>
@@ -63,7 +65,8 @@
<view class="order_comm order_product_warp">
<!-- 头部 -->
<view class="order_product_header">
<up-image :src="orderInfo.shopLogo" width="22" height="22" bgColor="#f1f6ff00" shape="circle"></up-image>
<up-image :src="orderInfo.shopLogo" width="22" height="22" bgColor="#f1f6ff00"
shape="circle"></up-image>
<view class="order_product_title">{{ orderInfo.shopName }}</view>
</view>
<!-- 产品详情 -->
@@ -75,7 +78,8 @@
<view class="content_info_title">{{ pItem.title }}</view>
<view class="content_info_tag">{{ pItem.goodsSpece }}</view>
<view>
<text class="content_info_description" v-for="dItem in pItem.description" :key="dItem">
<text class="content_info_description" v-for="dItem in pItem.description"
:key="dItem">
{{ dItem }}
</text>
</view>
@@ -91,8 +95,8 @@
<view class="item_value">
<view>{{ pItem.expressNo }} </view>
<view style="margin-left: 10rpx">
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00"
@click="copyData(pItem.expressNo)"></up-image>
<up-image src="/static/common/copy.png" width="14" height="14"
bgColor="#f1f6ff00" @click="copyData(pItem.expressNo)"></up-image>
</view>
</view>
</view>
@@ -105,24 +109,17 @@
<view class="order_comm order_data_warp">
<view class="data_item">
<view class="item_title">商品总价</view>
<view class="item_value" v-if="!orderInfo.buyDeductionValue">¥{{ orderInfo.sumAmount }}</view>
<view class="item_value" v-else>数字积分{{ orderInfo.buyDeductionValue }} +¥{{ orderInfo.sumAmount }}</view>
<view class="item_value">¥{{ orderInfo.sumAmount }}</view>
</view>
<view class="data_item">
<view class="item_title">快递运费</view>
<view class="item_value">¥{{ orderInfo.postage }}</view>
</view>
<view class="data_item" v-if="orderInfo.buyDeductionValue">
<view class="item_title">数字积分</view>
<view class="item_value" style="color: #7934F6">{{ orderInfo.buyDeductionValue }}数字积分</view>
</view>
<view class="data_item">
<view class="item_title">平台优惠<text class="copy_order_coupon" v-if="orderInfo.coupon">优惠券</text></view>
<view class="item_title">平台优惠<text class="copy_order_coupon" v-if="orderInfo.coupon">优惠券</text>
</view>
<view class="item_value">-¥0.00</view>
</view>
<view class="data_item">
<view class="item_title">应付款</view>
<view class="item_value pay_amount">¥{{ orderInfo.sumAmount + orderInfo.postage }}</view>
@@ -164,14 +161,18 @@
" height="12" bgColor="#f1f6ff00"></up-image>
</view>
</view>
<view>
<view @click.native="
previewQrcode(
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`
)
">
<up-qrcode
:val="`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`"
:size="63"
@click.stop="previewQrcode(`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`)"></up-qrcode>
:size="63"></up-qrcode>
</view>
</view>
<!-- 支付方式 -->
<view class="order_way_warp" @click="wayShowFun(true)" v-if="orderInfo.status === ORDER_TYPE.UNPAID">
<view>支付方式</view>
<view class="order_way_right">
@@ -184,7 +185,8 @@
[ORDER_TYPE.UNPAID, ORDER_TYPE.NOT_RECEIVE].includes(orderInfo.status)
">
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">取消订单</view> -->
<view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.UNPAID" @click="goPay">去付款</view>
<view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.UNPAID" @click="goPay">去付款
</view>
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请退款</view> -->
<view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.NOT_RECEIVE"
@click="confirmReceiptOk(orderInfo)">确认收货</view>
@@ -211,20 +213,21 @@
</view>
<up-radio :name="item.type" activeColor="#FF7C41"> </up-radio>
</view>
<view class="balance_comm_msg" v-if="item.type === 'balance' && isShowBalance">当前现金余额不足,如需支付请前往充值</view>
<view class="balance_comm_msg" v-if="item.type === 'balance' && isShowBalance">
当前现金余额不足,如需支付请前往充值</view>
</view>
</up-radio-group>
<view class="popup_but" @click="wayShow = false"> 确认 </view>
</view>
</up-popup>
<up-toast ref="uToastRef"></up-toast>
<QrcodePreview ref="qrcodePreview" :qrcodeVal="qrcodeVal" />
<QrcodePreview ref="qrcodePreviewRef" :qrcodeVal="qrcodeVal" />
</view>
</template>
<script>
import { ORDER_TYPE, ORDER_STATUS, getValue } from "@/utils/enumUtils.js";
import QrcodePreview from "@/pages/rwa_package/rwa_withdrawal_log/qrcode-preview.vue";
import QrcodePreview from "@/pages/rwa_package/component/qrcode-preview.vue";
import {
copyData,
assembleAddress,
@@ -245,9 +248,6 @@ import {
} from "@/utils/payUtils.js";
export default {
components: {
QrcodePreview,
},
computed: {
ORDER_TYPE() {
return ORDER_TYPE;
@@ -461,14 +461,18 @@ export default {
previewQrcode(val) {
console.log("val--", val);
this.qrcodeVal = val;
this.$refs.qrcodePreview.open();
this.$refs.qrcodePreviewRef.open();
},
},
components: {
QrcodePreview,
},
};
</script>
<style lang="scss" scoped>
.code_content {
.code_content {
display: flex;
background: #fff;
border-radius: 24rpx;
@@ -492,17 +496,17 @@ export default {
word-break: keep-all;
}
}
}
}
.mine_order_info_warp {
height: 100vh;
// height: calc(100vh - 180rpx);
.mine_order_info_warp {
// height: 100vh;
height: calc(100vh - 180rpx);
background-color: $app-bj;
position: relative;
overflow-y: auto;
}
}
.order_info_header {
.order_info_header {
background-color: $app-bt-bj;
height: 288rpx;
display: flex;
@@ -524,9 +528,9 @@ export default {
color: #ffffff;
}
}
}
}
.order_info_content {
.order_info_content {
position: absolute;
top: 184rpx;
width: calc(100% - 40rpx);
@@ -616,17 +620,17 @@ export default {
padding: 20rpx 10rpx 20rpx 44rpx;
}
}
}
}
.order_comm {
.order_comm {
background: #ffffff;
border-radius: 20rpx;
padding: 30rpx;
margin-top: 30rpx;
width: calc(100% - 60rpx);
}
}
.order_product_warp {
.order_product_warp {
.order_product_header {
display: flex;
align-items: center;
@@ -638,9 +642,9 @@ export default {
color: #1a1a1a;
margin-left: 10rpx;
}
}
}
.order_data_warp {
.order_data_warp {
margin-bottom: 20rpx;
.pay_amount {
@@ -669,9 +673,9 @@ export default {
.order_data_but {
border: 1rpx solid #f6f6f6;
}
}
}
.order_but_warp {
.order_but_warp {
position: fixed;
height: 140rpx;
bottom: 0;
@@ -684,40 +688,40 @@ export default {
.operate_comm {
height: 34rpx;
}
}
}
.content_other_item {
.content_other_item {
margin-top: 20rpx;
}
}
.data_item {
.data_item {
display: flex;
justify-content: space-between;
line-height: 60rpx;
font-weight: bold;
font-size: 24rpx;
}
}
.item_title {
.item_title {
color: #808080;
}
}
.item_value {
.item_value {
color: #1a1a1a;
display: flex;
}
}
.order_way_warp {
.order_way_warp {
margin-bottom: 60rpx;
width: calc(100% - 96rpx);
}
}
.content_info_title {
.content_info_title {
width: 370rpx;
}
}
.data_item_yd {
.data_item_yd {
display: flex;
justify-content: left;
}
}
</style>
@@ -25,7 +25,8 @@
<view class="form_item">
<view class="form_item_title">目标账户</view>
<view class="recharge_way_warp">
<up-radio-group v-model="form.toCategory" placement="column" v-if="wayOption && wayOption.length !== 0">
<up-radio-group v-model="form.toCategory" placement="column"
v-if="wayOption && wayOption.length !== 0">
<view :class="index + 1 < wayOption.length ? 'way_item way_item_but' : 'way_item'"
v-for="(item, index) in wayOption" :key="item.id">
<view class="way_item_">
@@ -53,26 +54,34 @@
</template>
<script>
import Header from '@/components/header.vue';
import { getExchangeRule, exchange } from '@/api/finance.js';
import { ACCOUNT_CATEGORY, getValue } from '@/utils/enumUtils.js';
import Header from '@/components/header.vue';
import {
getExchangeRule,
exchange
} from '@/api/finance.js';
import {
ACCOUNT_CATEGORY,
getValue
} from '@/utils/enumUtils.js';
export default {
export default {
computed: {
ACCOUNT_CATEGORY() {
return ACCOUNT_CATEGORY;
},
},
components: { Header },
components: {
Header
},
data() {
return {
form: {
amount: null,//充值金额
amount: null, //充值金额
fromCategory: null,
toCategory: null,
},
wayOption: [],
proAmount: 0,// 可兑换的金额
proAmount: 0, // 可兑换的金额
}
},
onLoad(option) {
@@ -133,7 +142,7 @@ export default {
}
}
}
}
</script>
<style lang="scss" scoped></style>
@@ -46,19 +46,29 @@
</template>
<script>
import Header from '@/components/header.vue';
import { getRechargeSupportPay, recharge } from '@/api/finance.js';
import { feedback } from '@/api/payment.js';
import { appWxpayFun, zfbPayFun } from '@/utils/payUtils.js'
import Header from '@/components/header.vue';
import {
getRechargeSupportPay,
recharge
} from '@/api/finance.js';
import {
feedback
} from '@/api/payment.js';
import {
appWxpayFun,
zfbPayFun
} from '@/utils/payUtils.js'
export default {
components: { Header },
export default {
components: {
Header
},
data() {
return {
form: {
category: null,
amount: null,//充值金额
payway: null,// 支付当时
amount: null, //充值金额
payway: null, // 支付当时
},
wayOption: [],
proAmount: 0,
@@ -98,7 +108,7 @@ export default {
},
// 立即充值
async rechargeOk() {
console.log('aaaaa',this.form);
console.log('aaaaa', this.form);
const params = this.form;
if (!params.amount) {
this.$refs.uToastRef.show({
@@ -114,7 +124,27 @@ export default {
});
return;
}
if (params.payway == "wechat") {
// #ifdef MP-WEIXIN
params["payway"] = "wechatMiniProgram";
params["code"] = await new Promise((resolve) => {
uni.login({
provider: "weixin",
onlyAuthorize: true,
success: function(loginRes) {
resolve(loginRes.code);
},
fail: (err) => {
resolve(""); // 登录失败时返回空字符串,避免后续流程中断
},
});
});
// #endif
}
console.log("params---", params);
const result = await recharge(params);
console.log("result", result);
if (result && result.bizcode === 100) {
@@ -230,7 +260,7 @@ export default {
},
}
}
}
</script>
<style lang="scss" scoped></style>
@@ -3,7 +3,7 @@
<view class="result-modal" v-if="visible">
<view class="modal-content">
<view class="modal-content-result">
<view v-for="item in prize" class="modal-content-result-item">
<view v-for="(item, index) in prize" :key="index" class="modal-content-result-item">
<view class="par-value">
<text v-if="item.type === 'balance'" class="moeny">¥ </text>{{ item.parValue }}
</view>
@@ -43,7 +43,7 @@ export default {
}
</script>
<style scoped>
<style scoped lang="scss">
.result-modal {
position: fixed;
top: 0;
+17
View File
@@ -275,6 +275,23 @@ export default {
category: 'balance',
payway: this.curSelect == '0' ? 'wechat' : 'alipay'
}
if (params.payway == "wechat") {
// #ifdef MP-WEIXIN
params["payway"] = "wechatMiniProgram";
params["code"] = await new Promise((resolve) => {
uni.login({
provider: "weixin",
onlyAuthorize: true,
success: function (loginRes) {
resolve(loginRes.code);
},
fail: (err) => {
resolve(""); // 登录失败时返回空字符串,避免后续流程中断
},
});
});
// #endif
}
recharge(params).then(result => {
if (result && result.bizcode === 100) {
const item = result.data;
@@ -1,51 +1,29 @@
<template>
<view class="rwa_withdrawal_log">
<Header
leftTitle="行权记录"
left-path-type="navigateTo"
:leftPath="leftPath"
/>
<Header leftTitle="行权记录" left-path-type="navigateTo" :leftPath="leftPath" />
<view class="_log_content">
<view class="_log_content_title">
<view>行权账户邮箱/时间</view>
<view>金额/状态</view>
</view>
<scroll-view
scroll-y="true"
@scrolltolower="loadMore"
style="height: calc(100vh - 300rpx)"
>
<view
class="_content_item"
v-for="item in logList"
:key="item.id"
v-if="logList && logList.length !== 0"
>
<view class="_content_item_no _content_item_no_buto"
>NO.{{ item.tradeNo }}</view
>
<scroll-view scroll-y="true" @scrolltolower="loadMore" style="height: calc(100vh - 300rpx)">
<view class="_content_item" v-for="item in logList" :key="item.id"
v-if="logList && logList.length !== 0">
<view class="_content_item_no _content_item_no_buto">NO.{{ item.tradeNo }}</view>
<!-- <view class="_content_item_no _content_item_no_buto" v-if="item.exchNo">股东流水号:{{item.exchNo}}</view> -->
<view class="_content_item_but">
<view class="_content_item_left">
<up-image
src="/static/rwa/account.png"
width="40"
height="40"
bgColor="#f1f6ff00"
/>
<up-image src="/static/rwa/account.png" width="40" height="40" bgColor="#f1f6ff00" />
<view class="_content_item_left_">
<view class="_content_item_left_title"
>{{ item.name }}-{{ item.account }}</view
>
<view class="_content_item_left_title">{{ item.name }}-{{ item.account }}</view>
<view class="_content_item_left_val">{{
formatDate(item.ctdate)
}}</view>
</view>
</view>
<view class="_content_item_right">
<view class="_content_item_left_title _content_item_left_amount"
>{{ item.amount }} {{ categotyObj.name || "USDT" }}</view
>
<view class="_content_item_left_title _content_item_left_amount">{{ item.amount }}
{{ categotyObj.name || "USDT" }}</view>
<view class="_content_item_left_status">{{
getValue(RWA_STATUS, item.status)
}}</view>
@@ -54,23 +32,15 @@
<view style="border-top: 1rpx solid #f5f5f5; margin: 28rpx 0"></view>
<view class="code_content" v-if="item.antChainHash">
<view>
<view style="font-size: 28rpx; color: #333; font-weight: bold"
>您的订单已接入蚂蚁链溯源</view
>
<view style="font-size: 20rpx; color: #999; margin-bottom: 18rpx"
>扫描二维码或复制下方链接查看溯源信息</view
>
<view style="font-size: 28rpx; color: #333; font-weight: bold">您的订单已接入蚂蚁链溯源</view>
<view style="font-size: 20rpx; color: #999; margin-bottom: 18rpx">扫描二维码或复制下方链接查看溯源信息</view>
<view class="code_content_item">
<view class="code_content_item_text">
{{
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${item.antChainHash}`
}}
</view>
<up-image
style="margin-left: 8rpx"
src="/static/rwa/copy.png"
width="12"
@click="
<up-image style="margin-left: 8rpx" src="/static/rwa/copy.png" width="12" @click="
copyData(
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${item.antChainHash}`
)
@@ -106,14 +76,27 @@
</template>
<script>
import Header from "@/components/header.vue";
import { copyData } from "@/utils/index.js";
import { getExchTransferRecord, getAcctBalance } from "@/api/finance.js";
import { formatDate } from "@/utils/index.js";
import { RWA_STATUS, getValue } from "@/utils/enumUtils.js";
import QrcodePreview from "@/pages/rwa_package/rwa_withdrawal_log/qrcode-preview.vue";
export default {
components: { Header, QrcodePreview },
import Header from "@/components/header.vue";
import {
copyData
} from "@/utils/index.js";
import {
getExchTransferRecord,
getAcctBalance
} from "@/api/finance.js";
import {
formatDate
} from "@/utils/index.js";
import {
RWA_STATUS,
getValue
} from "@/utils/enumUtils.js";
import QrcodePreview from "@/pages/rwa_package/component/qrcode-preview.vue";
export default {
components: {
Header,
QrcodePreview
},
computed: {
RWA_STATUS() {
return RWA_STATUS;
@@ -214,11 +197,11 @@ export default {
this.$refs.qrcodePreviewRef.open();
},
},
};
};
</script>
<style lang="scss">
.rwa_withdrawal_log {
.rwa_withdrawal_log {
background: #f5f5f5;
height: calc(100vh - 0rpx);
overflow: hidden;
@@ -252,15 +235,18 @@ export default {
._content_item_no_buto {
border-bottom: 1rpx solid #eeeeee;
}
.code_content {
display: flex;
justify-content: space-between;
align-items: center;
.code_content_item {
font-size: 20rpx;
color: #7934f6;
display: flex;
align-items: center;
.code_content_item_text {
width: 350rpx;
overflow: hidden;
@@ -271,6 +257,7 @@ export default {
}
}
}
._content_item_but {
display: flex;
justify-content: space-between;
@@ -317,5 +304,5 @@ export default {
}
}
}
}
}
</style>
+58 -25
View File
@@ -1,5 +1,4 @@
import { feedback } from '@/api/payment.js';
import { feedback } from "@/api/payment.js";
/**
* 微信支付
@@ -10,33 +9,62 @@ import { feedback } from '@/api/payment.js';
export function appWxpayFun(alipay, orderId, orderNum) {
const type = alipay.type;
const orderStr = alipay.orderStr;
console.log("微信支付---",alipay)
if (type === "app") {// app
console.log("微信支付---", alipay,type);
if (type === "app") {
// app
const orderInfo = {
"appid": alipay.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
"noncestr": alipay.nonceStr, // 随机字符串
"package": "Sign=WXPay", // 固定值
"partnerid": alipay.partnerId, // 微信支付商户号
"prepayid": alipay.prepayId, // 统一下单订单号
"timestamp": alipay.timeStamp, // 时间戳(单位:秒)
"sign": alipay.sign // 签名,这里用的 MD5/RSA 签名
appid: alipay.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
noncestr: alipay.nonceStr, // 随机字符串
package: "Sign=WXPay", // 固定值
partnerid: alipay.partnerId, // 微信支付商户号
prepayid: alipay.prepayId, // 统一下单订单号
timestamp: alipay.timeStamp, // 时间戳(单位:秒)
sign: alipay.sign, // 签名,这里用的 MD5/RSA 签名
};
uni.requestPayment({
provider: "wxpay",
orderInfo: orderInfo,
success: function (res) {
console.log('success:' + res);
console.log("success:" + res);
payFeedbackFun(orderId, orderNum, 1);
jumpWayOk();
},
fail: function (err) {
console.log('fail:', err);
console.log("fail:", err);
jumpWayError();
}
},
});
} else if (type === "h5") {// h5
} else if (type === "wechatMiniProgram") {
const orderInfo = {
// "appid": alipay.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
nonceStr: alipay.nonceStr, // 微信支付商户号
package: alipay.packageValue, // 统一下单订单号
timeStamp: alipay.timeStamp, // 时间戳(单位:秒)
signType: "RSA",
paySign: alipay.sign, // 签名,这里用的 MD5/RSA 签名
};
console.log("微信小程序支付---", orderInfo);
uni.requestPayment({
...orderInfo,
success: function (res) {
console.log("success:" + res);
payFeedbackFun(orderId, orderNum, 1);
jumpWayOk();
},
fail: function (err) {
console.log("fail:", err);
jumpWayError();
},
});
} else if (type === "h5") {
// h5
uni.navigateTo({
url: `/pages/other_package/payment_processing/payment_processing?link=${encodeURIComponent(orderStr)}&orderNum=` + orderNum // 假设有一个专门的支付页面来处理支付链接
url:
`/pages/other_package/payment_processing/payment_processing?link=${encodeURIComponent(
orderStr
)}&orderNum=` + orderNum, // 假设有一个专门的支付页面来处理支付链接
});
}
}
@@ -51,13 +79,18 @@ export function zfbPayFun(alipay, orderId, orderNum) {
console.log("alipay", alipay);
const type = alipay.type;
const orderStr = alipay.orderStr;
if (type === "h5") {// h5
if (type === "h5") {
// h5
uni.navigateTo({
url: `/pages/other_package/payment_processing/payment_processing?link=${encodeURIComponent(orderStr)}&orderNum=` + orderNum // 假设有一个专门的支付页面来处理支付链接
url:
`/pages/other_package/payment_processing/payment_processing?link=${encodeURIComponent(
orderStr
)}&orderNum=` + orderNum, // 假设有一个专门的支付页面来处理支付链接
});
} else if (type === "app") { // app
} else if (type === "app") {
// app
uni.requestPayment({
provider: 'alipay',
provider: "alipay",
orderInfo: orderStr,
success: function (res) {
console.log("zfbPayFun res", res);
@@ -67,26 +100,26 @@ export function zfbPayFun(alipay, orderId, orderNum) {
fail: function (err) {
console.error("支付宝支付error", err);
jumpWayError();
}
},
});
}
// return new Promise((resolve, reject) => {
// resolve(res);
// // reject(err);
// });
};
}
// 跳转到支付成功页面
export function jumpWayOk() {
uni.navigateTo({
url: "/pages/order_package/order_submit_ok/order_submit_ok",
})
});
}
// 跳转到支付失败页面
export function jumpWayError() {
uni.navigateTo({
url: "/pages/order_package/order_submit_error/order_submit_error",
})
});
}
/**
* 支付结果回调
@@ -99,7 +132,7 @@ async function payFeedbackFun(orderId, orderNum, status) {
orderId,
orderNum,
status,
}
};
console.log("params", params);
const response = await feedback(params);
console.log("payFeedbackFun response", response);