You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
3.9 KiB
111 lines
3.9 KiB
<!--pages/collection/index.wxml-->
|
|
<view class="page-container">
|
|
<!-- 筛选和搜索栏 -->
|
|
<view class="filter-bar">
|
|
<view class="filter-tabs">
|
|
<view class="filter-tab {{activeFilter === 'all' ? 'active' : ''}}" data-filter="all" bindtap="switchFilter">
|
|
<text>全部</text>
|
|
</view>
|
|
<view class="filter-tab {{activeFilter === 'me' ? 'active' : ''}}" data-filter="me" bindtap="switchFilter">
|
|
<text>我的</text>
|
|
</view>
|
|
</view>
|
|
<view class="search-container">
|
|
<input
|
|
type="text"
|
|
placeholder="搜索电话号码/主体名称"
|
|
bindinput="onSearchInput"
|
|
value="{{searchKeyword}}"
|
|
class="search-input"
|
|
/>
|
|
</view>
|
|
<view wx:if="isAdmin && invitees.length > 0" class="filter-button" bindtap="openSidebar">
|
|
<text class="filter-icon">🔍</text>
|
|
<text class="filter-text">筛选</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 二维码列表 -->
|
|
<view class="qr-list">
|
|
<block wx:if="{{qrCodes.length === 0}}">
|
|
<view class="empty-state">
|
|
<image
|
|
src="https://api.qrserver.com/v1/create-qr-code/?size=100x100&data=empty"
|
|
mode="aspectFit"
|
|
class="empty-image"
|
|
/>
|
|
<text class="empty-text">暂无二维码</text>
|
|
<text class="empty-subtext">请先生成邀请二维码</text>
|
|
</view>
|
|
</block>
|
|
<block wx:else>
|
|
<block wx:for="{{qrCodes}}" wx:key="sessionId" wx:for-index="index">
|
|
<!-- 二维码项 -->
|
|
<view class="qr-item" bindtap="toggleSection" data-index="{{index}}">
|
|
<view class="qr-item-header">
|
|
<view class="qr-item-info">
|
|
<rich-text nodes="{{item.company ? item.company : '未知'}}"></rich-text>
|
|
<view class="qr-item-details">
|
|
<rich-text nodes="{{item.phoneNumber ? item.phoneNumber : '未知'}}"></rich-text>
|
|
<text> / {{item.createdAt || '未知'}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="qr-item-arrow">
|
|
<text>{{expandedIndex === index ? '▲' : '▼'}}</text>
|
|
</view>
|
|
</view>
|
|
<!-- 二维码详情 -->
|
|
<view class="qr-item-content" wx:if="{{expandedIndex === index}}">
|
|
<image
|
|
src="{{item.qrCodeUrl || 'https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=' + encodeURIComponent(item.url)}}"
|
|
mode="aspectFit"
|
|
class="qr-image"
|
|
bindload="onImageLoad"
|
|
binderror="onImageError"
|
|
/>
|
|
<view class="qr-info-center">
|
|
<view class="qr-info-item">
|
|
<text>{{item.inviter || '未知'}}</text>
|
|
</view>
|
|
<view class="qr-info-item">
|
|
<text>{{item.inviterProjectName || '无职位'}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</block>
|
|
</view>
|
|
|
|
<!-- 底部按钮 -->
|
|
<view class="bottom-section">
|
|
<button class="generate-button" bindtap="goToGenerate">
|
|
<text class="generate-button-text">生成邀请二维码</text>
|
|
</button>
|
|
</view>
|
|
|
|
<!-- 筛选侧边栏 -->
|
|
<view class="sidebar" wx:if="{{sidebarVisible}}">
|
|
<view class="sidebar-overlay" bindtap="closeSidebar"></view>
|
|
<view class="sidebar-content">
|
|
<view class="sidebar-header">
|
|
<text class="sidebar-title">筛选用户</text>
|
|
<view class="sidebar-close" bindtap="closeSidebar">
|
|
<text>✕</text>
|
|
</view>
|
|
</view>
|
|
<view class="sidebar-body">
|
|
<view
|
|
wx:for="{{invitees}}"
|
|
wx:key="inviter"
|
|
class="sidebar-item"
|
|
data-filter="invitee_{{index}}"
|
|
data-inviter="{{item.inviter}}"
|
|
bindtap="filterByInviter"
|
|
>
|
|
<text class="sidebar-item-text">{{item.inviter}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|