2026-09-30 08:13:07 +08:00
|
|
|
<div class="page-head">
|
|
|
|
|
<h1>邀请访客</h1>
|
|
|
|
|
<span class="sub">朋友只读 —— 能看,不能改</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card card-pad">
|
|
|
|
|
<h2 class="section-title">三种身份 <span class="hint">决定能看到多少、能不能改</span></h2>
|
|
|
|
|
<div class="role-cards">
|
|
|
|
|
<div class="role-card">
|
|
|
|
|
<div class="rc-name">管理员</div>
|
2026-09-30 09:44:55 +08:00
|
|
|
<p class="rc-desc">一个家庭通常只有一位。系统级的 slogan、附件存哪儿、谁能登录,都在他手里。</p>
|
2026-09-30 08:13:07 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="role-card">
|
|
|
|
|
<div class="rc-name">家庭成员</div>
|
|
|
|
|
<p class="rc-desc">正常使用的人。可以建自己的通讯录、日历本,维护家里的名册与亲属关系。</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="role-card">
|
|
|
|
|
<div class="rc-name">访客</div>
|
|
|
|
|
<p class="rc-desc">一起旅行、一起看过电影的朋友。能登录进来看,但改不了任何东西,也不出现在家谱里。</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card card-pad" style="margin-top:16px">
|
|
|
|
|
<h2 class="section-title">开通一个访客账号</h2>
|
|
|
|
|
|
|
|
|
|
<?php if (!empty($errors['_'] ?? null)): ?>
|
|
|
|
|
<div class="flash"><div class="flash-item err"><?= e($errors['_']) ?></div></div>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
<form method="post" action="<?= e(url('accounts/invite_create')) ?>">
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
<div class="form-grid">
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="v_name">对方的名字</label>
|
|
|
|
|
<input class="input" id="v_name" name="name" value="<?= e(old('name')) ?>" required>
|
|
|
|
|
<?php if (!empty($errors['name'])): ?><span class="err"><?= e($errors['name']) ?></span><?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="v_phone">手机号(登录名)</label>
|
|
|
|
|
<input class="input" id="v_phone" name="phone" value="<?= e(old('phone')) ?>"
|
|
|
|
|
inputmode="numeric" required>
|
|
|
|
|
<?php if (!empty($errors['phone'])): ?><span class="err"><?= e($errors['phone']) ?></span><?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="v_password">初始密码</label>
|
|
|
|
|
<input class="input" id="v_password" name="password" type="password" required>
|
|
|
|
|
<span class="tip">至少 8 位,含字母和数字。把手机号和密码告诉他即可登录。</span>
|
|
|
|
|
<?php if (!empty($errors['password'])): ?><span class="err"><?= e($errors['password']) ?></span><?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="v_note">备注</label>
|
|
|
|
|
<input class="input" id="v_note" name="note" value="<?= e(old('note')) ?>"
|
|
|
|
|
placeholder="比如:2026 年一起去青海的朋友">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="btn-row">
|
|
|
|
|
<button class="btn" type="submit">开通访客账号</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
// 已有访客
|
|
|
|
|
$guests = [];
|
|
|
|
|
foreach ($people as $pp) {
|
|
|
|
|
if (($pp['account_role'] ?? '') === 'guest') {
|
|
|
|
|
$guests[] = $pp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<?php if ($guests): ?>
|
|
|
|
|
<div class="card card-pad" style="margin-top:16px">
|
|
|
|
|
<h2 class="section-title">已有访客 <span class="hint"><?= count($guests) ?> 位</span></h2>
|
|
|
|
|
<ul class="plain-list">
|
|
|
|
|
<?php foreach ($guests as $g): ?>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="<?= e(url('people/show', ['id' => (int)$g['id']])) ?>"><?= e($g['name']) ?></a>
|
|
|
|
|
<span class="muted small">
|
|
|
|
|
<?= e(\App\Crypto::maskPhone((string)($g['phone_encrypted'] ?? ''))) ?>
|
|
|
|
|
· <?= $g['account_status'] === 'active' ? '正常' : '已停用' ?>
|
|
|
|
|
</span>
|
|
|
|
|
</li>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</ul>
|
|
|
|
|
<p class="small muted" style="margin:14px 0 0">
|
|
|
|
|
要停用或删除,点进对方的名字,在「登录账号」里操作。
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<?php endif; ?>
|