|
@@ -48,12 +48,12 @@
|
|
|
class="w-40rpx h-30rpx mr-10rpx"
|
|
|
mode="scaleToFill"
|
|
|
/>
|
|
|
- <text class="">2</text>
|
|
|
+ <text class="">{{ teamInfo.total }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="w-320rpx h-120rpx text-primary flex flex-col items-center">
|
|
|
<view
|
|
|
- @click="receiveshow = true"
|
|
|
+ @click="getRewards"
|
|
|
class="w-160rpx h-60rpx bg-primary text-26rpx font-700 text-textc rounded-20rpx flex items-center justify-center"
|
|
|
>
|
|
|
{{ $t('team.Reward') }}
|
|
@@ -64,7 +64,7 @@
|
|
|
class="w-23rpx h-30rpx mr-18.5rpx"
|
|
|
mode="scaleToFill"
|
|
|
/>
|
|
|
- <text class="">2</text>
|
|
|
+ <text class="">{{ teamInfo.rewardsTotal }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -85,7 +85,7 @@
|
|
|
mode="scaleToFill"
|
|
|
class="w-30rpx h-30rpx"
|
|
|
/>
|
|
|
- <text class="ml-10rpx text-[24rpx]">11</text>
|
|
|
+ <text class="ml-10rpx text-[24rpx]">{{ teamInfo.claimableAmountA }}</text>
|
|
|
</view>
|
|
|
<view class="ml-20rpx flex items-center">
|
|
|
<image
|
|
@@ -93,13 +93,15 @@
|
|
|
mode="scaleToFill"
|
|
|
class="w-30rpx h-22rpx"
|
|
|
/>
|
|
|
- <text class="ml-10rpx text-[24rpx] font-700">11</text>
|
|
|
+ <text class="ml-10rpx text-[24rpx] font-700">
|
|
|
+ {{ teamInfo.teamACount }}
|
|
|
+ </text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="w-160rpx h-60rpx flex flex-col justify-center items-center mr-20rpx">
|
|
|
<view
|
|
|
- @click="abShow = true"
|
|
|
+ @click="openAbShow('A')"
|
|
|
class="w-full h-full text-textc bg-primary rounded-10rpx flex items-center justify-center"
|
|
|
>
|
|
|
<text class="text-[26rpx] fw-700">{{ $t('team.GetIt') }}</text>
|
|
@@ -123,7 +125,7 @@
|
|
|
mode="scaleToFill"
|
|
|
class="w-30rpx h-30rpx"
|
|
|
/>
|
|
|
- <text class="ml-10rpx text-[24rpx]">11</text>
|
|
|
+ <text class="ml-10rpx text-[24rpx]">{{ teamInfo.claimableRewardsB }}</text>
|
|
|
</view>
|
|
|
<view class="ml-20rpx flex items-center">
|
|
|
<image
|
|
@@ -131,12 +133,15 @@
|
|
|
mode="scaleToFill"
|
|
|
class="w-30rpx h-22rpx"
|
|
|
/>
|
|
|
- <text class="ml-10rpx text-[24rpx] font-700">11</text>
|
|
|
+ <text class="ml-10rpx text-[24rpx] font-700">
|
|
|
+ {{ teamInfo.teamBCount }}
|
|
|
+ </text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="w-160rpx h-60rpx flex flex-col justify-center items-center mr-20rpx">
|
|
|
<view
|
|
|
+ @click="openAbShow('B')"
|
|
|
class="w-full h-full text-textc bg-primary rounded-10rpx flex items-center justify-center"
|
|
|
>
|
|
|
<text class="text-[26rpx] fw-700">{{ $t('team.GetIt') }}</text>
|
|
@@ -150,7 +155,7 @@
|
|
|
<text class="text-[32rpx] fw-700 mb-10rpx">{{ $t('team.Invite') }}</text>
|
|
|
<text class="text-[24rpx] font-400">{{ $t('team.will') }}</text>
|
|
|
</view>
|
|
|
- <view class="flex flex-col justify-center" @click="lianjieShow = true">
|
|
|
+ <view class="flex flex-col justify-center" @click="openShareCode">
|
|
|
<view
|
|
|
class="w-160rpx h-60rpx text-textc bg-primary rounded-10rpx flex items-center justify-center mr-20rpx"
|
|
|
>
|
|
@@ -160,17 +165,20 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<scroll-view
|
|
|
+ v-if="ruleData?.inviteRewardsRuleList"
|
|
|
scroll-x
|
|
|
:scroll-anchoring="true"
|
|
|
:enhanced="true"
|
|
|
:show-scrollbar="false"
|
|
|
class="custom-scroll-view w-690rpx overflow-x-auto whitespace-nowrap mb-140rpx"
|
|
|
+ @touchstart="handleTouchStart"
|
|
|
+ @touchmove="handleTouchMove"
|
|
|
+ @touchend="handleTouchEnd"
|
|
|
>
|
|
|
<view class="inline-flex">
|
|
|
<view
|
|
|
- @click="lingquShow = true"
|
|
|
class="w-690rpx h-200rpx bg-cardlight flex items-center rounded-20rpx mr-20rpx"
|
|
|
- v-for="(item, index) in 1"
|
|
|
+ v-for="(item, index) in ruleData?.inviteRewardsRuleList"
|
|
|
:key="index"
|
|
|
>
|
|
|
<view class="flex w-100% items-center">
|
|
@@ -182,20 +190,30 @@
|
|
|
mode="scaleToFill"
|
|
|
class="w-70rpx h-70rpx"
|
|
|
/>
|
|
|
- <text class="ml-10rpx text-[50rpx] fw-700">+1000</text>
|
|
|
+ <text class="ml-10rpx text-[50rpx] fw-700">+{{ item.goldCoinNum }}</text>
|
|
|
</view>
|
|
|
- <text class="text-[28rpx] fw-700">Inviting 2 friends can earn</text>
|
|
|
+ <text class="text-[28rpx] fw-700">{{ item.rewardsDescribe }}</text>
|
|
|
</view>
|
|
|
<view class="flex">
|
|
|
<view class="w-75% c-bg">
|
|
|
- <wd-progress :percentage="10" color="primary" hide-text :duration="0.1" />
|
|
|
+ <wd-progress
|
|
|
+ :percentage="item.percentage"
|
|
|
+ color="primary"
|
|
|
+ hide-text
|
|
|
+ :duration="0.1"
|
|
|
+ />
|
|
|
</view>
|
|
|
<view class="text-[28rpx] flex flex-col justify-center ml-10rpx">
|
|
|
- <text>1/2</text>
|
|
|
+ <text>
|
|
|
+ {{
|
|
|
+ ruleData.inviteNum > item.inviteNum ? item.inviteNum : ruleData.inviteNum
|
|
|
+ }}/{{ item.inviteNum }}
|
|
|
+ </text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view
|
|
|
+ @click="lingquShowFn(item)"
|
|
|
class="mr-40rpx flex flex-col justify-center w-160rpx h-100rpx items-center rounded-10rpx bg-primary"
|
|
|
>
|
|
|
<text class="text-32rpx font-700">{{ $t('team.GetIt') }}</text>
|
|
@@ -220,20 +238,20 @@
|
|
|
<Dialog v-model:show-value="receiveshow" width="690rpx" height="686rpx">
|
|
|
<view class="w-full flex flex-col items-center">
|
|
|
<view class="w-630rpx flex items-center justify-between mt-90rpx">
|
|
|
- <text class="text-36rpx font-700 text-white">NewComer List</text>
|
|
|
+ <text class="text-36rpx font-700 text-white">{{ $t('team.NewComerList') }}</text>
|
|
|
<view class="flex items-center">
|
|
|
<image
|
|
|
src="@/static/images/team/cat.png"
|
|
|
class="w-23rpx h-30rpx mr-10rpx"
|
|
|
mode="scaleToFill"
|
|
|
/>
|
|
|
- <text class="text-primary text-28rpx font-700">2</text>
|
|
|
+ <text class="text-primary text-28rpx font-700">{{ rewards.length }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="w-630rpx bg-cards rounded-20rpx flex items-center h-194rpx mt-30rpx">
|
|
|
- <scroll-view :scroll-y="true" :show-scrollbar="false">
|
|
|
+ <scroll-view v-if="rewards.length > 0" :scroll-y="true" :show-scrollbar="false">
|
|
|
<view
|
|
|
- v-for="(item, index) in 10"
|
|
|
+ v-for="(item, index) in rewards"
|
|
|
:key="index"
|
|
|
class="text-[#fff] flex flex-col justify-center w-full items-center"
|
|
|
>
|
|
@@ -252,23 +270,25 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
- <!-- <view class="flex flex-col justify-center text-center w-100% h-100% text-[#fff]">-->
|
|
|
- <!-- <text>{{ $t('team.noData') }}</text>-->
|
|
|
- <!-- </view>-->
|
|
|
+ <view v-else class="flex flex-col justify-center text-center w-100% h-100% text-[#fff]">
|
|
|
+ <text>{{ $t('team.noData') }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view
|
|
|
+ @click="claimTeamInviteRewardFn"
|
|
|
class="w-630rpx bg-primary h-100rpx flex items-center justify-center rounded-20rpx mt-30rpx"
|
|
|
>
|
|
|
- <text class="text-28rpx font-700 text-textc">Receive all</text>
|
|
|
+ <text class="text-28rpx font-700 text-textc">{{ $t('team.ReceiveAll') }}</text>
|
|
|
</view>
|
|
|
<view class="w-630rpx bg-cards rounded-20rpx flex items-center h-100rpx mt-30rpx">
|
|
|
<text class="text-24rpx font-400 text-white flex-1 ml-30rpx">
|
|
|
- You will get rewards for every invitation!
|
|
|
+ {{ $t('team.will') }}
|
|
|
</text>
|
|
|
<view
|
|
|
+ @click="openShareCode"
|
|
|
class="w-70rpx h-70rpx rounded-20rpx bg-primary flex items-center justify-center mr-20rpx"
|
|
|
>
|
|
|
- <text class="text-26rpx font-700 text-textc">Go</text>
|
|
|
+ <text class="text-26rpx font-700 text-textc">{{ $t('play.Go') }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -288,9 +308,10 @@
|
|
|
<view
|
|
|
class="w-238rpx flex items-center fw-550 justify-between h-50rpx text-primary text-50rpx mt-38rpx"
|
|
|
>
|
|
|
- <text v-for="item in 'abcde'" :key="item">{{ item }}</text>
|
|
|
+ <text v-for="item in shareCode" :key="item">{{ item }}</text>
|
|
|
</view>
|
|
|
<view
|
|
|
+ @click="copyShareUrl"
|
|
|
class="w-214rpx h-60rpx rounded-30rpx bg-primary flex items-center justify-center mt-54rpx"
|
|
|
>
|
|
|
<image src="@/static/images/team/copy.png" class="w-26rpx h-26rpx mr-10rpx"></image>
|
|
@@ -312,40 +333,56 @@
|
|
|
src="@/static/images/team/teamcathui.png"
|
|
|
class="w-40rpx h-40rpx mr-10rpx"
|
|
|
></image>
|
|
|
- <text class="text-28rpx font-400">Total</text>
|
|
|
+ <text class="text-28rpx font-400">{{ $t('team.Total') }}</text>
|
|
|
</view>
|
|
|
- <text class="text-white font-24rpx font-400">1</text>
|
|
|
+ <text class="text-white font-24rpx font-400">
|
|
|
+ {{ abType === 'A' ? teamInfo.claimableRewardsA : teamInfo.claimableRewardsB }}
|
|
|
+ </text>
|
|
|
</view>
|
|
|
<image src="@/static/images/team/a.png" class="w-100rpx h-100rpx"></image>
|
|
|
<view class="w-215rpx h-100rpx flex flex-col items-center justify-between">
|
|
|
- <text class="text-28rpx font-400">Commission</text>
|
|
|
- <text class="text-white font-24rpx font-400">2%</text>
|
|
|
+ <text class="text-28rpx font-400">{{ $t('team.Commission') }}</text>
|
|
|
+ <text class="text-white font-24rpx font-400">
|
|
|
+ {{ abType === 'A' ? '2%' : '0.2%' }}
|
|
|
+ </text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view
|
|
|
+ @click="claimTeamShareRewardFn"
|
|
|
class="w-630rpx h-100rpx bg-cards rounded-20rpx flex items-center justify-center mt-30rpx"
|
|
|
>
|
|
|
<image src="@/static/images/team/jinbi.png" class="w-40rpx h-40rpx mr-10rpx"></image>
|
|
|
- <text class="text-28rpx font-700 text-primary">2</text>
|
|
|
+ <text class="text-28rpx font-700 text-primary">
|
|
|
+ {{ teamAOBData?.total ?? 0 }}
|
|
|
+ </text>
|
|
|
</view>
|
|
|
<view
|
|
|
class="w-630rpx h-60rpx flex items-center mt-30rpx justify-between text-26rpx font-400 text-white"
|
|
|
>
|
|
|
- <text>Total Team Production</text>
|
|
|
- <text>0 BH Coin</text>
|
|
|
+ <text>{{ $t('team.TotalTeamProduction') }}</text>
|
|
|
+ <text>{{ teamAOBData?.total ?? 0 }}</text>
|
|
|
</view>
|
|
|
<view class="w-630rpx h-1rpx bg-cards"></view>
|
|
|
<view class="w-630rpx">
|
|
|
- <scroll-view class="h-200rpx" :scroll-y="true" :show-scrollbar="false">
|
|
|
- <view v-for="(item, index) in 5" :key="index" class="flex justify-between mt-40rpx">
|
|
|
+ <scroll-view
|
|
|
+ v-if="teamAOBData?.users"
|
|
|
+ class="h-200rpx"
|
|
|
+ :scroll-y="true"
|
|
|
+ :show-scrollbar="false"
|
|
|
+ >
|
|
|
+ <view
|
|
|
+ v-for="(item, index) in teamAOBData.users"
|
|
|
+ :key="index"
|
|
|
+ class="flex justify-between mt-40rpx"
|
|
|
+ >
|
|
|
<view class="flex">
|
|
|
<image
|
|
|
- src="@/static/images/trophy/avatar.png"
|
|
|
+ :src="item.avatar"
|
|
|
class="w-90rpx h-90rpx rounded-100rpx mr-10rpx flex flex-col justify-center text-center"
|
|
|
></image>
|
|
|
<view class="text-[#fff] ml-15rpx">
|
|
|
<view>
|
|
|
- <text class="mr-10rpx text-26rpx font-700">123123</text>
|
|
|
+ <text class="mr-10rpx text-26rpx font-700">{{ item.tgAccount }}</text>
|
|
|
<image
|
|
|
src="@/static/images/team/fj.png"
|
|
|
mode="scaleToFill"
|
|
@@ -364,7 +401,7 @@
|
|
|
</view>
|
|
|
<view class="text-[#fff] flex flex-col justify-center">
|
|
|
<view class="flex text-[24rpx] font-400">
|
|
|
- <text>111</text>
|
|
|
+ <text>{{ item.userYieldTotal }}</text>
|
|
|
<image
|
|
|
src="@/static/images/trophy/jinbi.png"
|
|
|
mode="scaleToFill"
|
|
@@ -375,12 +412,12 @@
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
|
|
|
- <!-- <view-->
|
|
|
- <!-- v-else-->
|
|
|
- <!-- class="flex flex-col justify-center text-center w-100% h-100% text-[#fff] mt-50rpx"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- <text>{{ $t('team.noData') }}</text>-->
|
|
|
- <!-- </view>-->
|
|
|
+ <view
|
|
|
+ v-else
|
|
|
+ class="flex flex-col justify-center text-center w-100% h-100% text-[#fff] mt-50rpx"
|
|
|
+ >
|
|
|
+ <text>{{ $t('team.noData') }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</Dialog>
|
|
@@ -390,19 +427,20 @@
|
|
|
<image src="@/static/images/team/teamcat.png" mode="scaleToFill" class="w-82rpx h-62rpx" />
|
|
|
</view>
|
|
|
<view class="w-630rpx flex items-center justify-center mt-30rpx">
|
|
|
- <text class="text-36rpx font-700 text-white">Invite 1 friends</text>
|
|
|
+ <text class="text-36rpx font-700 text-white">{{ currentLingquData.rewardsDescribe }}</text>
|
|
|
</view>
|
|
|
<view class="w-630rpx flex items-center justify-center mt-30rpx">
|
|
|
<text class="text-26rpx font-400 text-white">
|
|
|
Unlock
|
|
|
- <text class="text-primary">10,000</text>
|
|
|
- BH Coin when you reach this level.
|
|
|
+ <text class="text-primary">{{ currentLingquData.goldCoinNum }}</text>
|
|
|
+ {{ $t('production.rewards.TapCoins') }}
|
|
|
</text>
|
|
|
</view>
|
|
|
<view
|
|
|
+ @click="claim"
|
|
|
class="w-630rpx bg-primary h-100rpx flex items-center justify-center rounded-20rpx mt-30rpx"
|
|
|
>
|
|
|
- <text class="text-28rpx font-700 text-textc">Claim</text>
|
|
|
+ <text class="text-28rpx font-700 text-textc">{{ $t('production.rewards.Claim') }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</Dialog>
|
|
@@ -482,7 +520,27 @@
|
|
|
import tabbar from '@/components/TabBar/index.vue'
|
|
|
import Dialog from '@/components/common/Dialog/index.vue'
|
|
|
import { shareToTelegram, TelegramLinkBuilder } from '@/utils/temlgram'
|
|
|
+import {
|
|
|
+ claimTeamInviteReward,
|
|
|
+ claimTeamInviteTaskReward,
|
|
|
+ claimTeamShareReward,
|
|
|
+ getMyTeamsInfo,
|
|
|
+ getShareCode,
|
|
|
+ getTeamInviteRewardsList,
|
|
|
+ getTeamInviteRewardsRules,
|
|
|
+ getTeamShareUserListByType,
|
|
|
+ TeamAOB,
|
|
|
+ TeamInfo,
|
|
|
+ TeamInviteRewardsRule,
|
|
|
+ TeamInviteRewardsRules,
|
|
|
+} from '@/service/team'
|
|
|
+import useClipboard from 'vue-clipboard3'
|
|
|
+import { useNotify } from 'wot-design-uni'
|
|
|
+import WebApp from '@twa-dev/sdk'
|
|
|
+import i18n from '@/locale'
|
|
|
|
|
|
+const { toClipboard } = useClipboard()
|
|
|
+const { showNotify, closeNotify } = useNotify()
|
|
|
const receiveshow = ref(false)
|
|
|
const lianjieShow = ref(false)
|
|
|
const abShow = ref(false)
|
|
@@ -491,11 +549,140 @@ const errorModel = ref(false)
|
|
|
|
|
|
const bot = new TelegramLinkBuilder(import.meta.env.VITE_TELEGRAM_BOOTNAME)
|
|
|
const getSimpleLink = () => {
|
|
|
- return bot.generateShareLink(`rp_${12345}`)
|
|
|
+ return bot.generateShareLink(`rp_${shareCode.value}`)
|
|
|
}
|
|
|
const shareUrl = () => {
|
|
|
shareToTelegram(getSimpleLink(), '')
|
|
|
}
|
|
|
+const teamInfo = ref<TeamInfo>({} as TeamInfo)
|
|
|
+const getMyTeamsInfoFn = async () => {
|
|
|
+ const { data } = await getMyTeamsInfo()
|
|
|
+ teamInfo.value = data
|
|
|
+}
|
|
|
+const shareCode = ref('')
|
|
|
+
|
|
|
+// 获取分享码信息
|
|
|
+const getShareCodeFn = async () => {
|
|
|
+ const { data } = await getShareCode()
|
|
|
+ shareCode.value = data
|
|
|
+}
|
|
|
+const openShareCode = () => {
|
|
|
+ receiveshow.value = false
|
|
|
+ lianjieShow.value = true
|
|
|
+}
|
|
|
+const copyShareUrl = async () => {
|
|
|
+ try {
|
|
|
+ await toClipboard(getSimpleLink())
|
|
|
+ showNotify({ type: 'success', message: 'success' })
|
|
|
+ } catch (e) {
|
|
|
+ showNotify({ type: 'warning', message: 'warning' })
|
|
|
+ }
|
|
|
+}
|
|
|
+// 固定奖励列表
|
|
|
+const rewards = ref<TeamInfo[]>([])
|
|
|
+const getRewards = async () => {
|
|
|
+ const { data } = await getTeamInviteRewardsList()
|
|
|
+ rewards.value = data
|
|
|
+ receiveshow.value = true
|
|
|
+}
|
|
|
+
|
|
|
+const claimTeamInviteRewardFn = async () => {
|
|
|
+ const { code, msg } = await claimTeamInviteReward()
|
|
|
+ if (code === 0) {
|
|
|
+ showNotify({ type: 'success', message: msg })
|
|
|
+ } else {
|
|
|
+ showNotify({ type: 'warning', message: msg })
|
|
|
+ }
|
|
|
+}
|
|
|
+// ab
|
|
|
+const abType = ref<'A' | 'B'>('A')
|
|
|
+const teamAOBData = ref<TeamAOB>({} as TeamAOB)
|
|
|
+const openAbShow = async (type: 'A' | 'B') => {
|
|
|
+ abType.value = type
|
|
|
+ const { data } = await getTeamShareUserListByType(type)
|
|
|
+ teamAOBData.value = data
|
|
|
+ abShow.value = true
|
|
|
+}
|
|
|
+const claimTeamShareRewardFn = async () => {
|
|
|
+ const { code, msg } = await claimTeamShareReward(abType.value)
|
|
|
+ if (code === 0) {
|
|
|
+ showNotify({ type: 'success', message: msg })
|
|
|
+ } else {
|
|
|
+ showNotify({ type: 'warning', message: msg })
|
|
|
+ }
|
|
|
+}
|
|
|
+// 阶段奖励
|
|
|
+const ruleData = ref<TeamInviteRewardsRule>({} as TeamInviteRewardsRule)
|
|
|
+const getTeamInviteRewardsListFn = async () => {
|
|
|
+ const { data } = await getTeamInviteRewardsRules()
|
|
|
+ ruleData.value = data
|
|
|
+ ruleData.value.inviteRewardsRuleList.forEach((item) => {
|
|
|
+ item.rewardsDescribe = i18n.global.t('production.rewards.yaoqinghaoyou', {
|
|
|
+ index: item.inviteNum,
|
|
|
+ })
|
|
|
+ item.percentage = (ruleData.value.inviteNum / item.inviteNum) * 100
|
|
|
+ })
|
|
|
+}
|
|
|
+const currentLingquData = ref<TeamInviteRewardsRules>({} as TeamInviteRewardsRules)
|
|
|
+const lingquShowFn = (item: TeamInviteRewardsRules) => {
|
|
|
+ if (ruleData.value.inviteNum >= item.inviteNum) {
|
|
|
+ currentLingquData.value = item
|
|
|
+ lingquShow.value = true
|
|
|
+ }
|
|
|
+}
|
|
|
+const claim = async () => {
|
|
|
+ const { code, msg } = await claimTeamInviteTaskReward(currentLingquData.value.id)
|
|
|
+ if (code === 0) {
|
|
|
+ showNotify({ type: 'success', message: msg })
|
|
|
+ } else {
|
|
|
+ showNotify({ type: 'warning', message: msg })
|
|
|
+ }
|
|
|
+ lianjieShow.value = false
|
|
|
+}
|
|
|
+// 处理滑动
|
|
|
+onShow(() => {
|
|
|
+ if (WebApp) {
|
|
|
+ // 禁用垂直滑动
|
|
|
+ WebApp.disableVerticalSwipes()
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+// 在组件卸载时恢复垂直滑动
|
|
|
+onHide(() => {
|
|
|
+ if (WebApp) {
|
|
|
+ // 恢复垂直滑动
|
|
|
+ WebApp.enableVerticalSwipes()
|
|
|
+ }
|
|
|
+})
|
|
|
+const startX = ref(0)
|
|
|
+const isScrolling = ref(false)
|
|
|
+const handleTouchStart = (e: TouchEvent) => {
|
|
|
+ startX.value = e.touches[0].pageX
|
|
|
+ isScrolling.value = false
|
|
|
+ if (WebApp?.HapticFeedback) {
|
|
|
+ WebApp.HapticFeedback.selectionChanged()
|
|
|
+ }
|
|
|
+}
|
|
|
+const handleTouchMove = (e) => {
|
|
|
+ const moveX = e.touches[0].pageX
|
|
|
+ const diffX = Math.abs(moveX - startX.value)
|
|
|
+
|
|
|
+ if (diffX > 10) {
|
|
|
+ isScrolling.value = true
|
|
|
+ if (e.cancelable) {
|
|
|
+ e.stopPropagation()
|
|
|
+ e.preventDefault()
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+const handleTouchEnd = () => {
|
|
|
+ isScrolling.value = false
|
|
|
+}
|
|
|
+onShow(async () => {
|
|
|
+ await getMyTeamsInfoFn()
|
|
|
+ await getShareCodeFn()
|
|
|
+ await getTeamInviteRewardsListFn()
|
|
|
+})
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.custom-scroll-view {
|