15102826049 1 tydzień temu
rodzic
commit
812e53ada9

+ 4 - 1
src/hooks/useDraw.ts

@@ -15,7 +15,6 @@ export function useDraw(props?: any, emit?: any) {
   };
 
   const onPayment = (data: any, type: string, pageType?: string) => {
-    console.log("-----------------", pageType);
     if (!isWithDraw(data.processStatus)) return;
     if (!isBtn.value) return;
     isBtn.value = false;
@@ -53,6 +52,10 @@ export function useDraw(props?: any, emit?: any) {
                 uni.navigateBack({
                   delta: 1,
                 });
+              } else if (type === "4") {
+                uni.reLaunch({
+                  url: "/pagesOne/record/claimList",
+                });
               } else {
                 handleClose();
               }

+ 8 - 0
src/pages.json

@@ -58,6 +58,14 @@
           }
         },
         {
+          "path": "record/claimList",
+          "style": {
+            "navigationBarTitleText": "快速理赔",
+            "navigationBarBackgroundColor": "#fff",
+            "enablePullDownRefresh": true
+          }
+        },
+        {
           "path": "record/uploadDetail",
           "style": {
             "navigationBarTitleText": "上传记录详情"

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

@@ -31,10 +31,7 @@
     </view>
     <button hover-class="button-hover" @click="onLogin">登录</button>
     <wd-button type="success">成功按钮</wd-button> -->
-    <user-login-popup
-      ref="loginRef"
-      path="/pagesOne/winner/index"
-    ></user-login-popup>
+    <user-login-popup ref="loginRef" :path="path"></user-login-popup>
   </view>
 </template>
 
@@ -49,6 +46,8 @@ import UserLoginPopup from "@/components/userLoginPopup.vue";
 const current = ref<number>(0);
 const appid = uni.getStorageSync("appid");
 
+const path = ref<string>("/pagesOne/winner/index");
+
 const onLogin = () => {
   uni.login({
     //获取code,
@@ -91,6 +90,7 @@ const toActivity = () => {
 
   if (!isGetPhone()) {
     loginRef.value.show = true;
+    path.value = "/pagesOne/winner/index";
   } else {
     uni.navigateTo({
       url: "/pagesOne/winner/index",
@@ -109,6 +109,7 @@ const toClaim = () => {
 
   if (!isGetPhone()) {
     loginRef.value.show = true;
+    path.value = "/pagesOne/claim/apply";
   } else {
     uni.navigateTo({
       url: "/pagesOne/claim/apply",

+ 6 - 10
src/pages/my/index.vue

@@ -33,31 +33,27 @@
         <view class="tools">
           <wd-cell
             is-link
-            title="奖励记录"
+            title="上传小票奖励记录"
             @click="toNextPage('/pagesOne/record/winnerList')"
           >
             <template #icon>
               <image :src="imgObj.gift" mode="scaleToFill" />
             </template>
-            <wd-badge
-              v-if="countData.receiptActivityCount > 0"
-              :modelValue="countData.receiptActivityCount"
-            >
+            <wd-badge :modelValue="countData.receiptActivityCount">
               <view class="count flex-center">去提现</view>
             </wd-badge>
           </wd-cell>
+          <!-- @click="toNextPage('/pagesOne/record/recordList?type=claim')" -->
+
           <wd-cell
+            @click="toNextPage('/pagesOne/record/claimList?type=list')"
             is-link
             title="快速理赔"
-            @click="toNextPage('/pagesOne/record/recordList?type=claim')"
           >
             <template #icon>
               <image :src="imgObj.lpIcon" mode="scaleToFill" />
             </template>
-            <wd-badge
-              v-if="countData.quickClaimCount > 0"
-              :modelValue="countData.quickClaimCount"
-            >
+            <wd-badge :modelValue="countData.quickClaimCount">
               <view class="count flex-center">去提现</view>
             </wd-badge>
           </wd-cell>

+ 1 - 1
src/pagesOne/claim/apply.vue

@@ -35,7 +35,7 @@ const toUpload = () => {
       if (
         response["FWGvRFSZ65JVrMsTqeBoT9hJYyeN9Z_aFAacMxoPlhY"] === "accept"
       ) {
-        uni.showToast({ title: "操作成功!", icon: "none" });
+        // uni.showToast({ title: "操作成功!", icon: "none" });
       }
       setTimeout(() => {
         uni.navigateTo({

+ 3 - 0
src/pagesOne/claim/uploadRecept.vue

@@ -56,6 +56,9 @@ const onSubmit = async () => {
       title: res.msg,
       icon: res.code === 200 ? "success" : "none",
     });
+    setTimeout(() => {
+      uni.navigateBack();
+    }, 500);
   } catch (err) {
     uni.showToast({
       title: res.msg || "上传失败",

+ 56 - 8
src/pagesOne/record/claimList.vue

@@ -2,6 +2,11 @@
   <scroll-view
     :scroll-top="sTop"
     @scrolltolower="onScroll"
+    @refresherrefresh="onRefresh"
+    @refresherpulling="onPulling"
+    @refresherrestore="pullUpEnd"
+    :refresher-triggered="triggered"
+    :refresher-enabled="true"
     scroll-y
     class="claimList"
   >
@@ -17,7 +22,7 @@
         @click="toDetail(item)"
         class="clain"
       >
-        <claim-item :detail="item"></claim-item>
+        <claim-item :detail="item" :claimType="currenType"></claim-item>
       </view>
     </view>
     <wd-gap bg-color="#f7f8f9" height="50rpx"></wd-gap>
@@ -26,14 +31,15 @@
 
 <script lang="ts" setup>
 import { onLoad } from "@dcloudio/uni-app";
-import { ref, reactive, watch } from "vue";
+import { ref, reactive, watch, nextTick, computed } from "vue";
 import ActiveBlock from "./components/activeBlock.vue";
-import { quickclaimsList } from "@/services/claim";
+import { quickclaimsList, auditSuccessList } from "@/services/claim";
 import emptyBox from "@/components/emptyBox.vue";
 import claimItem from "./components/claimItem.vue";
-
+import { onPullDownRefresh } from "@dcloudio/uni-app";
 const props = defineProps({
   activeName: String,
+  type: String,
 });
 
 const openid = uni.getStorageSync("openid");
@@ -50,18 +56,29 @@ const sTop = ref(0);
 watch(
   () => props.activeName,
   (val) => {
-    if (val === "claim") {
+    if (val === "claim" || !val) {
       sTop.value = 0;
       list.value = [];
       params.pageNum = 1;
-      getList("search");
+      nextTick(() => {
+        getList("search");
+      });
     }
+  },
+  {
+    immediate: true,
   }
 );
 
+const currenType = computed(() => {
+  return claimType.value || props.type;
+});
+
 const getList = (type?: string) => {
   if (type === "search") params.pageNum = 1;
-  quickclaimsList({ openid, ...params }).then((res: any) => {
+  const currentApi =
+    currenType.value === "list" ? auditSuccessList : quickclaimsList;
+  currentApi({ openid, ...params }).then((res: any) => {
     params.currentPage = Math.ceil(res.total / params.pageSize);
     list.value = [...list.value, ...res.rows].map((item) => {
       return {
@@ -70,10 +87,14 @@ const getList = (type?: string) => {
         paymentBillImageArr: item.paymentBillImage.split(","),
       };
     });
+    console.log("----------------------------", list.value);
+
+    // isRefresh.value = false;
   });
 };
 
 const toDetail = (item: any) => {
+  if (currenType.value === "list") return;
   uni.navigateTo({
     url: `/pagesOne/claim/claimRecord?id=${item.id}`,
   });
@@ -85,12 +106,39 @@ const onScroll = () => {
     getList();
   }
 };
+
+const claimType = ref("");
+onLoad((options: any) => {
+  claimType.value = options.type;
+  // isRefresh.value = false;
+});
+
+const triggered = ref(false);
+const onRefresh = () => {
+  sTop.value = 0;
+  list.value = [];
+  params.pageNum = 1;
+  nextTick(() => {
+    getList("search");
+  });
+};
+
+const onPulling = (e: any) => {
+  triggered.value = true;
+  setTimeout(() => {
+    triggered.value = false;
+  }, 1000);
+};
+
+const pullUpEnd = () => {
+  triggered.value = false;
+};
 </script>
 
 <style lang="scss" scoped>
 .claimList {
   background: #f7f8f9;
-  height: calc(100vh - 84rpx);
+  height: 100vh; //calc(100vh - 84rpx);;
   padding: 32rpx;
   box-sizing: border-box;
 

+ 1 - 0
src/pagesOne/record/components/activeBlock.vue

@@ -48,6 +48,7 @@
           :height="112"
           :src="joy"
           :enable-preview="true"
+          custom-style="margin-right:16rpx"
         />
       </view>
     </view>

+ 17 - 4
src/pagesOne/record/components/claimItem.vue

@@ -22,7 +22,11 @@
           :src="joy"
           :enable-preview="preview"
           custom-style="margin-right: 8rpx"
-        />
+        >
+          <template #error>
+            <view class="error-wrap">加载失败</view>
+          </template>
+        </wd-img>
       </view>
     </view>
     <view>
@@ -36,17 +40,21 @@
           :src="joy"
           :enable-preview="preview"
           custom-style="margin-right: 8rpx"
-        />
+        >
+          <template #error>
+            <view class="error-wrap">加载失败</view>
+          </template>
+        </wd-img>
       </view>
     </view>
     <view v-if="detail.auditRemark" class="remark"
       >拒绝原因:{{ detail.auditRemark }}</view
     >
     <view
-      v-if="!isShow"
+      v-if="claimType === 'list'"
       class="btn"
       :class="isWithDraw(detail.processStatus) ? 'active' : 'static'"
-      @click="onPayment(detail, '3', 'claim')"
+      @click="onPayment(detail, '4', 'claim')"
       >{{ isWithDraw(detail.processStatus) ? "提现" : "提现成功" }}</view
     >
   </view>
@@ -55,6 +63,7 @@
 <script lang="ts" setup>
 import { formatTagColor, formatTagBgColor, formatTagStr } from "@/utils/common";
 import { useDraw } from "@/hooks/useDraw";
+import { onLoad } from "@dcloudio/uni-app";
 
 const { onPayment, isWithDraw } = useDraw();
 const props = defineProps({
@@ -78,6 +87,7 @@ const props = defineProps({
     type: Boolean,
     default: false,
   },
+  claimType: String,
 });
 </script>
 
@@ -117,5 +127,8 @@ const props = defineProps({
       background: #d1d1d6;
     }
   }
+  .error-wrap {
+    background: #d1d1d6;
+  }
 }
 </style>

+ 6 - 2
src/pagesOne/record/recordList.vue

@@ -13,7 +13,11 @@
       </wd-tab>
       <wd-tab title="快速理赔上传记录" name="claim">
         <view class="content"
-          ><claim-list ref="claimRef" :activeName="activeName"></claim-list
+          ><claim-list
+            ref="claimRef"
+            :activeName="activeName"
+            type="claim"
+          ></claim-list
         ></view>
       </wd-tab>
     </wd-tabs>
@@ -27,7 +31,7 @@ import uploadList from "./uploadList.vue";
 import claimList from "./claimList.vue";
 // import emptyBox from "@/components/emptyBox.vue";
 
-const activeName = ref("");
+const activeName = ref("upload");
 
 onLoad((options: any) => {
   activeName.value = options.type || "upload";

+ 32 - 3
src/pagesOne/record/uploadList.vue

@@ -2,6 +2,11 @@
   <scroll-view
     :scroll-top="sTop"
     @scrolltolower="onScroll"
+    @refresherrefresh="onRefresh"
+    @refresherpulling="onPulling"
+    @refresherrestore="pullUpEnd"
+    :refresher-triggered="triggered"
+    :refresher-enabled="true"
     scroll-y
     class="winnerListContent"
   >
@@ -26,7 +31,7 @@
 
 <script lang="ts" setup>
 import { onLoad } from "@dcloudio/uni-app";
-import { ref, reactive, watch } from "vue";
+import { ref, reactive, watch, nextTick } from "vue";
 import ActiveBlock from "./components/activeBlock.vue";
 import { rewardList } from "@/services/ams";
 import emptyBox from "@/components/emptyBox.vue";
@@ -53,9 +58,12 @@ watch(
       sTop.value = 0;
       list.value = [];
       params.pageNum = 1;
-      getList("search");
+      nextTick(() => {
+        getList("search");
+      });
     }
-  }
+  },
+  { immediate: true }
 );
 
 const getList = (type?: string) => {
@@ -76,6 +84,27 @@ const onScroll = () => {
     getList();
   }
 };
+const triggered = ref(false);
+
+const onRefresh = () => {
+  sTop.value = 0;
+  list.value = [];
+  params.pageNum = 1;
+  nextTick(() => {
+    getList("search");
+  });
+};
+
+const onPulling = (e: any) => {
+  triggered.value = true;
+  setTimeout(() => {
+    triggered.value = false;
+  }, 1000);
+};
+
+const pullUpEnd = () => {
+  triggered.value = false;
+};
 </script>
 
 <style lang="scss" scoped>

+ 2 - 1
src/pagesOne/winner/components/uploadReceptPopop.vue

@@ -82,7 +82,7 @@ watch(
 watch(
   () => props.show,
   (newVal) => {
-    if (!newVal) {
+    if (newVal) {
       discountId.value = "";
     }
   }
@@ -142,6 +142,7 @@ const radioChange = (e: any) => {
     (item: any) => item.id === e.detail.value
   )[0];
   discountLevel.value = `满${obj.thresholdAmount}返${obj.cashbackAmount}`;
+  console.log("--------------------------", discountId.value);
 };
 
 const { handleClose } = useDraw(props, emit);

+ 18 - 13
src/pagesOne/winner/components/winRecordPopup.vue

@@ -10,13 +10,15 @@
           <view>
             <view v-for="item in list" :key="item.id" class="record">
               <text>活动力度:{{ item.discountLevel }}</text>
-              <text>奖励金额:{{ item.paymentAmount }}元</text>
-              <view
-                class="btn"
-                :class="isWithDraw(item.processStatus) ? '' : 'static'"
-                @click="onPayment(item, '2')"
-                >提现</view
-              >
+              <view class="flex-center-btw bot">
+                <text>奖励金额:{{ item.paymentAmount }}元</text>
+                <view
+                  class="btn"
+                  :class="isWithDraw(item.processStatus) ? '' : 'static'"
+                  @click="onPayment(item, '2')"
+                  >提现</view
+                >
+              </view>
             </view>
           </view>
         </scroll-view>
@@ -71,7 +73,7 @@ const scrolltolower = () => {
       // overflow-y: scroll;
       height: 798rpx;
       box-sizing: border-box;
-      width: 90%;
+      width: 85%;
       margin: auto;
       padding: 128rpx 0 95rpx;
       .record {
@@ -79,14 +81,14 @@ const scrolltolower = () => {
         // text-align: left;
         padding: 32rpx 0;
         border-bottom: 1rpx solid rgba(191, 200, 219, 0.5);
-        display: flex;
-        justify-content: space-between;
-        align-items: flex-end;
+        // display: flex;
+        // justify-content: space-between;
+        // align-items: flex-end;
         > text {
           line-height: 30rpx;
 
           &:last-of-type {
-            margin-left: 44rpx;
+            // margin-left: 44rpx;
           }
         }
         &:last-of-type {
@@ -106,12 +108,15 @@ const scrolltolower = () => {
     margin: auto;
   }
   .btn {
-    @include btnStyle(108rpx, 38rpx);
+    @include btnStyle(108rpx, 48rpx);
     font-weight: normal;
     font-size: 22rpx;
     &.static {
       background: #d1d1d6;
     }
   }
+  .bot {
+    height: 48rpx;
+  }
 }
 </style>

+ 2 - 2
src/pagesOne/winner/uploadImage.vue

@@ -93,11 +93,11 @@ const onAdd = () => {
           if (
             response["FWGvRFSZ65JVrMsTqeBoT9hJYyeN9Z_aFAacMxoPlhY"] === "accept"
           ) {
-            uni.showToast({ title: "操作成功!", icon: "none" });
+            // uni.showToast({ title: "操作成功!", icon: "none" });
           }
           setTimeout(() => {
             uni.navigateBack();
-          }, 800);
+          }, 500);
         },
         fail(err) {
           uni.showToast({ title: "订阅失败", icon: "error" });

+ 9 - 1
src/services/claim.ts

@@ -18,7 +18,7 @@ export const quickclaimsWithdraw = (data: string) => {
   });
 };
 
-//理赔记录
+//上传记录
 export const quickclaimsList = (data: any) => {
   return http({
     method: "POST",
@@ -26,6 +26,14 @@ export const quickclaimsList = (data: any) => {
     data,
   });
 };
+//理赔记录
+export const auditSuccessList = (data: any) => {
+  return http({
+    method: "POST",
+    url: `/customer/quickclaims/auditSuccessList?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
+    data,
+  });
+};
 
 //理赔详情
 export const quickclaimsDetail = (data: any) => {