Merge remote-tracking branch 'origin/cyh666666/consumer'
This commit is contained in:
@@ -91,7 +91,12 @@ const selPay = (v: number) => { payMethod.value = v }
|
||||
|
||||
// 获取当前用户ID(按现有store实现替换)
|
||||
const getCurrentUserId = (): string => {
|
||||
try { return (supa.getSession().user?.id as string) || '' } catch { return '' }
|
||||
try {
|
||||
const session = supaClient.getSession()
|
||||
return (session != null && session.user != null) ? (session.user.getString('id') ?? '') : ''
|
||||
} catch (e) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
const confirmSubscribe = async () => {
|
||||
@@ -132,10 +137,10 @@ const confirmSubscribe = async () => {
|
||||
if (ins != null && ins.error == null) {
|
||||
uni.showToast({ title: '订阅成功', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({ url: '/pages/mall/consumer/profile' })
|
||||
uni.redirectTo({ url: '/pages/main/profile' })
|
||||
}, 600)
|
||||
} else {
|
||||
uni.showToast({ title: ins?.error?.message || '订阅失败', icon: 'none' })
|
||||
uni.showToast({ title: ins?.error?.message ?? '订阅失败', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('订阅失败:', e)
|
||||
@@ -149,15 +154,17 @@ const confirmSubscribe = async () => {
|
||||
<style scoped>
|
||||
.subscribe-checkout { padding: 12px; }
|
||||
.header { margin-bottom: 8px; }
|
||||
.title { font-size: 18px; font-weight: 600; }
|
||||
.title { font-size: 18px; font-weight: 700; }
|
||||
.card { background: #fff; border-radius: 10px; padding: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
|
||||
.row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
|
||||
.row:last-child { border-bottom: none; }
|
||||
.label { color: #666; }
|
||||
.value { color: #111; font-weight: 600; }
|
||||
.section-title { margin-top: 12px; font-weight: 600; }
|
||||
.pay-methods { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
|
||||
.pay-item { display: flex; align-items: center; gap: 8px; }
|
||||
.value { color: #111; font-weight: 700; }
|
||||
.section-title { margin-top: 12px; font-weight: 700; }
|
||||
.pay-methods { display: flex; flex-direction: column; padding: 8px 0; }
|
||||
.pay-item { display: flex; align-items: center; margin-bottom: 8px; }
|
||||
.pay-item:last-child { margin-bottom: 0; }
|
||||
.pay-icon { margin-right: 8px; }
|
||||
.actions { display: flex; justify-content: flex-end; margin-top: 12px; }
|
||||
.primary { background: #3cc51f; color: #fff; border-radius: 6px; padding: 8px 12px; }
|
||||
.loading, .empty { padding: 24px; text-align: center; color: #888; }
|
||||
|
||||
Reference in New Issue
Block a user