This commit is contained in:
Eudemon 2025-03-11 19:20:47 +08:00
parent 45112b2881
commit bdf990d569
20 changed files with 382 additions and 123 deletions

16
.env
View File

@ -1,16 +1,16 @@
VITE_APP_H5_NO=1 VITE_APP_H5_NO=1
VITE_CHANNEL_ID="" VITE_CHANNEL_ID=""
VITE_APP_NAME=Spinz777 # VITE_APP_NAME=Spinz777
# VITE_APP_NAME=Winzz777 VITE_APP_NAME=Winzz777
VITE_APP_THEME=red VITE_APP_THEME=red
VITE_APP_ID=101 # VITE_APP_ID=101
# VITE_APP_ID=103 VITE_APP_ID=103
VITE_APP_DOWNLOAD_URL="https://www.777spinz.com/spinz777_101_1.0.0.apk" # VITE_APP_DOWNLOAD_URL="https://www.777spinz.com/spinz777_101_1.0.0.apk"
# VITE_APP_DOWNLOAD_URL="https://www.777spinz.com/Winzz777_103_100.apk" VITE_APP_DOWNLOAD_URL="https://www.777spinz.com/Winzz777_103_100.apk"
VITE_APP_LOCALE=en VITE_APP_LOCALE=en
VITE_APP_IMAGE_URL="https://img1.sp77.in/frontimg" VITE_APP_IMAGE_URL="https://img1.sp77.in/frontimg"
VITE_WALLET_URL="https://inrchain.in/#/?inviteCode=m5ncrxv0" VITE_WALLET_URL="https://inrchain.in/#/?inviteCode=m5ncrxv0"
VITE_NAME_UPPER=SPINZ777 # VITE_NAME_UPPER=SPINZ777
# VITE_NAME_UPPER=WINZZ777 VITE_NAME_UPPER=WINZZ777
VITE_CURRENCY=INR VITE_CURRENCY=INR
VITE_CURRENCY_SYMBOL= VITE_CURRENCY_SYMBOL=

View File

@ -17,8 +17,8 @@
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />') (coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script> --> </script> -->
<title>Spinz777</title> <!-- <title>Spinz777</title> -->
<!-- <title>Winzz777</title> --> <title>Winzz777</title>
<!--preload-links--> <!--preload-links-->
<!--app-context--> <!--app-context-->
</head> </head>

View File

@ -6,8 +6,24 @@ const api = {
rollMsg: ipConfig.api_app + '/home/rollMsg', rollMsg: ipConfig.api_app + '/home/rollMsg',
bannerList: ipConfig.api_app + '/banner/list', bannerList: ipConfig.api_app + '/banner/list',
getService: ipConfig.api_app + '/service/index', getService: ipConfig.api_app + '/service/index',
checkUserBankrupt: ipConfig.api_app+ '/activity/bankruptcy/checkBankruptcy',
createBankruptRecharge: ipConfig.api_app+ '/activity/bankruptcy/createRecharge',
} }
export const createBankruptRechargeApi = (amount) => {
return httpRequest.post({
url: api.createBankruptRecharge,
data: {
amount
}
})
}
export const checkBankruptApi = () => {
return httpRequest.post({
url: api.checkUserBankrupt,
data: {}
})
}
/** /**
* 获取重置按钮状态 * 获取重置按钮状态
*/ */

View File

