diff --git a/api/thresholdActivity.js b/api/thresholdActivity.js new file mode 100644 index 0000000..dcf2288 --- /dev/null +++ b/api/thresholdActivity.js @@ -0,0 +1,25 @@ +import { request, authRequest } from '../utils/request' + +export function listThresholdActivities(params = {}) { + return request({ url: '/api/app/threshold-activities', method: 'GET', data: params }) +} + +export function getThresholdActivity(id) { + return request({ url: `/api/app/threshold-activities/${id}`, method: 'GET' }) +} + +export function getMyThresholdActivity(id) { + return authRequest({ url: `/api/app/threshold-activities/${id}/my`, method: 'GET', suppressAuthModal: true }) +} + +export function joinThresholdActivity(id) { + return authRequest({ url: `/api/app/threshold-activities/${id}/join`, method: 'POST' }) +} + +export function listThresholdParticipants(id, page = 1, page_size = 20) { + return request({ url: `/api/app/threshold-activities/${id}/participants`, method: 'GET', data: { page, page_size } }) +} + +export function listThresholdWinners(id, page = 1, page_size = 100) { + return request({ url: `/api/app/threshold-activities/${id}/winners`, method: 'GET', data: { page, page_size } }) +} diff --git a/pages-activity/activity/threshold/detail.vue b/pages-activity/activity/threshold/detail.vue new file mode 100644 index 0000000..63e6b2f --- /dev/null +++ b/pages-activity/activity/threshold/detail.vue @@ -0,0 +1,586 @@ + + + + + diff --git a/pages-activity/activity/threshold/index.vue b/pages-activity/activity/threshold/index.vue new file mode 100644 index 0000000..11e829a --- /dev/null +++ b/pages-activity/activity/threshold/index.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/pages-game/game/minesweeper/index.vue b/pages-game/game/minesweeper/index.vue index a61da12..2a4dd9c 100755 --- a/pages-game/game/minesweeper/index.vue +++ b/pages-game/game/minesweeper/index.vue @@ -43,19 +43,21 @@ - {{ entering ? '正在进入...' : (ticketCount > 0 ? '立即开局' : '资格不足') }} - - 📡 对战列表 / 围观 + + + 📡 对战列表 / 围观 + + + 🏆 扫雷排行榜 + @@ -77,6 +79,9 @@ export default { this.loadTickets() }, methods: { + async openLeaderboard() { + uni.navigateTo({ url: '/pages-game/game/minesweeper/leaderboard' }) + }, async loadTickets() { this.loading = true @@ -304,6 +309,12 @@ export default { padding-bottom: calc(40rpx + env(safe-area-inset-bottom)); } +.minesweeper-actions { + display: flex; + gap: 20rpx; + margin-top: 24rpx; +} + .btn-primary { height: 110rpx; width: 100%; @@ -316,8 +327,8 @@ export default { } } -.btn-secondary { - margin-top: 24rpx; +btn-secondary { + flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 55rpx; @@ -327,6 +338,11 @@ export default { justify-content: center; } +.leaderboard-btn { + background: rgba($brand-primary, 0.10); + border-color: rgba($brand-primary, 0.18); +} + .secondary-btn-text { color: #94a3b8; font-size: 32rpx; diff --git a/pages-user/invite/landing.vue b/pages-user/invite/landing.vue index 74fb22f..7e44184 100755 --- a/pages-user/invite/landing.vue +++ b/pages-user/invite/landing.vue @@ -185,13 +185,18 @@ function onGetPhoneNumber(e) { } catch(e) {} uni.showToast({ title: '欢迎加入!', icon: 'success' }) + const backTarget = '/pages-activity/activity/threshold/index' setTimeout(() => { // #ifdef MP-TOUTIAO - // 抖音平台跳转到商城 uni.switchTab({ url: '/pages/shop/index' }) // #endif // #ifndef MP-TOUTIAO - uni.switchTab({ url: '/pages/index/index' }) + const pages = getCurrentPages() + if (pages.length > 1) { + uni.navigateBack({ delta: 1 }) + } else { + uni.switchTab({ url: '/pages/index/index' }) + } // #endif }, 500) diff --git a/pages-user/invites/index.vue b/pages-user/invites/index.vue index 4594631..759de87 100755 --- a/pages-user/invites/index.vue +++ b/pages-user/invites/index.vue @@ -19,6 +19,16 @@ {{ getRewardsTotal() }} 累计奖励 + + + {{ shareCount }} + 分享引导 + + + + + + 复制邀请码 @@ -83,6 +93,7 @@ const isRefreshing = ref(false) const page = ref(1) const pageSize = 20 const hasMore = ref(true) +const shareCount = ref(0) // 获取用户ID function getUserId() { @@ -126,6 +137,16 @@ function getRewardsTotal() { return list.value.length * rewardPerInvite } +function copyInviteLink() { + const inviteCode = uni.getStorageSync('invite_code') || (uni.getStorageSync('user_info') || {}).invite_code || '' + const text = inviteCode ? `快来和我一起参加裂变活动,邀请码:${inviteCode}` : '快来和我一起参加裂变活动' + uni.setClipboardData({ + data: text, + success: () => uni.showToast({ title: '邀请码已复制', icon: 'success' }), + fail: () => uni.showToast({ title: '复制失败', icon: 'none' }) + }) +} + // 下拉刷新 async function onRefresh() { isRefreshing.value = true @@ -172,8 +193,19 @@ async function fetchData(append = false) { } onLoad(() => { + const inviteCode = uni.getStorageSync('invite_code') || (uni.getStorageSync('user_info') || {}).invite_code || '' + shareCount.value = inviteCode ? 1 : 0 fetchData() }) + +onShareAppMessage(() => { + const inviteCode = uni.getStorageSync('invite_code') || (uni.getStorageSync('user_info') || {}).invite_code || '' + return { + title: '邀请好友一起参加裂变活动,达标就能开奖!', + path: `/pages-user/invite/landing?invite_code=${inviteCode}`, + imageUrl: '/static/logo.png' + } +})