st 2 месяцев назад
Родитель
Сommit
31fa5e9c97

+ 2 - 1
env/.env

@@ -8,13 +8,14 @@ VITE_WX_APPID = 'wxa2abb91f64032a2b'
 VITE_APP_PUBLIC_BASE=/tonmini/
 
 VITE_SERVER_BASEURL = 'https://www.strayblock.top/'
+#VITE_SERVER_BASEURL = 'https://xoyozi9walh9.xiaomiqiu.com/app/'
 VITE_UPLOAD_BASEURL = 'https://www.strayblock.top/'
 
 # h5是否需要配置代理
 VITE_APP_PROXY=true
 VITE_APP_PROXY_PREFIX = '/app'
 
-VITE_TELEGRAM_BASEURL = 'https://guitarcoin.app'
+VITE_TELEGRAM_BASEURL = 'https://www.strayblock.top'
 VITE_TELEGRAM_BOOTNAME = 'st_prprpr_bot'
 
 VITE_PRIVATE_KEY = '00C83135E19EBD958593091F42A3442DE3D03D975A5DBD4CE19F85C9FBF2D364B7'

+ 3 - 1
src/locale/es.json

@@ -203,5 +203,7 @@
   "purse.Props": "Propiedades",
   "purse.Production": "Producción",
   "purse.Ticket": "Obtener Ticket",
-  "purse.SPIN": "GIRO"
+  "purse.SPIN": "GIRO",
+  "production.game": "juego",
+  "production.top": "¡el nivel es el más alto!"
 }

+ 3 - 1
src/locale/ja.json

@@ -207,5 +207,7 @@
   "purse.Props": "プロップ",
   "purse.Production": "生産",
   "purse.Ticket": "チケットを取得",
-  "purse.SPIN": "スピン"
+  "purse.SPIN": "スピン",
+  "production.game": "ゲーム",
+  "production.top": "レベルは最高です!"
 }

+ 3 - 1
src/locale/ko.json

@@ -207,5 +207,7 @@
   "purse.Props": "프로퍼티",
   "purse.Production": "생산",
   "purse.Ticket": "티켓 구하기",
-  "purse.SPIN": "스핀"
+  "purse.SPIN": "스핀",
+  "production.game": "게임",
+  "production.top": "레벨이 최상입니다!"
 }

+ 3 - 1
src/locale/pt.json

@@ -203,5 +203,7 @@
   "purse.Props": "Props",
   "purse.Production": "Produção",
   "purse.Ticket": "Obter Ticket",
-  "purse.SPIN": "GIRO"
+  "purse.SPIN": "GIRO",
+  "production.game": "jogo",
+  "production.top": "o nível é o mais alto!"
 }

+ 3 - 1
src/locale/ru.json

@@ -207,5 +207,7 @@
   "purse.Props": "Предметы",
   "purse.Production": "Производство",
   "purse.Ticket": "Получение билета",
-  "purse.SPIN": "Вращение"
+  "purse.SPIN": "Вращение",
+  "production.game": "игра",
+  "production.top": "уровень на самом верху!"
 }

+ 3 - 1
src/locale/th.json

@@ -207,5 +207,7 @@
   "purse.Props": "เครื่องมือ",
   "purse.Production": "การผลิต",
   "purse.Ticket": "รับตั๋ว",
-  "purse.SPIN": "วงจรเครื่องผลิต"
+  "purse.SPIN": "วงจรเครื่องผลิต",
+  "production.game": "เกม",
+  "production.top": "ระดับคือระดับสูงสุด!"
 }

+ 3 - 1
src/locale/vi.json

@@ -207,5 +207,7 @@
   "purse.Props": "Vật phẩm",
   "purse.Production": "Sản xuất",
   "purse.Ticket": "Lấy vé",
-  "purse.SPIN": "Quay"
+  "purse.SPIN": "Quay",
+  "production.game": "trò chơi",
+  "production.top": "cấp độ là cao nhất!"
 }

+ 3 - 1
src/locale/zh-tw.json

@@ -202,5 +202,7 @@
   "purse.Props": "道具",
   "purse.Production": "生產",
   "purse.Ticket": "獲取門票",
-  "purse.SPIN": "旋轉"
+  "purse.SPIN": "旋轉",
+  "production.game": "遊戲",
+  "production.top": "等級是最高的!"
 }

+ 1 - 1
src/main.ts

@@ -7,7 +7,7 @@ import { routeInterceptor, requestInterceptor, prototypeInterceptor } from './in
 import 'virtual:uno.css'
 import '@/style/index.scss'
 