@ -52,7 +52,7 @@ import { usePromoStore } from '@/store/usePromoStore';
import { formatNum } from '@/module/utils/util'; import { formatNum } from '@/module/utils/util';
import toast from '@/module/toast/toast'; import toast from '@/module/toast/toast';
import { createRechargeApi } from '@/api/promo'; import { createRechargeApi } from '@/api/promo';
import { openUrl } from '@/module/utils/openUrl'; import { openWeb } from '@/module/utils/openUrl';
const popup = ref(null) const popup = ref(null)
const themeStore = useThemeStore() const themeStore = useThemeStore()
@ -70,7 +70,7 @@ const handleDeposit = async () => {
const amount = content.value[activeIndex.value].rechargeAmount const amount = content.value[activeIndex.value].rechargeAmount
const { data } = await createRechargeApi({ amount }) const { data } = await createRechargeApi({ amount })
uni.setStorageSync('rechargeAmount', amount) uni.setStorageSync('rechargeAmount', amount)
openUrl(data.url) openWeb(data.url)
toast.hideLoading() toast.hideLoading()
} catch (error) { } catch (error) {
console.log("deposit error: ", error); console.log("deposit error: ", error);

View File

@ -0,0 +1,189 @@
<script setup>
import { ref, computed } from 'vue'
import { useThemeStore } from '@/store/useThemeStore.js'
import { createBankruptRechargeApi } from '@/api/home'
import { formatNum } from '@/module/utils/util'
const props = defineProps({
detail: {
type: Array,
default: () => []
}
})
const themeStore = useThemeStore()
const theme = computed(() => themeStore.theme.greatRebet)
const popup = ref(null)
const currency = computed(() => import.meta.env.VITE_CURRENCY_SYMBOL)
const emit = defineEmits(['close'])
const open = () => {
popup.value.open()
}
const close = () => {
popup.value.close()
emit('close')
}
/**
*
* @param {number} num
*/
function transNumtoStrArr(num) {
if (!num || isNaN(num)) return []
return num.toString().split('')
}
const createOrder = async () => {
console.log('createOrder')
const { data } = await createBankruptRechargeApi();
console.log('createOrder', data);
}
const calAmount = (obj) => {
if(obj.recharge, obj.rate) {
return formatNum(obj.recharge * obj.rate + obj.recharge, 1)
}
return 0
}
defineExpose({
open,
close
})
</script>
<template>
<uni-popup ref="popup" type="center" :is-mask-click="false" mask-background-color="rgba(0,0,0,0.8)">
<view class="pop-content relative" :style="{ background: theme.popBg }">
<theme-image src="@/static/greatRebet/image_X.png" class="close pos-absolute" @click="close"></theme-image>
<view class="tip pos-absolute" :style="{ color: theme.tip }">{{ $t('home.greatRebet.tip') }}</view>
<view class="bonus left pos-absolute">
<view class="amount flex-center">
<!-- <theme-image src="@/static/greatRebet/lubi.png" class="icon-num"></theme-image>
<theme-image v-for="(item, index) in transNumtoStrArr(130)" :key="index" class="icon-num"
:src="`@/static/greatRebet/${item}.png`"></theme-image> -->
{{ currency }}{{ detail[0]['give'] }}
</view>
<view class="percent pos-absolute percent-left flex-center"
:style="{ background: theme.percentBg, color: theme.percent }">
<text>{{ formatNum(detail[0]['rate'] * 100, 1) }}</text>
<text style="font-size: 20rpx;">%</text>
</view>
</view>
<view class="bonus center pos-absolute">
<view class="amount flex-center">{{ currency }}{{ detail[1]['give'] }}</view>
<view class="percent percent-center pos-absolute flex-center"
:style="{ background: theme.percentBg, color: theme.percent }">
<text>{{ formatNum(detail[1]['rate'] * 100, 1) }}</text>
<text style="font-size: 20rpx;">%</text>
</view>
</view>
<view class="bonus right pos-absolute">
<view class="amount flex-center">{{ currency }}{{ detail[2]['give'] }}</view>
<view class="percent percent-right pos-absolute flex-center"
:style="{ background: theme.percentBg, color: theme.percent }">
<text>{{ formatNum(detail[2]['rate'] * 100, 1) }}</text>
<text style="font-size: 20rpx;">%</text>
</view>
</view>
<view class="btn-box pos-absolute flex justify-between w-full">
<view v-for="(item, index) in detail" :key="index" class="recharge-btn flex-center" :style="{ background: theme.btnBg, color: theme.light }"
@click.stop="createOrder(item.recharge)">{{ currency }}{{ item.recharge }}</view>
<!-- <view class="recharge-btn flex-center" :style="{ background: theme.btnBg, color: theme.light }"
@click.stop="createOrder">{{ currency }}22</view>
<view class="recharge-btn flex-center" :style="{ background: theme.btnBg, color: theme.light }"
@click.stop="createOrder">{{ currency }}33</view> -->
</view>
</view>
</uni-popup>
</template>
<style lang="scss" scoped>
.pop-content {
width: 737rpx;
height: 689rpx;
.close {
top: 0;
right: 60rpx;
width: 31rpx;
height: 31rpx;
}
.tip {
top: 134rpx;
left: 51%;
transform: translateX(-50%);
font-family: Roboto;
font-weight: 400;
font-size: 22rpx;
color: #FFCF72;
}
.left {
width: 180rpx;
height: 180rpx;
left: 66rpx;
top: 250rpx;
}
.center {
width: 204rpx;
height: 240rpx;
left: 50%;
transform: translateX(-50%);
top: 180rpx;
}
.right {
width: 180rpx;
height: 180rpx;
right: 60rpx;
top: 220rpx;
}
.icon-num {
width: 22rpx;
height: 34rpx;
}
.amount {
font-family: Roboto;
font-weight: bold;
font-size: 44rpx;
color: #FFFFFF;
// text-shadow: 1rpx 1rpx 4rpx #8A0A00;
background: linear-gradient(45deg, #F5FF60, #FFDE00, #FFFFFF 10%, #FFDE00, #F5FF60);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.percent {
width: 79rpx;
height: 79rpx;
font-size: 24rpx;
font-weight: bold;
transform: rotate(-15deg);
}
.percent-left {
top: -60rpx;
right: -20rpx;
}
.percent-center {
top: -20rpx;
right: -20rpx;
}
.percent-right {
top: -30rpx;
right: -30rpx;
}
.btn-box {
padding: 0 60rpx;
bottom: 180rpx;
.recharge-btn {
width: 176rpx;
height: 63rpx;
}
}
}
</style>

View File

@ -2,7 +2,7 @@
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
import { useThemeStore } from '@/store/useThemeStore' import { useThemeStore } from '@/store/useThemeStore'
import { usePromoStore } from '@/store/usePromoStore' import { usePromoStore } from '@/store/usePromoStore'
import { openUrl } from '@/module/utils/openUrl' import { openWeb } from '@/module/utils/openUrl'
import config from '@/config/global.config.js' import config from '@/config/global.config.js'
const promoStore = usePromoStore() const promoStore = usePromoStore()
@ -33,7 +33,7 @@ const toWheel = () => {
} }
const toTg = () => { const toTg = () => {
if (tgLink.value) { if (tgLink.value) {
openUrl(tgLink.value) openWeb(tgLink.value)
} }
} }

View File

@ -10,6 +10,9 @@ export default {
register: 'Register', register: 'Register',
award: 'Get', award: 'Get',
downloadSlogan: 'Download the App and bind your phone', downloadSlogan: 'Download the App and bind your phone',
popTip: 'Don\'t show today again' popTip: 'Don\'t show today again',
greatRebet: {
tip: 'Only this once'
}
} }
} }

