Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
lls_program
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-09-13 16:30:29 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1b9f19bffc49a401c4aac117412496a5133f82e6
1b9f19bf
1 parent
9af910e2
feat(RewardDetail): 添加分享来源处理逻辑
处理来自分享页面的跳转逻辑,根据来源参数决定跳转目标 移除未使用的用户信息接口导入
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
src/pages/RewardDetail/index.vue
src/pages/Rewards/index.vue
src/pages/RewardDetail/index.vue
View file @
1b9f19b
...
...
@@ -75,7 +75,6 @@
<script setup>
import { ref } from 'vue';
import Taro, { useDidShow, useLoad } from '@tarojs/taro';
import { getUserProfileAPI } from '@/api/user';
import { handleSharePageAuth, addShareFlag } from '@/utils/authRedirect';
// 导入接口
import { getCouponDetailAPI, redeemCouponAPI } from '@/api/coupon';
...
...
@@ -83,6 +82,7 @@ import { getCouponDetailAPI, redeemCouponAPI } from '@/api/coupon';
import { THEME_COLORS } from '@/utils/config';
const couponId = ref('');
const fromShare = ref(0);
// 优惠券详情数据
const reward = ref({
...
...
@@ -166,9 +166,17 @@ const handleRedeem = async () => {
// 延迟跳转到我的优惠券页面
setTimeout(() => {
Taro.navigateBack({
delta: 1
});
// 分享成功后,跳转到个人中心
if (fromShare.value) {
Taro.navigateTo({
url: '/pages/Profile/index'
});
} else {
// 非分享场景,返回上一页
Taro.navigateBack({
delta: 1
});
}
}, 2000);
} else {
throw new Error(redeemResponse?.message || '兑换失败');
...
...
@@ -190,6 +198,11 @@ const initData = async (options = {}) => {
couponId.value = options.id;
}
// 获取分享参数
if (options.from_share) {
fromShare.value = options.from_share;
}
// 获取优惠券详情
if (couponId.value) {
await fetchCouponDetail();
...
...
@@ -206,8 +219,8 @@ useLoad((options) => {
});
});
useDidShow(() => {
});
//
useDidShow(() => {
//
});
/**
...
...
src/pages/Rewards/index.vue
View file @
1b9f19b
<!--
* @Date: 2025-08-27 17:47:26
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-13 1
5:59:26
* @LastEditTime: 2025-09-13 1
6:22:18
* @FilePath: /lls_program/src/pages/Rewards/index.vue
* @Description: 文件描述
-->
...
...
Please
register
or
login
to post a comment