release: freeze V1.2 demo acceptance 2026-10-25
CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Waiting to run
CI/CD Pipeline / Backend Build & Test (push) Waiting to run
CI/CD Pipeline / Admin Web Build (push) Waiting to run
CI/CD Pipeline / Mini Program Compile Check (push) Waiting to run
CI/CD Pipeline / Migration Validation (push) Blocked by required conditions
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Waiting to run
CI/CD Pipeline / E2E (live stack) (push) Blocked by required conditions
CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Waiting to run
CI/CD Pipeline / Backend Build & Test (push) Waiting to run
CI/CD Pipeline / Admin Web Build (push) Waiting to run
CI/CD Pipeline / Mini Program Compile Check (push) Waiting to run
CI/CD Pipeline / Migration Validation (push) Blocked by required conditions
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Waiting to run
CI/CD Pipeline / E2E (live stack) (push) Blocked by required conditions
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
const { serviceConsentService } = require('../../services');
|
||||
|
||||
Page({
|
||||
data: { documents: [], saving: false, error: '', canAgree: false, hasAgreed: false },
|
||||
onShow() { this.load(); },
|
||||
async load() {
|
||||
try {
|
||||
const documents = await serviceConsentService.getState();
|
||||
this.setData({ documents, canAgree: documents.length === 2, hasAgreed: documents.some(item => item.agreed), error: '' });
|
||||
} catch (err) { this.setData({ error: err.message || '授权状态加载失败' }); }
|
||||
},
|
||||
async onAgree() {
|
||||
if (!this.data.canAgree || this.data.saving) return;
|
||||
this.setData({ saving: true, error: '' });
|
||||
try {
|
||||
const versions = {};
|
||||
this.data.documents.forEach(item => { versions[item.consentType] = item.documentVersion; });
|
||||
await serviceConsentService.agree(versions);
|
||||
wx.showToast({ title: '授权已确认', icon: 'success' });
|
||||
await this.load();
|
||||
} catch (err) { this.setData({ error: err.message || '授权确认失败' }); }
|
||||
finally { this.setData({ saving: false }); }
|
||||
},
|
||||
onWithdraw() {
|
||||
wx.showActionSheet({ itemList: ['撤回婚恋服务授权', '撤回隐私与安全授权'], success: ({ tapIndex }) => this.withdraw(tapIndex === 0 ? 'service_terms' : 'privacy_safety') });
|
||||
},
|
||||
async withdraw(consentType) {
|
||||
try { await serviceConsentService.withdraw(consentType); wx.showToast({ title: '已撤回', icon: 'success' }); await this.load(); }
|
||||
catch (err) { this.setData({ error: err.message || '撤回失败' }); }
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user