feat: add animated choice modes and bracket editor
Verify mini program and deploy preview / verify-deploy (push) Successful in 50s
Verify mini program and deploy preview / verify-deploy (push) Successful in 50s
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
.discover { padding: 28rpx 18rpx 180rpx; background: #fff; }
|
||||
.heading { font-size: 46rpx; font-weight: 950; }
|
||||
.subheading { margin: 10rpx 0 34rpx; color: #777; font-size: 24rpx; }
|
||||
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12rpx; }
|
||||
.result-card { overflow: hidden; border: 1rpx solid #eee; background: #fff; }
|
||||
.result-card image { display: block; width: 100%; height: 290rpx; }
|
||||
.result-copy { padding: 16rpx; }
|
||||
.result-copy text { color: #777; font-size: 21rpx; }
|
||||
.result-copy view { margin-top: 6rpx; font-size: 31rpx; font-weight: 900; }
|
||||
.bottom-nav { position: fixed; z-index: 20; left: 28rpx; right: 28rpx; bottom: calc(24rpx + env(safe-area-inset-bottom)); display: flex; height: 104rpx; padding: 0 18rpx; border-radius: 20rpx; background: #080808; box-shadow: 0 18rpx 50rpx rgba(0,0,0,.22); }
|
||||
.nav-item { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #888; font-size: 18rpx; }
|
||||
.nav-item.active { color: #fff; }
|
||||
.nav-item.active:before { content: ''; position: absolute; top: -25rpx; width: 94rpx; height: 94rpx; border: 14rpx solid #fff; border-radius: 50%; background: #080808; }
|
||||
.nav-icon { z-index: 1; width: 26rpx; height: 26rpx; margin-bottom: 7rpx; border: 5rpx solid currentColor; }
|
||||
.home-icon { transform: rotate(45deg); border-radius: 5rpx; }
|
||||
.discover-icon { border-radius: 50%; border-width: 6rpx 2rpx; }
|
||||
.me-icon { border-radius: 50%; }
|
||||
.nav-item text { z-index: 1; }
|
||||
@@ -0,0 +1,16 @@
|
||||
var api = require('../../utils/api');
|
||||
|
||||
Page({
|
||||
data: { results: [], loading: true, error: '' },
|
||||
onLoad: function () { this.load(); },
|
||||
load: function () {
|
||||
var self = this;
|
||||
api.request('/api/v1/results/discover').then(function (results) {
|
||||
self.setData({ results: results, loading: false, error: '' });
|
||||
}).catch(function (error) {
|
||||
self.setData({ loading: false, error: error.message || '加载失败' });
|
||||
});
|
||||
},
|
||||
openHome: function () { xhs.redirectTo({ url: '/pages/index/index' }); },
|
||||
openMe: function () { xhs.redirectTo({ url: '/pages/me/me' }); }
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{ "navigationBarTitleText": "大家的选择" }
|
||||
@@ -0,0 +1,18 @@
|
||||
<view class="page discover">
|
||||
<view class="heading">大家最近选了什么</view>
|
||||
<view class="subheading">看看同频的人把谁送到了最后</view>
|
||||
<view xhs:if="{{loading}}" class="empty">正在收集答案…</view>
|
||||
<view xhs:elif="{{error}}" class="empty">{{error}}</view>
|
||||
<view xhs:elif="{{!results.length}}" class="empty">还没有公开结果</view>
|
||||
<view xhs:else class="result-grid">
|
||||
<view xhs:for="{{results}}" xhs:key="id" class="result-card">
|
||||
<image src="/assets/test-covers/{{item.test_slug}}.jpg" mode="aspectFill" />
|
||||
<view class="result-copy"><text>{{item.test_title}}</text><view>{{item.champion_name}}</view></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-nav">
|
||||
<view class="nav-item" bindtap="openHome"><view class="nav-icon home-icon"></view><text>测试</text></view>
|
||||
<view class="nav-item active"><view class="nav-icon discover-icon"></view><text>发现</text></view>
|
||||
<view class="nav-item" bindtap="openMe"><view class="nav-icon me-icon"></view><text>我的</text></view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user