Ver Fonte

```
feat(api): 添加弹窗配置API接口

- 新增 xsb.popupConfig API 接口用于获取弹窗配置信息
- 更新全局类型定义文件以支持新的API方法

feat(components): 集成Wot Design Curtain组件

- 在组件声明中添加 WdCurtain 组件支持

fix(index): 修复领取成功后弹窗未关闭问题

- 在领取成功后设置 showoverlay.value = false 来关闭弹窗

feat(xsb): 实现首页弹窗广告功能

- 调用 queryPopupConfig 方法获取弹窗配置
- 使用 wd-overlay 和 image 组件展示弹窗广告
- 当用户点击遮罩时关闭弹窗

chore(config): 更新开发环境配置

- 启用 http://192.168.0.217:8080 开发服务器配置
- 注释掉线上测试地址

style(commonTab): 修复swiper属性绑定语法

- 将 display-multiple-items="5" 改为 :display-multiple-items="5"
```

zouzexu há 16 horas atrás
pai
commit
bd68bf083f

+ 1 - 0
src/api/apiDefinitions.ts

@@ -64,6 +64,7 @@ export default {
   'xsb.refundList':['POST', '/smqjh-oms/app-api/v1/refund/findList'],
   'xsb.refundCancel':['GET', '/smqjh-oms/app-api/v1/refund/cancel'],
   'xsb.refundDetails':['GET', '/smqjh-oms/app-api/v1/refund/findByDetails'],
+  'xsb.popupConfig':['GET', '/smqjh-system/app-api/v1/appAdvertInfo/popupConfig'],
 
   'common.myShoppingCart':['GET', '/smqjh-oms/app-api/v1/shoppingCart/myShoppingCart'],
   'common.addShoppingCart':['POST', '/smqjh-oms/app-api/v1/shoppingCart/addShoppingCart'],

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

@@ -205,6 +205,12 @@ declare global {
       ): Alova2Method<listData<Api.sysDict>, 'sys.dictPage', Config>;
     }
     xsb: {
+      popupConfig<
+        Config extends Alova2MethodConfig<apiResData<any>> & { }
+      >(
+        config: Config
+      ): Alova2Method<apiResData<any>, 'xsb.popupConfig', Config>;
+
       refundDetails<
         Config extends Alova2MethodConfig<apiResData<Api.OrderRefundDetails>> & {
           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']

+ 2 - 2
src/config/index.ts

@@ -7,13 +7,13 @@ const mapEnvVersion = {
   // develop: 'http://192.168.0.157:8080',
   // develop: 'http://192.168.1.253:8080',
   // develop: 'http://192.168.0.19:8080',
-  // develop: 'http://192.168.0.217:8080', // 黄
+  develop: 'http://192.168.0.217:8080', // 黄
   // develop: 'http://192.168.0.11:8080', // 王
   // develop: 'http://192.168.1.89:8080', // 田
   // develop: 'http://74949mkfh190.vicp.fun', // 付
   // 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',
   /**
    * 体验版
    */

+ 1 - 0
src/pages/index/index.vue

@@ -101,6 +101,7 @@ async function getZhUserReceived() {
   await Apis.sys.zhUserReceived({})
   useGlobalLoading().close()
   show({ msg: '领取成功 !' })
+  showoverlay.value = false
 }
 
 function handleGo() {

+ 22 - 1
src/subPack-xsb/commonTab/components/index.vue

@@ -34,6 +34,7 @@ function handleScroll(e: UniHelper.ScrollViewOnScrollEvent) {
 }
 onMounted(() => {
   opcity.value = 0
+  queryPopupConfig()
 })
 
 function handleCommonClass(item: Api.xsbCategories) {
@@ -84,6 +85,21 @@ function handleChangeSwiper(e: UniHelper.SwiperOnChangeEvent) {
 
   currentIndex.value = newIndices
 }
+
+const curtainInfo = ref({
+  enabled: false,
+  imageUrl: '',
+})
+async function queryPopupConfig() {
+  try {
+    const res = await Apis.xsb.popupConfig({})
+    curtainInfo.value = res.data
+  }
+  catch (error) {
+    console.error('获取弹窗配置失败:', error)
+    curtainInfo.value = { enabled: false, imageUrl: '' }
+  }
+}
 </script>
 
 <template>
@@ -196,7 +212,7 @@ function handleChangeSwiper(e: UniHelper.SwiperOnChangeEvent) {
                 </view>
 
                 <view v-if="swiperClassList.length" class="swiper-img swiper mt26rpx">
-                  <swiper class="h125rpx gap-16rpx" display-multiple-items="5" @change="handleChangeSwiper">
+                  <swiper class="h125rpx gap-16rpx" :display-multiple-items="5" @change="handleChangeSwiper">
                     <swiper-item v-for="item, idx in swiperClassList" :key="item.id" class="mb20rpx flex flex-col items-center text-center" @click="handleSwiperClick({ index: idx, item })">
                       <view class="pic-box">
                         <image class="h72rpx w72rpx" :src="item.icon" />
@@ -283,6 +299,11 @@ function handleChangeSwiper(e: UniHelper.SwiperOnChangeEvent) {
       </view>
       <view class="h60rpx" />
     </scroll-view>
+    <wd-overlay :show="curtainInfo.enabled" @click="curtainInfo.enabled = false">
+      <view class="h-full flex items-center justify-center">
+        <image class="h-784rpx w-750rpx" :src="curtainInfo.imageUrl" />
+      </view>
+    </wd-overlay>
   </view>
 </template>