Jelajahi Sumber

接品牌id接口

15102826049 1 Minggu lalu
induk
melakukan
2cf2ca2e2f

+ 2 - 0
.env.development

@@ -12,3 +12,5 @@ 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=https://coupon.qiuyutech.com.cn/prod-api
+

+ 1 - 1
.env.production

@@ -7,4 +7,4 @@ VITE_NODE_ENV = production
 VITE_APP_BASE_API = '/prod-api'
 
 # VITE_API_URL=https://coupon.qiuyutech.com.cn/prod-api
-VITE_API_URL=https://test-coupon.qiuyutech.com.cn/stage-api
+VITE_API_URL=https://coupon.qiuyutech.com.cn/prod-api

+ 16 - 9
src/pages/index/index.vue

@@ -38,6 +38,8 @@
 <script setup lang="ts">
 import { onLoad, onShow } from "@dcloudio/uni-app";
 import { getCarousel, getOpenId } from "@/services/ams";
+import { getBrand } from "@/services/claim";
+
 import { ref } from "vue";
 // import { useInfoStore } from "@/store/info";
 import { getActivityData, isGetPhone } from "@/utils/system";
@@ -98,15 +100,6 @@ 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;
     path.value = "/pagesOne/claim/apply";
@@ -117,9 +110,23 @@ const toClaim = () => {
   }
 };
 
+const getBrandId = () => {
+  getBrand(appid).then((res: any) => {
+    if (res.code === 200) {
+      uni.setStorageSync("brandId", res?.data?.brandId || "");
+    } else {
+      uni.showToast({
+        title: "获取品牌ID失败",
+        icon: "none",
+      });
+    }
+  });
+};
+
 onLoad(() => {
   onLogin();
   getBanner();
+  getBrandId();
 });
 
 onShow(() => {

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

@@ -20,8 +20,9 @@ import { quickclaimSubmit } from "@/services/claim";
 const aData = JSON.parse(uni.getStorageSync("activityData"));
 const phone = uni.getStorageSync("phone");
 const openid = uni.getStorageSync("openid");
+const brandId = uni.getStorageSync("brandId");
 const queryParams: Claim = reactive({
-  brandId: aData.brandId,
+  brandId: brandId || aData?.brandId,
   mobile: phone,
   openid: openid,
   paymentBillImage: "",

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

@@ -142,7 +142,6 @@ 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);

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

@@ -78,8 +78,8 @@ const onAdd = () => {
     mobile: phone,
     latitude: location.latitude || "",
     longitude: location.longitude || "",
-    discountId: routerInfo.discountId,
-    discountLevel: routerInfo.discountLevel,
+    discountId: routerInfo.discountId || "",
+    discountLevel: routerInfo.discountLevel || "",
     receiptImages: imgList.value.join(","),
     marketingActivityId: aData.id,
     brandId: aData.brandId,

+ 8 - 0
src/services/claim.ts

@@ -51,3 +51,11 @@ export const claimPayment = (data: any) => {
     data,
   });
 };
+
+//获取品牌id
+export const getBrand = (data: any) => {
+  return http({
+    method: "GET",
+    url: `/miniApp/getBrand/${data}`,
+  });
+};