Эх сурвалжийг харах

Merge branch 'dev' of http://39.101.143.165:8090/haiyang/couponCenter_mpapp into dev

haiyang 2 долоо хоног өмнө
parent
commit
7d8311c267

+ 9 - 0
src/api/receiveCoupon.ts

@@ -55,3 +55,12 @@ export function getWxQcCode(params) {
         }
     })
 }
+
+//标记分享成功接口
+export function markSuccess(shareId: string) {
+    return http.Get('/couponCenter/APP/shareRecord/markSuccess', {
+        params: {
+            shareId: shareId,
+        }
+    })
+}

+ 6 - 1
src/hooks/useShare.ts

@@ -1,8 +1,10 @@
 import { getIssuerDetail, getShareInfo } from '@/api/home'
+import { markSuccess } from '@/api/receiveCoupon'
 import { useTokenStore } from '@/store/token'
 import { useUserStore } from '@/store/user'
 import { getImageUrl } from '@/utils/imageUtil'
 
+
 /**
  * 分享配置选项
  */
@@ -109,6 +111,7 @@ export function useShare(initOptions: ShareOptions = {}) {
                     imageUrl,
                     success: (res) => {
                         console.log('分享成功', res)
+                        markSuccess(res)
                     },
                 }
             }
@@ -142,8 +145,10 @@ export function useShare(initOptions: ShareOptions = {}) {
             title: config.title,
             path: config.path,
             imageUrl: config.imageUrl,
-            success: (res) => {
+            success: async(res) => {
                 console.log('分享到朋友圈成功', res)
+                //-------这里掉大哥的方法--------------------------------
+                await markSuccess(res)
             },
         }
     }

+ 2 - 2
src/pages/my/my.vue

@@ -42,7 +42,7 @@ onShow(async () => {
     console.log('登录判断:', hasLogin.value)
     // 登录后查询收益数据
     if (hasLogin.value) {
-        await getCouponSituationRequest({ logo: 'time' })
+        await getCouponSituationRequest({ queryType: 'time' })
         await getShareStateRequest()
         deadline.value = Date.now()
         await getCouponIssuerApplyByIdRequest()
@@ -126,7 +126,7 @@ function menuClick(page) {
 async function onRefresh() {
     refreshing.value = true
     await userStore.fetchUserInfo()
-    await getCouponSituationRequest({ logo: 'time' })
+    await getCouponSituationRequest({ queryType: 'time' })
     await getShareStateRequest()
     deadline.value = Date.now()
     refreshing.value = false