Просмотр исходного кода

feat(djk): 添加福利弹窗功能并集成wot-design组件

添加了WdCurtain组件到项目中,并实现了福利领取弹窗功能,
包括用户登录后自动获取福利信息并在首页展示弹窗提示

BREAKING CHANGE: API类型定义从全局命名空间迁移到Api模块下
zhangtao 3 дней назад
Родитель
Сommit
92e3c8ef92

+ 6 - 6
src/api/globals.d.ts

@@ -1053,21 +1053,21 @@ declare global {
         config: Config
       ): Alova2Method<apiResData<string>, 'djk.djkAppletOrderConfirm', Config>;
       welfareList<
-        Config extends Alova2MethodConfig<apiResData<DjkWelfareVO[]>> & {
+        Config extends Alova2MethodConfig<apiResData<Api.DjkWelfareVO[]>> & {
 
         }
       >(
         config: Config
-      ): Alova2Method<apiResData<DjkWelfareVO[]>, 'djk.welfareList', Config>;
+      ): Alova2Method<apiResData<Api.DjkWelfareVO[]>, 'djk.welfareList', Config>;
       welfareInfo<
-        Config extends Alova2MethodConfig<apiResData<DjkWelfareVO>> & {
+        Config extends Alova2MethodConfig<apiResData<Api.DjkWelfareVO>> & {
           data: {
             id: number
           }
         }
       >(
         config: Config
-      ): Alova2Method<apiResData<DjkWelfareVO>, 'djk.welfareList', Config>;
+      ): Alova2Method<apiResData<Api.DjkWelfareVO>, 'djk.welfareList', Config>;
       welfareClaimInfo<
         Config extends Alova2MethodConfig<apiResData<any>> & {
           data: {
@@ -1102,12 +1102,12 @@ declare global {
         config: Config
       ): Alova2Method<apiResData<any>, 'djk.welfareClaimInfoDetaile', Config>;
       welfareClaimInfoPopup<
-        Config extends Alova2MethodConfig<apiResData<DjkWelfareVO>> & {
+        Config extends Alova2MethodConfig<apiResData<Api.DjkWelfareVO>> & {
           pathParams: { memberId: number };
         }
       >(
         config: Config
-      ): Alova2Method<apiResData<DjkWelfareVO>, 'djk.welfareClaimInfoPopup', Config>;
+      ): Alova2Method<apiResData<Api.DjkWelfareVO>, 'djk.welfareClaimInfoPopup', Config>;
       addWelfareOrder<
         Config extends Alova2MethodConfig<apiResData<any>> & {
           data: {/**

+ 1 - 0
src/components.d.ts

@@ -25,6 +25,7 @@ declare module 'vue' {
     WdCircle: typeof import('wot-design-uni/components/wd-circle/wd-circle.vue')['default']
     WdConfigProvider: typeof import('wot-design-uni/components/wd-config-provider/wd-config-provider.vue')['default']
     WdCountDown: typeof import('wot-design-uni/components/wd-count-down/wd-count-down.vue')['default']
+    WdCurtain: typeof import('wot-design-uni/components/wd-curtain/wd-curtain.vue')['default']
     WdDivider: typeof import('wot-design-uni/components/wd-divider/wd-divider.vue')['default']
     WdIcon: typeof import('wot-design-uni/components/wd-icon/wd-icon.vue')['default']
     WdInput: typeof import('wot-design-uni/components/wd-input/wd-input.vue')['default']

+ 4 - 4
src/config/index.ts

@@ -11,17 +11,17 @@ const mapEnvVersion = {
   // develop: 'http://192.168.1.89:8080', // 田
   // develop: 'http://192.168.0.11:8080', // 王S
   // develop: 'http://74949mkfh190.vicp.fun', // 付
-  develop: 'http://47.109.84.152:8081',
+  // develop: 'http://47.109.84.152:8081',
   // develop: 'https://5ed0f7cc.r9.vip.cpolar.cn',
-  // develop: 'https://smqjh.api.zswlgz.com',
+  develop: 'https://smqjh.api.zswlgz.com',
   /**
    * 体验版
    */
   // trial: "http://192.168.1.166:8080/jeecg-boot",
   // trial: 'http://192.168.0.157:8080',
-  // trial: 'http://47.109.84.152:8081',
+  trial: 'http://47.109.84.152:8081',
   // trial: 'http://192.168.1.166:8080',
-  trial: 'https://smqjh.api.zswlgz.com',
+  // trial: 'https://smqjh.api.zswlgz.com',
   /**
    * 正式版
    */

+ 28 - 0
src/subPack-djk/commonTab/index.vue

@@ -3,6 +3,7 @@ import home from './components/index.vue'
 import fl from './components/fl.vue'
 import order from './components/order.vue'
 import { StaticUrl } from '@/config'
+import router from '@/router'
 
 definePage({
   name: 'djk-homeTabbar',
@@ -15,6 +16,8 @@ definePage({
   },
 })
 const { refreshOrderList } = storeToRefs(useSysStore())
+const { userInfo, token } = storeToRefs(useUserStore())
+const showCurtain = ref(false)
 onLoad((options: any) => {
   if (options.pay) {
     handleTabbarChange({ value: 'djk-order' })
@@ -29,6 +32,7 @@ const tabbarItems = ref([
   { name: 'djk-order', value: null, active: false, title: '订单', icon1: `${StaticUrl}/djk-order0.png`, icon2: `${StaticUrl}/djk-order1.png` },
 ])
 const tabbarName = ref('djk-home')
+const welfare = ref<Api.DjkWelfareVO>()
 function handleTabbarChange({ value }: { value: string }) {
   setTabbarItemActive(value)
   tabbarName.value = value
@@ -43,6 +47,16 @@ function setTabbarItemActive(name: string) {
     }
   })
 }
+async function getData() {
+  if (!token.value)
+    return
+  const res = await Apis.djk.welfareClaimInfoPopup({ pathParams: { memberId: userInfo.value.id } })
+  if (res.data.id) {
+    welfare.value = res.data
+    showCurtain.value = true
+  }
+}
+getData()
 </script>
 
 <template>
@@ -73,6 +87,20 @@ function setTabbarItemActive(name: string) {
         </template>
       </wd-tabbar-item>
     </wd-tabbar>
+    <wd-overlay :show="showCurtain" :z-index="999999999" @click="showCurtain = false">
+      <view class="h-screen flex items-center justify-center">
+        <view class="relative h702rpx w702rpx">
+          <image
+            :src="`${StaticUrl}/djk-fl-popup.png`"
+            class="h702rpx w702rpx"
+            @click="router.push({ name: 'djk-welfare', params: { id: String(welfare?.id) } })"
+          />
+          <view class="absolute bottom-120rpx left-50% text-28rpx text-white -translate-x-50%">
+            领取:{{ welfare?.quantityClaimed || 0 }}/{{ welfare?.inventory || 0 }}
+          </view>
+        </view>
+      </view>
+    </wd-overlay>
   </view>
 </template>
 

+ 1 - 1
src/subPack-djk/shopinfo/index.vue

@@ -106,7 +106,7 @@ function handlePhone() {
                 :src="item.goodsImg"
               />
               <view class="bg-#F9F9F9 p16rpx">
-                <view class="text-28rpx font-semibold">
+                <view class="line-clamp-2 text-28rpx font-semibold">
                   {{ item.goodsName }}
                 </view>
                 <view class="mt16rpx flex items-center justify-between">