Lufaneng 9 months ago
parent a63acd6dbf
commit 7e2a9e7594

@ -186,6 +186,12 @@ const getMemberInfo = () => {
.finally(() => { .finally(() => {
uni.hideLoading(); uni.hideLoading();
}); });
};
const viewUserAgreement = () => {
uni.navigateTo({
url: "/pagesA/user-agreement/user-agreement",
});
}; };
// //

@ -12,6 +12,7 @@
<view class="order-list"> <view class="order-list">
<view class="order-item" v-for="order in list" :key="order.id"> <view class="order-item" v-for="order in list" :key="order.id">
<!-- 订单头部 --> <!-- 订单头部 -->
<div class="order-title">智能电梯图纸生成平台</div>
<view class="order-header"> <view class="order-header">
<view class="order-info"> <view class="order-info">
<text class="order-number">订单编号: {{ order.order_no }}</text> <text class="order-number">订单编号: {{ order.order_no }}</text>
@ -328,7 +329,7 @@
const alipayPay = async (orderInfo) => { const alipayPay = async (orderInfo) => {
// #ifdef H5 // #ifdef H5
// H5 // H5
const payUrl = orderInfo.payUrl; // H5 const payUrl = orderInfo.pay_url; // H5
window.location.href = payUrl; window.location.href = payUrl;
return { return {
success: true, success: true,
@ -361,7 +362,14 @@
// //
let paymentResult; let paymentResult;
if (order.pay_channel === "wxpay") { if (order.pay_channel === "wxpay") {
// #ifdef H5
uni.showToast({
icon:"none",
title:'请在小程序端使用微信支付'
})
return
// #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
const res = await uni.login({ const res = await uni.login({
provider: 'weixin' provider: 'weixin'
@ -383,7 +391,14 @@
}); });
console.log('orderResult', orderResult) console.log('orderResult', orderResult)
paymentResult = await wechatPay(orderResult); paymentResult = await wechatPay(orderResult);
} else if (order.pay_channel === "alipay") { } else if (order.pay_channel === "alipay") {
// #ifdef MP-WEIXIN
uni.showToast({
icon:"none",
title:'请在h5端使用支付宝支付'
})
return
// #endif
const orderResult = await RPC.post('/membership/order/pay_by_alipay', { const orderResult = await RPC.post('/membership/order/pay_by_alipay', {
order_no: order.order_no order_no: order.order_no
}) })
@ -546,7 +561,11 @@
background: white; background: white;
border-radius: 12px; border-radius: 12px;
margin-bottom: 16px; margin-bottom: 16px;
overflow: hidden; overflow: hidden;
.order-title {
padding: 16px 16px 0;
}
.order-header { .order-header {
display: flex; display: flex;

@ -129,7 +129,7 @@
// //
onLoad((options) => { onLoad((options) => {
orderNo.value = options.order_no || ''; orderNo.value = options.out_trade_no || '';
if (orderNo.value) { if (orderNo.value) {
startQueryPaymentStatus(); startQueryPaymentStatus();
} else { } else {

@ -44,6 +44,7 @@
<!-- 微信支付 --> <!-- 微信支付 -->
<view <view
v-if="isWechat"
class="payment-item" class="payment-item"
:class="{ active: selectedPayment === 'wxpay' }" :class="{ active: selectedPayment === 'wxpay' }"
@click="selectPayment('wxpay')" @click="selectPayment('wxpay')"
@ -124,6 +125,7 @@ const planPrice = ref(0);
const selectedPayment = ref("wxpay"); // const selectedPayment = ref("wxpay"); //
const paying = ref(false); const paying = ref(false);
const showAlipay = ref(true); // const showAlipay = ref(true); //
const isWechat = ref(true); //
const walletBalance = ref(0); const walletBalance = ref(0);
// //
@ -159,11 +161,14 @@ const checkEnvironment = () => {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// //
showAlipay.value = false; showAlipay.value = false;
isWechat.value = true
// #endif // #endif
// #ifdef H5 // #ifdef H5
// H5 // H5
showAlipay.value = true; showAlipay.value = true;
isWechat.value = false
selectedPayment.value="alipay"
// #endif // #endif
}; };

@ -41,7 +41,7 @@
<view class="section-title">选择支付方式</view> <view class="section-title">选择支付方式</view>
<view class="payment-list"> <view class="payment-list">
<!-- 微信支付 --> <!-- 微信支付 -->
<view class="payment-item" :class="{ active: selectedPayment === 'wxpay' }" <view v-if="isWechat" class="payment-item" :class="{ active: selectedPayment === 'wxpay' }"
@click="selectPayment('wxpay')"> @click="selectPayment('wxpay')">
<view class="payment-info"> <view class="payment-info">
<uv-icon name="weixin-fill" color="#07c160" size="28"></uv-icon> <uv-icon name="weixin-fill" color="#07c160" size="28"></uv-icon>
@ -139,7 +139,8 @@
const customAmount = ref(''); const customAmount = ref('');
const selectedPayment = ref('wxpay'); const selectedPayment = ref('wxpay');
const recharging = ref(false); const recharging = ref(false);
const showAlipay = ref(true); const showAlipay = ref(true);
const isWechat = ref(false)
// //
const rechargeAmounts = ref([{ const rechargeAmounts = ref([{
@ -216,16 +217,14 @@
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// //
showAlipay.value = false; showAlipay.value = false;
isWechat.value = true;
selectedPayment.value = 'wxpay'; selectedPayment.value = 'wxpay';
// #endif // #endif
// #ifdef H5 // #ifdef H5
// H5 // H5
showAlipay.value = true; showAlipay.value = true;
// selectedPayment.value = 'alipay';
const ua = navigator.userAgent.toLowerCase();
const isWechat = ua.indexOf('micromessenger') !== -1;
selectedPayment.value = isWechat ? 'wxpay' : 'alipay';
// #endif // #endif
}; };
@ -297,7 +296,7 @@
const alipayPay = async (orderInfo) => { const alipayPay = async (orderInfo) => {
// #ifdef H5 // #ifdef H5
// H5 // H5
const payUrl = orderInfo.payUrl; const payUrl = orderInfo.pay_url;
window.location.href = payUrl; window.location.href = payUrl;
return { return {
success: true, success: true,
@ -399,11 +398,14 @@
}); });
console.log('orderResult', orderResult) console.log('orderResult', orderResult)
paymentResult = await wechatPay(orderResult); paymentResult = await wechatPay(orderResult);
} else if (selectedPayment.value === 'alipay') { } else if (selectedPayment.value === 'alipay') {
const orderResult = await RPC.post('/membership/order/pay_by_alipay', {
order_no: orderNum.order_no
})
uni.showLoading({ uni.showLoading({
title: '正在跳转支付宝...' title: '正在跳转支付宝...'
}); });
paymentResult = await alipayPay(orderResult.alipayInfo); paymentResult = await alipayPay(orderResult);
} }
uni.hideLoading(); uni.hideLoading();

@ -124,7 +124,8 @@ $uv.http.interceptors.request.use(
} }
const method = config.url const method = config.url
config.url = 'https://lift-drawing.ruixininfo.com/jsonrpc' config.url = 'https://lift-h5.shulinelev.com/jsonrpc'
// config.url = 'https://lift-drawing.ruixininfo.com/jsonrpc'
// #ifdef H5 // #ifdef H5
config.url = '/jsonrpc' config.url = '/jsonrpc'
// #endif // #endif

Loading…
Cancel
Save