You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

寻求已关联Stripe Connect账户的编辑/移除按钮HTML/CSS模板

已关联Stripe Connect账户的编辑/移除UI方案(适配Angular + .Net)

核心UI组件设计

账户状态卡片

用简洁卡片展示已关联账户的关键信息,兼顾可读性与操作便捷性:

  • 顶部搭配Stripe风格图标+已关联Stripe Express账户状态标签,强化辨识度
  • 展示脱敏后的核心信息:关联邮箱、账户ID(如acct_123****)、绑定银行账户尾号(如****1234)
  • 卡片底部设置两个操作按钮:编辑账户和解除关联

操作逻辑说明

  • 编辑账户:点击后通过后端.Net生成Stripe官方账户管理链接(调用account_links API),前端Angular跳转至Stripe页面,用户可直接修改银行信息、个人资料等
  • 解除关联:点击弹出确认弹窗,确认后调用后端接口删除关联记录,可选调用Stripe API解除账户绑定,成功后刷新页面切换回未关联状态的按钮

示例Angular模板代码

<div class="stripe-account-card" *ngIf="hasConnectedStripeAccount">
  <div class="card-header">
    <span class="stripe-icon">💳</span>
    <span class="status-text">已关联Stripe Express账户</span>
  </div>
  <div class="card-body">
    <div class="info-item">
      <label>关联邮箱:</label>
      <span>{{ stripeAccount.email }}</span>
    </div>
    <div class="info-item">
      <label>账户ID:</label>
      <span>{{ stripeAccount.id | slice:0:8 }}****</span>
    </div>
    <div class="info-item">
      <label>绑定银行卡:</label>
      <span>****{{ stripeAccount.last4 }}</span>
    </div>
  </div>
  <div class="card-actions">
    <button class="btn-edit" (click)="openStripeAccountSettings()">编辑账户信息</button>
    <button class="btn-remove" (click)="showUnlinkConfirm()">解除关联</button>
  </div>
</div>

<!-- 解除关联确认弹窗 -->
<div class="confirm-modal" *ngIf="showConfirmModal">
  <div class="modal-content">
    <h3>确认解除关联?</h3>
    <p>解除后将无法接收课程收益,需重新关联账户才能继续收款。</p>
    <div class="modal-actions">
      <button class="btn-cancel" (click)="hideConfirmModal()">取消</button>
      <button class="btn-confirm" (click)="unlinkStripeAccount()">确认解除</button>
    </div>
  </div>
</div>

示例CSS样式

.stripe-account-card {
  max-width: 500px;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.stripe-icon {
  font-size: 24px;
  margin-right: 10px;
}

.status-text {
  font-size: 16px;
  font-weight: 600;
  color: #2e7d32;
}

.info-item {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.info-item label {
  color: #666;
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

.btn-edit {
  padding: 8px 16px;
  border: 1px solid #007bff;
  border-radius: 4px;
  background: white;
  color: #007bff;
  cursor: pointer;
}

.btn-edit:hover {
  background: #e3f2fd;
}

.btn-remove {
  padding: 8px 16px;
  border: 1px solid #dc3545;
  border-radius: 4px;
  background: white;
  color: #dc3545;
  cursor: pointer;
}

.btn-remove:hover {
  background: #ffebee;
}

/* 弹窗样式 */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 25px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn-cancel {
  padding: 8px 16px;
  border: 1px solid #6c757d;
  border-radius: 4px;
  background: white;
  color: #6c757d;
  cursor: pointer;
}

.btn-confirm {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: #dc3545;
  color: white;
  cursor: pointer;
}

后端.Net核心逻辑提示

  1. 生成编辑链接:调用Stripe的AccountLinkService.CreateAsync方法,传入用户的Stripe账户ID,设置refresh_url和return_url为平台页面,type指定为account_onboarding(已关联账户仍可进入管理页)
  2. 解除关联:删除数据库中用户与Stripe账户的关联记录,可选调用AccountService.DeleteAsync彻底注销账户(注意:删除后无法恢复)

UX优化建议

  • 解除关联必须添加二次确认,避免误操作
  • 用户从Stripe编辑页返回后,自动刷新平台端账户信息,确保数据同步
  • 若账户存在未完成验证等异常状态,在卡片上添加醒目提示,引导用户前往编辑页完善信息

内容的提问来源于stack exchange,提问作者Tito

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 23:40:28