View File

@ -1,10 +1,10 @@
{ {
/* Spinz777 */// /* Spinz777 *///
// "name" : "Winzz777", "name" : "Winzz777",
"name" : "Spinz777", // "name" : "Spinz777",
"appid" : "__UNI__FECBD22", "appid" : "__UNI__FECBD22",
// "description" : "Winzz777", "description" : "Winzz777",
"description" : "Spinz777", // "description" : "Spinz777",
"versionName" : "1.2.1", "versionName" : "1.2.1",
"versionCode" : 121, "versionCode" : 121,
"channel_list" : [ "channel_list" : [

View File

@ -1,5 +1,16 @@
import { useAppStore } from "@/store/useAppStore" import { useAppStore } from "@/store/useAppStore"
export const openWeb = (url) => {
if(!url) return;
// #ifdef WEB
requestAnimationFrame(() => {
window.open(url, '_blank')
})
// #endif
// #ifdef APP-PLUS
plus.runtime.openURL(url)
// #endif
}
export const openUrl = (url) => { export const openUrl = (url) => {
if (!url) { return } if (!url) { return }
// #ifdef H5 // #ifdef H5
@ -35,6 +46,6 @@ export const openUrl = (url) => {
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
// plus.runtime.openURL(url) // plus.runtime.openURL(url)
plus.runtime.openWeb(url) plus.runtime.openURL(url)
// #endif // #endif
} }

View File

@ -362,8 +362,8 @@
"globalStyle": { "globalStyle": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarTitleText": "Spinz777", // "navigationBarTitleText": "Spinz777",
// "navigationBarTitleText": "Winzz777", "navigationBarTitleText": "Winzz777",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"app-plus": { "app-plus": {

View File

@ -13,8 +13,7 @@
</template> </template>
<script setup> <script setup>
import { openUrl } from '@/module/utils/openUrl'; import { openUrl } from '@/module/utils/openUrl';
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
const info = uni.getWindowInfo(); const info = uni.getWindowInfo();
const handleOpen = () => { const handleOpen = () => {
@ -40,6 +39,7 @@ const handleBack = () => {
left: 0; left: 0;
z-index: 10; z-index: 10;
background-color: #80050A; background-color: #80050A;
height: 92rpx;
.header-image { .header-image {
@ -50,19 +50,19 @@ const handleBack = () => {
.back-area { .back-area {
position: absolute; position: absolute;
left: 30rpx; left: 10px;
top: 20rpx; top: 0;
width: 80rpx; width: 60px;
height: 60rpx; height: 50px;
z-index: 1000; z-index: 1000;
} }
.open-area { .open-area {
position: absolute; position: absolute;
right: 10rpx; right: 10px;
top: 15rpx; top: 0;
width: 180rpx; width: 220px;
height: 60rpx; height: 50px;
z-index: 1000; z-index: 1000;
} }
} }

View File

@ -106,10 +106,11 @@
@close="handleClose" /> @close="handleClose" />
<ConDepositPop ref="conDepositPop" @close="handleClose" /> <ConDepositPop ref="conDepositPop" @close="handleClose" />
<DepositBonus ref="depositBonusPop" @close="handleClose" /> <DepositBonus ref="depositBonusPop" @close="handleClose" />
<GreatRebet v-if="bankruptArr.length > 0" ref="greatPopRef" :detail="bankruptArr" @close="handleClose" />
<view v-if="showSlider" class="slider-bar" <view v-if="showSlider" class="slider-bar"
:style="{ right: -(col * singleItemWidth + 38) + 'rpx', transform: `translateX(${slideTranslateX}rpx)` }"> :style="{ right: -(col * singleItemWidth + 38) + 'rpx', transform: `translateX(${slideTranslateX}rpx)` }">
<view class="out-menu" @click="menuClick"> <view class="out-menu" @click="menuClick">
<theme-image src="@/static/home/zhankai.png" class="icon-slide-menu" /> <theme-image :src="`@/static/home/${slideOpen ? 'shouqi.png':'zhankai.png'}`" class="icon-slide-menu" />
<view class="red-dot" v-if="isDoted"></view> <view class="red-dot" v-if="isDoted"></view>
</view> </view>
<view class="slider-box" :style="{ width: slideWidth + 'rpx' }"> <view class="slider-box" :style="{ width: slideWidth + 'rpx' }">
@ -135,7 +136,7 @@ import { useThemeStore } from "@/store/useThemeStore";
import { useMailStore } from "@/store/useMailStore.js"; import { useMailStore } from "@/store/useMailStore.js";
import { useDepositStore } from "@/store/useDepositStore"; import { useDepositStore } from "@/store/useDepositStore";
import { usePromoStore } from "@/store/usePromoStore"; import { usePromoStore } from "@/store/usePromoStore";
import { requestBannerList, requestRechargeButtonStatus } from "@/api/home"; import { checkBankruptApi, requestBannerList, requestRechargeButtonStatus } from "@/api/home";
import { requestGetGameUrlByGame } from "@/api/game.js"; import { requestGetGameUrlByGame } from "@/api/game.js";
import HomeUserInfo from "./components/HomeUserInfo.vue"; import HomeUserInfo from "./components/HomeUserInfo.vue";
import HomeHeader from "./components/HomeHeader.vue"; import HomeHeader from "./components/HomeHeader.vue";
@ -153,7 +154,6 @@ import Jili from "./components/PromoPopup/Jili.vue"
import UserInfoPopUp from "./components/UserInfo.vue"; import UserInfoPopUp from "./components/UserInfo.vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { openUrl } from "@/module/utils/openUrl"; import { openUrl } from "@/module/utils/openUrl";
import promo from "../../locales/lang/en-US/promo";
// import StartLoading from "@/components/loading/StartLoading.vue" // import StartLoading from "@/components/loading/StartLoading.vue"
import { okSpin } from '@/module/third/okspin.js' import { okSpin } from '@/module/third/okspin.js'
import BindPhonePop from "@/components/popup/BindPhonePop.vue"; import BindPhonePop from "@/components/popup/BindPhonePop.vue";
@ -166,6 +166,7 @@ import toast from "@/module/toast/toast";
import ConDepositPop from "@/components/popup/ConDepositPop.vue"; import ConDepositPop from "@/components/popup/ConDepositPop.vue";
import DepositBonus from "@/components/popup/DepositBonus.vue"; import DepositBonus from "@/components/popup/DepositBonus.vue";
import WheelPop from "@/components/popup/WheelPop.vue"; import WheelPop from "@/components/popup/WheelPop.vue";
import GreatRebet from "@/components/popup/GreatRebet.vue";
import { checkRechargeActApi, checkRedepositApi } from "@/api/promo"; import { checkRechargeActApi, checkRedepositApi } from "@/api/promo";
const { t } = useI18n(); const { t } = useI18n();
@ -178,6 +179,7 @@ const depositStore = useDepositStore()
const promoStore = usePromoStore() const promoStore = usePromoStore()
const depositBonusRights = ref(false) const depositBonusRights = ref(false)
const awardPopup = ref(null) const awardPopup = ref(null)
const greatPopRef = ref(null)
const pageData = reactive({ const pageData = reactive({
// startLoadingVisible: true, // startLoadingVisible: true,
currentIndex: 0, currentIndex: 0,
@ -701,13 +703,57 @@ const onBindPhoneComplete = () => {
} }
} }
const bankruptArr = ref([])
const getUserBankrupt = async () => {
try {
const {data} = await checkBankruptApi()
console.log('getUserBankrupt:', data);
const {state, details} = data
if(state === 0) return
if(state === 1) {
const arr = details.sort((a, b) => a.recharge - b.recharge)
bankruptArr.value = [arr[0], arr[2], arr[1]]
popupArr.value.push(greatPopRef.value)
let dot = getDot('bankrupt_doted')
if(dot === '') {
setDot('bankrupt_doted', true)
dot = true
}
slideItems.value.push({
el: greatPopRef.value,
path: '',
icon: '@/static/pop_icons/animation_bx.gif',
doted: dot,
dotName: 'bankrupt_doted'
})
return
}
if(state === 2) {
let dot = getDot('bankrupt_doted')
if(dot === '') {
setDot('bankrupt_doted', true)
dot = true
}
slideItems.value.push({
el: greatPopRef.value,
path: '',
icon: '@/static/pop_icons/animation_bx.gif',
doted: dot,
dotName: 'bankrupt_doted'
})
}
} catch (error) {
console.log('getUserBankrupt error:', error);
}
}
onLoad(async () => { onLoad(async () => {
uni.hideTabBar(); uni.hideTabBar();
okSpin.login() okSpin.login()
getBanner(); getBanner();
await getUserBankrupt()
await checkUserAct(); await checkUserAct();
await promoStore.getPromoList()
checkRedepositApi().then(({ data }) => { checkRedepositApi().then(({ data }) => {
console.log("checkRedepositApi:", data); console.log("checkRedepositApi:", data);
if (data?.activity) { if (data?.activity) {
@ -762,12 +808,6 @@ onLoad(async () => {
}) })
} }
if (false) {
slideItems.value.push({
el: greatRebet.value,
icon: '@/static/pop_icons/animation_bx.gif'
})
}
const promoIdx = promoStore.promoList.findIndex(item => item.content?.popup === 'betrank') const promoIdx = promoStore.promoList.findIndex(item => item.content?.popup === 'betrank')
if (promoIdx !== -1) { if (promoIdx !== -1) {
// popupArr.value.push(rankRewardPop.value) // popupArr.value.push(rankRewardPop.value)
@ -791,7 +831,8 @@ onLoad(async () => {
showPopQueue() showPopQueue()
showSlider.value = true showSlider.value = true
slideOpen.value = true slideOpen.value = true
}, 1500); // greatPopRef.value.open()
}, 1000);
}); });

View File

@ -68,11 +68,11 @@ const handleClose = () => {
initData() initData()
} }
const handleConfirm = async () => { const handleConfirm = async () => {
showProgress.value = true // showProgress.value = true
await handleDownloadAndUpdate() // await handleDownloadAndUpdate()
plus.runtime.openURL(appStore.updateData.downloadUrl)
initData() initData()
} }
const handleDownloadAndUpdate = () => { const handleDownloadAndUpdate = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const dwTask = uni.downloadFile({ const dwTask = uni.downloadFile({

View File

@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
import { getPrizeByTgApi } from '@/api/promo'; import { getPrizeByTgApi } from '@/api/promo';
import Congratulation from '@/components/popup/Congratulation.vue'; import Congratulation from '@/components/popup/Congratulation.vue';
import toast from '@/module/toast/toast'; import toast from '@/module/toast/toast';
import { openUrl } from '@/module/utils/openUrl'; import { openWeb } from '@/module/utils/openUrl';
import { useThemeStore } from '@/store/useThemeStore'; import { useThemeStore } from '@/store/useThemeStore';
import { useUserStore } from '@/store/useUserStore'; import { useUserStore } from '@/store/useUserStore';
import BindPhonePop from '@/components/popup/BindPhonePop.vue'; import BindPhonePop from '@/components/popup/BindPhonePop.vue';
@ -21,7 +21,7 @@ const bindPhone = ref(null)
const appName = import.meta.env.VITE_APP_NAME const appName = import.meta.env.VITE_APP_NAME
const handleJoinNowClick = () => { const handleJoinNowClick = () => {
openUrl(userStore.tgLink) openWeb(userStore.tgLink)
} }
const confirmExchange = async () => { const confirmExchange = async () => {
if (inputCode.value === '') { if (inputCode.value === '') {

View File

@ -94,8 +94,7 @@
<script setup> <script setup>
import { useThemeStore } from "@/store/useThemeStore" import { useThemeStore } from "@/store/useThemeStore"
import { useAppStore } from "@/store/useAppStore" import { useAppStore } from "@/store/useAppStore"
import { onMounted, reactive } from "vue" import { openWeb } from "@/module/utils/openUrl"
import { openUrl } from "@/module/utils/openUrl"
import { usePromoStore } from '@/store/usePromoStore' import { usePromoStore } from '@/store/usePromoStore'
import { useUserStore } from "@/store/useUserStore" import { useUserStore } from "@/store/useUserStore"
@ -104,7 +103,7 @@ const appStore = useAppStore()
const promoStore = usePromoStore() const promoStore = usePromoStore()
const handleJoinNowClick = () => { const handleJoinNowClick = () => {
openUrl(useUserStore().tgLink) openWeb(useUserStore().tgLink)
} }
</script> </script>

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, computed, onMounted, nextTick } from 'vue'; import { ref, computed } from 'vue';
import { onLoad, onUnload } from '@dcloudio/uni-app'; import { onLoad, onUnload } from '@dcloudio/uni-app';
import { useThemeStore } from '@/store/useThemeStore'; import { useThemeStore } from '@/store/useThemeStore';
import { useAppStore } from '@/store/useAppStore'; import { useAppStore } from '@/store/useAppStore';
@ -18,18 +18,6 @@ const dw = computed(() => themeStore.theme.depositWheel);
const active = ref(0); const active = ref(0);
const imgBgs = [dw.value.wheelBg0, dw.value.wheelBg1, dw.value.wheelBg2, dw.value.wheelBg3]; const imgBgs = [dw.value.wheelBg0, dw.value.wheelBg1, dw.value.wheelBg2, dw.value.wheelBg3];
const statusBarHeight = ref(20) const statusBarHeight = ref(20)
// import sliverRing from '@/static/deposit_wheel/image_zpwk_silver.png'
// import goldRing from '@/static/deposit_wheel/image_zpwk_gold.png'
// import diamondRing from '@/static/deposit_wheel/image_zpwk_diamond.png'
// import supremeRing from '@/static/deposit_wheel/image_zpwk_supreme.png'
// import sliverPoint from '@/static/deposit_wheel/image_zhizhen_silver.png'
// import goldPoint from '@/static/deposit_wheel/image_zhizhen_gold.png'
// import diamondPoint from '@/static/deposit_wheel/image_zhizhen_diamond.png'
// import supremePoint from '@/static/deposit_wheel/image_zhizhen_supreme.png'
// import spinBg from '@/static/deposit_wheel/image_zpdk.png'
// import jinbi from '@/static/deposit_wheel/image_jinbi.png'
// import zhibi from '@/static/deposit_wheel/image_zhibi.png'
const imgPaths = [ const imgPaths = [
config.canvasImage + '/deposit_wheel/image_zpwk_silver.png', config.canvasImage + '/deposit_wheel/image_zpwk_silver.png',
config.canvasImage + '/deposit_wheel/image_zpwk_gold.png', config.canvasImage + '/deposit_wheel/image_zpwk_gold.png',
@ -74,7 +62,7 @@ const currency = computed(() => import.meta.env.VITE_CURRENCY_SYMBOL)
const currency2 = ref('') const currency2 = ref('')
const percent = ref(0) const percent = ref(0)
const autoRotation = ref(0); const autoRotation = ref(0);
const isAutoRotating = ref(true); const isAutoRotating = ref(false);
const autoRotateSpeed = 0.003; const autoRotateSpeed = 0.003;
const sliceWidth = ref(0); const sliceWidth = ref(0);
const totalW = ref(0); const totalW = ref(0);
@ -221,25 +209,28 @@ const slideToIndex = (index) => {
const easeInOutQuad = (t) => { const easeInOutQuad = (t) => {
return t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2; return t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
}; };
function drawSpin(context, rotation) {
const actualRotation = isAutoRotating.value && !isSpinning.value ? autoRotation.value : rotation;
const center = size / 2;
const innerCenter = innerSize / 2;
context.translate(center, center);
context.rotate(actualRotation);
context.translate(-center, -center);
context.drawImage(spinBg, center - innerCenter, center - innerCenter, innerSize, innerSize);
}
function drawWheel(rotation = 0, wheelIndex = active.value) { function drawWheel(rotation = 0, wheelIndex = active.value) {
const actualRotation = isAutoRotating.value && !isSpinning.value ? autoRotation.value : rotation; const actualRotation = isAutoRotating.value && !isSpinning.value ? autoRotation.value : rotation;
wheelRotations.value[wheelIndex] = actualRotation; wheelRotations.value[wheelIndex] = actualRotation;
const context = uni.createCanvasContext(wheelCanvasIds[wheelIndex]); const context = uni.createCanvasContext(wheelCanvasIds[wheelIndex]);
wheelContexts.value[wheelIndex] = context; wheelContexts.value[wheelIndex] = context;
const center = size / 2; const center = size / 2;
const innerCenter = innerSize / 2;
const radius = center - 10; const radius = center - 10;
// const sliceAngle = (2 * Math.PI) / prizes.value.length;
const sliceAngle = (2 * Math.PI) / activityContent.value[wheelIndex].prizes.length; const sliceAngle = (2 * Math.PI) / activityContent.value[wheelIndex].prizes.length;
context.clearRect(0, 0, size, size); context.clearRect(0, 0, size, size);
context.save(); context.save();
context.translate(center, center); drawSpin(context, rotation);
context.rotate(actualRotation);
context.translate(-center, -center);
context.drawImage(spinBg, center - innerCenter, center - innerCenter, innerSize, innerSize);
for (let index = 0, len = prizes.value.length; index < len; index++) { for (let index = 0, len = prizes.value.length; index < len; index++) {
// const prize = prizes.value[index]; // const prize = prizes.value[index];
@ -325,14 +316,13 @@ function drawWheel(rotation = 0, wheelIndex = active.value) {
wheelsDrawnComplete.value = true; wheelsDrawnComplete.value = true;
// //
setTimeout(() => { setTimeout(() => {
isAutoRotating.value = true;
startAutoRotate(); startAutoRotate();
}, 1000); // UI }, 1000); // UI
} }
}); });
} }
const calculateTargetRotation = (targetIndex) => { const calculateTargetRotation = (targetIndex) => {
// Calculate base rotation needed to align the target index // Calculate base rotation needed to align the target index
const sliceAngle = (2 * Math.PI) / prizes.value.length; const sliceAngle = (2 * Math.PI) / prizes.value.length;
@ -350,11 +340,14 @@ const calculateTargetRotation = (targetIndex) => {
return extraRotations + baseAngle; return extraRotations + baseAngle;
}; };
const startAutoRotate = () => { const startAutoRotate = () => {
if (!isAutoRotating.value || isSpinning.value) return; // if(!isAutoRotating.value) {
// return;
// }
console.log("startAutoRotate", isAutoRotating.value, isSpinning.value, wheelsDrawnComplete.value);
if (isAutoRotating.value || isSpinning.value || !wheelsDrawnComplete.value) return;
isAutoRotating.value = true;
const animate = () => { const animate = () => {
if (!isAutoRotating.value || isSpinning.value) return;
// //
autoRotation.value += autoRotateSpeed; autoRotation.value += autoRotateSpeed;
// 0-2π // 0-2π
@ -373,17 +366,17 @@ const startAutoRotate = () => {
requestAnimationFrame(animate); requestAnimationFrame(animate);
// #endif // #endif
// #ifndef H5 // #ifndef H5
autoTimer = setTimeout(animate, 16.6); setTimeout(animate, 16.6);
// #endif // #endif
}; };
console.log("startAutoRotate animate", isAutoRotating.value);
animate(); animate();
}; };
const startSpin = async () => { const startSpin = async () => {
if (isSpinning.value) return; if (isSpinning.value) return;
isSpinning.value = true;
isAutoRotating.value = false; isAutoRotating.value = false;
wheelsDrawnComplete.value = true; wheelsDrawnComplete.value = true;
isSpinning.value = true;
// If targetIndex is provided and valid, use it; otherwise random // If targetIndex is provided and valid, use it; otherwise random
let finalIndex; let finalIndex;
if (targetIndex >= 0 && targetIndex < prizes.value.length) { if (targetIndex >= 0 && targetIndex < prizes.value.length) {
@ -426,6 +419,7 @@ const startSpin = async () => {
awardAmount.value = typeEnum[prize.type] + ' x ' + prizes.value[finalIndex].amount awardAmount.value = typeEnum[prize.type] + ' x ' + prizes.value[finalIndex].amount
} }
awardPopup.value?.open() awardPopup.value?.open()
// drawWheel(rotationResult.value);
// TODO emit('spin-end', prizes.value[finalIndex]); // TODO emit('spin-end', prizes.value[finalIndex]);
} }
@ -437,19 +431,6 @@ const startSpin = async () => {
const easeOut = (t) => { const easeOut = (t) => {
return 1 - Math.pow(1 - t, 5); return 1 - Math.pow(1 - t, 5);
}; };
async function loadImg(src) {
return new Promise((resolve, reject) => {
uni.getImageInfo({
src,
success: (res) => {
resolve(res);
},
fail: (err) => {
reject(err);
},
});
})
}
const calPercent = () => { const calPercent = () => {
const stepItem = activityContent.value[active.value] const stepItem = activityContent.value[active.value]
const val = Math.ceil((rechargeAmount.value / stepItem.amounts[stepItem.amounts.length - 1]) * 100) const val = Math.ceil((rechargeAmount.value / stepItem.amounts[stepItem.amounts.length - 1]) * 100)
@ -532,12 +513,14 @@ const onClose = async () => {
// isSpinning.value = false; // isSpinning.value = false;
await getRedepositAct() await getRedepositAct()
// drawWheel() // drawWheel()
setTimeout(() => {
isSpinning.value = false; isSpinning.value = false;
isAutoRotating.value = true;
wheelsDrawnComplete.value = false; wheelsDrawnComplete.value = false;
startAutoRotate(); // startAutoRotate();
}, 1000); // setTimeout(() => {
// isSpinning.value = false;
// wheelsDrawnComplete.value = false;
// startAutoRotate();
// }, 1000);
} }
const toRules = () => { const toRules = () => {
uni.navigateTo({ url: '/pages/redeposit/WheelRules' }) uni.navigateTo({ url: '/pages/redeposit/WheelRules' })
@ -549,41 +532,49 @@ const depositNow = () => {
uni.navigateTo({ url: '/pages/wallet/Deposit' }) uni.navigateTo({ url: '/pages/wallet/Deposit' })
} }
onLoad(async () => { function start() {
await getRedepositAct()
// await drawWheel();
const windowInfo = uni.getWindowInfo(); const windowInfo = uni.getWindowInfo();
statusBarHeight.value = windowInfo.statusBarHeight; statusBarHeight.value = windowInfo.statusBarHeight;
const w = windowInfo.windowWidth; const w = windowInfo.windowWidth;
const space = (w - size) / 2; const space = (w - size) / 2;
const _sliceWidth = space + size;
// const _totalW = _sliceWidth * (rechargeAmount.value > 1777 ? 4 : 3);
sliceWidth.value = sliceWidth.value = w * 0.8;; sliceWidth.value = sliceWidth.value = w * 0.8;;
canvasSpace.value = space / 2; canvasSpace.value = space / 2;
const visibleWheels = rechargeAmount.value > 1777 ? 4 : 3; const visibleWheels = rechargeAmount.value > 1777 ? 4 : 3;
sliceWidth.value = w * 0.68; sliceWidth.value = w * 0.68;
totalW.value = sliceWidth.value * visibleWheels; totalW.value = sliceWidth.value * visibleWheels;
const initialOffset = (w - sliceWidth.value) / 2; const initialOffset = (w - sliceWidth.value) / 2;
translateX.value = initialOffset; translateX.value = initialOffset;
nextTick(() => {
// reset status // reset status
wheelDrawnStatus.value = [false, false, false, false]; wheelDrawnStatus.value = [false, false, false, false];
wheelsDrawnComplete.value = false; wheelsDrawnComplete.value = false;
isAutoRotating.value = false; // // isAutoRotating.value = false; //
setTimeout(() => {
console.log("setTimeout---------");
for (let i = 0; i < wheelCanvasIds.length; i++) { for (let i = 0; i < wheelCanvasIds.length; i++) {
if (activityContent.value[i]) { if (activityContent.value[i]) {
drawWheel(0, i); drawWheel(0, i);
} }
} }
// startAutoRotate(); }, 600);
})
}); }
// onLoad(async () => {
// console.log("mounted---------");
// await getRedepositAct()
// start()
// });
onLoad(async () => {
console.log("mounted---------");
await getRedepositAct()
start()
})
onUnload(() => { onUnload(() => {
isAutoRotating.value = false; isAutoRotating.value = false;
clearTimeout(autoTimer); // clearTimeout(autoTimer);
}); });
</script> </script>
<template> <template>
@ -644,7 +635,7 @@ onUnload(() => {
</template> </template>
<template v-else> <template v-else>
<view class="upto">upto</view> <view class="upto">upto</view>
<view class="amount">3777</view> <view class="amount">{{ currency }}3777</view>
</template> </template>
<theme-image v-if="disabledIndex <= 3" class="icon-lock" <theme-image v-if="disabledIndex <= 3" class="icon-lock"
src="@/static/deposit_wheel/image_lock.png" /> src="@/static/deposit_wheel/image_lock.png" />

View File

@ -57,9 +57,10 @@ onUnmounted(() => {
// } // }
// }) // })
const getRoll = async () => { const getRoll = () => {
const { data } = await getLotteryMsgApi() getLotteryMsgApi().then(({data}) => {
rollMsg.value = data rollMsg.value = data
})
// if (props.rollMsg && props.rollMsg?.length > 0) { // if (props.rollMsg && props.rollMsg?.length > 0) {
// return '' // return ''

View File

@ -254,7 +254,7 @@ import { requestAppEventUpload } from "@/api/app.js";
import { useAppStore } from "@/store/useAppStore"; import { useAppStore } from "@/store/useAppStore";
import { useThemeStore } from "@/store/useThemeStore"; import { useThemeStore } from "@/store/useThemeStore";
import { useUserStore } from "@/store/useUserStore"; import { useUserStore } from "@/store/useUserStore";
import { openUrl } from '@/module/utils/openUrl.js' import { openWeb } from '@/module/utils/openUrl.js'
import HomeUserInfo from "@/pages/home/components/HomeUserInfo.vue"; import HomeUserInfo from "@/pages/home/components/HomeUserInfo.vue";
import VipItem from "../account/components/VipItem/VipItem.vue"; import VipItem from "../account/components/VipItem/VipItem.vue";
@ -333,7 +333,7 @@ const deposit = () => {
} }
const openCustomer = () => { const openCustomer = () => {
openUrl(userStore.serviceUrl) openWeb(userStore.serviceUrl)
} }
</script> </script>

View File

@ -136,7 +136,7 @@ export const useAppStore = defineStore({
updateText: '', updateText: '',
updateType: 0 updateType: 0
}, },
packageName: 'uni.UNIFECBD22',//101 Spinz777 // packageName: 'uni.UNIFECBD22',//101 Spinz777
// packageName: 'uni.UNIFECBD22', //102 // packageName: 'uni.UNIFECBD22', //102
packageName: 'com.kllksgqoCasw3d.game',//103 Winzz777 packageName: 'com.kllksgqoCasw3d.game',//103 Winzz777
}), }),

View File

@ -588,5 +588,13 @@ export default {
awardBg: `top / contain no-repeat url('${imgSrc}/deposit_wheel/fenleidk.png')`, awardBg: `top / contain no-repeat url('${imgSrc}/deposit_wheel/fenleidk.png')`,
rewardBg: `top / contain no-repeat url('${imgSrc}/deposit_wheel/rewards_dk.png')`, rewardBg: `top / contain no-repeat url('${imgSrc}/deposit_wheel/rewards_dk.png')`,
recordBgLinear: 'linear-gradient(0deg, #5A0600, #660A00)', recordBgLinear: 'linear-gradient(0deg, #5A0600, #660A00)',
},
greatRebet: {
light: '#ffffff',
popBg: `top / contain no-repeat url('${imgSrc}/greatRebet/image_dk.png')`,
btnBg: `top / contain no-repeat url('${imgSrc}/greatRebet/btn_gm.png')`,
percentBg: `top / contain no-repeat url('${imgSrc}/greatRebet/image_zhekou.png')`,
percent:' #FCDB53',
tip: '#FFCF72'
} }
} }