15102826049 2 тижнів тому
батько
коміт
adfff7d154

+ 2 - 2
.env.development

@@ -10,5 +10,5 @@ VITE_APP_BASE_API = ''
 # 路由懒加载
 VITE_CLI_BABEL_TRANSPILE_MODULES = true
 
-# VITE_API_URL=http://192.168.168.104:8090
-VITE_API_URL=https://test-coupon.qiuyutech.com.cn/stage-api
+VITE_API_URL=http://192.168.168.104:8090
+# VITE_API_URL=https://test-coupon.qiuyutech.com.cn/stage-api

+ 69 - 0
package-lock.json

@@ -23,9 +23,11 @@
         "@dcloudio/uni-mp-weixin": "3.0.0-4030620241128001",
         "@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
         "@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
+        "@rollup/plugin-commonjs": "^28.0.3",
         "axios": "^1.9.0",
         "pinia": "^3.0.2",
         "sass-loader": "^8.0.2",
+        "vite-plugin-require-transform": "^1.0.21",
         "vue": "^3.0.0",
         "vue-i18n": "^9.1.9",
         "wot-design-uni": "^1.9.1"
@@ -3503,6 +3505,32 @@
         "node": ">= 8"
       }
     },
+    "node_modules/@rollup/plugin-commonjs": {
+      "version": "28.0.3",
+      "resolved": "https://registry.npmmirror.com/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.3.tgz",
+      "integrity": "sha512-pyltgilam1QPdn+Zd9gaCfOLcnjMEJ9gV+bTw6/r73INdvzf1ah9zLIJBm+kW7R6IUFIQ1YO+VqZtYxZNWFPEQ==",
+      "license": "MIT",
+      "dependencies": {
+        "@rollup/pluginutils": "^5.0.1",
+        "commondir": "^1.0.1",
+        "estree-walker": "^2.0.2",
+        "fdir": "^6.2.0",
+        "is-reference": "1.2.1",
+        "magic-string": "^0.30.3",
+        "picomatch": "^4.0.2"
+      },
+      "engines": {
+        "node": ">=16.0.0 || 14 >= 14.17"
+      },
+      "peerDependencies": {
+        "rollup": "^2.68.0||^3.0.0||^4.0.0"
+      },
+      "peerDependenciesMeta": {
+        "rollup": {
+          "optional": true
+        }
+      }
+    },
     "node_modules/@rollup/pluginutils": {
       "version": "5.1.4",
       "resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.1.4.tgz",
@@ -5548,6 +5576,12 @@
       "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz",
       "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
     },
+    "node_modules/commondir": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/commondir/-/commondir-1.0.1.tgz",
+      "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==",
+      "license": "MIT"
+    },
     "node_modules/compare-versions": {
       "version": "3.6.0",
       "resolved": "https://registry.npmmirror.com/compare-versions/-/compare-versions-3.6.0.tgz",
@@ -6422,6 +6456,20 @@
         "bser": "2.1.1"
       }
     },
+    "node_modules/fdir": {
+      "version": "6.4.6",
+      "resolved": "https://registry.npmmirror.com/fdir/-/fdir-6.4.6.tgz",
+      "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==",
+      "license": "MIT",
+      "peerDependencies": {
+        "picomatch": "^3 || ^4"
+      },
+      "peerDependenciesMeta": {
+        "picomatch": {
+          "optional": true
+        }
+      }
+    },
     "node_modules/file-type": {
       "version": "9.0.0",
       "resolved": "https://registry.npmmirror.com/file-type/-/file-type-9.0.0.tgz",
@@ -7153,6 +7201,15 @@
       "license": "MIT",
       "peer": true
     },
+    "node_modules/is-reference": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmmirror.com/is-reference/-/is-reference-1.2.1.tgz",
+      "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==",
+      "license": "MIT",
+      "dependencies": {
+        "@types/estree": "*"
+      }
+    },
     "node_modules/is-stream": {
       "version": "2.0.1",
       "resolved": "https://registry.npmmirror.com/is-stream/-/is-stream-2.0.1.tgz",
@@ -11004,6 +11061,18 @@
         }
       }
     },
