Forráskód Böngészése

```
feat(video-rights): 添加视频权益搜索功能

- 在API接口中增加productName参数支持搜索
- 集成WdSearch组件用于搜索输入
- 添加加载状态管理和错误处理
- 实现下拉刷新和上拉加载更多功能

fix(refueling): 修改跳转逻辑为小程序跳转

- 移除router导入和相关依赖
- 替换为uni.navigateToMiniProgram实现滴滴加油小程序跳转
- 添加小程序appId和路径配置

chore(config): 调整开发环境配置

- 启用本地开发服务器配置
- 注释掉线上测试环境地址

refactor(types): 更新全局类型定义

- 为API响应数据添加productName字段类型定义
- 注册WdSearch组件类型声明
```

zouzexu 1 napja
szülő
commit
b40c0f8d59

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

@@ -924,6 +924,7 @@ declare global {
           data: {
             pageNum?: number;
             pageSize?: number;
+            productName?: string;
           }
         }
       >(

+ 1 - 0
src/components.d.ts

@@ -40,6 +40,7 @@ declare module 'vue' {
     WdRadio: typeof import('wot-design-uni/components/wd-radio/wd-radio.vue')['default']
     WdRadioGroup: typeof import('wot-design-uni/components/wd-radio-group/wd-radio-group.vue')['default']
     WdRate: typeof import('wot-design-uni/components/wd-rate/wd-rate.vue')['default']
+    WdSearch: typeof import('wot-design-uni/components/wd-search/wd-search.vue')['default']
     WdSkeleton: typeof import('wot-design-uni/components/wd-skeleton/wd-skeleton.vue')['default']
     WdSortButton: typeof import('wot-design-uni/components/wd-sort-button/wd-sort-button.vue')['default']
     WdStatusTip: typeof import('wot-design-uni/components/wd-status-tip/wd-status-tip.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',
   /**
    * 体验版
    */

+ 6 - 3
src/subPack-refueling/commonTab/index.vue

@@ -1,6 +1,4 @@
 <script setup lang="ts">
-import router from '@/router'
-
 definePage({
   name: 'refueling-tabbar',
   islogin: false,
@@ -11,7 +9,12 @@ definePage({
 
 function refuelingPay() {
   console.log('触发跳转')
-  router.push({ name: 'refueling-webview' })
+  // router.push({ name: 'refueling-webview' })
+  uni.navigateToMiniProgram({
+    appId: 'wx0d252f6ed9755862', // 滴滴加油小程序appId
+    path: 'packageA/pages/open-energy-pay/index?orderId=&tradeId=&appId=wx43b5b906cc30ed0b&path=/pages/index/index&envVersion=小程序回跳环境', // 滴滴加油收银台页面地址,需要拼接orderId和tradeId
+    envVersion: 'release', // 固定release
+  })
 }
 </script>
 

+ 16 - 2
src/subPack-videoRights/commonTab/components/home.vue

@@ -7,8 +7,9 @@ const { statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
 /**
  * 获取视频权益列表
  */
-const { data: videoDataList, isLastPage, page, refresh } = usePagination((pageNum, pageSize) =>
-  Apis.videoRight.findAppByPage({ data: { pageNum, pageSize } }), {
+const productName = ref('')
+const { data: videoDataList, isLastPage, page, reload, error, refresh } = usePagination((pageNum, pageSize) =>
+  Apis.videoRight.findAppByPage({ data: { pageNum, pageSize, productName: productName.value } }), {
   data: (resp) => {
     return resp.data?.list
   },
@@ -19,6 +20,9 @@ const { data: videoDataList, isLastPage, page, refresh } = usePagination((pageNu
   immediate: true,
   middleware: createGlobalLoadingMiddleware(),
 })
+const state = computed(() => {
+  return error.value ? 'error' : !isLastPage.value ? 'loading' : 'finished'
+})
 onShow(() => {
   refresh()
 })
@@ -27,6 +31,14 @@ onReachBottom(() => {
     page.value++
   }
 })
+
+function submitSearch() {
+  refresh()
+}
+
+function clearSearch() {
+  refresh()
+}
 </script>
 
 <template>
@@ -36,6 +48,7 @@ onReachBottom(() => {
       safe-area-inset-top left-arrow fixed @click-left="router.back()"
     />
     <view :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }" />
+    <wd-search v-model="productName" placeholder="请输入名称" cancel-txt="搜索" @cancel="submitSearch" @clear="clearSearch" />
     <view class="box-border px24rpx">
       <scroll-view scroll-y type="custom">
         <grid-view type="masonry" cross-axis-count="2" main-axis-gap="10" cross-axis-gap="10">
@@ -68,6 +81,7 @@ onReachBottom(() => {
         </grid-view>
         <StatusTip v-if="!videoDataList.length" tip="暂无内容" />
       </scroll-view>
+      <wd-loadmore :state="state" :loading-props="{ color: '#9ED605', size: 20 }" @reload="reload" />
     </view>
   </view>
 </template>