-
全部
+
全部
图纸生成
会员购买
钱包充值
@@ -124,7 +124,7 @@
import HeaderCustom from '/components/HeaderCustom/HeaderCustom.vue'
import RPC from "@/utils/request";
import dayjs from "dayjs";
-
+
const isWeChatH5 = ref(false)
// #ifdef H5
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
@@ -315,40 +315,12 @@
// #ifdef H5
// H5微信支付
- if (typeof WeixinJSBridge !== "undefined") {
- return new Promise((resolve, reject) => {
- WeixinJSBridge.invoke(
- "getBrandWCPayRequest", {
- appId: 'wxc504638e03981812',
- timeStamp: orderInfo.timeStamp,
- nonceStr: orderInfo.nonceStr,
- package: orderInfo.package,
- signType: orderInfo.signType,
- paySign: orderInfo.paySign,
- },
- (res) => {
- if (res.err_msg === "get_brand_wcpay_request:ok") {
- resolve({
- success: true,
- data: res
- });
- } else if (res.err_msg === "get_brand_wcpay_request:cancel") {
- reject(new Error("用户取消支付"));
- } else {
- reject(new Error("微信支付失败"));
- }
- }
- );
- });
- } else {
- // 不在微信环境,跳转到支付页面
- const payUrl = orderInfo.mwebUrl; // 后端返回的H5支付链接
- window.location.href = payUrl;
- return {
- success: true,
- redirect: true
- };
- }
+ const payUrl = orderInfo.mwebUrl; // 后端返回的H5支付链接
+ window.location.href = payUrl;
+ return {
+ success: true,
+ redirect: true
+ };
// #endif
};
@@ -390,13 +362,22 @@
let paymentResult;
if (order.pay_channel === "wxpay") {
+ // #ifdef MP-WEIXIN
const res = await uni.login({
provider: 'weixin'
})
- const orderResult = await RPC.post('/membership/order/pay_by_wechat_mini', {
+ orderResult = await RPC.post('/membership/order/pay_by_wechat_mini', {
code: res.code,
- "order_no": order.order_no
+ "order_no": orderNum.order_no
+ })
+ // #endif
+
+ // #ifdef H5
+ orderResult = await RPC.post('/membership/order/pay_by_wechat_h5', {
+ "order_no": orderNum.order_no
})
+ // #endif
+
uni.showLoading({
title: "正在跳转微信支付...",
});
@@ -411,6 +392,7 @@
});
paymentResult = await alipayPay(orderResult);
} else if (order.pay_channel === 'wallet') {
+ uni.hideLoading()
const res = await showModalAsync({
title: '确认支付',
content: '确认使用钱包余额支付?'
diff --git a/pagesA/edit-profile/edit-profile.vue b/pagesA/edit-profile/edit-profile.vue
index 02c426e..de2e84f 100644
--- a/pagesA/edit-profile/edit-profile.vue
+++ b/pagesA/edit-profile/edit-profile.vue
@@ -37,7 +37,7 @@
手机号
- {{ userStore.userInfo.phone }}
+ {{ userStore.userInfo.phone }}
@@ -45,17 +45,8 @@
-
-
-
+
用户协议
@@ -63,21 +54,20 @@
-
关于我们
-
+ -->
-
+
@@ -463,14 +453,14 @@
const bindPhoneInfo = ref({
phone: "",
code: "",
- });
-
- const changePhone = () => {
+ });
+
+ const changePhone = () => {
bindPhoneInfo.value = {
phone: "",
code: "",
- }
- popup.value.open()
+ }
+ popup.value.open()
}
const bindPhoneRules = ref({
phone: [{
@@ -489,98 +479,98 @@
message: "请输入验证码",
trigger: ["blur", "change"],
},
- });
-
- const bindCodeChange = (text) => {
- bindCodeTips.value = text;
- };
-
- const closeBindPhoneModal = () => {
- popup.value.close();
- bindPhoneInfo.value = {
- phone: "",
- code: "",
- };
- bindCodeTips.value = "获取验证码";
- };
-
- const confirmBindPhone = async () => {
- try {
- await bindPhoneForm.value.validate();
-
- bindingPhone.value = true;
-
- // 调用绑定手机号API
- RPC.post('/user/bind_phone', {
- phone: bindPhoneInfo.value.phone,
- code: bindPhoneInfo.value.code,
- token: authStore.accessToken
- }).then((res) => {
- console.log('bind_phone', res)
- bindingPhone.value = false;
- uni.showToast({
- title: "换绑成功",
- icon: "success",
- });
- popup.value.close()
- RPC.post('/user/info', {
- token: authStore.accessToken,
- })
- .then((res) => {
- userStore.setUserInfo(res)
- })
- })
- } catch (error) {
- console.error("换绑手机号失败:", error);
- bindingPhone.value = false;
- }
- };
-
- const getBindCode = () => {
- if (!bindPhoneInfo.value.phone) {
- uni.showToast({
- title: "请输入手机号",
- icon: "none",
- });
- return;
- }
-
- if (!/^1[3-9]\d{9}$/.test(bindPhoneInfo.value.phone)) {
- uni.showToast({
- title: "请输入正确的手机号",
- icon: "none",
- });
- return;
- }
-
- if (bindCodeRef.value.canGetCode) {
- uni.showLoading({
- title: "正在获取验证码",
- });
- // 调用发送验证码API
- RPC.post('/user/bind_phone/send_code', {
- phone: bindPhoneInfo.value.phone,
- token: authStore.accessToken
- }).then(() => {
- uni.hideLoading()
- uni.showToast({
- title: '验证码已发送',
- icon: 'success'
- })
- bindCodeRef.value.start()
- }).catch(() => {
- uni.hideLoading()
- uni.showToast({
- title: '发送失败,请重试',
- icon: 'none'
- })
- })
- } else {
- uni.showToast({
- title: "倒计时结束后再发送",
- icon: "none",
- });
- }
+ });
+
+ const bindCodeChange = (text) => {
+ bindCodeTips.value = text;
+ };
+
+ const closeBindPhoneModal = () => {
+ popup.value.close();
+ bindPhoneInfo.value = {
+ phone: "",
+ code: "",
+ };
+ bindCodeTips.value = "获取验证码";
+ };
+
+ const confirmBindPhone = async () => {
+ try {
+ await bindPhoneForm.value.validate();
+
+ bindingPhone.value = true;
+
+ // 调用绑定手机号API
+ RPC.post('/user/bind_phone', {
+ phone: bindPhoneInfo.value.phone,
+ code: bindPhoneInfo.value.code,
+ token: authStore.accessToken
+ }).then((res) => {
+ console.log('bind_phone', res)
+ bindingPhone.value = false;
+ uni.showToast({
+ title: "换绑成功",
+ icon: "success",
+ });
+ popup.value.close()
+ RPC.post('/user/info', {
+ token: authStore.accessToken,
+ })
+ .then((res) => {
+ userStore.setUserInfo(res)
+ })
+ })
+ } catch (error) {
+ console.error("换绑手机号失败:", error);
+ bindingPhone.value = false;
+ }
+ };
+
+ const getBindCode = () => {
+ if (!bindPhoneInfo.value.phone) {
+ uni.showToast({
+ title: "请输入手机号",
+ icon: "none",
+ });
+ return;
+ }
+
+ if (!/^1[3-9]\d{9}$/.test(bindPhoneInfo.value.phone)) {
+ uni.showToast({
+ title: "请输入正确的手机号",
+ icon: "none",
+ });
+ return;
+ }
+
+ if (bindCodeRef.value.canGetCode) {
+ uni.showLoading({
+ title: "正在获取验证码",
+ });
+ // 调用发送验证码API
+ RPC.post('/user/bind_phone/send_code', {
+ phone: bindPhoneInfo.value.phone,
+ token: authStore.accessToken
+ }).then(() => {
+ uni.hideLoading()
+ uni.showToast({
+ title: '验证码已发送',
+ icon: 'success'
+ })
+ bindCodeRef.value.start()
+ }).catch(() => {
+ uni.hideLoading()
+ uni.showToast({
+ title: '发送失败,请重试',
+ icon: 'none'
+ })
+ })
+ } else {
+ uni.showToast({
+ title: "倒计时结束后再发送",
+ icon: "none",
+ });
+ }
};
@@ -707,43 +697,43 @@
.sheet-cancel {
margin-top: 10px;
}
- }
- .bind-phone-modal {
- width: 320px;
- padding: 24px;
-
- .modal-header {
- text-align: center;
- margin-bottom: 24px;
-
- .modal-title {
- font-size: 18px;
- font-weight: bold;
- color: #333;
- margin-bottom: 8px;
- }
-
- .modal-subtitle {
- font-size: 14px;
- color: #666;
- }
- }
-
- .modal-form {
- margin-bottom: 24px;
-
- .uv-form-item {
- margin-bottom: 16px;
- }
- }
-
- .modal-actions {
- display: flex;
- gap: 12px;
-
- .uv-button {
- flex: 1;
- }
- }
+ }
+ .bind-phone-modal {
+ width: 320px;
+ padding: 24px;
+
+ .modal-header {
+ text-align: center;
+ margin-bottom: 24px;
+
+ .modal-title {
+ font-size: 18px;
+ font-weight: bold;
+ color: #333;
+ margin-bottom: 8px;
+ }
+
+ .modal-subtitle {
+ font-size: 14px;
+ color: #666;
+ }
+ }
+
+ .modal-form {
+ margin-bottom: 24px;
+
+ .uv-form-item {
+ margin-bottom: 16px;
+ }
+ }
+
+ .modal-actions {
+ display: flex;
+ gap: 12px;
+
+ .uv-button {
+ flex: 1;
+ }
+ }
}
\ No newline at end of file
diff --git a/pagesA/payment/payment.vue b/pagesA/payment/payment.vue
new file mode 100644
index 0000000..5af5892
--- /dev/null
+++ b/pagesA/payment/payment.vue
@@ -0,0 +1,510 @@
+
+
+
+
+
+
+
+ 订单详情
+
+ {{ planName }}
+ ¥{{ planPrice }}
+
+
+
+
+
+
+ 选择支付方式
+
+
+
+
+
+
+ 钱包支付
+ 余额:¥{{ walletBalance }}
+
+
+
+
+
+
+
+
+
+
+ 微信支付
+ 推荐使用微信支付
+
+
+
+
+
+
+
+
+
+
+ 支付宝
+ 安全便捷的支付方式
+
+
+
+
+
+
+
+
+
+ 立即支付 ¥{{ planPrice }}
+
+
+ 支付即表示同意
+ 《会员服务协议》
+
+
+
+
+
+
+
+
\ No newline at end of file