diff --git a/.env b/.env
index 9340570f..8711f6ac 100644
--- a/.env
+++ b/.env
@@ -5,8 +5,8 @@ SHOPRO_VERSION=v2.4.1
SHOPRO_API_PATH=/app-api
# 后端接口 - 测试环境(通过 process.env.NODE_ENV == development)
-SHOPRO_DEV_BASE_URL = https://api.htysapp.com
-# SHOPRO_DEV_BASE_URL=https://hrf48v5ife.fy.takin.cc
+# SHOPRO_DEV_BASE_URL = https://api.htysapp.com
+SHOPRO_DEV_BASE_URL=https://baac9a029ea84f36ba28c023fed4fc5f.hd.takin.cc
# 后端接口 - 正式环境(通过 process.env.NODE_ENV != development)
SHOPRO_BASE_URL=https://api.htysapp.com
diff --git a/@html/alipay-jump.html b/@html/alipay-jump.html
new file mode 100644
index 00000000..51ae471f
--- /dev/null
+++ b/@html/alipay-jump.html
@@ -0,0 +1,326 @@
+
+
+
+
+ 荷塘月色 - app下载
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
荷塘月色
+
同城交友平台
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/@html/归档.zip b/@html/归档_2026_05_21_16_30_51.7z
similarity index 92%
rename from @html/归档.zip
rename to @html/归档_2026_05_21_16_30_51.7z
index 6afabe49..217ae304 100644
Binary files a/@html/归档.zip and b/@html/归档_2026_05_21_16_30_51.7z differ
diff --git a/src/pages.json b/src/pages.json
index 9b129e89..eb5eb211 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -90,6 +90,13 @@
{
"root": "pages/profile",
"pages": [
+ {
+ "path": "alipay-webview",
+ "style": {
+ "navigationBarTitleText": "支付宝支付",
+ "navigationStyle": "custom"
+ }
+ },
{
"path": "pay-result",
"style": {
diff --git a/src/pages/pay/recharge-log.vue b/src/pages/pay/recharge-log.vue
index 8de792ac..14de6a11 100644
--- a/src/pages/pay/recharge-log.vue
+++ b/src/pages/pay/recharge-log.vue
@@ -13,10 +13,7 @@
支付状态
-
+
{{ item.refundStatus === 10 ? '已退款' : '已支付' }}
@@ -31,137 +28,130 @@
充值时间
- {{ sheep.$helper.timeFormat(item.payTime, 'yyyy-mm-dd hh:MM:ss') }}
+ {{ sheep.$helper.timeFormat(item.payTime, 'yyyy-mm-dd hh:MM:ss') }}
-
-
+
+
diff --git a/src/pages/pay/recharge.vue b/src/pages/pay/recharge.vue
index 4ac646ce..1e40fe68 100644
--- a/src/pages/pay/recharge.vue
+++ b/src/pages/pay/recharge.vue
@@ -1,15 +1,12 @@
-
+
当前余额(元)
{{ fen2yuan(userWallet.balance) }}
@@ -23,31 +20,18 @@
充值金额
¥
-
+
-
-
+
确认充值
@@ -56,222 +40,222 @@
diff --git a/src/pages/profile/alipay-webview.vue b/src/pages/profile/alipay-webview.vue
new file mode 100644
index 00000000..0c4c0a77
--- /dev/null
+++ b/src/pages/profile/alipay-webview.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/profile/apply-vip.vue b/src/pages/profile/apply-vip.vue
index e101c57f..2c4c7fb4 100644
--- a/src/pages/profile/apply-vip.vue
+++ b/src/pages/profile/apply-vip.vue
@@ -3,9 +3,7 @@
-
-
-
+
@@ -80,6 +78,19 @@
微信支付
+
+
+ 支付宝支付步骤
+
+ 1.
+ 点击下方“立即开通VIP”
+
+
+ 2.
+ 在弹窗中点击“复制链接”,粘贴到手机浏览器打开完成支付
+
+
+
@@ -128,7 +139,7 @@ import $store from '@/sheep/store';
import PayOrderApi from '@/sheep/api/pay/order';
// @ts-ignore
import sheep from '@/sheep';
-import { jumpToWechatMiniProgram } from '@/sheep/util/wechat-tool';
+import { jumpToWechatMiniProgram, wechatNavBack } from '@/sheep/util/wechat-tool';
const messageBox = useMessage();
const vipProtocolMessageBox = useMessage('vip-protocol-message-box');
@@ -168,13 +179,18 @@ const payMethodMap = [
const nodes = ref(''); // 会员协议文本
const payMethod = ref<'alipay' | 'wechat'>('alipay'); // 支付方式:alipay / wechat
const openTypeList = ref([]); // 会员类型列表
-const curOpenTypeId = ref(); // 当前选择的会员类型id
+const curOpenTypeId = ref();
+// 当前选择的会员类型
const currentOpenType = computed(() =>
openTypeList.value?.find((item) => item.id == curOpenTypeId.value),
-); // 当前选择的会员类型
+);
+const isLogin = computed(() => sheep.$store('user').isLogin);
onLoad(async (params) => {
console.log('onLoad:', params);
+ if (!isLogin.value) {
+ return
+ }
const { data = null } = await RecentApi.getMemberOpenTypeList();
openTypeList.value = data ?? [];
if (openTypeList.value && openTypeList.value[0]) {
@@ -190,7 +206,11 @@ onLoad(async (params) => {
});
onShow(async () => {
- getChatConfig();
+ if (!isLogin.value) {
+ authDialog()
+ } else {
+ getChatConfig();
+ }
});
// 查看会员协议
@@ -203,6 +223,23 @@ async function alert(type: string | number, title: string) {
});
}
+const authDialog = () => {
+ messageBox
+ .confirm({
+ msg: '',
+ title: '开通会员需要登录,请先登录',
+ confirmButtonText: '请先登录',
+ cancelButtonText: '取消',
+ })
+ .then(() => {
+ sheep.$store('user').logout();
+ uni.reLaunch({ url: '/pages/login/login' });
+ })
+ .catch(() => {
+
+ });
+}
+
// 查询小程序配置
const getChatConfig = async () => {
try {
@@ -234,10 +271,6 @@ const handleOpenVip = () => {
uni.showToast({ title: '请选择支付方式', icon: 'none' });
return;
}
- if (!payMethodItem.payment) {
- uni.showToast({ title: `不支持${payMethodItem.title}支付`, icon: 'none' });
- return;
- }
messageBox
.confirm({
title: '确认开通?',
@@ -245,7 +278,11 @@ const handleOpenVip = () => {
})
.then(async () => {
// #ifdef MP-WEIXIN
- disposeWechatPay(curOpenTypeId.value);
+ if (payMethod.value === 'wechat') {
+ disposeWechatPay(curOpenTypeId.value);
+ } else {
+ disposeAlipayPay(curOpenTypeId.value);
+ }
// #endif
// #ifndef MP-WEIXIN
jumpToWechatPage();
@@ -254,6 +291,27 @@ const handleOpenVip = () => {
.catch(() => { });
};
+// 处理支付宝支付
+const disposeAlipayPay = async (openTypeId: any) => {
+ uni.showLoading({ title: '支付中...', mask: true });
+ try {
+ const { code, data } = await RecentApi.memberOpenTypePay({
+ openTypeId: openTypeId,
+ });
+ console.log('开通vipId:', data);
+ if (code !== 0) {
+ uni.showToast({ title: '创建订单失败', icon: 'none' });
+ throw new Error('创建订单失败');
+ }
+ await sheep.$platform.pay(payMethod.value, 'recharge', data);
+ // 更新用户信息
+ $store('user').getInfo();
+ uni.showToast({ title: '创建订单成功', icon: 'success' });
+ } catch (error) {
+ console.error('|处理支付宝支付|,意外的错误error:', error);
+ }
+}
+
// 处理微信支付
const disposeWechatPay = async (openTypeId: any) => {
uni.showLoading({ title: '支付中...', mask: true });
diff --git a/src/pages/profile/recharge.vue b/src/pages/profile/recharge.vue
index d6b84fa9..76ba52e9 100644
--- a/src/pages/profile/recharge.vue
+++ b/src/pages/profile/recharge.vue
@@ -3,9 +3,7 @@
-
-
-
+
支付宝
-
@@ -64,6 +61,20 @@
微信支付
+
+
+ 支付宝支付步骤
+
+ 1.
+ 点击下方“钻石充值数额”
+
+
+ 2.
+ 在弹窗中点击“复制链接”,粘贴到手机浏览器打开完成支付
+
+
+
@@ -96,7 +107,7 @@ import { onLoad, onShow } from '@dcloudio/uni-app';
import sheep from '@/sheep';
// @ts-ignore
import PayOrderApi from '@/sheep/api/pay/order';
-import { jumpToWechatMiniProgram } from '@/sheep/util/wechat-tool';
+import { jumpToWechatMiniProgram, wechatNavBack } from '@/sheep/util/wechat-tool';
const messageBox = useMessage();
@@ -118,10 +129,15 @@ const payMethod = ref<'alipay' | 'wechat'>('alipay'); // 支付方式:alipay /
const rechargePackag = ref<{ id: number; name: string; payPrice: number; bonusPrice: number }[]>(
[],
);
+
const userWallet = computed(() => sheep.$store('user').userWallet);
+const isLogin = computed(() => sheep.$store('user').isLogin);
onLoad(async (params) => {
console.log('onLoad:', params);
+ if (!isLogin.value) {
+ return
+ }
const { data } = await RecentApi.getWalletRechargePackage();
rechargePackag.value = data ?? [];
if (params) {
@@ -138,14 +154,35 @@ onLoad(async (params) => {
});
onShow(async () => {
- // 查询钱包余额
- getWallet();
+ if (!isLogin.value) {
+ authDialog()
+ } else {
+ // 查询钱包余额
+ getWallet();
+ }
});
const getWallet = () => {
sheep.$store('user').getWallet();
};
+const authDialog = () => {
+ messageBox
+ .confirm({
+ msg: '',
+ title: '充值钻石需要登录,请先登录',
+ confirmButtonText: '请先登录',
+ cancelButtonText: '取消',
+ })
+ .then(() => {
+ sheep.$store('user').logout();
+ uni.reLaunch({ url: '/pages/login/login' });
+ })
+ .catch(() => {
+
+ });
+}
+
const handleRecharge = (item: any) => {
if (!item.id) {
uni.showToast({ title: '请选择会员类型', icon: 'none' });
@@ -156,10 +193,6 @@ const handleRecharge = (item: any) => {
uni.showToast({ title: '请选择支付方式', icon: 'none' });
return;
}
- if (!payMethodItem.payment) {
- uni.showToast({ title: `不支持${payMethodItem.title}支付`, icon: 'none' });
- return;
- }
messageBox
.confirm({
title: '提示',
@@ -167,7 +200,11 @@ const handleRecharge = (item: any) => {
})
.then(async () => {
// #ifdef MP-WEIXIN
- disposeWechatPay(item.id);
+ if (payMethod.value === 'wechat') {
+ disposeWechatPay(item.id);
+ } else {
+ disposeAlipayPay(item.id);
+ }
// #endif
// #ifndef MP-WEIXIN
jumpToWechatPage(item.id);
@@ -176,6 +213,27 @@ const handleRecharge = (item: any) => {
.catch(() => { });
};
+// 处理支付宝支付
+const disposeAlipayPay = async (packageId: any) => {
+ uni.showLoading({ title: '支付中...', mask: true });
+ try {
+ const { code, data } = await RecentApi.walletRecharge({ packageId: packageId });
+ console.log('发起订单id,data:', data);
+ if (code !== 0) {
+ uni.showToast({ title: '创建订单失败', icon: 'none' });
+ throw new Error();
+ }
+ await sheep.$platform.pay(payMethod.value, 'recharge', data.payOrderId);
+ // 更新用户钱包
+ getWallet();
+ uni.showToast({ title: '创建订单成功', icon: 'success' });
+ } catch (error) {
+ console.error('|处理支付宝支付|,意外的错误error:', error);
+ } finally {
+ uni.hideLoading();
+ }
+}
+
// 处理微信支付
const disposeWechatPay = async (packageId: any) => {
uni.showLoading({ title: '支付中...', mask: true });
diff --git a/src/pages/wechat-tabbar/index.vue b/src/pages/wechat-tabbar/index.vue
index f51070a0..dffc1455 100644
--- a/src/pages/wechat-tabbar/index.vue
+++ b/src/pages/wechat-tabbar/index.vue
@@ -3,9 +3,11 @@
+
+
diff --git a/src/pages/wechat/pages/gift/index.vue b/src/pages/wechat/pages/gift/index.vue
index 4345589d..9de84ca1 100644
--- a/src/pages/wechat/pages/gift/index.vue
+++ b/src/pages/wechat/pages/gift/index.vue
@@ -3,9 +3,7 @@
-
-
-
+
-
-
-
+
@@ -49,6 +47,7 @@ import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
import useScroll from '@/sheep/hooks/use-scroll';
import { onPageScroll } from '@dcloudio/uni-app';
import BrokerageApi from '@/sheep/api/trade/brokerage';
+import { wechatNavBack } from '@/sheep/util/wechat-tool';
const userInfo = computed(() => sheep.$store('user').userInfo);
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
diff --git a/src/sheep/platform/pay.js b/src/sheep/platform/pay.js
index bd05ee16..8899269e 100644
--- a/src/sheep/platform/pay.js
+++ b/src/sheep/platform/pay.js
@@ -222,6 +222,7 @@ export default class SheepPay {
success: (res) => {
if (res.confirm) {
sheep.$helper.copyText(data.displayContent);
+ // uni.navigateTo({ url: '/pages/profile/alipay-webview?url=' + encodeURIComponent(data.displayContent) })
}
},
});
diff --git a/src/sheep/util/wechat-tool.ts b/src/sheep/util/wechat-tool.ts
index 8b8d7503..3af8bd41 100644
--- a/src/sheep/util/wechat-tool.ts
+++ b/src/sheep/util/wechat-tool.ts
@@ -4,6 +4,23 @@ import SocialApi from '@/sheep/api/member/social';
const targetAppId = 'wx2b4e4d3feff8267f';
+export const wechatNavBack = () => {
+ // 非小程序直接返回
+ // #ifndef MP-WEIXIN
+ uni.navigateBack()
+ // #endif
+ // 在小程序里要判断一下
+ // #ifdef MP-WEIXIN
+ // 判断能否返回
+ let pages = getCurrentPages();
+ if (pages.length == 1) {
+ uni.switchTab({ url: `/pages/wechat-tabbar/index` })
+ } else {
+ uni.navigateBack()
+ }
+ // #endif
+}
+
const paramsToQuery = (params) => {
if (isEmpty(params)) {
return '';