+    "node_modules/vite-plugin-require-transform": {
+      "version": "1.0.21",
+      "resolved": "https://registry.npmmirror.com/vite-plugin-require-transform/-/vite-plugin-require-transform-1.0.21.tgz",
+      "integrity": "sha512-A3SrHhVg9tCW35O7E8kcuB71YTEdVd3EaM1zh6gbH4zxy4WzXSfcNf0UiWmaHHhr6wdFhiiAGdpR6S0SUxXkGQ==",
+      "license": "ISC",
+      "dependencies": {
+        "@babel/generator": "^7.22.5",
+        "@babel/parser": "^7.22.5",
+        "@babel/traverse": "^7.22.5",
+        "@babel/types": "^7.22.5"
+      }
+    },
     "node_modules/vue": {
       "version": "3.5.16",
       "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.16.tgz",

+ 2 - 0
package.json

@@ -50,9 +50,11 @@
     "@dcloudio/uni-mp-weixin": "3.0.0-4030620241128001",
     "@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
     "@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
+    "@rollup/plugin-commonjs": "^28.0.3",
     "axios": "^1.9.0",
     "pinia": "^3.0.2",
     "sass-loader": "^8.0.2",
+    "vite-plugin-require-transform": "^1.0.21",
     "vue": "^3.0.0",
     "vue-i18n": "^9.1.9",
     "wot-design-uni": "^1.9.1"

+ 5 - 1
src/components/customUpload.vue

@@ -26,7 +26,10 @@ import { onLoad } from "@dcloudio/uni-app";
 import { reactive, ref } from "vue";
 const fileList = ref<any[]>([]);
 const imgList = ref<string[]>([]);
-const action = import.meta.env.VITE_API_URL + "/miniApp/oss/upload";
+const aData = JSON.parse(uni.getStorageSync("activityData"));
+
+const action =
+  import.meta.env.VITE_API_URL + "/miniApp/oss/upload/" + aData.brandId;
 
 const props = defineProps({
   title: String,
@@ -64,6 +67,7 @@ const customUpload = (file: any, formData: any, options: any) => {
 const handleRemove = (file: any) => {
   const data = JSON.parse(file.file.response);
   imgList.value = imgList.value.filter((item) => item !== data.url);
+  emit("success", imgList.value);
 };
 </script>
 

+ 10 - 2
src/hooks/useDraw.ts

@@ -1,5 +1,7 @@
 import { ref, reactive } from "vue";
 import { payment } from "@/services/ams";
+import { claimPayment } from "@/services/claim";
+
 let isBtn = ref(true);
 const appid = uni.getStorageSync("appid");
 
@@ -12,7 +14,8 @@ export function useDraw(props?: any, emit?: any) {
     return status === "3" || status === "5" || status === "6";
   };
 
-  const onPayment = (data: any, type: string) => {
+  const onPayment = (data: any, type: string, pageType?: string) => {
+    console.log("-----------------", pageType);
     if (!isWithDraw(data.processStatus)) return;
     if (!isBtn.value) return;
     isBtn.value = false;
@@ -21,7 +24,8 @@ export function useDraw(props?: any, emit?: any) {
       data.processStatus === "5" ||
       data.processStatus === "6";
     if (!status) return;
-    payment(data.id)
+    const currentApi = pageType === "claim" ? claimPayment : payment;
+    currentApi(data.id)
       .then((res: any) => {
         if (res.code === 500) {
           uni.showToast({ icon: "none", title: "提现中" });
@@ -45,6 +49,10 @@ export function useDraw(props?: any, emit?: any) {
                     url: "/pages/my/index",
                   });
                 }, 500);
+              } else if (type === "3") {
+                uni.navigateBack({
+                  delta: 1,
+                });
               } else {
                 handleClose();
               }

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

@@ -20,7 +20,7 @@
       class="enter-img"
       src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/lp.png"
       mode="scaleToFill"
-      @click="toActivity"
+      @click="toClaim"
     />
     <!-- <button open-type="getPhoneNumber" @getphonenumber="getPhone">
       获取手机号
@@ -97,6 +97,24 @@ const toActivity = () => {
     });
   }
 };
+const toClaim = () => {
+  // const data = JSON.parse(uni.getStorageSync("activityData")) || {};
+  // if (!data) {
+  //   uni.showToast({
+  //     title: "当前暂无满返红包上传小票活动哦",
+  //     icon: "none",
+  //   });
+  //   return;
+  // }
+
+  if (!isGetPhone()) {
+    loginRef.value.show = true;
+  } else {
+    uni.navigateTo({
+      url: "/pagesOne/claim/apply",
+    });
+  }
+};
 
 onLoad(() => {
   onLogin();

+ 20 - 4
src/pages/my/index.vue

@@ -40,6 +40,7 @@
               <image :src="imgObj.gift" mode="scaleToFill" />
             </template>
             <image
+              v-if="countData.receiptActivityCount > 0"
               style="width: 128rpx; height: 48rpx"
               :src="imgObj.with"
               mode="scaleToFill"
@@ -49,12 +50,13 @@
           <wd-cell
             is-link
             title="快速理赔"
-            @click="toNextPage('/pagesOne/claim/apply')"
+            @click="toNextPage('/pagesOne/record/recordList?type=claim')"
           >
             <template #icon>
               <image :src="imgObj.lpIcon" mode="scaleToFill" />
             </template>
             <image
+              v-if="countData.quickClaimCount > 0"
               style="width: 128rpx; height: 48rpx"
               :src="imgObj.with"
               mode="scaleToFill"
@@ -65,7 +67,7 @@
             border
             is-link
             title="上传记录"
-            @click="toNextPage('/pagesOne/record/recordList')"
+            @click="toNextPage('/pagesOne/record/recordList?type=upload')"
           >
             <template #icon>
               <image :src="imgObj.page" mode="scaleToFill" />
@@ -104,9 +106,9 @@
 <script setup lang="ts">
 import { onLoad, onShow } from "@dcloudio/uni-app";
 
-import { ref } from "vue";
+import { reactive, ref } from "vue";
 import { getNavTop } from "@/utils/system";
-// import { paymentAPI } from "@/services/ams";
+import { pendingWithdrawCount } from "@/services/ams";
 import { getActivityData, isGetPhone, getMobile } from "@/utils/system";
 import UserLoginPopup from "@/components/userLoginPopup.vue";
 import NearlyStoreBox from "./components/nearlyStoreBox.vue";
@@ -149,6 +151,7 @@ const list2 = [
     src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/address2.png",
   },
 ];
+const openid = uni.getStorageSync("openid");
 
 const navTop = ref<number>(0);
 const loginRef = <any>ref(null);
@@ -166,6 +169,18 @@ const toNextPage = (val: string) => {
   }
 };
 
+const countData = reactive({ quickClaimCount: 0, receiptActivityCount: 0 });
+
+const getCount = async () => {
+  let res: any = await pendingWithdrawCount(openid);
+  try {
+    countData.quickClaimCount = res.data?.quickClaimCount || 0;
+    countData.receiptActivityCount = res.data?.receiptActivityCount || 0;
+  } catch (err) {
+    console.log(err);
+  }
+};
+
 // const toUpLoad = () => {
 //   path.value = "/pagesOne/record/uploadList";
 //   if (!isGetPhone()) {
@@ -201,6 +216,7 @@ onLoad(() => {
   navTop.value = getNavTop();
 });
 onShow(() => {
+  getCount();
   getActivityData();
 });
 // const onLogin = async () => {

+ 21 - 4
src/pagesOne/claim/apply.vue

@@ -26,8 +26,25 @@ const toGraph = () => {
 };
 
 const toUpload = () => {
-  uni.navigateTo({
-    url: "/pagesOne/claim/uploadRecept",
+  //用户订阅消息模板消息
+  wx.requestSubscribeMessage({
+    tmplIds: ["FWGvRFSZ65JVrMsTqeBoT9hJYyeN9Z_aFAacMxoPlhY"],
+    success(response: any) {
+      if (
+        response["FWGvRFSZ65JVrMsTqeBoT9hJYyeN9Z_aFAacMxoPlhY"] === "accept"
+      ) {
+        uni.showToast({ title: "操作成功!", icon: "none" });
+      }
+      setTimeout(() => {
+        uni.navigateTo({
+          url: "/pagesOne/claim/uploadRecept",
+        });
+      }, 800);
+    },
+    fail(err) {
+      uni.showToast({ title: "订阅失败", icon: "error" });
+      uni.navigateBack();
+    },
   });
 };
 </script>
@@ -72,8 +89,8 @@ const toUpload = () => {
     }
   }
   .dun {
-    width: 106px;
-    height: 108px;
+    width: 212rpx;
+    height: 216rpx;
     float: right;
   }
 }

+ 23 - 1
src/pagesOne/claim/claimRecord.vue

@@ -3,14 +3,36 @@
     <view class="content">
       <view class="title">理赔记录</view>
       <view>
-        <claim-item :isShow="false"></claim-item>
+        <claim-item :isShow="false" :detail="detailData"></claim-item>
       </view>
     </view>
   </view>
 </template>
 
 <script lang="ts" setup>
+import { ref } from "vue";
+import { onLoad } from "@dcloudio/uni-app";
 import ClaimItem from "../record/components/claimItem.vue";
+import { quickclaimsDetail } from "@/services/claim";
+
+const openid = uni.getStorageSync("openid");
+const detailData = ref({} as any);
+const getDetail = async (id: string) => {
+  const res: any = await quickclaimsDetail({ openid, id });
+  try {
+    if (res.code === 200) {
+      detailData.value = res.data;
+      detailData.value.paymentBillImageArr =
+        res.data.paymentBillImage.split(",");
+      detailData.value.receiptImageArr = res.data.receiptImage.split(",");
+    }
+  } catch (error) {
+    console.log(error);
+  }
+};
+onLoad((options: any) => {
+  getDetail(options.id);
+});
 </script>
 
 <style lang="scss" scoped>

+ 51 - 2
src/pagesOne/claim/uploadRecept.vue

@@ -7,17 +7,66 @@
     ></custom-upload>
   </view>
   <wd-gap bg-color="#fff" height="256rpx"></wd-gap>
-  <view class="btn" @click="toAdd">立即上传</view>
+  <view class="btn" @click="onSubmit">立即上传</view>
 </template>
 
 <script lang="ts" setup>
+import { onLoad } from "@dcloudio/uni-app";
+import { ref, reactive } from "vue";
 import CustomUpload from "@/components/customUpload.vue";
+import type { Claim } from "../../services/interface";
+import { quickclaimSubmit } from "@/services/claim";
+
+const aData = JSON.parse(uni.getStorageSync("activityData"));
+const phone = uni.getStorageSync("phone");
+const openid = uni.getStorageSync("openid");
+const queryParams: Claim = reactive({
+  brandId: aData.brandId,
+  mobile: phone,
+  openid: openid,
+  paymentBillImage: "",
+  receiptImage: "",
+});
 const handleRecept = (val: Array<string>) => {
   console.log(val);
+  queryParams.receiptImage = val.join(",");
 };
 const handleBill = (val: Array<string>) => {
-  console.log(val);
+  queryParams.paymentBillImage = val.join(",");
 };
+
+const onSubmit = async () => {
+  if (!queryParams.paymentBillImage) {
+    uni.showToast({
+      title: "请上传微信支付账单详情图片",
+      icon: "none",
+    });
+    return;
+  }
+  if (!queryParams.receiptImage) {
+    uni.showToast({
+      title: "请上传购物小票图片",
+      icon: "none",
+    });
+    return;
+  }
+  const res: any = await quickclaimSubmit(queryParams);
+  try {
+    uni.showToast({
+      title: res.msg,
+      icon: res.code === 200 ? "success" : "none",
+    });
+  } catch (err) {
+    uni.showToast({
+      title: res.msg || "上传失败",
+      icon: "none",
+    });
+  }
+};
+
+onLoad(() => {
+  // console.log("--------------------------", Models.Claim);
+});
 </script>
 
 <style lang="scss" scoped>

+ 68 - 6
src/pagesOne/record/claimList.vue

@@ -1,13 +1,23 @@
 <template>
-  <scroll-view scroll-y class="claimList">
+  <scroll-view
+    :scroll-top="sTop"
+    @scrolltolower="onScroll"
+    scroll-y
+    class="claimList"
+  >
     <empty-box
       v-if="list.length == 0"
       text="暂无上传记录"
       src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/no-upload.png"
     ></empty-box>
     <view class="itemBox">
-      <view v-for="item in 10" :key="item" @click="toDetail" class="clain">
-        <claim-item></claim-item>
+      <view
+        v-for="item in list"
+        :key="item.id"
+        @click="toDetail(item)"
+        class="clain"
+      >
+        <claim-item :detail="item"></claim-item>
       </view>
     </view>
     <wd-gap bg-color="#f7f8f9" height="50rpx"></wd-gap>
@@ -15,14 +25,66 @@
 </template>
 
 <script lang="ts" setup>
+import { onLoad } from "@dcloudio/uni-app";
+import { ref, reactive, watch } from "vue";
+import ActiveBlock from "./components/activeBlock.vue";
+import { quickclaimsList } from "@/services/claim";
+import emptyBox from "@/components/emptyBox.vue";
 import claimItem from "./components/claimItem.vue";
-const list: any = [];
 
-const toDetail = () => {
+const props = defineProps({
+  activeName: String,
+});
+
+const openid = uni.getStorageSync("openid");
+
+const list = <any>ref([]);
+
+const params = <any>reactive({
+  pageSize: 10,
+  pageNum: 1,
+  currentPage: 0,
+});
+const sTop = ref(0);
+
+watch(
+  () => props.activeName,
+  (val) => {
+    if (val === "claim") {
+      sTop.value = 0;
+      list.value = [];
+      params.pageNum = 1;
+      getList("search");
+    }
+  }
+);
+
+const getList = (type?: string) => {
+  if (type === "search") params.pageNum = 1;
+  quickclaimsList({ openid, ...params }).then((res: any) => {
+    params.currentPage = Math.ceil(res.total / params.pageSize);
+    list.value = [...list.value, ...res.rows].map((item) => {
+      return {
+        ...item,
+        receiptImageArr: item.receiptImage.split(","),
+        paymentBillImageArr: item.paymentBillImage.split(","),
+      };
+    });
+  });
+};
+
+const toDetail = (item: any) => {
   uni.navigateTo({
-    url: "/pagesOne/claim/claimRecord",
+    url: `/pagesOne/claim/claimRecord?id=${item.id}`,
   });
 };
+
+const onScroll = () => {
+  if (params.pageNum < params.currentPage) {
+    params.pageNum++;
+    getList();
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 22 - 9
src/pagesOne/record/components/claimItem.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="claimItem">
     <view class="flex-btw-center">
-      <text>上传时间:2021-11-21 10:00:52</text>
+      <text>上传时间:{{ detail.createTime }}</text>
       <wd-tag
         v-if="isShow"
         custom-style="padding:8rpx 26rpx;border-radius: 8rpx;font-size:22rpx;float: right"
@@ -15,6 +15,8 @@
       <text class="title">购物小票图片</text>
       <view>
         <wd-img
+          v-for="(joy, index) in detail.receiptImageArr"
+          :key="index"
           width="96rpx"
           height="170rpx"
           :src="joy"
@@ -27,6 +29,8 @@
       <text class="title">微信账单支付详情图片</text>
       <view>
         <wd-img
+          v-for="(joy, index) in detail.paymentBillImageArr"
+          :key="index"
           width="96rpx"
           height="170rpx"
           :src="joy"
@@ -35,15 +39,24 @@
         />
       </view>
     </view>
-    <view v-if="isShow" class="remark"
-      >拒绝原因:订单中活动商品数量/金额不足</view
+    <view v-if="detail.auditRemark" class="remark"
+      >拒绝原因:{{ detail.auditRemark }}</view
+    >
+    <view
+      v-if="!isShow"
+      class="btn"
+      :class="isWithDraw(detail.processStatus) ? 'active' : 'static'"
+      @click="onPayment(detail, '3', 'claim')"
+      >{{ isWithDraw(detail.processStatus) ? "提现" : "提现成功" }}</view
     >
-    <view v-if="!isShow" class="btn">提现</view>
   </view>
 </template>
 
 <script lang="ts" setup>
 import { formatTagColor, formatTagBgColor, formatTagStr } from "@/utils/common";
+import { useDraw } from "@/hooks/useDraw";
+
+const { onPayment, isWithDraw } = useDraw();
 const props = defineProps({
   isShow: {
     type: Boolean,
@@ -51,7 +64,7 @@ const props = defineProps({
   },
   detail: {
     type: Object,
-    default: { processStatus: "2" },
+    default: {},
   },
   index: {
     type: Number,
@@ -62,9 +75,6 @@ const props = defineProps({
     default: false,
   },
 });
-
-const joy =
-  "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/Group%201.png";
 </script>
 
 <style lang="scss" scoped>
@@ -94,11 +104,14 @@ const joy =
     margin-top: 6rpx;
   }
   .btn {
-    @include btnStyle(64px, 24px);
+    @include btnStyle(128rpx, 48rpx);
     position: absolute;
     right: 22rpx;
     bottom: 24rpx;
     font-weight: normal;
+    &.static {
+      background: #d1d1d6;
+    }
   }
 }
 </style>

+ 14 - 10
src/pagesOne/record/recordList.vue

@@ -6,11 +6,15 @@
       color="#337B52"
       inactiveColor="#555D6C"
     >
-      <wd-tab title="小票上传记录" name="1">
-        <view class="content"><upload-list></upload-list></view>
+      <wd-tab title="小票上传记录" name="upload">
+        <view class="content"
+          ><upload-list :activeName="activeName"></upload-list
+        ></view>
       </wd-tab>
-      <wd-tab title="快速理赔上传记录" name="2">
-        <view class="content"><claim-list></claim-list></view>
+      <wd-tab title="快速理赔上传记录" name="claim">
+        <view class="content"
+          ><claim-list ref="claimRef" :activeName="activeName"></claim-list
+        ></view>
       </wd-tab>
     </wd-tabs>
   </view>
@@ -18,16 +22,16 @@
 
 <script lang="ts" setup>
 import { onLoad } from "@dcloudio/uni-app";
-import { ref } from "vue";
+import { ref, nextTick } from "vue";
 import uploadList from "./uploadList.vue";
 import claimList from "./claimList.vue";
-import emptyBox from "@/components/emptyBox.vue";
+// import emptyBox from "@/components/emptyBox.vue";
 
-const activeName = ref("2");
+const activeName = ref("");
 
-const handleChange = (name: string) => {};
-
-onLoad(() => {});
+onLoad((options: any) => {
+  activeName.value = options.type || "upload";
+});
 </script>
 
 <style lang="scss">

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

@@ -1,5 +1,10 @@
 <template>
-  <scroll-view scroll-y class="winnerListContent">
+  <scroll-view
+    :scroll-top="sTop"
+    @scrolltolower="onScroll"
+    scroll-y
+    class="winnerListContent"
+  >
     <!-- <view class="title">上传记录</view> -->
     <view class="content">
       <empty-box
@@ -20,12 +25,16 @@
 </template>
 
 <script lang="ts" setup>
-import { onLoad, onReachBottom } from "@dcloudio/uni-app";
-import { ref, reactive } from "vue";
+import { onLoad } from "@dcloudio/uni-app";
+import { ref, reactive, watch } from "vue";
 import ActiveBlock from "./components/activeBlock.vue";
 import { rewardList } from "@/services/ams";
 import emptyBox from "@/components/emptyBox.vue";
 
+const props = defineProps({
+  activeName: String,
+});
+
 const openid = uni.getStorageSync("openid");
 
 const list = <any>ref([]);
@@ -35,24 +44,38 @@ const params = <any>reactive({
   pageNum: 1,
   currentPage: 0,
 });
+const sTop = ref(0);
+
+watch(
+  () => props.activeName,
+  (val) => {
+    if (val === "upload") {
+      sTop.value = 0;
+      list.value = [];
+      params.pageNum = 1;
+      getList("search");
+    }
+  }
+);
 
-const getList = () => {
+const getList = (type?: string) => {
+  if (type === "search") params.pageNum = 1;
   rewardList({ openid, ...params }).then((res: any) => {
     params.currentPage = Math.ceil(res.total / params.pageSize);
     list.value = [...list.value, ...res.rows];
   });
 };
 
-onLoad(() => {
-  getList();
-});
+// onLoad(() => {
+//   getList();
+// });
 
-onReachBottom(() => {
+const onScroll = () => {
   if (params.pageNum < params.currentPage) {
     params.pageNum++;
     getList();
   }
-});
+};
 </script>
 
 <style lang="scss" scoped>

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

@@ -51,7 +51,7 @@
 import { reactive, ref, watch } from "vue";
 import { imgObj } from "../utils/source";
 import { useDraw } from "@/hooks/useDraw";
-import { receptProp } from "../utils/interface";
+import type { Receipt } from "@/services/interface";
 import { validate } from "@/services/ams";
 const props = defineProps({
   show: {
@@ -62,7 +62,7 @@ const props = defineProps({
     type: String,
     defalut: "",
   },
-  list: Array<receptProp>,
+  list: Array<Receipt>,
 });
 const openid = uni.getStorageSync("openid");
 

+ 3 - 3
src/pagesOne/winner/index.vue

@@ -108,7 +108,7 @@ import {
   auditSuccessList,
   validate,
 } from "@/services/ams";
-import { receptProp } from "./utils/interface";
+import type { Receipt } from "@/services/interface";
 let showExample = ref<boolean>(false);
 let showUpload = ref<boolean>(false);
 let showWiner = ref<boolean>(false);
@@ -118,7 +118,7 @@ const appid = uni.getStorageSync("appid");
 const backImage = ref<string>("");
 // const statusBarHeight = uni.getWindowInfo().statusBarHeight * 2;
 let aData: any = reactive({ discounts: [] });
-let list = ref([] as receptProp[]);
+let list = ref([] as Receipt[]);
 
 const openid = uni.getStorageSync("openid");
 
@@ -143,7 +143,7 @@ const getList = () => {
     .then((res: any) => {
       aData = res.data[0] || {};
       aData.authCheck = aData.authCheck.split(",");
-      list.value = aData.discounts.map((item: receptProp) => {
+      list.value = aData.discounts.map((item: Receipt) => {
         return {
           ...item,
           checked: false,

+ 1 - 0
src/pagesOne/winner/uploadImage.vue

@@ -82,6 +82,7 @@ const onAdd = () => {
     discountLevel: routerInfo.discountLevel,
     receiptImages: imgList.value.join(","),
     marketingActivityId: aData.id,
+    brandId: aData.brandId,
   };
   addCustomer(params).then((res: any) => {
     if (res.code === 200) {

+ 9 - 1
src/services/ams.ts

@@ -92,7 +92,7 @@ export const getOpenId = (data: any) => {
     data,
   });
 };
-
+//小票提现
 export const payment = (data: any) => {
   return http({
     method: "POST",
@@ -108,3 +108,11 @@ export const subscribeToMessage = (data: any) => {
     url: `/customer/subscribeToMessage/${data}`,
   });
 };
+
+//记录统计
+export const pendingWithdrawCount = (data: any) => {
+  return http({
+    method: "GET",
+    url: `/customer/pendingWithdrawCount/${data}`,
+  });
+};

+ 45 - 0
src/services/claim.ts

@@ -0,0 +1,45 @@
+import { http } from "@/utils/http";
+/**
+ * 快速理赔申请
+ */
+export const quickclaimSubmit = (data: any) => {
+  return http({
+    method: "POST",
+    url: `/customer/quickclaims/submit`,
+    data,
+  });
+};
+
+//理赔提现
+export const quickclaimsWithdraw = (data: string) => {
+  return http({
+    method: "POST",
+    url: `/customer/quickclaims/withdraw/${data}`,
+  });
+};
+
+//理赔记录
+export const quickclaimsList = (data: any) => {
+  return http({
+    method: "POST",
+    url: `/customer/quickclaims/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
+    data,
+  });
+};
+
+//理赔详情
+export const quickclaimsDetail = (data: any) => {
+  return http({
+    method: "POST",
+    url: `/customer/quickclaims/detail`,
+    data,
+  });
+};
+//理赔提现
+export const claimPayment = (data: any) => {
+  return http({
+    method: "POST",
+    url: `/customer/quickclaims/withdraw/${data}`,
+    data,
+  });
+};

+ 9 - 1
src/pagesOne/winner/utils/interface.ts → src/services/interface.ts

@@ -1,4 +1,4 @@
-export interface receptProp {
+export interface Receipt {
   brandId: string;
   cashbackAmount: number;
   createTime: string;
@@ -11,3 +11,11 @@ export interface receptProp {
   checked: boolean;
   disabled: boolean;
 }
+
+export interface Claim {
+  brandId: string;
+  mobile?: string;
+  openid: string;
+  paymentBillImage: string;
+  receiptImage: string;
+}

+ 1 - 0
tsconfig.json

@@ -1,6 +1,7 @@
 {
   "extends": "@vue/tsconfig/tsconfig.json",
   "compilerOptions": {
+    "moduleResolution": "node",
     "ignoreDeprecations": "5.0",
     "sourceMap": true,
     "baseUrl": ".",