-// import '@/utils/vConsole'
+import '@/utils/vConsole'
 
 export function createApp() {
   const app = createSSRApp(App)

+ 4 - 3
src/pages/index/index.vue

@@ -490,7 +490,7 @@ const upRules = async (upgradeType: 'coin' | 'currency') => {
 // 星星
 const stars = ref([])
 const visibleStars = ref([])
-const totalStars = 50
+const totalStars = 30
 const addInterval = 100 // 每100ms添加一颗星星
 let addStarTimer = null
 
@@ -595,6 +595,7 @@ const addStarsGradually = () => {
   --rotate: 0deg;
   --scale: 1;
   filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
+  will-change: transform, opacity;
   animation:
     star-appear 0.5s ease-out forwards,
     star-fall var(--duration) linear infinite var(--delay);
@@ -613,7 +614,7 @@ const addStarsGradually = () => {
 
 @keyframes star-fall {
   0% {
-    transform: translateZ(-100px) translateX(0) translateY(0) rotate(0deg) scale(var(--scale));
+    transform: translateZ(0) translateX(0) translateY(0) rotate(0deg) scale(var(--scale));
   }
   10% {
     transform: translateZ(0) translateX(-50px) translateY(50px) rotate(var(--rotate))
@@ -625,7 +626,7 @@ const addStarsGradually = () => {
   }
   100% {
     opacity: 0;
-    transform: translateZ(100px) translateX(-200px) translateY(500px) rotate(var(--rotate))
+    transform: translateZ(0) translateX(-200px) translateY(500px) rotate(var(--rotate))
       scale(var(--scale));
   }
 }

+ 100 - 5
src/pages/task/index.vue

@@ -33,7 +33,7 @@
     </view>
     <view class="w-690rpx flex flex-col items-center mb-120rpx">
       <view
-        v-for="(item, index) in 10"
+        v-for="(item, index) in taskInfoList"
         :key="index"
         class="w-full h-full mt-20rpx bg-cardlight rounded-20rpx flex justify-between"
       >
@@ -46,22 +46,24 @@
             />
           </view>
           <view class="flex flex-col justify-center ml-15rpx text-[#fff] flex-1">
-            <text class="text-[28rpx] font-700">加入频道</text>
+            <text class="text-[28rpx] font-700">{{ item.name }}</text>
             <view class="mt-10rpx">
               <image
                 src="@/static/images/trophy/jinbi.png"
                 class="w-30rpx h-30rpx"
                 mode="scaleToFill"
               />
-              <text class="fw-400 ml-10rpx text-26rpx">+1111</text>
+              <text class="fw-400 ml-10rpx text-26rpx">+{{ item.goldCoin }}</text>
             </view>
           </view>
-          <view class="flex flex-col justify-center mr-20rpx">
+          <view class="flex flex-col justify-center mr-20rpx" @click="linkUrl(item)">
             <view class="w-160rpx text-center">
               <view
                 class="w-160rpx h-60rpx bg-primary rounded-10rpx flex items-center justify-center"
               >
-                <text class="text-26rpx font-700">check</text>
+                <text class="text-26rpx font-700 text-textc">
+                  {{ taskStatus[item.userTaskStatus] }}
+                </text>
               </view>
             </view>
           </view>
@@ -69,10 +71,35 @@
       </view>
     </view>
   </view>
+  <Dialog v-model:show-value="lingquShow" width="690rpx" height="577rpx">
+    <view class="flex text-white flex-col items-center mt-90rpx">
+      <image src="@/static/images/team/jinbi.png" class="w-100rpx h-100rpx"></image>
+      <text class="text-36rpx font-700 mt-30rpx text-center w-630rpx">
+        {{ $t('task.Congratulation') }}
+      </text>
+      <view class="mt-40rpx flex items-center">
+        <image src="@/static/images/team/jinbi.png" class="w-30rpx h-30rpx mr-10rpx"></image>
+        <text class="text-white text-26rpx font-400">+{{ currentLibaoData?.goldCoin }}</text>
+      </view>
+      <view
+        @click="lingqu"
+        class="text-textc w-630rpx h-100rpx rounded-20rpx mt-30rpx bg-primary flex items-center justify-center text-white"
+      >
+        {{ $t('index.Ok') }}
+      </view>
+    </view>
+  </Dialog>
   <tabbar currentTab="pages/task/index"></tabbar>
 </template>
 <script setup lang="ts">
 import tabbar from '@/components/TabBar/index.vue'
+import { getTaskInfoList, handleTask, TaskInfo } from '@/service/task'
+import i18n from '@/locale/index'
+import Dialog from '@/components/common/Dialog/index.vue'
+import { openExternalLink } from '@/utils/temlgram'
+import { useNotify } from 'wot-design-uni'
+
+const { showNotify } = useNotify()
 
 type Tab = 'one' | 'two'
 const activeTab = ref<Tab>('one')
@@ -81,9 +108,77 @@ const activeTab = ref<Tab>('one')
 const changeActiveTab = async (tab: Tab) => {
   activeTab.value = tab
   if (tab === 'one') {
+    await getTaskInfoListFn('1')
   } else if (tab === 'two') {
+    await getTaskInfoListFn('2')
+  }
+}
+const taskInfoList = ref<TaskInfo[]>([])
+const getTaskInfoListFn = async (type: string) => {
+  // 获取任务列表
+  const { data } = await getTaskInfoList(type)
+  console.info('🚀 ~ file:index method:getTaskInfoListFn line:91 -----', data)
+  taskInfoList.value = data
+}
+onShow(async () => {
+  activeTab.value = 'one'
+  await getTaskInfoListFn('1')
+})
+const taskStatus = ref({
+  0: i18n.global.t('task.Start'),
+  1: i18n.global.t('task.Claim'),
+  2: i18n.global.t('play.Go'),
+})
+const up = () => {
+  taskStatus.value = {
+    0: i18n.global.t('task.Start'),
+    1: i18n.global.t('task.Claim'),
+    2: i18n.global.t('play.Go'),
   }
 }
+watch(
+  () => i18n.global.locale,
+  () => {
+    up()
+  },
+  {
+    deep: true,
+  },
+)
+const lingquShow = ref(false)
+const currentLibaoData = ref<TaskInfo>()
+const linkUrl = async (item: TaskInfo) => {
+  currentLibaoData.value = item
+  console.info('🚀 ~ file:index method:linkUrl line:151 -----', currentLibaoData.value)
+  if (item.userTaskStatus === 0) {
+    if (item.taskLink != null && item.taskLink !== '') {
+      openExternalLink(item.taskLink)
+    }
+    await handleTaskFn(item.id)
+  }
+  if (item.userTaskStatus === 2) {
+    if (item.taskLink != null && item.taskLink !== '') {
+      openExternalLink(item.taskLink)
+    }
+    return
+  }
+  if (item.userTaskStatus === 1) {
+    lingquShow.value = true
+  }
+}
+const handleTaskFn = async (id: string) => {
+  const { code, msg } = await handleTask(id)
+  if (code === 1) {
+    showNotify({ type: 'success', message: msg })
+  } else {
+    showNotify({ type: 'warning', message: msg })
+  }
+  await getTaskInfoListFn(activeTab.value === 'one' ? '1' : '2')
+}
+const lingqu = async () => {
+  await handleTaskFn(currentLibaoData.value.id)
+  lingquShow.value = false
+}
 </script>
 <style lang="scss" scoped>
 .tab-bg {

+ 21 - 0
src/service/task/index.ts

@@ -0,0 +1,21 @@
+import { httpPost } from '@/utils/http'
+export interface TaskInfo {
+  id?: string // 任务id <int64>
+  name?: string // 任务名称
+  instruction?: string // 任务说明
+  taskIcon?: string // 任务图标
+  taskLink?: string // 任务链接
+  categoryCode?: string // 任务分类编码
+  goldCoin?: number // 金币数量
+  sortNum?: number // 排序
+  userTaskStatus?: number // 用户任务状态
+}
+// 获取任务列表
+export const getTaskInfoList = (categoryCode: string) => {
+  return httpPost<TaskInfo[]>('/app/task/getTaskInfoList', { categoryCode })
+}
+
+// 获取任务列表
+export const handleTask = (taskId: string) => {
+  return httpPost<TaskInfo[]>('/app/task/handleTask', { taskId })
+}

+ 5 - 89
src/types/auto-import.d.ts

@@ -98,7 +98,7 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }
 // for vue template auto import
@@ -162,6 +162,7 @@ declare module 'vue' {
     readonly onUnload: UnwrapRef<typeof import('@dcloudio/uni-app')['onUnload']>
     readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
     readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
+    readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
     readonly provide: UnwrapRef<typeof import('vue')['provide']>
     readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
     readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
@@ -180,98 +181,13 @@ declare module 'vue' {
     readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
     readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
     readonly useGameTimer: UnwrapRef<typeof import('../hooks/useGameTimer')['useGameTimer']>
+    readonly useId: UnwrapRef<typeof import('vue')['useId']>
     readonly useImgPath: UnwrapRef<typeof import('../hooks/useImgPath')['useImgPath']>
+    readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
     readonly useRequest: UnwrapRef<typeof import('../hooks/useRequest')['default']>
     readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
     readonly useTelegramBackButton: UnwrapRef<typeof import('../hooks/useTelegramBackButton')['useTelegramBackButton']>
-    readonly useUpload: UnwrapRef<typeof import('../hooks/useUpload')['default']>
-    readonly watch: UnwrapRef<typeof import('vue')['watch']>
-    readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
-    readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
-    readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
-  }
-}
-declare module '@vue/runtime-core' {
-  interface GlobalComponents {}
-  interface ComponentCustomProperties {
-    readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
-    readonly computed: UnwrapRef<typeof import('vue')['computed']>
-    readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
-    readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
-    readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
-    readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
-    readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
-    readonly formatAmount: UnwrapRef<typeof import('../hooks/moneyProcessing')['formatAmount']>
-    readonly formatAmountNoFloat: UnwrapRef<typeof import('../hooks/moneyProcessing')['formatAmountNoFloat']>
-    readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
-    readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
-    readonly h: UnwrapRef<typeof import('vue')['h']>
-    readonly inject: UnwrapRef<typeof import('vue')['inject']>
-    readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
-    readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
-    readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
-    readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
-    readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
-    readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
-    readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
-    readonly onAddToFavorites: UnwrapRef<typeof import('@dcloudio/uni-app')['onAddToFavorites']>
-    readonly onBackPress: UnwrapRef<typeof import('@dcloudio/uni-app')['onBackPress']>
-    readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
-    readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
-    readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
-    readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
-    readonly onError: UnwrapRef<typeof import('@dcloudio/uni-app')['onError']>
-    readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
-    readonly onHide: UnwrapRef<typeof import('@dcloudio/uni-app')['onHide']>
-    readonly onLaunch: UnwrapRef<typeof import('@dcloudio/uni-app')['onLaunch']>
-    readonly onLoad: UnwrapRef<typeof import('@dcloudio/uni-app')['onLoad']>
-    readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
-    readonly onNavigationBarButtonTap: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarButtonTap']>
-    readonly onNavigationBarSearchInputChanged: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputChanged']>
-    readonly onNavigationBarSearchInputClicked: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputClicked']>
-    readonly onNavigationBarSearchInputConfirmed: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputConfirmed']>
-    readonly onNavigationBarSearchInputFocusChanged: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputFocusChanged']>
-    readonly onPageNotFound: UnwrapRef<typeof import('@dcloudio/uni-app')['onPageNotFound']>
-    readonly onPageScroll: UnwrapRef<typeof import('@dcloudio/uni-app')['onPageScroll']>
-    readonly onPullDownRefresh: UnwrapRef<typeof import('@dcloudio/uni-app')['onPullDownRefresh']>
-    readonly onReachBottom: UnwrapRef<typeof import('@dcloudio/uni-app')['onReachBottom']>
-    readonly onReady: UnwrapRef<typeof import('@dcloudio/uni-app')['onReady']>
-    readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
-    readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
-    readonly onResize: UnwrapRef<typeof import('@dcloudio/uni-app')['onResize']>
-    readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
-    readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
-    readonly onShareAppMessage: UnwrapRef<typeof import('@dcloudio/uni-app')['onShareAppMessage']>
-    readonly onShareTimeline: UnwrapRef<typeof import('@dcloudio/uni-app')['onShareTimeline']>
-    readonly onShow: UnwrapRef<typeof import('@dcloudio/uni-app')['onShow']>
-    readonly onTabItemTap: UnwrapRef<typeof import('@dcloudio/uni-app')['onTabItemTap']>
-    readonly onThemeChange: UnwrapRef<typeof import('@dcloudio/uni-app')['onThemeChange']>
-    readonly onUnhandledRejection: UnwrapRef<typeof import('@dcloudio/uni-app')['onUnhandledRejection']>
-    readonly onUnload: UnwrapRef<typeof import('@dcloudio/uni-app')['onUnload']>
-    readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
-    readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
-    readonly provide: UnwrapRef<typeof import('vue')['provide']>
-    readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
-    readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
-    readonly ref: UnwrapRef<typeof import('vue')['ref']>
-    readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
-    readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
-    readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
-    readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
-    readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
-    readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
-    readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
-    readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
-    readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
-    readonly unref: UnwrapRef<typeof import('vue')['unref']>
-    readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
-    readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
-    readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
-    readonly useGameTimer: UnwrapRef<typeof import('../hooks/useGameTimer')['useGameTimer']>
-    readonly useImgPath: UnwrapRef<typeof import('../hooks/useImgPath')['useImgPath']>
-    readonly useRequest: UnwrapRef<typeof import('../hooks/useRequest')['default']>
-    readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
-    readonly useTelegramBackButton: UnwrapRef<typeof import('../hooks/useTelegramBackButton')['useTelegramBackButton']>
+    readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
     readonly useUpload: UnwrapRef<typeof import('../hooks/useUpload')['default']>
     readonly watch: UnwrapRef<typeof import('vue')['watch']>
     readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>